@microsoft/omnichannel-chat-widget 0.1.0-main.eb80fb1 → 0.1.0-main.ebfc563

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 (325) hide show
  1. package/README.md +35 -11
  2. package/lib/cjs/assets/Icons.js +4 -2
  3. package/lib/cjs/common/Constants.js +54 -153
  4. package/lib/cjs/common/KeyCodes.js +3 -4
  5. package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -5
  6. package/lib/cjs/common/storage/default/defaultCacheManager.js +26 -0
  7. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +111 -0
  8. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +78 -0
  9. package/lib/cjs/common/telemetry/TelemetryConstants.js +85 -24
  10. package/lib/cjs/common/telemetry/TelemetryHelper.js +31 -56
  11. package/lib/cjs/common/telemetry/TelemetryManager.js +17 -35
  12. package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
  13. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -3
  14. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +49 -35
  15. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -14
  16. package/lib/cjs/common/utils.js +80 -80
  17. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +21 -45
  18. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -26
  19. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  20. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +13 -71
  21. package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
  22. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -37
  23. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
  24. package/lib/cjs/components/footerstateful/FooterStateful.js +12 -44
  25. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
  26. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +15 -44
  27. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
  28. package/lib/cjs/components/headerstateful/HeaderStateful.js +26 -35
  29. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
  30. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +39 -0
  31. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +20 -0
  32. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  33. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +34 -0
  34. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +64 -0
  35. package/lib/cjs/components/livechatwidget/common/Deferred.js +37 -0
  36. package/lib/cjs/components/livechatwidget/common/authHelper.js +50 -0
  37. package/lib/cjs/components/livechatwidget/common/createAdapter.js +10 -9
  38. package/lib/cjs/components/livechatwidget/common/createFooter.js +4 -23
  39. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +10 -10
  40. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +36 -44
  41. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
  42. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +132 -61
  43. package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
  44. package/lib/cjs/components/livechatwidget/common/endChat.js +167 -61
  45. package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
  46. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +8 -17
  47. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
  48. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +50 -52
  49. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +98 -66
  50. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +9 -33
  51. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -15
  52. package/lib/cjs/components/livechatwidget/common/shareObservable.js +41 -0
  53. package/lib/cjs/components/livechatwidget/common/startChat.js +287 -90
  54. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +0 -8
  55. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +2 -11
  56. package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  57. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +354 -170
  58. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +19 -19
  59. package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
  60. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +4 -17
  61. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +9 -14
  62. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -23
  63. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  64. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +13 -0
  65. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  66. package/lib/cjs/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  67. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -45
  68. package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  69. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +21 -35
  70. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -24
  71. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +94 -19
  72. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -7
  73. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
  74. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -0
  75. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -27
  76. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +9 -16
  77. package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
  78. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -15
  79. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
  80. package/lib/cjs/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  81. package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  82. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +12 -0
  83. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -5
  84. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  85. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  86. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  87. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  88. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  89. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  90. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  91. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  92. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +0 -7
  93. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -5
  94. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +33 -80
  95. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +10 -22
  96. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +27 -61
  97. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
  98. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
  99. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +82 -0
  100. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +10 -0
  101. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +10 -0
  102. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  103. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  104. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +10 -0
  105. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -9
  106. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +89 -0
  107. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +7 -18
  108. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +8 -42
  109. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +4 -22
  110. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +13 -30
  111. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
  112. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -34
  113. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -10
  114. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +7 -18
  115. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -19
  116. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +1 -9
  117. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -9
  118. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -34
  119. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +1 -10
  120. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +7 -11
  121. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +5 -14
  122. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -21
  123. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +33 -0
  124. package/lib/cjs/contexts/ChatAdapterStore.js +0 -2
  125. package/lib/cjs/contexts/ChatContextStore.js +0 -2
  126. package/lib/cjs/contexts/ChatSDKStore.js +0 -2
  127. package/lib/cjs/contexts/common/ConversationState.js +4 -3
  128. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +30 -26
  129. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +18 -11
  130. package/lib/cjs/contexts/createReducer.js +169 -109
  131. package/lib/cjs/controller/componentController.js +5 -34
  132. package/lib/cjs/hooks/useChatAdapterStore.js +0 -6
  133. package/lib/cjs/hooks/useChatContextStore.js +0 -6
  134. package/lib/cjs/hooks/useChatSDKStore.js +0 -6
  135. package/lib/cjs/index.js +0 -5
  136. package/lib/cjs/plugins/newMessageEventHandler.js +82 -0
  137. package/lib/esm/assets/Icons.js +2 -1
  138. package/lib/esm/common/Constants.js +49 -141
  139. package/lib/esm/common/KeyCodes.js +3 -3
  140. package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -3
  141. package/lib/esm/common/storage/default/defaultCacheManager.js +18 -0
  142. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +104 -0
  143. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +70 -0
  144. package/lib/esm/common/telemetry/TelemetryConstants.js +84 -19
  145. package/lib/esm/common/telemetry/TelemetryHelper.js +32 -46
  146. package/lib/esm/common/telemetry/TelemetryManager.js +17 -24
  147. package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
  148. package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
  149. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +49 -23
  150. package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -10
  151. package/lib/esm/common/utils.js +73 -45
  152. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +21 -16
  153. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +23 -13
  154. package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
  155. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +14 -47
  156. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +9 -16
  157. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
  158. package/lib/esm/components/footerstateful/FooterStateful.js +14 -25
  159. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +15 -37
  160. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
  161. package/lib/esm/components/headerstateful/HeaderStateful.js +27 -21
  162. package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
  163. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -0
  164. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +13 -0
  165. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  166. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +27 -0
  167. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +57 -0
  168. package/lib/esm/components/livechatwidget/common/Deferred.js +30 -0
  169. package/lib/esm/components/livechatwidget/common/authHelper.js +42 -0
  170. package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -4
  171. package/lib/esm/components/livechatwidget/common/createFooter.js +4 -16
  172. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +10 -5
  173. package/lib/esm/components/livechatwidget/common/createMarkdown.js +38 -37
  174. package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
  175. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +134 -49
  176. package/lib/esm/components/livechatwidget/common/endChat.js +171 -50
  177. package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
  178. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +10 -12
  179. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
  180. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +52 -24
  181. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +98 -58
  182. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +9 -23
  183. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -6
  184. package/lib/esm/components/livechatwidget/common/shareObservable.js +35 -0
  185. package/lib/esm/components/livechatwidget/common/startChat.js +287 -71
  186. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
  187. package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
  188. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +357 -122
  189. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +19 -7
  190. package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
  191. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +4 -5
  192. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +9 -4
  193. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -11
  194. package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  195. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +6 -0
  196. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  197. package/lib/esm/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  198. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +16 -30
  199. package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  200. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +24 -12
  201. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +6 -6
  202. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +94 -4
  203. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
  204. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  205. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -0
  206. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +12 -19
  207. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +9 -12
  208. package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
  209. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +5 -5
  210. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
  211. package/lib/esm/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  212. package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  213. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
  214. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -3
  215. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  216. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  217. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  218. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  219. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  220. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  221. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  222. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  223. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +2 -5
  224. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -4
  225. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +34 -66
  226. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +12 -14
  227. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +27 -40
  228. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
  229. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +34 -0
  230. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +80 -0
  231. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +3 -0
  232. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +3 -0
  233. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -1
  234. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -1
  235. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +3 -0
  236. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -7
  237. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +83 -0
  238. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +8 -9
  239. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +9 -28
  240. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +5 -14
  241. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +15 -19
  242. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
  243. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -29
  244. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -7
  245. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +9 -14
  246. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +17 -14
  247. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -7
  248. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -7
  249. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +15 -27
  250. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -5
  251. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +9 -9
  252. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +7 -9
  253. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -13
  254. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +27 -0
  255. package/lib/esm/contexts/ChatAdapterStore.js +2 -1
  256. package/lib/esm/contexts/ChatContextStore.js +2 -1
  257. package/lib/esm/contexts/ChatSDKStore.js +2 -1
  258. package/lib/esm/contexts/common/ConversationState.js +4 -3
  259. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +30 -26
  260. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -7
  261. package/lib/esm/contexts/createReducer.js +169 -105
  262. package/lib/esm/controller/componentController.js +6 -5
  263. package/lib/esm/hooks/useChatAdapterStore.js +0 -4
  264. package/lib/esm/hooks/useChatContextStore.js +0 -4
  265. package/lib/esm/hooks/useChatSDKStore.js +0 -4
  266. package/lib/esm/plugins/newMessageEventHandler.js +75 -0
  267. package/lib/types/assets/Icons.d.ts +1 -0
  268. package/lib/types/common/Constants.d.ts +41 -2
  269. package/lib/types/common/interfaces/IContextDataStore.d.ts +2 -2
  270. package/lib/types/common/storage/default/defaultCacheManager.d.ts +4 -0
  271. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
  272. package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
  273. package/lib/types/common/telemetry/TelemetryConstants.d.ts +59 -6
  274. package/lib/types/common/telemetry/TelemetryHelper.d.ts +2 -0
  275. package/lib/types/common/telemetry/definitions/Contracts.d.ts +4 -4
  276. package/lib/types/common/telemetry/definitions/Payload.d.ts +13 -9
  277. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +7 -3
  278. package/lib/types/common/utils.d.ts +8 -1
  279. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +5 -2
  280. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
  281. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +5 -1
  282. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
  283. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
  284. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
  285. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
  286. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
  287. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
  288. package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
  289. package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
  290. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
  291. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -4
  292. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
  293. package/lib/types/components/livechatwidget/common/startChat.d.ts +5 -2
  294. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
  295. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +4 -1
  296. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +6 -3
  297. package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
  298. package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
  299. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
  300. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
  301. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
  302. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -2
  303. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
  304. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +2 -0
  305. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +4 -0
  306. package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
  307. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +4 -1
  308. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +4 -0
  309. package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
  310. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +0 -1
  311. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  312. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
  313. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
  314. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
  315. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -0
  316. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -0
  317. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
  318. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
  319. package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
  320. package/lib/types/contexts/common/ConversationState.d.ts +4 -2
  321. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +6 -3
  322. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +30 -25
  323. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
  324. package/lib/types/plugins/newMessageEventHandler.d.ts +2 -0
  325. package/package.json +12 -13
