@microsoft/omnichannel-chat-widget 1.8.1-main.4fb8cb5 → 1.8.1-main.565f247
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/telemetry/TelemetryConstants.js +0 -4
- package/lib/cjs/common/telemetry/TelemetryManager.js +2 -2
- package/lib/cjs/common/utils.js +0 -3
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +3 -7
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +2 -12
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -4
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +1 -30
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +19 -31
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +2 -23
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +5 -14
- package/lib/cjs/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +0 -1
- package/lib/esm/common/telemetry/TelemetryConstants.js +0 -4
- package/lib/esm/common/telemetry/TelemetryManager.js +2 -2
- package/lib/esm/common/utils.js +0 -3
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +3 -7
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +3 -13
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +0 -4
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +0 -28
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +19 -31
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +2 -23
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +5 -14
- package/lib/esm/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.js +0 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +0 -4
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +0 -1
- package/lib/types/components/postchatsurveypanestateful/enums/CustomerVoiceEvents.d.ts +1 -2
- package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +0 -1
- package/package.json +2 -2
- package/lib/cjs/common/utils/xssUtils.js +0 -79
- package/lib/cjs/components/errorboundary/ErrorBoundary.js +0 -68
- package/lib/esm/common/utils/xssUtils.js +0 -72
- package/lib/esm/components/errorboundary/ErrorBoundary.js +0 -59
- package/lib/types/common/utils/xssUtils.d.ts +0 -29
- package/lib/types/components/errorboundary/ErrorBoundary.d.ts +0 -14
|
@@ -112,8 +112,6 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
112
112
|
TelemetryEvent["DisconnectEndChatSDKCallFailed"] = "DisconnectEndChatSDKCallFailed";
|
|
113
113
|
TelemetryEvent["GetChatReconnectContextSDKCallStarted"] = "GetChatReconnectContextSDKCallStarted";
|
|
114
114
|
TelemetryEvent["GetChatReconnectContextSDKCallFailed"] = "GetChatReconnectContextSDKCallFailed";
|
|
115
|
-
TelemetryEvent["CheckContactIdError"] = "checkContactIdError";
|
|
116
|
-
TelemetryEvent["GetChatReconnectContextSDKCallSucceeded"] = "GetChatReconnectContextSDKCallSucceeded";
|
|
117
115
|
TelemetryEvent["ParseAdaptiveCardFailed"] = "ParseAdaptiveCardFailed";
|
|
118
116
|
TelemetryEvent["ClientDataStoreProviderFailed"] = "ClientDataStoreProviderFailed";
|
|
119
117
|
TelemetryEvent["InMemoryDataStoreFailed"] = "InMemoryDataStoreFailed";
|
|
@@ -181,7 +179,6 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
181
179
|
TelemetryEvent["CustomerVoiceResponsePageLoaded"] = "CustomerVoiceResponsePageLoaded";
|
|
182
180
|
TelemetryEvent["CustomerVoiceFormResponseSubmitted"] = "CustomerVoiceFormResponseSubmitted";
|
|
183
181
|
TelemetryEvent["CustomerVoiceFormResponseError"] = "CustomerVoiceFormResponseError";
|
|
184
|
-
TelemetryEvent["CustomerVoiceFormsError"] = "CustomerVoiceFormsError";
|
|
185
182
|
TelemetryEvent["BotAuthActivityEmptySasUrl"] = "BotAuthActivityEmptySasUrl";
|
|
186
183
|
TelemetryEvent["SetBotAuthProviderFetchConfig"] = "SetBotAuthProviderFetchConfig";
|
|
187
184
|
TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
|
|
@@ -259,7 +256,6 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
259
256
|
TelemetryEvent["UXNotificationPaneCompleted"] = "UXNotificationPaneCompleted";
|
|
260
257
|
TelemetryEvent["UXOutOfOfficeHoursPaneStart"] = "UXOutOfOfficeHoursPaneStart";
|
|
261
258
|
TelemetryEvent["UXOutOfOfficeHoursPaneCompleted"] = "UXOutOfOfficeHoursPaneCompleted";
|
|
262
|
-
TelemetryEvent["XSSTextDetected"] = "XSSTextDetected";
|
|
263
259
|
TelemetryEvent["UXPostChatLoadingPaneStart"] = "UXPostChatLoadingPaneStart";
|
|
264
260
|
TelemetryEvent["UXPostChatLoadingPaneCompleted"] = "UXPostChatLoadingPaneCompleted";
|
|
265
261
|
TelemetryEvent["UXPrechatPaneStart"] = "UXPrechatPaneStart";
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.disposeLoggers = exports.TelemetryTimers = exports.TelemetryManager = exports.RegisterLoggers = void 0;
|
|
7
7
|
var _TelemetryConstants = require("./TelemetryConstants");
|
|
8
8
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
|
-
var _TelemetryHelper = require("./TelemetryHelper");
|
|
10
|
-
var _appInsightsLogger = require("./loggers/appInsightsLogger");
|
|
11
9
|
var _ariaTelemetryLogger = require("./loggers/ariaTelemetryLogger");
|
|
12
10
|
var _consoleLogger = require("./loggers/consoleLogger");
|
|
13
11
|
var _defaultAriaConfig = require("./defaultConfigs/defaultAriaConfig");
|
|
12
|
+
var _TelemetryHelper = require("./TelemetryHelper");
|
|
13
|
+
var _appInsightsLogger = require("./loggers/appInsightsLogger");
|
|
14
14
|
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); } }
|
|
15
15
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
package/lib/cjs/common/utils.js
CHANGED
|
@@ -421,9 +421,6 @@ const getConversationDetailsCall = async function (facadeChatSDK) {
|
|
|
421
421
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
422
422
|
exports.getConversationDetailsCall = getConversationDetailsCall;
|
|
423
423
|
const checkContactIdError = e => {
|
|
424
|
-
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
425
|
-
Event: _TelemetryConstants.TelemetryEvent.CheckContactIdError
|
|
426
|
-
});
|
|
427
424
|
if ((e === null || e === void 0 ? void 0 : e.message) === _omnichannelChatSdk.ChatSDKErrorName.AuthContactIdNotFoundFailure) {
|
|
428
425
|
const contactIdNotFoundErrorEvent = {
|
|
429
426
|
eventName: _TelemetryConstants.BroadcastEvent.ContactIdNotFound,
|
|
@@ -84,13 +84,9 @@ const ConfirmationPaneStateful = props => {
|
|
|
84
84
|
(0, _react.useEffect)(() => {
|
|
85
85
|
(0, _utils.preventFocusToMoveOutOfElement)(controlProps.id);
|
|
86
86
|
const focusableElements = (0, _utils.findAllFocusableElement)(`#${controlProps.id}`);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
preventScroll: true
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
});
|
|
87
|
+
if (focusableElements) {
|
|
88
|
+
focusableElements[0].focus();
|
|
89
|
+
}
|
|
94
90
|
elements = (0, _utils.findParentFocusableElementsWithoutChildContainer)(controlProps.id);
|
|
95
91
|
(0, _utils.setTabIndices)(elements, initialTabIndexMap, false);
|
|
96
92
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -8,7 +8,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _ChatAdapterStore = require("../../contexts/ChatAdapterStore");
|
|
9
9
|
var _ChatContextStore = require("../../contexts/ChatContextStore");
|
|
10
10
|
var _ChatSDKStore = require("../../contexts/ChatSDKStore");
|
|
11
|
-
var _ErrorBoundary = _interopRequireDefault(require("../errorboundary/ErrorBoundary"));
|
|
12
11
|
var _FacadeChatSDK = require("../../common/facades/FacadeChatSDK");
|
|
13
12
|
var _FacadeChatSDKStore = require("../../contexts/FacadeChatSDKStore");
|
|
14
13
|
var _LiveChatWidgetStateful = _interopRequireDefault(require("./livechatwidgetstateful/LiveChatWidgetStateful"));
|
|
@@ -17,8 +16,6 @@ var _LiveChatWidgetContextInitialState = require("../../contexts/common/LiveChat
|
|
|
17
16
|
var _getMockChatSDKIfApplicable = require("./common/getMockChatSDKIfApplicable");
|
|
18
17
|
var _utils = require("../../common/utils");
|
|
19
18
|
var _overridePropsOnMockIfApplicable = _interopRequireDefault(require("./common/overridePropsOnMockIfApplicable"));
|
|
20
|
-
var _registerTelemetryLoggers = require("./common/registerTelemetryLoggers");
|
|
21
|
-
var _startChatErrorHandler = require("./common/startChatErrorHandler");
|
|
22
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
24
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -49,14 +46,7 @@ const LiveChatWidget = props => {
|
|
|
49
46
|
"isSDKMocked": !(0, _utils.isNullOrUndefined)(props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type)
|
|
50
47
|
}, disableReauthentication));
|
|
51
48
|
}
|
|
52
|
-
|
|
53
|
-
(0, _registerTelemetryLoggers.registerTelemetryLoggers)(props, dispatch);
|
|
54
|
-
}, [dispatch]);
|
|
55
|
-
return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.default, {
|
|
56
|
-
onError: error => {
|
|
57
|
-
(0, _startChatErrorHandler.logWidgetLoadWithUnexpectedError)(error);
|
|
58
|
-
}
|
|
59
|
-
}, /*#__PURE__*/_react.default.createElement(_FacadeChatSDKStore.FacadeChatSDKStore.Provider, {
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_FacadeChatSDKStore.FacadeChatSDKStore.Provider, {
|
|
60
50
|
value: [facadeChatSDK, setFacadeChatSDK]
|
|
61
51
|
}, /*#__PURE__*/_react.default.createElement(_ChatSDKStore.ChatSDKStore.Provider, {
|
|
62
52
|
value: chatSDK
|
|
@@ -64,7 +54,7 @@ const LiveChatWidget = props => {
|
|
|
64
54
|
value: [adapter, setAdapter]
|
|
65
55
|
}, /*#__PURE__*/_react.default.createElement(_ChatContextStore.ChatContextStore.Provider, {
|
|
66
56
|
value: [state, dispatch]
|
|
67
|
-
}, /*#__PURE__*/_react.default.createElement(_LiveChatWidgetStateful.default, props)))))
|
|
57
|
+
}, /*#__PURE__*/_react.default.createElement(_LiveChatWidgetStateful.default, props)))));
|
|
68
58
|
};
|
|
69
59
|
exports.LiveChatWidget = LiveChatWidget;
|
|
70
60
|
var _default = LiveChatWidget;
|
|
@@ -73,10 +73,6 @@ const getChatReconnectContext = async (facadeChatSDK, chatConfig, props, isAuthe
|
|
|
73
73
|
// AuthToken will be reset later at start chat
|
|
74
74
|
(0, _authHelper.removeAuthTokenProvider)(facadeChatSDK.getChatSDK());
|
|
75
75
|
}
|
|
76
|
-
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
77
|
-
Event: _TelemetryConstants.TelemetryEvent.GetChatReconnectContextSDKCallSucceeded,
|
|
78
|
-
Description: "Reconnect context SDK call succeeded"
|
|
79
|
-
});
|
|
80
76
|
return reconnectChatContext;
|
|
81
77
|
}
|
|
82
78
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.logWidgetLoadComplete = exports.handleStartChatError = void 0;
|
|
7
7
|
var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
|
|
8
8
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
var _Constants = require("../../../common/Constants");
|
|
@@ -148,37 +148,8 @@ const logWidgetLoadCompleteWithError = ex => {
|
|
|
148
148
|
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed
|
|
149
149
|
});
|
|
150
150
|
};
|
|
151
|
-
const logWidgetLoadWithUnexpectedError = ex => {
|
|
152
|
-
var _TelemetryTimers$Widg4;
|
|
153
|
-
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
154
|
-
const details = {
|
|
155
|
-
message: (ex === null || ex === void 0 ? void 0 : ex.message) || "An unexpected error occurred",
|
|
156
|
-
stack: (ex === null || ex === void 0 ? void 0 : ex.stack) || "No stack trace available"
|
|
157
|
-
};
|
|
158
|
-
let additionalDetails = "";
|
|
159
|
-
try {
|
|
160
|
-
additionalDetails = JSON.stringify(details);
|
|
161
|
-
} catch (error) {
|
|
162
|
-
additionalDetails = "Failed to stringify error details";
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
-
const exDetails = {
|
|
167
|
-
Exception: `Widget load with unexpected error: ${additionalDetails}`
|
|
168
|
-
};
|
|
169
|
-
if (ex !== null && ex !== void 0 && ex.httpResponseStatusCode) {
|
|
170
|
-
exDetails.HttpResponseStatusCode = ex.httpResponseStatusCode;
|
|
171
|
-
}
|
|
172
|
-
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.ERROR, {
|
|
173
|
-
Event: _TelemetryConstants.TelemetryEvent.WidgetLoadFailed,
|
|
174
|
-
Description: "Widget load with unexpected error",
|
|
175
|
-
ExceptionDetails: exDetails,
|
|
176
|
-
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers === null || _TelemetryManager.TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = _TelemetryManager.TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
151
|
|
|
180
152
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
181
|
-
exports.logWidgetLoadWithUnexpectedError = logWidgetLoadWithUnexpectedError;
|
|
182
153
|
const forceEndChat = facadeChatSDK => {
|
|
183
154
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
184
155
|
Event: _TelemetryConstants.TelemetryEvent.PrepareEndChat,
|
|
@@ -52,6 +52,7 @@ var _initCallingSdk = require("../common/initCallingSdk");
|
|
|
52
52
|
var _initConfirmationPropsComposer = require("../common/initConfirmationPropsComposer");
|
|
53
53
|
var _initWebChatComposer = require("../common/initWebChatComposer");
|
|
54
54
|
var _defaultCacheManager = require("../../../common/storage/default/defaultCacheManager");
|
|
55
|
+
var _registerTelemetryLoggers = require("../common/registerTelemetryLoggers");
|
|
55
56
|
var _setPostChatContextAndLoadSurvey = require("../common/setPostChatContextAndLoadSurvey");
|
|
56
57
|
var _startProactiveChat = require("../common/startProactiveChat");
|
|
57
58
|
var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useChatAdapterStore"));
|
|
@@ -63,7 +64,7 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
63
64
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
64
65
|
let uiTimer;
|
|
65
66
|
const LiveChatWidgetStateful = props => {
|
|
66
|
-
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$
|
|
67
|
+
var _props$webChatContain, _props$styleProps, _props$webChatContain2, _props$webChatContain3, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain7, _state$appStates14, _props$webChatContain9, _props$webChatContain10, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _livechatProps$webCha, _props$webChatContain11, _props$webChatContain12, _props$webChatContain13, _props$webChatContain14, _props$webChatContain15, _props$webChatContain16, _props$webChatContain17, _props$webChatContain18, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
67
68
|
(0, _react2.useEffect)(() => {
|
|
68
69
|
uiTimer = (0, _utils.createTimer)();
|
|
69
70
|
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -82,13 +83,10 @@ const LiveChatWidgetStateful = props => {
|
|
|
82
83
|
const [facadeChatSDK] = (0, _useFacadeChatSDKStore.default)();
|
|
83
84
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
85
|
const [voiceVideoCallingSDK, setVoiceVideoCallingSDK] = (0, _react2.useState)(undefined);
|
|
85
|
-
const [conversationId, setConversationId] = (0, _react2.useState)("");
|
|
86
86
|
const {
|
|
87
87
|
Composer
|
|
88
88
|
} = _botframeworkWebchat.Components;
|
|
89
89
|
const canStartProactiveChat = (0, _react2.useRef)(true);
|
|
90
|
-
const bubbleBackground = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.webChatStyles) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.bubbleBackground) ?? ((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : (_props$webChatContain5 = _props$webChatContain4.adaptiveCardStyles) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background;
|
|
91
|
-
const bubbleTextColor = ((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : (_props$webChatContain7 = _props$webChatContain6.webChatStyles) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.bubbleTextColor) ?? ((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : (_props$webChatContain9 = _props$webChatContain8.adaptiveCardStyles) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color;
|
|
92
90
|
|
|
93
91
|
// Process general styles
|
|
94
92
|
const generalStyles = {
|
|
@@ -97,7 +95,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
97
95
|
|
|
98
96
|
//Scrollbar styles
|
|
99
97
|
const scrollbarProps = Object.assign({}, _defaultScrollBarProps.defaultScrollBarProps, props === null || props === void 0 ? void 0 : props.scrollBarProps);
|
|
100
|
-
const sendBoxTextArea = props === null || props === void 0 ? void 0 : (_props$
|
|
98
|
+
const sendBoxTextArea = props === null || props === void 0 ? void 0 : (_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.sendBoxTextBox) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.textarea;
|
|
101
99
|
|
|
102
100
|
// In case the broadcast channel is already initialized elsewhere; One tab can only hold 1 instance
|
|
103
101
|
if ((props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.skipBroadcastChannelInit) !== true) {
|
|
@@ -230,6 +228,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
230
228
|
state.domainStates.confirmationPaneConfirmedOptionClicked = false;
|
|
231
229
|
state.domainStates.confirmationState = _Constants.ConfirmationState.NotSet;
|
|
232
230
|
setupClientDataStore();
|
|
231
|
+
(0, _registerTelemetryLoggers.registerTelemetryLoggers)(props, dispatch);
|
|
233
232
|
(0, _createInternetConnectionChangeHandler.createInternetConnectionChangeHandler)(state);
|
|
234
233
|
dispatch({
|
|
235
234
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_WIDGET_ELEMENT_ID,
|
|
@@ -579,14 +578,6 @@ const LiveChatWidgetStateful = props => {
|
|
|
579
578
|
});
|
|
580
579
|
});
|
|
581
580
|
|
|
582
|
-
// Retrieve convId
|
|
583
|
-
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.UpdateConversationDataForTelemetry).subscribe(msg => {
|
|
584
|
-
var _msg$payload11, _msg$payload11$liveWo;
|
|
585
|
-
if ((_msg$payload11 = msg.payload) !== null && _msg$payload11 !== void 0 && (_msg$payload11$liveWo = _msg$payload11.liveWorkItem) !== null && _msg$payload11$liveWo !== void 0 && _msg$payload11$liveWo.conversationId) {
|
|
586
|
-
setConversationId(msg.payload.liveWorkItem.conversationId);
|
|
587
|
-
}
|
|
588
|
-
});
|
|
589
|
-
|
|
590
581
|
// Check for TPC and log in telemetry if blocked
|
|
591
582
|
(0, _defaultClientDataStoreProvider.isCookieAllowed)();
|
|
592
583
|
return () => {
|
|
@@ -633,8 +624,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
633
624
|
});
|
|
634
625
|
}
|
|
635
626
|
if (state.appStates.conversationState === _ConversationState.ConversationState.InActive) {
|
|
636
|
-
var _props$
|
|
637
|
-
if ((props === null || props === void 0 ? void 0 : (_props$
|
|
627
|
+
var _props$webChatContain4, _props$webChatContain5;
|
|
628
|
+
if ((props === null || props === void 0 ? void 0 : (_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : (_props$webChatContain5 = _props$webChatContain4.renderingMiddlewareProps) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.hideSendboxOnConversationEnd) !== false) {
|
|
638
629
|
setWebChatStyles(styles => {
|
|
639
630
|
return {
|
|
640
631
|
...styles,
|
|
@@ -678,12 +669,12 @@ const LiveChatWidgetStateful = props => {
|
|
|
678
669
|
}
|
|
679
670
|
}, [state.appStates.unreadMessageCount]);
|
|
680
671
|
(0, _react2.useEffect)(() => {
|
|
681
|
-
var _props$
|
|
672
|
+
var _props$webChatContain6;
|
|
682
673
|
setWebChatStyles({
|
|
683
674
|
...webChatStyles,
|
|
684
|
-
...((_props$
|
|
675
|
+
...((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : _props$webChatContain6.webChatStyles)
|
|
685
676
|
});
|
|
686
|
-
}, [(_props$
|
|
677
|
+
}, [(_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.webChatStyles]);
|
|
687
678
|
(0, _react2.useEffect)(() => {
|
|
688
679
|
//Confirmation pane dismissing through OK option, so proceed with end chat
|
|
689
680
|
if (state.domainStates.confirmationState === _Constants.ConfirmationState.Ok) {
|
|
@@ -782,12 +773,12 @@ const LiveChatWidgetStateful = props => {
|
|
|
782
773
|
|
|
783
774
|
// if props state gets updates we need to update the renderingMiddlewareProps in the state
|
|
784
775
|
(0, _react2.useEffect)(() => {
|
|
785
|
-
var _props$
|
|
776
|
+
var _props$webChatContain8;
|
|
786
777
|
dispatch({
|
|
787
778
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RENDERING_MIDDLEWARE_PROPS,
|
|
788
|
-
payload: (_props$
|
|
779
|
+
payload: (_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : _props$webChatContain8.renderingMiddlewareProps
|
|
789
780
|
});
|
|
790
|
-
}, [(_props$
|
|
781
|
+
}, [(_props$webChatContain9 = props.webChatContainerProps) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.renderingMiddlewareProps]);
|
|
791
782
|
(0, _react2.useEffect)(() => {
|
|
792
783
|
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.INFO, {
|
|
793
784
|
Event: _TelemetryConstants.TelemetryEvent.UXLiveChatWidgetCompleted,
|
|
@@ -830,7 +821,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
830
821
|
const webChatProps = (0, _initWebChatComposer.initWebChatComposer)(props, state, dispatch, facadeChatSDK, endChatRelay);
|
|
831
822
|
const downloadTranscriptProps = (0, _createDownloadTranscriptProps.default)(props.downloadTranscriptProps, {
|
|
832
823
|
...(_defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps === null || _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps === void 0 ? void 0 : _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles),
|
|
833
|
-
...((_props$
|
|
824
|
+
...((_props$webChatContain10 = props.webChatContainerProps) === null || _props$webChatContain10 === void 0 ? void 0 : _props$webChatContain10.webChatStyles)
|
|
834
825
|
}, props.webChatContainerProps);
|
|
835
826
|
const livechatProps = {
|
|
836
827
|
...props,
|
|
@@ -856,11 +847,6 @@ const LiveChatWidgetStateful = props => {
|
|
|
856
847
|
(0, _utils.setOcUserAgent)(facadeChatSDK.getChatSDK());
|
|
857
848
|
const directLine = ((_livechatProps$webCha = livechatProps.webChatContainerProps) === null || _livechatProps$webCha === void 0 ? void 0 : _livechatProps$webCha.directLine) ?? adapter ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.directLine;
|
|
858
849
|
const userID = directLine.getState ? directLine === null || directLine === void 0 ? void 0 : directLine.getState("acs.userId") : "teamsvisitor";
|
|
859
|
-
const styleOptions = _react2.default.useMemo(() => ({
|
|
860
|
-
...webChatStyles,
|
|
861
|
-
bubbleBackground,
|
|
862
|
-
bubbleTextColor
|
|
863
|
-
}), [webChatStyles, bubbleBackground, bubbleTextColor]);
|
|
864
850
|
|
|
865
851
|
// WebChat's Composer can only be rendered if a directLine object is defined
|
|
866
852
|
return directLine && /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
@@ -899,7 +885,11 @@ const LiveChatWidgetStateful = props => {
|
|
|
899
885
|
}`}
|
|
900
886
|
`), /*#__PURE__*/_react2.default.createElement(_DraggableChatWidget.default, chatWidgetDraggableConfig, /*#__PURE__*/_react2.default.createElement(Composer, _extends({}, webChatProps, {
|
|
901
887
|
userID: userID,
|
|
902
|
-
styleOptions:
|
|
888
|
+
styleOptions: {
|
|
889
|
+
...webChatStyles,
|
|
890
|
+
bubbleBackground: ((_props$webChatContain11 = props.webChatContainerProps) === null || _props$webChatContain11 === void 0 ? void 0 : (_props$webChatContain12 = _props$webChatContain11.webChatStyles) === null || _props$webChatContain12 === void 0 ? void 0 : _props$webChatContain12.bubbleBackground) ?? ((_props$webChatContain13 = props.webChatContainerProps) === null || _props$webChatContain13 === void 0 ? void 0 : (_props$webChatContain14 = _props$webChatContain13.adaptiveCardStyles) === null || _props$webChatContain14 === void 0 ? void 0 : _props$webChatContain14.background) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.background,
|
|
891
|
+
bubbleTextColor: ((_props$webChatContain15 = props.webChatContainerProps) === null || _props$webChatContain15 === void 0 ? void 0 : (_props$webChatContain16 = _props$webChatContain15.webChatStyles) === null || _props$webChatContain16 === void 0 ? void 0 : _props$webChatContain16.bubbleTextColor) ?? ((_props$webChatContain17 = props.webChatContainerProps) === null || _props$webChatContain17 === void 0 ? void 0 : (_props$webChatContain18 = _props$webChatContain17.adaptiveCardStyles) === null || _props$webChatContain18 === void 0 ? void 0 : _props$webChatContain18.color) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.color
|
|
892
|
+
},
|
|
903
893
|
directLine: directLine
|
|
904
894
|
}), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
905
895
|
id: widgetElementId,
|
|
@@ -930,9 +920,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
930
920
|
}, livechatProps.callingContainerProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideWebChatContainer) && (0, _componentController.shouldShowWebChatContainer)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.webChatContainer) || /*#__PURE__*/_react2.default.createElement(_WebChatContainerStateful.default, livechatProps)), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hideConfirmationPane) && (0, _componentController.shouldShowConfirmationPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.confirmationPane) || /*#__PURE__*/_react2.default.createElement(_ConfirmationPaneStateful.default, _extends({}, confirmationPaneProps, {
|
|
931
921
|
setPostChatContext: setPostChatContextRelay,
|
|
932
922
|
prepareEndChat: prepareEndChatRelay
|
|
933
|
-
}))), !((_livechatProps$contro13 = livechatProps.controlProps) !== null && _livechatProps$contro13 !== void 0 && _livechatProps$contro13.hidePostChatLoadingPane) && (0, _componentController.shouldShowPostChatLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatLoadingPane) || /*#__PURE__*/_react2.default.createElement(_PostChatLoadingPaneStateful.default, livechatProps.postChatLoadingPaneProps)), (0, _componentController.shouldShowPostChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.postChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PostChatSurveyPaneStateful.default, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK,
|
|
934
|
-
customerVoiceSurveyCorrelationId: conversationId
|
|
935
|
-
}))), (0, _createFooter.createFooter)(livechatProps, state), (0, _componentController.shouldShowEmailTranscriptPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon13 = livechatProps.componentOverrides) === null || _livechatProps$compon13 === void 0 ? void 0 : _livechatProps$compon13.emailTranscriptPane) || /*#__PURE__*/_react2.default.createElement(_EmailTranscriptPaneStateful.default, livechatProps.emailTranscriptPane))))));
|
|
923
|
+
}))), !((_livechatProps$contro13 = livechatProps.controlProps) !== null && _livechatProps$contro13 !== void 0 && _livechatProps$contro13.hidePostChatLoadingPane) && (0, _componentController.shouldShowPostChatLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatLoadingPane) || /*#__PURE__*/_react2.default.createElement(_PostChatLoadingPaneStateful.default, livechatProps.postChatLoadingPaneProps)), (0, _componentController.shouldShowPostChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.postChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PostChatSurveyPaneStateful.default, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), (0, _createFooter.createFooter)(livechatProps, state), (0, _componentController.shouldShowEmailTranscriptPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon13 = livechatProps.componentOverrides) === null || _livechatProps$compon13 === void 0 ? void 0 : _livechatProps$compon13.emailTranscriptPane) || /*#__PURE__*/_react2.default.createElement(_EmailTranscriptPaneStateful.default, livechatProps.emailTranscriptPane))))));
|
|
936
924
|
};
|
|
937
925
|
exports.LiveChatWidgetStateful = LiveChatWidgetStateful;
|
|
938
926
|
var _default = LiveChatWidgetStateful;
|
|
@@ -7,16 +7,15 @@ exports.default = exports.OutOfOfficeHoursPaneStateful = void 0;
|
|
|
7
7
|
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _utils = require("../../common/utils");
|
|
10
|
+
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
10
11
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
12
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
12
13
|
var _defaultgeneralOOOHPaneStyleProps = require("./common/defaultStyleProps/defaultgeneralOOOHPaneStyleProps");
|
|
13
|
-
var _xssUtils = require("../../common/utils/xssUtils");
|
|
14
14
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
17
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
18
18
|
let uiTimer;
|
|
19
|
-
const OOOHPaneTitleText = "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open.";
|
|
20
19
|
const OutOfOfficeHoursPaneStateful = props => {
|
|
21
20
|
var _props$styleProps;
|
|
22
21
|
(0, _react.useEffect)(() => {
|
|
@@ -55,28 +54,8 @@ const OutOfOfficeHoursPaneStateful = props => {
|
|
|
55
54
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
56
55
|
});
|
|
57
56
|
}, []);
|
|
58
|
-
|
|
59
|
-
// Enhanced titleText sanitization
|
|
60
57
|
if (controlProps !== null && controlProps !== void 0 && controlProps.titleText) {
|
|
61
|
-
|
|
62
|
-
cleanText,
|
|
63
|
-
isXSSDetected
|
|
64
|
-
} = (0, _xssUtils.detectAndCleanXSS)(controlProps.titleText);
|
|
65
|
-
if (!isXSSDetected) {
|
|
66
|
-
// replace with the sanitized text
|
|
67
|
-
controlProps.titleText = cleanText;
|
|
68
|
-
} else {
|
|
69
|
-
_TelemetryHelper.TelemetryHelper.logLoadingEventToAllTelemetry(_TelemetryConstants.LogLevel.WARN, {
|
|
70
|
-
Event: _TelemetryConstants.TelemetryEvent.XSSTextDetected,
|
|
71
|
-
Description: "Potential XSS attempt detected in titleText",
|
|
72
|
-
CustomProperties: {
|
|
73
|
-
originalText: controlProps.titleText.substring(0, 100),
|
|
74
|
-
// Log first 100 chars for analysis
|
|
75
|
-
cleanedText: cleanText.substring(0, 100)
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
controlProps.titleText = OOOHPaneTitleText;
|
|
79
|
-
}
|
|
58
|
+
controlProps.titleText = _dompurify.default.sanitize(controlProps.titleText);
|
|
80
59
|
}
|
|
81
60
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.OutOfOfficeHoursPane, {
|
|
82
61
|
componentOverrides: props.componentOverrides,
|
|
@@ -18,14 +18,13 @@ var _isValidSurveyUrl = _interopRequireDefault(require("./common/isValidSurveyUr
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, compact
|
|
22
|
-
let showMultiLingual = arguments.length >
|
|
21
|
+
const generateSurveyInviteLink = function (surveyInviteLink, isEmbed, locale, compact) {
|
|
22
|
+
let showMultiLingual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
23
23
|
const surveyLinkParams = new URLSearchParams({
|
|
24
24
|
embed: isEmbed.toString(),
|
|
25
25
|
compact: (compact ?? true).toString(),
|
|
26
26
|
lang: locale ?? "en-us",
|
|
27
|
-
showmultilingual: (showMultiLingual ?? false).toString()
|
|
28
|
-
cvResponsePageRequestId: customerVoiceSurveyCorrelationId
|
|
27
|
+
showmultilingual: (showMultiLingual ?? false).toString()
|
|
29
28
|
});
|
|
30
29
|
return `${surveyInviteLink}&${surveyLinkParams.toString()}`;
|
|
31
30
|
};
|
|
@@ -41,9 +40,9 @@ const PostChatSurveyPaneStateful = props => {
|
|
|
41
40
|
// Bot survey enabled
|
|
42
41
|
state.appStates.postChatParticipantType === _Constants.ParticipantType.Bot) {
|
|
43
42
|
// Only Bot has engaged
|
|
44
|
-
surveyInviteLink = generateSurveyInviteLink(state.domainStates.postChatContext.botSurveyInviteLink, surveyMode, state.domainStates.postChatContext.botFormsProLocale, props.isCustomerVoiceSurveyCompact ?? true
|
|
43
|
+
surveyInviteLink = generateSurveyInviteLink(state.domainStates.postChatContext.botSurveyInviteLink, surveyMode, state.domainStates.postChatContext.botFormsProLocale, props.isCustomerVoiceSurveyCompact ?? true);
|
|
45
44
|
} else {
|
|
46
|
-
surveyInviteLink = generateSurveyInviteLink(state.domainStates.postChatContext.surveyInviteLink, surveyMode, state.domainStates.postChatContext.formsProLocale, props.isCustomerVoiceSurveyCompact ?? true
|
|
45
|
+
surveyInviteLink = generateSurveyInviteLink(state.domainStates.postChatContext.surveyInviteLink, surveyMode, state.domainStates.postChatContext.formsProLocale, props.isCustomerVoiceSurveyCompact ?? true);
|
|
47
46
|
}
|
|
48
47
|
if (props.copilotSurveyContext) {
|
|
49
48
|
surveyInviteLink = `${surveyInviteLink}&mcs_additionalcontext=${JSON.stringify(props.copilotSurveyContext)}`;
|
|
@@ -106,14 +105,6 @@ const PostChatSurveyPaneStateful = props => {
|
|
|
106
105
|
message: "Customer Voice form response error."
|
|
107
106
|
}
|
|
108
107
|
});
|
|
109
|
-
} else if (typeof data === "string" && data.startsWith(_CustomerVoiceEvents.CustomerVoiceEvents.FormsError)) {
|
|
110
|
-
_TelemetryHelper.TelemetryHelper.logActionEventToAllTelemetry(_TelemetryConstants.LogLevel.ERROR, {
|
|
111
|
-
Event: _TelemetryConstants.TelemetryEvent.CustomerVoiceFormsError,
|
|
112
|
-
Description: "Customer Voice failed to load with forms error.",
|
|
113
|
-
ExceptionDetails: {
|
|
114
|
-
message: `Customer Voice forms error details: ${data}`
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
108
|
}
|
|
118
109
|
});
|
|
119
110
|
}, []);
|
|
@@ -10,5 +10,4 @@ exports.CustomerVoiceEvents = CustomerVoiceEvents;
|
|
|
10
10
|
CustomerVoiceEvents["ResponsePageLoaded"] = "ResponsePageLoaded";
|
|
11
11
|
CustomerVoiceEvents["FormResponseSubmitted"] = "FormResponseSubmitted";
|
|
12
12
|
CustomerVoiceEvents["FormResponseError"] = "FormResponseError";
|
|
13
|
-
CustomerVoiceEvents["FormsError"] = "FormsError";
|
|
14
13
|
})(CustomerVoiceEvents || (exports.CustomerVoiceEvents = CustomerVoiceEvents = {}));
|
|
@@ -106,8 +106,6 @@ export let TelemetryEvent;
|
|
|
106
106
|
TelemetryEvent["DisconnectEndChatSDKCallFailed"] = "DisconnectEndChatSDKCallFailed";
|
|
107
107
|
TelemetryEvent["GetChatReconnectContextSDKCallStarted"] = "GetChatReconnectContextSDKCallStarted";
|
|
108
108
|
TelemetryEvent["GetChatReconnectContextSDKCallFailed"] = "GetChatReconnectContextSDKCallFailed";
|
|
109
|
-
TelemetryEvent["CheckContactIdError"] = "checkContactIdError";
|
|
110
|
-
TelemetryEvent["GetChatReconnectContextSDKCallSucceeded"] = "GetChatReconnectContextSDKCallSucceeded";
|
|
111
109
|
TelemetryEvent["ParseAdaptiveCardFailed"] = "ParseAdaptiveCardFailed";
|
|
112
110
|
TelemetryEvent["ClientDataStoreProviderFailed"] = "ClientDataStoreProviderFailed";
|
|
113
111
|
TelemetryEvent["InMemoryDataStoreFailed"] = "InMemoryDataStoreFailed";
|
|
@@ -175,7 +173,6 @@ export let TelemetryEvent;
|
|
|
175
173
|
TelemetryEvent["CustomerVoiceResponsePageLoaded"] = "CustomerVoiceResponsePageLoaded";
|
|
176
174
|
TelemetryEvent["CustomerVoiceFormResponseSubmitted"] = "CustomerVoiceFormResponseSubmitted";
|
|
177
175
|
TelemetryEvent["CustomerVoiceFormResponseError"] = "CustomerVoiceFormResponseError";
|
|
178
|
-
TelemetryEvent["CustomerVoiceFormsError"] = "CustomerVoiceFormsError";
|
|
179
176
|
TelemetryEvent["BotAuthActivityEmptySasUrl"] = "BotAuthActivityEmptySasUrl";
|
|
180
177
|
TelemetryEvent["SetBotAuthProviderFetchConfig"] = "SetBotAuthProviderFetchConfig";
|
|
181
178
|
TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
|
|
@@ -253,7 +250,6 @@ export let TelemetryEvent;
|
|
|
253
250
|
TelemetryEvent["UXNotificationPaneCompleted"] = "UXNotificationPaneCompleted";
|
|
254
251
|
TelemetryEvent["UXOutOfOfficeHoursPaneStart"] = "UXOutOfOfficeHoursPaneStart";
|
|
255
252
|
TelemetryEvent["UXOutOfOfficeHoursPaneCompleted"] = "UXOutOfOfficeHoursPaneCompleted";
|
|
256
|
-
TelemetryEvent["XSSTextDetected"] = "XSSTextDetected";
|
|
257
253
|
TelemetryEvent["UXPostChatLoadingPaneStart"] = "UXPostChatLoadingPaneStart";
|
|
258
254
|
TelemetryEvent["UXPostChatLoadingPaneCompleted"] = "UXPostChatLoadingPaneCompleted";
|
|
259
255
|
TelemetryEvent["UXPrechatPaneStart"] = "UXPrechatPaneStart";
|
|
@@ -6,11 +6,11 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
6
6
|
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); }
|
|
7
7
|
import { LogLevel, ScenarioType, TelemetryConstants, TelemetryEvent } from "./TelemetryConstants";
|
|
8
8
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
9
|
-
import { TelemetryHelper } from "./TelemetryHelper";
|
|
10
|
-
import { appInsightsLogger } from "./loggers/appInsightsLogger";
|
|
11
9
|
import { ariaTelemetryLogger } from "./loggers/ariaTelemetryLogger";
|
|
12
10
|
import { consoleLogger } from "./loggers/consoleLogger";
|
|
13
11
|
import { defaultAriaConfig } from "./defaultConfigs/defaultAriaConfig";
|
|
12
|
+
import { TelemetryHelper } from "./TelemetryHelper";
|
|
13
|
+
import { appInsightsLogger } from "./loggers/appInsightsLogger";
|
|
14
14
|
export let TelemetryTimers = /*#__PURE__*/_createClass(function TelemetryTimers() {
|
|
15
15
|
_classCallCheck(this, TelemetryTimers);
|
|
16
16
|
});
|
package/lib/esm/common/utils.js
CHANGED
|
@@ -385,9 +385,6 @@ export const getConversationDetailsCall = async function (facadeChatSDK) {
|
|
|
385
385
|
|
|
386
386
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
387
387
|
export const checkContactIdError = e => {
|
|
388
|
-
TelemetryHelper.logSDKEvent(LogLevel.ERROR, {
|
|
389
|
-
Event: TelemetryEvent.CheckContactIdError
|
|
390
|
-
});
|
|
391
388
|
if ((e === null || e === void 0 ? void 0 : e.message) === ChatSDKErrorName.AuthContactIdNotFoundFailure) {
|
|
392
389
|
const contactIdNotFoundErrorEvent = {
|
|
393
390
|
eventName: BroadcastEvent.ContactIdNotFound,
|
|
@@ -75,13 +75,9 @@ export const ConfirmationPaneStateful = props => {
|
|
|
75
75
|
useEffect(() => {
|
|
76
76
|
preventFocusToMoveOutOfElement(controlProps.id);
|
|
77
77
|
const focusableElements = findAllFocusableElement(`#${controlProps.id}`);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
preventScroll: true
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
});
|
|
78
|
+
if (focusableElements) {
|
|
79
|
+
focusableElements[0].focus();
|
|
80
|
+
}
|
|
85
81
|
elements = findParentFocusableElementsWithoutChildContainer(controlProps.id);
|
|
86
82
|
setTabIndices(elements, initialTabIndexMap, false);
|
|
87
83
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useReducer, useState } from "react";
|
|
2
2
|
import { ChatAdapterStore } from "../../contexts/ChatAdapterStore";
|
|
3
3
|
import { ChatContextStore } from "../../contexts/ChatContextStore";
|
|
4
4
|
import { ChatSDKStore } from "../../contexts/ChatSDKStore";
|
|
5
|
-
import ErrorBoundary from "../errorboundary/ErrorBoundary";
|
|
6
5
|
import { FacadeChatSDK } from "../../common/facades/FacadeChatSDK";
|
|
7
6
|
import { FacadeChatSDKStore } from "../../contexts/FacadeChatSDKStore";
|
|
8
7
|
import LiveChatWidgetStateful from "./livechatwidgetstateful/LiveChatWidgetStateful";
|
|
@@ -11,8 +10,6 @@ import { getLiveChatWidgetContextInitialState } from "../../contexts/common/Live
|
|
|
11
10
|
import { getMockChatSDKIfApplicable } from "./common/getMockChatSDKIfApplicable";
|
|
12
11
|
import { isNullOrUndefined } from "../../common/utils";
|
|
13
12
|
import overridePropsOnMockIfApplicable from "./common/overridePropsOnMockIfApplicable";
|
|
14
|
-
import { registerTelemetryLoggers } from "./common/registerTelemetryLoggers";
|
|
15
|
-
import { logWidgetLoadWithUnexpectedError } from "./common/startChatErrorHandler";
|
|
16
13
|
export const LiveChatWidget = props => {
|
|
17
14
|
var _props$mock, _props$featureConfigP, _props$chatConfig, _props$chatConfig$Liv;
|
|
18
15
|
const reducer = createReducer();
|
|
@@ -40,14 +37,7 @@ export const LiveChatWidget = props => {
|
|
|
40
37
|
"isSDKMocked": !isNullOrUndefined(props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type)
|
|
41
38
|
}, disableReauthentication));
|
|
42
39
|
}
|
|
43
|
-
|
|
44
|
-
registerTelemetryLoggers(props, dispatch);
|
|
45
|
-
}, [dispatch]);
|
|
46
|
-
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
47
|
-
onError: error => {
|
|
48
|
-
logWidgetLoadWithUnexpectedError(error);
|
|
49
|
-
}
|
|
50
|
-
}, /*#__PURE__*/React.createElement(FacadeChatSDKStore.Provider, {
|
|
40
|
+
return /*#__PURE__*/React.createElement(FacadeChatSDKStore.Provider, {
|
|
51
41
|
value: [facadeChatSDK, setFacadeChatSDK]
|
|
52
42
|
}, /*#__PURE__*/React.createElement(ChatSDKStore.Provider, {
|
|
53
43
|
value: chatSDK
|
|
@@ -55,6 +45,6 @@ export const LiveChatWidget = props => {
|
|
|
55
45
|
value: [adapter, setAdapter]
|
|
56
46
|
}, /*#__PURE__*/React.createElement(ChatContextStore.Provider, {
|
|
57
47
|
value: [state, dispatch]
|
|
58
|
-
}, /*#__PURE__*/React.createElement(LiveChatWidgetStateful, props)))))
|
|
48
|
+
}, /*#__PURE__*/React.createElement(LiveChatWidgetStateful, props)))));
|
|
59
49
|
};
|
|
60
50
|
export default LiveChatWidget;
|
|
@@ -67,10 +67,6 @@ const getChatReconnectContext = async (facadeChatSDK, chatConfig, props, isAuthe
|
|
|
67
67
|
// AuthToken will be reset later at start chat
|
|
68
68
|
removeAuthTokenProvider(facadeChatSDK.getChatSDK());
|
|
69
69
|
}
|
|
70
|
-
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
71
|
-
Event: TelemetryEvent.GetChatReconnectContextSDKCallSucceeded,
|
|
72
|
-
Description: "Reconnect context SDK call succeeded"
|
|
73
|
-
});
|
|
74
70
|
return reconnectChatContext;
|
|
75
71
|
}
|
|
76
72
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -141,34 +141,6 @@ const logWidgetLoadCompleteWithError = ex => {
|
|
|
141
141
|
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg3 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg3 === void 0 ? void 0 : _TelemetryTimers$Widg3.milliSecondsElapsed
|
|
142
142
|
});
|
|
143
143
|
};
|
|
144
|
-
export const logWidgetLoadWithUnexpectedError = ex => {
|
|
145
|
-
var _TelemetryTimers$Widg4;
|
|
146
|
-
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
147
|
-
const details = {
|
|
148
|
-
message: (ex === null || ex === void 0 ? void 0 : ex.message) || "An unexpected error occurred",
|
|
149
|
-
stack: (ex === null || ex === void 0 ? void 0 : ex.stack) || "No stack trace available"
|
|
150
|
-
};
|
|
151
|
-
let additionalDetails = "";
|
|
152
|
-
try {
|
|
153
|
-
additionalDetails = JSON.stringify(details);
|
|
154
|
-
} catch (error) {
|
|
155
|
-
additionalDetails = "Failed to stringify error details";
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
159
|
-
const exDetails = {
|
|
160
|
-
Exception: `Widget load with unexpected error: ${additionalDetails}`
|
|
161
|
-
};
|
|
162
|
-
if (ex !== null && ex !== void 0 && ex.httpResponseStatusCode) {
|
|
163
|
-
exDetails.HttpResponseStatusCode = ex.httpResponseStatusCode;
|
|
164
|
-
}
|
|
165
|
-
TelemetryHelper.logLoadingEventToAllTelemetry(LogLevel.ERROR, {
|
|
166
|
-
Event: TelemetryEvent.WidgetLoadFailed,
|
|
167
|
-
Description: "Widget load with unexpected error",
|
|
168
|
-
ExceptionDetails: exDetails,
|
|
169
|
-
ElapsedTimeInMilliseconds: TelemetryTimers === null || TelemetryTimers === void 0 ? void 0 : (_TelemetryTimers$Widg4 = TelemetryTimers.WidgetLoadTimer) === null || _TelemetryTimers$Widg4 === void 0 ? void 0 : _TelemetryTimers$Widg4.milliSecondsElapsed
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
144
|
|
|
173
145
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
174
146
|
const forceEndChat = facadeChatSDK => {
|