@microsoft/omnichannel-chat-widget 0.1.0-main.e67738e → 0.1.0-main.ec08ec5

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 (262) hide show
  1. package/lib/cjs/common/Constants.js +0 -167
  2. package/lib/cjs/common/KeyCodes.js +0 -3
  3. package/lib/cjs/common/contextDataStore/DataStoreManager.js +0 -4
  4. package/lib/cjs/common/storage/default/defaultCacheManager.js +24 -0
  5. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +102 -0
  6. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +78 -0
  7. package/lib/cjs/common/telemetry/TelemetryConstants.js +21 -22
  8. package/lib/cjs/common/telemetry/TelemetryHelper.js +16 -57
  9. package/lib/cjs/common/telemetry/TelemetryManager.js +0 -31
  10. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +0 -2
  11. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +30 -36
  12. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +0 -9
  13. package/lib/cjs/common/utils.js +18 -105
  14. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +8 -46
  15. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +2 -24
  16. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -32
  17. package/lib/cjs/components/dimlayer/DimLayer.js +0 -4
  18. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -36
  19. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -8
  20. package/lib/cjs/components/footerstateful/FooterStateful.js +11 -42
  21. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +0 -6
  22. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -45
  23. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -8
  24. package/lib/cjs/components/headerstateful/HeaderStateful.js +12 -27
  25. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -14
  26. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +2 -9
  27. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -5
  28. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -11
  29. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +11 -19
  30. package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -10
  31. package/lib/cjs/components/livechatwidget/common/authHelper.js +13 -15
  32. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -13
  33. package/lib/cjs/components/livechatwidget/common/createFooter.js +4 -23
  34. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -14
  35. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +16 -24
  36. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +55 -36
  37. package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +0 -3
  38. package/lib/cjs/components/livechatwidget/common/endChat.js +8 -33
  39. package/lib/cjs/components/livechatwidget/common/getGeneralStylesForButton.js +0 -6
  40. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +7 -16
  41. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -8
  42. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -54
  43. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +36 -66
  44. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +4 -17
  45. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -11
  46. package/lib/cjs/components/livechatwidget/common/shareObservable.js +4 -8
  47. package/lib/cjs/components/livechatwidget/common/startChat.js +55 -86
  48. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +0 -8
  49. package/lib/cjs/components/livechatwidget/common/updateSessionDataForTelemetry.js +2 -11
  50. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +125 -196
  51. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +4 -17
  52. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +4 -17
  53. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -17
  54. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -23
  55. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  56. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +13 -0
  57. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  58. package/lib/cjs/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  59. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +8 -36
  60. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +2 -32
  61. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -24
  62. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +21 -37
  63. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +0 -7
  64. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -6
  65. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +9 -26
  66. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -17
  67. package/lib/cjs/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -24
  68. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -15
  69. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -8
  70. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +0 -4
  71. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -4
  72. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  73. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  74. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  75. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  76. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  77. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  78. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  79. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  80. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +0 -7
  81. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -5
  82. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -41
  83. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +9 -19
  84. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -60
  85. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +7 -15
  86. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -13
  87. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -16
  88. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +10 -0
  89. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +10 -0
  90. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  91. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  92. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +10 -0
  93. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -9
  94. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +2 -30
  95. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -12
  96. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +6 -28
  97. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  98. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +13 -30
  99. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -9
  100. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -34
  101. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -10
  102. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +1 -12
  103. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +16 -19
  104. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +1 -9
  105. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -9
  106. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +13 -34
  107. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +1 -10
  108. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +7 -11
  109. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +5 -14
  110. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -21
  111. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -12
  112. package/lib/cjs/contexts/ChatAdapterStore.js +0 -2
  113. package/lib/cjs/contexts/ChatContextStore.js +0 -2
  114. package/lib/cjs/contexts/ChatSDKStore.js +0 -2
  115. package/lib/cjs/contexts/common/ConversationState.js +0 -1
  116. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -2
  117. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +8 -10
  118. package/lib/cjs/contexts/createReducer.js +135 -106
  119. package/lib/cjs/controller/componentController.js +1 -30
  120. package/lib/cjs/hooks/useChatAdapterStore.js +0 -6
  121. package/lib/cjs/hooks/useChatContextStore.js +0 -6
  122. package/lib/cjs/hooks/useChatSDKStore.js +0 -6
  123. package/lib/cjs/index.js +0 -5
  124. package/lib/cjs/plugins/newMessageEventHandler.js +15 -36
  125. package/lib/esm/common/Constants.js +0 -155
  126. package/lib/esm/common/KeyCodes.js +0 -2
  127. package/lib/esm/common/contextDataStore/DataStoreManager.js +0 -2
  128. package/lib/esm/common/storage/default/defaultCacheManager.js +16 -0
  129. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +95 -0
  130. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +70 -0
  131. package/lib/esm/common/telemetry/TelemetryConstants.js +25 -19
  132. package/lib/esm/common/telemetry/TelemetryHelper.js +16 -45
  133. package/lib/esm/common/telemetry/TelemetryManager.js +0 -18
  134. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +28 -24
  135. package/lib/esm/common/telemetry/loggers/consoleLogger.js +0 -5
  136. package/lib/esm/common/utils.js +18 -53
  137. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +8 -17
  138. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +2 -7
  139. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +10 -13
  140. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -15
  141. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.spec.js +6 -6
  142. package/lib/esm/components/footerstateful/FooterStateful.js +13 -23
  143. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +7 -35
  144. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.spec.js +6 -6
  145. package/lib/esm/components/headerstateful/HeaderStateful.js +12 -12
  146. package/lib/esm/components/livechatwidget/LiveChatWidget.js +2 -2
  147. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +2 -6
  148. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +0 -3
  149. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +4 -8
  150. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +11 -15
  151. package/lib/esm/components/livechatwidget/common/Deferred.js +3 -8
  152. package/lib/esm/components/livechatwidget/common/authHelper.js +13 -10
  153. package/lib/esm/components/livechatwidget/common/createAdapter.js +4 -6
  154. package/lib/esm/components/livechatwidget/common/createFooter.js +4 -16
  155. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +2 -5
  156. package/lib/esm/components/livechatwidget/common/createMarkdown.js +18 -18
  157. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +57 -23
  158. package/lib/esm/components/livechatwidget/common/endChat.js +10 -18
  159. package/lib/esm/components/livechatwidget/common/getGeneralStylesForButton.js +0 -2
  160. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +9 -11
  161. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -5
  162. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +18 -19
  163. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +37 -51
  164. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +4 -9
  165. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +4 -3
  166. package/lib/esm/components/livechatwidget/common/shareObservable.js +4 -7
  167. package/lib/esm/components/livechatwidget/common/startChat.js +57 -59
  168. package/lib/esm/components/livechatwidget/common/updateSessionDataForTelemetry.js +4 -2
  169. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +126 -129
  170. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +4 -5
  171. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +4 -5
  172. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +4 -5
  173. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +32 -11
  174. package/lib/esm/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +1 -1
  175. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +6 -0
  176. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +0 -1
  177. package/lib/esm/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  178. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -20
  179. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +4 -8
  180. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -6
  181. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +19 -11
  182. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  183. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +9 -18
  184. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -13
  185. package/lib/esm/components/webchatcontainerstateful/common/utils/BrowserInfo.js +2 -16
  186. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +3 -5
  187. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +5 -6
  188. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +0 -2
  189. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +0 -2
  190. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +0 -1
  191. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +0 -1
  192. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +0 -1
  193. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +0 -1
  194. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +0 -1
  195. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +0 -1
  196. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +0 -1
  197. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +0 -1
  198. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +2 -5
  199. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +0 -4
  200. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +17 -26
  201. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +11 -11
  202. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +23 -38
  203. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +9 -8
  204. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +2 -9
  205. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +0 -14
  206. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +3 -0
  207. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +3 -0
  208. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -1
  209. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -1
  210. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +3 -0
  211. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.js +3 -7
  212. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +4 -28
  213. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +3 -3
  214. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +7 -14
  215. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +3 -3
  216. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +15 -19
  217. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +5 -8
  218. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -29
  219. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -7
  220. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +3 -8
  221. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +16 -14
  222. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -7
  223. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -7
  224. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +15 -27
  225. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -5
  226. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +9 -9
  227. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +7 -9
  228. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +1 -13
  229. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +0 -5
  230. package/lib/esm/contexts/ChatAdapterStore.js +2 -1
  231. package/lib/esm/contexts/ChatContextStore.js +2 -1
  232. package/lib/esm/contexts/ChatSDKStore.js +2 -1
  233. package/lib/esm/contexts/common/ConversationState.js +0 -1
  234. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -2
  235. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +8 -6
  236. package/lib/esm/contexts/createReducer.js +135 -103
  237. package/lib/esm/controller/componentController.js +2 -1
  238. package/lib/esm/hooks/useChatAdapterStore.js +0 -4
  239. package/lib/esm/hooks/useChatContextStore.js +0 -4
  240. package/lib/esm/hooks/useChatSDKStore.js +0 -4
  241. package/lib/esm/plugins/newMessageEventHandler.js +15 -26
  242. package/lib/types/common/storage/default/defaultCacheManager.d.ts +4 -0
  243. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
  244. package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
  245. package/lib/types/common/telemetry/TelemetryConstants.d.ts +9 -2
  246. package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
  247. package/lib/types/components/livechatwidget/common/authHelper.d.ts +3 -2
  248. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -5
  249. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -2
  250. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
  251. package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -0
  252. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
  253. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  254. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +4 -1
  255. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  256. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
  257. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -0
  258. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -0
  259. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -1
  260. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +1 -1
  261. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
  262. package/package.json +3 -3