@@ -4,89 +4,60 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.shouldShowWebChatContainer = exports.shouldShowReconnectChatPane = exports.shouldShowProactiveChatPane = exports.shouldShowPreChatSurveyPane = exports.shouldShowPostChatSurveyPane = exports.shouldShowPostChatLoadingPane = exports.shouldShowOutOfOfficeHoursPane = exports.shouldShowLoadingPane = exports.shouldShowHeader = exports.shouldShowFooter = exports.shouldShowEmailTranscriptPane = exports.shouldShowConfirmationPane = exports.shouldShowChatButton = exports.shouldShowCallingContainer = void 0;
7
-
8
7
  var _ConversationState = require("../contexts/common/ConversationState");
9
-
10
8
  const shouldShowChatButton = state => {
11
- return state.appStates.isMinimized || state.appStates.conversationState === _ConversationState.ConversationState.Closed;
9
+ return (state.appStates.isMinimized || state.appStates.conversationState === _ConversationState.ConversationState.Closed) && state.appStates.hideStartChatButton === false; // Do not show chat button in case of popout
12
10
  };
13
-
14
11
  exports.shouldShowChatButton = shouldShowChatButton;
15
-
16
12
  const shouldShowProactiveChatPane = state => {
17
13
  return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.ProactiveChat;
18
14
  };
