@microsoft/omnichannel-chat-widget 0.1.0-main.bf74329 → 0.1.0-main.c1dcc1d
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 +6 -4
- package/lib/cjs/common/telemetry/TelemetryHelper.js +2 -0
- package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +2 -2
- package/lib/cjs/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +14 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +0 -1
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +17 -13
- package/lib/cjs/components/livechatwidget/common/startChat.js +3 -3
- package/lib/cjs/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +51 -10
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +11 -1
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/createReducer.js +9 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +6 -4
- package/lib/esm/common/telemetry/TelemetryHelper.js +2 -0
- package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +2 -2
- package/lib/esm/components/chatbuttonstateful/common/styleProps/defaultOutOfOfficeChatButtonStyleProps.js +3 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultScrollBarProps.js +7 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +0 -1
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +15 -13
- package/lib/esm/components/livechatwidget/common/startChat.js +3 -3
- package/lib/esm/components/livechatwidget/interfaces/IScrollBarProps.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +52 -11
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware.js +11 -1
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/createReducer.js +9 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +5 -3
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -4
- package/lib/types/components/livechatwidget/common/defaultProps/defaultScrollBarProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -5
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/interfaces/IScrollBarProps.d.ts +22 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +1 -1
|
@@ -54,6 +54,7 @@ exports.BroadcastEvent = BroadcastEvent;
|
|
|
54
54
|
BroadcastEvent["CloseChat"] = "CloseChat";
|
|
55
55
|
BroadcastEvent["InitiateEndChatOnBrowserUnload"] = "InitiateEndChatOnBrowserUnload";
|
|
56
56
|
BroadcastEvent["ClosePopoutWindow"] = "ClosePopoutWindow";
|
|
57
|
+
BroadcastEvent["RaiseErrorEvent"] = "RaiseErrorEvent";
|
|
57
58
|
})(BroadcastEvent || (exports.BroadcastEvent = BroadcastEvent = {}));
|
|
58
59
|
let TelemetryEvent;
|
|
59
60
|
exports.TelemetryEvent = TelemetryEvent;
|
|
@@ -66,8 +67,8 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
66
67
|
TelemetryEvent["CallDisconnected"] = "CallDisconnected";
|
|
67
68
|
TelemetryEvent["CallDisconnectedException"] = "CallDisconnectedException";
|
|
68
69
|
TelemetryEvent["IncomingCallEnded"] = "incomingCallEnded";
|
|
69
|
-
TelemetryEvent["
|
|
70
|
-
TelemetryEvent["
|
|
70
|
+
TelemetryEvent["VoiceVideoSdkInitialize"] = "VoiceVideoSdkInitialize";
|
|
71
|
+
TelemetryEvent["VoiceVideoSdkInitializeException"] = "VoiceVideoSdkInitializeException";
|
|
71
72
|
TelemetryEvent["VoiceVideoLoading"] = "VoiceVideoLoading";
|
|
72
73
|
TelemetryEvent["VoiceVideoNotLoaded"] = "VoiceVideoNotLoaded";
|
|
73
74
|
TelemetryEvent["VoiceVideoLoadingException"] = "VoiceVideoLoadingException";
|
|
@@ -148,6 +149,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
148
149
|
TelemetryEvent["QueuePositionMessageRecieved"] = "QueuePositionMessageRecieved";
|
|
149
150
|
TelemetryEvent["AverageWaitTimeMessageRecieved"] = "AverageWaitTimeMessageRecieved";
|
|
150
151
|
TelemetryEvent["DataMaskingRuleApplied"] = "DataMaskingRuleApplied";
|
|
152
|
+
TelemetryEvent["DataMaskingRuleApplyFailed"] = "DataMaskingRuleApplyFailed";
|
|
151
153
|
TelemetryEvent["IC3ClientEvent"] = "IC3ClientEvent";
|
|
152
154
|
TelemetryEvent["ConversationEndedThreadEventReceived"] = "ConversationEndedThreadEventReceived";
|
|
153
155
|
TelemetryEvent["InvalidConfiguration"] = "InvalidConfiguration";
|
|
@@ -250,8 +252,8 @@ class TelemetryConstants {
|
|
|
250
252
|
case TelemetryEvent.CallDisconnected:
|
|
251
253
|
case TelemetryEvent.CallDisconnectedException:
|
|
252
254
|
case TelemetryEvent.IncomingCallEnded:
|
|
253
|
-
case TelemetryEvent.
|
|
254
|
-
case TelemetryEvent.
|
|
255
|
+
case TelemetryEvent.VoiceVideoSdkInitialize:
|
|
256
|
+
case TelemetryEvent.VoiceVideoSdkInitializeException:
|
|
255
257
|
case TelemetryEvent.VoiceVideoLoading:
|
|
256
258
|
case TelemetryEvent.VoiceVideoNotLoaded:
|
|
257
259
|
case TelemetryEvent.VoiceVideoLoadingException:
|
|
@@ -59,6 +59,7 @@ class TelemetryHelper {
|
|
|
59
59
|
event.ActionType = payload.ActionType;
|
|
60
60
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
61
61
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
62
|
+
event.Description = payload.Description;
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
static conformToWebChatContract(level, input) {
|
|
@@ -84,6 +85,7 @@ class TelemetryHelper {
|
|
|
84
85
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
85
86
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
86
87
|
event.Language = ((_TelemetryManager$Int10 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : _TelemetryManager$Int10.chatWidgetLocaleLCID) || "";
|
|
88
|
+
event.Description = payload.Data;
|
|
87
89
|
});
|
|
88
90
|
}
|
|
89
91
|
static conformToLoadContract(level, input) {
|
|
@@ -67,7 +67,7 @@ const CallingContainerStateful = props => {
|
|
|
67
67
|
});
|
|
68
68
|
} catch (e) {
|
|
69
69
|
_TelemetryHelper.TelemetryHelper.logCallingEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
70
|
-
Event: _TelemetryConstants.TelemetryEvent.
|
|
70
|
+
Event: _TelemetryConstants.TelemetryEvent.VoiceVideoSdkInitializeException,
|
|
71
71
|
Description: `Failed to initialize VideoVoiceCalling Sdk: ${e}`
|
|
72
72
|
});
|
|
73
73
|
}
|
|
@@ -75,7 +75,7 @@ const CallingContainerStateful = props => {
|
|
|
75
75
|
init().then(() => {
|
|
76
76
|
if (voiceVideoCallingSdk) {
|
|
77
77
|
_TelemetryHelper.TelemetryHelper.logCallingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
78
|
-
Event: _TelemetryConstants.TelemetryEvent.
|
|
78
|
+
Event: _TelemetryConstants.TelemetryEvent.VoiceVideoSdkInitialize,
|
|
79
79
|
Description: "Initialize VideoVoiceCalling Sdk Success"
|
|
80
80
|
}, callId);
|
|
81
81
|
voiceVideoCallingSdk.onCallAdded(() => {
|
|
@@ -7,6 +7,9 @@ exports.defaultOutOfOfficeChatButtonStyleProps = void 0;
|
|
|
7
7
|
const defaultOutOfOfficeChatButtonStyleProps = {
|
|
8
8
|
iconStyleProps: {
|
|
9
9
|
backgroundColor: "#000000"
|
|
10
|
+
},
|
|
11
|
+
subtitleStyleProps: {
|
|
12
|
+
margin: "0px 10px 0px 10px"
|
|
10
13
|
}
|
|
11
14
|
};
|
|
12
15
|
exports.defaultOutOfOfficeChatButtonStyleProps = defaultOutOfOfficeChatButtonStyleProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultScrollBarProps = void 0;
|
|
7
|
+
const defaultScrollBarProps = {
|
|
8
|
+
width: "7px",
|
|
9
|
+
trackBackgroundColor: "#f1f1f1",
|
|
10
|
+
thumbBackgroundColor: "#888",
|
|
11
|
+
thumbBorderRadius: "10px",
|
|
12
|
+
thumbHoverColor: "#555"
|
|
13
|
+
};
|
|
14
|
+
exports.defaultScrollBarProps = defaultScrollBarProps;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.startUnauthenticatedReconnectChat = exports.handleUnauthenticatedReconnectChat = exports.handleRedirectUnauthenticatedReconnectChat = exports.getReconnectIdForAuthenticatedChat = exports.getChatReconnectContext = void 0;
|
|
6
|
+
exports.startUnauthenticatedReconnectChat = exports.isReconnectEnabled = exports.handleUnauthenticatedReconnectChat = exports.handleRedirectUnauthenticatedReconnectChat = exports.getReconnectIdForAuthenticatedChat = exports.getChatReconnectContext = void 0;
|
|
7
7
|
require("regenerator-runtime/runtime");
|
|
8
8
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
@@ -11,9 +11,14 @@ var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
|
11
11
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
12
12
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
13
13
|
var _authHelper = require("./authHelper");
|
|
14
|
+
const isReconnectEnabled = chatConfig => {
|
|
15
|
+
return chatConfig && chatConfig.LiveWSAndLiveChatEngJoin.msdyn_enablechatreconnect && (chatConfig.LiveWSAndLiveChatEngJoin.msdyn_enablechatreconnect === "true" || chatConfig.LiveWSAndLiveChatEngJoin.msdyn_enablechatreconnect === true);
|
|
16
|
+
};
|
|
17
|
+
|
|
14
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
exports.isReconnectEnabled = isReconnectEnabled;
|
|
20
|
+
const getChatReconnectContext = async (chatSDK, chatConfig, getAuthToken, reconnectId) => {
|
|
21
|
+
if (isReconnectEnabled(chatConfig)) {
|
|
17
22
|
try {
|
|
18
23
|
if (reconnectId) {
|
|
19
24
|
const chatReconnectOptionalParams = {
|
|
@@ -44,17 +49,16 @@ const getChatReconnectContext = async (chatSDK, chatConfig, getAuthToken, isReco
|
|
|
44
49
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
50
|
exports.getChatReconnectContext = getChatReconnectContext;
|
|
46
51
|
const getReconnectIdForAuthenticatedChat = async (props, chatSDK) => {
|
|
47
|
-
var _props$chatConfig
|
|
52
|
+
var _props$chatConfig;
|
|
48
53
|
let authClientFunction = undefined;
|
|
49
54
|
if ((_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && _props$chatConfig.LiveChatConfigAuthSettings) {
|
|
50
55
|
var _props$chatConfig2, _props$chatConfig2$Li;
|
|
51
56
|
authClientFunction = ((_props$chatConfig2 = props.chatConfig) === null || _props$chatConfig2 === void 0 ? void 0 : (_props$chatConfig2$Li = _props$chatConfig2.LiveChatConfigAuthSettings) === null || _props$chatConfig2$Li === void 0 ? void 0 : _props$chatConfig2$Li.msdyn_javascriptclientfunction) ?? undefined;
|
|
52
57
|
}
|
|
53
|
-
if ((
|
|
58
|
+
if (isReconnectEnabled(props.chatConfig) && authClientFunction
|
|
54
59
|
// TODO: Implement this after storage is in place
|
|
55
60
|
/* && !isLoadWithState() */) {
|
|
56
|
-
|
|
57
|
-
const previousActiveSessionResponse = await getChatReconnectContext(chatSDK, props.chatConfig, props.getAuthToken, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.isReconnectEnabled);
|
|
61
|
+
const previousActiveSessionResponse = await getChatReconnectContext(chatSDK, props.chatConfig, props.getAuthToken);
|
|
58
62
|
if (previousActiveSessionResponse && previousActiveSessionResponse.reconnectId) {
|
|
59
63
|
return previousActiveSessionResponse.reconnectId;
|
|
60
64
|
}
|
|
@@ -64,8 +68,8 @@ const getReconnectIdForAuthenticatedChat = async (props, chatSDK) => {
|
|
|
64
68
|
|
|
65
69
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
70
|
exports.getReconnectIdForAuthenticatedChat = getReconnectIdForAuthenticatedChat;
|
|
67
|
-
const handleUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter,
|
|
68
|
-
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken,
|
|
71
|
+
const handleUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, reconnectId, initStartChat, redirectInSameWindow) => {
|
|
72
|
+
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken, reconnectId);
|
|
69
73
|
if (shouldRedirectOrStartNewChat(reconnectAvailabilityResponse)) {
|
|
70
74
|
await redirectOrStartNewChat(reconnectAvailabilityResponse, chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat, redirectInSameWindow);
|
|
71
75
|
} else {
|
|
@@ -75,8 +79,8 @@ const handleUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthTo
|
|
|
75
79
|
|
|
76
80
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
81
|
exports.handleUnauthenticatedReconnectChat = handleUnauthenticatedReconnectChat;
|
|
78
|
-
const startUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter,
|
|
79
|
-
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken,
|
|
82
|
+
const startUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, reconnectId, initStartChat) => {
|
|
83
|
+
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken, reconnectId);
|
|
80
84
|
if (!shouldRedirectOrStartNewChat(reconnectAvailabilityResponse)) {
|
|
81
85
|
await setReconnectIdAndStartChat(chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, reconnectId, initStartChat);
|
|
82
86
|
}
|
|
@@ -146,8 +150,8 @@ const startNewChatEmptyRedirectionUrl = async (chatSDK, chatConfig, getAuthToken
|
|
|
146
150
|
};
|
|
147
151
|
|
|
148
152
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
149
|
-
const handleRedirectUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat,
|
|
150
|
-
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken,
|
|
153
|
+
const handleRedirectUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat, reconnectId, redirectInSameWindow) => {
|
|
154
|
+
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken, reconnectId);
|
|
151
155
|
if (shouldRedirectOrStartNewChat(reconnectAvailabilityResponse)) {
|
|
152
156
|
await redirectOrStartNewChat(reconnectAvailabilityResponse, chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat, redirectInSameWindow);
|
|
153
157
|
}
|
|
@@ -39,8 +39,8 @@ const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) =>
|
|
|
39
39
|
|
|
40
40
|
// Redirecting if unauthenticated reconnect chat expired
|
|
41
41
|
if ((_props$reconnectChatP = props.reconnectChatPaneProps) !== null && _props$reconnectChatP !== void 0 && _props$reconnectChatP.reconnectId) {
|
|
42
|
-
var _props$reconnectChatP2, _props$reconnectChatP3
|
|
43
|
-
await (0, _reconnectChatHelper.handleRedirectUnauthenticatedReconnectChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, initStartChat, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.
|
|
42
|
+
var _props$reconnectChatP2, _props$reconnectChatP3;
|
|
43
|
+
await (0, _reconnectChatHelper.handleRedirectUnauthenticatedReconnectChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, initStartChat, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.reconnectId, (_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.redirectInSameWindow);
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -174,7 +174,7 @@ const initStartChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAda
|
|
|
174
174
|
});
|
|
175
175
|
|
|
176
176
|
// Set post chat context in state, no survey load
|
|
177
|
-
|
|
177
|
+
(0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch);
|
|
178
178
|
|
|
179
179
|
// Updating chat session detail for telemetry
|
|
180
180
|
await (0, _updateSessionDataForTelemetry.updateSessionDataForTelemetry)(chatSDK, dispatch);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -49,6 +49,7 @@ var _useChatSDKStore = _interopRequireDefault(require("../../../hooks/useChatSDK
|
|
|
49
49
|
var _ActivityStreamHandler = require("../common/ActivityStreamHandler");
|
|
50
50
|
var _defaultCacheManager = require("../../../common/storage/default/defaultCacheManager");
|
|
51
51
|
var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
|
|
52
|
+
var _defaultScrollBarProps = require("../common/defaultProps/defaultScrollBarProps");
|
|
52
53
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
53
54
|
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); }
|
|
54
55
|
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; }
|
|
@@ -75,6 +76,9 @@ const LiveChatWidgetStateful = props => {
|
|
|
75
76
|
const generalStyles = {
|
|
76
77
|
root: Object.assign({}, (0, _getGeneralStylesForButton.getGeneralStylesForButton)(state), (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyles)
|
|
77
78
|
};
|
|
79
|
+
|
|
80
|
+
//Scrollbar styles
|
|
81
|
+
const scrollbarProps = Object.assign({}, _defaultScrollBarProps.defaultScrollBarProps, props === null || props === void 0 ? void 0 : props.scrollBarProps);
|
|
78
82
|
const broadcastServiceChannelName = (0, _utils.getBroadcastChannelName)(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC === void 0 ? void 0 : _chatSDK$omnichannelC.widgetId, ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
|
|
79
83
|
(0, _omnichannelChatComponents.BroadcastServiceInitialize)(broadcastServiceChannelName);
|
|
80
84
|
_TelemetryManager.TelemetryTimers.LcwLoadToChatButtonTimer = (0, _utils.createTimer)();
|
|
@@ -101,7 +105,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
101
105
|
});
|
|
102
106
|
};
|
|
103
107
|
(0, _react2.useEffect)(() => {
|
|
104
|
-
var _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps8, _props$chatConfig, _props$chatConfig$Cha, _props$controlProps9, _props$reconnectChatP, _props$chatConfig2, _props$chatConfig2$Li,
|
|
108
|
+
var _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps8, _props$chatConfig, _props$chatConfig$Cha, _props$controlProps9, _props$reconnectChatP, _props$chatConfig2, _props$chatConfig2$Li, _state$domainStates;
|
|
105
109
|
// Add default localStorage support for widget
|
|
106
110
|
if (props.contextDataStore === undefined) {
|
|
107
111
|
var _chatSDK$omnichannelC2, _chatSDK$omnichannelC3, _props$controlProps3;
|
|
@@ -145,8 +149,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
145
149
|
payload: globalDir
|
|
146
150
|
});
|
|
147
151
|
if (!((_props$controlProps9 = props.controlProps) !== null && _props$controlProps9 !== void 0 && _props$controlProps9.skipChatButtonRendering) && (_props$reconnectChatP = props.reconnectChatPaneProps) !== null && _props$reconnectChatP !== void 0 && _props$reconnectChatP.reconnectId) {
|
|
148
|
-
var _props$reconnectChatP2
|
|
149
|
-
(0, _reconnectChatHelper.startUnauthenticatedReconnectChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.
|
|
152
|
+
var _props$reconnectChatP2;
|
|
153
|
+
(0, _reconnectChatHelper.startUnauthenticatedReconnectChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.reconnectId, _startChat.initStartChat);
|
|
150
154
|
return;
|
|
151
155
|
}
|
|
152
156
|
|
|
@@ -154,7 +158,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
154
158
|
// where customer can choose to continue previous conversation or start new conversation
|
|
155
159
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
160
|
const isAuthenticationSettingsEnabled = (_props$chatConfig2 = props.chatConfig) !== null && _props$chatConfig2 !== void 0 && (_props$chatConfig2$Li = _props$chatConfig2.LiveChatConfigAuthSettings) !== null && _props$chatConfig2$Li !== void 0 && _props$chatConfig2$Li.msdyn_javascriptclientfunction ? true : false;
|
|
157
|
-
if (!state.appStates.skipChatButtonRendering && state.appStates.conversationState === _ConversationState.ConversationState.Active && isAuthenticationSettingsEnabled === true && (
|
|
161
|
+
if (!state.appStates.skipChatButtonRendering && state.appStates.conversationState === _ConversationState.ConversationState.Active && isAuthenticationSettingsEnabled === true && (0, _reconnectChatHelper.isReconnectEnabled)(props.chatConfig)) {
|
|
158
162
|
(0, _reconnectChatHelper.getReconnectIdForAuthenticatedChat)(props, chatSDK).then(authReconnectId => {
|
|
159
163
|
if (authReconnectId && !state.appStates.reconnectId) {
|
|
160
164
|
dispatch({
|
|
@@ -188,13 +192,13 @@ const LiveChatWidgetStateful = props => {
|
|
|
188
192
|
// useEffect for when skip chat button rendering
|
|
189
193
|
(0, _react2.useEffect)(() => {
|
|
190
194
|
if (state.appStates.skipChatButtonRendering) {
|
|
191
|
-
var _props$
|
|
195
|
+
var _props$reconnectChatP3;
|
|
192
196
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
193
197
|
eventName: _TelemetryConstants.BroadcastEvent.ChatInitiated
|
|
194
198
|
});
|
|
195
|
-
if ((_props$
|
|
196
|
-
var _props$
|
|
197
|
-
(0, _reconnectChatHelper.handleUnauthenticatedReconnectChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$
|
|
199
|
+
if ((_props$reconnectChatP3 = props.reconnectChatPaneProps) !== null && _props$reconnectChatP3 !== void 0 && _props$reconnectChatP3.reconnectId && !state.appStates.reconnectId) {
|
|
200
|
+
var _props$reconnectChatP4, _props$reconnectChatP5;
|
|
201
|
+
(0, _reconnectChatHelper.handleUnauthenticatedReconnectChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$reconnectChatP4 = props.reconnectChatPaneProps) === null || _props$reconnectChatP4 === void 0 ? void 0 : _props$reconnectChatP4.reconnectId, _startChat.initStartChat, (_props$reconnectChatP5 = props.reconnectChatPaneProps) === null || _props$reconnectChatP5 === void 0 ? void 0 : _props$reconnectChatP5.redirectInSameWindow);
|
|
198
202
|
} else {
|
|
199
203
|
(0, _reconnectChatHelper.getReconnectIdForAuthenticatedChat)(props, chatSDK).then(authReconnectId => {
|
|
200
204
|
if (authReconnectId && !state.appStates.reconnectId) {
|
|
@@ -345,6 +349,26 @@ const LiveChatWidgetStateful = props => {
|
|
|
345
349
|
payload: msg === null || msg === void 0 ? void 0 : msg.payload
|
|
346
350
|
});
|
|
347
351
|
});
|
|
352
|
+
|
|
353
|
+
// Reset state variables
|
|
354
|
+
_omnichannelChatComponents.BroadcastService.getMessageByEventName(_TelemetryConstants.BroadcastEvent.RaiseErrorEvent).subscribe(() => {
|
|
355
|
+
dispatch({
|
|
356
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONFIG,
|
|
357
|
+
payload: undefined
|
|
358
|
+
});
|
|
359
|
+
dispatch({
|
|
360
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
|
|
361
|
+
payload: undefined
|
|
362
|
+
});
|
|
363
|
+
dispatch({
|
|
364
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
365
|
+
payload: undefined
|
|
366
|
+
});
|
|
367
|
+
dispatch({
|
|
368
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
369
|
+
payload: undefined
|
|
370
|
+
});
|
|
371
|
+
});
|
|
348
372
|
return () => {
|
|
349
373
|
(0, _disposeTelemetryLoggers.disposeTelemetryLoggers)();
|
|
350
374
|
};
|
|
@@ -449,7 +473,24 @@ const LiveChatWidgetStateful = props => {
|
|
|
449
473
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
450
474
|
const initStartChatRelay = (optionalParams, persistedState) => (0, _startChat.initStartChat)(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, optionalParams, persistedState);
|
|
451
475
|
const confirmationPaneProps = (0, _initConfirmationPropsComposer.initConfirmationPropsComposer)(props);
|
|
452
|
-
return /*#__PURE__*/_react2.default.createElement(
|
|
476
|
+
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
477
|
+
::-webkit-scrollbar {
|
|
478
|
+
width: ${scrollbarProps.width};
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
::-webkit-scrollbar-track {
|
|
482
|
+
background: ${scrollbarProps.trackBackgroundColor};
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
::-webkit-scrollbar-thumb {
|
|
486
|
+
background: ${scrollbarProps.thumbBackgroundColor};
|
|
487
|
+
border-radius: ${scrollbarProps.thumbBorderRadius};
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
::-webkit-scrollbar-thumb:hover {
|
|
491
|
+
background: ${scrollbarProps.thumbHoverColor};
|
|
492
|
+
}
|
|
493
|
+
`), /*#__PURE__*/_react2.default.createElement(Composer, _extends({}, webChatProps, {
|
|
453
494
|
styleOptions: webChatStyles,
|
|
454
495
|
directLine: ((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.directLine) ?? adapter ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.directLine
|
|
455
496
|
}), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
@@ -478,7 +519,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
478
519
|
}, props.callingContainerProps)), !((_props$controlProps23 = props.controlProps) !== null && _props$controlProps23 !== void 0 && _props$controlProps23.hideWebChatContainer) && (0, _componentController.shouldShowWebChatContainer)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr8 = props.componentOverrides) === null || _props$componentOverr8 === void 0 ? void 0 : _props$componentOverr8.webChatContainer) || /*#__PURE__*/_react2.default.createElement(_WebChatContainerStateful.default, props.webChatContainerProps)), !((_props$controlProps24 = props.controlProps) !== null && _props$controlProps24 !== void 0 && _props$controlProps24.hideConfirmationPane) && (0, _componentController.shouldShowConfirmationPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr9 = props.componentOverrides) === null || _props$componentOverr9 === void 0 ? void 0 : _props$componentOverr9.confirmationPane) || /*#__PURE__*/_react2.default.createElement(_ConfirmationPaneStateful.default, _extends({}, confirmationPaneProps, {
|
|
479
520
|
setPostChatContext: setPostChatContextRelay,
|
|
480
521
|
prepareEndChat: prepareEndChatRelay
|
|
481
|
-
}))), !((_props$controlProps25 = props.controlProps) !== null && _props$controlProps25 !== void 0 && _props$controlProps25.hidePostChatLoadingPane) && (0, _componentController.shouldShowPostChatLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr10 = props.componentOverrides) === null || _props$componentOverr10 === void 0 ? void 0 : _props$componentOverr10.postChatLoadingPane) || /*#__PURE__*/_react2.default.createElement(_PostChatLoadingPaneStateful.default, props.postChatLoadingPaneProps)), (0, _componentController.shouldShowPostChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr11 = props.componentOverrides) === null || _props$componentOverr11 === void 0 ? void 0 : _props$componentOverr11.postChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PostChatSurveyPaneStateful.default, _extends({}, props.postChatSurveyPaneProps, props.chatSDK))), (0, _createFooter.createFooter)(props, state), (0, _componentController.shouldShowEmailTranscriptPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr12 = props.componentOverrides) === null || _props$componentOverr12 === void 0 ? void 0 : _props$componentOverr12.emailTranscriptPane) || /*#__PURE__*/_react2.default.createElement(_EmailTranscriptPaneStateful.default, props.emailTranscriptPane))));
|
|
522
|
+
}))), !((_props$controlProps25 = props.controlProps) !== null && _props$controlProps25 !== void 0 && _props$controlProps25.hidePostChatLoadingPane) && (0, _componentController.shouldShowPostChatLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr10 = props.componentOverrides) === null || _props$componentOverr10 === void 0 ? void 0 : _props$componentOverr10.postChatLoadingPane) || /*#__PURE__*/_react2.default.createElement(_PostChatLoadingPaneStateful.default, props.postChatLoadingPaneProps)), (0, _componentController.shouldShowPostChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr11 = props.componentOverrides) === null || _props$componentOverr11 === void 0 ? void 0 : _props$componentOverr11.postChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PostChatSurveyPaneStateful.default, _extends({}, props.postChatSurveyPaneProps, props.chatSDK))), (0, _createFooter.createFooter)(props, state), (0, _componentController.shouldShowEmailTranscriptPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_props$componentOverr12 = props.componentOverrides) === null || _props$componentOverr12 === void 0 ? void 0 : _props$componentOverr12.emailTranscriptPane) || /*#__PURE__*/_react2.default.createElement(_EmailTranscriptPaneStateful.default, props.emailTranscriptPane)))));
|
|
482
523
|
};
|
|
483
524
|
exports.LiveChatWidgetStateful = LiveChatWidgetStateful;
|
|
484
525
|
var _default = LiveChatWidgetStateful;
|
|
@@ -28,6 +28,7 @@ const applyDataMasking = (action, regexCollection) => {
|
|
|
28
28
|
});
|
|
29
29
|
return action;
|
|
30
30
|
}
|
|
31
|
+
let isRuleMatched = false;
|
|
31
32
|
for (const ruleId of Object.keys(regexCollection)) {
|
|
32
33
|
const item = regexCollection[ruleId];
|
|
33
34
|
if (item) {
|
|
@@ -38,10 +39,15 @@ const applyDataMasking = (action, regexCollection) => {
|
|
|
38
39
|
while (match = regex.exec(text)) {
|
|
39
40
|
const replaceStr = match[0].replace(/./gi, maskedChar);
|
|
40
41
|
text = text.replace(match[0], replaceStr);
|
|
42
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
43
|
+
Event: _TelemetryConstants.TelemetryEvent.DataMaskingRuleApplied,
|
|
44
|
+
Description: `Data Masking Rule Id: ${ruleId} applied.`
|
|
45
|
+
});
|
|
46
|
+
isRuleMatched = true;
|
|
41
47
|
}
|
|
42
48
|
} catch (err) {
|
|
43
49
|
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
44
|
-
Event: _TelemetryConstants.TelemetryEvent.
|
|
50
|
+
Event: _TelemetryConstants.TelemetryEvent.DataMaskingRuleApplyFailed,
|
|
45
51
|
ExceptionDetails: {
|
|
46
52
|
RuleId: ruleId,
|
|
47
53
|
Exception: err
|
|
@@ -49,6 +55,10 @@ const applyDataMasking = (action, regexCollection) => {
|
|
|
49
55
|
});
|
|
50
56
|
}
|
|
51
57
|
}
|
|
58
|
+
// Exit if rule matched
|
|
59
|
+
if (isRuleMatched === true) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
52
62
|
}
|
|
53
63
|
action.payload.text = text;
|
|
54
64
|
return action;
|
|
@@ -41,4 +41,5 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
41
41
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 31] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
42
42
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 32] = "SET_WIDGET_SIZE";
|
|
43
43
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 33] = "SET_WIDGET_INSTANCE_ID";
|
|
44
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 34] = "SET_LIVE_CHAT_CONFIG";
|
|
44
45
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -282,6 +282,15 @@ const createReducer = () => {
|
|
|
282
282
|
widgetInstanceId: action.payload
|
|
283
283
|
}
|
|
284
284
|
};
|
|
285
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONFIG:
|
|
286
|
+
return {
|
|
287
|
+
...state,
|
|
288
|
+
domainStates: {
|
|
289
|
+
...state.domainStates,
|
|
290
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
291
|
+
liveChatConfig: action.payload
|
|
292
|
+
}
|
|
293
|
+
};
|
|
285
294
|
default:
|
|
286
295
|
return state;
|
|
287
296
|
}
|
|
@@ -49,6 +49,7 @@ export let BroadcastEvent;
|
|
|
49
49
|
BroadcastEvent["CloseChat"] = "CloseChat";
|
|
50
50
|
BroadcastEvent["InitiateEndChatOnBrowserUnload"] = "InitiateEndChatOnBrowserUnload";
|
|
51
51
|
BroadcastEvent["ClosePopoutWindow"] = "ClosePopoutWindow";
|
|
52
|
+
BroadcastEvent["RaiseErrorEvent"] = "RaiseErrorEvent";
|
|
52
53
|
})(BroadcastEvent || (BroadcastEvent = {}));
|
|
53
54
|
export let TelemetryEvent;
|
|
54
55
|
(function (TelemetryEvent) {
|
|
@@ -60,8 +61,8 @@ export let TelemetryEvent;
|
|
|
60
61
|
TelemetryEvent["CallDisconnected"] = "CallDisconnected";
|
|
61
62
|
TelemetryEvent["CallDisconnectedException"] = "CallDisconnectedException";
|
|
62
63
|
TelemetryEvent["IncomingCallEnded"] = "incomingCallEnded";
|
|
63
|
-
TelemetryEvent["
|
|
64
|
-
TelemetryEvent["
|
|
64
|
+
TelemetryEvent["VoiceVideoSdkInitialize"] = "VoiceVideoSdkInitialize";
|
|
65
|
+
TelemetryEvent["VoiceVideoSdkInitializeException"] = "VoiceVideoSdkInitializeException";
|
|
65
66
|
TelemetryEvent["VoiceVideoLoading"] = "VoiceVideoLoading";
|
|
66
67
|
TelemetryEvent["VoiceVideoNotLoaded"] = "VoiceVideoNotLoaded";
|
|
67
68
|
TelemetryEvent["VoiceVideoLoadingException"] = "VoiceVideoLoadingException";
|
|
@@ -142,6 +143,7 @@ export let TelemetryEvent;
|
|
|
142
143
|
TelemetryEvent["QueuePositionMessageRecieved"] = "QueuePositionMessageRecieved";
|
|
143
144
|
TelemetryEvent["AverageWaitTimeMessageRecieved"] = "AverageWaitTimeMessageRecieved";
|
|
144
145
|
TelemetryEvent["DataMaskingRuleApplied"] = "DataMaskingRuleApplied";
|
|
146
|
+
TelemetryEvent["DataMaskingRuleApplyFailed"] = "DataMaskingRuleApplyFailed";
|
|
145
147
|
TelemetryEvent["IC3ClientEvent"] = "IC3ClientEvent";
|
|
146
148
|
TelemetryEvent["ConversationEndedThreadEventReceived"] = "ConversationEndedThreadEventReceived";
|
|
147
149
|
TelemetryEvent["InvalidConfiguration"] = "InvalidConfiguration";
|
|
@@ -244,8 +246,8 @@ export class TelemetryConstants {
|
|
|
244
246
|
case TelemetryEvent.CallDisconnected:
|
|
245
247
|
case TelemetryEvent.CallDisconnectedException:
|
|
246
248
|
case TelemetryEvent.IncomingCallEnded:
|
|
247
|
-
case TelemetryEvent.
|
|
248
|
-
case TelemetryEvent.
|
|
249
|
+
case TelemetryEvent.VoiceVideoSdkInitialize:
|
|
250
|
+
case TelemetryEvent.VoiceVideoSdkInitializeException:
|
|
249
251
|
case TelemetryEvent.VoiceVideoLoading:
|
|
250
252
|
case TelemetryEvent.VoiceVideoNotLoaded:
|
|
251
253
|
case TelemetryEvent.VoiceVideoLoadingException:
|
|
@@ -53,6 +53,7 @@ export class TelemetryHelper {
|
|
|
53
53
|
event.ActionType = payload.ActionType;
|
|
54
54
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
55
55
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
56
|
+
event.Description = payload.Description;
|
|
56
57
|
});
|
|
57
58
|
}
|
|
58
59
|
static conformToWebChatContract(level, input) {
|
|
@@ -78,6 +79,7 @@ export class TelemetryHelper {
|
|
|
78
79
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
79
80
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
80
81
|
event.Language = ((_TelemetryManager$Int10 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int10 === void 0 ? void 0 : _TelemetryManager$Int10.chatWidgetLocaleLCID) || "";
|
|
82
|
+
event.Description = payload.Data;
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
static conformToLoadContract(level, input) {
|
|
@@ -58,7 +58,7 @@ export const CallingContainerStateful = props => {
|
|
|
58
58
|
});
|
|
59
59
|
} catch (e) {
|
|
60
60
|
TelemetryHelper.logCallingEvent(LogLevel.ERROR, {
|
|
61
|
-
Event: TelemetryEvent.
|
|
61
|
+
Event: TelemetryEvent.VoiceVideoSdkInitializeException,
|
|
62
62
|
Description: `Failed to initialize VideoVoiceCalling Sdk: ${e}`
|
|
63
63
|
});
|
|
64
64
|
}
|
|
@@ -66,7 +66,7 @@ export const CallingContainerStateful = props => {
|
|
|
66
66
|
init().then(() => {
|
|
67
67
|
if (voiceVideoCallingSdk) {
|
|
68
68
|
TelemetryHelper.logCallingEvent(LogLevel.INFO, {
|
|
69
|
-
Event: TelemetryEvent.
|
|
69
|
+
Event: TelemetryEvent.VoiceVideoSdkInitialize,
|
|
70
70
|
Description: "Initialize VideoVoiceCalling Sdk Success"
|
|
71
71
|
}, callId);
|
|
72
72
|
voiceVideoCallingSdk.onCallAdded(() => {
|
|
@@ -5,10 +5,13 @@ import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
|
5
5
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
6
6
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
7
7
|
import { handleAuthentication, removeAuthTokenProvider } from "./authHelper";
|
|
8
|
+
const isReconnectEnabled = chatConfig => {
|
|
9
|
+
return chatConfig && chatConfig.LiveWSAndLiveChatEngJoin.msdyn_enablechatreconnect && (chatConfig.LiveWSAndLiveChatEngJoin.msdyn_enablechatreconnect === "true" || chatConfig.LiveWSAndLiveChatEngJoin.msdyn_enablechatreconnect === true);
|
|
10
|
+
};
|
|
8
11
|
|
|
9
12
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
-
const getChatReconnectContext = async (chatSDK, chatConfig, getAuthToken,
|
|
11
|
-
if (isReconnectEnabled) {
|
|
13
|
+
const getChatReconnectContext = async (chatSDK, chatConfig, getAuthToken, reconnectId) => {
|
|
14
|
+
if (isReconnectEnabled(chatConfig)) {
|
|
12
15
|
try {
|
|
13
16
|
if (reconnectId) {
|
|
14
17
|
const chatReconnectOptionalParams = {
|
|
@@ -38,17 +41,16 @@ const getChatReconnectContext = async (chatSDK, chatConfig, getAuthToken, isReco
|
|
|
38
41
|
|
|
39
42
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
43
|
const getReconnectIdForAuthenticatedChat = async (props, chatSDK) => {
|
|
41
|
-
var _props$chatConfig
|
|
44
|
+
var _props$chatConfig;
|
|
42
45
|
let authClientFunction = undefined;
|
|
43
46
|
if ((_props$chatConfig = props.chatConfig) !== null && _props$chatConfig !== void 0 && _props$chatConfig.LiveChatConfigAuthSettings) {
|
|
44
47
|
var _props$chatConfig2, _props$chatConfig2$Li;
|
|
45
48
|
authClientFunction = ((_props$chatConfig2 = props.chatConfig) === null || _props$chatConfig2 === void 0 ? void 0 : (_props$chatConfig2$Li = _props$chatConfig2.LiveChatConfigAuthSettings) === null || _props$chatConfig2$Li === void 0 ? void 0 : _props$chatConfig2$Li.msdyn_javascriptclientfunction) ?? undefined;
|
|
46
49
|
}
|
|
47
|
-
if ((
|
|
50
|
+
if (isReconnectEnabled(props.chatConfig) && authClientFunction
|
|
48
51
|
// TODO: Implement this after storage is in place
|
|
49
52
|
/* && !isLoadWithState() */) {
|
|
50
|
-
|
|
51
|
-
const previousActiveSessionResponse = await getChatReconnectContext(chatSDK, props.chatConfig, props.getAuthToken, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.isReconnectEnabled);
|
|
53
|
+
const previousActiveSessionResponse = await getChatReconnectContext(chatSDK, props.chatConfig, props.getAuthToken);
|
|
52
54
|
if (previousActiveSessionResponse && previousActiveSessionResponse.reconnectId) {
|
|
53
55
|
return previousActiveSessionResponse.reconnectId;
|
|
54
56
|
}
|
|
@@ -57,8 +59,8 @@ const getReconnectIdForAuthenticatedChat = async (props, chatSDK) => {
|
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
-
const handleUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter,
|
|
61
|
-
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken,
|
|
62
|
+
const handleUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, reconnectId, initStartChat, redirectInSameWindow) => {
|
|
63
|
+
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken, reconnectId);
|
|
62
64
|
if (shouldRedirectOrStartNewChat(reconnectAvailabilityResponse)) {
|
|
63
65
|
await redirectOrStartNewChat(reconnectAvailabilityResponse, chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat, redirectInSameWindow);
|
|
64
66
|
} else {
|
|
@@ -67,8 +69,8 @@ const handleUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthTo
|
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
70
|
-
const startUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter,
|
|
71
|
-
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken,
|
|
72
|
+
const startUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, reconnectId, initStartChat) => {
|
|
73
|
+
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken, reconnectId);
|
|
72
74
|
if (!shouldRedirectOrStartNewChat(reconnectAvailabilityResponse)) {
|
|
73
75
|
await setReconnectIdAndStartChat(chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, reconnectId, initStartChat);
|
|
74
76
|
}
|
|
@@ -137,8 +139,8 @@ const startNewChatEmptyRedirectionUrl = async (chatSDK, chatConfig, getAuthToken
|
|
|
137
139
|
};
|
|
138
140
|
|
|
139
141
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
|
-
const handleRedirectUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat,
|
|
141
|
-
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken,
|
|
142
|
+
const handleRedirectUnauthenticatedReconnectChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat, reconnectId, redirectInSameWindow) => {
|
|
143
|
+
const reconnectAvailabilityResponse = await getChatReconnectContext(chatSDK, chatConfig, getAuthToken, reconnectId);
|
|
142
144
|
if (shouldRedirectOrStartNewChat(reconnectAvailabilityResponse)) {
|
|
143
145
|
await redirectOrStartNewChat(reconnectAvailabilityResponse, chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat, redirectInSameWindow);
|
|
144
146
|
}
|
|
@@ -152,4 +154,4 @@ const redirectOrStartNewChat = async (reconnectAvailabilityResponse, chatSDK, ch
|
|
|
152
154
|
await startNewChatEmptyRedirectionUrl(chatSDK, chatConfig, getAuthToken, dispatch, setAdapter, initStartChat);
|
|
153
155
|
}
|
|
154
156
|
};
|
|
155
|
-
export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
|
|
157
|
+
export { isReconnectEnabled, getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
|
|
@@ -34,8 +34,8 @@ const prepareStartChat = async (props, chatSDK, state, dispatch, setAdapter) =>
|
|
|
34
34
|
|
|
35
35
|
// Redirecting if unauthenticated reconnect chat expired
|
|
36
36
|
if ((_props$reconnectChatP = props.reconnectChatPaneProps) !== null && _props$reconnectChatP !== void 0 && _props$reconnectChatP.reconnectId) {
|
|
37
|
-
var _props$reconnectChatP2, _props$reconnectChatP3
|
|
38
|
-
await handleRedirectUnauthenticatedReconnectChat(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, initStartChat, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.
|
|
37
|
+
var _props$reconnectChatP2, _props$reconnectChatP3;
|
|
38
|
+
await handleRedirectUnauthenticatedReconnectChat(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, initStartChat, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.reconnectId, (_props$reconnectChatP3 = props.reconnectChatPaneProps) === null || _props$reconnectChatP3 === void 0 ? void 0 : _props$reconnectChatP3.redirectInSameWindow);
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
41
|
|
|
@@ -167,7 +167,7 @@ const initStartChat = async (chatSDK, chatConfig, getAuthToken, dispatch, setAda
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
// Set post chat context in state, no survey load
|
|
170
|
-
|
|
170
|
+
setPostChatContextAndLoadSurvey(chatSDK, dispatch);
|
|
171
171
|
|
|
172
172
|
// Updating chat session detail for telemetry
|
|
173
173
|
await updateSessionDataForTelemetry(chatSDK, dispatch);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import { BroadcastService, decodeComponentString, BroadcastServiceInitialize } f
|
|
|
4
4
|
import { Stack } from "@fluentui/react";
|
|
5
5
|
import React, { useEffect, useRef, useState } from "react";
|
|
6
6
|
import { createTimer, getBroadcastChannelName, getLocaleDirection, getStateFromCache, getWidgetCacheId, getWidgetEndChatEventName, isNullOrEmptyString, isUndefinedOrEmpty } from "../../../common/utils";
|
|
7
|
-
import { getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat } from "../common/reconnectChatHelper";
|
|
7
|
+
import { getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, isReconnectEnabled, startUnauthenticatedReconnectChat } from "../common/reconnectChatHelper";
|
|
8
8
|
import { initStartChat, prepareStartChat, setPreChatAndInitiateChat } from "../common/startChat";
|
|
9
9
|
import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowWebChatContainer } from "../../../controller/componentController";
|
|
10
10
|
import CallingContainerStateful from "../../callingcontainerstateful/CallingContainerStateful";
|
|
@@ -45,6 +45,7 @@ import useChatSDKStore from "../../../hooks/useChatSDKStore";
|
|
|
45
45
|
import { ActivityStreamHandler } from "../common/ActivityStreamHandler";
|
|
46
46
|
import { registerBroadcastServiceForLocalStorage } from "../../../common/storage/default/defaultCacheManager";
|
|
47
47
|
import { defaultClientDataStoreProvider } from "../../../common/storage/default/defaultClientDataStoreProvider";
|
|
48
|
+
import { defaultScrollBarProps } from "../common/defaultProps/defaultScrollBarProps";
|
|
48
49
|
export const LiveChatWidgetStateful = props => {
|
|
49
50
|
var _props$webChatContain, _props$styleProps, _chatSDK$omnichannelC, _props$controlProps, _props$controlProps2, _props$webChatContain3, _props$webChatContain4, _props$styleProps2, _props$controlProps14, _props$controlProps15, _props$componentOverr, _props$controlProps16, _props$componentOverr2, _props$controlProps17, _props$componentOverr3, _props$controlProps18, _props$componentOverr4, _props$controlProps19, _props$componentOverr5, _props$controlProps20, _props$componentOverr6, _props$controlProps21, _props$componentOverr7, _props$controlProps22, _props$controlProps23, _props$componentOverr8, _props$controlProps24, _props$componentOverr9, _props$controlProps25, _props$componentOverr10, _props$componentOverr11, _props$componentOverr12;
|
|
50
51
|
const [state, dispatch] = useChatContextStore();
|
|
@@ -67,6 +68,9 @@ export const LiveChatWidgetStateful = props => {
|
|
|
67
68
|
const generalStyles = {
|
|
68
69
|
root: Object.assign({}, getGeneralStylesForButton(state), (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyles)
|
|
69
70
|
};
|
|
71
|
+
|
|
72
|
+
//Scrollbar styles
|
|
73
|
+
const scrollbarProps = Object.assign({}, defaultScrollBarProps, props === null || props === void 0 ? void 0 : props.scrollBarProps);
|
|
70
74
|
const broadcastServiceChannelName = getBroadcastChannelName(chatSDK === null || chatSDK === void 0 ? void 0 : (_chatSDK$omnichannelC = chatSDK.omnichannelConfig) === null || _chatSDK$omnichannelC === void 0 ? void 0 : _chatSDK$omnichannelC.widgetId, ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
|
|
71
75
|
BroadcastServiceInitialize(broadcastServiceChannelName);
|
|
72
76
|
TelemetryTimers.LcwLoadToChatButtonTimer = createTimer();
|
|
@@ -93,7 +97,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
93
97
|
});
|
|
94
98
|
};
|
|
95
99
|
useEffect(() => {
|
|
96
|
-
var _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps8, _props$chatConfig, _props$chatConfig$Cha, _props$controlProps9, _props$reconnectChatP, _props$chatConfig2, _props$chatConfig2$Li,
|
|
100
|
+
var _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps8, _props$chatConfig, _props$chatConfig$Cha, _props$controlProps9, _props$reconnectChatP, _props$chatConfig2, _props$chatConfig2$Li, _state$domainStates;
|
|
97
101
|
// Add default localStorage support for widget
|
|
98
102
|
if (props.contextDataStore === undefined) {
|
|
99
103
|
var _chatSDK$omnichannelC2, _chatSDK$omnichannelC3, _props$controlProps3;
|
|
@@ -137,8 +141,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
137
141
|
payload: globalDir
|
|
138
142
|
});
|
|
139
143
|
if (!((_props$controlProps9 = props.controlProps) !== null && _props$controlProps9 !== void 0 && _props$controlProps9.skipChatButtonRendering) && (_props$reconnectChatP = props.reconnectChatPaneProps) !== null && _props$reconnectChatP !== void 0 && _props$reconnectChatP.reconnectId) {
|
|
140
|
-
var _props$reconnectChatP2
|
|
141
|
-
startUnauthenticatedReconnectChat(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.
|
|
144
|
+
var _props$reconnectChatP2;
|
|
145
|
+
startUnauthenticatedReconnectChat(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$reconnectChatP2 = props.reconnectChatPaneProps) === null || _props$reconnectChatP2 === void 0 ? void 0 : _props$reconnectChatP2.reconnectId, initStartChat);
|
|
142
146
|
return;
|
|
143
147
|
}
|
|
144
148
|
|
|
@@ -146,7 +150,7 @@ export const LiveChatWidgetStateful = props => {
|
|
|
146
150
|
// where customer can choose to continue previous conversation or start new conversation
|
|
147
151
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
152
|
const isAuthenticationSettingsEnabled = (_props$chatConfig2 = props.chatConfig) !== null && _props$chatConfig2 !== void 0 && (_props$chatConfig2$Li = _props$chatConfig2.LiveChatConfigAuthSettings) !== null && _props$chatConfig2$Li !== void 0 && _props$chatConfig2$Li.msdyn_javascriptclientfunction ? true : false;
|
|
149
|
-
if (!state.appStates.skipChatButtonRendering && state.appStates.conversationState === ConversationState.Active && isAuthenticationSettingsEnabled === true && (
|
|
153
|
+
if (!state.appStates.skipChatButtonRendering && state.appStates.conversationState === ConversationState.Active && isAuthenticationSettingsEnabled === true && isReconnectEnabled(props.chatConfig)) {
|
|
150
154
|
getReconnectIdForAuthenticatedChat(props, chatSDK).then(authReconnectId => {
|
|
151
155
|
if (authReconnectId && !state.appStates.reconnectId) {
|
|
152
156
|
dispatch({
|
|
@@ -180,13 +184,13 @@ export const LiveChatWidgetStateful = props => {
|
|
|
180
184
|
// useEffect for when skip chat button rendering
|
|
181
185
|
useEffect(() => {
|
|
182
186
|
if (state.appStates.skipChatButtonRendering) {
|
|
183
|
-
var _props$
|
|
187
|
+
var _props$reconnectChatP3;
|
|
184
188
|
BroadcastService.postMessage({
|
|
185
189
|
eventName: BroadcastEvent.ChatInitiated
|
|
186
190
|
});
|
|
187
|
-
if ((_props$
|
|
188
|
-
var _props$
|
|
189
|
-
handleUnauthenticatedReconnectChat(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$
|
|
191
|
+
if ((_props$reconnectChatP3 = props.reconnectChatPaneProps) !== null && _props$reconnectChatP3 !== void 0 && _props$reconnectChatP3.reconnectId && !state.appStates.reconnectId) {
|
|
192
|
+
var _props$reconnectChatP4, _props$reconnectChatP5;
|
|
193
|
+
handleUnauthenticatedReconnectChat(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, (_props$reconnectChatP4 = props.reconnectChatPaneProps) === null || _props$reconnectChatP4 === void 0 ? void 0 : _props$reconnectChatP4.reconnectId, initStartChat, (_props$reconnectChatP5 = props.reconnectChatPaneProps) === null || _props$reconnectChatP5 === void 0 ? void 0 : _props$reconnectChatP5.redirectInSameWindow);
|
|
190
194
|
} else {
|
|
191
195
|
getReconnectIdForAuthenticatedChat(props, chatSDK).then(authReconnectId => {
|
|
192
196
|
if (authReconnectId && !state.appStates.reconnectId) {
|
|
@@ -337,6 +341,26 @@ export const LiveChatWidgetStateful = props => {
|
|
|
337
341
|
payload: msg === null || msg === void 0 ? void 0 : msg.payload
|
|
338
342
|
});
|
|
339
343
|
});
|
|
344
|
+
|
|
345
|
+
// Reset state variables
|
|
346
|
+
BroadcastService.getMessageByEventName(BroadcastEvent.RaiseErrorEvent).subscribe(() => {
|
|
347
|
+
dispatch({
|
|
348
|
+
type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONFIG,
|
|
349
|
+
payload: undefined
|
|
350
|
+
});
|
|
351
|
+
dispatch({
|
|
352
|
+
type: LiveChatWidgetActionType.SET_CUSTOM_CONTEXT,
|
|
353
|
+
payload: undefined
|
|
354
|
+
});
|
|
355
|
+
dispatch({
|
|
356
|
+
type: LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
357
|
+
payload: undefined
|
|
358
|
+
});
|
|
359
|
+
dispatch({
|
|
360
|
+
type: LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
361
|
+
payload: undefined
|
|
362
|
+
});
|
|
363
|
+
});
|
|
340
364
|
return () => {
|
|
341
365
|
disposeTelemetryLoggers();
|
|
342
366
|
};
|
|
@@ -441,7 +465,24 @@ export const LiveChatWidgetStateful = props => {
|
|
|
441
465
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
442
466
|
const initStartChatRelay = (optionalParams, persistedState) => initStartChat(chatSDK, props.chatConfig, props.getAuthToken, dispatch, setAdapter, optionalParams, persistedState);
|
|
443
467
|
const confirmationPaneProps = initConfirmationPropsComposer(props);
|
|
444
|
-
return /*#__PURE__*/React.createElement(
|
|
468
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
|
|
469
|
+
::-webkit-scrollbar {
|
|
470
|
+
width: ${scrollbarProps.width};
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
::-webkit-scrollbar-track {
|
|
474
|
+
background: ${scrollbarProps.trackBackgroundColor};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
::-webkit-scrollbar-thumb {
|
|
478
|
+
background: ${scrollbarProps.thumbBackgroundColor};
|
|
479
|
+
border-radius: ${scrollbarProps.thumbBorderRadius};
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
::-webkit-scrollbar-thumb:hover {
|
|
483
|
+
background: ${scrollbarProps.thumbHoverColor};
|
|
484
|
+
}
|
|
485
|
+
`), /*#__PURE__*/React.createElement(Composer, _extends({}, webChatProps, {
|
|
445
486
|
styleOptions: webChatStyles,
|
|
446
487
|
directLine: ((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : _props$webChatContain4.directLine) ?? adapter ?? defaultWebChatContainerStatefulProps.directLine
|
|
447
488
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
@@ -470,6 +511,6 @@ export const LiveChatWidgetStateful = props => {
|
|
|
470
511
|
}, props.callingContainerProps)), !((_props$controlProps23 = props.controlProps) !== null && _props$controlProps23 !== void 0 && _props$controlProps23.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_props$componentOverr8 = props.componentOverrides) === null || _props$componentOverr8 === void 0 ? void 0 : _props$componentOverr8.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, props.webChatContainerProps)), !((_props$controlProps24 = props.controlProps) !== null && _props$controlProps24 !== void 0 && _props$controlProps24.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_props$componentOverr9 = props.componentOverrides) === null || _props$componentOverr9 === void 0 ? void 0 : _props$componentOverr9.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
|
|
471
512
|
setPostChatContext: setPostChatContextRelay,
|
|
472
513
|
prepareEndChat: prepareEndChatRelay
|
|
473
|
-
}))), !((_props$controlProps25 = props.controlProps) !== null && _props$controlProps25 !== void 0 && _props$controlProps25.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_props$componentOverr10 = props.componentOverrides) === null || _props$componentOverr10 === void 0 ? void 0 : _props$componentOverr10.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, props.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_props$componentOverr11 = props.componentOverrides) === null || _props$componentOverr11 === void 0 ? void 0 : _props$componentOverr11.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, props.postChatSurveyPaneProps, props.chatSDK))), createFooter(props, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_props$componentOverr12 = props.componentOverrides) === null || _props$componentOverr12 === void 0 ? void 0 : _props$componentOverr12.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, props.emailTranscriptPane))));
|
|
514
|
+
}))), !((_props$controlProps25 = props.controlProps) !== null && _props$controlProps25 !== void 0 && _props$controlProps25.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_props$componentOverr10 = props.componentOverrides) === null || _props$componentOverr10 === void 0 ? void 0 : _props$componentOverr10.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, props.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_props$componentOverr11 = props.componentOverrides) === null || _props$componentOverr11 === void 0 ? void 0 : _props$componentOverr11.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, props.postChatSurveyPaneProps, props.chatSDK))), createFooter(props, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_props$componentOverr12 = props.componentOverrides) === null || _props$componentOverr12 === void 0 ? void 0 : _props$componentOverr12.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, props.emailTranscriptPane)))));
|
|
474
515
|
};
|
|
475
516
|
export default LiveChatWidgetStateful;
|
|
@@ -22,6 +22,7 @@ const applyDataMasking = (action, regexCollection) => {
|
|
|
22
22
|
});
|
|
23
23
|
return action;
|
|
24
24
|
}
|
|
25
|
+
let isRuleMatched = false;
|
|
25
26
|
for (const ruleId of Object.keys(regexCollection)) {
|
|
26
27
|
const item = regexCollection[ruleId];
|
|
27
28
|
if (item) {
|
|
@@ -32,10 +33,15 @@ const applyDataMasking = (action, regexCollection) => {
|
|
|
32
33
|
while (match = regex.exec(text)) {
|
|
33
34
|
const replaceStr = match[0].replace(/./gi, maskedChar);
|
|
34
35
|
text = text.replace(match[0], replaceStr);
|
|
36
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
37
|
+
Event: TelemetryEvent.DataMaskingRuleApplied,
|
|
38
|
+
Description: `Data Masking Rule Id: ${ruleId} applied.`
|
|
39
|
+
});
|
|
40
|
+
isRuleMatched = true;
|
|
35
41
|
}
|
|
36
42
|
} catch (err) {
|
|
37
43
|
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
38
|
-
Event: TelemetryEvent.
|
|
44
|
+
Event: TelemetryEvent.DataMaskingRuleApplyFailed,
|
|
39
45
|
ExceptionDetails: {
|
|
40
46
|
RuleId: ruleId,
|
|
41
47
|
Exception: err
|
|
@@ -43,6 +49,10 @@ const applyDataMasking = (action, regexCollection) => {
|
|
|
43
49
|
});
|
|
44
50
|
}
|
|
45
51
|
}
|
|
52
|
+
// Exit if rule matched
|
|
53
|
+
if (isRuleMatched === true) {
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
46
56
|
}
|
|
47
57
|
action.payload.text = text;
|
|
48
58
|
return action;
|
|
@@ -34,4 +34,5 @@ export let LiveChatWidgetActionType;
|
|
|
34
34
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 31] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
35
35
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 32] = "SET_WIDGET_SIZE";
|
|
36
36
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 33] = "SET_WIDGET_INSTANCE_ID";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 34] = "SET_LIVE_CHAT_CONFIG";
|
|
37
38
|
})(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
|
|
@@ -276,6 +276,15 @@ export const createReducer = () => {
|
|
|
276
276
|
widgetInstanceId: action.payload
|
|
277
277
|
}
|
|
278
278
|
};
|
|
279
|
+
case LiveChatWidgetActionType.SET_LIVE_CHAT_CONFIG:
|
|
280
|
+
return {
|
|
281
|
+
...state,
|
|
282
|
+
domainStates: {
|
|
283
|
+
...state.domainStates,
|
|
284
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
285
|
+
liveChatConfig: action.payload
|
|
286
|
+
}
|
|
287
|
+
};
|
|
279
288
|
default:
|
|
280
289
|
return state;
|
|
281
290
|
}
|
|
@@ -42,7 +42,8 @@ export declare enum BroadcastEvent {
|
|
|
42
42
|
ChatInitiated = "ChatInitiated",
|
|
43
43
|
CloseChat = "CloseChat",
|
|
44
44
|
InitiateEndChatOnBrowserUnload = "InitiateEndChatOnBrowserUnload",
|
|
45
|
-
ClosePopoutWindow = "ClosePopoutWindow"
|
|
45
|
+
ClosePopoutWindow = "ClosePopoutWindow",
|
|
46
|
+
RaiseErrorEvent = "RaiseErrorEvent"
|
|
46
47
|
}
|
|
47
48
|
export declare enum TelemetryEvent {
|
|
48
49
|
CallAdded = "CallAdded",
|
|
@@ -53,8 +54,8 @@ export declare enum TelemetryEvent {
|
|
|
53
54
|
CallDisconnected = "CallDisconnected",
|
|
54
55
|
CallDisconnectedException = "CallDisconnectedException",
|
|
55
56
|
IncomingCallEnded = "incomingCallEnded",
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
VoiceVideoSdkInitialize = "VoiceVideoSdkInitialize",
|
|
58
|
+
VoiceVideoSdkInitializeException = "VoiceVideoSdkInitializeException",
|
|
58
59
|
VoiceVideoLoading = "VoiceVideoLoading",
|
|
59
60
|
VoiceVideoNotLoaded = "VoiceVideoNotLoaded",
|
|
60
61
|
VoiceVideoLoadingException = "VoiceVideoLoadingException",
|
|
@@ -135,6 +136,7 @@ export declare enum TelemetryEvent {
|
|
|
135
136
|
QueuePositionMessageRecieved = "QueuePositionMessageRecieved",
|
|
136
137
|
AverageWaitTimeMessageRecieved = "AverageWaitTimeMessageRecieved",
|
|
137
138
|
DataMaskingRuleApplied = "DataMaskingRuleApplied",
|
|
139
|
+
DataMaskingRuleApplyFailed = "DataMaskingRuleApplyFailed",
|
|
138
140
|
IC3ClientEvent = "IC3ClientEvent",
|
|
139
141
|
ConversationEndedThreadEventReceived = "ConversationEndedThreadEventReceived",
|
|
140
142
|
InvalidConfiguration = "InvalidConfiguration",
|
|
@@ -7,8 +7,9 @@ export interface BaseContract {
|
|
|
7
7
|
OrganizationId: string;
|
|
8
8
|
LCWRuntimeId: string;
|
|
9
9
|
CurrentRequestId: string;
|
|
10
|
-
ExceptionDetails?:
|
|
10
|
+
ExceptionDetails?: any;
|
|
11
11
|
LogLevel: string;
|
|
12
|
+
Description?: string;
|
|
12
13
|
}
|
|
13
14
|
export interface ConfigValidationContract extends BaseContract {
|
|
14
15
|
Event?: string;
|
|
@@ -40,7 +41,6 @@ export interface IC3ClientContract extends BaseContract {
|
|
|
40
41
|
EndpointId?: string;
|
|
41
42
|
ErrorCode?: string;
|
|
42
43
|
ShouldBubbleToHost?: boolean;
|
|
43
|
-
Description?: string;
|
|
44
44
|
}
|
|
45
45
|
export interface OCChatSDKContract extends BaseContract {
|
|
46
46
|
RequestId: string;
|
|
@@ -58,7 +58,6 @@ export interface WebChatContract extends BaseContract {
|
|
|
58
58
|
export interface CallingContract extends BaseContract {
|
|
59
59
|
CallId?: string;
|
|
60
60
|
Event?: string;
|
|
61
|
-
Description?: string;
|
|
62
61
|
}
|
|
63
62
|
export interface ACSAdapterContract extends BaseContract {
|
|
64
63
|
Description?: string;
|
|
@@ -68,6 +67,5 @@ export interface ACSAdapterContract extends BaseContract {
|
|
|
68
67
|
TimeStamp?: string;
|
|
69
68
|
Event?: string;
|
|
70
69
|
ErrorCode?: string;
|
|
71
|
-
ExceptionDetails?: any;
|
|
72
70
|
}
|
|
73
71
|
export declare type TelemetryContract = OCChatSDKContract | IC3ClientContract | ActionsContract | LoadContract | WebChatContract | ConfigValidationContract | CallingContract | ACSAdapterContract | BaseContract | any;
|
|
@@ -3,9 +3,10 @@ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
|
3
3
|
import { Dispatch } from "react";
|
|
4
4
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
5
5
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
6
|
-
declare const
|
|
6
|
+
declare const isReconnectEnabled: (chatConfig: ChatConfig | undefined) => any;
|
|
7
|
+
declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, reconnectId?: string | undefined) => Promise<any>;
|
|
7
8
|
declare const getReconnectIdForAuthenticatedChat: (props: ILiveChatWidgetProps, chatSDK: any) => Promise<string | undefined>;
|
|
8
|
-
declare const handleUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any,
|
|
9
|
-
declare const startUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any,
|
|
10
|
-
declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any,
|
|
11
|
-
export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
|
|
9
|
+
declare const handleUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
10
|
+
declare const startUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any) => Promise<void>;
|
|
11
|
+
declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
12
|
+
export { isReconnectEnabled, getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
|
|
@@ -21,6 +21,7 @@ import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
|
|
|
21
21
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
22
22
|
import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
|
|
23
23
|
import { IPostChatSurveyPaneStatefulProps } from "../../postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps";
|
|
24
|
+
import { IScrollBarProps } from "./IScrollBarProps";
|
|
24
25
|
export interface ILiveChatWidgetProps {
|
|
25
26
|
audioNotificationProps?: IAudioNotificationProps;
|
|
26
27
|
callingContainerProps?: ICallingContainerProps;
|
|
@@ -50,4 +51,5 @@ export interface ILiveChatWidgetProps {
|
|
|
50
51
|
liveChatContextFromCache?: ILiveChatWidgetContext;
|
|
51
52
|
contextDataStore?: IContextDataStore;
|
|
52
53
|
getAuthToken?: (authClientFunction?: string) => Promise<string | null>;
|
|
54
|
+
scrollBarProps?: IScrollBarProps;
|
|
53
55
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IScrollBarProps {
|
|
2
|
+
/**
|
|
3
|
+
* Scrollbar width in px
|
|
4
|
+
*/
|
|
5
|
+
width?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Scrollbar track background color
|
|
8
|
+
*/
|
|
9
|
+
trackBackgroundColor?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Scrollbar thumb background color
|
|
12
|
+
*/
|
|
13
|
+
thumbBackgroundColor?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Scrollbar thumb border radius in px
|
|
16
|
+
*/
|
|
17
|
+
thumbBorderRadius?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Scrollbar thumb hover color
|
|
20
|
+
*/
|
|
21
|
+
thumbHoverColor?: string;
|
|
22
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IReconnectChatPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/reconnectchatpane/interfaces/IReconnectChatPaneProps";
|
|
2
2
|
export interface IReconnectChatPaneStatefulProps extends IReconnectChatPaneProps {
|
|
3
|
-
isReconnectEnabled?: boolean;
|
|
4
3
|
reconnectId?: string;
|
|
5
4
|
redirectInSameWindow?: boolean;
|
|
6
5
|
}
|