@microsoft/omnichannel-chat-widget 1.8.5-0 → 1.8.6

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 (347) hide show
  1. package/lib/cjs/assets/Audios.js +1 -2
  2. package/lib/cjs/assets/Icons.js +16 -32
  3. package/lib/cjs/common/Constants.js +58 -86
  4. package/lib/cjs/common/KeyCodes.js +9 -10
  5. package/lib/cjs/common/contextDataStore/DataStoreManager.js +7 -8
  6. package/lib/cjs/common/facades/FacadeChatSDK.js +11 -13
  7. package/lib/cjs/common/storage/default/defaultCacheManager.js +7 -8
  8. package/lib/cjs/common/telemetry/AppInsightsEvents.js +2 -3
  9. package/lib/cjs/common/telemetry/ScenarioMarker.js +10 -12
  10. package/lib/cjs/common/telemetry/TelemetryConstants.js +31 -29
  11. package/lib/cjs/common/telemetry/TelemetryHelper.js +39 -39
  12. package/lib/cjs/common/telemetry/TelemetryManager.js +21 -24
  13. package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +2 -3
  14. package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +2 -3
  15. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +2 -3
  16. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryInternalData.js +2 -3
  17. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +7 -8
  18. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +1 -1
  19. package/lib/cjs/common/utils/SecureEventBus.js +36 -10
  20. package/lib/cjs/common/utils/dispatchCustomEvent.js +2 -3
  21. package/lib/cjs/common/utils/xssUtils.js +1 -1
  22. package/lib/cjs/common/utils.js +10 -11
  23. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +15 -17
  24. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +10 -12
  25. package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +2 -3
  26. package/lib/cjs/components/citationpanestateful/CitationDim.js +3 -4
  27. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +3 -6
  28. package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +3 -5
  29. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +3 -5
  30. package/lib/cjs/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.js +2 -3
  31. package/lib/cjs/components/dimlayer/DimLayer.js +1 -1
  32. package/lib/cjs/components/draggable/DraggableChatWidget.js +3 -5
  33. package/lib/cjs/components/draggable/DraggableEventEmitter.js +4 -6
  34. package/lib/cjs/components/draggable/DraggableEventNames.js +4 -5
  35. package/lib/cjs/components/draggable/DraggableEventReceiver.js +2 -4
  36. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +8 -10
  37. package/lib/cjs/components/errorboundary/ErrorBoundary.js +17 -21
  38. package/lib/cjs/components/footerstateful/FooterStateful.js +9 -11
  39. package/lib/cjs/components/footerstateful/audionotificationstateful/AudioNotificationStateful.js +2 -4
  40. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +4 -4
  41. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.js +1 -2
  42. package/lib/cjs/components/headerstateful/HeaderStateful.js +13 -15
  43. package/lib/cjs/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.js +2 -3
  44. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +6 -8
  45. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +10 -14
  46. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +26 -32
  47. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +10 -12
  48. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +9 -11
  49. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +9 -11
  50. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +9 -11
  51. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +12 -17
  52. package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +4 -5
  53. package/lib/cjs/components/livechatwidget/common/Deferred.js +10 -13
  54. package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +12 -15
  55. package/lib/cjs/components/livechatwidget/common/authHelper.js +1 -1
  56. package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +5 -5
  57. package/lib/cjs/components/livechatwidget/common/createAdapter.js +3 -3
  58. package/lib/cjs/components/livechatwidget/common/createDownloadTranscriptProps.js +1 -2
  59. package/lib/cjs/components/livechatwidget/common/createFooter.js +1 -1
  60. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -6
  61. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +1 -2
  62. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +2 -3
  63. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +2 -3
  64. package/lib/cjs/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.js +2 -3
  65. package/lib/cjs/components/livechatwidget/common/endChat.js +12 -13
  66. package/lib/cjs/components/livechatwidget/common/helpers/markdownHelper.js +1 -1
  67. package/lib/cjs/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -4
  68. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +17 -17
  69. package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +8 -8
  70. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +4 -5
  71. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +6 -6
  72. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +11 -11
  73. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +10 -10
  74. package/lib/cjs/components/livechatwidget/common/startChat.js +37 -37
  75. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +6 -7
  76. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +3 -4
  77. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +76 -78
  78. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +6 -8
  79. package/lib/cjs/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.js +2 -3
  80. package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +2 -3
  81. package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +37 -40
  82. package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.js +2 -3
  83. package/lib/cjs/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.js +2 -3
  84. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +3 -5
  85. package/lib/cjs/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.js +2 -3
  86. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +3 -5
  87. package/lib/cjs/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.js +2 -3
  88. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +4 -6
  89. package/lib/cjs/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.js +2 -3
  90. package/lib/cjs/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +1 -2
  91. package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +3 -4
  92. package/lib/cjs/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +3 -4
  93. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +10 -12
  94. package/lib/cjs/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.js +2 -3
  95. package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +2 -3
  96. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -10
  97. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -6
  98. package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +15 -17
  99. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +2 -3
  100. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +2 -3
  101. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +2 -3
  102. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +2 -3
  103. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +2 -3
  104. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -37
  105. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +18 -21
  106. package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +17 -20
  107. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +21 -24
  108. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +20 -23
  109. package/lib/cjs/components/webchatcontainerstateful/common/MockBotCardCommandType.js +4 -5
  110. package/lib/cjs/components/webchatcontainerstateful/common/MockBotCommand.js +4 -5
  111. package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +1 -2
  112. package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +2 -3
  113. package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +3 -4
  114. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.js +2 -3
  115. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.js +2 -3
  116. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -3
  117. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -4
  118. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -3
  119. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +2 -3
  120. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.js +2 -3
  121. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +2 -3
  122. package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +12 -15
  123. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +10 -12
  124. package/lib/cjs/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +0 -1
  125. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +10 -13
  126. package/lib/cjs/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +1 -1
  127. package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +3 -4
  128. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +7 -8
  129. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +2 -3
  130. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +7 -8
  131. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +3 -4
  132. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +3 -4
  133. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +3 -4
  134. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +3 -4
  135. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +3 -4
  136. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +3 -4
  137. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +3 -4
  138. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +3 -4
  139. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +9 -11
  140. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.js +1 -2
  141. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.js +1 -2
  142. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +2 -3
  143. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +2 -3
  144. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +60 -42
  145. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +2 -4
  146. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +8 -9
  147. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -1
  148. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +4 -4
  149. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +11 -12
  150. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.js +2 -3
  151. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.js +2 -3
  152. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +3 -4
  153. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +4 -5
  154. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +3 -4
  155. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +3 -4
  156. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.js +2 -3
  157. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.js +1 -1
  158. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +3 -3
  159. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.js +2 -3
  160. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.js +2 -3
  161. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.js +2 -3
  162. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.js +2 -3
  163. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.js +2 -3
  164. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.js +2 -3
  165. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.js +2 -3
  166. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.js +2 -3
  167. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.js +2 -3
  168. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +2 -3
  169. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +2 -3
  170. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +2 -3
  171. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.js +2 -3
  172. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +2 -3
  173. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +2 -3
  174. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.js +2 -3
  175. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.js +2 -3
  176. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +2 -3
  177. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.js +2 -3
  178. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.js +2 -3
  179. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.js +2 -3
  180. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +2 -3
  181. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.js +2 -3
  182. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -6
  183. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +7 -7
  184. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
  185. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +1 -1
  186. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -4
  187. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
  188. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +1 -2
  189. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +2 -3
  190. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +3 -4
  191. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +7 -8
  192. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +1 -2
  193. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +3 -4
  194. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +8 -8
  195. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +9 -10
  196. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +3 -4
  197. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +1 -2
  198. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +4 -5
  199. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +3 -4
  200. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +4 -5
  201. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +3 -4
  202. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +3 -4
  203. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.js +1 -2
  204. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.js +2 -3
  205. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +8 -10
  206. package/lib/cjs/contexts/ChatAdapterStore.js +1 -2
  207. package/lib/cjs/contexts/ChatContextStore.js +1 -2
  208. package/lib/cjs/contexts/ChatSDKStore.js +1 -2
  209. package/lib/cjs/contexts/FacadeChatSDKStore.js +1 -2
  210. package/lib/cjs/contexts/common/ConversationState.js +3 -4
  211. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +211 -4
  212. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +3 -3
  213. package/lib/cjs/contexts/common/StartChatFailureType.js +3 -4
  214. package/lib/cjs/controller/componentController.js +1 -1
  215. package/lib/cjs/firstresponselatency/Constants.js +3 -4
  216. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +9 -11
  217. package/lib/cjs/firstresponselatency/util.js +8 -8
  218. package/lib/cjs/hooks/useChatAdapterStore.js +1 -2
  219. package/lib/cjs/hooks/useChatContextStore.js +1 -2
  220. package/lib/cjs/hooks/useChatSDKStore.js +1 -2
  221. package/lib/cjs/hooks/useFacadeChatSDKStore.js +1 -2
  222. package/lib/cjs/hooks/useWindowDimensions.js +1 -1
  223. package/lib/cjs/index.js +1 -1
  224. package/lib/cjs/plugins/createChatTranscript.js +25 -28
  225. package/lib/cjs/plugins/newMessageEventHandler.js +2 -2
  226. package/lib/esm/common/Constants.js +40 -39
  227. package/lib/esm/common/KeyCodes.js +9 -9
  228. package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -6
  229. package/lib/esm/common/facades/FacadeChatSDK.js +9 -10
  230. package/lib/esm/common/storage/default/defaultCacheManager.js +6 -6
  231. package/lib/esm/common/telemetry/ScenarioMarker.js +9 -10
  232. package/lib/esm/common/telemetry/TelemetryConstants.js +33 -25
  233. package/lib/esm/common/telemetry/TelemetryHelper.js +38 -37
  234. package/lib/esm/common/telemetry/TelemetryManager.js +19 -20
  235. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +5 -5
  236. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +1 -1
  237. package/lib/esm/common/utils/SecureEventBus.js +9 -8
  238. package/lib/esm/common/utils.js +10 -11
  239. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +12 -12
  240. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +7 -7
  241. package/lib/esm/components/citationpanestateful/CitationDim.js +1 -1
  242. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +0 -1
  243. package/lib/esm/components/draggable/DraggableEventEmitter.js +1 -1
  244. package/lib/esm/components/draggable/DraggableEventNames.js +3 -3
  245. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -5
  246. package/lib/esm/components/errorboundary/ErrorBoundary.js +15 -17
  247. package/lib/esm/components/footerstateful/FooterStateful.js +6 -6
  248. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +3 -3
  249. package/lib/esm/components/headerstateful/HeaderStateful.js +10 -10
  250. package/lib/esm/components/livechatwidget/LiveChatWidget.js +3 -3
  251. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +9 -12
  252. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +23 -28
  253. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +8 -9
  254. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +7 -8
  255. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +7 -8
  256. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +7 -8
  257. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +10 -14
  258. package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +3 -3
  259. package/lib/esm/components/livechatwidget/common/Deferred.js +8 -10
  260. package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +10 -12
  261. package/lib/esm/components/livechatwidget/common/authHelper.js +1 -1
  262. package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +5 -5
  263. package/lib/esm/components/livechatwidget/common/createAdapter.js +3 -3
  264. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +6 -6
  265. package/lib/esm/components/livechatwidget/common/createMarkdown.js +0 -1
  266. package/lib/esm/components/livechatwidget/common/endChat.js +12 -13
  267. package/lib/esm/components/livechatwidget/common/initConfirmationPropsComposer.js +4 -4
  268. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +16 -16
  269. package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +8 -8
  270. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +3 -3
  271. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +6 -6
  272. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +11 -11
  273. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +10 -10
  274. package/lib/esm/components/livechatwidget/common/startChat.js +37 -37
  275. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +6 -7
  276. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
  277. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +73 -73
  278. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +3 -3
  279. package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +34 -35
  280. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +1 -1
  281. package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +3 -3
  282. package/lib/esm/components/postchatsurveypanestateful/enums/PostChatSurveyMode.js +3 -3
  283. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +7 -7
  284. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +5 -5
  285. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +1 -1
  286. package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +12 -12
  287. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +31 -32
  288. package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +15 -17
  289. package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +15 -17
  290. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +18 -20
  291. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +18 -20
  292. package/lib/esm/components/webchatcontainerstateful/common/MockBotCardCommandType.js +3 -3
  293. package/lib/esm/components/webchatcontainerstateful/common/MockBotCommand.js +3 -3
  294. package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +1 -1
  295. package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +10 -12
  296. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +7 -8
  297. package/lib/esm/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.js +0 -1
  298. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +7 -7
  299. package/lib/esm/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.js +1 -1
  300. package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -1
  301. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -6
  302. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -6
  303. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.js +3 -3
  304. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.js +3 -3
  305. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.js +3 -3
  306. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.js +3 -3
  307. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.js +3 -3
  308. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.js +3 -3
  309. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.js +3 -3
  310. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.js +3 -3
  311. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +7 -8
  312. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +28 -35
  313. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +6 -6
  314. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +3 -3
  315. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.js +9 -9
  316. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.js +1 -1
  317. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.js +3 -3
  318. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.js +1 -1
  319. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.js +1 -1
  320. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +3 -3
  321. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.js +6 -6
  322. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +7 -7
  323. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +1 -1
  324. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.js +0 -1
  325. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.js +2 -2
  326. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +6 -6
  327. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +2 -2
  328. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +8 -8
  329. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -8
  330. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +2 -2
  331. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.js +3 -3
  332. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.js +2 -2
  333. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.js +2 -2
  334. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +3 -4
  335. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.js +2 -2
  336. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +6 -7
  337. package/lib/esm/contexts/common/ConversationState.js +3 -3
  338. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +211 -3
  339. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +3 -3
  340. package/lib/esm/contexts/common/StartChatFailureType.js +3 -3
  341. package/lib/esm/controller/componentController.js +1 -2
  342. package/lib/esm/firstresponselatency/Constants.js +3 -3
  343. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +7 -8
  344. package/lib/esm/firstresponselatency/util.js +8 -8
  345. package/lib/esm/plugins/createChatTranscript.js +23 -25
  346. package/lib/esm/plugins/newMessageEventHandler.js +2 -2
  347. package/package.json +28 -22