19
-
20
15
  exports.shouldShowProactiveChatPane = shouldShowProactiveChatPane;
21
-
22
16
  const shouldShowHeader = state => {
23
17
  return !state.appStates.isMinimized && state.appStates.conversationState !== _ConversationState.ConversationState.Closed && state.appStates.conversationState !== _ConversationState.ConversationState.ProactiveChat;
24
18
  };
25
-
26
19
  exports.shouldShowHeader = shouldShowHeader;
27
-
28
20
  const shouldShowFooter = state => {
29
- return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Active;
21
+ return !state.appStates.isMinimized && (state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive || state.appStates.conversationState === _ConversationState.ConversationState.Postchat);
30
22
  };
31
-
32
23
  exports.shouldShowFooter = shouldShowFooter;
33
-
34
24
  const shouldShowEmailTranscriptPane = state => {
35
25
  return state.uiStates.showEmailTranscriptPane;
36
26
  };
37
-
38
27
  exports.shouldShowEmailTranscriptPane = shouldShowEmailTranscriptPane;
39
-
40
28
  const shouldShowWebChatContainer = state => {
41
- return state.appStates.conversationState === _ConversationState.ConversationState.Active;
29
+ return state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive;
42
30
  };
43
-
44
31
  exports.shouldShowWebChatContainer = shouldShowWebChatContainer;
45
-
46
32
  const shouldShowLoadingPane = state => {
47
- return !state.appStates.isMinimized && !state.appStates.shouldShowPostChat && state.appStates.conversationState === _ConversationState.ConversationState.Loading;
33
+ return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Loading;
48
34
  };
49
-
50
35
  exports.shouldShowLoadingPane = shouldShowLoadingPane;
51
-
52
36
  const shouldShowReconnectChatPane = state => {
53
37
  return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.ReconnectChat;
54
38
  };
55
-
56
39
  exports.shouldShowReconnectChatPane = shouldShowReconnectChatPane;
57
-
58
40
  const shouldShowPostChatLoadingPane = state => {
59
- return !state.appStates.isMinimized && state.appStates.shouldShowPostChat && state.appStates.conversationState === _ConversationState.ConversationState.Loading;
41
+ return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.PostchatLoading;
60
42
  };
61
-
62
43
  exports.shouldShowPostChatLoadingPane = shouldShowPostChatLoadingPane;
63
-
64
44
  const shouldShowOutOfOfficeHoursPane = state => {
65
45
  return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.OutOfOffice;
66
46
  };
67
-
68
47
  exports.shouldShowOutOfOfficeHoursPane = shouldShowOutOfOfficeHoursPane;
69
-
70
48
  const shouldShowPreChatSurveyPane = state => {
71
49
  return state.appStates.conversationState === _ConversationState.ConversationState.Prechat;
72
50
  };
73
-
74
51
  exports.shouldShowPreChatSurveyPane = shouldShowPreChatSurveyPane;
75
-
76
52
  const shouldShowConfirmationPane = state => {
77
53
  return state.uiStates.showConfirmationPane;
78
54
  };
79
-
80
55
  exports.shouldShowConfirmationPane = shouldShowConfirmationPane;
81
-
82
56
  const shouldShowPostChatSurveyPane = state => {
83
57
  return state.appStates.conversationState === _ConversationState.ConversationState.Postchat;
84
58
  };
85
-
86
59
  exports.shouldShowPostChatSurveyPane = shouldShowPostChatSurveyPane;
87
-
88
60
  const shouldShowCallingContainer = state => {
89
61
  return state.appStates.conversationState === _ConversationState.ConversationState.Active && state.appStates.e2vvEnabled;
90
62
  };
