@microsoft/omnichannel-chat-widget 1.8.3-main.ec1328d → 1.8.4-main.4478bbf

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 (185) hide show
  1. package/lib/cjs/common/Constants.js +7 -0
  2. package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
  3. package/lib/cjs/common/telemetry/AppInsightsEvents.js +4 -5
  4. package/lib/cjs/common/telemetry/TelemetryConstants.js +46 -2
  5. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +26 -10
  6. package/lib/cjs/common/utils/SecureEventBus.js +307 -0
  7. package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
  8. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
  9. package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
  10. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +199 -0
  11. package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
  12. package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  13. package/lib/cjs/components/headerstateful/HeaderStateful.js +8 -2
  14. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
  15. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +127 -0
  16. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  17. package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +15 -0
  18. package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +284 -0
  19. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
  20. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +18 -0
  21. package/lib/cjs/components/livechatwidget/common/endChat.js +28 -3
  22. package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  23. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -6
  24. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  25. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
  26. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
  27. package/lib/cjs/components/livechatwidget/common/startChat.js +10 -5
  28. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -4
  29. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
  30. package/lib/cjs/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
  31. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +41 -8
  32. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +29 -2
  33. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
  34. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +122 -11
  35. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  36. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  37. package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +14 -0
  38. package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +17 -0
  39. package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +97 -0
  40. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  41. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +1 -1
  42. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  43. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
  44. package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
  45. package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +59 -0
  46. package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  47. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +122 -0
  48. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +10 -0
  49. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +18 -0
  50. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1038 -0
  51. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
  52. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +44 -0
  53. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +16 -2
  54. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  55. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +20 -0
  56. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  57. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -2
  58. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +59 -0
  59. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +5 -3
  60. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
  61. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +97 -30
  62. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  63. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +46 -45
  64. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  65. package/lib/cjs/contexts/createReducer.js +15 -0
  66. package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
  67. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
  68. package/lib/cjs/index.js +9 -1
  69. package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
  70. package/lib/esm/common/Constants.js +7 -0
  71. package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
  72. package/lib/esm/common/telemetry/AppInsightsEvents.js +4 -5
  73. package/lib/esm/common/telemetry/TelemetryConstants.js +44 -1
  74. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +27 -11
  75. package/lib/esm/common/utils/SecureEventBus.js +328 -0
  76. package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
  77. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
  78. package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
  79. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +188 -0
  80. package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
  81. package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  82. package/lib/esm/components/headerstateful/HeaderStateful.js +9 -3
  83. package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
  84. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +120 -0
  85. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  86. package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +8 -0
  87. package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +277 -0
  88. package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
  89. package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +11 -0
  90. package/lib/esm/components/livechatwidget/common/endChat.js +29 -4
  91. package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  92. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +8 -6
  93. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  94. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
  95. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
  96. package/lib/esm/components/livechatwidget/common/startChat.js +12 -7
  97. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -4
  98. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
  99. package/lib/esm/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
  100. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +42 -9
  101. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -4
  102. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
  103. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +125 -12
  104. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
  105. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  106. package/lib/esm/components/webchatcontainerstateful/common/activities/botActivity.js +7 -0
  107. package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +9 -0
  108. package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +90 -0
  109. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  110. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
  111. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  112. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
  113. package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
  114. package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +51 -0
  115. package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  116. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +115 -0
  117. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +3 -0
  118. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +10 -0
  119. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1060 -0
  120. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
  121. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +42 -0
  122. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +13 -0
  123. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  124. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +13 -0
  125. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  126. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
  127. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +52 -0
  128. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -2
  129. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
  130. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +98 -30
  131. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
  132. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +46 -45
  133. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  134. package/lib/esm/contexts/createReducer.js +15 -0
  135. package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
  136. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
  137. package/lib/esm/index.js +1 -0
  138. package/lib/esm/plugins/newMessageEventHandler.js +4 -1
  139. package/lib/types/common/Constants.d.ts +6 -0
  140. package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
  141. package/lib/types/common/telemetry/TelemetryConstants.d.ts +41 -2
  142. package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
  143. package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
  144. package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
  145. package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
  146. package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
  147. package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
  148. package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
  149. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
  150. package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts +45 -0
  151. package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +7 -0
  152. package/lib/types/components/livechatwidget/common/PersistentConversationHandler.d.ts +28 -0
  153. package/lib/types/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.d.ts +2 -0
  154. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
  155. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
  156. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +5 -1
  157. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
  158. package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +7 -0
  159. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
  160. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
  161. package/lib/types/components/webchatcontainerstateful/common/activities/botActivity.d.ts +7 -0
  162. package/lib/types/components/webchatcontainerstateful/common/activities/conversationDividerActivity.d.ts +10 -0
  163. package/lib/types/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.d.ts +2 -0
  164. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
  165. package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
  166. package/lib/types/components/webchatcontainerstateful/hooks/usePersistentChatHistory.d.ts +4 -0
  167. package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
  168. package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +7 -0
  169. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.d.ts +3 -0
  170. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.d.ts +4 -0
  171. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +326 -0
  172. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.d.ts +8 -0
  173. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -0
  174. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.d.ts +2 -0
  175. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.d.ts +2 -0
  176. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +3 -4
  177. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
  178. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  179. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +1 -0
  180. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +46 -45
  181. package/lib/types/index.d.ts +1 -0
  182. package/package.json +3 -3
  183. /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  184. /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  185. /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