@@ -18,16 +18,16 @@ let conversationDetails = undefined;
18
18
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
19
  let postChatSurveyMode = undefined;
20
20
  const getBotSurveyMode = (props, state) => {
21
- var _props$chatConfig, _props$chatConfig$Liv, _state$domainStates$l, _state$domainStates$l2;
22
- return ((_props$chatConfig = props.chatConfig) === null || _props$chatConfig === void 0 ? void 0 : (_props$chatConfig$Liv = _props$chatConfig.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig$Liv === void 0 ? void 0 : _props$chatConfig$Liv.msdyn_postconversationsurveybotsurveymode) ?? ((_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_postconversationsurveybotsurveymode);
21
+ var _props$chatConfig, _state$domainStates$l;
22
+ return ((_props$chatConfig = props.chatConfig) === null || _props$chatConfig === void 0 || (_props$chatConfig = _props$chatConfig.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig === void 0 ? void 0 : _props$chatConfig.msdyn_postconversationsurveybotsurveymode) ?? ((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 || (_state$domainStates$l = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.msdyn_postconversationsurveybotsurveymode);
23
23
  };
24
24
  const getUserSurveyMode = (props, state) => {
25
- var _props$chatConfig2, _props$chatConfig2$Li, _props$chatConfig3, _props$chatConfig3$Li;
26
- if (!((_props$chatConfig2 = props.chatConfig) !== null && _props$chatConfig2 !== void 0 && (_props$chatConfig2$Li = _props$chatConfig2.LiveWSAndLiveChatEngJoin) !== null && _props$chatConfig2$Li !== void 0 && _props$chatConfig2$Li.msdyn_postconversationsurveymode)) {
27
- var _state$domainStates, _state$domainStates$l3, _state$domainStates$l4;
28
- return (state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : (_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) ?? _PostChatSurveyMode.PostChatSurveyMode.Embed;
25
+ var _props$chatConfig2, _props$chatConfig3;
26
+ if (!((_props$chatConfig2 = props.chatConfig) !== null && _props$chatConfig2 !== void 0 && (_props$chatConfig2 = _props$chatConfig2.LiveWSAndLiveChatEngJoin) !== null && _props$chatConfig2 !== void 0 && _props$chatConfig2.msdyn_postconversationsurveymode)) {
27
+ var _state$domainStates;
28
+ return (state === null || state === void 0 || (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.liveChatConfig) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.LiveWSAndLiveChatEngJoin) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.msdyn_postconversationsurveymode) ?? _PostChatSurveyMode.PostChatSurveyMode.Embed;
29
29
  }
30
- return (_props$chatConfig3 = props.chatConfig) === null || _props$chatConfig3 === void 0 ? void 0 : (_props$chatConfig3$Li = _props$chatConfig3.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig3$Li === void 0 ? void 0 : _props$chatConfig3$Li.msdyn_postconversationsurveymode;
30
+ return (_props$chatConfig3 = props.chatConfig) === null || _props$chatConfig3 === void 0 || (_props$chatConfig3 = _props$chatConfig3.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig3 === void 0 ? void 0 : _props$chatConfig3.msdyn_postconversationsurveymode;
31
31
  };
32
32
 
33
33
  // Set Survey mode based on conversation ended by entity
@@ -134,8 +134,8 @@ const initiatePostChat = async (props, conversationDetailsParam, state, dispatch
134
134
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
135
135
  exports.initiatePostChat = initiatePostChat;
136
136
  const isPostChatEnabled = (props, state) => {
137
- var _props$chatConfig4, _props$chatConfig4$Li, _state$domainStates$l5, _state$domainStates$l6;
138
- const isPostChatEnabled = ((_props$chatConfig4 = props.chatConfig) === null || _props$chatConfig4 === void 0 ? void 0 : (_props$chatConfig4$Li = _props$chatConfig4.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig4$Li === void 0 ? void 0 : _props$chatConfig4$Li.msdyn_postconversationsurveyenable) ?? ((_state$domainStates$l5 = state.domainStates.liveChatConfig) === null || _state$domainStates$l5 === void 0 ? void 0 : (_state$domainStates$l6 = _state$domainStates$l5.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l6 === void 0 ? void 0 : _state$domainStates$l6.msdyn_postconversationsurveyenable);
137
+ var _props$chatConfig4, _state$domainStates$l2;
138
+ const isPostChatEnabled = ((_props$chatConfig4 = props.chatConfig) === null || _props$chatConfig4 === void 0 || (_props$chatConfig4 = _props$chatConfig4.LiveWSAndLiveChatEngJoin) === null || _props$chatConfig4 === void 0 ? void 0 : _props$chatConfig4.msdyn_postconversationsurveyenable) ?? ((_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 || (_state$domainStates$l2 = _state$domainStates$l2.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable);
139
139
  return isPostChatEnabled === _Constants.Constants.true;
140
140
  };
141
141
 
@@ -153,7 +153,7 @@ const getPostChatContext = async (facadeChatSDK, state, dispatch) => {
153
153
  }
154
154
  if (postChatEnabled) {
155
155
  var _state$domainStates2;
156
- if ((state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.postChatContext) === undefined) {
156
+ if ((state === null || state === void 0 || (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.postChatContext) === undefined) {
157
157
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
158
158
  const context = await facadeChatSDK.getPostChatSurveyContext();
159
159
  _TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
@@ -64,7 +64,7 @@ const prepareStartChat = async (props, facadeChatSDK, state, dispatch, setAdapte
64
64
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
65
  exports.prepareStartChat = prepareStartChat;
66
66
  const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, isProactiveChat, proactiveChatEnablePrechatState, state, props) => {
67
- var _props$preChatSurveyP, _props$preChatSurveyP2, _props$controlProps, _state$domainStates, _state$domainStates$l, _state$domainStates$l2, _state$appStates2;
67
+ var _props$preChatSurveyP, _props$controlProps, _state$domainStates, _state$appStates2;
68
68
  // This reset needs to be done before to load prechat, because the conversation state changes from close to prechat
69
69
  if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === _ConversationState.ConversationState.Closed) {
70
70
  // Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
@@ -73,12 +73,12 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
73
73
 
74
74
  // Getting prechat Survey Context
75
75
  const parseToJson = false;
76
- const preChatSurveyResponse = (props === null || props === void 0 ? void 0 : (_props$preChatSurveyP = props.preChatSurveyPaneProps) === null || _props$preChatSurveyP === void 0 ? void 0 : (_props$preChatSurveyP2 = _props$preChatSurveyP.controlProps) === null || _props$preChatSurveyP2 === void 0 ? void 0 : _props$preChatSurveyP2.payload) ?? (await facadeChatSDK.getPreChatSurvey(parseToJson));
76
+ const preChatSurveyResponse = (props === null || props === void 0 || (_props$preChatSurveyP = props.preChatSurveyPaneProps) === null || _props$preChatSurveyP === void 0 || (_props$preChatSurveyP = _props$preChatSurveyP.controlProps) === null || _props$preChatSurveyP === void 0 ? void 0 : _props$preChatSurveyP.payload) ?? (await facadeChatSDK.getPreChatSurvey(parseToJson));
77
77
  let showPrechat = isProactiveChat ? preChatSurveyResponse && proactiveChatEnablePrechatState : preChatSurveyResponse && !(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hidePreChatSurveyPane);
78
- showPrechat = await (0, _persistentChatHelper.shouldSetPreChatIfPersistentChat)(facadeChatSDK, state === null || state === void 0 ? void 0 : (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 ? void 0 : (_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_conversationmode, showPrechat);
78
+ showPrechat = await (0, _persistentChatHelper.shouldSetPreChatIfPersistentChat)(facadeChatSDK, state === null || state === void 0 || (_state$domainStates = state.domainStates) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.liveChatConfig) === null || _state$domainStates === void 0 || (_state$domainStates = _state$domainStates.LiveWSAndLiveChatEngJoin) === null || _state$domainStates === void 0 ? void 0 : _state$domainStates.msdyn_conversationmode, showPrechat);
79
79
  if (showPrechat) {
80
- var _state$domainStates2, _state$domainStates2$, _state$domainStates2$2, _state$domainStates2$3;
81
- const isOutOfOperatingHours = (state === null || state === void 0 ? void 0 : (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 ? void 0 : (_state$domainStates2$ = _state$domainStates2.liveChatConfig) === null || _state$domainStates2$ === void 0 ? void 0 : (_state$domainStates2$2 = _state$domainStates2$.LiveWSAndLiveChatEngJoin) === null || _state$domainStates2$2 === void 0 ? void 0 : (_state$domainStates2$3 = _state$domainStates2$2.OutOfOperatingHours) === null || _state$domainStates2$3 === void 0 ? void 0 : _state$domainStates2$3.toString().toLowerCase()) === "true";
80
+ var _state$domainStates2;
81
+ const isOutOfOperatingHours = (state === null || state === void 0 || (_state$domainStates2 = state.domainStates) === null || _state$domainStates2 === void 0 || (_state$domainStates2 = _state$domainStates2.liveChatConfig) === null || _state$domainStates2 === void 0 || (_state$domainStates2 = _state$domainStates2.LiveWSAndLiveChatEngJoin) === null || _state$domainStates2 === void 0 || (_state$domainStates2 = _state$domainStates2.OutOfOperatingHours) === null || _state$domainStates2 === void 0 ? void 0 : _state$domainStates2.toString().toLowerCase()) === "true";
82
82
  if (isOutOfOperatingHours) {
83
83
  (state === null || state === void 0 ? void 0 : state.appStates.isMinimized) && dispatch({
84
84
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
@@ -104,8 +104,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
104
104
  });
105
105
 
106
106
  // If minimized, maximize the chat, if the state is missing, consider it as minimized
107
- 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) {
108
- var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$, _TelemetryManager$Int;
107
+ if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 || (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
108
+ var _state$domainStates3, _state$domainStates4, _TelemetryManager$Int;
109
109
  dispatch({
110
110
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
111
111
  payload: false
@@ -115,9 +115,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
115
115
  _omnichannelChatComponents.BroadcastService.postMessage({
116
116
  eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
117
117
  payload: {
118
- 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,
119
- 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,
120
- runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
118
+ height: state === null || state === void 0 || (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 || (_state$domainStates3 = _state$domainStates3.widgetSize) === null || _state$domainStates3 === void 0 ? void 0 : _state$domainStates3.height,
119
+ width: state === null || state === void 0 || (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 || (_state$domainStates4 = _state$domainStates4.widgetSize) === null || _state$domainStates4 === void 0 ? void 0 : _state$domainStates4.width,
120
+ runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 || (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
121
121
  }
122
122
  });
123
123
  }
@@ -137,8 +137,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
137
137
  *
138
138
  * This is because a new change to control OOH as closed event when a widget is coming from chat.
139
139
  */
140
- 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) {
141
- var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int2;
140
+ if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 || (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
141
+ var _state$domainStates5, _state$domainStates6, _TelemetryManager$Int2;
142
142
  dispatch({
143
143
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
144
144
  payload: false
@@ -147,9 +147,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
147
147
  _omnichannelChatComponents.BroadcastService.postMessage({
148
148
  eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
149
149
  payload: {
150
- 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,
151
- 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,
152
- runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
150
+ height: state === null || state === void 0 || (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 || (_state$domainStates5 = _state$domainStates5.widgetSize) === null || _state$domainStates5 === void 0 ? void 0 : _state$domainStates5.height,
151
+ width: state === null || state === void 0 || (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 || (_state$domainStates6 = _state$domainStates6.widgetSize) === null || _state$domainStates6 === void 0 ? void 0 : _state$domainStates6.width,
152
+ runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 || (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
153
153
  }
154
154
  });
155
155
  }
@@ -162,9 +162,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
162
162
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
163
163
  exports.setPreChatAndInitiateChat = setPreChatAndInitiateChat;
164
164
  const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props, params, persistedState) => {
165
- var _state$domainStates7, _state$domainStates7$, _state$domainStates7$2;
165
+ var _state$domainStates7;
166
166
  let isStartChatSuccessful = false;
167
- const persistentChatEnabled = (0, _liveChatConfigUtils.isPersistentChatEnabled)(state === null || state === void 0 ? void 0 : (_state$domainStates7 = state.domainStates) === null || _state$domainStates7 === void 0 ? void 0 : (_state$domainStates7$ = _state$domainStates7.liveChatConfig) === null || _state$domainStates7$ === void 0 ? void 0 : (_state$domainStates7$2 = _state$domainStates7$.LiveWSAndLiveChatEngJoin) === null || _state$domainStates7$2 === void 0 ? void 0 : _state$domainStates7$2.msdyn_conversationmode);
167
+ const persistentChatEnabled = (0, _liveChatConfigUtils.isPersistentChatEnabled)(state === null || state === void 0 || (_state$domainStates7 = state.domainStates) === null || _state$domainStates7 === void 0 || (_state$domainStates7 = _state$domainStates7.liveChatConfig) === null || _state$domainStates7 === void 0 || (_state$domainStates7 = _state$domainStates7.LiveWSAndLiveChatEngJoin) === null || _state$domainStates7 === void 0 ? void 0 : _state$domainStates7.msdyn_conversationmode);
168
168
  if ((state === null || state === void 0 ? void 0 : state.appStates.conversationState) === _ConversationState.ConversationState.Closed) {
169
169
  // Preventive reset to avoid starting chat with previous requestId which could potentially cause problems
170
170
  (0, _endChat.chatSDKStateCleanUp)(facadeChatSDK.getChatSDK());
@@ -172,7 +172,7 @@ const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props,
172
172
  try {
173
173
  var _state$appStates3;
174
174
  // Clear disconnect state on start chat
175
- (state === null || state === void 0 ? void 0 : (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.chatDisconnectEventReceived) && dispatch({
175
+ (state === null || state === void 0 || (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.chatDisconnectEventReceived) && dispatch({
176
176
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
177
177
  payload: false
178
178
  });
@@ -189,23 +189,23 @@ const initStartChat = async (facadeChatSDK, dispatch, setAdapter, state, props,
189
189
 
190
190
  //Check if chat retrieved from cache
191
191
  if (persistedState || params !== null && params !== void 0 && params.liveChatContext) {
192
- var _persistedState$domai, _persistedState$domai2, _persistedState$domai3, _persistedState$domai4, _persistedState$domai5;
192
+ var _persistedState$domai, _persistedState$domai2;
193
193
  _omnichannelChatComponents.BroadcastService.postMessage({
194
194
  eventName: _TelemetryConstants.BroadcastEvent.ChatRetrievedFromCache,
195
195
  payload: {
196
- chatId: persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai = persistedState.domainStates) === null || _persistedState$domai === void 0 ? void 0 : (_persistedState$domai2 = _persistedState$domai.liveChatContext) === null || _persistedState$domai2 === void 0 ? void 0 : (_persistedState$domai3 = _persistedState$domai2.chatToken) === null || _persistedState$domai3 === void 0 ? void 0 : _persistedState$domai3.chatId,
197
- requestId: persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai4 = persistedState.domainStates) === null || _persistedState$domai4 === void 0 ? void 0 : (_persistedState$domai5 = _persistedState$domai4.liveChatContext) === null || _persistedState$domai5 === void 0 ? void 0 : _persistedState$domai5.requestId
196
+ chatId: persistedState === null || persistedState === void 0 || (_persistedState$domai = persistedState.domainStates) === null || _persistedState$domai === void 0 || (_persistedState$domai = _persistedState$domai.liveChatContext) === null || _persistedState$domai === void 0 || (_persistedState$domai = _persistedState$domai.chatToken) === null || _persistedState$domai === void 0 ? void 0 : _persistedState$domai.chatId,
197
+ requestId: persistedState === null || persistedState === void 0 || (_persistedState$domai2 = persistedState.domainStates) === null || _persistedState$domai2 === void 0 || (_persistedState$domai2 = _persistedState$domai2.liveChatContext) === null || _persistedState$domai2 === void 0 ? void 0 : _persistedState$domai2.requestId
198
198
  }
199
199
  });
200
200
  }
201
201
  try {
202
- var _window$Microsoft, _window$Microsoft$Dyn, _window$Microsoft$Dyn2, _window$Microsoft$Dyn3;
202
+ var _window$Microsoft;
203
203
  // Set custom context params
204
204
  await setCustomContextParams(state, props);
205
205
  const defaultOptionalParams = {
206
206
  sendDefaultInitContext: true,
207
207
  isProactiveChat: !!(params !== null && params !== void 0 && params.isProactiveChat),
208
- portalContactId: (_window$Microsoft = window.Microsoft) === null || _window$Microsoft === void 0 ? void 0 : (_window$Microsoft$Dyn = _window$Microsoft.Dynamic365) === null || _window$Microsoft$Dyn === void 0 ? void 0 : (_window$Microsoft$Dyn2 = _window$Microsoft$Dyn.Portal) === null || _window$Microsoft$Dyn2 === void 0 ? void 0 : (_window$Microsoft$Dyn3 = _window$Microsoft$Dyn2.User) === null || _window$Microsoft$Dyn3 === void 0 ? void 0 : _window$Microsoft$Dyn3.contactId
208
+ portalContactId: (_window$Microsoft = window.Microsoft) === null || _window$Microsoft === void 0 || (_window$Microsoft = _window$Microsoft.Dynamic365) === null || _window$Microsoft === void 0 || (_window$Microsoft = _window$Microsoft.Portal) === null || _window$Microsoft === void 0 || (_window$Microsoft = _window$Microsoft.User) === null || _window$Microsoft === void 0 ? void 0 : _window$Microsoft.contactId
209
209
  };
210
210
  const startChatOptionalParams = Object.assign({}, params, optionalParams, defaultOptionalParams);
211
211
  // startTime is used to determine if a message is history or new, better to be set before creating the adapter to get bandwidth
@@ -293,27 +293,27 @@ const createAdapterAndSubscribe = async (facadeChatSDK, dispatch, setAdapter, st
293
293
  });
294
294
  if (chatToken !== null && chatToken !== void 0 && chatToken.chatId && chatToken !== null && chatToken !== void 0 && chatToken.visitorId) {
295
295
  var _newAdapter$activity$;
296
- newAdapter === null || newAdapter === void 0 ? void 0 : (_newAdapter$activity$ = newAdapter.activity$) === null || _newAdapter$activity$ === void 0 ? void 0 : _newAdapter$activity$.subscribe((0, _newMessageEventHandler.createOnNewAdapterActivityHandler)(chatToken.chatId, chatToken.visitorId, startTime));
296
+ newAdapter === null || newAdapter === void 0 || (_newAdapter$activity$ = newAdapter.activity$) === null || _newAdapter$activity$ === void 0 || _newAdapter$activity$.subscribe((0, _newMessageEventHandler.createOnNewAdapterActivityHandler)(chatToken.chatId, chatToken.visitorId, startTime));
297
297
  }
298
298
  };
299
299
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
300
300
  const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, setAdapter) => {
301
- var _state$appStates4, _persistedState$domai6, _persistedState$appSt;
301
+ var _state$appStates4, _persistedState$domai3, _persistedState$appSt;
302
302
  // By pass this function in case of popout chat
303
- if ((state === null || state === void 0 ? void 0 : (_state$appStates4 = state.appStates) === null || _state$appStates4 === void 0 ? void 0 : _state$appStates4.hideStartChatButton) === true) {
303
+ if ((state === null || state === void 0 || (_state$appStates4 = state.appStates) === null || _state$appStates4 === void 0 ? void 0 : _state$appStates4.hideStartChatButton) === true) {
304
304
  return false;
305
305
  }
306
306
  const persistedState = (0, _utils.getStateFromCache)((0, _utils.getWidgetCacheIdfromProps)(props));
307
307
 
308
308
  //Connect to only active chat session
309
- if (persistedState && !(0, _utils.isUndefinedOrEmpty)(persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai6 = persistedState.domainStates) === null || _persistedState$domai6 === void 0 ? void 0 : _persistedState$domai6.liveChatContext) && (persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$appSt = persistedState.appStates) === null || _persistedState$appSt === void 0 ? void 0 : _persistedState$appSt.conversationState) === _ConversationState.ConversationState.Active) {
310
- var _persistedState$domai7;
309
+ if (persistedState && !(0, _utils.isUndefinedOrEmpty)(persistedState === null || persistedState === void 0 || (_persistedState$domai3 = persistedState.domainStates) === null || _persistedState$domai3 === void 0 ? void 0 : _persistedState$domai3.liveChatContext) && (persistedState === null || persistedState === void 0 || (_persistedState$appSt = persistedState.appStates) === null || _persistedState$appSt === void 0 ? void 0 : _persistedState$appSt.conversationState) === _ConversationState.ConversationState.Active) {
310
+ var _persistedState$domai4;
311
311
  dispatch({
312
312
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
313
313
  payload: _ConversationState.ConversationState.Loading
314
314
  });
315
315
  const optionalParams = {
316
- liveChatContext: persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai7 = persistedState.domainStates) === null || _persistedState$domai7 === void 0 ? void 0 : _persistedState$domai7.liveChatContext
316
+ liveChatContext: persistedState === null || persistedState === void 0 || (_persistedState$domai4 = persistedState.domainStates) === null || _persistedState$domai4 === void 0 ? void 0 : _persistedState$domai4.liveChatContext
317
317
  };
318
318
  await initStartChat(facadeChatSDK, dispatch, setAdapter, state, props, optionalParams, persistedState);
319
319
  return true;
@@ -323,11 +323,11 @@ const canConnectToExistingChat = async (props, facadeChatSDK, state, dispatch, s
323
323
 
324
324
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
325
325
  const setCustomContextParams = async (state, props) => {
326
- var _state$domainStates8, _persistedState$domai8;
326
+ var _state$domainStates8, _persistedState$domai5;
327
327
  if (state !== null && state !== void 0 && (_state$domainStates8 = state.domainStates) !== null && _state$domainStates8 !== void 0 && _state$domainStates8.customContext) {
328
328
  var _state$domainStates9;
329
329
  optionalParams = Object.assign({}, optionalParams, {
330
- customContext: JSON.parse(JSON.stringify(state === null || state === void 0 ? void 0 : (_state$domainStates9 = state.domainStates) === null || _state$domainStates9 === void 0 ? void 0 : _state$domainStates9.customContext))
330
+ customContext: JSON.parse(JSON.stringify(state === null || state === void 0 || (_state$domainStates9 = state.domainStates) === null || _state$domainStates9 === void 0 ? void 0 : _state$domainStates9.customContext))
331
331
  });
332
332
  return;
333
333
  }
@@ -336,7 +336,7 @@ const setCustomContextParams = async (state, props) => {
336
336
  }
337
337
  // Add custom context only for unauthenticated chat
338
338
  const persistedState = (0, _utils.getStateFromCache)(widgetInstanceId);
339
- const customContextLocal = (persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai8 = persistedState.domainStates) === null || _persistedState$domai8 === void 0 ? void 0 : _persistedState$domai8.customContext) ?? (props === null || props === void 0 ? void 0 : props.initialCustomContext);
339
+ const customContextLocal = (persistedState === null || persistedState === void 0 || (_persistedState$domai5 = persistedState.domainStates) === null || _persistedState$domai5 === void 0 ? void 0 : _persistedState$domai5.customContext) ?? (props === null || props === void 0 ? void 0 : props.initialCustomContext);
340
340
  if (customContextLocal) {
341
341
  _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
342
342
  Event: _TelemetryConstants.TelemetryEvent.SettingCustomContext,
@@ -360,9 +360,9 @@ const canStartPopoutChat = async props => {
360
360
  }
361
361
  popoutWidgetInstanceId = (0, _utils.getWidgetCacheIdfromProps)(props, true);
362
362
  if (!(0, _utils.isNullOrEmptyString)(popoutWidgetInstanceId)) {
363
- var _persistedState$domai9, _persistedState$appSt2;
363
+ var _persistedState$domai6, _persistedState$appSt2;
364
364
  const persistedState = (0, _utils.getStateFromCache)(popoutWidgetInstanceId);
365
- if (persistedState && !(0, _utils.isUndefinedOrEmpty)(persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$domai9 = persistedState.domainStates) === null || _persistedState$domai9 === void 0 ? void 0 : _persistedState$domai9.liveChatContext) && (persistedState === null || persistedState === void 0 ? void 0 : (_persistedState$appSt2 = persistedState.appStates) === null || _persistedState$appSt2 === void 0 ? void 0 : _persistedState$appSt2.conversationState) === _ConversationState.ConversationState.Active) {
365
+ if (persistedState && !(0, _utils.isUndefinedOrEmpty)(persistedState === null || persistedState === void 0 || (_persistedState$domai6 = persistedState.domainStates) === null || _persistedState$domai6 === void 0 ? void 0 : _persistedState$domai6.liveChatContext) && (persistedState === null || persistedState === void 0 || (_persistedState$appSt2 = persistedState.appStates) === null || _persistedState$appSt2 === void 0 ? void 0 : _persistedState$appSt2.conversationState) === _ConversationState.ConversationState.Active) {
366
366
  // Initiate popout chat
367
367
  _omnichannelChatComponents.BroadcastService.postMessage({
368
368
  eventName: _TelemetryConstants.BroadcastEvent.InitiateStartChatInPopoutMode
@@ -375,9 +375,9 @@ const canStartPopoutChat = async props => {
375
375
 
376
376
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
377
377
  const checkIfConversationStillValid = async (facadeChatSDK, dispatch, state) => {
378
- var _state$domainStates10, _state$domainStates11, _state$domainStates12;
379
- const requestIdFromCache = (_state$domainStates10 = state.domainStates) === null || _state$domainStates10 === void 0 ? void 0 : (_state$domainStates11 = _state$domainStates10.liveChatContext) === null || _state$domainStates11 === void 0 ? void 0 : _state$domainStates11.requestId;
380
- const liveChatContext = state === null || state === void 0 ? void 0 : (_state$domainStates12 = state.domainStates) === null || _state$domainStates12 === void 0 ? void 0 : _state$domainStates12.liveChatContext;
378
+ var _state$domainStates0, _state$domainStates1;
379
+ const requestIdFromCache = (_state$domainStates0 = state.domainStates) === null || _state$domainStates0 === void 0 || (_state$domainStates0 = _state$domainStates0.liveChatContext) === null || _state$domainStates0 === void 0 ? void 0 : _state$domainStates0.requestId;
380
+ const liveChatContext = state === null || state === void 0 || (_state$domainStates1 = state.domainStates) === null || _state$domainStates1 === void 0 ? void 0 : _state$domainStates1.liveChatContext;
381
381
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
382
382
  let conversationDetails = undefined;
383
383
  // Preserve current requestId
@@ -37,7 +37,6 @@ const handleStartChatError = (dispatch, facadeChatSDK, props, ex, isStartChatSuc
37
37
  logWidgetLoadCompleteWithError(ex);
38
38
  // Don't return early - let the generic error handling logic handle hideErrorUIPane and telemetry
39
39
  }
40
-
41
40
  if (ex.message === _Constants.WidgetLoadCustomErrorString.NetworkErrorString) {
42
41
  logWidgetLoadCompleteWithError(ex);
43
42
  }
@@ -124,7 +123,7 @@ const logWidgetLoadFailed = ex => {
124
123
  Event: _TelemetryConstants.TelemetryEvent.WidgetLoadFailed,
125
124
  Description: "Widget load complete with error",
126
125
  ExceptionDetails: exDetails,
127
- ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed,
126
+ ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 || (_TelemetryTimers$Widg = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg === void 0 ? void 0 : _TelemetryTimers$Widg.milliSecondsElapsed,
128
127
  CustomProperties: {
129
128
  ConversationStage: _TelemetryConstants.ConversationStage.Initialization
130
129
  }
@@ -139,7 +138,7 @@ const logWidgetLoadComplete = additionalMessage => {
139
138
  _TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
140
139
  Event: _TelemetryConstants.TelemetryEvent.WidgetLoadComplete,
141
140
  Description: descriptionString,
142
- ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg2 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
141
+ ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 || (_TelemetryTimers$Widg2 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg2 === void 0 ? void 0 : _TelemetryTimers$Widg2.milliSecondsElapsed
143
142
  });
144
143
  };
145
144
  exports.logWidgetLoadComplete = logWidgetLoadComplete;
@@ -170,7 +169,7 @@ const logWidgetLoadCompleteWithError = ex => {
170
169
  Event: _TelemetryConstants.TelemetryEvent.WidgetLoadFailed,
171
170
  Description: "Widget load complete with error",
172
171
  ExceptionDetails: exDetails,
173
- ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed,
172
+ ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 || (_TelemetryTimers$Widg3 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed,
174
173
  CustomProperties: {
175
174
  ConversationStage: _TelemetryConstants.ConversationStage.Initialization
176
175
  }
@@ -201,7 +200,7 @@ const logWidgetLoadWithUnexpectedError = ex => {
201
200
  Event: _TelemetryConstants.TelemetryEvent.WidgetLoadFailed,
202
201
  Description: "Widget load with unexpected error",
203
202
  ExceptionDetails: exDetails,
204
- ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed,
203
+ ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 || (_TelemetryTimers$Widg4 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed,
205
204
  CustomProperties: {
206
205
  ConversationStage: _TelemetryConstants.ConversationStage.Initialization
207
206
  }
@@ -218,7 +217,7 @@ const forceEndChat = facadeChatSDK => {
218
217
  _TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
219
218
  Event: _TelemetryConstants.TelemetryEvent.EndChatSDKCall
220
219
  });
221
- facadeChatSDK === null || facadeChatSDK === void 0 ? void 0 : facadeChatSDK.getChatSDK().endChat();
220
+ facadeChatSDK === null || facadeChatSDK === void 0 || facadeChatSDK.getChatSDK().endChat();
222
221
  };
223
222
  const handleWidgetUseOutsideOperatingHour = dispatch => {
224
223
  dispatch({
@@ -286,7 +285,7 @@ const handleInvalidOrClosedConversation = (dispatch, facadeChatSDK, props, ex) =
286
285
  (0, _endChat.endChatStateCleanUp)(dispatch);
287
286
  (0, _endChat.closeChatStateCleanUp)(dispatch);
288
287
  (0, _endChat.chatSDKStateCleanUp)(facadeChatSDK.getChatSDK());
289
- (_DataStoreManager$cli = _DataStoreManager.DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 ? void 0 : _DataStoreManager$cli.removeData((0, _utils.getWidgetCacheIdfromProps)(props));
288
+ (_DataStoreManager$cli = _DataStoreManager.DataStoreManager.clientDataStore) === null || _DataStoreManager$cli === void 0 || _DataStoreManager$cli.removeData((0, _utils.getWidgetCacheIdfromProps)(props));
290
289
 
291
290
  // Starts new chat
292
291
  dispatch({
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.LiveChatWidgetMockType = void 0;
7
- let LiveChatWidgetMockType;
8
- exports.LiveChatWidgetMockType = LiveChatWidgetMockType;
9
- (function (LiveChatWidgetMockType) {
7
+ let LiveChatWidgetMockType = exports.LiveChatWidgetMockType = /*#__PURE__*/function (LiveChatWidgetMockType) {
10
8
  LiveChatWidgetMockType["Test"] = "Test";
11
9
  LiveChatWidgetMockType["Demo"] = "Demo";
12
10
  LiveChatWidgetMockType["Designer"] = "Designer";
13
- })(LiveChatWidgetMockType || (exports.LiveChatWidgetMockType = LiveChatWidgetMockType = {}));
11
+ return LiveChatWidgetMockType;
12
+ }({});