91
-
92
63
  exports.shouldShowCallingContainer = shouldShowCallingContainer;
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _ChatAdapterStore = require("../contexts/ChatAdapterStore");
9
-
10
8
  var _react = require("react");
11
-
12
9
  const useChatAdapterStore = () => {
13
10
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
11
  const adapter = (0, _react.useContext)(_ChatAdapterStore.ChatAdapterStore);
15
-
16
12
  if (!adapter) {
17
13
  throw new Error("This hook can only be used on component that is descendants of <ChatAdapterStore.Provider>");
18
14
  }
19
-
20
15
  return adapter;
21
16
  };
22
-
23
17
  var _default = useChatAdapterStore;
24
18
  exports.default = _default;
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = require("react");
9
-
10
8
  var _ChatContextStore = require("../contexts/ChatContextStore");
11
-
12
9
  const useChatContextStore = () => {
13
10
  const context = (0, _react.useContext)(_ChatContextStore.ChatContextStore);
14
-
15
11
  if (!context) {
16
12
  throw new Error("This hook can only be used on component that is descendants of <ChatContextStore.Provider>");
17
13
  }
18
-
19
14
  return context;
20
15
  };
21
-
22
16
  var _default = useChatContextStore;
23
17
  exports.default = _default;
@@ -4,20 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _ChatSDKStore = require("../contexts/ChatSDKStore");
9
-
10
8
  var _react = require("react");
11
-
12
9
  const useChatSDKStore = () => {
13
10
  const sdk = (0, _react.useContext)(_ChatSDKStore.ChatSDKStore);
14
-
15
11
  if (!sdk) {
16
12
  throw new Error("This hook is not called on component that is descendants of <ChatSDKStore.Provider>, or ChatSDK is not passed into LiveChatWidget component.");
17
13
  }
18
-
19
14
  return sdk;
20
15
  };
21
-
22
16
  var _default = useChatSDKStore;
23
17
  exports.default = _default;
package/lib/cjs/index.js CHANGED
@@ -39,13 +39,8 @@ Object.defineProperty(exports, "useChatSDKStore", {
39
39
  return _useChatSDKStore.default;
40
40
  }
41
41
  });
42
-
43
42
  var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
44
-
45
43
  var _useChatContextStore = _interopRequireDefault(require("./hooks/useChatContextStore"));
46
-
47
44
  var _useChatSDKStore = _interopRequireDefault(require("./hooks/useChatSDKStore"));
48
-
49
45
  var _LiveChatWidget = _interopRequireDefault(require("./components/livechatwidget/LiveChatWidget"));
50
-
51
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createOnNewAdapterActivityHandler = void 0;
7
+ var _TelemetryConstants = require("../common/telemetry/TelemetryConstants");
8
+ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
9
+ var _Constants = require("../common/Constants");
10
+ var _TelemetryHelper = require("../common/telemetry/TelemetryHelper");
11
+ const createOnNewAdapterActivityHandler = (chatId, userId) => {
12
+ const onNewAdapterActivityHandler = activity => {
13
+ var _activity$channelData, _activity$channelData2, _activity$channelData3;
14
+ const isActivityMessage = (activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message;
15
+ const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(_Constants.Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
16
+ raiseMessageEvent(activity, isHistoryMessage);
17
+ };
18
+ const raiseMessageEvent = (activity, isHistoryMessage) => {
19
+ if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message) {
20
+ var _text, _text2, _activity$channelData4, _activity$from;
21
+ const payload = {
22
+ // To identify hidden contents vs empty content
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ text: (activity === null || activity === void 0 ? void 0 : (_text = activity.text) === null || _text === void 0 ? void 0 : _text.length) >= 1 ? `*contents hidden (${activity === null || activity === void 0 ? void 0 : (_text2 = activity.text) === null || _text2 === void 0 ? void 0 : _text2.length} chars)*` : "",
25
+ type: activity === null || activity === void 0 ? void 0 : activity.type,
26
+ timestamp: activity === null || activity === void 0 ? void 0 : activity.timestamp,
27
+ userId: userId,
28
+ tags: activity === null || activity === void 0 ? void 0 : (_activity$channelData4 = activity.channelData) === null || _activity$channelData4 === void 0 ? void 0 : _activity$channelData4.tags,
29
+ messageType: ""
30
+ };
31
+ if ((activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === _Constants.Constants.userMessageTag) {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ payload.messageType = _Constants.Constants.userMessageTag;
34
+ const newMessageSentEvent = {
35
+ eventName: _TelemetryConstants.BroadcastEvent.NewMessageSent,
36
+ payload: payload
37
+ };
38
+ _omnichannelChatComponents.BroadcastService.postMessage(newMessageSentEvent);
39
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
40
+ Event: _TelemetryConstants.TelemetryEvent.MessageSent,
41
+ Description: "New message sent"
42
+ });
43
+ } else {
44
+ var _activity$channelData5, _activity$channelData6;
45
+ if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(_Constants.Constants.systemMessageTag)) {
46
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
+ payload.messageType = _Constants.Constants.systemMessageTag;
48
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
49
+ Event: _TelemetryConstants.TelemetryEvent.SystemMessageReceived,
50
+ Description: "System message received"
51
+ });
52
+ } else {
53
+ var _activity$channelData7, _activity$channelData8, _activity$channelData9;
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ const messageHasNoText = !(activity !== null && activity !== void 0 && activity.text);
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ const messageHasNoTags = !(activity !== null && activity !== void 0 && activity.channelData) || !(activity !== null && activity !== void 0 && (_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && _activity$channelData7.tags) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData8 = activity.channelData) === null || _activity$channelData8 === void 0 ? void 0 : (_activity$channelData9 = _activity$channelData8.tags) === null || _activity$channelData9 === void 0 ? void 0 : _activity$channelData9.length) === 0;
58
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
+ const messageHasNoAttachments = !(activity !== null && activity !== void 0 && activity.attachments) || (activity === null || activity === void 0 ? void 0 : activity.attachments.length) === 0;
60
+ if (messageHasNoTags && messageHasNoText && messageHasNoAttachments) {
61
+ return;
62
+ }
63
+ payload.messageType = _Constants.Constants.userMessageTag;
64
+ }
65
+ const newMessageReceivedEvent = {
66
+ eventName: isHistoryMessage ? _TelemetryConstants.BroadcastEvent.HistoryMessageReceived : _TelemetryConstants.BroadcastEvent.NewMessageReceived,
67
+ payload: payload
68
+ };
69
+ _omnichannelChatComponents.BroadcastService.postMessage(newMessageReceivedEvent);
70
+ if (!isHistoryMessage) {
71
+ _TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
72
+ Event: _TelemetryConstants.TelemetryEvent.MessageReceived,
73
+ Description: "New message received",
74
+ Data: payload
75
+ });
76
+ }
77
+ }
78
+ }
79
+ };
80
+ return onNewAdapterActivityHandler;
81
+ };
82
+ exports.createOnNewAdapterActivityHandler = createOnNewAdapterActivityHandler;
@@ -8,4 +8,5 @@ export const PDFIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy
8
8
  export const PowerpointIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ3NXYxNDQ1cTAgMjctMTAgNTB0LTI3IDQwLTQxIDI4LTUwIDEwSDY0MHEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTB2LTI1NkgxMTVxLTI0IDAtNDQtOXQtM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+";
