@azure/communication-react 1.14.0-alpha-202403160012 → 1.14.0-alpha-202403200012

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 (133) hide show
  1. package/dist/communication-react.d.ts +14 -14
  2. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BCdGFyar.js → RichTextSendBoxWrapper-DRoOTcxC.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BCdGFyar.js.map → RichTextSendBoxWrapper-DRoOTcxC.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{index-BfFCLrEO.js → index-CeYIHxFb.js} +695 -542
  5. package/dist/dist-cjs/communication-react/index-CeYIHxFb.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/index.js +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +2 -2
  10. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +2 -2
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  13. package/dist/dist-esm/calling-component-bindings/src/hooks/useSelector.d.ts +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +14 -12
  16. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +2 -0
  18. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  19. package/dist/dist-esm/chat-component-bindings/src/hooks/useSelector.d.ts +1 -1
  20. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +1 -1
  21. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
  22. package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js +1 -1
  23. package/dist/dist-esm/chat-stateful-client/src/ResourceDownloadQueue.js.map +1 -1
  24. package/dist/dist-esm/chat-stateful-client/src/iterators/createDecoratedIterator.d.ts +2 -2
  25. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  26. package/dist/dist-esm/communication-react/src/mergedHooks.d.ts +1 -1
  27. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +12 -3
  28. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +46 -0
  30. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +91 -0
  31. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -0
  32. package/dist/dist-esm/react-components/src/components/ChatMessage/{FluentChatMessageComponentWrapper.d.ts → MessageComponents/FluentChatMessageComponent.d.ts} +6 -7
  33. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +122 -0
  34. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -0
  35. package/dist/dist-esm/react-components/src/components/ChatMessage/{ChatMessageComponent.d.ts → MyMessageComponents/ChatMyMessageComponent.d.ts} +9 -9
  36. package/dist/dist-esm/react-components/src/components/ChatMessage/{ChatMessageComponent.js → MyMessageComponents/ChatMyMessageComponent.js} +5 -5
  37. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -0
  38. package/dist/dist-esm/react-components/src/components/ChatMessage/{ChatMessageComponentAsMessageBubble.d.ts → MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts} +10 -19
  39. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +162 -0
  40. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -0
  41. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.d.ts +12 -0
  42. package/dist/dist-esm/react-components/src/components/ChatMessage/{FluentChatMessageComponentWrapper.js → MyMessageComponents/FluentChatMyMessageComponent.js} +12 -54
  43. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -0
  44. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -4
  45. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +3 -3
  47. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +3 -5
  49. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  50. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +3 -5
  51. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
  52. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +3 -1
  53. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +98 -118
  54. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  55. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +6 -6
  56. package/dist/dist-esm/react-components/src/components/VideoGallery.js +3 -7
  57. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  58. package/dist/dist-esm/react-components/src/components/VideoTile.js +1 -1
  59. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  60. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  61. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.d.ts +0 -1
  62. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js +1 -1
  63. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js.map +1 -1
  64. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +29 -0
  65. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +92 -0
  66. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -0
  67. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.d.ts +2 -3
  68. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js +2 -2
  69. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js +5 -3
  71. package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js.map +1 -1
  72. package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -1
  73. package/dist/dist-esm/react-components/src/theming/icons.js +1 -1
  74. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  75. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  76. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +5 -5
  77. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  78. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +5 -5
  79. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  80. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +1 -1
  81. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  82. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +2 -7
  83. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  84. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +2 -2
  85. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +10 -12
  86. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  87. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.d.ts +2 -2
  88. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +18 -18
  89. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  90. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.d.ts +1 -1
  91. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useSelector.d.ts +1 -1
  92. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  93. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +1 -3
  94. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  95. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.d.ts +3 -3
  96. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js +4 -7
  97. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js.map +1 -1
  98. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +1 -5
  99. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  100. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -4
  101. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  102. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +4 -4
  103. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  104. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useAdaptedSelector.d.ts +2 -2
  105. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.d.ts +1 -1
  106. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -1
  107. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +5 -5
  108. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +5 -5
  109. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +5 -5
  110. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +5 -5
  111. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +5 -5
  112. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +5 -5
  113. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +5 -5
  114. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +5 -5
  115. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +5 -5
  116. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +5 -5
  117. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +5 -5
  118. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +5 -5
  119. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +5 -5
  120. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +5 -5
  121. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +5 -5
  122. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +5 -5
  123. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +5 -5
  124. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +5 -5
  125. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +5 -5
  126. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +5 -5
  127. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +5 -5
  128. package/package.json +3 -5
  129. package/dist/dist-cjs/communication-react/index-BfFCLrEO.js.map +0 -1
  130. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +0 -1
  131. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +0 -218
  132. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +0 -1
  133. package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AzureCommunicationCallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAqDlC,OAAO,EACL,yCAAyC,EAEzC,iDAAiD,EACjD,iDAAiD,EAClD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yCAAyC,EACzC,6CAA6C,EAC9C,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,6CAA6C;AAC7C,OAAO,EAEL,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAM7D,OAAO,EAAE,yCAAyC,EAAE,MAAM,2DAA2D,CAAC;AAEtH,OAAO,EAEL,6CAA6C,EAC9C,MAAM,2DAA2D,CAAC;AAInE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAA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AAC;oBACrD,CAAC;oBACD,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;oBAC7B,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;gBACjC,CAAC;YACH,CAAC,CAAA,CAAC,EAAE,CAAC;QACP,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAiBF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,sDAAsD,GAAG,CAAO,EAC3E,UAAU,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,gBAAgB;AAChB,2DAA2D;AAC3D,kBAAkB,EACkC,EAAgC,EAAE;IACtF,MAAM,wBAAwB,GAAG,6CAA6C,CAC5E,UAAU,EACV,SAAS,EACT,WAAW;IACX,2DAA2D;IAC3D,kBAAkB,CACnB,CAAC;IACF,MAAM,wBAAwB,GAAG,6CAA6C,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAC7G,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAC3G,OAAO,IAAI,qCAAqC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7E,CAAC,CAAA,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wDAAwD,GAAG,CACtE,WAAwB,EACxB,WAAwB,EACH,EAAE,CAAC,IAAI,qCAAqC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE9F,MAAM,yBAAyB,GAAG,CAChC,OAAqD,EACjB,EAAE;IACtC,OAAO,aAAa,IAAI,OAAO,CAAC;AAClC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n\nimport {\n AudioDeviceInfo,\n Call,\n CallAgent,\n GroupCallLocator,\n PermissionConstraints,\n PropertyChangedEvent,\n TeamsMeetingLinkLocator,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(close-captions) */\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing) */\nimport { AttachmentMetadata } from '@internal/react-components';\nimport {\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n IsMutedChangedListener,\n CallIdChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n DisplayNameChangedListener,\n IsSpeakingChangedListener,\n CallAdapter,\n CallAdapterState,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageReceivedListener,\n MessageReadListener,\n ChatAdapter,\n ChatAdapterState,\n ParticipantsRemovedListener,\n ParticipantsAddedListener,\n MessageEditedListener,\n MessageDeletedListener\n} from '../../ChatComposite';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ResourceDetails } from '../../ChatComposite';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadManager } from '../../ChatComposite';\nimport { CallWithChatAdapter, CallWithChatEvent } from './CallWithChatAdapter';\nimport {\n callWithChatAdapterStateFromBackingStates,\n CallWithChatAdapterState,\n mergeCallAdapterStateIntoCallWithChatAdapterState,\n mergeChatAdapterStateIntoCallWithChatAdapterState\n} from '../state/CallWithChatAdapterState';\nimport {\n _createAzureCommunicationChatAdapterInner,\n createAzureCommunicationChatAdapterFromClient\n} from '../../ChatComposite/adapter/AzureCommunicationChatAdapter';\nimport { EventEmitter } from 'events';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { getChatThreadFromTeamsLink } from './parseTeamsUrl';\nimport { AdapterError } from '../../common/adapters';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { CallParticipantsLocator } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport { _createAzureCommunicationCallAdapterInner } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport {\n CallAdapterLocator,\n createAzureCommunicationCallAdapterFromClient\n} from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\nimport { StatefulCallClient } from '@internal/calling-stateful-client';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\nimport { ChatThreadClient } from '@azure/communication-chat';\nimport { useEffect, useRef, useState } from 'react';\nimport { _toCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { JoinCallOptions, StartCallIdentifier } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(video-background-effects) */\nimport { AzureCommunicationCallAdapterOptions } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n/* @conditional-compile-remove(close-captions) */\nimport {\n IsCaptionsActiveChangedListener,\n CaptionsReceivedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(capabilities) */\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(spotlight) */\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\ntype CallWithChatAdapterStateChangedHandler = (newState: CallWithChatAdapterState) => void;\n\n/** Context of Call with Chat, which is a centralized context for all state updates */\nclass CallWithChatContext {\n private emitter = new EventEmitter();\n private state: CallWithChatAdapterState;\n\n constructor(clientState: CallWithChatAdapterState, maxListeners = 50) {\n this.state = clientState;\n this.emitter.setMaxListeners(maxListeners);\n }\n\n public onStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: CallWithChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): CallWithChatAdapterState {\n return this.state;\n }\n\n public updateClientState(clientState: CallWithChatAdapterState): void {\n this.setState(clientState);\n }\n\n public updateClientStateWithChatState(chatAdapterState: ChatAdapterState): void {\n this.updateClientState(mergeChatAdapterStateIntoCallWithChatAdapterState(this.state, chatAdapterState));\n }\n\n public updateClientStateWithCallState(callAdapterState: CallAdapterState): void {\n this.updateClientState(mergeCallAdapterStateIntoCallWithChatAdapterState(this.state, callAdapterState));\n }\n}\n\n/**\n * CallWithChat adapter backed by Azure Communication Services.\n * Created for easy use with the {@link CallWithChatComposite}.\n */\nexport class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapter {\n private callAdapter: CallAdapter;\n private chatAdapter: ChatAdapter;\n private context: CallWithChatContext;\n private onChatStateChange: (newChatAdapterState: ChatAdapterState) => void;\n private onCallStateChange: (newChatAdapterState: CallAdapterState) => void;\n\n constructor(callAdapter: CallAdapter, chatAdapter: ChatAdapter) {\n this.bindPublicMethods();\n this.callAdapter = callAdapter;\n this.chatAdapter = chatAdapter;\n this.context = new CallWithChatContext(callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter));\n\n const onChatStateChange = (newChatAdapterState: ChatAdapterState): void => {\n this.context.updateClientStateWithChatState(newChatAdapterState);\n };\n this.chatAdapter.onStateChange(onChatStateChange);\n this.onChatStateChange = onChatStateChange;\n\n const onCallStateChange = (newCallAdapterState: CallAdapterState): void => {\n this.context.updateClientStateWithCallState(newCallAdapterState);\n };\n this.callAdapter.onStateChange(onCallStateChange);\n this.onCallStateChange = onCallStateChange;\n }\n\n private bindPublicMethods(): void {\n this.joinCall.bind(this);\n this.leaveCall.bind(this);\n this.startCall.bind(this);\n this.onStateChange.bind(this);\n this.offStateChange.bind(this);\n this.getState.bind(this);\n this.dispose.bind(this);\n this.setCamera.bind(this);\n this.setMicrophone.bind(this);\n this.setSpeaker.bind(this);\n this.askDevicePermission.bind(this);\n this.queryCameras.bind(this);\n this.queryMicrophones.bind(this);\n this.querySpeakers.bind(this);\n this.startCamera.bind(this);\n this.stopCamera.bind(this);\n this.mute.bind(this);\n this.unmute.bind(this);\n this.startScreenShare.bind(this);\n this.stopScreenShare.bind(this);\n this.raiseHand.bind(this);\n this.lowerHand.bind(this);\n /* @conditional-compile-remove(reaction) */\n this.onReactionClick.bind(this);\n this.removeParticipant.bind(this);\n this.createStreamView.bind(this);\n this.disposeStreamView.bind(this);\n this.disposeScreenShareStreamView.bind(this);\n this.fetchInitialData.bind(this);\n this.sendMessage.bind(this);\n this.sendReadReceipt.bind(this);\n this.sendTypingIndicator.bind(this);\n this.loadPreviousChatMessages.bind(this);\n this.updateMessage.bind(this);\n this.deleteMessage.bind(this);\n this.on.bind(this);\n this.off.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.clearFileUploads = this.clearFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.cancelFileUpload = this.cancelFileUpload.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.holdCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.resumeCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.addParticipant.bind(this);\n this.sendDtmfTone.bind(this);\n /* @conditional-compile-remove(unsupported-browser) */\n this.allowUnsupportedBrowserVersion.bind(this);\n /* @conditional-compile-remove(close-captions) */ {\n this.startCaptions.bind(this);\n this.stopCaptions.bind(this);\n this.setSpokenLanguage.bind(this);\n this.setCaptionLanguage.bind(this);\n }\n /* @conditional-compile-remove(video-background-effects) */\n this.startVideoBackgroundEffect.bind(this);\n /* @conditional-compile-remove(video-background-effects) */\n this.stopVideoBackgroundEffects.bind(this);\n /* @conditional-compile-remove(video-background-effects) */\n this.updateBackgroundPickerImages.bind(this);\n }\n\n /** Join existing Call. */\n public joinCall(options?: boolean | JoinCallOptions): Call | undefined {\n if (typeof options === 'boolean') {\n return this.callAdapter.joinCall(options);\n } else {\n return this.callAdapter.joinCall(options);\n }\n }\n /** Leave current Call. */\n public async leaveCall(forEveryone?: boolean): Promise<void> {\n // Only remove self from the GroupCall. Contoso must manage access to Chat.\n await this.callAdapter.leaveCall(forEveryone);\n }\n\n /** Start a new Call. */\n public startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: StartCallIdentifier[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: string[] | StartCallIdentifier[], options?: StartCallOptions): Call | undefined {\n if (participants.length === 0) {\n throw new Error('At least one participant is required to start a call');\n }\n if (typeof participants[0] === 'string') {\n return this.callAdapter.startCall(participants as string[], options);\n } else {\n return this.callAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n }\n /**\n * Subscribe to state change events.\n * @param handler - handler to be called when the state changes. This is passed the new state.\n */\n public onStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n /**\n * Unsubscribe to state change events.\n * @param handler - handler to be no longer called when state changes.\n */\n public offStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n /** Get current Call and Chat state. */\n public getState(): CallWithChatAdapterState {\n return this.context.getState();\n }\n /** Dispose of the current CallWithChatAdapter. */\n public dispose(): void {\n this.chatAdapter.offStateChange(this.onChatStateChange);\n this.callAdapter.offStateChange(this.onCallStateChange);\n\n this.chatAdapter.dispose();\n this.callAdapter.dispose();\n }\n /** Remove a participant from the Call only. */\n public async removeParticipant(\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n await this.callAdapter.removeParticipant(participant);\n }\n public async setCamera(device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.setCamera(device, options);\n }\n /** Set the microphone to be used in the Call. */\n public async setMicrophone(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setMicrophone(device);\n }\n /** Set the speaker to be used in the Call. */\n public async setSpeaker(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setSpeaker(device);\n }\n public async askDevicePermission(constraints: PermissionConstraints): Promise<void> {\n await this.callAdapter.askDevicePermission(constraints);\n }\n /** Query for available cameras. */\n public async queryCameras(): Promise<VideoDeviceInfo[]> {\n return await this.callAdapter.queryCameras();\n }\n /** Query for available microphones. */\n public async queryMicrophones(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.queryMicrophones();\n }\n /** Query for available speakers. */\n public async querySpeakers(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.querySpeakers();\n }\n /** Start the camera for the user in the Call. */\n public async startCamera(options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.startCamera(options);\n }\n /** Stop the camera for the user in the Call. */\n public async stopCamera(): Promise<void> {\n await this.callAdapter.stopCamera();\n }\n /** Mute the user in the Call. */\n public async mute(): Promise<void> {\n await this.callAdapter.mute();\n }\n /** Unmute the user in the Call. */\n public async unmute(): Promise<void> {\n await this.callAdapter.unmute();\n }\n /** Trigger the user to start screen share. */\n public async startScreenShare(): Promise<void> {\n await this.callAdapter.startScreenShare();\n }\n /** Stop the current active screen share. */\n public async stopScreenShare(): Promise<void> {\n await this.callAdapter.stopScreenShare();\n }\n /** Raise hand for local user. */\n public async raiseHand(): Promise<void> {\n await this.callAdapter.raiseHand();\n }\n /** Lower hand for local user. */\n public async lowerHand(): Promise<void> {\n await this.callAdapter.lowerHand();\n }\n /* @conditional-compile-remove(reaction) */\n public async onReactionClick(reaction: Reaction): Promise<void> {\n await this.callAdapter.onReactionClick(reaction);\n }\n /** Create a stream view for a remote participants video feed. */\n public async createStreamView(\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> {\n return await this.callAdapter.createStreamView(remoteUserId, options);\n }\n /** Dispose of a created stream view of a remote participants video feed. */\n public async disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.disposeStreamView(remoteUserId, options);\n }\n /** Dispose of a remote screen share */\n public async disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n /** Dispose of a remote video stream */\n public async disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n /** Dispose of the local video stream */\n public async disposeLocalVideoStreamView(): Promise<void> {\n await this.callAdapter.disposeLocalVideoStreamView();\n }\n /** Fetch initial Call and Chat data such as chat messages. */\n public async fetchInitialData(): Promise<void> {\n await this.chatAdapter.fetchInitialData();\n }\n /** Send a chat message. */\n public async sendMessage(content: string): Promise<void> {\n await this.chatAdapter.sendMessage(content);\n }\n /** Send a chat read receipt. */\n public async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.chatAdapter.sendReadReceipt(chatMessageId);\n }\n /** Send an isTyping indicator. */\n public async sendTypingIndicator(): Promise<void> {\n await this.chatAdapter.sendTypingIndicator();\n }\n /** Load previous Chat messages. */\n public async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.chatAdapter.loadPreviousChatMessages(messagesToLoad);\n }\n /** Update an existing message. */\n public async updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(file-sharing) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void> {\n return await this.chatAdapter.updateMessage(\n messageId,\n content,\n metadata,\n /* @conditional-compile-remove(file-sharing) */ options\n );\n }\n /** Delete an existing message. */\n public async deleteMessage(messageId: string): Promise<void> {\n return await this.chatAdapter.deleteMessage(messageId);\n }\n /* @conditional-compile-remove(file-sharing) */\n public registerActiveFileUploads = (files: File[]): FileUploadManager[] => {\n return this.chatAdapter.registerActiveFileUploads(files);\n };\n /* @conditional-compile-remove(file-sharing) */\n public registerCompletedFileUploads = (metadata: AttachmentMetadata[]): FileUploadManager[] => {\n return this.chatAdapter.registerCompletedFileUploads(metadata);\n };\n /* @conditional-compile-remove(file-sharing) */\n public clearFileUploads = (): void => {\n this.chatAdapter.clearFileUploads();\n };\n /* @conditional-compile-remove(file-sharing) */\n public cancelFileUpload = (id: string): void => {\n this.chatAdapter.cancelFileUpload(id);\n };\n /* @conditional-compile-remove(file-sharing) */\n public updateFileUploadProgress = (id: string, progress: number): void => {\n this.chatAdapter.updateFileUploadProgress(id, progress);\n };\n /* @conditional-compile-remove(file-sharing) */\n public updateFileUploadErrorMessage = (id: string, errorMessage: string): void => {\n this.chatAdapter.updateFileUploadErrorMessage(id, errorMessage);\n };\n /* @conditional-compile-remove(file-sharing) */\n public updateFileUploadMetadata = (id: string, metadata: AttachmentMetadata): void => {\n this.chatAdapter.updateFileUploadMetadata(id, metadata);\n };\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n public async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatAdapter.downloadResourceToCache(resourceDetails);\n }\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n public removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatAdapter.removeResourceFromCache(resourceDetails);\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async holdCall(): Promise<void> {\n return await this.callAdapter.holdCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async resumeCall(): Promise<void> {\n return await this.callAdapter.resumeCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isCommunicationUserIdentifier(participant)) {\n return await this.callAdapter.addParticipant(participant);\n } else {\n return await this.callAdapter.addParticipant(participant, options);\n }\n }\n\n public async sendDtmfTone(dtmfTone: DtmfTone): Promise<void> {\n return await this.callAdapter.sendDtmfTone(dtmfTone);\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callAdapter.allowUnsupportedBrowserVersion();\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async startCaptions(options?: StartCaptionsOptions): Promise<void> {\n await this.callAdapter.startCaptions(options);\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async stopCaptions(): Promise<void> {\n await this.callAdapter.stopCaptions();\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async setCaptionLanguage(language: string): Promise<void> {\n await this.callAdapter.setCaptionLanguage(language);\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async setSpokenLanguage(language: string): Promise<void> {\n await this.callAdapter.setSpokenLanguage(language);\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public async stopVideoBackgroundEffects(): Promise<void> {\n return await this.callAdapter.stopVideoBackgroundEffects();\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n /* @conditional-compile-remove(end-of-call-survey) */\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callAdapter.submitSurvey(survey);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.startSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.stopSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopAllSpotlight(): Promise<void> {\n return this.callAdapter.stopAllSpotlight();\n }\n\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n /* @conditional-compile-remove(capabilities) */\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: CallWithChatEvent, listener: any): void {\n switch (event) {\n case 'callParticipantsJoined':\n this.callAdapter.on('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.on('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.on('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.on('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.on('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.on('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.on('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.on('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.on('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.on('selectedSpeakerChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'captionsReceived':\n this.callAdapter.on('captionsReceived', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionsActiveChanged':\n this.callAdapter.on('isCaptionsActiveChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionLanguageChanged':\n this.callAdapter.on('isCaptionLanguageChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isSpokenLanguageChanged':\n this.callAdapter.on('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.chatAdapter.on('messageReceived', listener);\n break;\n case 'messageEdited':\n this.chatAdapter.on('messageEdited', listener);\n break;\n case 'messageDeleted':\n this.chatAdapter.on('messageDeleted', listener);\n break;\n case 'messageSent':\n this.chatAdapter.on('messageSent', listener);\n break;\n case 'messageRead':\n this.chatAdapter.on('messageRead', listener);\n break;\n case 'chatParticipantsAdded':\n this.chatAdapter.on('participantsAdded', listener);\n break;\n case 'chatParticipantsRemoved':\n this.chatAdapter.on('participantsRemoved', listener);\n break;\n case 'callError':\n this.callAdapter.on('error', listener);\n break;\n case 'chatError':\n this.chatAdapter.on('error', listener);\n break;\n\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n /* @conditional-compile-remove(capabilities) */\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: CallWithChatEvent, listener: any): void {\n switch (event as unknown) {\n case 'callParticipantsJoined':\n this.callAdapter.off('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.off('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.off('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.off('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.off('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.off('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.off('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.off('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.off('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.off('selectedSpeakerChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'captionsReceived':\n this.callAdapter.off('captionsReceived', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionsActiveChanged':\n this.callAdapter.off('isCaptionsActiveChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionLanguageChanged':\n this.callAdapter.off('isCaptionLanguageChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isSpokenLanguageChanged':\n this.callAdapter.off('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.chatAdapter.off('messageReceived', listener);\n break;\n case 'messageEdited':\n this.chatAdapter.off('messageEdited', listener);\n break;\n case 'messageDeleted':\n this.chatAdapter.off('messageDeleted', listener);\n break;\n case 'messageSent':\n this.chatAdapter.off('messageSent', listener);\n break;\n case 'messageRead':\n this.chatAdapter.off('messageRead', listener);\n break;\n case 'chatParticipantsAdded':\n this.chatAdapter.off('participantsAdded', listener);\n break;\n case 'chatParticipantsRemoved':\n this.chatAdapter.off('participantsRemoved', listener);\n break;\n case 'callError':\n this.callAdapter.off('error', listener);\n break;\n case 'chatError':\n this.chatAdapter.off('error', listener);\n break;\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n}\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Call with an associated Chat thread.\n *\n * @public\n */\nexport interface CallAndChatLocator {\n /** Locator used by {@link createAzureCommunicationCallWithChatAdapter} to locate the call to join */\n callLocator: GroupCallLocator | /* @conditional-compile-remove(teams-adhoc-call) */ CallParticipantsLocator;\n /** Chat thread ID used by {@link createAzureCommunicationCallWithChatAdapter} to locate the chat thread to join */\n chatThreadId: string;\n}\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapter}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n locator: CallAndChatLocator | TeamsMeetingLinkLocator;\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId?: string;\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a CallWithChatAdapter backed by Azure Communication services\n * to plug into the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapter = async ({\n userId,\n displayName,\n credential,\n endpoint,\n locator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterArgs): Promise<CallWithChatAdapter> => {\n const callAdapterLocator = isTeamsMeetingLinkLocator(locator) ? locator : locator.callLocator;\n const createCallAdapterPromise = _createAzureCommunicationCallAdapterInner({\n userId,\n displayName,\n credential,\n locator: callAdapterLocator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ options: callAdapterOptions,\n telemetryImplementationHint: 'CallWithChat' as _TelemetryImplementationHint\n });\n\n const threadId = isTeamsMeetingLinkLocator(locator)\n ? getChatThreadFromTeamsLink(locator.meetingLink)\n : locator.chatThreadId;\n const createChatAdapterPromise = _createAzureCommunicationChatAdapterInner(\n endpoint,\n userId,\n displayName,\n credential,\n threadId,\n 'CallWithChat' as _TelemetryImplementationHint\n );\n\n const [callAdapter, chatAdapter] = await Promise.all([createCallAdapterPromise, createChatAdapterPromise]);\n return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n};\n\n/**\n * A custom React hook to simplify the creation of {@link CallWithChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationCallWithChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationCallWithChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationCallWithChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationCallWithChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: CallWithChatAdapter) => Promise<void>\n): CallWithChatAdapter | undefined => {\n const {\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<CallWithChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<CallWithChatAdapter | undefined>(undefined);\n const creatingAdapterRef = useRef<boolean>(false);\n\n const afterCreateRef = useRef<((adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>) | undefined>(\n undefined\n );\n const beforeDisposeRef = useRef<((adapter: CallWithChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !locator || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n if (creatingAdapterRef.current) {\n console.warn(\n 'Adapter is already being created, please see storybook for more information: https://azure.github.io/communication-ui-library/?path=/story/troubleshooting--page'\n );\n return;\n }\n creatingAdapterRef.current = true;\n let newAdapter = await createAzureCommunicationCallWithChatAdapter({\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [\n adapterRef,\n afterCreateRef,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n beforeDisposeRef,\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n ]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapterFromClient}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterFromClientArgs = {\n callLocator: CallAdapterLocator | TeamsMeetingLinkLocator;\n callAgent: CallAgent;\n callClient: StatefulCallClient;\n chatClient: StatefulChatClient;\n chatThreadClient: ChatThreadClient;\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a {@link CallWithChatAdapter} using the provided {@link StatefulChatClient} and {@link StatefulCallClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient} and {@link StatefulCallClient}.\n * Please note that chatThreadClient has to be created by StatefulChatClient via chatClient.getChatThreadClient(chatThreadId) API.\n * Consider using {@link createAzureCommunicationCallWithChatAdapter} for a simpler API.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapterFromClients = async ({\n callClient,\n callAgent,\n callLocator,\n chatClient,\n chatThreadClient,\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise<CallWithChatAdapter> => {\n const createCallAdapterPromise = createAzureCommunicationCallAdapterFromClient(\n callClient,\n callAgent,\n callLocator,\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions\n );\n const createChatAdapterPromise = createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n const [callAdapter, chatAdapter] = await Promise.all([createCallAdapterPromise, createChatAdapterPromise]);\n return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n};\n\n/**\n * Create a {@link CallWithChatAdapter} from the underlying adapters.\n *\n * This is an internal factory function used by browser tests to inject fake adapters for call and chat.\n *\n * @internal\n */\nexport const _createAzureCommunicationCallWithChatAdapterFromAdapters = (\n callAdapter: CallAdapter,\n chatAdapter: ChatAdapter\n): CallWithChatAdapter => new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n\nconst isTeamsMeetingLinkLocator = (\n locator: CallAndChatLocator | TeamsMeetingLinkLocator\n): locator is TeamsMeetingLinkLocator => {\n return 'meetingLink' in locator;\n};\n"]}
1
+ {"version":3,"file":"AzureCommunicationCallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAqDlC,OAAO,EACL,yCAAyC,EAEzC,iDAAiD,EACjD,iDAAiD,EAClD,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,yCAAyC,EACzC,6CAA6C,EAC9C,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,6CAA6C;AAC7C,OAAO,EAEL,6BAA6B,EAE9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAM7D,OAAO,EAAE,yCAAyC,EAAE,MAAM,2DAA2D,CAAC;AAEtH,OAAO,EAEL,6CAA6C,EAC9C,MAAM,2DAA2D,CAAC;AAInE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,0BAA0B,EAAgC,yCAAgC;AAsBnG,sFAAsF;AACtF,MAAM,mBAAmB;IAIvB,YAAY,WAAqC,EAAE,YAAY,GAAG,EAAE;QAH5D,YAAO,GAAG,IAAI,YAAY,EAAE,CAAC;QAInC,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;QACzB,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAEM,aAAa,CAAC,OAA+C;QAClE,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC;IAEM,cAAc,CAAC,OAA+C;QACnE,IAAI,CAAC,OAAO,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wB,GAAG,6CAA6C,CAC5E,UAAU,EACV,SAAS,EACT,WAAW;IACX,2DAA2D;IAC3D,kBAAkB,CACnB,CAAC;IACF,MAAM,wBAAwB,GAAG,6CAA6C,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAC7G,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAC3G,OAAO,IAAI,qCAAqC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAC7E,CAAC,CAAA,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wDAAwD,GAAG,CACtE,WAAwB,EACxB,WAAwB,EACH,EAAE,CAAC,IAAI,qCAAqC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAE9F,MAAM,yBAAyB,GAAG,CAChC,OAAqD,EACjB,EAAE;IACtC,OAAO,aAAa,IAAI,OAAO,CAAC;AAClC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ // REMOVE ONCE THIS FILE IS IMPLEMENTED\n\nimport {\n AudioDeviceInfo,\n Call,\n CallAgent,\n GroupCallLocator,\n PermissionConstraints,\n PropertyChangedEvent,\n TeamsMeetingLinkLocator,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(close-captions) */\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing) */\nimport { AttachmentMetadata } from '@internal/react-components';\nimport {\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n IsMutedChangedListener,\n CallIdChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n DisplayNameChangedListener,\n IsSpeakingChangedListener,\n CallAdapter,\n CallAdapterState,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageReceivedListener,\n MessageReadListener,\n ChatAdapter,\n ChatAdapterState,\n ParticipantsRemovedListener,\n ParticipantsAddedListener,\n MessageEditedListener,\n MessageDeletedListener\n} from '../../ChatComposite';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ResourceDetails } from '../../ChatComposite';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadManager } from '../../ChatComposite';\nimport { CallWithChatAdapter, CallWithChatEvent } from './CallWithChatAdapter';\nimport {\n callWithChatAdapterStateFromBackingStates,\n CallWithChatAdapterState,\n mergeCallAdapterStateIntoCallWithChatAdapterState,\n mergeChatAdapterStateIntoCallWithChatAdapterState\n} from '../state/CallWithChatAdapterState';\nimport {\n _createAzureCommunicationChatAdapterInner,\n createAzureCommunicationChatAdapterFromClient\n} from '../../ChatComposite/adapter/AzureCommunicationChatAdapter';\nimport { EventEmitter } from 'events';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { getChatThreadFromTeamsLink } from './parseTeamsUrl';\nimport { AdapterError } from '../../common/adapters';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { CallParticipantsLocator } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport { _createAzureCommunicationCallAdapterInner } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n\nimport {\n CallAdapterLocator,\n createAzureCommunicationCallAdapterFromClient\n} from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\nimport { StatefulCallClient } from '@internal/calling-stateful-client';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\nimport { ChatThreadClient } from '@azure/communication-chat';\nimport { useEffect, useRef, useState } from 'react';\nimport { _toCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { JoinCallOptions, StartCallIdentifier } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(video-background-effects) */\nimport { AzureCommunicationCallAdapterOptions } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';\n/* @conditional-compile-remove(close-captions) */\nimport {\n IsCaptionsActiveChangedListener,\n CaptionsReceivedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(capabilities) */\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(spotlight) */\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\ntype CallWithChatAdapterStateChangedHandler = (newState: CallWithChatAdapterState) => void;\n\n/** Context of Call with Chat, which is a centralized context for all state updates */\nclass CallWithChatContext {\n private emitter = new EventEmitter();\n private state: CallWithChatAdapterState;\n\n constructor(clientState: CallWithChatAdapterState, maxListeners = 50) {\n this.state = clientState;\n this.emitter.setMaxListeners(maxListeners);\n }\n\n public onStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: CallWithChatAdapterStateChangedHandler): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: CallWithChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): CallWithChatAdapterState {\n return this.state;\n }\n\n public updateClientState(clientState: CallWithChatAdapterState): void {\n this.setState(clientState);\n }\n\n public updateClientStateWithChatState(chatAdapterState: ChatAdapterState): void {\n this.updateClientState(mergeChatAdapterStateIntoCallWithChatAdapterState(this.state, chatAdapterState));\n }\n\n public updateClientStateWithCallState(callAdapterState: CallAdapterState): void {\n this.updateClientState(mergeCallAdapterStateIntoCallWithChatAdapterState(this.state, callAdapterState));\n }\n}\n\n/**\n * CallWithChat adapter backed by Azure Communication Services.\n * Created for easy use with the {@link CallWithChatComposite}.\n */\nexport class AzureCommunicationCallWithChatAdapter implements CallWithChatAdapter {\n private callAdapter: CallAdapter;\n private chatAdapter: ChatAdapter;\n private context: CallWithChatContext;\n private onChatStateChange: (newChatAdapterState: ChatAdapterState) => void;\n private onCallStateChange: (newChatAdapterState: CallAdapterState) => void;\n\n constructor(callAdapter: CallAdapter, chatAdapter: ChatAdapter) {\n this.bindPublicMethods();\n this.callAdapter = callAdapter;\n this.chatAdapter = chatAdapter;\n this.context = new CallWithChatContext(callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter));\n\n const onChatStateChange = (newChatAdapterState: ChatAdapterState): void => {\n this.context.updateClientStateWithChatState(newChatAdapterState);\n };\n this.chatAdapter.onStateChange(onChatStateChange);\n this.onChatStateChange = onChatStateChange;\n\n const onCallStateChange = (newCallAdapterState: CallAdapterState): void => {\n this.context.updateClientStateWithCallState(newCallAdapterState);\n };\n this.callAdapter.onStateChange(onCallStateChange);\n this.onCallStateChange = onCallStateChange;\n }\n\n private bindPublicMethods(): void {\n this.joinCall.bind(this);\n this.leaveCall.bind(this);\n this.startCall.bind(this);\n this.onStateChange.bind(this);\n this.offStateChange.bind(this);\n this.getState.bind(this);\n this.dispose.bind(this);\n this.setCamera.bind(this);\n this.setMicrophone.bind(this);\n this.setSpeaker.bind(this);\n this.askDevicePermission.bind(this);\n this.queryCameras.bind(this);\n this.queryMicrophones.bind(this);\n this.querySpeakers.bind(this);\n this.startCamera.bind(this);\n this.stopCamera.bind(this);\n this.mute.bind(this);\n this.unmute.bind(this);\n this.startScreenShare.bind(this);\n this.stopScreenShare.bind(this);\n this.raiseHand.bind(this);\n this.lowerHand.bind(this);\n /* @conditional-compile-remove(reaction) */\n this.onReactionClick.bind(this);\n this.removeParticipant.bind(this);\n this.createStreamView.bind(this);\n this.disposeStreamView.bind(this);\n this.disposeScreenShareStreamView.bind(this);\n this.fetchInitialData.bind(this);\n this.sendMessage.bind(this);\n this.sendReadReceipt.bind(this);\n this.sendTypingIndicator.bind(this);\n this.loadPreviousChatMessages.bind(this);\n this.updateMessage.bind(this);\n this.deleteMessage.bind(this);\n this.on.bind(this);\n this.off.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.clearFileUploads = this.clearFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.cancelFileUpload = this.cancelFileUpload.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.holdCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.resumeCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.addParticipant.bind(this);\n this.sendDtmfTone.bind(this);\n /* @conditional-compile-remove(unsupported-browser) */\n this.allowUnsupportedBrowserVersion.bind(this);\n /* @conditional-compile-remove(close-captions) */ {\n this.startCaptions.bind(this);\n this.stopCaptions.bind(this);\n this.setSpokenLanguage.bind(this);\n this.setCaptionLanguage.bind(this);\n }\n /* @conditional-compile-remove(video-background-effects) */\n this.startVideoBackgroundEffect.bind(this);\n /* @conditional-compile-remove(video-background-effects) */\n this.stopVideoBackgroundEffects.bind(this);\n /* @conditional-compile-remove(video-background-effects) */\n this.updateBackgroundPickerImages.bind(this);\n }\n\n /** Join existing Call. */\n public joinCall(options?: boolean | JoinCallOptions): Call | undefined {\n if (typeof options === 'boolean') {\n return this.callAdapter.joinCall(options);\n } else {\n return this.callAdapter.joinCall(options);\n }\n }\n /** Leave current Call. */\n public async leaveCall(forEveryone?: boolean): Promise<void> {\n // Only remove self from the GroupCall. Contoso must manage access to Chat.\n await this.callAdapter.leaveCall(forEveryone);\n }\n\n /** Start a new Call. */\n public startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: StartCallIdentifier[], options?: StartCallOptions): Call | undefined;\n /** Start a new Call. */\n public startCall(participants: string[] | StartCallIdentifier[], options?: StartCallOptions): Call | undefined {\n if (participants.length === 0) {\n throw new Error('At least one participant is required to start a call');\n }\n if (typeof participants[0] === 'string') {\n return this.callAdapter.startCall(participants as string[], options);\n } else {\n return this.callAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n }\n /**\n * Subscribe to state change events.\n * @param handler - handler to be called when the state changes. This is passed the new state.\n */\n public onStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n /**\n * Unsubscribe to state change events.\n * @param handler - handler to be no longer called when state changes.\n */\n public offStateChange(handler: (state: CallWithChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n /** Get current Call and Chat state. */\n public getState(): CallWithChatAdapterState {\n return this.context.getState();\n }\n /** Dispose of the current CallWithChatAdapter. */\n public dispose(): void {\n this.chatAdapter.offStateChange(this.onChatStateChange);\n this.callAdapter.offStateChange(this.onCallStateChange);\n\n this.chatAdapter.dispose();\n this.callAdapter.dispose();\n }\n /** Remove a participant from the Call only. */\n public async removeParticipant(\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n await this.callAdapter.removeParticipant(participant);\n }\n public async setCamera(device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.setCamera(device, options);\n }\n /** Set the microphone to be used in the Call. */\n public async setMicrophone(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setMicrophone(device);\n }\n /** Set the speaker to be used in the Call. */\n public async setSpeaker(device: AudioDeviceInfo): Promise<void> {\n await this.callAdapter.setSpeaker(device);\n }\n public async askDevicePermission(constraints: PermissionConstraints): Promise<void> {\n await this.callAdapter.askDevicePermission(constraints);\n }\n /** Query for available cameras. */\n public async queryCameras(): Promise<VideoDeviceInfo[]> {\n return await this.callAdapter.queryCameras();\n }\n /** Query for available microphones. */\n public async queryMicrophones(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.queryMicrophones();\n }\n /** Query for available speakers. */\n public async querySpeakers(): Promise<AudioDeviceInfo[]> {\n return await this.callAdapter.querySpeakers();\n }\n /** Start the camera for the user in the Call. */\n public async startCamera(options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.startCamera(options);\n }\n /** Stop the camera for the user in the Call. */\n public async stopCamera(): Promise<void> {\n await this.callAdapter.stopCamera();\n }\n /** Mute the user in the Call. */\n public async mute(): Promise<void> {\n await this.callAdapter.mute();\n }\n /** Unmute the user in the Call. */\n public async unmute(): Promise<void> {\n await this.callAdapter.unmute();\n }\n /** Trigger the user to start screen share. */\n public async startScreenShare(): Promise<void> {\n await this.callAdapter.startScreenShare();\n }\n /** Stop the current active screen share. */\n public async stopScreenShare(): Promise<void> {\n await this.callAdapter.stopScreenShare();\n }\n /** Raise hand for local user. */\n public async raiseHand(): Promise<void> {\n await this.callAdapter.raiseHand();\n }\n /** Lower hand for local user. */\n public async lowerHand(): Promise<void> {\n await this.callAdapter.lowerHand();\n }\n /* @conditional-compile-remove(reaction) */\n public async onReactionClick(reaction: Reaction): Promise<void> {\n await this.callAdapter.onReactionClick(reaction);\n }\n /** Create a stream view for a remote participants video feed. */\n public async createStreamView(\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> {\n return await this.callAdapter.createStreamView(remoteUserId, options);\n }\n /** Dispose of a created stream view of a remote participants video feed. */\n public async disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void> {\n await this.callAdapter.disposeStreamView(remoteUserId, options);\n }\n /** Dispose of a remote screen share */\n public async disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n /** Dispose of a remote video stream */\n public async disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n await this.callAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n /** Dispose of the local video stream */\n public async disposeLocalVideoStreamView(): Promise<void> {\n await this.callAdapter.disposeLocalVideoStreamView();\n }\n /** Fetch initial Call and Chat data such as chat messages. */\n public async fetchInitialData(): Promise<void> {\n await this.chatAdapter.fetchInitialData();\n }\n /** Send a chat message. */\n public async sendMessage(content: string): Promise<void> {\n await this.chatAdapter.sendMessage(content);\n }\n /** Send a chat read receipt. */\n public async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.chatAdapter.sendReadReceipt(chatMessageId);\n }\n /** Send an isTyping indicator. */\n public async sendTypingIndicator(): Promise<void> {\n await this.chatAdapter.sendTypingIndicator();\n }\n /** Load previous Chat messages. */\n public async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.chatAdapter.loadPreviousChatMessages(messagesToLoad);\n }\n /** Update an existing message. */\n public async updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(file-sharing) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void> {\n return await this.chatAdapter.updateMessage(\n messageId,\n content,\n metadata,\n /* @conditional-compile-remove(file-sharing) */ options\n );\n }\n /** Delete an existing message. */\n public async deleteMessage(messageId: string): Promise<void> {\n return await this.chatAdapter.deleteMessage(messageId);\n }\n /* @conditional-compile-remove(file-sharing) */\n public registerActiveFileUploads = (files: File[]): FileUploadManager[] => {\n return this.chatAdapter.registerActiveFileUploads(files);\n };\n /* @conditional-compile-remove(file-sharing) */\n public registerCompletedFileUploads = (metadata: AttachmentMetadata[]): FileUploadManager[] => {\n return this.chatAdapter.registerCompletedFileUploads(metadata);\n };\n /* @conditional-compile-remove(file-sharing) */\n public clearFileUploads = (): void => {\n this.chatAdapter.clearFileUploads();\n };\n /* @conditional-compile-remove(file-sharing) */\n public cancelFileUpload = (id: string): void => {\n this.chatAdapter.cancelFileUpload(id);\n };\n /* @conditional-compile-remove(file-sharing) */\n public updateFileUploadProgress = (id: string, progress: number): void => {\n this.chatAdapter.updateFileUploadProgress(id, progress);\n };\n /* @conditional-compile-remove(file-sharing) */\n public updateFileUploadErrorMessage = (id: string, errorMessage: string): void => {\n this.chatAdapter.updateFileUploadErrorMessage(id, errorMessage);\n };\n /* @conditional-compile-remove(file-sharing) */\n public updateFileUploadMetadata = (id: string, metadata: AttachmentMetadata): void => {\n this.chatAdapter.updateFileUploadMetadata(id, metadata);\n };\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n public async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatAdapter.downloadResourceToCache(resourceDetails);\n }\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n public removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatAdapter.removeResourceFromCache(resourceDetails);\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async holdCall(): Promise<void> {\n return await this.callAdapter.holdCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async resumeCall(): Promise<void> {\n return await this.callAdapter.resumeCall();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isCommunicationUserIdentifier(participant)) {\n return await this.callAdapter.addParticipant(participant);\n } else {\n return await this.callAdapter.addParticipant(participant, options);\n }\n }\n\n public async sendDtmfTone(dtmfTone: DtmfTone): Promise<void> {\n return await this.callAdapter.sendDtmfTone(dtmfTone);\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callAdapter.allowUnsupportedBrowserVersion();\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async startCaptions(options?: StartCaptionsOptions): Promise<void> {\n await this.callAdapter.startCaptions(options);\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async stopCaptions(): Promise<void> {\n await this.callAdapter.stopCaptions();\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async setCaptionLanguage(language: string): Promise<void> {\n await this.callAdapter.setCaptionLanguage(language);\n }\n\n /* @conditional-compile-remove(close-captions) */\n public async setSpokenLanguage(language: string): Promise<void> {\n await this.callAdapter.setSpokenLanguage(language);\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public async stopVideoBackgroundEffects(): Promise<void> {\n return await this.callAdapter.stopVideoBackgroundEffects();\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n /* @conditional-compile-remove(end-of-call-survey) */\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callAdapter.submitSurvey(survey);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.startSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callAdapter.stopSpotlight(userIds);\n }\n\n /* @conditional-compile-remove(spotlight) */\n public async stopAllSpotlight(): Promise<void> {\n return this.callAdapter.stopAllSpotlight();\n }\n\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n /* @conditional-compile-remove(capabilities) */\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: CallWithChatEvent, listener: any): void {\n switch (event) {\n case 'callParticipantsJoined':\n this.callAdapter.on('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.on('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.on('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.on('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.on('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.on('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.on('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.on('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.on('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.on('selectedSpeakerChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'captionsReceived':\n this.callAdapter.on('captionsReceived', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionsActiveChanged':\n this.callAdapter.on('isCaptionsActiveChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionLanguageChanged':\n this.callAdapter.on('isCaptionLanguageChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isSpokenLanguageChanged':\n this.callAdapter.on('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.chatAdapter.on('messageReceived', listener);\n break;\n case 'messageEdited':\n this.chatAdapter.on('messageEdited', listener);\n break;\n case 'messageDeleted':\n this.chatAdapter.on('messageDeleted', listener);\n break;\n case 'messageSent':\n this.chatAdapter.on('messageSent', listener);\n break;\n case 'messageRead':\n this.chatAdapter.on('messageRead', listener);\n break;\n case 'chatParticipantsAdded':\n this.chatAdapter.on('participantsAdded', listener);\n break;\n case 'chatParticipantsRemoved':\n this.chatAdapter.on('participantsRemoved', listener);\n break;\n case 'callError':\n this.callAdapter.on('error', listener);\n break;\n case 'chatError':\n this.chatAdapter.on('error', listener);\n break;\n\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n /* @conditional-compile-remove(close-captions) */\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n /* @conditional-compile-remove(capabilities) */\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n /* @conditional-compile-remove(spotlight) */\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: CallWithChatEvent, listener: any): void {\n switch (event as unknown) {\n case 'callParticipantsJoined':\n this.callAdapter.off('participantsJoined', listener);\n break;\n case 'callParticipantsLeft':\n this.callAdapter.off('participantsLeft', listener);\n break;\n case 'callEnded':\n this.callAdapter.off('callEnded', listener);\n break;\n case 'isMutedChanged':\n this.callAdapter.off('isMutedChanged', listener);\n break;\n case 'callIdChanged':\n this.callAdapter.off('callIdChanged', listener);\n break;\n case 'isLocalScreenSharingActiveChanged':\n this.callAdapter.off('isLocalScreenSharingActiveChanged', listener);\n break;\n case 'displayNameChanged':\n this.callAdapter.off('displayNameChanged', listener);\n break;\n case 'isSpeakingChanged':\n this.callAdapter.off('isSpeakingChanged', listener);\n break;\n case 'selectedMicrophoneChanged':\n this.callAdapter.off('selectedMicrophoneChanged', listener);\n break;\n case 'selectedSpeakerChanged':\n this.callAdapter.off('selectedSpeakerChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'captionsReceived':\n this.callAdapter.off('captionsReceived', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionsActiveChanged':\n this.callAdapter.off('isCaptionsActiveChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isCaptionLanguageChanged':\n this.callAdapter.off('isCaptionLanguageChanged', listener);\n break;\n /* @conditional-compile-remove(close-captions) */\n case 'isSpokenLanguageChanged':\n this.callAdapter.off('isSpokenLanguageChanged', listener);\n break;\n case 'messageReceived':\n this.chatAdapter.off('messageReceived', listener);\n break;\n case 'messageEdited':\n this.chatAdapter.off('messageEdited', listener);\n break;\n case 'messageDeleted':\n this.chatAdapter.off('messageDeleted', listener);\n break;\n case 'messageSent':\n this.chatAdapter.off('messageSent', listener);\n break;\n case 'messageRead':\n this.chatAdapter.off('messageRead', listener);\n break;\n case 'chatParticipantsAdded':\n this.chatAdapter.off('participantsAdded', listener);\n break;\n case 'chatParticipantsRemoved':\n this.chatAdapter.off('participantsRemoved', listener);\n break;\n case 'callError':\n this.callAdapter.off('error', listener);\n break;\n case 'chatError':\n this.chatAdapter.off('error', listener);\n break;\n default:\n throw `Unknown AzureCommunicationCallWithChatAdapter Event: ${event}`;\n }\n }\n}\n\n/**\n * Arguments for use in {@link createAzureCommunicationCallWithChatAdapter} to join a Call with an associated Chat thread.\n *\n * @public\n */\nexport interface CallAndChatLocator {\n /** Locator used by {@link createAzureCommunicationCallWithChatAdapter} to locate the call to join */\n callLocator: GroupCallLocator | /* @conditional-compile-remove(teams-adhoc-call) */ CallParticipantsLocator;\n /** Chat thread ID used by {@link createAzureCommunicationCallWithChatAdapter} to locate the chat thread to join */\n chatThreadId: string;\n}\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapter}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n locator: CallAndChatLocator | TeamsMeetingLinkLocator;\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId?: string;\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a CallWithChatAdapter backed by Azure Communication services\n * to plug into the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapter = async ({\n userId,\n displayName,\n credential,\n endpoint,\n locator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterArgs): Promise<CallWithChatAdapter> => {\n const callAdapterLocator = isTeamsMeetingLinkLocator(locator) ? locator : locator.callLocator;\n const createCallAdapterPromise = _createAzureCommunicationCallAdapterInner({\n userId,\n displayName,\n credential,\n locator: callAdapterLocator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ options: callAdapterOptions,\n telemetryImplementationHint: 'CallWithChat' as _TelemetryImplementationHint\n });\n\n const threadId = isTeamsMeetingLinkLocator(locator)\n ? getChatThreadFromTeamsLink(locator.meetingLink)\n : locator.chatThreadId;\n const createChatAdapterPromise = _createAzureCommunicationChatAdapterInner(\n endpoint,\n userId,\n displayName,\n credential,\n threadId,\n 'CallWithChat' as _TelemetryImplementationHint\n );\n\n const [callAdapter, chatAdapter] = await Promise.all([createCallAdapterPromise, createChatAdapterPromise]);\n return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n};\n\n/**\n * A custom React hook to simplify the creation of {@link CallWithChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationCallWithChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationCallWithChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationCallWithChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationCallWithChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: CallWithChatAdapter) => Promise<void>\n): CallWithChatAdapter | undefined => {\n const {\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<CallWithChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<CallWithChatAdapter | undefined>(undefined);\n const creatingAdapterRef = useRef<boolean>(false);\n\n const afterCreateRef = useRef<((adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>) | undefined>(\n undefined\n );\n const beforeDisposeRef = useRef<((adapter: CallWithChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !locator || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n if (creatingAdapterRef.current) {\n console.warn(\n 'Adapter is already being created, please see storybook for more information: https://azure.github.io/communication-ui-library/?path=/story/troubleshooting--page'\n );\n return;\n }\n creatingAdapterRef.current = true;\n let newAdapter = await createAzureCommunicationCallWithChatAdapter({\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [\n adapterRef,\n afterCreateRef,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n beforeDisposeRef,\n credential,\n displayName,\n endpoint,\n locator,\n userId,\n /* @conditional-compile-remove(video-background-effects) */ callAdapterOptions\n ]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Arguments for {@link createAzureCommunicationCallWithChatAdapterFromClient}\n *\n * @public\n */\nexport type AzureCommunicationCallWithChatAdapterFromClientArgs = {\n callLocator: CallAdapterLocator | TeamsMeetingLinkLocator;\n callAgent: CallAgent;\n callClient: StatefulCallClient;\n chatClient: StatefulChatClient;\n chatThreadClient: ChatThreadClient;\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a {@link CallWithChatAdapter} using the provided {@link StatefulChatClient} and {@link StatefulCallClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient} and {@link StatefulCallClient}.\n * Please note that chatThreadClient has to be created by StatefulChatClient via chatClient.getChatThreadClient(chatThreadId) API.\n * Consider using {@link createAzureCommunicationCallWithChatAdapter} for a simpler API.\n *\n * @public\n */\nexport const createAzureCommunicationCallWithChatAdapterFromClients = async ({\n callClient,\n callAgent,\n callLocator,\n chatClient,\n chatThreadClient,\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions\n}: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise<CallWithChatAdapter> => {\n const createCallAdapterPromise = createAzureCommunicationCallAdapterFromClient(\n callClient,\n callAgent,\n callLocator,\n /* @conditional-compile-remove(video-background-effects) */\n callAdapterOptions\n );\n const createChatAdapterPromise = createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n const [callAdapter, chatAdapter] = await Promise.all([createCallAdapterPromise, createChatAdapterPromise]);\n return new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n};\n\n/**\n * Create a {@link CallWithChatAdapter} from the underlying adapters.\n *\n * This is an internal factory function used by browser tests to inject fake adapters for call and chat.\n *\n * @internal\n */\nexport const _createAzureCommunicationCallWithChatAdapterFromAdapters = (\n callAdapter: CallAdapter,\n chatAdapter: ChatAdapter\n): CallWithChatAdapter => new AzureCommunicationCallWithChatAdapter(callAdapter, chatAdapter);\n\nconst isTeamsMeetingLinkLocator = (\n locator: CallAndChatLocator | TeamsMeetingLinkLocator\n): locator is TeamsMeetingLinkLocator => {\n return 'meetingLink' in locator;\n};\n"]}
@@ -179,8 +179,8 @@ export class AzureCommunicationChatAdapter {
179
179
  offStateChange(handler) {
180
180
  this.context.offStateChange(handler);
181
181
  }
182
- sendMessage(content, options = {}) {
183
- return __awaiter(this, void 0, void 0, function* () {
182
+ sendMessage(content_1) {
183
+ return __awaiter(this, arguments, void 0, function* (content, options = {}) {
184
184
  yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
185
185
  /* @conditional-compile-remove(file-sharing) */
186
186
  options.metadata = Object.assign(Object.assign({}, options.metadata), convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads));
@@ -410,7 +410,7 @@ const convertEventType = (type) => {
410
410
  *
411
411
  * @public
412
412
  */
413
- export const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) => __awaiter(void 0, void 0, void 0, function* () {
413
+ export const createAzureCommunicationChatAdapter = (_a) => __awaiter(void 0, [_a], void 0, function* ({ endpoint: endpointUrl, userId, displayName, credential, threadId }) {
414
414
  return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);
415
415
  });
416
416
  /**
@@ -418,7 +418,7 @@ export const createAzureCommunicationChatAdapter = ({ endpoint: endpointUrl, use
418
418
  *
419
419
  * @internal
420
420
  */
421
- export const _createAzureCommunicationChatAdapterInner = (endpoint, userId, displayName, credential, threadId, telemetryImplementationHint = 'Chat') => __awaiter(void 0, void 0, void 0, function* () {
421
+ export const _createAzureCommunicationChatAdapterInner = (endpoint_1, userId_1, displayName_1, credential_1, threadId_1, ...args_1) => __awaiter(void 0, [endpoint_1, userId_1, displayName_1, credential_1, threadId_1, ...args_1], void 0, function* (endpoint, userId, displayName, credential, threadId, telemetryImplementationHint = 'Chat') {
422
422
  if (!_isValidIdentifier(userId)) {
423
423
  throw new Error('Provided userId is invalid. Please provide valid identifier object.');
424
424
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AzureCommunicationChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAElC,OAAO,EACL,8BAA8B,EAI/B,gDAAuC;AACxC,OAAO,EAAgB,yBAAyB,EAAE,mDAA0C;AAY5F,OAAO,EAAE,6BAA6B,EAAgC,yCAAgC;AACtG,OAAO,YAAY,MAAM,QAAQ,CAAC;AAelC,+CAA+C;AAC/C,OAAO,EAAqB,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AACtH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AAQ,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AAC1G,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n _createStatefulChatClientInner,\n ChatClientState,\n ChatError,\n StatefulChatClient\n} from '@internal/chat-stateful-client';\nimport { ChatHandlers, createDefaultChatHandlers } from '@internal/chat-component-bindings';\nimport { ChatMessage, ChatMessageType, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport type {\n ChatMessageDeletedEvent,\n ChatMessageEditedEvent,\n ChatMessageReceivedEvent,\n ChatThreadPropertiesUpdatedEvent,\n ParticipantsAddedEvent,\n ParticipantsRemovedEvent,\n ReadReceiptReceivedEvent\n} from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport EventEmitter from 'events';\nimport {\n ChatAdapter,\n ChatAdapterState,\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener,\n TopicChangedListener\n} from './ChatAdapter';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ResourceDetails } from './ChatAdapter';\nimport { AdapterError } from '../../common/adapters';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadAdapter, convertFileUploadsUiStateToMessageMetadata } from './AzureCommunicationFileUploadAdapter';\n/* @conditional-compile-remove(file-sharing) */\nimport { AzureCommunicationFileUploadAdapter } from './AzureCommunicationFileUploadAdapter';\nimport { useEffect, useRef, useState } from 'react';\nimport { _isValidIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing) */\nimport { AttachmentMetadata } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadManager } from '../file-sharing';\n\n/**\n * Context of Chat, which is a centralized context for all state updates\n * @private\n */\nexport class ChatContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: ChatAdapterState;\n private threadId: string;\n\n constructor(clientState: ChatClientState, threadId: string) {\n const thread = clientState.threads[threadId];\n this.threadId = threadId;\n if (!thread) {\n throw 'Cannot find threadId, please initialize thread before use!';\n }\n this.state = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n }\n\n public onStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: ChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): ChatAdapterState {\n return this.state;\n }\n\n public setError(error: Error): void {\n this.setState({ ...this.state, error });\n }\n\n public updateClientState(clientState: ChatClientState): void {\n const thread = clientState.threads[this.threadId];\n if (!thread) {\n throw 'Cannot find threadId, please make sure thread state is still in Stateful ChatClient.';\n }\n\n let updatedState: ChatAdapterState = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n\n /* @conditional-compile-remove(file-sharing) */\n updatedState = { ...updatedState, fileUploads: this.state.fileUploads };\n\n this.setState(updatedState);\n }\n}\n\n/**\n * @private\n */\nexport class AzureCommunicationChatAdapter implements ChatAdapter {\n private chatClient: StatefulChatClient;\n private chatThreadClient: ChatThreadClient;\n private context: ChatContext;\n /* @conditional-compile-remove(file-sharing) */\n private fileUploadAdapter: FileUploadAdapter;\n private handlers: ChatHandlers;\n private emitter: EventEmitter = new EventEmitter();\n\n constructor(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient) {\n this.bindAllPublicMethods();\n this.chatClient = chatClient;\n this.chatThreadClient = chatThreadClient;\n this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);\n /* @conditional-compile-remove(file-sharing) */\n this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);\n\n const onStateChange = (clientState: ChatClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n chatClient.offStateChange(onStateChange);\n return;\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultChatHandlers(chatClient, chatThreadClient);\n\n this.chatClient.onStateChange(onStateChange);\n this.subscribeAllEvents();\n }\n\n private bindAllPublicMethods(): void {\n this.onStateChange = this.onStateChange.bind(this);\n this.offStateChange = this.offStateChange.bind(this);\n this.getState = this.getState.bind(this);\n this.dispose = this.dispose.bind(this);\n this.fetchInitialData = this.fetchInitialData.bind(this);\n this.sendMessage = this.sendMessage.bind(this);\n this.sendReadReceipt = this.sendReadReceipt.bind(this);\n this.sendTypingIndicator = this.sendTypingIndicator.bind(this);\n this.updateMessage = this.updateMessage.bind(this);\n this.deleteMessage = this.deleteMessage.bind(this);\n this.removeParticipant = this.removeParticipant.bind(this);\n this.setTopic = this.setTopic.bind(this);\n this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);\n this.on = this.on.bind(this);\n this.off = this.off.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.clearFileUploads = this.clearFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.cancelFileUpload = this.cancelFileUpload.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n }\n\n dispose(): void {\n this.unsubscribeAllEvents();\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.chatClient.dispose();\n }\n\n async fetchInitialData(): Promise<void> {\n // If get properties fails we dont want to try to get the participants after.\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.chatThreadClient.getProperties();\n // Fetch all participants who joined before the local user.\n for await (const _page of this.chatThreadClient.listParticipants().byPage({\n // Fetch 100 participants per page by default.\n maxPageSize: 100\n // eslint-disable-next-line curly\n }));\n });\n }\n\n getState(): ChatAdapterState {\n return this.context.getState();\n }\n\n onStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n offStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n async sendMessage(content: string, options: SendMessageOptions = {}): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing) */\n options.metadata = {\n ...options.metadata,\n ...convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads)\n };\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * All the current uploads need to be clear from the state before a message has been sent.\n * This ensures the following behavior:\n * 1. File Upload cards are removed from sendbox at the same time text in sendbox is removed.\n * 2. any component rendering these file uploads doesn't continue to do so.\n * 3. Cleans the state for new file uploads with a fresh message.\n */\n this.fileUploadAdapter.clearFileUploads();\n\n await this.handlers.onSendMessage(content, options);\n });\n }\n\n async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onMessageSeen(chatMessageId);\n });\n }\n\n async sendTypingIndicator(): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onTyping();\n });\n }\n\n async removeParticipant(userId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onRemoveParticipant(userId);\n });\n }\n\n async setTopic(topicName: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.updateThreadTopicName(topicName);\n });\n }\n\n async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onLoadPreviousChatMessages(messagesToLoad);\n });\n }\n\n async updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(file-sharing) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing) */\n const updatedOptions = { attachmentMetadata: options?.attachmentMetadata, metadata: metadata };\n /* @conditional-compile-remove(file-sharing) */\n return await this.handlers.onUpdateMessage(messageId, content, updatedOptions);\n return await this.handlers.onUpdateMessage(messageId, content);\n });\n }\n\n async deleteMessage(messageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteMessage(messageId);\n });\n }\n\n /* @conditional-compile-remove(file-sharing) */\n registerActiveFileUploads(files: File[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerActiveFileUploads(files);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n registerCompletedFileUploads(metadata: AttachmentMetadata[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerCompletedFileUploads(metadata);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n clearFileUploads(): void {\n this.fileUploadAdapter.clearFileUploads();\n }\n\n /* @conditional-compile-remove(file-sharing) */\n cancelFileUpload(id: string): void {\n this.fileUploadAdapter.cancelFileUpload(id);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadProgress(id: string, progress: number): void {\n this.fileUploadAdapter.updateFileUploadProgress(id, progress);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadErrorMessage(id: string, errorMessage: string): void {\n this.fileUploadAdapter.updateFileUploadErrorMessage(id, errorMessage);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadMetadata(id: string, metadata: AttachmentMetadata): void {\n this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);\n }\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatClient.downloadResourceToCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatClient.removeResourceFromCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n private messageReceivedListener(event: ChatMessageReceivedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageReceived', { message });\n\n const currentUserId = toFlatCommunicationIdentifier(this.chatClient.getState().userId);\n if (message?.sender && toFlatCommunicationIdentifier(message.sender) === currentUserId) {\n this.emitter.emit('messageSent', { message });\n }\n }\n\n private messageEditedListener(event: ChatMessageEditedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageEdited', { message });\n }\n\n private messageDeletedListener(event: ChatMessageDeletedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageDeleted', { message });\n }\n\n private messageReadListener({ chatMessageId, recipient }: ReadReceiptReceivedEvent): void {\n const message = this.getState().thread.chatMessages[chatMessageId];\n if (message) {\n this.emitter.emit('messageRead', { message, readBy: recipient });\n }\n }\n\n private participantsAddedListener({ addedBy, participantsAdded }: ParticipantsAddedEvent): void {\n this.emitter.emit('participantsAdded', { addedBy, participantsAdded });\n }\n\n private participantsRemovedListener({ removedBy, participantsRemoved }: ParticipantsRemovedEvent): void {\n this.emitter.emit('participantsRemoved', { removedBy, participantsRemoved });\n }\n\n private chatThreadPropertiesUpdatedListener(event: ChatThreadPropertiesUpdatedEvent): void {\n this.emitter.emit('topicChanged', { topic: event.properties.topic });\n }\n\n private subscribeAllEvents(): void {\n this.chatClient.on('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.on('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.on('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.on('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.on('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.on('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n private unsubscribeAllEvents(): void {\n this.chatClient.off('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.off('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.off('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.off('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.off('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.off('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n off(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isChatError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\nconst convertEventToChatMessage = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): ChatMessage => {\n return {\n id: event.id,\n version: event.version,\n content: isChatMessageDeletedEvent(event) ? undefined : { message: event.message },\n type: convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n createdOn: new Date(event.createdOn),\n editedOn: isChatMessageEditedEvent(event) ? event.editedOn : undefined,\n deletedOn: isChatMessageDeletedEvent(event) ? event.deletedOn : undefined\n };\n};\n\nconst isChatMessageEditedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageEditedEvent => {\n return 'editedOn' in event;\n};\n\nconst isChatMessageDeletedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageDeletedEvent => {\n return 'deletedOn' in event;\n};\n\n// only text/html message type will be received from event\nconst convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n};\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link ChatAdapter}.\n *\n * @public\n */\nexport type AzureCommunicationChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n threadId: string;\n};\n\n/**\n * Create a {@link ChatAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link ChatAdapter} provided by this library.\n *\n * @public\n */\nexport const createAzureCommunicationChatAdapter = async ({\n endpoint: endpointUrl,\n userId,\n displayName,\n credential,\n threadId\n}: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter> => {\n return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: string,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n};\n\n/**\n * A custom React hook to simplify the creation of {@link ChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: ChatAdapter) => Promise<void>\n): ChatAdapter | undefined => {\n const { credential, displayName, endpoint, threadId, userId } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<ChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<ChatAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: ChatAdapter) => Promise<ChatAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: ChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !threadId || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationChatAdapter({\n credential,\n displayName,\n endpoint,\n threadId,\n userId\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [adapterRef, afterCreateRef, beforeDisposeRef, credential, displayName, endpoint, threadId, userId]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link ChatAdapter} using the provided {@link StatefulChatClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient}.\n * Consider using {@link createAzureCommunicationChatAdapter} for a simpler API.\n *\n * @public\n */\nexport async function createAzureCommunicationChatAdapterFromClient(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient\n): Promise<ChatAdapter> {\n return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);\n}\n\nconst isChatError = (e: Error): e is ChatError => {\n return 'target' in e && e['target'] !== undefined && 'innerError' in e && e['innerError'] !== undefined;\n};\n"]}
1
+ {"version":3,"file":"AzureCommunicationChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAElC,OAAO,EACL,8BAA8B,EAI/B,gDAAuC;AACxC,OAAO,EAAgB,yBAAyB,EAAE,mDAA0C;AAY5F,OAAO,EAAE,6BAA6B,EAAg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6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;CAAA;AAED,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAkB,EAAE;IAC/C,OAAO,QAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AAC1G,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n _createStatefulChatClientInner,\n ChatClientState,\n ChatError,\n StatefulChatClient\n} from '@internal/chat-stateful-client';\nimport { ChatHandlers, createDefaultChatHandlers } from '@internal/chat-component-bindings';\nimport { ChatMessage, ChatMessageType, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport type {\n ChatMessageDeletedEvent,\n ChatMessageEditedEvent,\n ChatMessageReceivedEvent,\n ChatThreadPropertiesUpdatedEvent,\n ParticipantsAddedEvent,\n ParticipantsRemovedEvent,\n ReadReceiptReceivedEvent\n} from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport EventEmitter from 'events';\nimport {\n ChatAdapter,\n ChatAdapterState,\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener,\n TopicChangedListener\n} from './ChatAdapter';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { ResourceDetails } from './ChatAdapter';\nimport { AdapterError } from '../../common/adapters';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadAdapter, convertFileUploadsUiStateToMessageMetadata } from './AzureCommunicationFileUploadAdapter';\n/* @conditional-compile-remove(file-sharing) */\nimport { AzureCommunicationFileUploadAdapter } from './AzureCommunicationFileUploadAdapter';\nimport { useEffect, useRef, useState } from 'react';\nimport { _isValidIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing) */\nimport { AttachmentMetadata } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadManager } from '../file-sharing';\n\n/**\n * Context of Chat, which is a centralized context for all state updates\n * @private\n */\nexport class ChatContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: ChatAdapterState;\n private threadId: string;\n\n constructor(clientState: ChatClientState, threadId: string) {\n const thread = clientState.threads[threadId];\n this.threadId = threadId;\n if (!thread) {\n throw 'Cannot find threadId, please initialize thread before use!';\n }\n this.state = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n }\n\n public onStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: ChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): ChatAdapterState {\n return this.state;\n }\n\n public setError(error: Error): void {\n this.setState({ ...this.state, error });\n }\n\n public updateClientState(clientState: ChatClientState): void {\n const thread = clientState.threads[this.threadId];\n if (!thread) {\n throw 'Cannot find threadId, please make sure thread state is still in Stateful ChatClient.';\n }\n\n let updatedState: ChatAdapterState = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n\n /* @conditional-compile-remove(file-sharing) */\n updatedState = { ...updatedState, fileUploads: this.state.fileUploads };\n\n this.setState(updatedState);\n }\n}\n\n/**\n * @private\n */\nexport class AzureCommunicationChatAdapter implements ChatAdapter {\n private chatClient: StatefulChatClient;\n private chatThreadClient: ChatThreadClient;\n private context: ChatContext;\n /* @conditional-compile-remove(file-sharing) */\n private fileUploadAdapter: FileUploadAdapter;\n private handlers: ChatHandlers;\n private emitter: EventEmitter = new EventEmitter();\n\n constructor(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient) {\n this.bindAllPublicMethods();\n this.chatClient = chatClient;\n this.chatThreadClient = chatThreadClient;\n this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);\n /* @conditional-compile-remove(file-sharing) */\n this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);\n\n const onStateChange = (clientState: ChatClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n chatClient.offStateChange(onStateChange);\n return;\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultChatHandlers(chatClient, chatThreadClient);\n\n this.chatClient.onStateChange(onStateChange);\n this.subscribeAllEvents();\n }\n\n private bindAllPublicMethods(): void {\n this.onStateChange = this.onStateChange.bind(this);\n this.offStateChange = this.offStateChange.bind(this);\n this.getState = this.getState.bind(this);\n this.dispose = this.dispose.bind(this);\n this.fetchInitialData = this.fetchInitialData.bind(this);\n this.sendMessage = this.sendMessage.bind(this);\n this.sendReadReceipt = this.sendReadReceipt.bind(this);\n this.sendTypingIndicator = this.sendTypingIndicator.bind(this);\n this.updateMessage = this.updateMessage.bind(this);\n this.deleteMessage = this.deleteMessage.bind(this);\n this.removeParticipant = this.removeParticipant.bind(this);\n this.setTopic = this.setTopic.bind(this);\n this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);\n this.on = this.on.bind(this);\n this.off = this.off.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.clearFileUploads = this.clearFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.cancelFileUpload = this.cancelFileUpload.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n }\n\n dispose(): void {\n this.unsubscribeAllEvents();\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n this.chatClient.dispose();\n }\n\n async fetchInitialData(): Promise<void> {\n // If get properties fails we dont want to try to get the participants after.\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.chatThreadClient.getProperties();\n // Fetch all participants who joined before the local user.\n for await (const _page of this.chatThreadClient.listParticipants().byPage({\n // Fetch 100 participants per page by default.\n maxPageSize: 100\n // eslint-disable-next-line curly\n }));\n });\n }\n\n getState(): ChatAdapterState {\n return this.context.getState();\n }\n\n onStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n offStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n async sendMessage(content: string, options: SendMessageOptions = {}): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing) */\n options.metadata = {\n ...options.metadata,\n ...convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads)\n };\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * All the current uploads need to be clear from the state before a message has been sent.\n * This ensures the following behavior:\n * 1. File Upload cards are removed from sendbox at the same time text in sendbox is removed.\n * 2. any component rendering these file uploads doesn't continue to do so.\n * 3. Cleans the state for new file uploads with a fresh message.\n */\n this.fileUploadAdapter.clearFileUploads();\n\n await this.handlers.onSendMessage(content, options);\n });\n }\n\n async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onMessageSeen(chatMessageId);\n });\n }\n\n async sendTypingIndicator(): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onTyping();\n });\n }\n\n async removeParticipant(userId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onRemoveParticipant(userId);\n });\n }\n\n async setTopic(topicName: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.updateThreadTopicName(topicName);\n });\n }\n\n async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onLoadPreviousChatMessages(messagesToLoad);\n });\n }\n\n async updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(file-sharing) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing) */\n const updatedOptions = { attachmentMetadata: options?.attachmentMetadata, metadata: metadata };\n /* @conditional-compile-remove(file-sharing) */\n return await this.handlers.onUpdateMessage(messageId, content, updatedOptions);\n return await this.handlers.onUpdateMessage(messageId, content);\n });\n }\n\n async deleteMessage(messageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteMessage(messageId);\n });\n }\n\n /* @conditional-compile-remove(file-sharing) */\n registerActiveFileUploads(files: File[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerActiveFileUploads(files);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n registerCompletedFileUploads(metadata: AttachmentMetadata[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerCompletedFileUploads(metadata);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n clearFileUploads(): void {\n this.fileUploadAdapter.clearFileUploads();\n }\n\n /* @conditional-compile-remove(file-sharing) */\n cancelFileUpload(id: string): void {\n this.fileUploadAdapter.cancelFileUpload(id);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadProgress(id: string, progress: number): void {\n this.fileUploadAdapter.updateFileUploadProgress(id, progress);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadErrorMessage(id: string, errorMessage: string): void {\n this.fileUploadAdapter.updateFileUploadErrorMessage(id, errorMessage);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadMetadata(id: string, metadata: AttachmentMetadata): void {\n this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);\n }\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatClient.downloadResourceToCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatClient.removeResourceFromCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n private messageReceivedListener(event: ChatMessageReceivedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageReceived', { message });\n\n const currentUserId = toFlatCommunicationIdentifier(this.chatClient.getState().userId);\n if (message?.sender && toFlatCommunicationIdentifier(message.sender) === currentUserId) {\n this.emitter.emit('messageSent', { message });\n }\n }\n\n private messageEditedListener(event: ChatMessageEditedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageEdited', { message });\n }\n\n private messageDeletedListener(event: ChatMessageDeletedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageDeleted', { message });\n }\n\n private messageReadListener({ chatMessageId, recipient }: ReadReceiptReceivedEvent): void {\n const message = this.getState().thread.chatMessages[chatMessageId];\n if (message) {\n this.emitter.emit('messageRead', { message, readBy: recipient });\n }\n }\n\n private participantsAddedListener({ addedBy, participantsAdded }: ParticipantsAddedEvent): void {\n this.emitter.emit('participantsAdded', { addedBy, participantsAdded });\n }\n\n private participantsRemovedListener({ removedBy, participantsRemoved }: ParticipantsRemovedEvent): void {\n this.emitter.emit('participantsRemoved', { removedBy, participantsRemoved });\n }\n\n private chatThreadPropertiesUpdatedListener(event: ChatThreadPropertiesUpdatedEvent): void {\n this.emitter.emit('topicChanged', { topic: event.properties.topic });\n }\n\n private subscribeAllEvents(): void {\n this.chatClient.on('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.on('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.on('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.on('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.on('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.on('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n private unsubscribeAllEvents(): void {\n this.chatClient.off('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.off('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.off('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.off('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.off('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.off('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n off(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isChatError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\nconst convertEventToChatMessage = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): ChatMessage => {\n return {\n id: event.id,\n version: event.version,\n content: isChatMessageDeletedEvent(event) ? undefined : { message: event.message },\n type: convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n createdOn: new Date(event.createdOn),\n editedOn: isChatMessageEditedEvent(event) ? event.editedOn : undefined,\n deletedOn: isChatMessageDeletedEvent(event) ? event.deletedOn : undefined\n };\n};\n\nconst isChatMessageEditedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageEditedEvent => {\n return 'editedOn' in event;\n};\n\nconst isChatMessageDeletedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageDeletedEvent => {\n return 'deletedOn' in event;\n};\n\n// only text/html message type will be received from event\nconst convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n};\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link ChatAdapter}.\n *\n * @public\n */\nexport type AzureCommunicationChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n threadId: string;\n};\n\n/**\n * Create a {@link ChatAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link ChatAdapter} provided by this library.\n *\n * @public\n */\nexport const createAzureCommunicationChatAdapter = async ({\n endpoint: endpointUrl,\n userId,\n displayName,\n credential,\n threadId\n}: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter> => {\n return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: string,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n};\n\n/**\n * A custom React hook to simplify the creation of {@link ChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: ChatAdapter) => Promise<void>\n): ChatAdapter | undefined => {\n const { credential, displayName, endpoint, threadId, userId } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<ChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<ChatAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: ChatAdapter) => Promise<ChatAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: ChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !threadId || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationChatAdapter({\n credential,\n displayName,\n endpoint,\n threadId,\n userId\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [adapterRef, afterCreateRef, beforeDisposeRef, credential, displayName, endpoint, threadId, userId]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link ChatAdapter} using the provided {@link StatefulChatClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient}.\n * Consider using {@link createAzureCommunicationChatAdapter} for a simpler API.\n *\n * @public\n */\nexport async function createAzureCommunicationChatAdapterFromClient(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient\n): Promise<ChatAdapter> {\n return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);\n}\n\nconst isChatError = (e: Error): e is ChatError => {\n return 'target' in e && e['target'] !== undefined && 'innerError' in e && e['innerError'] !== undefined;\n};\n"]}
@@ -3,9 +3,9 @@ import { ChatAdapterState } from '../adapter/ChatAdapter';
3
3
  /**
4
4
  * @private
5
5
  */
6
- export declare const useAdaptedSelector: <SelectorT extends (state: ChatClientState, props: any) => any>(selector: SelectorT, selectorProps?: Parameters<SelectorT>[1] | undefined) => ReturnType<SelectorT>;
6
+ export declare const useAdaptedSelector: <SelectorT extends (state: ChatClientState, props: any) => any>(selector: SelectorT, selectorProps?: Parameters<SelectorT>[1]) => ReturnType<SelectorT>;
7
7
  /**
8
8
  * @private
9
9
  */
10
- export declare const useSelectorWithAdaptation: <SelectorT extends (state: ReturnType<AdaptFuncT>, props: any) => any, AdaptFuncT extends (state: ChatAdapterState) => any>(selector: SelectorT, adaptState: AdaptFuncT, selectorProps?: Parameters<SelectorT>[1] | undefined) => ReturnType<SelectorT>;
10
+ export declare const useSelectorWithAdaptation: <SelectorT extends (state: ReturnType<AdaptFuncT>, props: any) => any, AdaptFuncT extends (state: ChatAdapterState) => any>(selector: SelectorT, adaptState: AdaptFuncT, selectorProps?: Parameters<SelectorT>[1]) => ReturnType<SelectorT>;
11
11
  //# sourceMappingURL=useAdaptedSelector.d.ts.map
@@ -2,5 +2,5 @@ import { ChatAdapterState } from '../adapter/ChatAdapter';
2
2
  /**
3
3
  * @private
4
4
  */
5
- export declare const useSelector: <SelectorT extends (state: ChatAdapterState, props: any) => any>(selector: SelectorT, selectorProps?: Parameters<SelectorT>[1] | undefined) => ReturnType<SelectorT>;
5
+ export declare const useSelector: <SelectorT extends (state: ChatAdapterState, props: any) => any>(selector: SelectorT, selectorProps?: Parameters<SelectorT>[1]) => ReturnType<SelectorT>;
6
6
  //# sourceMappingURL=useSelector.d.ts.map