@@ -3,25 +3,13 @@ import React from "react";
3
3
  import { decodeComponentString } from "@microsoft/omnichannel-chat-components";
4
4
  import { shouldShowFooter } from "../../../controller/componentController";
5
5
  export const createFooter = (props, state) => {
6
- var _props$footerProps, _props$controlProps, _props$componentOverr, _props$componentOverr2;
7
-
8
- const footerPropsHidden = { ...props.footerProps,
9
- controlProps: { ...((_props$footerProps = props.footerProps) === null || _props$footerProps === void 0 ? void 0 : _props$footerProps.controlProps),
10
- hideDownloadTranscriptButton: true,
11
- hideEmailTranscriptButton: true,
12
- hideAudioNotificationButton: true
13
- }
14
- };
15
- const footer = !((_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideFooter) && shouldShowFooter(state) ? decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.footer) || /*#__PURE__*/React.createElement(FooterStateful, {
6
+ var _props$controlProps, _props$componentOverr;
7
+ const hideFooterDisplay = !((_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideFooter) && shouldShowFooter(state) ? false : true;
8
+ const footer = decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.footer) || /*#__PURE__*/React.createElement(FooterStateful, {
16
9
  footerProps: props.footerProps,
17
10
  downloadTranscriptProps: props.downloadTranscriptProps,
18
11
  audioNotificationProps: props.audioNotificationProps,
19
- hideFooterDisplay: false
20
- }) : decodeComponentString((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.footer) || /*#__PURE__*/React.createElement(FooterStateful, {
21
- footerProps: footerPropsHidden,
22
- downloadTranscriptProps: props.downloadTranscriptProps,
23
- audioNotificationProps: props.audioNotificationProps,
24
- hideFooterDisplay: true
12
+ hideFooterDisplay: hideFooterDisplay
25
13
  });
26
14
  return footer;
27
15
  };
@@ -4,7 +4,6 @@ import { NotificationScenarios } from "../../webchatcontainerstateful/webchatcon
4
4
  import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
5
5
  import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
6
6
  import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
7
-
8
7
  const isInternetConnected = async () => {
9
8
  try {
10
9
  const response = await fetch(Constants.internetConnectionTestUrl);
@@ -14,11 +13,9 @@ const isInternetConnected = async () => {
14
13
  return false;
15
14
  }
16
15
  };
17
-
18
16
  export const createInternetConnectionChangeHandler = async () => {
19
17
  const handler = async () => {
20
18
  const connected = await isInternetConnected();
21
-
22
19
  if (!connected) {
23
20
  TelemetryHelper.logActionEvent(LogLevel.WARN, {
24
21
  Event: TelemetryEvent.NetworkDisconnected
@@ -30,9 +27,9 @@ export const createInternetConnectionChangeHandler = async () => {
30
27
  });
31
28
  NotificationHandler.notifySuccess(NotificationScenarios.InternetConnection, defaultMiddlewareLocalizedTexts.MIDDLEWARE_BANNER_INTERNET_BACK_ONLINE);
32
29
  }
33
- }; // Checking connection status on online & offline events due to possible false positives
34
-
30
+ };
35
31
 
32
+ // Checking connection status on online & offline events due to possible false positives
36
33
  window.addEventListener("online", () => handler(), false);
37
34
  window.addEventListener("offline", () => handler(), false);
38
35
  };
@@ -1,17 +1,18 @@
1
1
  import MarkdownIt from "markdown-it";
2
2
  import MarkdownItForInline from "markdown-it-for-inline";
3
3
  import { defaultMarkdownLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts";
4
- import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
+ import { Constants } from "../../../common/Constants";
5
5
 
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
7
  export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineMarkdownSupport) => {
7
8
  let markdown;
8
-
9
9
  if (!disableMarkdownMessageFormatting) {
10
10
  markdown = new MarkdownIt(Constants.Default, {
11
11
  html: true,
12
12
  linkify: true,
13
13
  breaks: !disableNewLineMarkdownSupport
14
- }); // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
14
+ });
15
+ // ToDo: Commenting below usage of plugin until deferred bug is resolved: https://github.com/mayashavin/markdown-it-slack/issues/1
15
16
  // markdown.use(MarkdownSlack);
16
17
  } else {
17
18
  markdown = new MarkdownIt(Constants.Zero, {
@@ -19,38 +20,37 @@ export const createMarkdown = (disableMarkdownMessageFormatting, disableNewLineM
19
20
  linkify: true,
20
21
  breaks: !disableNewLineMarkdownSupport
21
22
  });
22
- markdown.enable(["entity", // Rule to process html entity - {, ¯, "
23
- "linkify", // Rule to replace link-like texts with link nodes
24
- "html_block", // Rule to process html blocks and paragraphs
25
- "html_inline", // Rule to process html tags
23
+ markdown.enable(["entity",
24
+ // Rule to process html entity - {, ¯, "
25
+ "linkify",
26
+ // Rule to replace link-like texts with link nodes
27
+ "html_block",
28
+ // Rule to process html blocks and paragraphs
29
+ "html_inline",
30
+ // Rule to process html tags
26
31
  "newline" // Rule to proceess '\n'
27
32
  ]);
28
- } // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
-
33
+ }
30
34
 
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
36
  markdown.use(MarkdownItForInline, "url_new_win", "link_open", function (tokens, idx, env) {
32
- const targetAttrIndex = tokens[idx].attrIndex(Constants.Target); // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
33
-
37
+ const targetAttrIndex = tokens[idx].attrIndex(Constants.Target);
38
+ // Put a transparent pixel instead of the "open in new window" icon, so developers can easily modify the icon in CSS.
34
39
  const TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
35
-
36
40
  if (~targetAttrIndex) {
37
41
  tokens[idx].attrs[targetAttrIndex][1] = Constants.Blank;
38
42
  } else {
39
43
  tokens[idx].attrPush([Constants.Target, Constants.Blank]);
40
44
  }
41
-
42
45
  const relAttrIndex = tokens[idx].attrIndex(Constants.TargetRelationship);
43
-
44
46
  if (~relAttrIndex) {
45
47
  tokens[idx].attrs[relAttrIndex][1] = Constants.TargetRelationshipAttributes;
46
48
  } else {
47
49
  tokens[idx].attrPush([Constants.TargetRelationship, Constants.TargetRelationshipAttributes]);
48
-
49
50
  if (!disableMarkdownMessageFormatting) {
50
- tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]); // eslint-disable-next-line quotes
51
-
51
+ tokens[idx].attrPush([Constants.Title, defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT]);
52
+ // eslint-disable-next-line quotes
52
53
  const iconTokens = markdown.parseInline(`![${defaultMarkdownLocalizedTexts.MARKDOWN_EXTERNAL_LINK_ALT}](${TRANSPARENT_GIF})`, env)[0].children;
53
-
54
54
  if (iconTokens && iconTokens.length > 0) {
55
55
  iconTokens[0].attrJoin("class", Constants.OpenLinkIconCssClass);
56
56
  tokens.splice(idx + 2, 0, ...iconTokens);
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/no-explicit-any */
2
+
2
3
  import { ChatReconnectIconBase64, CloseChatButtonIconBase64, ModernChatIconBase64, ProactiveChatBannerBase64 } from "@microsoft/omnichannel-chat-components";
3
4
  import MockAdapter from "../../../webchatcontainerstateful/common/mockadapter";
4
5
  import { NewMessageNotificationSoundBase64 } from "../../../../assets/Audios";
@@ -10,8 +11,9 @@ import { createAvatarMiddleware } from "../../../webchatcontainerstateful/webcha
10
11
  import { createMarkdown } from "../createMarkdown";
11
12
  import { groupActivitiesMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
12
13
  import { typingIndicatorMiddleware } from "../../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
13
- import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger"; // eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+ import { createWebChatTelemetry } from "../../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
14
15
 
16
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
17
  export const dummyDefaultProps = {
16
18
  audioNotificationProps: {
17
19
  audioSrc: NewMessageNotificationSoundBase64
@@ -166,24 +168,28 @@ export const dummyDefaultProps = {
166
168
  },
167
169
  audioCallButtonStyleProps: {
168
170
  borderRadius: "50%",
169
- color: "#FFFFFF",
170
171
  backgroundColor: "#008000",
171
172
  lineHeight: "40px",
172
173
  height: "40px",
173
174
  width: "40px",
174
- fontSize: 18
175
+ icon: {
176
+ fontSize: 18,
177
+ color: "#FFFFFF"
178
+ }
175
179
  },
176
180
  audioCallButtonHoverStyleProps: {
177
181
  filter: "brightness(0.8)"
178
182
  },
179
183
  videoCallButtonStyleProps: {
180
184
  borderRadius: "50%",
181
- color: "#FFFFFF",
182
185
  backgroundColor: "#008000",
183
186
  lineHeight: "40px",
184
187
  height: "40px",
185
188
  width: "40px",
186
- fontSize: 18
189
+ icon: {
190
+ fontSize: 18,
191
+ color: "#FFFFFF"
192
+ }
187
193
  },
188
194
  videoCallButtonHoverStyleProps: {
189
195
  filter: "brightness(0.8)"
@@ -194,13 +200,15 @@ export const dummyDefaultProps = {
194
200
  },
195
201
  declineCallButtonStyleProps: {
196
202
  borderRadius: "50%",
197
- color: "#FFFFFF",
198
203
  backgroundColor: "#DC0000",
199
204
  lineHeight: "40px",
200
205
  height: "40px",
201
206
  width: "40px",
202
- fontSize: 18,
203
- marginLeft: "5px"
207
+ marginLeft: "5px",
208
+ icon: {
209
+ fontSize: 18,
210
+ color: "#FFFFFF"
211
+ }
204
212
  },
205
213
  incomingCallTitleStyleProps: {
206
214
  margin: "0 5px",
@@ -465,8 +473,8 @@ export const dummyDefaultProps = {
465
473
  onConfirm: () => {},
466
474
  // Detailed implementation omitted
467
475
  onCancel: () => {} // Detailed implementation omitted
468
-
469
476
  },
477
+
470
478
  styleProps: {
471
479
  generalStyleProps: {
472
480
  backgroundColor: "#FFFFFF",
@@ -771,6 +779,7 @@ export const dummyDefaultProps = {
771
779
  },
772
780
  audioNotificationButtonProps: {
773
781
  id: "oc-lcw-footer-audionotification-button",
782
+ type: "icon",
774
783
  ariaLabel: "Turn sound off",
775
784
  toggleAriaLabel: "Turn sound on",
776
785
  iconName: "Volume3",
@@ -796,8 +805,10 @@ export const dummyDefaultProps = {
796
805
  padding: "0 10px 5px 10px"
797
806
  },
798
807
  downloadTranscriptButtonStyleProps: {
799
- color: "blue",
800
- fontSize: 16,
808
+ icon: {
809
+ color: "blue",
810
+ fontSize: 16
811
+ },
801
812
  height: "25px",
802
813
  lineHeight: "25px",
803
814
  width: "25px"
@@ -807,8 +818,10 @@ export const dummyDefaultProps = {
807
818
  backgroundColor: "#C8C8C8"
808
819
  },
809
820
  emailTranscriptButtonStyleProps: {
810
- color: "blue",
811
- fontSize: 16,
821
+ cicon: {
822
+ color: "blue",
823
+ fontSize: 16
824
+ },
812
825
  height: "25px",
813
826
  lineHeight: "25px",
814
827
  width: "25px"
@@ -818,8 +831,10 @@ export const dummyDefaultProps = {
818
831
  backgroundColor: "#C8C8C8"
819
832
  },
820
833
  audioNotificationButtonStyleProps: {
821
- color: "blue",
822
- fontSize: 16,
834
+ icon: {
835
+ color: "blue",
836
+ fontSize: 16
837
+ },
823
838
  height: "25px",
824
839
  lineHeight: "25px",
825
840
  width: "25px"
@@ -870,7 +885,7 @@ export const dummyDefaultProps = {
870
885
  className: undefined
871
886
  },
872
887
  closeButtonProps: {
873
- id: "oc-lcw-header-minimize-button",
888
+ id: "oc-lcw-header-close-button",
874
889
  type: "icon",
875
890
  iconName: "ChromeClose",
876
891
  ariaLabel: "Close",
@@ -1049,8 +1064,8 @@ export const dummyDefaultProps = {
1049
1064
  titleText: "We're Offline",
1050
1065
  subtitleText: "No agents available",
1051
1066
  onClick: () => {} // Detailed implementation omitted
1052
-
1053
1067
  },
1068
+
1054
1069
  styleProps: {
1055
1070
  // ...[Existing chat button style props]
1056
1071
  iconStyleProps: {
@@ -1068,8 +1083,8 @@ export const dummyDefaultProps = {
1068
1083
  text: "We're Offline"
1069
1084
  },
1070
1085
  onMinimizeClick: () => {} // Detailed implementation omitted
1071
-
1072
1086
  },
1087
+
1073
1088
  styleProps: {
1074
1089
  // ...[Existing chat button style props]
1075
1090
  generalStyleProps: {
@@ -1166,7 +1181,8 @@ export const dummyDefaultProps = {
1166
1181
  backgroundColor: "#FFFFFF",
1167
1182
  borderColor: "#F1F1F1"
1168
1183
  }
1169
- }
1184
+ },
1185
+ isCustomerVoiceSurveyCompact: undefined
1170
1186
  },
1171
1187
  proactiveChatPaneProps: {
1172
1188
  componentOverrides: {
@@ -1186,7 +1202,17 @@ export const dummyDefaultProps = {
1186
1202
  hideSubtitle: false,
1187
1203
  subtitleText: "Live chat support!",
1188
1204
  hideCloseButton: false,
1189
- closeButtonAriaLabel: "Close Button",
1205
+ closeButtonProps: {
1206
+ id: "oc-lcw-proactivechat-closebutton",
1207
+ type: "icon",
1208
+ iconName: "ChromeClose",
1209
+ ariaLabel: "Close",
1210
+ imageIconProps: undefined,
1211
+ text: "Close",
1212
+ onClick: undefined,
1213
+ className: undefined,
1214
+ hideButtonTitle: true
1215
+ },
1190
1216
  isBodyContainerHorizantal: false,
1191
1217
  hideBodyTitle: false,
1192
1218
  bodyTitleText: "Hi! Have any questions? I am here to help.",
@@ -1196,8 +1222,8 @@ export const dummyDefaultProps = {
1196
1222
  onClose: () => {},
1197
1223
  // Detailed implementation omitted
1198
1224
  onStart: () => {} // Detailed implementation omitted
1199
-
1200
1225
  },
1226
+
1201
1227
  styleProps: {
1202
1228
  generalStyleProps: {
1203
1229
  backgroundColor: "rgb(255, 255, 255)",
@@ -1328,8 +1354,8 @@ export const dummyDefaultProps = {
1328
1354
  onStartNewChat: () => {},
1329
1355
  // Detailed implementation omitted
1330
1356
  onMinimize: () => {} // Detailed implementation omitted
1331
-
1332
1357
  },
1358
+
1333
1359
  styleProps: {
1334
1360
  generalStyleProps: {
1335
1361
  backgroundColor: "rgb(255, 255, 255)",
@@ -1414,7 +1440,6 @@ export const dummyDefaultProps = {
1414
1440
  startNewChatButtonClassName: undefined
1415
1441
  }
1416
1442
  },
1417
- isReconnectEnabled: undefined,
1418
1443
  reconnectId: undefined,
1419
1444
  redirectInSameWindow: undefined
1420
1445
  },
@@ -1536,6 +1561,12 @@ export const dummyDefaultProps = {
1536
1561
  lineHeight: "16px",
1537
1562
  padding: "0px 10px 0 10px"
1538
1563
  },
1564
+ userMessageBoxStyles: {
1565
+ maxWidth: "75%"
1566
+ },
1567
+ systemMessageBoxStyles: {
1568
+ maxWidth: "75%"
1569
+ },
1539
1570
  typingIndicatorStyleProps: {
1540
1571
  marginLeft: "10px",
1541
1572
  marginBottom: "5px",
@@ -1655,6 +1686,9 @@ export const dummyDefaultProps = {
1655
1686
  },
1656
1687
  attachmentSizeStyles: {
1657
1688
  display: "none"
1689
+ },
1690
+ receivedMessageAnchorStyles: {
1691
+ color: "white"
1658
1692
  }
1659
1693
  },
1660
1694
  localizedTexts: {
@@ -7,16 +7,16 @@ import { WebChatStoreLoader } from "../../webchatcontainerstateful/webchatcontro
7
7
  import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
8
8
  import { PostChatSurveyMode } from "../../postchatsurveypanestateful/enums/PostChatSurveyMode";
9
9
  import { Constants } from "../../../common/Constants";
10
- import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
+ import { addDelayInMs, getWidgetEndChatEventName } from "../../../common/utils";
11
11
 
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
13
  const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, state) => {
13
14
  var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _conversationDetails;
14
-
15
15
  const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
16
- const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode; // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
+ const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
17
17
 
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
19
  let conversationDetails = undefined;
19
-
20
20
  try {
21
21
  conversationDetails = await chatSDK.getConversationDetails();
22
22
  } catch (erorr) {
@@ -27,12 +27,10 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
27
27
  }
28
28
  });
29
29
  }
30
-
31
30
  if (isPostChatEnabled === "true" && ((_conversationDetails = conversationDetails) === null || _conversationDetails === void 0 ? void 0 : _conversationDetails.canRenderPostChat) === Constants.truePascal) {
32
31
  const skipEndChatSDK = false;
33
32
  const skipCloseChat = true;
34
33
  await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, false);
35
-
36
34
  if (postChatSurveyMode === PostChatSurveyMode.Embed) {
37
35
  dispatch({
38
36
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
@@ -49,14 +47,12 @@ const prepareEndChat = async (props, chatSDK, setAdapter, setWebChatStyles, disp
49
47
  payload: ConversationState.InActive
50
48
  });
51
49
  }
52
-
53
50
  return;
54
51
  }
55
-
56
52
  await endChat(props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, false, false, true);
57
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
-
53
+ };
59
54
 
55
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
60
56
  const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, adapter, skipEndChatSDK, skipCloseChat, postMessageToOtherTab) => {
61
57
  if (!skipEndChatSDK) {
62
58
  try {
@@ -73,9 +69,9 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
73
69
  });
74
70
  postMessageToOtherTab = false;
75
71
  }
76
- } // Need to clear these states immediately when chat ended from OC.
77
-
72
+ }
78
73
 
74
+ // Need to clear these states immediately when chat ended from OC.
79
75
  dispatch({
80
76
  type: LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
81
77
  payload: undefined
@@ -88,14 +84,13 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
88
84
  type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
89
85
  payload: undefined
90
86
  });
91
-
92
87
  if (!skipCloseChat) {
93
88
  try {
94
89
  var _props$webChatContain;
95
-
96
90
  adapter === null || adapter === void 0 ? void 0 : adapter.end();
97
91
  setAdapter(undefined);
98
- setWebChatStyles({ ...defaultWebChatContainerStatefulProps.webChatStyles,
92
+ setWebChatStyles({
93
+ ...defaultWebChatContainerStatefulProps.webChatStyles,
99
94
  ...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles)
100
95
  });
101
96
  WebChatStoreLoader.store = null;
@@ -127,10 +122,8 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
127
122
  proactiveChatInNewWindow: false
128
123
  }
129
124
  });
130
-
131
125
  if (postMessageToOtherTab) {
132
126
  var _chatSDK$omnichannelC, _chatSDK$omnichannelC2, _props$controlProps;
133
-
134
127
  const endChatEventName = getWidgetEndChatEventName(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC === void 0 ? void 0 : _chatSDK$omnichannelC.orgId, chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC2 = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC2 === void 0 ? void 0 : _chatSDK$omnichannelC2.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
135
128
  BroadcastService.postMessage({
136
129
  eventName: endChatEventName
@@ -146,5 +139,4 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
146
139
  }
147
140
  }
148
141
  };
149
-
150
142
  export { prepareEndChat, endChat };
@@ -2,7 +2,6 @@ import { shouldShowChatButton, shouldShowProactiveChatPane } from "../../../cont
2
2
  import { defaultLiveChatWidgetGeneralStyles } from "./defaultStyles/defaultLiveChatWidgetGeneralStyles";
3
3
  export const getGeneralStylesForButton = state => {
4
4
  let generalStylesForButton = defaultLiveChatWidgetGeneralStyles;
5
-
6
5
  if (!shouldShowChatButton(state) && !shouldShowProactiveChatPane(state)) {
7
6
  generalStylesForButton = Object.assign({}, defaultLiveChatWidgetGeneralStyles, {
8
7
  boxShadow: "0px 0px 2px rgba(0, 0, 0, 0.16), 0px 4px 8px rgba(0, 0, 0, 0.12)",
@@ -12,6 +11,5 @@ export const getGeneralStylesForButton = state => {
12
11
  padding: "0.5"
13
12
  });
14
13
  }
15
-
16
14
  return generalStylesForButton;
17
15
  };
@@ -1,6 +1,7 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
2
- import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
+ import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
3
3
 
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4
5
  export const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
5
6
  try {
6
7
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -13,18 +14,15 @@ export const initCallingSdk = async (chatSDK, setVoiceVideoCallingSDK) => {
13
14
  });
14
15
  return true;
15
16
  }
16
-
17
17
  return false;
18
18
  } catch (error) {
19
- if (error !== "Voice and video call is not enabled") {
20
- TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
21
- Event: TelemetryEvent.CallingSDKLoadFailed,
22
- ExceptionDetails: {
23
- exception: error
24
- }
25
- });
26
- }
27
-
19
+ TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
20
+ Event: TelemetryEvent.CallingSDKLoadFailed,
21
+ ExceptionDetails: {
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ exception: error.message
24
+ }
25
+ });
28
26
  return false;
29
27
  }
30
28
  };
@@ -1,14 +1,13 @@
1
1
  import { defaultConfirmationPaneLocalizedTexts } from "../../confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts";
2
2
  export const initConfirmationPropsComposer = props => {
3
3
  var _props$confirmationPa, _props$footerProps, _props$footerProps$co, _props$footerProps2, _props$footerProps2$c, _props$confirmationPa2;
4
-
5
- const confirmationPanelocalizedTexts = { ...defaultConfirmationPaneLocalizedTexts,
4
+ const confirmationPanelocalizedTexts = {
5
+ ...defaultConfirmationPaneLocalizedTexts,
6
6
  ...(props === null || props === void 0 ? void 0 : (_props$confirmationPa = props.confirmationPaneProps) === null || _props$confirmationPa === void 0 ? void 0 : _props$confirmationPa.confirmationPaneLocalizedTexts)
7
7
  };
8
8
  let confirmationPaneInputs;
9
9
  const emailTranscriptDisabled = ((_props$footerProps = props.footerProps) === null || _props$footerProps === void 0 ? void 0 : (_props$footerProps$co = _props$footerProps.controlProps) === null || _props$footerProps$co === void 0 ? void 0 : _props$footerProps$co.hideEmailTranscriptButton) ?? false;
10
10
  const downloadTranscriptDisabled = ((_props$footerProps2 = props.footerProps) === null || _props$footerProps2 === void 0 ? void 0 : (_props$footerProps2$c = _props$footerProps2.controlProps) === null || _props$footerProps2$c === void 0 ? void 0 : _props$footerProps2$c.hideDownloadTranscriptButton) ?? false;
11
-
12
11
  if (!emailTranscriptDisabled && !downloadTranscriptDisabled) {
13
12
  confirmationPaneInputs = {
14
13
  title: confirmationPanelocalizedTexts.CLOSE_CONFIRMATION_DIALOG_TITLE_FOR_EMAIL_AND_DOWNLOAD_TRANSCRIPT_ENABLED,
@@ -30,8 +29,8 @@ export const initConfirmationPropsComposer = props => {
30
29
  description: confirmationPanelocalizedTexts.CLOSE_CONFIRMATION_DIALOG_DESCRIPTION_DEFAULT
31
30
  };
32
31
  }
33
-
34
- const confirmationPaneProps = { ...props.confirmationPaneProps,
32
+ const confirmationPaneProps = {
33
+ ...props.confirmationPaneProps,
35
34
  controlProps: {
36
35
  titleText: confirmationPaneInputs.title,
37
36
  subtitleText: confirmationPaneInputs.description,
@@ -29,41 +29,39 @@ import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontr
29
29
  import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
30
30
  import { createCardActionMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware";
31
31
  import createMessageTimeStampMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware";
32
- import { Constants } from "../../../common/Constants"; // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ import { Constants } from "../../../common/Constants";
33
33
 
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
35
  export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatStyles) => {
35
36
  var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4, _state$domainStates$l8, _state$domainStates$l9, _props$webChatContain7, _props$webChatContain8, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain9, _props$webChatContain10, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain11, _props$webChatContain12, _defaultWebChatContai, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain17, _props$webChatContain18, _defaultWebChatContai2, _props$webChatContain19, _props$webChatContain20, _defaultWebChatContai3, _props$webChatContain21, _props$webChatContain22;
36
-
37
- const localizedTexts = { ...defaultMiddlewareLocalizedTexts,
37
+ const localizedTexts = {
38
+ ...defaultMiddlewareLocalizedTexts,
38
39
  ...((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.localizedTexts)
39
40
  };
40
- const disableNewLineMarkdownSupport = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableNewLineMarkdownSupport) ?? defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
41
-
41
+ const disableNewLineMarkdownSupport = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : _props$webChatContain2.disableNewLineMarkdownSupport) ?? defaultWebChatContainerStatefulProps.disableNewLineMarkdownSupport;
42
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
42
43
  const markdown = createMarkdown(((_props$webChatContain3 = props.webChatContainerProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableMarkdownMessageFormatting) ?? defaultWebChatContainerStatefulProps.disableMarkdownMessageFormatting, disableNewLineMarkdownSupport);
43
44
  const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
44
- const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode; // Initialize Web Chat's redux store
45
+ const postChatSurveyMode = (_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : (_state$domainStates$l4 = _state$domainStates$l3.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l4 === void 0 ? void 0 : _state$domainStates$l4.msdyn_postconversationsurveymode;
45
46
 
47
+ // Initialize Web Chat's redux store
46
48
  let webChatStore = WebChatStoreLoader.store;
47
-
48
49
  if (!webChatStore) {
49
50
  var _state$domainStates$l5, _state$domainStates$l6, _state$domainStates$l7, _props$webChatContain6;
50
-
51
51
  const conversationEndCallback = async () => {
52
52
  var _props$webChatContain4, _props$webChatContain5;
53
-
54
53
  TelemetryHelper.logActionEvent(LogLevel.INFO, {
55
54
  Event: TelemetryEvent.ConversationEndedThreadEventReceived,
56
55
  Description: "Conversation is ended by agent side or by timeout."
57
56
  });
58
-
59
57
  if ((props === null || props === void 0 ? void 0 : (_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : (_props$webChatContain5 = _props$webChatContain4.renderingMiddlewareProps) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.hideSendboxOnConversationEnd) !== false) {
60
58
  setWebChatStyles(styles => {
61
- return { ...styles,
59
+ return {
60
+ ...styles,
62
61
  hideSendBox: true
63
62
  };
64
63
  });
65
64
  }
66
-
67
65
  if (isPostChatEnabled === "true") {
68
66
  if (postChatSurveyMode === PostChatSurveyMode.Embed) {
69
67
  WebChatStoreLoader.store = null;
@@ -92,7 +90,6 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
92
90
  payload: true
93
91
  });
94
92
  }
95
-
96
93
  dispatch({
97
94
  type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
98
95
  payload: undefined
@@ -102,15 +99,17 @@ export const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatS
102
99
  payload: undefined
103
100
  });
104
101
  };
105
-
106
- webChatStore = createStore({}, //initial state
107
- preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), createMessageTimeStampMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, // eslint-disable-next-line @typescript-eslint/no-explicit-any
102
+ webChatStore = createStore({},
103
+ //initial state
104
+ preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : _state$domainStates$l5.allowedFileExtensions, (_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.maxUploadFileSize, localizedTexts), channelDataMiddleware, createConversationEndMiddleware(conversationEndCallback), createDataMaskingMiddleware((_state$domainStates$l7 = state.domainStates.liveChatConfig) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.DataMaskingInfo), createMessageTimeStampMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware, createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware,
105
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
106
  ...(((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.storeMiddlewares) ?? []));
109
107
  WebChatStoreLoader.store = webChatStore;
110
- } // Initialize the remaining Web Chat props
111
-
108
+ }
112
109
 
113
- const webChatProps = { ...defaultWebChatContainerStatefulProps.webChatProps,
110
+ // Initialize the remaining Web Chat props
111
+ const webChatProps = {
112
+ ...defaultWebChatContainerStatefulProps.webChatProps,
114
113
  dir: state.domainStates.globalDir,
115
114
  locale: changeLanguageCodeFormatForWebChat(getLocaleStringFromId((_state$domainStates$l8 = state.domainStates.liveChatConfig) === null || _state$domainStates$l8 === void 0 ? void 0 : (_state$domainStates$l9 = _state$domainStates$l8.ChatWidgetLanguage) === null || _state$domainStates$l9 === void 0 ? void 0 : _state$domainStates$l9.msdyn_localeid)),
116
115
  store: webChatStore,