@microsoft/omnichannel-chat-widget 1.7.8-main.29ce174 → 1.7.8-main.2bcb0b6
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.
- package/lib/cjs/common/Constants.js +67 -20
- package/lib/cjs/common/KeyCodes.js +6 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/cjs/common/facades/FacadeChatSDK.js +392 -295
- package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +31 -0
- package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +158 -129
- package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/cjs/common/telemetry/TelemetryManager.js +32 -12
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
- package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +149 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/cjs/components/footerstateful/FooterStateful.js +11 -6
- package/lib/cjs/components/headerstateful/HeaderStateful.js +21 -11
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +4 -18
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +8 -25
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +14 -12
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +16 -10
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -4
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/cjs/firstresponselatency/Constants.js +13 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +118 -0
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +201 -0
- package/lib/cjs/firstresponselatency/util.js +98 -0
- package/lib/cjs/plugins/createChatTranscript.js +88 -58
- package/lib/cjs/plugins/newMessageEventHandler.js +102 -88
- package/lib/esm/common/Constants.js +65 -19
- package/lib/esm/common/KeyCodes.js +6 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/esm/common/facades/FacadeChatSDK.js +392 -295
- package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
- package/lib/esm/common/telemetry/AppInsightsEvents.js +24 -0
- package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +158 -129
- package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/esm/common/telemetry/TelemetryManager.js +32 -12
- package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
- package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +139 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +3 -2
- package/lib/esm/components/footerstateful/FooterStateful.js +11 -6
- package/lib/esm/components/headerstateful/HeaderStateful.js +21 -11
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +4 -18
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +6 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -2
- package/lib/esm/components/livechatwidget/common/startChat.js +9 -26
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +5 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +14 -12
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +16 -10
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -4
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/esm/firstresponselatency/Constants.js +6 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +112 -0
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +194 -0
- package/lib/esm/firstresponselatency/util.js +87 -0
- package/lib/esm/plugins/createChatTranscript.js +88 -58
- package/lib/esm/plugins/newMessageEventHandler.js +100 -86
- package/lib/types/assets/Audios.d.ts +1 -1
- package/lib/types/assets/Icons.d.ts +16 -16
- package/lib/types/common/Constants.d.ts +283 -277
- package/lib/types/common/KeyCodes.d.ts +5 -5
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -4
- package/lib/types/common/facades/FacadeChatSDK.d.ts +75 -74
- package/lib/types/common/facades/types/IFacadeChatSDKInput.d.ts +13 -13
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -14
- package/lib/types/common/interfaces/ITimer.d.ts +3 -3
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +5 -5
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +4 -4
- package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -6
- package/lib/types/common/telemetry/AppInsightsEvents.d.ts +1 -0
- package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +272 -257
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +48 -43
- package/lib/types/common/telemetry/TelemetryManager.d.ts +12 -12
- package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
- package/lib/types/common/telemetry/defaultConfigs/defaultAriaConfig.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.d.ts +2 -2
- package/lib/types/common/telemetry/defaultConfigs/defaultTelemetryInternalData.d.ts +2 -2
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +77 -77
- package/lib/types/common/telemetry/definitions/Payload.d.ts +105 -105
- package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
- package/lib/types/common/telemetry/interfaces/IAriaConfigurations.d.ts +18 -18
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +6 -5
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +23 -21
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +48 -48
- package/lib/types/common/telemetry/interfaces/ITelemetryEvents.d.ts +7 -7
- package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +10 -0
- package/lib/types/common/telemetry/loggers/ariaTelemetryLogger.d.ts +2 -2
- package/lib/types/common/telemetry/loggers/consoleLogger.d.ts +2 -2
- package/lib/types/common/utils.d.ts +49 -49
- package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +4 -3
- package/lib/types/components/callingcontainerstateful/ICallingContainerStatefulProps.d.ts +4 -4
- package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +4 -3
- package/lib/types/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.d.ts +2 -2
- package/lib/types/components/chatbuttonstateful/interfaces/IChatButtonStatefulParams.d.ts +17 -17
- package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +4 -3
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +2 -2
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneInputs.d.ts +4 -4
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.d.ts +10 -10
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +13 -13
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +8 -8
- package/lib/types/components/dimlayer/DimLayer.d.ts +6 -5
- package/lib/types/components/draggable/DraggableChatWidget.d.ts +9 -9
- package/lib/types/components/draggable/DraggableEventEmitter.d.ts +27 -27
- package/lib/types/components/draggable/DraggableEventNames.d.ts +6 -6
- package/lib/types/components/draggable/DraggableEventReceiver.d.ts +27 -27
- package/lib/types/components/draggable/IDraggableElementPosition.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableElementPositionDelta.d.ts +5 -5
- package/lib/types/components/draggable/IDraggableEvent.d.ts +12 -12
- package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +4 -3
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IChatTranscriptBody.d.ts +5 -5
- package/lib/types/components/emailtranscriptpanestateful/interfaces/IEmailTranscriptPaneProps.d.ts +11 -11
- package/lib/types/components/footerstateful/FooterStateful.d.ts +3 -2
- package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +4 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps.d.ts +3 -3
- package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +4 -4
- package/lib/types/components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts.d.ts +23 -23
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps.d.ts +19 -19
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/IWebChatTranscriptConfig.d.ts +14 -14
- package/lib/types/components/footerstateful/downloadtranscriptstateful/interfaces/TranscriptHtmlScripts.d.ts +33 -33
- package/lib/types/components/headerstateful/HeaderStateful.d.ts +4 -3
- package/lib/types/components/headerstateful/common/styleProps/defaultOutOfOfficeHeaderStyleProps.d.ts +2 -2
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +33 -33
- package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -14
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -5
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -9
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +18 -18
- package/lib/types/components/livechatwidget/common/chatDisconnectHelper.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/createAdapter.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/createDownloadTranscriptProps.d.ts +25 -25
- package/lib/types/components/livechatwidget/common/createFooter.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/createInternetConnectionChangeHandler.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/createMarkdown.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/defaultStyles/defaultLiveChatWidgetGeneralStyles.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +13 -13
- package/lib/types/components/livechatwidget/common/getGeneralStylesForButton.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/helpers/markdownHelper.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initCallingSdk.d.ts +2 -2
- package/lib/types/components/livechatwidget/common/initConfirmationPropsComposer.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +7 -7
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/overridePropsOnMockIfApplicable.d.ts +3 -3
- package/lib/types/components/livechatwidget/common/persistentChatHelper.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +12 -12
- package/lib/types/components/livechatwidget/common/registerTelemetryLoggers.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +10 -10
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +11 -11
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +6 -6
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +4 -4
- package/lib/types/components/livechatwidget/common/updateSessionDataForTelemetry.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IBotAuthActivitySubscriberOptionalParams.d.ts +4 -4
- package/lib/types/components/livechatwidget/interfaces/IDraggableChatWidgetProps.d.ts +10 -10
- package/lib/types/components/livechatwidget/interfaces/IFeatureConfigProps.d.ts +3 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +17 -17
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +21 -21
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +70 -68
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetStyleProps.d.ts +5 -5
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +8 -8
- package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -22
- package/lib/types/components/livechatwidget/interfaces/ISendBox.d.ts +12 -12
- package/lib/types/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.d.ts +3 -3
- package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +3 -2
- package/lib/types/components/loadingpanestateful/common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +4 -3
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectControlProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/defaultProps/defaultChatDisconnectStyleProps.d.ts +2 -2
- package/lib/types/components/notificationpanestateful/interfaces/INotificationPaneStatefulProps.d.ts +13 -13
- package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +4 -3
- package/lib/types/components/ooohpanestateful/common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatloadingpanestateful/common/defaultgeneralPostChatLoadingPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/postchatsurveypanestateful/common/defaultStyleProps/defaultgeneralPostChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -2
- package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +5 -5
- package/lib/types/components/postchatsurveypanestateful/enums/PostChatSurveyMode.d.ts +4 -4
- package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +4 -3
- package/lib/types/components/prechatsurveypanestateful/common/defaultProps/defaultPreChatSurveyLocalizedTexts.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.d.ts +2 -2
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +3 -2
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -3
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +4 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatContext.d.ts +4 -4
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatOptionalParams.d.ts +3 -3
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulParams.d.ts +5 -5
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +4 -3
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -2
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -5
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -6
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +14 -14
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -8
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +4 -3
- package/lib/types/components/webchatcontainerstateful/common/DemoChatAdapter.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/common/DemoChatSDK.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +31 -31
- package/lib/types/components/webchatcontainerstateful/common/MockBotCardCommandType.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/common/MockBotCommand.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultAttachmentProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMarkdownLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStatefulContainerStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/common/mockadapter.d.ts +14 -14
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +45 -45
- package/lib/types/components/webchatcontainerstateful/common/utils/BrowserInfo.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.d.ts +7 -7
- package/lib/types/components/webchatcontainerstateful/common/utils/attachmentActivityUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/common/utils/isMaskingFromCustomer.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/interfaces/IAttachmentProps.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotAuthConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingInfo.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingRule.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/interfaces/IDataMaskingSetting.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +37 -37
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatAction.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +28 -28
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +39 -39
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/BrowserVendor.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineActivityType.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/DirectLineSenderRole.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/MessageType.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationLevel.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/SendStatus.d.ts +5 -5
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/enums/WebChatActionType.d.ts +24 -24
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.d.ts +9 -9
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsEgressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/adaptermiddlewares/formatTagsIngressMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/FileScanStatus.d.ts +6 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +3 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +8 -8
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentContentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDividerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentDownloadIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentFileNameStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAttachmentSizeStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentAdaptiveCardStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentIconStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAtttachmentStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSentMessageAnchorStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampContentStyles.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampFailedStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorBubbleStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorContainerStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTypingIndicatorMessageStyles.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageStyles.d.ts +3 -3
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/index.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +4 -4
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +7 -6
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator.d.ts +11 -11
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware.d.ts +10 -10
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.d.ts +12 -12
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -1
- package/lib/types/contexts/ChatAdapterStore.d.ts +1 -2
- package/lib/types/contexts/ChatContextStore.d.ts +1 -1
- package/lib/types/contexts/ChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/FacadeChatSDKStore.d.ts +1 -1
- package/lib/types/contexts/common/ConversationState.d.ts +13 -13
- package/lib/types/contexts/common/ILiveChatWidgetAction.d.ts +5 -5
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +63 -63
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +40 -40
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +48 -48
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +3 -3
- package/lib/types/contexts/common/StartChatFailureType.d.ts +5 -5
- package/lib/types/contexts/createReducer.d.ts +4 -4
- package/lib/types/controller/componentController.d.ts +16 -16
- package/lib/types/firstresponselatency/Constants.d.ts +30 -0
- package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -0
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -0
- package/lib/types/firstresponselatency/util.d.ts +7 -0
- package/lib/types/hooks/useChatAdapterStore.d.ts +2 -2
- package/lib/types/hooks/useChatContextStore.d.ts +5 -5
- package/lib/types/hooks/useChatSDKStore.d.ts +2 -2
- package/lib/types/hooks/useDebounce.d.ts +3 -3
- package/lib/types/hooks/useFacadeChatSDKStore.d.ts +3 -3
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -4
- package/lib/types/index.d.ts +11 -11
- package/lib/types/plugins/createChatTranscript.d.ts +3 -3
- package/lib/types/plugins/newMessageEventHandler.d.ts +2 -2
- package/package.json +41 -16
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FirstResponseLatencyTracker = void 0;
|
|
7
|
+
var _TelemetryConstants = require("../common/telemetry/TelemetryConstants");
|
|
8
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
|
+
var _TelemetryHelper = require("../common/telemetry/TelemetryHelper");
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
let FirstResponseLatencyTracker = /*#__PURE__*/function () {
|
|
17
|
+
function FirstResponseLatencyTracker() {
|
|
18
|
+
_classCallCheck(this, FirstResponseLatencyTracker);
|
|
19
|
+
_defineProperty(this, "isABotConversation", false);
|
|
20
|
+
_defineProperty(this, "isStarted", false);
|
|
21
|
+
_defineProperty(this, "isEnded", false);
|
|
22
|
+
_defineProperty(this, "startTrackingMessage", void 0);
|
|
23
|
+
_defineProperty(this, "stopTrackingMessage", void 0);
|
|
24
|
+
_defineProperty(this, "isReady", false);
|
|
25
|
+
_defineProperty(this, "offlineNetworkListener", _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.NetworkDisconnected).subscribe(() => {
|
|
26
|
+
this.isStarted = false;
|
|
27
|
+
this.isEnded = false;
|
|
28
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
29
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageStopLapTrackError,
|
|
30
|
+
Description: "Tracker Stopped due to network disconnection"
|
|
31
|
+
});
|
|
32
|
+
}));
|
|
33
|
+
_defineProperty(this, "fmltrackingListener", _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.FMLTrackingCompleted).subscribe(() => {
|
|
34
|
+
this.isReady = true;
|
|
35
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
36
|
+
eventName: _TelemetryConstants.BroadcastEvent.FMLTrackingCompletedAck,
|
|
37
|
+
payload: null
|
|
38
|
+
});
|
|
39
|
+
}));
|
|
40
|
+
// Rehydrate message is received when the widget is reloaded, this is to ensure that we are not tracking messages that are not part of the current conversation
|
|
41
|
+
// No need to keep listerning for tracking, enforcing disconnection for the listners
|
|
42
|
+
_defineProperty(this, "rehydrateListener", _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.RehydrateMessageReceived).subscribe(() => {
|
|
43
|
+
this.isReady = true;
|
|
44
|
+
}));
|
|
45
|
+
// Rehydrate message is received when the widget is reloaded, this is to ensure that we are not tracking messages that are not part of the current conversation
|
|
46
|
+
// No need to keep listerning for tracking, enforcing disconnection for the listners
|
|
47
|
+
_defineProperty(this, "historyListener", _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.HistoryMessageReceived).subscribe(() => {
|
|
48
|
+
this.isReady = true;
|
|
49
|
+
}));
|
|
50
|
+
// this is a workaround to ensure in reload we track effectively the messages
|
|
51
|
+
// we do have a mechanism in place to prevent log agent messages.
|
|
52
|
+
this.isABotConversation = true;
|
|
53
|
+
}
|
|
54
|
+
_createClass(FirstResponseLatencyTracker, [{
|
|
55
|
+
key: "createTrackingMessage",
|
|
56
|
+
value: function createTrackingMessage(payload, type) {
|
|
57
|
+
return {
|
|
58
|
+
Id: payload.Id,
|
|
59
|
+
role: payload.role,
|
|
60
|
+
timestamp: payload === null || payload === void 0 ? void 0 : payload.timestamp,
|
|
61
|
+
tags: payload.tags,
|
|
62
|
+
messageType: payload.messageType,
|
|
63
|
+
text: payload.text,
|
|
64
|
+
type: type,
|
|
65
|
+
checkTime: new Date().getTime()
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Tracking Functions
|
|
70
|
+
}, {
|
|
71
|
+
key: "startTracking",
|
|
72
|
+
value: function startTracking(payload) {
|
|
73
|
+
if (!this.isReady) return;
|
|
74
|
+
// this prevents to initiate tracking for multiple incoming messages
|
|
75
|
+
if (this.isStarted) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
// this is to ensure we track only messages where bot is engaged
|
|
79
|
+
if (!this.isABotConversation) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
// control of states to prevent clashing of messages
|
|
83
|
+
this.isStarted = true;
|
|
84
|
+
this.isEnded = false;
|
|
85
|
+
// The idea of using types is to enrich telemetry data
|
|
86
|
+
this.startTrackingMessage = this.createTrackingMessage(payload, "userMessage");
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "handleAgentMessage",
|
|
90
|
+
value: function handleAgentMessage(payload) {
|
|
91
|
+
var _payload$tags;
|
|
92
|
+
// this tag so far is only present in agent messages
|
|
93
|
+
if (payload !== null && payload !== void 0 && (_payload$tags = payload.tags) !== null && _payload$tags !== void 0 && _payload$tags.includes("public")) {
|
|
94
|
+
this.deregister();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "stopTracking",
|
|
99
|
+
value: function stopTracking(payload) {
|
|
100
|
+
var _this$stopTrackingMes, _this$startTrackingMe;
|
|
101
|
+
// this prevents execution for multiple incoming messages from the bot.
|
|
102
|
+
if (this.isEnded && !this.isStarted) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// control of states to prevent clashing of messages
|
|
107
|
+
this.isEnded = true;
|
|
108
|
+
this.isStarted = false;
|
|
109
|
+
|
|
110
|
+
// The idea of using types is to enrich telemetry data
|
|
111
|
+
this.stopTrackingMessage = this.createTrackingMessage(payload, "botMessage");
|
|
112
|
+
// calculating elapsed time
|
|
113
|
+
const elapsedTime = (((_this$stopTrackingMes = this.stopTrackingMessage) === null || _this$stopTrackingMes === void 0 ? void 0 : _this$stopTrackingMes.checkTime) ?? 0) - (((_this$startTrackingMe = this.startTrackingMessage) === null || _this$startTrackingMe === void 0 ? void 0 : _this$startTrackingMe.checkTime) ?? 0);
|
|
114
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
115
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageLapTrack,
|
|
116
|
+
Description: "First response latency tracking",
|
|
117
|
+
CustomProperties: {
|
|
118
|
+
elapsedTime,
|
|
119
|
+
userMessage: this.startTrackingMessage,
|
|
120
|
+
botMessage: this.stopTrackingMessage
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// mechanism to ensure we track only allowed conversations
|
|
126
|
+
}, {
|
|
127
|
+
key: "isMessageFromValidSender",
|
|
128
|
+
value: function isMessageFromValidSender(payload) {
|
|
129
|
+
var _payload$tags2;
|
|
130
|
+
// agent scenario
|
|
131
|
+
if (payload !== null && payload !== void 0 && (_payload$tags2 = payload.tags) !== null && _payload$tags2 !== void 0 && _payload$tags2.includes("public")) {
|
|
132
|
+
this.handleAgentMessage(payload);
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
key: "startClock",
|
|
139
|
+
value: function startClock(payload) {
|
|
140
|
+
try {
|
|
141
|
+
if (!payload || !payload.Id) {
|
|
142
|
+
throw new Error("Invalid payload");
|
|
143
|
+
}
|
|
144
|
+
this.startTracking(payload);
|
|
145
|
+
} catch (e) {
|
|
146
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
147
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageStartLapTrackError,
|
|
148
|
+
Description: "Error while starting the clock",
|
|
149
|
+
ExceptionDetails: e,
|
|
150
|
+
CustomProperties: {
|
|
151
|
+
payload: payload
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "stopClock",
|
|
158
|
+
value: function stopClock(payload) {
|
|
159
|
+
try {
|
|
160
|
+
if (!payload || !payload.Id) {
|
|
161
|
+
throw new Error("Invalid payload");
|
|
162
|
+
}
|
|
163
|
+
if (!this.isMessageFromValidSender(payload)) return;
|
|
164
|
+
if (this.isABotConversation && this.isStarted) {
|
|
165
|
+
this.stopTracking(payload);
|
|
166
|
+
}
|
|
167
|
+
} catch (e) {
|
|
168
|
+
console.error("FRL : error while trying to stop the tracker", e);
|
|
169
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
170
|
+
Event: _TelemetryConstants.TelemetryEvent.MessageStopLapTrackError,
|
|
171
|
+
Description: "Error while stopping the clock",
|
|
172
|
+
ExceptionDetails: e,
|
|
173
|
+
CustomProperties: {
|
|
174
|
+
payload: payload
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
//reset state
|
|
178
|
+
this.startTrackingMessage = undefined;
|
|
179
|
+
this.stopTrackingMessage = undefined;
|
|
180
|
+
this.isStarted = false;
|
|
181
|
+
this.isEnded = false;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
key: "deregister",
|
|
186
|
+
value: function deregister() {
|
|
187
|
+
// Reset State
|
|
188
|
+
this.isABotConversation = false;
|
|
189
|
+
this.isStarted = false;
|
|
190
|
+
this.isEnded = false;
|
|
191
|
+
this.startTrackingMessage = undefined;
|
|
192
|
+
this.stopTrackingMessage = undefined;
|
|
193
|
+
this.offlineNetworkListener.unsubscribe();
|
|
194
|
+
this.fmltrackingListener.unsubscribe();
|
|
195
|
+
this.rehydrateListener.unsubscribe();
|
|
196
|
+
this.historyListener.unsubscribe();
|
|
197
|
+
}
|
|
198
|
+
}]);
|
|
199
|
+
return FirstResponseLatencyTracker;
|
|
200
|
+
}();
|
|
201
|
+
exports.FirstResponseLatencyTracker = FirstResponseLatencyTracker;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.polyfillMessagePayloadForEvent = exports.isHistoryMessage = exports.getScenarioType = exports.createTrackingMessage = exports.buildMessagePayload = void 0;
|
|
7
|
+
var _Constants = require("./Constants");
|
|
8
|
+
var _Constants2 = require("../common/Constants");
|
|
9
|
+
const isHistoryMessage = (activity, startTime) => {
|
|
10
|
+
try {
|
|
11
|
+
if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants2.Constants.message) {
|
|
12
|
+
var _activity$channelData, _activity$channelData2;
|
|
13
|
+
// this is an old piece of code, probably no longer relevant
|
|
14
|
+
if (activity !== null && activity !== void 0 && (_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants2.Constants.historyMessageTag)) return true;
|
|
15
|
+
|
|
16
|
+
// Id is an epoch time in milliseconds , in utc format, for some reason is in a string format
|
|
17
|
+
if (activity !== null && activity !== void 0 && activity.id) {
|
|
18
|
+
/// activity.id is an string that contains epoch time in milliseconds
|
|
19
|
+
const activityId = parseInt(activity === null || activity === void 0 ? void 0 : activity.id);
|
|
20
|
+
|
|
21
|
+
// if the activity id is not a number, we default to new message
|
|
22
|
+
if (isNaN(activityId)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// if the activity id is less than the start time, it means that the message is a history message
|
|
27
|
+
if (activityId < startTime) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// anything else will be considered a new message
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
} catch (e) {
|
|
35
|
+
// if there is an error in parsing the activity id, we will consider it a new message
|
|
36
|
+
console.error("Error in parsing activity id: ", e);
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
exports.isHistoryMessage = isHistoryMessage;
|
|
41
|
+
const buildMessagePayload = (activity, userId) => {
|
|
42
|
+
var _text, _text2, _activity$channelData3, _activity$from;
|
|
43
|
+
return {
|
|
44
|
+
// To identify hidden contents vs empty content
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
text: (activity === null || activity === void 0 ? void 0 : (_text = activity.text) === null || _text === void 0 ? void 0 : _text.length) >= 1 ? `*contents hidden (${activity === null || activity === void 0 ? void 0 : (_text2 = activity.text) === null || _text2 === void 0 ? void 0 : _text2.length} chars)*` : "",
|
|
47
|
+
type: activity === null || activity === void 0 ? void 0 : activity.type,
|
|
48
|
+
timestamp: activity === null || activity === void 0 ? void 0 : activity.timestamp,
|
|
49
|
+
userId: userId,
|
|
50
|
+
tags: activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.tags,
|
|
51
|
+
messageType: "",
|
|
52
|
+
Id: activity === null || activity === void 0 ? void 0 : activity.id,
|
|
53
|
+
role: activity === null || activity === void 0 ? void 0 : (_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role,
|
|
54
|
+
isChatComplete: false
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.buildMessagePayload = buildMessagePayload;
|
|
58
|
+
const polyfillMessagePayloadForEvent = (activity, payload, conversationId) => {
|
|
59
|
+
var _activity$conversatio, _attachments, _activity$from2;
|
|
60
|
+
return {
|
|
61
|
+
...payload,
|
|
62
|
+
channelData: activity === null || activity === void 0 ? void 0 : activity.channelData,
|
|
63
|
+
chatId: activity === null || activity === void 0 ? void 0 : (_activity$conversatio = activity.conversation) === null || _activity$conversatio === void 0 ? void 0 : _activity$conversatio.id,
|
|
64
|
+
conversationId: conversationId,
|
|
65
|
+
Id: activity === null || activity === void 0 ? void 0 : activity.id,
|
|
66
|
+
isChatComplete: false,
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
text: activity === null || activity === void 0 ? void 0 : activity.text,
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
+
attachment: (activity === null || activity === void 0 ? void 0 : (_attachments = activity.attachments) === null || _attachments === void 0 ? void 0 : _attachments.length) >= 1 ? activity === null || activity === void 0 ? void 0 : activity.attachments : [],
|
|
71
|
+
role: activity === null || activity === void 0 ? void 0 : (_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
exports.polyfillMessagePayloadForEvent = polyfillMessagePayloadForEvent;
|
|
75
|
+
const getScenarioType = activity => {
|
|
76
|
+
var _activity$from3, _activity$channelData4, _activity$channelData5;
|
|
77
|
+
if ((activity === null || activity === void 0 ? void 0 : (_activity$from3 = activity.from) === null || _activity$from3 === void 0 ? void 0 : _activity$from3.role) === _Constants2.Constants.userMessageTag) {
|
|
78
|
+
return _Constants.ScenarioType.UserSendMessageStrategy;
|
|
79
|
+
}
|
|
80
|
+
if (activity !== null && activity !== void 0 && (_activity$channelData4 = activity.channelData) !== null && _activity$channelData4 !== void 0 && (_activity$channelData5 = _activity$channelData4.tags) !== null && _activity$channelData5 !== void 0 && _activity$channelData5.includes(_Constants2.Constants.systemMessageTag)) {
|
|
81
|
+
return _Constants.ScenarioType.SystemMessageStrategy;
|
|
82
|
+
}
|
|
83
|
+
return _Constants.ScenarioType.ReceivedMessageStrategy;
|
|
84
|
+
};
|
|
85
|
+
exports.getScenarioType = getScenarioType;
|
|
86
|
+
const createTrackingMessage = (payload, type) => {
|
|
87
|
+
return {
|
|
88
|
+
Id: payload.Id,
|
|
89
|
+
role: payload.role,
|
|
90
|
+
timestamp: payload === null || payload === void 0 ? void 0 : payload.timestamp,
|
|
91
|
+
tags: payload.tags,
|
|
92
|
+
messageType: payload.messageType,
|
|
93
|
+
text: payload.text,
|
|
94
|
+
type: type,
|
|
95
|
+
checkTime: new Date().getTime()
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
exports.createTrackingMessage = createTrackingMessage;
|
|
@@ -8,14 +8,18 @@ var _utils = require("../common/utils");
|
|
|
8
8
|
var _defaultLibraryScripts = _interopRequireDefault(require("../components/footerstateful/downloadtranscriptstateful/common/defaultLibraryScripts"));
|
|
9
9
|
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
13
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
15
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
16
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
-
|
|
17
|
+
let TranscriptHTMLBuilder = /*#__PURE__*/function () {
|
|
15
18
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
16
19
|
|
|
17
|
-
|
|
20
|
+
function TranscriptHTMLBuilder(options) {
|
|
18
21
|
var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
|
|
22
|
+
_classCallCheck(this, TranscriptHTMLBuilder);
|
|
19
23
|
_defineProperty(this, "options", void 0);
|
|
20
24
|
_defineProperty(this, "pageTitle", "Customer Transcript");
|
|
21
25
|
_defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
|
|
@@ -75,59 +79,79 @@ class TranscriptHTMLBuilder {
|
|
|
75
79
|
this.externalScripts = this.options.externalScripts;
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
_createClass(TranscriptHTMLBuilder, [{
|
|
83
|
+
key: "createMetaElement",
|
|
84
|
+
value: function createMetaElement() {
|
|
85
|
+
const htmlData = `
|
|
80
86
|
<meta charset="UTF-8">
|
|
81
87
|
`;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
88
|
+
return htmlData;
|
|
89
|
+
}
|
|
90
|
+
}, {
|
|
91
|
+
key: "createTitleElement",
|
|
92
|
+
value: function createTitleElement() {
|
|
93
|
+
const htmlData = `<title> ${this.pageTitle} </title>`;
|
|
94
|
+
return htmlData;
|
|
95
|
+
}
|
|
96
|
+
}, {
|
|
97
|
+
key: "createScriptElement",
|
|
98
|
+
value: function createScriptElement(src) {
|
|
99
|
+
let integrity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
100
|
+
let crossOrigin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
101
|
+
let referrerPolicy = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
102
|
+
return `<script src="${src}" ${integrity ? `integrity="${integrity}"` : ""} ${crossOrigin ? `crossorigin="${crossOrigin}"` : ""} ${referrerPolicy ? `referrerpolicy="${referrerPolicy}"` : ""}><\/script>`;
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "createWebChatScriptElement",
|
|
106
|
+
value: function createWebChatScriptElement() {
|
|
107
|
+
var _this$externalScripts, _this$externalScripts2, _this$externalScripts3, _this$externalScripts4, _this$externalScripts5, _this$externalScripts6, _this$externalScripts7, _this$externalScripts8, _this$externalScripts9, _this$externalScripts10;
|
|
108
|
+
return (_this$externalScripts = this.externalScripts) !== null && _this$externalScripts !== void 0 && (_this$externalScripts2 = _this$externalScripts.botframeworkWebChat) !== null && _this$externalScripts2 !== void 0 && _this$externalScripts2.src ? this.createScriptElement((_this$externalScripts3 = this.externalScripts) === null || _this$externalScripts3 === void 0 ? void 0 : (_this$externalScripts4 = _this$externalScripts3.botframeworkWebChat) === null || _this$externalScripts4 === void 0 ? void 0 : _this$externalScripts4.src, (_this$externalScripts5 = this.externalScripts) === null || _this$externalScripts5 === void 0 ? void 0 : (_this$externalScripts6 = _this$externalScripts5.botframeworkWebChat) === null || _this$externalScripts6 === void 0 ? void 0 : _this$externalScripts6.integrity, (_this$externalScripts7 = this.externalScripts) === null || _this$externalScripts7 === void 0 ? void 0 : (_this$externalScripts8 = _this$externalScripts7.botframeworkWebChat) === null || _this$externalScripts8 === void 0 ? void 0 : _this$externalScripts8.crossOrigin, (_this$externalScripts9 = this.externalScripts) === null || _this$externalScripts9 === void 0 ? void 0 : (_this$externalScripts10 = _this$externalScripts9.botframeworkWebChat) === null || _this$externalScripts10 === void 0 ? void 0 : _this$externalScripts10.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.botframeworkWebChat.src);
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "createRxJsScriptElement",
|
|
112
|
+
value: function createRxJsScriptElement() {
|
|
113
|
+
var _this$externalScripts11, _this$externalScripts12, _this$externalScripts13, _this$externalScripts14, _this$externalScripts15, _this$externalScripts16, _this$externalScripts17, _this$externalScripts18, _this$externalScripts19, _this$externalScripts20;
|
|
114
|
+
return (_this$externalScripts11 = this.externalScripts) !== null && _this$externalScripts11 !== void 0 && (_this$externalScripts12 = _this$externalScripts11.rxJs) !== null && _this$externalScripts12 !== void 0 && _this$externalScripts12.src ? this.createScriptElement((_this$externalScripts13 = this.externalScripts) === null || _this$externalScripts13 === void 0 ? void 0 : (_this$externalScripts14 = _this$externalScripts13.rxJs) === null || _this$externalScripts14 === void 0 ? void 0 : _this$externalScripts14.src, (_this$externalScripts15 = this.externalScripts) === null || _this$externalScripts15 === void 0 ? void 0 : (_this$externalScripts16 = _this$externalScripts15.rxJs) === null || _this$externalScripts16 === void 0 ? void 0 : _this$externalScripts16.integrity, (_this$externalScripts17 = this.externalScripts) === null || _this$externalScripts17 === void 0 ? void 0 : (_this$externalScripts18 = _this$externalScripts17.rxJs) === null || _this$externalScripts18 === void 0 ? void 0 : _this$externalScripts18.crossOrigin, (_this$externalScripts19 = this.externalScripts) === null || _this$externalScripts19 === void 0 ? void 0 : (_this$externalScripts20 = _this$externalScripts19.rxJs) === null || _this$externalScripts20 === void 0 ? void 0 : _this$externalScripts20.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.rxJs.src, _defaultLibraryScripts.default.rxJs.integrity, _defaultLibraryScripts.default.rxJs.crossOrigin, _defaultLibraryScripts.default.rxJs.referrerPolicy);
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "createReactScriptElement",
|
|
118
|
+
value: function createReactScriptElement() {
|
|
119
|
+
var _this$externalScripts21, _this$externalScripts22, _this$externalScripts23, _this$externalScripts24, _this$externalScripts25, _this$externalScripts26, _this$externalScripts27, _this$externalScripts28, _this$externalScripts29, _this$externalScripts30;
|
|
120
|
+
return (_this$externalScripts21 = this.externalScripts) !== null && _this$externalScripts21 !== void 0 && (_this$externalScripts22 = _this$externalScripts21.react) !== null && _this$externalScripts22 !== void 0 && _this$externalScripts22.src ? this.createScriptElement((_this$externalScripts23 = this.externalScripts) === null || _this$externalScripts23 === void 0 ? void 0 : (_this$externalScripts24 = _this$externalScripts23.react) === null || _this$externalScripts24 === void 0 ? void 0 : _this$externalScripts24.src, (_this$externalScripts25 = this.externalScripts) === null || _this$externalScripts25 === void 0 ? void 0 : (_this$externalScripts26 = _this$externalScripts25.react) === null || _this$externalScripts26 === void 0 ? void 0 : _this$externalScripts26.integrity, (_this$externalScripts27 = this.externalScripts) === null || _this$externalScripts27 === void 0 ? void 0 : (_this$externalScripts28 = _this$externalScripts27.react) === null || _this$externalScripts28 === void 0 ? void 0 : _this$externalScripts28.crossOrigin, (_this$externalScripts29 = this.externalScripts) === null || _this$externalScripts29 === void 0 ? void 0 : (_this$externalScripts30 = _this$externalScripts29.react) === null || _this$externalScripts30 === void 0 ? void 0 : _this$externalScripts30.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.react.src);
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
key: "createReactDomScriptElement",
|
|
124
|
+
value: function createReactDomScriptElement() {
|
|
125
|
+
var _this$externalScripts31, _this$externalScripts32, _this$externalScripts33, _this$externalScripts34, _this$externalScripts35, _this$externalScripts36, _this$externalScripts37, _this$externalScripts38, _this$externalScripts39, _this$externalScripts40, _this$externalScripts41, _this$externalScripts42;
|
|
126
|
+
return (_this$externalScripts31 = this.externalScripts) !== null && _this$externalScripts31 !== void 0 && (_this$externalScripts32 = _this$externalScripts31.reactDom) !== null && _this$externalScripts32 !== void 0 && _this$externalScripts32.src ? this.createScriptElement((_this$externalScripts33 = this.externalScripts) === null || _this$externalScripts33 === void 0 ? void 0 : (_this$externalScripts34 = _this$externalScripts33.reactDom) === null || _this$externalScripts34 === void 0 ? void 0 : _this$externalScripts34.src, (_this$externalScripts35 = this.externalScripts) === null || _this$externalScripts35 === void 0 ? void 0 : (_this$externalScripts36 = _this$externalScripts35.reactDom) === null || _this$externalScripts36 === void 0 ? void 0 : _this$externalScripts36.integrity, (_this$externalScripts37 = this.externalScripts) === null || _this$externalScripts37 === void 0 ? void 0 : (_this$externalScripts38 = _this$externalScripts37.reactDom) === null || _this$externalScripts38 === void 0 ? void 0 : _this$externalScripts38.crossOrigin, (_this$externalScripts39 = this.externalScripts) === null || _this$externalScripts39 === void 0 ? void 0 : (_this$externalScripts40 = _this$externalScripts39.reactDom) === null || _this$externalScripts40 === void 0 ? void 0 : _this$externalScripts40.referrerPolicy) : this.createScriptElement(((_this$externalScripts41 = this.externalScripts) === null || _this$externalScripts41 === void 0 ? void 0 : (_this$externalScripts42 = _this$externalScripts41.reactDom) === null || _this$externalScripts42 === void 0 ? void 0 : _this$externalScripts42.src) ?? _defaultLibraryScripts.default.reactDom.src);
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "createMarkdownItScriptElement",
|
|
130
|
+
value: function createMarkdownItScriptElement() {
|
|
131
|
+
var _this$externalScripts43, _this$externalScripts44, _this$externalScripts45, _this$externalScripts46, _this$externalScripts47, _this$externalScripts48, _this$externalScripts49, _this$externalScripts50, _this$externalScripts51, _this$externalScripts52;
|
|
132
|
+
return (_this$externalScripts43 = this.externalScripts) !== null && _this$externalScripts43 !== void 0 && (_this$externalScripts44 = _this$externalScripts43.markdownIt) !== null && _this$externalScripts44 !== void 0 && _this$externalScripts44.src ? this.createScriptElement((_this$externalScripts45 = this.externalScripts) === null || _this$externalScripts45 === void 0 ? void 0 : (_this$externalScripts46 = _this$externalScripts45.markdownIt) === null || _this$externalScripts46 === void 0 ? void 0 : _this$externalScripts46.src, (_this$externalScripts47 = this.externalScripts) === null || _this$externalScripts47 === void 0 ? void 0 : (_this$externalScripts48 = _this$externalScripts47.markdownIt) === null || _this$externalScripts48 === void 0 ? void 0 : _this$externalScripts48.integrity, (_this$externalScripts49 = this.externalScripts) === null || _this$externalScripts49 === void 0 ? void 0 : (_this$externalScripts50 = _this$externalScripts49.markdownIt) === null || _this$externalScripts50 === void 0 ? void 0 : _this$externalScripts50.crossOrigin, (_this$externalScripts51 = this.externalScripts) === null || _this$externalScripts51 === void 0 ? void 0 : (_this$externalScripts52 = _this$externalScripts51.markdownIt) === null || _this$externalScripts52 === void 0 ? void 0 : _this$externalScripts52.referrerPolicy) : this.createScriptElement(_defaultLibraryScripts.default.markdownIt.src, _defaultLibraryScripts.default.markdownIt.integrity, _defaultLibraryScripts.default.markdownIt.crossOrigin);
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "createExternalScriptElements",
|
|
136
|
+
value: function createExternalScriptElements() {
|
|
137
|
+
const webChatScript = this.createWebChatScriptElement();
|
|
138
|
+
const rxJsScript = this.createRxJsScriptElement();
|
|
139
|
+
const reactScript = this.createReactScriptElement();
|
|
140
|
+
const reactDomScript = this.createReactDomScriptElement();
|
|
141
|
+
const markdownItScript = this.createMarkdownItScriptElement();
|
|
142
|
+
const htmlData = `
|
|
121
143
|
${webChatScript}
|
|
122
144
|
${rxJsScript}
|
|
123
145
|
${reactScript}
|
|
124
146
|
${reactDomScript}
|
|
125
147
|
${markdownItScript}
|
|
126
148
|
`;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
149
|
+
return htmlData;
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "createHeadElement",
|
|
153
|
+
value: function createHeadElement() {
|
|
154
|
+
const htmlData = `
|
|
131
155
|
<head>
|
|
132
156
|
${this.createMetaElement()}
|
|
133
157
|
${this.createTitleElement()}
|
|
@@ -367,10 +391,12 @@ class TranscriptHTMLBuilder {
|
|
|
367
391
|
<\/style>
|
|
368
392
|
</head>
|
|
369
393
|
`;
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
394
|
+
return htmlData;
|
|
395
|
+
}
|
|
396
|
+
}, {
|
|
397
|
+
key: "createBodyElement",
|
|
398
|
+
value: function createBodyElement() {
|
|
399
|
+
const htmlData = `
|
|
374
400
|
<body>
|
|
375
401
|
<script>
|
|
376
402
|
if (!navigator.onLine) {
|
|
@@ -651,18 +677,22 @@ class TranscriptHTMLBuilder {
|
|
|
651
677
|
<\/script>
|
|
652
678
|
</body>
|
|
653
679
|
`;
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
680
|
+
return htmlData;
|
|
681
|
+
}
|
|
682
|
+
}, {
|
|
683
|
+
key: "createHTML",
|
|
684
|
+
value: function createHTML() {
|
|
685
|
+
const htmlData = `
|
|
658
686
|
<html>
|
|
659
687
|
${this.createHeadElement()}
|
|
660
688
|
${this.createBodyElement()}
|
|
661
689
|
</html>
|
|
662
690
|
`;
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
691
|
+
return htmlData;
|
|
692
|
+
}
|
|
693
|
+
}]);
|
|
694
|
+
return TranscriptHTMLBuilder;
|
|
695
|
+
}();
|
|
666
696
|
const createChatTranscript = async function (transcript, facadeChatSDK) {
|
|
667
697
|
let renderAttachments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
668
698
|
let transcriptOptions = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|