@@ -1,276 +1,184 @@
1
1
  var _class;
2
-
3
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  export class Constants {}
6
-
6
+ _defineProperty(Constants, "magicCodeBroadcastChannel", "MagicCodeChannel");
7
+ _defineProperty(Constants, "magicCodeResponseBroadcastChannel", "MagicCodeResponseChannel");
7
8
  _defineProperty(Constants, "systemMessageTag", "system");
8
-
9
9
  _defineProperty(Constants, "userMessageTag", "user");
10
-
10
+ _defineProperty(Constants, "historyMessageTag", "history");
11
11
  _defineProperty(Constants, "agentEndConversationMessageTag", "agentendconversation");
12
-
12
+ _defineProperty(Constants, "supervisorForceCloseMessageTag", "supervisorforceclosedconversation");
13
13
  _defineProperty(Constants, "receivedMessageClassName", "ms_lcw_webchat_received_message");
14
-
15
14
  _defineProperty(Constants, "sentMessageClassName", "ms_lcw_webchat_sent_message");
16
-
17
15
  _defineProperty(Constants, "webchatChannelId", "webchat");
18
-
19
16
  _defineProperty(Constants, "markdown", "markdown");
20
-
21
17
  _defineProperty(Constants, "actionType", "actionType");
22
-
23
18
  _defineProperty(Constants, "String", "string");
24
-
25
19
  _defineProperty(Constants, "ChatMessagesJson", "chatMessagesJson");
26
-
27
20
  _defineProperty(Constants, "truePascal", "True");
28
-
29
21
  _defineProperty(Constants, "true", "true");
30
-
31
22
  _defineProperty(Constants, "false", "false");
32
-
33
23
  _defineProperty(Constants, "maximumUnreadMessageCount", 99);
34
-
35
- _defineProperty(Constants, "widgetStateDataKey", "LcwChatWidgetState");
36
-
37
24
  _defineProperty(Constants, "channelIdKey", "ChannelId-");
38
-
39
25
  _defineProperty(Constants, "ChannelId", "lcw");
40
-
41
26
  _defineProperty(Constants, "CustomerTag", "FromCustomer");
42
-
43
27
  _defineProperty(Constants, "GifContentType", "image/gif");
44
-
45
28
  _defineProperty(Constants, "video", "video");
46
-
47
29
  _defineProperty(Constants, "audio", "audio");
48
-
49
30
  _defineProperty(Constants, "controlsList", "controlsList");
50
-
51
31
  _defineProperty(Constants, "nodownload", "nodownload");
52
-
53
32
  _defineProperty(Constants, "activity", "activity");
54
-
55
33
  _defineProperty(Constants, "payload", "payload");
56
-
57
34
  _defineProperty(Constants, "text", "text");
58
-
59
35
  _defineProperty(Constants, "blank", "_blank");
60
-
61
36
  _defineProperty(Constants, "visitorIdPrefix", "8:");
62
-
63
37
  _defineProperty(Constants, "left", "left");
64
-
65
38
  _defineProperty(Constants, "queuePositionMessageTag", "queueposition");