@@ -1,6 +1,7 @@
1
1
  import { ConversationEndEntity, ParticipantType } from "../../../common/Constants";
2
2
  import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
3
3
  import { changeLanguageCodeFormatForWebChat, getConversationDetailsCall } from "../../../common/utils";
4
+ import { getOverriddenLocalizedStrings, localizedStringsBotInitialsMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware";
4
5
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
5
6
  import { Constants } from "../../../common/Constants";
6
7
  import { ConversationState } from "../../../contexts/common/ConversationState";
@@ -12,6 +13,7 @@ import { WebChatStoreLoader } from "../../webchatcontainerstateful/webchatcontro
12
13
  import attachmentProcessingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware";
13
14
  import channelDataMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware";
14
15
  import { createActivityMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware";
16
+ import { createActivityStatusMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware";
15
17
  import { createAttachmentMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware";
16
18
  import createAttachmentUploadValidatorMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware";
17
19
  import { createAvatarMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware";
@@ -39,11 +41,10 @@ import htmlPlayerMiddleware from "../../webchatcontainerstateful/webchatcontroll
39
41
  import htmlTextMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware";
40
42
  import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware";
41
43
  import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
42
- import { localizedStringsBotInitialsMiddleware, getOverriddenLocalizedStrings } from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware";
43
44
 
44
45
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
46
  export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) => {
46
- var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain13, _props$webChatContain14, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain15, _props$webChatContain16, _defaultWebChatContai, _props$webChatContain17, _props$webChatContain18, _props$webChatContain19, _props$webChatContain20, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai2, _props$webChatContain23, _props$webChatContain24, _defaultWebChatContai3, _props$webChatContain25, _props$webChatContain26, _props$webChatContain27, _props$webChatContain28;
47
+ var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain13, _props$webChatContain14, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain15, _props$webChatContain16, _state$domainStates$l6, _state$domainStates$l7, _props$webChatContain17, _props$webChatContain18, _props$webChatContain19, _props$webChatContain20, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai, _props$webChatContain23, _props$webChatContain24, _defaultWebChatContai2, _props$webChatContain25, _props$webChatContain26, _props$webChatContain27, _props$webChatContain28;
47
48
  // Add a hook to make all links open a new window
48
49
  postDomPurifyActivities();
49
50
  const localizedTexts = {
@@ -61,6 +62,7 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
61
62
  let webChatStore = WebChatStoreLoader.store;
62
63
  if (!webChatStore) {
63
64
  var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _props$webChatContain7;
65
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
64
66
  const addConversationalSurveyTagsCallback = action => {
65
67
  var _inMemoryState$appSta;
66
68
  const inMemoryState = executeReducer(state, {
@@ -118,7 +120,7 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
118
120
  };
119
121
  webChatStore = createStore({},
120
122
  //initial state
121
- preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), createCustomEventMiddleware(BroadcastService), createQueueOverflowMiddleware(state, dispatch), channelDataMiddleware(addConversationalSurveyTagsCallback), createConversationEndMiddleware(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), createDataMaskingMiddleware((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), createMessageTimeStampMiddleware, createMessageSequenceIdOverrideMiddleware, createCitationsMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware(honorsTargetInHTMLLinks), createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, createCallActionMiddleware(), localizedStringsBotInitialsMiddleware(),
123
+ preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), createCustomEventMiddleware(BroadcastService), createQueueOverflowMiddleware(state, dispatch), channelDataMiddleware(addConversationalSurveyTagsCallback), createConversationEndMiddleware(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), createDataMaskingMiddleware((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), createMessageTimeStampMiddleware, createMessageSequenceIdOverrideMiddleware, createCitationsMiddleware(state, dispatch), gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware(honorsTargetInHTMLLinks), createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, createCallActionMiddleware(), localizedStringsBotInitialsMiddleware(),
122
124
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
123
125
  ...(((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.storeMiddlewares) ?? []));
124
126
  WebChatStoreLoader.store = webChatStore;
@@ -163,12 +165,12 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
163
165
  store: webChatStore,
164
166
  activityMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain12 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableActivityMiddleware ? undefined : createActivityMiddleware(renderMarkdown, (_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps),
165
167
  attachmentMiddleware: (_props$webChatContain13 = props.webChatContainerProps) !== null && _props$webChatContain13 !== void 0 && (_props$webChatContain14 = _props$webChatContain13.renderingMiddlewareProps) !== null && _props$webChatContain14 !== void 0 && _props$webChatContain14.disableAttachmentMiddleware ? undefined : createAttachmentMiddleware(((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : (_state$domainStates$r4 = _state$domainStates$r3.attachmentProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.enableInlinePlaying) ?? defaultAttachmentProps.enableInlinePlaying),
166
- activityStatusMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableActivityStatusMiddleware ? undefined : (_defaultWebChatContai = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.activityStatusMiddleware,
168
+ activityStatusMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableActivityStatusMiddleware ? undefined : createActivityStatusMiddleware(getLocaleStringFromId((_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : (_state$domainStates$l7 = _state$domainStates$l6.ChatWidgetLanguage) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.msdyn_localeid)),
167
169
  toastMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableToastMiddleware ? undefined : createToastMiddleware(props.notificationPaneProps, endChat),
168
170
  renderMarkdown,
169
171
  avatarMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableAvatarMiddleware ? undefined : createAvatarMiddleware((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
170
- groupActivitiesMiddleware: (_props$webChatContain21 = props.webChatContainerProps) !== null && _props$webChatContain21 !== void 0 && (_props$webChatContain22 = _props$webChatContain21.renderingMiddlewareProps) !== null && _props$webChatContain22 !== void 0 && _props$webChatContain22.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.groupActivitiesMiddleware,
171
- typingIndicatorMiddleware: (_props$webChatContain23 = props.webChatContainerProps) !== null && _props$webChatContain23 !== void 0 && (_props$webChatContain24 = _props$webChatContain23.renderingMiddlewareProps) !== null && _props$webChatContain24 !== void 0 && _props$webChatContain24.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai3 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.typingIndicatorMiddleware,
172
+ groupActivitiesMiddleware: (_props$webChatContain21 = props.webChatContainerProps) !== null && _props$webChatContain21 !== void 0 && (_props$webChatContain22 = _props$webChatContain21.renderingMiddlewareProps) !== null && _props$webChatContain22 !== void 0 && _props$webChatContain22.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.groupActivitiesMiddleware,
173
+ typingIndicatorMiddleware: (_props$webChatContain23 = props.webChatContainerProps) !== null && _props$webChatContain23 !== void 0 && (_props$webChatContain24 = _props$webChatContain23.renderingMiddlewareProps) !== null && _props$webChatContain24 !== void 0 && _props$webChatContain24.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai2 = defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.typingIndicatorMiddleware,
172
174
  onTelemetry: createWebChatTelemetry(),
173
175
  cardActionMiddleware: createCardActionMiddleware(((_props$webChatContain25 = props.webChatContainerProps) === null || _props$webChatContain25 === void 0 ? void 0 : _props$webChatContain25.botMagicCode) || undefined),
174
176
  sendTypingIndicator: true,
@@ -1,6 +1,7 @@
1
1
  const overridePropsOnMockIfApplicable = props => {
2
2
  var _props$mock, _props$mock2;
3
3
  if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
4
+ var _props$mock3, _props$mock3$mockMess;
4
5
  if (!props.webChatContainerProps) {
5
6
  props.webChatContainerProps = {};
6
7
  }
@@ -16,7 +17,7 @@ const overridePropsOnMockIfApplicable = props => {
16
17
  props.webChatContainerProps = {
17
18
  ...props.webChatContainerProps,
18
19
  webChatProps: {
19
- disabled: true,
20
+ disabled: !(props !== null && props !== void 0 && (_props$mock3 = props.mock) !== null && _props$mock3 !== void 0 && (_props$mock3$mockMess = _props$mock3.mockMessages) !== null && _props$mock3$mockMess !== void 0 && _props$mock3$mockMess.length),
20
21
  ...props.webChatContainerProps.webChatProps,
21
22
  overrideLocalizedStrings: {
22
23
  TEXT_INPUT_PLACEHOLDER: "Send a message . . .",
@@ -149,7 +149,7 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
149
149
  if ((state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.postChatContext) === undefined) {
150
150
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
151
151
  const context = await facadeChatSDK.getPostChatSurveyContext();
152
- TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
152
+ TelemetryHelper.logSDKEvent(LogLevel.INFO, {
153
153
  Event: TelemetryEvent.PostChatContextCallSucceed,
154
154
  Description: PostChatSurveyTelemetryMessage.PostChatContextCallSucceed
155
155
  });
@@ -167,7 +167,7 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
167
167
  }
168
168
  }
169
169
  } catch (error) {
170
- TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.ERROR, {
170
+ TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
171
171
  Event: TelemetryEvent.PostChatContextCallFailed,
172
172
  Description: PostChatSurveyTelemetryMessage.PostChatContextCallFailed,
173
173
  ExceptionDetails: {
@@ -19,13 +19,13 @@ export const setPostChatContextAndLoadSurvey = async (facadeChatSDK, dispatch, p
19
19
  const postChatEnabled = postChatConfig.postChatEnabled;
20
20
  if (postChatEnabled) {
21
21
  if (!persistedChat) {
22
- TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
22
+ TelemetryHelper.logSDKEvent(LogLevel.INFO, {
23
23
  Event: TelemetryEvent.PostChatContextCallStarted,
24
24
  Description: PostChatSurveyTelemetryMessage.PostChatContextCallStarted
25
25
  });
26
26
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
27
  const context = await facadeChatSDK.getPostChatSurveyContext();
28
- TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
28
+ TelemetryHelper.logSDKEvent(LogLevel.INFO, {
29
29
  Event: TelemetryEvent.PostChatContextCallSucceed,
30
30
  Description: PostChatSurveyTelemetryMessage.PostChatContextCallSucceed
31
31
  });
@@ -42,7 +42,7 @@ export const setPostChatContextAndLoadSurvey = async (facadeChatSDK, dispatch, p
42
42
  }
43
43
  }
44
44
  } catch (ex) {
45
- TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.ERROR, {
45
+ TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
46
46
  Event: TelemetryEvent.PostChatContextCallFailed,
47
47
  Description: PostChatSurveyTelemetryMessage.PostChatContextCallFailed,
48
48
  ExceptionDetails: {
@@ -1,9 +1,9 @@
1
- import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
1
+ import { BroadcastEvent, ConversationStage, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
2
2
  import { Constants, LiveWorkItemState, WidgetLoadTelemetryMessage } from "../../../common/Constants";
3
3
  import { TelemetryManager, TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
4
4
  import { checkContactIdError, createTimer, getConversationDetailsCall, getStateFromCache, getWidgetCacheIdfromProps, isNullOrEmptyString, isNullOrUndefined, isUndefinedOrEmpty } from "../../../common/utils";
5
5
  import { handleChatReconnect, isPersistentEnabled, isReconnectEnabled } from "./reconnectChatHelper";
6
- import { handleStartChatError, logWidgetLoadComplete } from "./startChatErrorHandler";
6
+ import { handleStartChatError, logStartChatComplete, logWidgetLoadComplete } from "./startChatErrorHandler";
7
7
  import { ActivityStreamHandler } from "./ActivityStreamHandler";
8
8
  import { BroadcastService } from "@microsoft/omnichannel-chat-components";
9
9
  import { ConversationState } from "../../../contexts/common/ConversationState";
@@ -99,7 +99,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
99
99
 
100
100
  // If minimized, maximize the chat, if the state is missing, consider it as minimized
101
101
  if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
102
- var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$;
102
+ var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$, _TelemetryManager$Int;
103
103
  dispatch({
104
104
  type: LiveChatWidgetActionType.SET_MINIMIZED,
105
105
  payload: false
@@ -110,7 +110,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
110
110
  eventName: BroadcastEvent.MaximizeChat,
111
111
  payload: {
112
112
  height: state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : (_state$domainStates3$ = _state$domainStates3.widgetSize) === null || _state$domainStates3$ === void 0 ? void 0 : _state$domainStates3$.height,
113
- width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width
113
+ width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width,
114
+ runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
114
115
  }
115
116
  });
116
117
  }
@@ -131,7 +132,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
131
132
  * This is because a new change to control OOH as closed event when a widget is coming from chat.
132
133
  */
133
134
  if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
134
- var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int;
135
+ var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int2;
135
136
  dispatch({
136
137
  type: LiveChatWidgetActionType.SET_MINIMIZED,
137
138
  payload: false
@@ -142,7 +143,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
142
143
  payload: {
143
144
  height: state === null || state === void 0 ? void 0 : (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 ? void 0 : (_state$domainStates5$ = _state$domainStates5.widgetSize) === null || _state$domainStates5$ === void 0 ? void 0 : _state$domainStates5$.height,
144
145
  width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width,
145
- runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
146
+ runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int2 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
146
147
  }
147
148
  });
148
149
  }
@@ -173,7 +174,10 @@ const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props,
173
174
  TelemetryTimers.WidgetLoadTimer = createTimer();
174
175
  TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
175
176
  Event: TelemetryEvent.WidgetLoadStarted,
176
- Description: "Widget start chat started."
177
+ Description: "Widget start chat started.",
178
+ CustomProperties: {
179
+ ConversationStage: ConversationStage.Initialization
180
+ }
177
181
  });
178
182
 
179
183
  //Check if chat retrieved from cache
@@ -201,6 +205,7 @@ const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props,
201
205
  const startTime = new Date().getTime();
202
206
  createTrackingForFirstMessage();
203
207
  await facadeChatSDK.startChat(startChatOptionalParams);
208
+ logStartChatComplete();
204
209
  isStartChatSuccessful = true;
205
210
  await createAdapterAndSubscribe(facadeChatSDK, dispatch, setAdapter, startTime, props);
206
211
  } catch (error) {
@@ -1,5 +1,5 @@
1
1
  import { ChatSDKError, ChatSDKErrorName } from "@microsoft/omnichannel-chat-sdk";
2
- import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
2
+ import { ConversationStage, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
3
3
  import { PrepareEndChatDescriptionConstants, WidgetLoadCustomErrorString, WidgetLoadTelemetryMessage } from "../../../common/Constants";
4
4
  import { callingStateCleanUp, chatSDKStateCleanUp, closeChatStateCleanUp, endChatStateCleanUp } from "./endChat";
5
5
  import { ConversationState } from "../../../contexts/common/ConversationState";
@@ -118,7 +118,10 @@ const logWidgetLoadFailed = ex => {
118
118
  Event: TelemetryEvent.WidgetLoadFailed,
119
119
  Description: "Widget load complete with error",
120
120
  ExceptionDetails: exDetails,
121
- ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed
121
+ ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed,
122
+ CustomProperties: {
123
+ ConversationStage: ConversationStage.Initialization
124
+ }
122
125
  });
123
126
  };
124
127
  export const logWidgetLoadComplete = additionalMessage => {
@@ -133,6 +136,16 @@ export const logWidgetLoadComplete = additionalMessage => {
133
136
  ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg2 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
134
137
  });
135
138
  };
139
+ export const logStartChatComplete = additionalMessage => {
140
+ let descriptionString = "Start chat complete";
141
+ if (additionalMessage) {
142
+ descriptionString += `. ${additionalMessage}`;
143
+ }
144
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
145
+ Event: TelemetryEvent.StartChatComplete,
146
+ Description: descriptionString
147
+ });
148
+ };
136
149
  const logWidgetLoadCompleteWithError = ex => {
137
150
  var _TelemetryTimers$Widg3;
138
151
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -149,7 +162,10 @@ const logWidgetLoadCompleteWithError = ex => {
149
162
  Event: TelemetryEvent.WidgetLoadFailed,
150
163
  Description: "Widget load complete with error",
151
164
  ExceptionDetails: exDetails,
152
- ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed
165
+ ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed,
166
+ CustomProperties: {
167
+ ConversationStage: ConversationStage.Initialization
168
+ }
153
169
  });
154
170
  };
155
171
  export const logWidgetLoadWithUnexpectedError = ex => {
@@ -177,7 +193,10 @@ export const logWidgetLoadWithUnexpectedError = ex => {
177
193
  Event: TelemetryEvent.WidgetLoadFailed,
178
194
  Description: "Widget load with unexpected error",
179
195
  ExceptionDetails: exDetails,
180
- ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed
196
+ ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed,
197
+ CustomProperties: {
198
+ ConversationStage: ConversationStage.Initialization
199
+ }
181
200
  });
182
201
  };
183
202
 
@@ -1,6 +1,6 @@
1
- var LiveChatWidgetMockType;
1
+ export let LiveChatWidgetMockType;
2
2
  (function (LiveChatWidgetMockType) {
3
3
  LiveChatWidgetMockType["Test"] = "Test";
4
4
  LiveChatWidgetMockType["Demo"] = "Demo";
5
- })(LiveChatWidgetMockType || (LiveChatWidgetMockType = {}));
6
- export {};
5
+ LiveChatWidgetMockType["Designer"] = "Designer";
6
+ })(LiveChatWidgetMockType || (LiveChatWidgetMockType = {}));
@@ -1,5 +1,5 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
2
+ import { BroadcastEvent, ConversationStage, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
3
3
  import { BroadcastService, BroadcastServiceInitialize, decodeComponentString } from "@microsoft/omnichannel-chat-components";
4
4
  import { Components } from "botframework-webchat";
5
5
  import { ConfirmationState, Constants, ConversationEndEntity, E2VVOptions, LiveWorkItemState, PrepareEndChatDescriptionConstants, StorageType, WidgetLoadCustomErrorString } from "../../../common/Constants";
@@ -61,7 +61,10 @@ export const LiveChatWidgetStateful = props => {
61
61
  uiTimer = createTimer();
62
62
  TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
63
63
  Event: TelemetryEvent.UXLiveChatWidgetStart,
64
- Description: "Live chat widget loading started."
64
+ Description: "Live chat widget loading started.",
65
+ CustomProperties: {
66
+ ConversationStage: ConversationStage.Initialization
67
+ }
65
68
  });
66
69
  }, []);
67
70
  const [state, dispatch] = useChatContextStore();
@@ -480,7 +483,8 @@ export const LiveChatWidgetStateful = props => {
480
483
  eventName: BroadcastEvent.MaximizeChat,
481
484
  payload: {
482
485
  height: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain = inMemoryState.domainStates) === null || _inMemoryState$domain === void 0 ? void 0 : (_inMemoryState$domain2 = _inMemoryState$domain.widgetSize) === null || _inMemoryState$domain2 === void 0 ? void 0 : _inMemoryState$domain2.height,
483
- width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width
486
+ width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width,
487
+ lcwRuntimeId: TelemetryManager.InternalTelemetryData.lcwRuntimeId
484
488
  }
485
489
  });
486
490
  return;
@@ -491,7 +495,10 @@ export const LiveChatWidgetStateful = props => {
491
495
  BroadcastService.getMessageByEventName(BroadcastEvent.InitiateEndChat).subscribe(async () => {
492
496
  TelemetryHelper.logSDKEventToAllTelemetry(LogLevel.INFO, {
493
497
  Event: TelemetryEvent.EndChatEventReceived,
494
- Description: "Received InitiateEndChat BroadcastEvent."
498
+ Description: "Received InitiateEndChat BroadcastEvent.",
499
+ CustomProperties: {
500
+ ConversationStage: ConversationStage.ConversationEnd
501
+ }
495
502
  });
496
503
 
497
504
  // This is to ensure to get latest state from cache in multitab
@@ -796,7 +803,10 @@ export const LiveChatWidgetStateful = props => {
796
803
  TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
797
804
  Event: TelemetryEvent.UXLiveChatWidgetCompleted,
798
805
  Description: "Live chat widget loading completed.",
799
- ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
806
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
807
+ CustomProperties: {
808
+ ConversationStage: ConversationStage.Initialization
809
+ }
800
810
  });
801
811
  }, []);
802
812
  const initiateEndChatOnBrowserUnload = () => {
@@ -868,23 +878,46 @@ export const LiveChatWidgetStateful = props => {
868
878
 
869
879
  // WebChat's Composer can only be rendered if a directLine object is defined
870
880
  return directLine && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
871
- ::-webkit-scrollbar {
881
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar {
872
882
  width: ${scrollbarProps.width};
873
883
  }
874
884
 
875
- ::-webkit-scrollbar-track {
885
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
876
886
  background: ${scrollbarProps.trackBackgroundColor};
877
887
  }
878
888
 
879
- ::-webkit-scrollbar-thumb {
889
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
880
890
  background: ${scrollbarProps.thumbBackgroundColor};
881
891
  border-radius: ${scrollbarProps.thumbBorderRadius};
882
892
  }
883
893
 
884
- ::-webkit-scrollbar-thumb:hover {
894
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
885
895
  background: ${scrollbarProps.thumbHoverColor};
886
896
  }
887
897
 
898
+ /* High Contrast mode support - optimized for all variants */
899
+ @media (prefers-contrast: high), (-ms-high-contrast: active), (forced-colors: active) {
900
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
901
+ background: Canvas !important;
902
+ border: 1px solid CanvasText !important;
903
+ }
904
+
905
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
906
+ background: CanvasText !important;
907
+ border: 1px solid Canvas !important;
908
+ min-height: 20px !important;
909
+ }
910
+
911
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
912
+ background: Highlight !important;
913
+ border: 1px solid CanvasText !important;
914
+ }
915
+
916
+ #oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-corner {
917
+ background: Canvas !important;
918
+ }
919
+ }
920
+
888
921
  .webchat__basic-transcript__activity-markdown-body > :last-child {
889
922
  margin-bottom: 0px;
890
923
  }
@@ -1,4 +1,4 @@
1
- import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
1
+ import { ConversationStage, LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
2
  import React, { useEffect } from "react";
3
3
  import { ParticipantType } from "../../common/Constants";
4
4
  import { CustomerVoiceEvents } from "./enums/CustomerVoiceEvents";
@@ -6,9 +6,10 @@ import { PostChatSurveyMode } from "./enums/PostChatSurveyMode";
6
6
  import { PostChatSurveyPane } from "@microsoft/omnichannel-chat-components";
7
7
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
8
8
  import { defaultGeneralPostChatSurveyPaneStyleProps } from "./common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps";
9
- import { findAllFocusableElement } from "../../common/utils";
9
+ import { createTimer, findAllFocusableElement } from "../../common/utils";
10
10
  import useChatContextStore from "../../hooks/useChatContextStore";
11
11
  import isValidSurveyUrl from "./common/isValidSurveyUrl";
12
+ let uiTimer;
12
13
  const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, compact, customerVoiceSurveyCorrelationId) {
13
14
  let showMultiLingual = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
14
15
  const surveyLinkParams = new URLSearchParams({
@@ -22,6 +23,16 @@ const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, co
22
23
  };
23
24
  export const PostChatSurveyPaneStateful = props => {
24
25
  var _props$styleProps, _state$appStates, _props$controlProps;
26
+ useEffect(() => {
27
+ uiTimer = createTimer();
28
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
29
+ Event: TelemetryEvent.UXPostChatPaneStarted,
30
+ Description: "Postchat survey pane loading started.",
31
+ CustomProperties: {
32
+ ConversationStage: ConversationStage.ConversationEnd
33
+ }
34
+ });
35
+ }, []);
25
36
  const [state] = useChatContextStore();
26
37
  const generalStyleProps = Object.assign({}, defaultGeneralPostChatSurveyPaneStyleProps, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps, {
27
38
  display: state.appStates.isMinimized ? "none" : "contents"
@@ -72,7 +83,14 @@ export const PostChatSurveyPaneStateful = props => {
72
83
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
73
84
  Event: TelemetryEvent.PostChatSurveyLoaded
74
85
  });
75
-
86
+ TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
87
+ Event: TelemetryEvent.UXPostChatPaneCompleted,
88
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
89
+ Description: "Postchat survey pane loading completed.",
90
+ CustomProperties: {
91
+ ConversationStage: ConversationStage.ConversationEnd
92
+ }
93
+ });
76
94
  //Customer Voice Telemetry Events
77
95
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
96
  window.addEventListener("message", message => {
@@ -87,7 +105,10 @@ export const PostChatSurveyPaneStateful = props => {
87
105
  } else if (data === CustomerVoiceEvents.FormResponseSubmitted) {
88
106
  TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
89
107
  Event: TelemetryEvent.CustomerVoiceFormResponseSubmitted,
90
- Description: "Customer Voice form response submitted."
108
+ Description: "Customer Voice form response submitted.",
109
+ CustomProperties: {
110
+ ConversationStage: ConversationStage.ConversationEnd
111
+ }
91
112
  });
92
113
  } else if (data === CustomerVoiceEvents.FormResponseError) {
93
114
  TelemetryHelper.logActionEventToAllTelemetry(LogLevel.ERROR, {
@@ -95,6 +116,9 @@ export const PostChatSurveyPaneStateful = props => {
95
116
  Description: "Customer Voice form response error.",
96
117
  ExceptionDetails: {
97
118
  message: "Customer Voice form response error."
119
+ },
120
+ CustomProperties: {
121
+ ConversationStage: ConversationStage.ConversationEnd
98
122
  }
99
123
  });
100
124
  } else if (typeof data === "string" && data.startsWith(CustomerVoiceEvents.FormsError)) {
@@ -103,6 +127,9 @@ export const PostChatSurveyPaneStateful = props => {
103
127
  Description: "Customer Voice failed to load with forms error.",
104
128
  ExceptionDetails: {
105
129
  message: `Customer Voice forms error details: ${data}`
130
+ },
131
+ CustomProperties: {
132
+ ConversationStage: ConversationStage.ConversationEnd
106
133
  }
107
134
  });
108
135
  }
@@ -1,5 +1,5 @@
1
1
  import { HtmlAttributeNames, Regex } from "../../common/Constants";
2
- import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
+ import { ConversationStage, LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
3
3
  import React, { useEffect } from "react";
4
4
  import { createTimer, extractPreChatSurveyResponseValues, findAllFocusableElement, getStateFromCache, getWidgetCacheId, isUndefinedOrEmpty, parseAdaptiveCardPayload } from "../../common/utils";
5
5
  import { ConversationState } from "../../contexts/common/ConversationState";
@@ -19,7 +19,10 @@ export const PreChatSurveyPaneStateful = props => {
19
19
  uiTimer = createTimer();
20
20
  TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
21
21
  Event: TelemetryEvent.UXPrechatPaneStart,
22
- Description: "Prechat survey pane loading started."
22
+ Description: "Prechat survey pane loading started.",
23
+ CustomProperties: {
24
+ ConversationStage: ConversationStage.Initialization
25
+ }
23
26
  });
24
27
  }, []);
25
28
 
@@ -70,7 +73,10 @@ export const PreChatSurveyPaneStateful = props => {
70
73
  onSubmit: async values => {
71
74
  TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
72
75
  Event: TelemetryEvent.PrechatSubmitted,
73
- Description: "Prechat survey submitted."
76
+ Description: "Prechat survey submitted.",
77
+ CustomProperties: {
78
+ ConversationStage: ConversationStage.Initialization
79
+ }
74
80
  });
75
81
  dispatch({
76
82
  type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
@@ -144,7 +150,10 @@ export const PreChatSurveyPaneStateful = props => {
144
150
  TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.INFO, {
145
151
  Event: TelemetryEvent.UXPrechatPaneCompleted,
146
152
  ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed,
147
- Description: "Prechat survey pane loading completed."
153
+ Description: "Prechat survey pane loading completed.",
154
+ CustomProperties: {
155
+ ConversationStage: ConversationStage.Initialization
156
+ }
148
157
  });
149
158
  }, []);
150
159