@microsoft/omnichannel-chat-widget 1.8.2-main.5199342 → 1.8.2-main.d82a79b
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/README.md +2 -0
- package/lib/cjs/common/Constants.js +11 -3
- package/lib/cjs/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/cjs/common/utils.js +7 -1
- package/lib/cjs/components/draggable/DraggableChatWidget.js +16 -1
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +22 -9
- package/lib/cjs/components/livechatwidget/common/endChat.js +18 -7
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +30 -1
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +18 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +31 -7
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +15 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +6 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +22 -11
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +18 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +4 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +12 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +45 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +3 -1
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +3 -1
- package/lib/cjs/contexts/createReducer.js +30 -0
- package/lib/cjs/controller/componentController.js +2 -2
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +101 -36
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +39 -21
- package/lib/cjs/firstresponselatency/util.js +60 -31
- package/lib/cjs/plugins/newMessageEventHandler.js +12 -6
- package/lib/esm/common/Constants.js +9 -2
- package/lib/esm/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/esm/common/utils.js +4 -0
- package/lib/esm/components/draggable/DraggableChatWidget.js +16 -1
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +22 -9
- package/lib/esm/components/livechatwidget/common/endChat.js +18 -7
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +30 -1
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +16 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +33 -9
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +16 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +6 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +22 -11
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +18 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +4 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +12 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +38 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +3 -1
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +3 -1
- package/lib/esm/contexts/createReducer.js +30 -0
- package/lib/esm/controller/componentController.js +2 -2
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +101 -36
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +39 -21
- package/lib/esm/firstresponselatency/util.js +57 -29
- package/lib/esm/plugins/newMessageEventHandler.js +12 -6
- package/lib/types/common/Constants.d.ts +8 -2
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -0
- package/lib/types/common/utils.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +5 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +2 -2
- package/lib/types/firstresponselatency/util.d.ts +17 -0
- package/lib/types/plugins/newMessageEventHandler.d.ts +1 -1
- package/package.json +4 -4
|
@@ -56,7 +56,7 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
const WebChatContainerStateful = props => {
|
|
59
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2,
|
|
59
|
+
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$webChatContain9, _props$webChatContain10;
|
|
60
60
|
(0, _react2.useEffect)(() => {
|
|
61
61
|
uiTimer = (0, _utils.createTimer)();
|
|
62
62
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -185,20 +185,24 @@ const WebChatContainerStateful = props => {
|
|
|
185
185
|
background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background};
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock {
|
|
189
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color} !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
188
192
|
.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
|
|
189
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
193
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp3 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp3 === void 0 ? void 0 : (_webChatContainerProp4 = _webChatContainerProp3.userMessageBoxStyles) === null || _webChatContainerProp4 === void 0 ? void 0 : _webChatContainerProp4.maxWidth) ?? (_defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === null || _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles === void 0 ? void 0 : _defaultUserMessageBoxStyles.defaultUserMessageBoxStyles.maxWidth)}
|
|
190
194
|
}
|
|
191
195
|
|
|
192
196
|
.webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
|
|
193
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
197
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp5 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp5 === void 0 ? void 0 : (_webChatContainerProp6 = _webChatContainerProp5.systemMessageBoxStyles) === null || _webChatContainerProp6 === void 0 ? void 0 : _webChatContainerProp6.maxWidth) ?? (_defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === null || _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles === void 0 ? void 0 : _defaultSystemMessageBoxStyles.defaultSystemMessageBoxStyles.maxWidth)}
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
div[class="ac-textBlock"] *,
|
|
197
|
-
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
201
|
+
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp7 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.textWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
198
202
|
|
|
199
203
|
div[class="ac-input-container"] input.ac-multichoiceInput,
|
|
200
204
|
div[class="ac-input-container"] select.ac-multichoiceInput {
|
|
201
|
-
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (
|
|
205
|
+
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp8 !== void 0 && _webChatContainerProp8.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
202
206
|
}
|
|
203
207
|
|
|
204
208
|
.ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
|
|
@@ -210,15 +214,15 @@ const WebChatContainerStateful = props => {
|
|
|
210
214
|
div[class="ac-textBlock"] a:visited,
|
|
211
215
|
div[class="ac-textBlock"] a:hover,
|
|
212
216
|
div[class="ac-textBlock"] a:active {
|
|
213
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
217
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp9 === void 0 ? void 0 : _webChatContainerProp9.anchorColor) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.anchorColor};
|
|
214
218
|
}
|
|
215
219
|
|
|
216
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
220
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.buttonWhiteSpace) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
217
221
|
|
|
218
222
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
219
223
|
/* Fallback for browsers that don't support mask */
|
|
220
224
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
221
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
225
|
+
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp11 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp11 === void 0 ? void 0 : (_webChatContainerProp12 = _webChatContainerProp11.receivedMessageAnchorStyles) === null || _webChatContainerProp12 === void 0 ? void 0 : _webChatContainerProp12.filter) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.filter)};
|
|
222
226
|
height: .75em;
|
|
223
227
|
width: .75em;
|
|
224
228
|
margin-left: .25em;
|
|
@@ -228,7 +232,7 @@ const WebChatContainerStateful = props => {
|
|
|
228
232
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
229
233
|
/* Fallback for browsers that don't support mask */
|
|
230
234
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
231
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
235
|
+
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp13 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp13 === void 0 ? void 0 : (_webChatContainerProp14 = _webChatContainerProp13.sentMessageAnchorStyles) === null || _webChatContainerProp14 === void 0 ? void 0 : _webChatContainerProp14.filter) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.filter)};
|
|
232
236
|
height: .75em;
|
|
233
237
|
width: .75em;
|
|
234
238
|
margin-left: .25em;
|
|
@@ -238,7 +242,7 @@ const WebChatContainerStateful = props => {
|
|
|
238
242
|
/* Modern browsers with mask support */
|
|
239
243
|
@supports (mask: url()) or (-webkit-mask: url()) {
|
|
240
244
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
241
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
245
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp15 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp15 === void 0 ? void 0 : (_webChatContainerProp16 = _webChatContainerProp15.receivedMessageAnchorStyles) === null || _webChatContainerProp16 === void 0 ? void 0 : _webChatContainerProp16.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)} !important;
|
|
242
246
|
background-image: none !important;
|
|
243
247
|
filter: none !important;
|
|
244
248
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -248,7 +252,7 @@ const WebChatContainerStateful = props => {
|
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
251
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
255
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp17 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp17 === void 0 ? void 0 : (_webChatContainerProp18 = _webChatContainerProp17.sentMessageAnchorStyles) === null || _webChatContainerProp18 === void 0 ? void 0 : _webChatContainerProp18.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)} !important;
|
|
252
256
|
background-image: none !important;
|
|
253
257
|
filter: none !important;
|
|
254
258
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -266,18 +270,18 @@ const WebChatContainerStateful = props => {
|
|
|
266
270
|
.ms_lcw_webchat_received_message a:visited,
|
|
267
271
|
.ms_lcw_webchat_received_message a:hover,
|
|
268
272
|
.ms_lcw_webchat_received_message a:active {
|
|
269
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
273
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp19 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp19 === void 0 ? void 0 : (_webChatContainerProp20 = _webChatContainerProp19.receivedMessageAnchorStyles) === null || _webChatContainerProp20 === void 0 ? void 0 : _webChatContainerProp20.color) ?? (_defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === null || _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles === void 0 ? void 0 : _defaultReceivedMessageAnchorStyles.defaultReceivedMessageAnchorStyles.color)};
|
|
270
274
|
}
|
|
271
275
|
.ms_lcw_webchat_sent_message a:link,
|
|
272
276
|
.ms_lcw_webchat_sent_message a:visited,
|
|
273
277
|
.ms_lcw_webchat_sent_message a:hover,
|
|
274
278
|
.ms_lcw_webchat_sent_message a:active {
|
|
275
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
279
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp21 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp21 === void 0 ? void 0 : (_webChatContainerProp22 = _webChatContainerProp21.sentMessageAnchorStyles) === null || _webChatContainerProp22 === void 0 ? void 0 : _webChatContainerProp22.color) ?? (_defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === null || _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles === void 0 ? void 0 : _defaultSentMessageAnchorStyles.defaultSentMessageAnchorStyles.color)};
|
|
276
280
|
}
|
|
277
281
|
|
|
278
282
|
// we had a nasty bug long time ago with crashing borders messing with the sendbox, so if customer adds this value, they need to deal with that
|
|
279
283
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
280
|
-
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
284
|
+
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp23 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp23 === void 0 ? void 0 : _webChatContainerProp23.bubbleBorderRadius) ?? 0} !important; /* Override border-radius */
|
|
281
285
|
}
|
|
282
286
|
|
|
283
287
|
.webchat__stacked-layout_container>div {
|
|
@@ -14,13 +14,13 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
14
14
|
******/
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
17
|
-
const channelDataMiddleware = _ref => {
|
|
17
|
+
const channelDataMiddleware = addConversationalSurveyTagsCallback => _ref => {
|
|
18
18
|
let {
|
|
19
19
|
dispatch
|
|
20
20
|
} = _ref;
|
|
21
21
|
return next => action => {
|
|
22
|
-
var _action$payload,
|
|
23
|
-
if ((action === null ||
|
|
22
|
+
var _action, _action2, _action2$payload, _action2$payload$acti;
|
|
23
|
+
if (((_action = action) === null || _action === void 0 ? void 0 : _action.type) === _WebChatActionType.WebChatActionType.DIRECT_LINE_POST_ACTIVITY_PENDING && (_action2 = action) !== null && _action2 !== void 0 && (_action2$payload = _action2.payload) !== null && _action2$payload !== void 0 && (_action2$payload$acti = _action2$payload.activity) !== null && _action2$payload$acti !== void 0 && _action2$payload$acti.channelData) {
|
|
24
24
|
const channelIdTag = `${_Constants.Constants.channelIdKey}${_Constants.Constants.ChannelId}`;
|
|
25
25
|
const customerMessageTag = `${_Constants.Constants.CustomerTag}`;
|
|
26
26
|
if (action.payload.activity.channelData.tags) {
|
|
@@ -34,6 +34,7 @@ const channelDataMiddleware = _ref => {
|
|
|
34
34
|
action.payload.activity.channelData.tags = [channelIdTag];
|
|
35
35
|
action.payload.activity.channelData.tags.push(customerMessageTag);
|
|
36
36
|
}
|
|
37
|
+
action = addConversationalSurveyTagsCallback(action);
|
|
37
38
|
action.payload.activity.channelData.metadata = {
|
|
38
39
|
deliveryMode: _omnichannelChatSdk.DeliveryMode.Bridged
|
|
39
40
|
};
|
|
@@ -16,27 +16,33 @@ var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
|
16
16
|
******/
|
|
17
17
|
|
|
18
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
19
|
-
const createConversationEndMiddleware = conversationEndCallback => _ref => {
|
|
19
|
+
const createConversationEndMiddleware = (conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback) => _ref => {
|
|
20
20
|
let {
|
|
21
21
|
dispatch
|
|
22
22
|
} = _ref;
|
|
23
23
|
return next => action => {
|
|
24
24
|
var _action$payload;
|
|
25
25
|
if ((action === null || action === void 0 ? void 0 : action.type) == _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
26
|
-
var _activity$from2, _activity$
|
|
26
|
+
var _activity$from2, _activity$channelData17, _activity$channelData18;
|
|
27
27
|
const activity = action.payload.activity;
|
|
28
28
|
if (activity.channelId === "ACS_CHANNEL") {
|
|
29
29
|
var _activity$from;
|
|
30
30
|
if (((_activity$from = activity.from) === null || _activity$from === void 0 ? void 0 : _activity$from.role) === _DirectLineSenderRole.DirectLineSenderRole.Bot) {
|
|
31
|
-
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6;
|
|
31
|
+
var _activity$channelData, _activity$channelData2, _activity$channelData3, _activity$channelData4, _activity$channelData5, _activity$channelData6, _activity$channelData7, _activity$channelData8, _activity$channelData9, _activity$channelData10, _activity$channelData11, _activity$channelData12, _activity$channelData13, _activity$channelData14, _activity$channelData15, _activity$channelData16;
|
|
32
32
|
if ((_activity$channelData = activity.channelData) !== null && _activity$channelData !== void 0 && (_activity$channelData2 = _activity$channelData.tags) !== null && _activity$channelData2 !== void 0 && _activity$channelData2.includes(_Constants.Constants.systemMessageTag) && ((_activity$channelData3 = activity.channelData) !== null && _activity$channelData3 !== void 0 && (_activity$channelData4 = _activity$channelData3.tags) !== null && _activity$channelData4 !== void 0 && _activity$channelData4.includes(_Constants.Constants.agentEndConversationMessageTag) || (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(_Constants.Constants.supervisorForceCloseMessageTag))) {
|
|
33
33
|
conversationEndCallback();
|
|
34
34
|
}
|
|
35
|
+
if ((_activity$channelData7 = activity.channelData) !== null && _activity$channelData7 !== void 0 && (_activity$channelData8 = _activity$channelData7.tags) !== null && _activity$channelData8 !== void 0 && _activity$channelData8.includes(_Constants.Constants.systemMessageTag) && ((_activity$channelData9 = activity.channelData) !== null && _activity$channelData9 !== void 0 && (_activity$channelData10 = _activity$channelData9.tags) !== null && _activity$channelData10 !== void 0 && _activity$channelData10.includes(_Constants.Constants.startConversationalSurveyMessageTag) || (_activity$channelData11 = activity.channelData) !== null && _activity$channelData11 !== void 0 && (_activity$channelData12 = _activity$channelData11.tags) !== null && _activity$channelData12 !== void 0 && _activity$channelData12.includes(_Constants.Constants.startConversationalSurveyMessageTag))) {
|
|
36
|
+
startConversationalSurveyCallback();
|
|
37
|
+
}
|
|
38
|
+
if ((_activity$channelData13 = activity.channelData) !== null && _activity$channelData13 !== void 0 && (_activity$channelData14 = _activity$channelData13.tags) !== null && _activity$channelData14 !== void 0 && _activity$channelData14.includes(_Constants.Constants.systemMessageTag) && (_activity$channelData15 = activity.channelData) !== null && _activity$channelData15 !== void 0 && (_activity$channelData16 = _activity$channelData15.tags) !== null && _activity$channelData16 !== void 0 && _activity$channelData16.includes(_Constants.Constants.endConversationalSurveyMessageTag)) {
|
|
39
|
+
endConversationalSurveyCallback();
|
|
40
|
+
}
|
|
35
41
|
}
|
|
36
|
-
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$
|
|
37
|
-
var _activity$
|
|
42
|
+
} else if (((_activity$from2 = activity.from) === null || _activity$from2 === void 0 ? void 0 : _activity$from2.role) === _DirectLineSenderRole.DirectLineSenderRole.Channel && ((_activity$channelData17 = activity.channelData) === null || _activity$channelData17 === void 0 ? void 0 : _activity$channelData17.type) === _MessageType.MessageTypes.Thread && (_activity$channelData18 = activity.channelData) !== null && _activity$channelData18 !== void 0 && _activity$channelData18.properties) {
|
|
43
|
+
var _activity$channelData19, _activity$channelData20, _activity$channelData21, _activity$channelData22;
|
|
38
44
|
// IC3
|
|
39
|
-
if (((_activity$
|
|
45
|
+
if (((_activity$channelData19 = activity.channelData) === null || _activity$channelData19 === void 0 ? void 0 : (_activity$channelData20 = _activity$channelData19.properties) === null || _activity$channelData20 === void 0 ? void 0 : _activity$channelData20.isdeleted) === _Constants.Constants.truePascal || !((_activity$channelData21 = activity.channelData) !== null && _activity$channelData21 !== void 0 && (_activity$channelData22 = _activity$channelData21.properties) !== null && _activity$channelData22 !== void 0 && _activity$channelData22.containsExternalEntitiesListeningAll)) {
|
|
40
46
|
conversationEndCallback();
|
|
41
47
|
}
|
|
42
48
|
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createQueueOverflowMiddleware = void 0;
|
|
7
|
+
var _WebChatActionType = require("../../enums/WebChatActionType");
|
|
8
|
+
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
9
|
+
var _TelemetryHelper = require("../../../../../common/telemetry/TelemetryHelper");
|
|
10
|
+
var _LiveChatWidgetActionType = require("../../../../../contexts/common/LiveChatWidgetActionType");
|
|
11
|
+
var _createReducer = require("../../../../../contexts/createReducer");
|
|
12
|
+
var _utils = require("../../../../../common/utils");
|
|
13
|
+
const queueOverflowHandlingHelper = async (state, dispatch) => {
|
|
14
|
+
const {
|
|
15
|
+
appStates
|
|
16
|
+
} = (0, _createReducer.executeReducer)(state, {
|
|
17
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
18
|
+
payload: undefined
|
|
19
|
+
});
|
|
20
|
+
if (!appStates.chatDisconnectEventReceived) {
|
|
21
|
+
dispatch({
|
|
22
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
23
|
+
payload: true
|
|
24
|
+
});
|
|
25
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
26
|
+
Event: _TelemetryConstants.TelemetryEvent.QueueOverflowEvent,
|
|
27
|
+
Description: "Set chat disconnect event received."
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const createQueueOverflowMiddleware = (state, dispatch) => () => next => action => {
|
|
32
|
+
var _action$payload;
|
|
33
|
+
if ((action === null || action === void 0 ? void 0 : action.type) == _WebChatActionType.WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
34
|
+
const activity = action.payload.activity;
|
|
35
|
+
if ((0, _utils.isEndConversationDueToOverflowActivity)(activity)) {
|
|
36
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
37
|
+
Event: _TelemetryConstants.TelemetryEvent.QueueOverflowEvent,
|
|
38
|
+
Description: "Queue overflow event received."
|
|
39
|
+
});
|
|
40
|
+
queueOverflowHandlingHelper(state, dispatch);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return next(action);
|
|
44
|
+
};
|
|
45
|
+
exports.createQueueOverflowMiddleware = createQueueOverflowMiddleware;
|
|
@@ -52,5 +52,7 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
52
52
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 42] = "SET_SURVEY_MODE";
|
|
53
53
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 43] = "SET_CONFIRMATION_STATE";
|
|
54
54
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 44] = "SET_POST_CHAT_PARTICIPANT_TYPE";
|
|
55
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
55
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 45] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
|
|
56
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 46] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
|
|
57
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 47] = "GET_IN_MEMORY_STATE";
|
|
56
58
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -83,7 +83,9 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
83
83
|
conversationEndedBy: _Constants.ConversationEndEntity.NotSet,
|
|
84
84
|
chatDisconnectEventReceived: false,
|
|
85
85
|
selectedSurveyMode: null,
|
|
86
|
-
postChatParticipantType: undefined
|
|
86
|
+
postChatParticipantType: undefined,
|
|
87
|
+
isConversationalSurvey: false,
|
|
88
|
+
isConversationalSurveyEnabled: false
|
|
87
89
|
},
|
|
88
90
|
uiStates: {
|
|
89
91
|
showConfirmationPane: false,
|
|
@@ -656,6 +656,36 @@ const reducer = (state, action) => {
|
|
|
656
656
|
postChatParticipantType: action.payload
|
|
657
657
|
}
|
|
658
658
|
};
|
|
659
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATIONAL_SURVEY_ENABLED:
|
|
660
|
+
inMemory = {
|
|
661
|
+
...inMemory,
|
|
662
|
+
appStates: {
|
|
663
|
+
...inMemory.appStates,
|
|
664
|
+
isConversationalSurveyEnabled: action.payload
|
|
665
|
+
}
|
|
666
|
+
};
|
|
667
|
+
return {
|
|
668
|
+
...state,
|
|
669
|
+
appStates: {
|
|
670
|
+
...state.appStates,
|
|
671
|
+
isConversationalSurveyEnabled: action.payload
|
|
672
|
+
}
|
|
673
|
+
};
|
|
674
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATIONAL_SURVEY_DISPLAY:
|
|
675
|
+
inMemory = {
|
|
676
|
+
...inMemory,
|
|
677
|
+
appStates: {
|
|
678
|
+
...inMemory.appStates,
|
|
679
|
+
isConversationalSurvey: action.payload
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
return {
|
|
683
|
+
...state,
|
|
684
|
+
appStates: {
|
|
685
|
+
...state.appStates,
|
|
686
|
+
isConversationalSurvey: action.payload
|
|
687
|
+
}
|
|
688
|
+
};
|
|
659
689
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE:
|
|
660
690
|
return inMemory;
|
|
661
691
|
default:
|
|
@@ -27,7 +27,7 @@ const shouldShowEmailTranscriptPane = state => {
|
|
|
27
27
|
};
|
|
28
28
|
exports.shouldShowEmailTranscriptPane = shouldShowEmailTranscriptPane;
|
|
29
29
|
const shouldShowWebChatContainer = state => {
|
|
30
|
-
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive;
|
|
30
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Active || state.appStates.conversationState === _ConversationState.ConversationState.InActive || state.appStates.conversationState === _ConversationState.ConversationState.Postchat && state.appStates.isConversationalSurveyEnabled && state.appStates.isConversationalSurvey;
|
|
31
31
|
};
|
|
32
32
|
exports.shouldShowWebChatContainer = shouldShowWebChatContainer;
|
|
33
33
|
const shouldShowLoadingPane = state => {
|
|
@@ -60,7 +60,7 @@ const shouldShowConfirmationPane = state => {
|
|
|
60
60
|
};
|
|
61
61
|
exports.shouldShowConfirmationPane = shouldShowConfirmationPane;
|
|
62
62
|
const shouldShowPostChatSurveyPane = state => {
|
|
63
|
-
return state.appStates.conversationState === _ConversationState.ConversationState.Postchat;
|
|
63
|
+
return state.appStates.conversationState === _ConversationState.ConversationState.Postchat && !state.appStates.isConversationalSurvey;
|
|
64
64
|
};
|
|
65
65
|
exports.shouldShowPostChatSurveyPane = shouldShowPostChatSurveyPane;
|
|
66
66
|
const shouldShowCallingContainer = state => {
|
|
@@ -12,54 +12,96 @@ var _util = require("./util");
|
|
|
12
12
|
// with different timeline, therefore this is a functional approach to track the events, instead of a class based approach
|
|
13
13
|
const createTrackingForFirstMessage = () => {
|
|
14
14
|
// Reset the tracking variables
|
|
15
|
-
let
|
|
16
|
-
let stopTracking = false;
|
|
15
|
+
let isTracking = false;
|
|
17
16
|
let startTime = 0;
|
|
18
17
|
let stopTime = 0;
|
|
19
|
-
let stopTrackingMessage;
|
|
18
|
+
let stopTrackingMessage = null;
|
|
20
19
|
let flag = false;
|
|
20
|
+
let trackingTimeoutId;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the message payload is from a valid sender (not an agent).
|
|
24
|
+
* Returns false if the message is from an agent (tag 'public'), true otherwise.
|
|
25
|
+
*/
|
|
21
26
|
const isMessageFromValidSender = payload => {
|
|
22
27
|
var _payload$tags;
|
|
23
|
-
// agent scenario
|
|
24
28
|
if (payload !== null && payload !== void 0 && (_payload$tags = payload.tags) !== null && _payload$tags !== void 0 && _payload$tags.includes("public")) {
|
|
25
29
|
return false;
|
|
26
30
|
}
|
|
27
31
|
return true;
|
|
28
32
|
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Listener for widget load completion event.
|
|
36
|
+
* Starts tracking the time for the first bot message after widget loads.
|
|
37
|
+
* Sets a 5-second timeout to auto-reset if no bot message is received.
|
|
38
|
+
*/
|
|
29
39
|
const widgetLoadListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.WidgetLoadComplete).subscribe(() => {
|
|
30
|
-
if (
|
|
31
|
-
|
|
40
|
+
if (isTracking) return;
|
|
41
|
+
isTracking = true;
|
|
32
42
|
startTime = new Date().getTime();
|
|
43
|
+
// Start a 5-second timeout to auto-stop tracking if not stopped
|
|
44
|
+
if (trackingTimeoutId) {
|
|
45
|
+
clearTimeout(trackingTimeoutId);
|
|
46
|
+
}
|
|
47
|
+
trackingTimeoutId = setTimeout(() => {
|
|
48
|
+
if (isTracking) {
|
|
49
|
+
// Reset state and disengage, no telemetry or FMLTrackingCompleted
|
|
50
|
+
isTracking = false;
|
|
51
|
+
startTime = 0;
|
|
52
|
+
stopTime = 0;
|
|
53
|
+
stopTrackingMessage = null;
|
|
54
|
+
trackingTimeoutId = undefined;
|
|
55
|
+
disconnectListener();
|
|
56
|
+
}
|
|
57
|
+
}, 10000); //adding more time since it meassures from widget load complete till message received
|
|
33
58
|
});
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Listener for new bot message event.
|
|
62
|
+
* If a valid bot message is received, stops tracking and logs telemetry.
|
|
63
|
+
* If the message is invalid, resets and disengages listeners.
|
|
64
|
+
*/
|
|
34
65
|
const newMessageListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.NewMessageReceived).subscribe(message => {
|
|
35
66
|
const payload = message.payload;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
stopTime = new Date().getTime();
|
|
43
|
-
const elapsedTime = stopTime - startTime;
|
|
44
|
-
stopTracking = true;
|
|
45
|
-
stopTrackingMessage = (0, _util.createTrackingMessage)(payload, "botMessage");
|
|
46
|
-
notifyFMLTrackingCompleted();
|
|
47
|
-
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
48
|
-
Event: _TelemetryConstants.TelemetryEvent.BotFirstMessageLapTrack,
|
|
49
|
-
Description: "First Message from Bot latency tracking",
|
|
50
|
-
CustomProperties: {
|
|
51
|
-
elapsedTime,
|
|
52
|
-
widgetLoadedAt: startTime,
|
|
53
|
-
botMessage: stopTrackingMessage
|
|
54
|
-
}
|
|
55
|
-
});
|
|
67
|
+
if (!isMessageFromValidSender(payload)) {
|
|
68
|
+
// If not valid, stop everything and clean up
|
|
69
|
+
isTracking = false;
|
|
70
|
+
if (trackingTimeoutId) {
|
|
71
|
+
clearTimeout(trackingTimeoutId);
|
|
72
|
+
trackingTimeoutId = undefined;
|
|
56
73
|
}
|
|
74
|
+
disconnectListener();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (isTracking) {
|
|
78
|
+
isTracking = false;
|
|
79
|
+
// Clear the timeout if it exists
|
|
80
|
+
if (trackingTimeoutId) {
|
|
81
|
+
clearTimeout(trackingTimeoutId);
|
|
82
|
+
trackingTimeoutId = undefined;
|
|
83
|
+
}
|
|
84
|
+
stopTime = new Date().getTime();
|
|
85
|
+
const elapsedTime = stopTime - startTime;
|
|
86
|
+
stopTrackingMessage = (0, _util.createTrackingMessage)(payload, "botMessage");
|
|
87
|
+
notifyFMLTrackingCompleted();
|
|
88
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
89
|
+
Event: _TelemetryConstants.TelemetryEvent.BotFirstMessageLapTrack,
|
|
90
|
+
Description: "First Message from Bot latency tracking",
|
|
91
|
+
CustomProperties: {
|
|
92
|
+
elapsedTime,
|
|
93
|
+
widgetLoadedAt: startTime,
|
|
94
|
+
botMessage: stopTrackingMessage
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
disconnectListener();
|
|
57
98
|
}
|
|
58
|
-
|
|
59
|
-
// this track only first message, if coming from the bot or not
|
|
60
|
-
// the only difference is that it logs only those from bot
|
|
61
|
-
disconnectListener();
|
|
62
99
|
});
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Notifies that FML (First Message Latency) tracking is completed.
|
|
103
|
+
* Retries sending the completion event until acknowledged.
|
|
104
|
+
*/
|
|
63
105
|
const notifyFMLTrackingCompleted = () => {
|
|
64
106
|
ackListener();
|
|
65
107
|
// Retry sending until flag is true, but do not block the main thread
|
|
@@ -74,6 +116,11 @@ const createTrackingForFirstMessage = () => {
|
|
|
74
116
|
}
|
|
75
117
|
}, 100);
|
|
76
118
|
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Listener for FMLTrackingCompletedAck event.
|
|
122
|
+
* Sets the flag to true when acknowledgment is received.
|
|
123
|
+
*/
|
|
77
124
|
const ackListener = () => {
|
|
78
125
|
const listen = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.FMLTrackingCompletedAck).subscribe(() => {
|
|
79
126
|
flag = true;
|
|
@@ -83,22 +130,32 @@ const createTrackingForFirstMessage = () => {
|
|
|
83
130
|
|
|
84
131
|
// 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
|
|
85
132
|
// No need to keep listerning for tracking, enforcing disconnection for the listners
|
|
133
|
+
/**
|
|
134
|
+
* Listener for widget rehydration event.
|
|
135
|
+
* Resets tracking and disconnects listeners when widget is reloaded.
|
|
136
|
+
*/
|
|
86
137
|
const rehydrateListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.RehydrateMessageReceived).subscribe(() => {
|
|
87
|
-
|
|
88
|
-
stopTracking = false;
|
|
138
|
+
isTracking = false;
|
|
89
139
|
disconnectListener();
|
|
90
140
|
});
|
|
91
141
|
|
|
92
142
|
// 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
|
|
93
143
|
// No need to keep listerning for tracking, enforcing disconnection for the listners
|
|
144
|
+
/**
|
|
145
|
+
* Listener for history message event.
|
|
146
|
+
* Resets tracking and disconnects listeners when history is loaded.
|
|
147
|
+
*/
|
|
94
148
|
const historyListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.HistoryMessageReceived).subscribe(() => {
|
|
95
|
-
|
|
96
|
-
stopTracking = false;
|
|
149
|
+
isTracking = false;
|
|
97
150
|
disconnectListener();
|
|
98
151
|
});
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Listener for network disconnection event.
|
|
155
|
+
* Resets tracking, disconnects listeners, and logs a telemetry error.
|
|
156
|
+
*/
|
|
99
157
|
const offlineNetworkListener = _omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.TelemetryEvent.NetworkDisconnected).subscribe(() => {
|
|
100
|
-
|
|
101
|
-
stopTracking = false;
|
|
158
|
+
isTracking = false;
|
|
102
159
|
disconnectListener();
|
|
103
160
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
104
161
|
Event: _TelemetryConstants.TelemetryEvent.BotFirstMessageLapTrackError,
|
|
@@ -107,7 +164,15 @@ const createTrackingForFirstMessage = () => {
|
|
|
107
164
|
});
|
|
108
165
|
|
|
109
166
|
// this is to ensure that we are not tracking messages that are not part of the current conversation
|
|
167
|
+
/**
|
|
168
|
+
* Disconnects all listeners and clears the tracking timeout.
|
|
169
|
+
* Used for cleanup when tracking is stopped or reset.
|
|
170
|
+
*/
|
|
110
171
|
const disconnectListener = () => {
|
|
172
|
+
if (trackingTimeoutId) {
|
|
173
|
+
clearTimeout(trackingTimeoutId);
|
|
174
|
+
trackingTimeoutId = undefined;
|
|
175
|
+
}
|
|
111
176
|
historyListener.unsubscribe();
|
|
112
177
|
rehydrateListener.unsubscribe();
|
|
113
178
|
newMessageListener.unsubscribe();
|