66
-
67
39
  _defineProperty(Constants, "averageWaitTimeMessageTag", "averagewaittime");
68
-
69
40
  _defineProperty(Constants, "message", "message");
70
-
41
+ _defineProperty(Constants, "hiddenTag", "Hidden");
42
+ _defineProperty(Constants, "prefixTimestampTag", "ServerMessageTimestamp_");
43
+ _defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
44
+ _defineProperty(Constants, "publicMessageTag", "public");
71
45
  _defineProperty(Constants, "supportedAdaptiveCardContentTypes", ["application/vnd.microsoft.card.adaptive", "application/vnd.microsoft.card.audio", "application/vnd.microsoft.card.hero", "application/vnd.microsoft.card.receipt", "application/vnd.microsoft.card.thumbnail", "application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"]);
72
-
73
46
  _defineProperty(Constants, "maxUploadFileSize", "500000");
74
-
75
- _defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp)$/i);
76
-
77
- _defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|flac|mp2|mp3|pcm|wav|wma)$/i);
78
-
47
+ _defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp|webp)$/i);
48
+ _defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|amr|flac|mp2|mp3|pcm|wav|wma)$/i);
79
49
  _defineProperty(Constants, "videoMediaRegex", /(\.)(avchd|avi|flv|mpe|mpeg|mpg|mpv|mp4|m4p|m4v|mov|qt|swf|webm|wmv)$/i);
80
-
81
50
  _defineProperty(Constants, "chromeSupportedInlineMediaRegex", /(\.)(aac|mp3|wav|mp4)$/i);
82
-
83
51
  _defineProperty(Constants, "firefoxSupportedInlineMediaRegex", /(\.)(aac|flac|mp3|wav|mp4|mov)$/i);
84
-
85
52
  _defineProperty(Constants, "CallAdded", "callAdded");
86
-
87
53
  _defineProperty(Constants, "LocalVideoStreamAdded", "localVideoStreamAdded");
88
-
89
54
  _defineProperty(Constants, "LocalVideoStreamRemoved", "localVideoStreamRemoved");
90
-
91
55
  _defineProperty(Constants, "RemoteVideoStreamAdded", "remoteVideoStreamAdded");
92
-
93
56
  _defineProperty(Constants, "RemoteVideoStreamRemoved", "remoteVideoStreamRemoved");
94
-
95
57
  _defineProperty(Constants, "CallDisconnected", "callDisconnected");
96
-
97
58
  _defineProperty(Constants, "IncomingCallEnded", "incomingCallEnded");
98
-
99
59
  _defineProperty(Constants, "VoiceVideoInitialize", "voiceVideoInitialize");
100
-
101
60
  _defineProperty(Constants, "VoiceVideoInitializeException", "voiceVideoInitializeOnException");
102
-
103
61
  _defineProperty(Constants, "VoiceVideoLoading", "voiceVideoLoading");
104
-
105
62
  _defineProperty(Constants, "VoiceVideoNotLoaded", "voiceVideoNotLoaded");
106
-
107
63
  _defineProperty(Constants, "VoiceVideoLoadingException", "voiceVideoLoadingOnException");
108
-
109
64
  _defineProperty(Constants, "VoiceVideoAcceptCallException", "voiceVideoAcceptCallOnException");
110
-
111
65
  _defineProperty(Constants, "VoiceVideoAcceptCallWithVideoException", "voiceVideoAcceptCallWithVideoException");
112
-
113
66
  _defineProperty(Constants, "defaultDownloadTranscriptError", "Download transcript failed.");
114
-
115
67
  _defineProperty(Constants, "ProactiveChatInviteTimeoutInMs", 60000);
116
-
117
68
  _defineProperty(Constants, "InputSubmit", "InputSubmit");
118
-
119
69
  _defineProperty(Constants, "ReconnectIdAttributeName", "oc.reconnectid");
120
-
121
- _defineProperty(Constants, "redirectPageRequest", "redirectPageRequest");
122
-
123
70
  _defineProperty(Constants, "LiveChatWidget", "LiveChatWidgetNew");
124
-
125
71
  _defineProperty(Constants, "GuidPattern", "xx-x-4m-ym-xxx");
126
-
127
72
  _defineProperty(Constants, "Default", "default");
128
-
129
73
  _defineProperty(Constants, "Zero", "zero");
130
-
131
74
  _defineProperty(Constants, "Title", "title");
132
-
133
75
  _defineProperty(Constants, "Target", "target");
134
-
135
76
  _defineProperty(Constants, "Blank", "_blank");
136
-
137
77
  _defineProperty(Constants, "TargetRelationship", "rel");
138
-
139
78
  _defineProperty(Constants, "TargetRelationshipAttributes", "noopener noreferrer");
140
-
141
79
  _defineProperty(Constants, "OpenLinkIconCssClass", "webchat__markdown__external-link-icon");
142
-
143
80
  _defineProperty(Constants, "internetConnectionTestUrl", "https://ocsdk-prod.azureedge.net/public/connecttest.txt");
144
-
145
81
  _defineProperty(Constants, "internetConnectionTestUrlText", "Omnichannel Connect Test");
146
-
82
+ _defineProperty(Constants, "ChatWidgetStateChangedPrefix", "ChatWidgetStateChanged");
83
+ _defineProperty(Constants, "PostChatLoadingDurationInMs", 2000);
84
+ _defineProperty(Constants, "BrowserUnloadConfirmationMessage", "Do you want to leave chat?");
85
+ _defineProperty(Constants, "CacheTtlInMinutes", 15);
147
86
  export const Regex = (_class = class Regex {}, _defineProperty(_class, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _class);
148
87
  export class HtmlIdNames {}
149
-
150
88
  _defineProperty(HtmlIdNames, "MSLiveChatWidget", "MSLiveChatWidget");
151
-
152
89
  export class HtmlClassNames {}
153
-
154
90
  _defineProperty(HtmlClassNames, "webChatBannerCloseButton", "webchat__toast__dismissButton");
155
-
156
91
  _defineProperty(HtmlClassNames, "webChatBannerExpandButton", "webchat__toaster__expandIcon");
157
-
158
92
  export class HtmlElementSelectors {}
159
-
160
93
  _defineProperty(HtmlElementSelectors, "sendBoxSelector", "textarea[data-id=\"webchat-sendbox-input\"]");
161
-
162
94
  export class HtmlAttributeNames {}
163
-
164
95
  _defineProperty(HtmlAttributeNames, "role", "role");
165
-
166
96
  _defineProperty(HtmlAttributeNames, "navigation", "navigation");
167
-
168
97
  _defineProperty(HtmlAttributeNames, "ariaLabel", "aria-label");
169
-
170
98
  _defineProperty(HtmlAttributeNames, "ariaLive", "aria-live");
171
-
172
99
  _defineProperty(HtmlAttributeNames, "ariaDisabled", "aria-disabled");
173
-
174
100
  _defineProperty(HtmlAttributeNames, "form", "form");
175
-
176
101
  _defineProperty(HtmlAttributeNames, "ariaLabelledby", "aria-labelledby");
177
-
178
102
  _defineProperty(HtmlAttributeNames, "tabindex", "tabindex");
179
-
180
103
  _defineProperty(HtmlAttributeNames, "ariaRequired", "aria-required");
181
-
182
104
  _defineProperty(HtmlAttributeNames, "ariaDesribedby", "aria-describedby");
183
-
184
105
  _defineProperty(HtmlAttributeNames, "ariaHidden", "aria-hidden");
185
-
186
106
  _defineProperty(HtmlAttributeNames, "disabled", "disabled");
187
-
188
107
  _defineProperty(HtmlAttributeNames, "hidden", "hidden");
189
-
190
108
  _defineProperty(HtmlAttributeNames, "download", "download");
191
-
192
109
  _defineProperty(HtmlAttributeNames, "href", "href");
193
-
194
110
  _defineProperty(HtmlAttributeNames, "region", "region");
195
-
196
111
  _defineProperty(HtmlAttributeNames, "button", "button");
197
-
198
112
  _defineProperty(HtmlAttributeNames, "input", "Input");
199
-
200
113
  _defineProperty(HtmlAttributeNames, "style", "style");
201
-
202
114
  _defineProperty(HtmlAttributeNames, "head", "head");
203
-
204
115
  _defineProperty(HtmlAttributeNames, "type", "type");
205
-
206
116
  _defineProperty(HtmlAttributeNames, "csstext", "text/css");
207
-
208
117
  _defineProperty(HtmlAttributeNames, "listItem", "LI");
209
-
210
118
  _defineProperty(HtmlAttributeNames, "unorderedList", "UL");
211
-
212
119
  _defineProperty(HtmlAttributeNames, "div", "div");
213
-
214
120
  _defineProperty(HtmlAttributeNames, "aTagName", "a");
215
-
216
121
  _defineProperty(HtmlAttributeNames, "noopenerTag", "noopener");
217
-
218
122
  _defineProperty(HtmlAttributeNames, "noreferrerTag", "noreferrer");
219
-
220
123
  _defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
221
-
222
124
  _defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
223
-
224
125
  _defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
225
-
126
+ _defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
226
127
  export class WebChatMiddlewareConstants {}
227
-
228
128
  _defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
229
-
230
129
  _defineProperty(WebChatMiddlewareConstants, "timeBetweenTimestampGroups", 300000);
231
-
232
130
  _defineProperty(WebChatMiddlewareConstants, "maxTextLength", 6000);
233
-
234
131
  _defineProperty(WebChatMiddlewareConstants, "adaptiveCard", "AdaptiveCard");
235
-
236
132
  export class MimeTypes {}
237
-
238
133
  _defineProperty(MimeTypes, "UnknownFileType", "application/octet-stream");
239
-
240
134
  export class LocaleConstants {}
241
-
242
135
  _defineProperty(LocaleConstants, "RTL_LOCALES", ["1025", "1037"]);
243
-
244
136
  export let ElementType;
245
-
246
137
  (function (ElementType) {
247
138
  ElementType["CallingContainerSDK"] = "CallingContainerSDK";
248
139
  })(ElementType || (ElementType = {}));
249
-
250
140
  export let ChatSDKError;
251
-
252
141
  (function (ChatSDKError) {
253
142
  ChatSDKError["WidgetUseOutsideOperatingHour"] = "WidgetUseOutsideOperatingHour";
254
143
  })(ChatSDKError || (ChatSDKError = {}));
255
-
144
+ export let EnvironmentVersion;
145
+ (function (EnvironmentVersion) {
146
+ EnvironmentVersion["prod"] = "prod";
147
+ EnvironmentVersion["dogfood"] = "df";
148
+ EnvironmentVersion["int"] = "int";
149
+ EnvironmentVersion["test"] = "test";
150
+ })(EnvironmentVersion || (EnvironmentVersion = {}));
151
+ export let E2VVOptions;
152
+ (function (E2VVOptions) {
153
+ E2VVOptions["NoCalling"] = "192350000";
154
+ E2VVOptions["VideoAndVoiceCalling"] = "192350001";
155
+ E2VVOptions["VoiceOnly"] = "192350002";
156
+ })(E2VVOptions || (E2VVOptions = {}));
157
+ export let LiveWorkItemState;
158
+ (function (LiveWorkItemState) {
159
+ LiveWorkItemState["Active"] = "Active";
160
+ LiveWorkItemState["Closed"] = "Closed";
161
+ LiveWorkItemState["Open"] = "Open";
162
+ LiveWorkItemState["Waiting"] = "Waiting";
163
+ LiveWorkItemState["WrapUp"] = "WrapUp";
164
+ })(LiveWorkItemState || (LiveWorkItemState = {}));
256
165
  export class TranscriptConstants {}
257
-
258
166
  _defineProperty(TranscriptConstants, "ChatTranscriptsBodyColor", "#F5F5F5");
259
-
260
167
  _defineProperty(TranscriptConstants, "TranscriptMessageEmojiMessageType", "http://schema.skype.com/emoji");
261
-
262
168
  _defineProperty(TranscriptConstants, "ChatTranscriptDownloadFile", "ChatTranscripts.html");
263
-
264
169
  _defineProperty(TranscriptConstants, "DefaultFileAttachmentName", "Untitled.txt");
265
-
266
170
  _defineProperty(TranscriptConstants, "CustomerDialogColor", "#E8E8E8");
267
-
268
171
  _defineProperty(TranscriptConstants, "CustomerFontColor", "black");
269
-
270
172
  _defineProperty(TranscriptConstants, "AdaptiveCardType", "adaptivecard");
271
-
272
173
  _defineProperty(TranscriptConstants, "InternalMode", "internal");
273
-
274
174
  _defineProperty(TranscriptConstants, "AgentDialogColor", "#2266E3");
275
-
276
- _defineProperty(TranscriptConstants, "AgentFontColor", "white");
175
+ _defineProperty(TranscriptConstants, "AgentFontColor", "white");
176
+ export class AriaTelemetryConstants {}
177
+ _defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
178
+ _defineProperty(AriaTelemetryConstants, "GCCH_ENDPOINT", "https://tb.pipe.aria.microsoft.com/Collector/3.0/");
179
+ _defineProperty(AriaTelemetryConstants, "DOD_ENDPOINT", "https://pf.pipe.aria.microsoft.com/Collector/3.0");
180
+ _defineProperty(AriaTelemetryConstants, "EUROPE_ENDPOINT", "https://eu-mobile.events.data.microsoft.com/Collector/3.0/");
181
+ _defineProperty(AriaTelemetryConstants, "MOONCAKE_ENDPOINT", "");
182
+ _defineProperty(AriaTelemetryConstants, "Public", "Public");
183
+ _defineProperty(AriaTelemetryConstants, "EU", "Europe");
184
+ _defineProperty(AriaTelemetryConstants, "lcwEUDomainNames", ["crm4.omnichannelengagementhub.com", "crm12.omnichannelengagementhub.com", "crm16.omnichannelengagementhub.com", "crm17.omnichannelengagementhub.com", "crm19.omnichannelengagementhub.com"]);
@@ -1,5 +1,5 @@
1
1
  var _class;
2
-
3
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4
-
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
5
  export const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "TAB", "Tab"), _class);
@@ -1,5 +1,5 @@
1
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
-
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3
4
  export class DataStoreManager {}
4
-
5
5
  _defineProperty(DataStoreManager, "clientDataStore", void 0);
@@ -0,0 +1,18 @@
1
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
+ import { BroadcastService } from "@microsoft/omnichannel-chat-components";
5
+ import { getWidgetCacheId } from "../../utils";
6
+ import { defaultClientDataStoreProvider } from "./defaultClientDataStoreProvider";
7
+ export class defaultCacheManager {}
8
+ _defineProperty(defaultCacheManager, "InternalCache", {});
9
+ export const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId, ttlInMins) => {
10
+ const widgetCacheId = getWidgetCacheId(orgid, widgetId, widgetInstanceId);
11
+ BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
12
+ try {
13
+ defaultClientDataStoreProvider(ttlInMins).setData(widgetCacheId, JSON.stringify(msg.payload), "localStorage");
14
+ } catch (error) {
15
+ console.error("Error in setting data to localstorage", error);
16
+ }
17
+ });
18
+ };