@carbon/ai-chat 0.1.1-alpha5 → 0.1.1-react17
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/dist/App.js +933 -55468
- package/dist/Carousel.js +1 -5705
- package/dist/Chat.js +1 -8339
- package/dist/GenesysMessengerServiceDesk.js +1 -579
- package/dist/HumanAgentServiceImpl.js +1 -1122
- package/dist/NiceDFOServiceDesk.js +2 -2097
- package/dist/PDFViewerContainer.js +2 -27439
- package/dist/SFServiceDesk.js +1 -1012
- package/dist/ServiceDeskImpl.js +1 -72
- package/dist/ZendeskServiceDesk.js +1 -649
- package/dist/_commonjsHelpers.js +1 -33
- package/dist/_node-resolve_empty.js +1 -25
- package/dist/agentActions.js +1 -187
- package/dist/aiChatEntry.js +1 -28
- package/dist/aiChatEntry2.js +4 -7022
- package/dist/anonymousUserIDStorage.js +2 -250
- package/dist/ar-dz.js +1 -55
- package/dist/ar-kw.js +1 -55
- package/dist/ar-ly.js +1 -55
- package/dist/ar-ma.js +1 -55
- package/dist/ar-sa.js +1 -55
- package/dist/ar-tn.js +1 -55
- package/dist/ar.js +1 -55
- package/dist/ar2.js +1 -470
- package/dist/cs.js +1 -55
- package/dist/cs2.js +1 -470
- package/dist/de-at.js +1 -55
- package/dist/de-ch.js +1 -55
- package/dist/de.js +1 -55
- package/dist/de2.js +1 -470
- package/dist/domUtils.js +2 -820
- package/dist/en-au.js +1 -55
- package/dist/en-ca.js +1 -55
- package/dist/en-gb.js +1 -55
- package/dist/en-ie.js +1 -55
- package/dist/en-il.js +1 -55
- package/dist/en-nz.js +1 -55
- package/dist/es-do.js +1 -55
- package/dist/es-us.js +1 -55
- package/dist/es.js +1 -55
- package/dist/es2.js +1 -470
- package/dist/export.js +1 -25
- package/dist/export.legacy.js +1 -25
- package/dist/fontUtils.js +1 -1036
- package/dist/fr-ca.js +1 -55
- package/dist/fr-ch.js +1 -55
- package/dist/fr.js +1 -55
- package/dist/fr2.js +1 -470
- package/dist/humanAgentUtils.js +1 -1393
- package/dist/it-ch.js +1 -55
- package/dist/it.js +1 -55
- package/dist/it2.js +1 -470
- package/dist/ja.js +1 -55
- package/dist/ja2.js +1 -470
- package/dist/jstz.min.js +1 -41
- package/dist/ko.js +1 -55
- package/dist/ko2.js +1 -470
- package/dist/messageUtils.js +1 -1338
- package/dist/mockServiceDesk.js +1 -851
- package/dist/moduleFederationPluginUtils.js +2 -5852
- package/dist/nl.js +1 -55
- package/dist/nl2.js +1 -470
- package/dist/pt-br.js +1 -55
- package/dist/pt-br2.js +1 -470
- package/dist/pt.js +1 -55
- package/dist/render.js +1 -88
- package/dist/web-components/cds-aichat-container/index.js +3 -3
- package/dist/web-components/cds-aichat-container/index.js.map +1 -1
- package/dist/web-components/cds-aichat-custom-element/index.js +2 -2
- package/dist/web-components/cds-aichat-custom-element/index.js.map +1 -1
- package/dist/zh-cn.js +1 -55
- package/dist/zh-tw.js +1 -55
- package/dist/zh-tw2.js +1 -470
- package/dist/zh.js +1 -470
- package/package.json +1 -1
package/dist/humanAgentUtils.js
CHANGED
|
@@ -1,1393 +1 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
(C) Copyright IBM Corp. 2017, 2024. All Rights Reserved.
|
|
5
|
-
|
|
6
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
7
|
-
in compliance with the License. You may obtain a copy of the License at
|
|
8
|
-
|
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
|
|
11
|
-
Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
12
|
-
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
13
|
-
or implied. See the License for the specific language governing permissions and limitations under
|
|
14
|
-
the License.
|
|
15
|
-
|
|
16
|
-
@carbon/ai-chat 0.1.1-alpha5
|
|
17
|
-
|
|
18
|
-
Built: Oct 24 2024 10:59 am -04:00
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
import { u as uuid, U as UUIDType, p as MessageResponseTypes, c as consoleError, k as deepFreeze, l as cloneDeep } from './aiChatEntry2.js';
|
|
24
|
-
import { s as streamItemID, am as isBetaUserDefinedResponse, an as transformBetaUserDefinedResponse, ao as createMessageResponseForItem, L as InternalMessageResponseType, ap as isGridResponseType, aq as isCarouselResponseType, ar as isShowPanelButtonType, y as isPanelResponseType, n as isResponseWithNestedItems, as as isItemSupportedInResponseBody, at as isCardResponseType, a2 as ButtonItemType, au as isButtonResponseType, ab as memoizeOne, X as AgentMessageType, o as asyncForEach } from './messageUtils.js';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* IBM Confidential
|
|
29
|
-
*
|
|
30
|
-
* (C) Copyright IBM Corp. 2019, 2023
|
|
31
|
-
*
|
|
32
|
-
* The source code for this program is not published or otherwise
|
|
33
|
-
* divested of its trade secrets, irrespective of what has been
|
|
34
|
-
* deposited with the U. S. Copyright Office
|
|
35
|
-
*
|
|
36
|
-
* US Government Users Restricted Rights - Use, duplication or
|
|
37
|
-
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
|
38
|
-
*
|
|
39
|
-
*/
|
|
40
|
-
/**
|
|
41
|
-
* This function will return a new promise that keeps a reference to its own resolve and reject functions so that they
|
|
42
|
-
* can be called on demand by the code using the promise.
|
|
43
|
-
*/
|
|
44
|
-
function resolvablePromise() {
|
|
45
|
-
let resolveFunction;
|
|
46
|
-
let rejectFunction;
|
|
47
|
-
const promise = new Promise((resolve, reject) => {
|
|
48
|
-
resolveFunction = resolve;
|
|
49
|
-
rejectFunction = reject;
|
|
50
|
-
});
|
|
51
|
-
promise.doResolve = (resolveValue) => {
|
|
52
|
-
promise.isResolved = true;
|
|
53
|
-
promise.isComplete = true;
|
|
54
|
-
resolveFunction(resolveValue);
|
|
55
|
-
};
|
|
56
|
-
promise.doReject = (rejectValue) => {
|
|
57
|
-
promise.isRejected = true;
|
|
58
|
-
promise.isComplete = true;
|
|
59
|
-
rejectFunction(rejectValue);
|
|
60
|
-
};
|
|
61
|
-
promise.isResolved = false;
|
|
62
|
-
promise.isRejected = false;
|
|
63
|
-
promise.isComplete = false;
|
|
64
|
-
return promise;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* IBM Confidential
|
|
70
|
-
*
|
|
71
|
-
* (C) Copyright IBM Corp. 2020, 2023
|
|
72
|
-
*
|
|
73
|
-
* The source code for this program is not published or otherwise
|
|
74
|
-
* divested of its trade secrets, irrespective of what has been
|
|
75
|
-
* deposited with the U. S. Copyright Office
|
|
76
|
-
*
|
|
77
|
-
* US Government Users Restricted Rights - Use, duplication or
|
|
78
|
-
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
|
79
|
-
*
|
|
80
|
-
*/
|
|
81
|
-
/**
|
|
82
|
-
* Takes data from the v2 message API ({@link MessageResponse}) and transforms into something usable by WAC
|
|
83
|
-
* ({@link LocalMessageItem}).
|
|
84
|
-
*
|
|
85
|
-
* @param messageItem The individual item from the message to convert.
|
|
86
|
-
* @param fullMessage The message object that came from the server.
|
|
87
|
-
* instance.
|
|
88
|
-
* @param isLatestWelcomeNode Indicates if this message is a new welcome message that has just been shown to the user
|
|
89
|
-
* and isn't a historical welcome message.
|
|
90
|
-
* ID as the message.
|
|
91
|
-
* @param disableFadeAnimation Indicates if the entrance fade animation for the message should be disabled.
|
|
92
|
-
*/
|
|
93
|
-
function outputItemToLocalItem(messageItem, fullMessage, isLatestWelcomeNode = false, disableFadeAnimation = false) {
|
|
94
|
-
// If the item comes with a streaming id, use that. Otherwise assign a new id.
|
|
95
|
-
const id = streamItemID(fullMessage.id, messageItem) || uuid(UUIDType.LOCAL_MESSAGE);
|
|
96
|
-
// Create the LocalMessage. It will temporarily have the extra "output" property it gets from the original
|
|
97
|
-
// MessageResponse object.
|
|
98
|
-
const localMessage = {
|
|
99
|
-
ui_state: {
|
|
100
|
-
id,
|
|
101
|
-
needsAnnouncement: !fullMessage.history.from_history,
|
|
102
|
-
disableFadeAnimation,
|
|
103
|
-
},
|
|
104
|
-
item: messageItem,
|
|
105
|
-
fullMessageID: fullMessage.id,
|
|
106
|
-
};
|
|
107
|
-
if (isLatestWelcomeNode) {
|
|
108
|
-
localMessage.ui_state.isWelcomeResponse = true;
|
|
109
|
-
}
|
|
110
|
-
// If this is a user_defined response included in our "beta" response types, we transform the response here.
|
|
111
|
-
return isBetaUserDefinedResponse(localMessage)
|
|
112
|
-
? transformBetaUserDefinedResponse(localMessage)
|
|
113
|
-
: localMessage;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Creates an empty skeleton of a {@link LocalMessageItem} with the inline_error response type.
|
|
117
|
-
*/
|
|
118
|
-
function createLocalMessageForInlineError(text) {
|
|
119
|
-
const messageItem = {
|
|
120
|
-
response_type: MessageResponseTypes.INLINE_ERROR,
|
|
121
|
-
text,
|
|
122
|
-
};
|
|
123
|
-
return createLocalMessageForItem(messageItem);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Creates an empty skeleton of a {@link LocalMessageItem} with the given item.
|
|
127
|
-
*/
|
|
128
|
-
function createLocalMessageForItem(messageItem) {
|
|
129
|
-
const originalMessage = createMessageResponseForItem(messageItem);
|
|
130
|
-
const localMessage = outputItemToLocalItem(messageItem, originalMessage);
|
|
131
|
-
return { originalMessage, localMessage };
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Creates an empty skeleton of a {@link LocalMessageItem} for a chat status message.
|
|
135
|
-
*/
|
|
136
|
-
function createLocalMessageForChatStatusMessage(internalMessageResponseType, text) {
|
|
137
|
-
const messageItem = {
|
|
138
|
-
response_type: internalMessageResponseType,
|
|
139
|
-
text,
|
|
140
|
-
};
|
|
141
|
-
const originalMessage = createMessageResponseForItem(messageItem);
|
|
142
|
-
const localMessage = outputItemToLocalItem(messageItem, originalMessage);
|
|
143
|
-
return { originalMessage, localMessage };
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Creates an empty skeleton of a {@link LocalMessageItem} with the session_expired response type.
|
|
147
|
-
*/
|
|
148
|
-
function createLocalMessageForSessionExpiration(text) {
|
|
149
|
-
return createLocalMessageForChatStatusMessage(InternalMessageResponseType.SESSION_EXPIRED, text);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Creates an empty skeleton of a {@link LocalMessageItem} with the failed_channel_transfer response type.
|
|
153
|
-
*/
|
|
154
|
-
function createLocalMessageForChannelTransferFailure(text) {
|
|
155
|
-
return createLocalMessageForChatStatusMessage(InternalMessageResponseType.CHANNEL_TRANSFER_FAILED, text);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Loops through the give list of message items to create local message items for each of them. This allows us to reuse
|
|
159
|
-
* the existing ui_state functionality to update nested messages like we currently do with normal messages.
|
|
160
|
-
*
|
|
161
|
-
* @param localMessageItem The local message item to store nested local message items in.
|
|
162
|
-
* @param originalMessage The original message response these nested messages came from.
|
|
163
|
-
* @param fromHistory Indicates if the message was fetched from session history.
|
|
164
|
-
* @param nestedLocalMessageItems A list to add local message items to as they're created.
|
|
165
|
-
* @param allowFooter Determines whether buttons in the footer should render. This allows us to prevent deeply
|
|
166
|
-
* nested buttons from rendering, such as a card with a footer nested in a panel.
|
|
167
|
-
*/
|
|
168
|
-
function createLocalMessageItemsForNestedMessageItems(localMessageItem, originalMessage, fromHistory, nestedLocalMessageItems, allowFooter) {
|
|
169
|
-
const { item } = localMessageItem;
|
|
170
|
-
if (isGridResponseType(item)) {
|
|
171
|
-
localMessageItem.ui_state.gridLocalMessageItemIDs = item.rows.map(row => {
|
|
172
|
-
return row.cells.map(cell => {
|
|
173
|
-
const cellLocalMessageItemIDs = [];
|
|
174
|
-
createLocalMessageItemsForNestedType('items', localMessageItem, cell.items, cellLocalMessageItemIDs, originalMessage, fromHistory, nestedLocalMessageItems, nestedMessageItem => isSupportedMessageItemInBody(localMessageItem.item, nestedMessageItem), false);
|
|
175
|
-
return cellLocalMessageItemIDs;
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
else if (isCarouselResponseType(item)) {
|
|
180
|
-
localMessageItem.ui_state.itemsLocalMessageItemIDs = [];
|
|
181
|
-
createLocalMessageItemsForNestedType('items', localMessageItem, item.items, localMessageItem.ui_state.itemsLocalMessageItemIDs, originalMessage, fromHistory, nestedLocalMessageItems, nestedMessageItem => isSupportedMessageItemInBody(item, nestedMessageItem),
|
|
182
|
-
// A carousel as standalone response type should allow buttons. If a carousel is allowed to be nested in the
|
|
183
|
-
// future, this would be helpful to prevent buttons in it.
|
|
184
|
-
allowFooter);
|
|
185
|
-
}
|
|
186
|
-
else {
|
|
187
|
-
const bodyItems = item.body || item.panel?.body;
|
|
188
|
-
if (bodyItems) {
|
|
189
|
-
localMessageItem.ui_state.bodyLocalMessageItemIDs = [];
|
|
190
|
-
createLocalMessageItemsForNestedType('body', localMessageItem, bodyItems, localMessageItem.ui_state.bodyLocalMessageItemIDs, originalMessage, fromHistory, nestedLocalMessageItems, nestedMessageItem => isSupportedMessageItemInBody(item, nestedMessageItem),
|
|
191
|
-
// If nested items are being rendered in a panel, the footer should not be allowed.
|
|
192
|
-
!isShowPanelButtonType(item) && !isPanelResponseType(item));
|
|
193
|
-
}
|
|
194
|
-
if (!allowFooter) {
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
const footerItems = item.footer || item.panel?.footer;
|
|
198
|
-
if (footerItems) {
|
|
199
|
-
localMessageItem.ui_state.footerLocalMessageItemIDs = [];
|
|
200
|
-
createLocalMessageItemsForNestedType('footer', localMessageItem, footerItems, localMessageItem.ui_state.footerLocalMessageItemIDs, originalMessage, fromHistory, nestedLocalMessageItems, nestedMessageItem => isSupportedMessageItemInFooter(item, nestedMessageItem),
|
|
201
|
-
// A show panel button in a footer may open a panel that itself also has a footer. Nothing else in a footer can
|
|
202
|
-
// have nested items with footers.
|
|
203
|
-
!isShowPanelButtonType(item));
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
function createLocalMessageItemsForNestedType(type, localMessageItem, items, nestedMessageItemIDs, originalMessage, fromHistory, nestedLocalMessageItems, isSupported, allowFooter) {
|
|
208
|
-
items.forEach(nestedMessageItem => {
|
|
209
|
-
if (isSupported(nestedMessageItem)) {
|
|
210
|
-
const nestedLocalMessageItem = outputItemToLocalItem(nestedMessageItem, originalMessage, false, true);
|
|
211
|
-
nestedMessageItemIDs.push(nestedLocalMessageItem.ui_state.id);
|
|
212
|
-
nestedLocalMessageItems.push(nestedLocalMessageItem);
|
|
213
|
-
if (isResponseWithNestedItems(nestedLocalMessageItem.item)) {
|
|
214
|
-
createLocalMessageItemsForNestedMessageItems(nestedLocalMessageItem, originalMessage, fromHistory, nestedLocalMessageItems, allowFooter);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
consoleError(`The "${localMessageItem.item.response_type}" response type does not support "${nestedMessageItem.response_type}" in "${type}" array.`);
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Determines if the given nested item is allowed to be displayed inside the given root message item body.
|
|
224
|
-
*/
|
|
225
|
-
function isSupportedMessageItemInBody(rootMessageItem, nestedMessageItem) {
|
|
226
|
-
switch (rootMessageItem.response_type) {
|
|
227
|
-
case InternalMessageResponseType.CARD:
|
|
228
|
-
return !isCardResponseType(nestedMessageItem) && isItemSupportedInResponseBody(nestedMessageItem);
|
|
229
|
-
case InternalMessageResponseType.CAROUSEL:
|
|
230
|
-
return isCardResponseType(nestedMessageItem);
|
|
231
|
-
case InternalMessageResponseType.BUTTON:
|
|
232
|
-
return (rootMessageItem.button_type === ButtonItemType.SHOW_PANEL &&
|
|
233
|
-
isItemSupportedInResponseBody(nestedMessageItem));
|
|
234
|
-
case InternalMessageResponseType.GRID:
|
|
235
|
-
return !isCardResponseType(nestedMessageItem) && isItemSupportedInResponseBody(nestedMessageItem);
|
|
236
|
-
case InternalMessageResponseType.PANEL:
|
|
237
|
-
return isItemSupportedInResponseBody(nestedMessageItem);
|
|
238
|
-
default:
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Determines if the given nested item is allowed to be displayed inside the given root message item footer. Only
|
|
244
|
-
* the button response type should be allowed in the footer. Depending on the root message item, the show_panel
|
|
245
|
-
* button type won't be allowed to render.
|
|
246
|
-
*/
|
|
247
|
-
function isSupportedMessageItemInFooter(rootMessageItem, nestedMessageItem) {
|
|
248
|
-
if (isButtonResponseType(nestedMessageItem)) {
|
|
249
|
-
// The panel response type and show_panel button type should not support the button type "show_panel" in the
|
|
250
|
-
// footer. This is to prevent the user from opening a panel when a panel is already open.
|
|
251
|
-
if (isPanelResponseType(rootMessageItem) || isShowPanelButtonType(rootMessageItem)) {
|
|
252
|
-
return !isShowPanelButtonType(nestedMessageItem);
|
|
253
|
-
}
|
|
254
|
-
return true;
|
|
255
|
-
}
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
260
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
261
|
-
if (ar || !(i in from)) {
|
|
262
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
263
|
-
ar[i] = from[i];
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
267
|
-
};
|
|
268
|
-
var BrowserInfo = /** @class */ (function () {
|
|
269
|
-
function BrowserInfo(name, version, os) {
|
|
270
|
-
this.name = name;
|
|
271
|
-
this.version = version;
|
|
272
|
-
this.os = os;
|
|
273
|
-
this.type = 'browser';
|
|
274
|
-
}
|
|
275
|
-
return BrowserInfo;
|
|
276
|
-
}());
|
|
277
|
-
var NodeInfo = /** @class */ (function () {
|
|
278
|
-
function NodeInfo(version) {
|
|
279
|
-
this.version = version;
|
|
280
|
-
this.type = 'node';
|
|
281
|
-
this.name = 'node';
|
|
282
|
-
this.os = process.platform;
|
|
283
|
-
}
|
|
284
|
-
return NodeInfo;
|
|
285
|
-
}());
|
|
286
|
-
var SearchBotDeviceInfo = /** @class */ (function () {
|
|
287
|
-
function SearchBotDeviceInfo(name, version, os, bot) {
|
|
288
|
-
this.name = name;
|
|
289
|
-
this.version = version;
|
|
290
|
-
this.os = os;
|
|
291
|
-
this.bot = bot;
|
|
292
|
-
this.type = 'bot-device';
|
|
293
|
-
}
|
|
294
|
-
return SearchBotDeviceInfo;
|
|
295
|
-
}());
|
|
296
|
-
var BotInfo = /** @class */ (function () {
|
|
297
|
-
function BotInfo() {
|
|
298
|
-
this.type = 'bot';
|
|
299
|
-
this.bot = true; // NOTE: deprecated test name instead
|
|
300
|
-
this.name = 'bot';
|
|
301
|
-
this.version = null;
|
|
302
|
-
this.os = null;
|
|
303
|
-
}
|
|
304
|
-
return BotInfo;
|
|
305
|
-
}());
|
|
306
|
-
var ReactNativeInfo = /** @class */ (function () {
|
|
307
|
-
function ReactNativeInfo() {
|
|
308
|
-
this.type = 'react-native';
|
|
309
|
-
this.name = 'react-native';
|
|
310
|
-
this.version = null;
|
|
311
|
-
this.os = null;
|
|
312
|
-
}
|
|
313
|
-
return ReactNativeInfo;
|
|
314
|
-
}());
|
|
315
|
-
// tslint:disable-next-line:max-line-length
|
|
316
|
-
var SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;
|
|
317
|
-
var SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/;
|
|
318
|
-
var REQUIRED_VERSION_PARTS = 3;
|
|
319
|
-
var userAgentRules = [
|
|
320
|
-
['aol', /AOLShield\/([0-9\._]+)/],
|
|
321
|
-
['edge', /Edge\/([0-9\._]+)/],
|
|
322
|
-
['edge-ios', /EdgiOS\/([0-9\._]+)/],
|
|
323
|
-
['yandexbrowser', /YaBrowser\/([0-9\._]+)/],
|
|
324
|
-
['kakaotalk', /KAKAOTALK\s([0-9\.]+)/],
|
|
325
|
-
['samsung', /SamsungBrowser\/([0-9\.]+)/],
|
|
326
|
-
['silk', /\bSilk\/([0-9._-]+)\b/],
|
|
327
|
-
['miui', /MiuiBrowser\/([0-9\.]+)$/],
|
|
328
|
-
['beaker', /BeakerBrowser\/([0-9\.]+)/],
|
|
329
|
-
['edge-chromium', /EdgA?\/([0-9\.]+)/],
|
|
330
|
-
[
|
|
331
|
-
'chromium-webview',
|
|
332
|
-
/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/,
|
|
333
|
-
],
|
|
334
|
-
['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],
|
|
335
|
-
['phantomjs', /PhantomJS\/([0-9\.]+)(:?\s|$)/],
|
|
336
|
-
['crios', /CriOS\/([0-9\.]+)(:?\s|$)/],
|
|
337
|
-
['firefox', /Firefox\/([0-9\.]+)(?:\s|$)/],
|
|
338
|
-
['fxios', /FxiOS\/([0-9\.]+)/],
|
|
339
|
-
['opera-mini', /Opera Mini.*Version\/([0-9\.]+)/],
|
|
340
|
-
['opera', /Opera\/([0-9\.]+)(?:\s|$)/],
|
|
341
|
-
['opera', /OPR\/([0-9\.]+)(:?\s|$)/],
|
|
342
|
-
['pie', /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],
|
|
343
|
-
['pie', /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],
|
|
344
|
-
['netfront', /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],
|
|
345
|
-
['ie', /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],
|
|
346
|
-
['ie', /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],
|
|
347
|
-
['ie', /MSIE\s(7\.0)/],
|
|
348
|
-
['bb10', /BB10;\sTouch.*Version\/([0-9\.]+)/],
|
|
349
|
-
['android', /Android\s([0-9\.]+)/],
|
|
350
|
-
['ios', /Version\/([0-9\._]+).*Mobile.*Safari.*/],
|
|
351
|
-
['safari', /Version\/([0-9\._]+).*Safari/],
|
|
352
|
-
['facebook', /FB[AS]V\/([0-9\.]+)/],
|
|
353
|
-
['instagram', /Instagram\s([0-9\.]+)/],
|
|
354
|
-
['ios-webview', /AppleWebKit\/([0-9\.]+).*Mobile/],
|
|
355
|
-
['ios-webview', /AppleWebKit\/([0-9\.]+).*Gecko\)$/],
|
|
356
|
-
['curl', /^curl\/([0-9\.]+)$/],
|
|
357
|
-
['searchbot', SEARCHBOX_UA_REGEX],
|
|
358
|
-
];
|
|
359
|
-
var operatingSystemRules = [
|
|
360
|
-
['iOS', /iP(hone|od|ad)/],
|
|
361
|
-
['Android OS', /Android/],
|
|
362
|
-
['BlackBerry OS', /BlackBerry|BB10/],
|
|
363
|
-
['Windows Mobile', /IEMobile/],
|
|
364
|
-
['Amazon OS', /Kindle/],
|
|
365
|
-
['Windows 3.11', /Win16/],
|
|
366
|
-
['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/],
|
|
367
|
-
['Windows 98', /(Windows 98)|(Win98)/],
|
|
368
|
-
['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/],
|
|
369
|
-
['Windows XP', /(Windows NT 5.1)|(Windows XP)/],
|
|
370
|
-
['Windows Server 2003', /(Windows NT 5.2)/],
|
|
371
|
-
['Windows Vista', /(Windows NT 6.0)/],
|
|
372
|
-
['Windows 7', /(Windows NT 6.1)/],
|
|
373
|
-
['Windows 8', /(Windows NT 6.2)/],
|
|
374
|
-
['Windows 8.1', /(Windows NT 6.3)/],
|
|
375
|
-
['Windows 10', /(Windows NT 10.0)/],
|
|
376
|
-
['Windows ME', /Windows ME/],
|
|
377
|
-
['Windows CE', /Windows CE|WinCE|Microsoft Pocket Internet Explorer/],
|
|
378
|
-
['Open BSD', /OpenBSD/],
|
|
379
|
-
['Sun OS', /SunOS/],
|
|
380
|
-
['Chrome OS', /CrOS/],
|
|
381
|
-
['Linux', /(Linux)|(X11)/],
|
|
382
|
-
['Mac OS', /(Mac_PowerPC)|(Macintosh)/],
|
|
383
|
-
['QNX', /QNX/],
|
|
384
|
-
['BeOS', /BeOS/],
|
|
385
|
-
['OS/2', /OS\/2/],
|
|
386
|
-
];
|
|
387
|
-
function detect(userAgent) {
|
|
388
|
-
if (typeof document === 'undefined' &&
|
|
389
|
-
typeof navigator !== 'undefined' &&
|
|
390
|
-
navigator.product === 'ReactNative') {
|
|
391
|
-
return new ReactNativeInfo();
|
|
392
|
-
}
|
|
393
|
-
if (typeof navigator !== 'undefined') {
|
|
394
|
-
return parseUserAgent(navigator.userAgent);
|
|
395
|
-
}
|
|
396
|
-
return getNodeVersion();
|
|
397
|
-
}
|
|
398
|
-
function matchUserAgent(ua) {
|
|
399
|
-
// opted for using reduce here rather than Array#first with a regex.test call
|
|
400
|
-
// this is primarily because using the reduce we only perform the regex
|
|
401
|
-
// execution once rather than once for the test and for the exec again below
|
|
402
|
-
// probably something that needs to be benchmarked though
|
|
403
|
-
return (ua !== '' &&
|
|
404
|
-
userAgentRules.reduce(function (matched, _a) {
|
|
405
|
-
var browser = _a[0], regex = _a[1];
|
|
406
|
-
if (matched) {
|
|
407
|
-
return matched;
|
|
408
|
-
}
|
|
409
|
-
var uaMatch = regex.exec(ua);
|
|
410
|
-
return !!uaMatch && [browser, uaMatch];
|
|
411
|
-
}, false));
|
|
412
|
-
}
|
|
413
|
-
function parseUserAgent(ua) {
|
|
414
|
-
var matchedRule = matchUserAgent(ua);
|
|
415
|
-
if (!matchedRule) {
|
|
416
|
-
return null;
|
|
417
|
-
}
|
|
418
|
-
var name = matchedRule[0], match = matchedRule[1];
|
|
419
|
-
if (name === 'searchbot') {
|
|
420
|
-
return new BotInfo();
|
|
421
|
-
}
|
|
422
|
-
// Do not use RegExp for split operation as some browser do not support it (See: http://blog.stevenlevithan.com/archives/cross-browser-split)
|
|
423
|
-
var versionParts = match[1] && match[1].split('.').join('_').split('_').slice(0, 3);
|
|
424
|
-
if (versionParts) {
|
|
425
|
-
if (versionParts.length < REQUIRED_VERSION_PARTS) {
|
|
426
|
-
versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true);
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
else {
|
|
430
|
-
versionParts = [];
|
|
431
|
-
}
|
|
432
|
-
var version = versionParts.join('.');
|
|
433
|
-
var os = detectOS(ua);
|
|
434
|
-
var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);
|
|
435
|
-
if (searchBotMatch && searchBotMatch[1]) {
|
|
436
|
-
return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);
|
|
437
|
-
}
|
|
438
|
-
return new BrowserInfo(name, version, os);
|
|
439
|
-
}
|
|
440
|
-
function detectOS(ua) {
|
|
441
|
-
for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {
|
|
442
|
-
var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1];
|
|
443
|
-
var match = regex.exec(ua);
|
|
444
|
-
if (match) {
|
|
445
|
-
return os;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
return null;
|
|
449
|
-
}
|
|
450
|
-
function getNodeVersion() {
|
|
451
|
-
var isNode = typeof process !== 'undefined' && process.version;
|
|
452
|
-
return isNode ? new NodeInfo(process.version.slice(1)) : null;
|
|
453
|
-
}
|
|
454
|
-
function createVersionParts(count) {
|
|
455
|
-
var output = [];
|
|
456
|
-
for (var ii = 0; ii < count; ii++) {
|
|
457
|
-
output.push('0');
|
|
458
|
-
}
|
|
459
|
-
return output;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
*
|
|
464
|
-
* IBM Confidential
|
|
465
|
-
*
|
|
466
|
-
* (C) Copyright IBM Corp. 2020, 2023
|
|
467
|
-
*
|
|
468
|
-
* The source code for this program is not published or otherwise
|
|
469
|
-
* divested of its trade secrets, irrespective of what has been
|
|
470
|
-
* deposited with the U. S. Copyright Office
|
|
471
|
-
*
|
|
472
|
-
* US Government Users Restricted Rights - Use, duplication or
|
|
473
|
-
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
|
474
|
-
*
|
|
475
|
-
*/
|
|
476
|
-
/**
|
|
477
|
-
* Miscellaneous utilities for dealing with the browser.
|
|
478
|
-
*/
|
|
479
|
-
const browser = detect();
|
|
480
|
-
const BROWSER_INFO = browser;
|
|
481
|
-
// The user agent string in version 13 of the operating system no longer distinguishes between macOS and iPads so
|
|
482
|
-
// need add an extra check that may not be reliable in the future.
|
|
483
|
-
const IS_IPAD = /iPad/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
|
484
|
-
const IS_IOS = browser?.os === 'iOS';
|
|
485
|
-
const IS_ANDROID = browser?.os === 'Android OS';
|
|
486
|
-
const IS_MOBILE = IS_IOS || IS_ANDROID || IS_IPAD;
|
|
487
|
-
// The width and height checks here are how we differentiate between mobile android devices and tablets. Eventually new
|
|
488
|
-
// phones may get wide enough that the width check needs to be increased.
|
|
489
|
-
const IS_PHONE = IS_MOBILE && (window.screen.width < 500 || window.screen.height < 500);
|
|
490
|
-
// Assume the phone is in portrait mode if the width is small.
|
|
491
|
-
const IS_PHONE_IN_PORTRAIT_MODE = IS_PHONE && window.screen.width < 500;
|
|
492
|
-
const IS_TABLET = IS_MOBILE && !IS_PHONE;
|
|
493
|
-
// The minimum window width in which we will display the button for opening the PDF viewer.
|
|
494
|
-
const MIN_PDF_VIEWER_WIDTH = 550;
|
|
495
|
-
// For reference here is a list of screen dimensions observed for some of the iPhone devices in browser stack.
|
|
496
|
-
//
|
|
497
|
-
// 414x896 XS Max
|
|
498
|
-
// 414x896 XR
|
|
499
|
-
//
|
|
500
|
-
// 375x812 XS
|
|
501
|
-
// 375x812 X
|
|
502
|
-
//
|
|
503
|
-
// 414x736 8 Plus
|
|
504
|
-
// 414x736 6S Plus
|
|
505
|
-
// 414x736 6 Plus
|
|
506
|
-
//
|
|
507
|
-
// 375x667 8
|
|
508
|
-
// 375x667 7
|
|
509
|
-
// 375x667 6s
|
|
510
|
-
// 375x667 6
|
|
511
|
-
//
|
|
512
|
-
// 320x568 SE
|
|
513
|
-
// This array maps from a screen height on iOS device to a height offset to apply to the widget for devices of that
|
|
514
|
-
// height.
|
|
515
|
-
const IOS_HEIGHT_MAP = [
|
|
516
|
-
[896, 114],
|
|
517
|
-
[812, 114],
|
|
518
|
-
[736, 75],
|
|
519
|
-
[667, 75],
|
|
520
|
-
];
|
|
521
|
-
/**
|
|
522
|
-
* The Browser info supplied in context in ActionsImpl.tsx. This info is used by the integrations
|
|
523
|
-
* backend for agent routing within dialog and to help enable the human agent on the other end of a service desk.
|
|
524
|
-
*/
|
|
525
|
-
function getBrowserInfo() {
|
|
526
|
-
return {
|
|
527
|
-
browser_name: BROWSER_INFO?.name,
|
|
528
|
-
browser_version: BROWSER_INFO?.version,
|
|
529
|
-
browser_OS: BROWSER_INFO?.os,
|
|
530
|
-
language: window.navigator?.language,
|
|
531
|
-
page_url: window.location.origin + window.location.pathname,
|
|
532
|
-
screen_resolution: `width: ${window.screen?.width}, height: ${window.screen?.height}`,
|
|
533
|
-
user_agent: window.navigator?.userAgent,
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
/**
|
|
537
|
-
* This function is responsible for returning a height offset to apply to older iOS devices. On these devices the
|
|
538
|
-
* navigation bars at the top and bottom of the screen consume a portion of the 100vh viewport height which causes
|
|
539
|
-
* the text field to be cut off at the bottom. By applying this offset we make it visible. Unfortunately this offset
|
|
540
|
-
* is different on different devices so we make a guess based on the screen height. Another drawback is that this
|
|
541
|
-
* offset causes a gap to appear below the text field when the navigation bars are hiding.
|
|
542
|
-
*/
|
|
543
|
-
function getIPhoneHeightOffset() {
|
|
544
|
-
// eslint-disable-next-line no-restricted-globals
|
|
545
|
-
const screenHeight = Math.max(screen.height, screen.width);
|
|
546
|
-
for (let index = 0; index < IOS_HEIGHT_MAP.length; index++) {
|
|
547
|
-
const [height, offset] = IOS_HEIGHT_MAP[index];
|
|
548
|
-
if (screenHeight >= height) {
|
|
549
|
-
return offset;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
return 75;
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* Gets the hostname and pathname of the page web chat is injected in.
|
|
556
|
-
*/
|
|
557
|
-
function getURLHostnameAndPath() {
|
|
558
|
-
const { origin, pathname } = window.location;
|
|
559
|
-
return origin + pathname;
|
|
560
|
-
}
|
|
561
|
-
/**
|
|
562
|
-
* Determines if the host page is using a secure protocol.
|
|
563
|
-
*/
|
|
564
|
-
function isSecureHost() {
|
|
565
|
-
return window.location.protocol === 'https:';
|
|
566
|
-
}
|
|
567
|
-
/**
|
|
568
|
-
* In some conditions (iFrames) window.sessionStorage is DEFINED, but not accessible.
|
|
569
|
-
* Rather than doing window.sessionStorage || alternate checks, this actually checks if sessionStorage
|
|
570
|
-
* can be used.
|
|
571
|
-
*
|
|
572
|
-
* @returns If window.sessionStorage is read and writeable.
|
|
573
|
-
*/
|
|
574
|
-
function isSessionStorageAvailable() {
|
|
575
|
-
let isAvailable = false;
|
|
576
|
-
try {
|
|
577
|
-
window.sessionStorage.setItem('web-chat-test-item', 'true');
|
|
578
|
-
window.sessionStorage.getItem('web-chat-test-item');
|
|
579
|
-
window.sessionStorage.removeItem('web-chat-test-item');
|
|
580
|
-
isAvailable = true;
|
|
581
|
-
}
|
|
582
|
-
catch {
|
|
583
|
-
// Ignore.
|
|
584
|
-
}
|
|
585
|
-
return isAvailable;
|
|
586
|
-
}
|
|
587
|
-
const IS_SESSION_STORAGE = memoizeOne(isSessionStorageAvailable);
|
|
588
|
-
/**
|
|
589
|
-
* Attempts to return the hostname of the provided URL. If an invalid url is returned, we just return the provided url
|
|
590
|
-
* value.
|
|
591
|
-
*/
|
|
592
|
-
function getURLHostName(url) {
|
|
593
|
-
try {
|
|
594
|
-
return new URL(url).hostname;
|
|
595
|
-
}
|
|
596
|
-
catch {
|
|
597
|
-
return url;
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
/**
|
|
601
|
-
* Removes the parameter with the given name from the URL.
|
|
602
|
-
*/
|
|
603
|
-
function removeParameter(paramName) {
|
|
604
|
-
const { location } = window;
|
|
605
|
-
const params = new URLSearchParams(location.search);
|
|
606
|
-
if (params.has(paramName)) {
|
|
607
|
-
params.delete(paramName);
|
|
608
|
-
let paramsString = params.toString();
|
|
609
|
-
if (paramsString) {
|
|
610
|
-
paramsString = `?${paramsString}`;
|
|
611
|
-
}
|
|
612
|
-
const newURL = location.origin + location.pathname + paramsString + location.hash;
|
|
613
|
-
// eslint-disable-next-line no-restricted-globals
|
|
614
|
-
history.replaceState(history.state, null, newURL);
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
/**
|
|
618
|
-
* Retrieves from search params in the URL and removes them.
|
|
619
|
-
*/
|
|
620
|
-
function pullValueParam(paramName) {
|
|
621
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
622
|
-
const paramValue = searchParams.get(paramName);
|
|
623
|
-
if (paramValue) {
|
|
624
|
-
removeParameter(paramName);
|
|
625
|
-
return paramValue;
|
|
626
|
-
}
|
|
627
|
-
return null;
|
|
628
|
-
}
|
|
629
|
-
/**
|
|
630
|
-
* Executes the given operation in a setTimeout if the timeout value is specified. If not, then the operation is
|
|
631
|
-
* executed immediately without using a setTimeout.
|
|
632
|
-
*/
|
|
633
|
-
function conditionalSetTimeout(operation, timeout) {
|
|
634
|
-
if (timeout) {
|
|
635
|
-
return setTimeout(operation, timeout);
|
|
636
|
-
}
|
|
637
|
-
// Execute the operation immediately.
|
|
638
|
-
operation();
|
|
639
|
-
return null;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
*
|
|
644
|
-
* IBM Confidential
|
|
645
|
-
*
|
|
646
|
-
* (C) Copyright IBM Corp. 2020, 2023
|
|
647
|
-
*
|
|
648
|
-
* The source code for this program is not published or otherwise
|
|
649
|
-
* divested of its trade secrets, irrespective of what has been
|
|
650
|
-
* deposited with the U. S. Copyright Office
|
|
651
|
-
*
|
|
652
|
-
* US Government Users Restricted Rights - Use, duplication or
|
|
653
|
-
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
|
654
|
-
*
|
|
655
|
-
*/
|
|
656
|
-
const CHANGE_STATE = 'CHANGE_STATE';
|
|
657
|
-
const UPDATE_BOT_NAME = 'UPDATE_BOT_NAME';
|
|
658
|
-
const UPDATE_BOT_AVATAR_URL = 'UPDATE_BOT_AVATAR_URL';
|
|
659
|
-
const UPDATE_LAUNCHER_AVATAR_URL = 'UPDATE_LAUNCHER_AVATAR_URL';
|
|
660
|
-
const UPDATE_MAIN_HEADER_TITLE = 'UPDATE_MAIN_HEADER_TITLE';
|
|
661
|
-
const HYDRATE_CHAT = 'HYDRATE_CHAT';
|
|
662
|
-
const SET_MAIN_CONFIG = 'SET_MAIN_CONFIG';
|
|
663
|
-
const HYDRATE_MESSAGE_HISTORY = 'HYDRATE_MESSAGE_HISTORY';
|
|
664
|
-
const ADD_LOCAL_MESSAGE_ITEM = 'ADD_LOCAL_MESSAGE_ITEM';
|
|
665
|
-
const REMOVE_MESSAGES = 'REMOVE_MESSAGES';
|
|
666
|
-
const UPDATE_LOCAL_MESSAGE_ITEM = 'UPDATE_LOCAL_MESSAGE_ITEM';
|
|
667
|
-
const SET_APP_STATE_VALUE = 'SET_APP_STATE_VALUE';
|
|
668
|
-
const ADD_IS_TYPING_COUNTER = 'ADD_IS_TYPING_COUNTER';
|
|
669
|
-
const ADD_IS_LOADING_COUNTER = 'ADD_IS_LOADING_COUNTER';
|
|
670
|
-
const SET_VIEW_STATE = 'SET_VIEW_STATE';
|
|
671
|
-
const SET_VIEW_CHANGING = 'SET_VIEW_CHANGING';
|
|
672
|
-
const SET_INITIAL_VIEW_CHANGE_COMPLETE = 'SET_INITIAL_VIEW_CHANGE_COMPLETE';
|
|
673
|
-
const UPDATE_CSS_VARIABLES = 'UPDATE_CSS_VARIABLES';
|
|
674
|
-
const UPDATE_THEME_CONFIG = 'UPDATE_THEME_CONFIG';
|
|
675
|
-
const UPDATE_STREAMING_CONFIG = 'UPDATE_STREAMING_CONFIG';
|
|
676
|
-
const MESSAGE_SET_OPTION_SELECTED = 'MESSAGE_SET_OPTION_SELECTED';
|
|
677
|
-
const SET_MESSAGE_UI_PROPERTY = 'SET_MESSAGE_UI_PROPERTY';
|
|
678
|
-
const SET_MESSAGE_HISTORY_PROPERTY = 'SET_MESSAGE_HISTORY_PROPERTY';
|
|
679
|
-
const SET_LAUNCHER_PROPERTY = 'SET_LAUNCHER_PROPERTY';
|
|
680
|
-
const SET_LAUNCHER_CONFIG_PROPERTY = 'SET_LAUNCHER_CONFIG_PROPERTY';
|
|
681
|
-
const ANNOUNCE_MESSAGE = 'ANNOUNCE_MESSAGE';
|
|
682
|
-
const SET_ALTERNATE_SUGGESTIONS_OPEN = 'SET_ALTERNATE_SUGGESTIONS_OPEN';
|
|
683
|
-
const SET_CHAT_MESSAGES_PROPERTY = 'SET_CHAT_MESSAGES_PROPERTY';
|
|
684
|
-
const RESTART_CONVERSATION = 'RESTART_CONVERSATION';
|
|
685
|
-
const SET_ALTERNATE_SUGGESTIONS_THIRD_STRIKE = 'SET_ALTERNATE_SUGGESTIONS_THIRD_STRIKE';
|
|
686
|
-
const ACCEPTED_DISCLAIMER = 'ACCEPTED_DISCLAIMER';
|
|
687
|
-
const ADD_MESSAGE = 'ADD_MESSAGE';
|
|
688
|
-
const UPDATE_HOME_SCREEN_CONFIG = 'UPDATE_HOME_SCREEN_CONFIG';
|
|
689
|
-
const UPDATE_ALTERNATE_SUGGESTIONS_CONFIG = 'UPDATE_ALTERNATE_SUGGESTIONS_CONFIG';
|
|
690
|
-
const SUGGESTIONS_SET_SELECTED_INDEX = 'SUGGESTIONS_SET_SELECTED_INDEX';
|
|
691
|
-
const UPDATE_SESSION_STARTED_TIMESTAMP = 'UPDATE_SESSION_STARTED_TIMESTAMP';
|
|
692
|
-
const UPDATE_SESSION_ID = 'UPDATE_SESSION_ID';
|
|
693
|
-
const UPDATE_HAS_SENT_NON_WELCOME_MESSAGE = 'UPDATE_HAS_SENT_NON_WELCOME_MESSAGE';
|
|
694
|
-
const UPDATE_PERSISTED_CHAT_STATE = 'UPDATE_PERSISTED_CHAT_STATE';
|
|
695
|
-
const SET_TOUR_DATA = 'SET_TOUR_DATA';
|
|
696
|
-
const CLEAR_TOUR_DATA = 'CLEAR_TOUR_DATA';
|
|
697
|
-
const CHANGE_STEP_IN_TOUR = 'CHANGE_STEP_IN_TOUR';
|
|
698
|
-
const SET_HOME_SCREEN_IS_OPEN = 'SET_HOME_SCREEN_IS_OPEN';
|
|
699
|
-
const SET_UPDATE_HISTORY_USER_DEFINED_COUNT = 'SET_UPDATE_HISTORY_USER_DEFINED_COUNT';
|
|
700
|
-
const UPDATE_LAUNCHER_CONFIG = 'UPDATE_LAUNCHER_CONFIG';
|
|
701
|
-
const UPDATE_BRANDING_CONFIG = 'UPDATE_BRANDING_CONFIG';
|
|
702
|
-
const SET_BRANDING_OVERLAY_IS_OPEN = 'SET_BRANDING_OVERLAY_IS_OPEN';
|
|
703
|
-
const SET_BRANDING_BANNER_SHOWN = 'SET_BRANDING_BANNER_SHOWN';
|
|
704
|
-
const SET_SUGGESTIONS_SEARCH_RESULTS = 'SET_SUGGESTIONS_SEARCH_RESULTS';
|
|
705
|
-
const UPDATE_MESSAGE = 'UPDATE_MESSAGE';
|
|
706
|
-
const SET_LAUNCHER_MINIMIZED = 'SET_LAUNCHER_MINIMIZED';
|
|
707
|
-
const CLOSE_IFRAME_PANEL = 'CLOSE_IFRAME_PANEL';
|
|
708
|
-
const OPEN_IFRAME_CONTENT = 'OPEN_IFRAME_CONTENT';
|
|
709
|
-
const SET_CONVERSATIONAL_SEARCH_CITATION_PANEL_IS_OPEN = 'SET_CONVERSATIONAL_SEARCH_CITATION_PANEL_IS_OPEN';
|
|
710
|
-
const SET_CUSTOM_PANEL_OPTIONS = 'SET_CUSTOM_PANEL_OPTIONS';
|
|
711
|
-
const SET_CUSTOM_PANEL_OPEN = 'SET_CUSTOM_PANEL_OPEN';
|
|
712
|
-
const TOGGLE_HOME_SCREEN = 'GO_BACK_TO_HOME';
|
|
713
|
-
const UPDATE_INPUT_STATE = 'UPDATE_INPUT_STATE';
|
|
714
|
-
const SET_IS_BROWSER_PAGE_VISIBLE = 'SET_IS_PAGE_VISIBLE';
|
|
715
|
-
const ADD_INPUT_FILE = 'ADD_INPUT_FILE';
|
|
716
|
-
const CLEAR_INPUT_FILES = 'CLEAR_INPUT_FILES';
|
|
717
|
-
const REMOVE_INPUT_FILE = 'REMOVE_INPUT_FILE';
|
|
718
|
-
const REMOVE_LOCAL_MESSAGE_ITEM = 'REMOVE_LOCAL_MESSAGE_ITEM';
|
|
719
|
-
const FILE_UPLOAD_INPUT_ERROR = 'FILE_UPLOAD_INPUT_ERROR';
|
|
720
|
-
const ADD_NESTED_MESSAGES = 'ADD_NESTED_MESSAGES';
|
|
721
|
-
const SET_RESPONSE_PANEL_IS_OPEN = 'SET_RESPONSE_PANEL_IS_OPEN';
|
|
722
|
-
const SET_RESPONSE_PANEL_CONTENT = 'SET_PANEL_RESPONSE_CONTENT';
|
|
723
|
-
const STREAMING_ADD_CHUNK = 'STREAMING_ADD_CHUNK';
|
|
724
|
-
const STREAMING_START = 'STREAMING_START';
|
|
725
|
-
const ADD_NOTIFICATION = 'ADD_NOTIFICATION';
|
|
726
|
-
const REMOVE_ALL_NOTIFICATIONS = 'REMOVE_ALL_NOTIFICATIONS';
|
|
727
|
-
const REMOVE_NOTIFICATIONS = 'REMOVE_NOTIFICATIONS';
|
|
728
|
-
const actions = {
|
|
729
|
-
/**
|
|
730
|
-
* Allows you to change any portion of the app state.
|
|
731
|
-
*/
|
|
732
|
-
changeState(partialState) {
|
|
733
|
-
// Using "UnknownAction" here seems to be required or our dts bundler blows up on this with a "this node exceeds the
|
|
734
|
-
// maximum length" error.
|
|
735
|
-
return { type: CHANGE_STATE, partialState };
|
|
736
|
-
},
|
|
737
|
-
setMainConfig(mainConfig) {
|
|
738
|
-
return {
|
|
739
|
-
type: SET_MAIN_CONFIG,
|
|
740
|
-
mainConfig,
|
|
741
|
-
};
|
|
742
|
-
},
|
|
743
|
-
chatWasHydrated() {
|
|
744
|
-
return { type: HYDRATE_CHAT };
|
|
745
|
-
},
|
|
746
|
-
hydrateMessageHistory(messageHistory) {
|
|
747
|
-
return { type: HYDRATE_MESSAGE_HISTORY, messageHistory };
|
|
748
|
-
},
|
|
749
|
-
removeMessages(messageIDs) {
|
|
750
|
-
return { type: REMOVE_MESSAGES, messageIDs };
|
|
751
|
-
},
|
|
752
|
-
restartConversation() {
|
|
753
|
-
return {
|
|
754
|
-
type: RESTART_CONVERSATION,
|
|
755
|
-
};
|
|
756
|
-
},
|
|
757
|
-
/**
|
|
758
|
-
* Adds the given message item to the message list. If the message item is already in the list, it will not be
|
|
759
|
-
* added again and will be left at its current position (unless addAfterID is provided) but the contents of the
|
|
760
|
-
* message will be replaced with the new item.
|
|
761
|
-
*
|
|
762
|
-
* @param messageItem The message item to add or replaced.
|
|
763
|
-
* @param message The full message the item belongs to.
|
|
764
|
-
* @param addMessage Indicates if the full message should also be added to the store along with the item.
|
|
765
|
-
* @param addAfterID Indicates if the message item should be inserted immediately after another item that may
|
|
766
|
-
* already be in the list. If this value is not provided, the item will be inserted at the end of the list (if it
|
|
767
|
-
* does not already exist in the list).
|
|
768
|
-
*/
|
|
769
|
-
addLocalMessageItem(messageItem, message, addMessage, addAfterID) {
|
|
770
|
-
return {
|
|
771
|
-
type: ADD_LOCAL_MESSAGE_ITEM,
|
|
772
|
-
messageItem,
|
|
773
|
-
message,
|
|
774
|
-
addMessage,
|
|
775
|
-
addAfterID,
|
|
776
|
-
};
|
|
777
|
-
},
|
|
778
|
-
/**
|
|
779
|
-
* Adds the given message to the message list. This may also re-order any existing message items that are already
|
|
780
|
-
* visible due to being received from previous streaming chunks.
|
|
781
|
-
*/
|
|
782
|
-
addMessage(message) {
|
|
783
|
-
return { type: ADD_MESSAGE, message };
|
|
784
|
-
},
|
|
785
|
-
updateLocalMessageItem(messageItem) {
|
|
786
|
-
return { type: UPDATE_LOCAL_MESSAGE_ITEM, messageItem };
|
|
787
|
-
},
|
|
788
|
-
updateMessage(message) {
|
|
789
|
-
return { type: UPDATE_MESSAGE, message };
|
|
790
|
-
},
|
|
791
|
-
messageSetOptionSelected(messageID, sentMessage) {
|
|
792
|
-
return {
|
|
793
|
-
type: MESSAGE_SET_OPTION_SELECTED,
|
|
794
|
-
messageID,
|
|
795
|
-
sentMessage,
|
|
796
|
-
};
|
|
797
|
-
},
|
|
798
|
-
updatePersistedChatState(chatState) {
|
|
799
|
-
return {
|
|
800
|
-
type: UPDATE_PERSISTED_CHAT_STATE,
|
|
801
|
-
chatState,
|
|
802
|
-
};
|
|
803
|
-
},
|
|
804
|
-
setTourData(newActiveTourMessageID) {
|
|
805
|
-
return {
|
|
806
|
-
type: SET_TOUR_DATA,
|
|
807
|
-
newActiveTourMessageID,
|
|
808
|
-
};
|
|
809
|
-
},
|
|
810
|
-
clearTourData() {
|
|
811
|
-
return {
|
|
812
|
-
type: CLEAR_TOUR_DATA,
|
|
813
|
-
};
|
|
814
|
-
},
|
|
815
|
-
changeStepInTour(newStepNumber) {
|
|
816
|
-
return {
|
|
817
|
-
type: CHANGE_STEP_IN_TOUR,
|
|
818
|
-
newStepNumber,
|
|
819
|
-
};
|
|
820
|
-
},
|
|
821
|
-
updateSessionID(sessionID) {
|
|
822
|
-
return {
|
|
823
|
-
type: UPDATE_SESSION_ID,
|
|
824
|
-
sessionID,
|
|
825
|
-
};
|
|
826
|
-
},
|
|
827
|
-
updateSessionStartedTimestamp(sessionStartedTimestamp) {
|
|
828
|
-
return {
|
|
829
|
-
type: UPDATE_SESSION_STARTED_TIMESTAMP,
|
|
830
|
-
sessionStartedTimestamp,
|
|
831
|
-
};
|
|
832
|
-
},
|
|
833
|
-
updateHasSentNonWelcomeMessage(hasSentNonWelcomeMessage) {
|
|
834
|
-
return {
|
|
835
|
-
type: UPDATE_HAS_SENT_NON_WELCOME_MESSAGE,
|
|
836
|
-
hasSentNonWelcomeMessage,
|
|
837
|
-
};
|
|
838
|
-
},
|
|
839
|
-
setAppStateValue(key, value) {
|
|
840
|
-
return {
|
|
841
|
-
type: SET_APP_STATE_VALUE,
|
|
842
|
-
key,
|
|
843
|
-
value,
|
|
844
|
-
};
|
|
845
|
-
},
|
|
846
|
-
addIsTypingCounter(addToIsTyping) {
|
|
847
|
-
return {
|
|
848
|
-
type: ADD_IS_TYPING_COUNTER,
|
|
849
|
-
addToIsTyping,
|
|
850
|
-
};
|
|
851
|
-
},
|
|
852
|
-
addIsLoadingCounter(addToIsLoading) {
|
|
853
|
-
return {
|
|
854
|
-
type: ADD_IS_LOADING_COUNTER,
|
|
855
|
-
addToIsLoading,
|
|
856
|
-
};
|
|
857
|
-
},
|
|
858
|
-
updateBotName(name) {
|
|
859
|
-
return { type: UPDATE_BOT_NAME, name };
|
|
860
|
-
},
|
|
861
|
-
updateMainHeaderTitle(title) {
|
|
862
|
-
return { type: UPDATE_MAIN_HEADER_TITLE, title };
|
|
863
|
-
},
|
|
864
|
-
updateBotAvatarURL(url) {
|
|
865
|
-
return { type: UPDATE_BOT_AVATAR_URL, url };
|
|
866
|
-
},
|
|
867
|
-
updateLauncherAvatarURL(source) {
|
|
868
|
-
return { type: UPDATE_LAUNCHER_AVATAR_URL, source };
|
|
869
|
-
},
|
|
870
|
-
updateCSSVariables(variables, publicVars, remoteStyles) {
|
|
871
|
-
return { type: UPDATE_CSS_VARIABLES, variables, publicVars, remoteStyles };
|
|
872
|
-
},
|
|
873
|
-
updateThemeConfig(themeConfig) {
|
|
874
|
-
return { type: UPDATE_THEME_CONFIG, themeConfig };
|
|
875
|
-
},
|
|
876
|
-
updateStreamingConfig(streamingConfig) {
|
|
877
|
-
return { type: UPDATE_STREAMING_CONFIG, streamingConfig };
|
|
878
|
-
},
|
|
879
|
-
updateHomeScreenConfig(homeScreenConfig) {
|
|
880
|
-
return { type: UPDATE_HOME_SCREEN_CONFIG, homeScreenConfig };
|
|
881
|
-
},
|
|
882
|
-
/**
|
|
883
|
-
* Updates the configuration for the suggestions feature. Only the properties that are defined here will be
|
|
884
|
-
* applied to the updated config.
|
|
885
|
-
*/
|
|
886
|
-
updateAlternateSuggestionsConfig(config) {
|
|
887
|
-
return { type: UPDATE_ALTERNATE_SUGGESTIONS_CONFIG, config };
|
|
888
|
-
},
|
|
889
|
-
setViewState(viewState) {
|
|
890
|
-
return { type: SET_VIEW_STATE, viewState };
|
|
891
|
-
},
|
|
892
|
-
setViewChanging(viewChanging) {
|
|
893
|
-
return { type: SET_VIEW_CHANGING, viewChanging };
|
|
894
|
-
},
|
|
895
|
-
setInitialViewChangeComplete(changeComplete) {
|
|
896
|
-
return { type: SET_INITIAL_VIEW_CHANGE_COMPLETE, changeComplete };
|
|
897
|
-
},
|
|
898
|
-
/**
|
|
899
|
-
* Sets the give property of the {@link LocalMessageUIState} associated with the message of the given ID to the
|
|
900
|
-
* given value.
|
|
901
|
-
*
|
|
902
|
-
* @param localMessageID The ID of the message to update.
|
|
903
|
-
* @param propertyName The name of the property to update.
|
|
904
|
-
* @param propertyValue The value to set on the property.
|
|
905
|
-
*/
|
|
906
|
-
setMessageUIProperty(localMessageID, propertyName, propertyValue) {
|
|
907
|
-
return { type: SET_MESSAGE_UI_PROPERTY, localMessageID, propertyName, propertyValue };
|
|
908
|
-
},
|
|
909
|
-
/**
|
|
910
|
-
* Sets the value of one of the properties of {@link PersistedLauncherState}.
|
|
911
|
-
*/
|
|
912
|
-
setLauncherProperty(propertyName, propertyValue) {
|
|
913
|
-
return { type: SET_LAUNCHER_PROPERTY, propertyName, propertyValue };
|
|
914
|
-
},
|
|
915
|
-
setLauncherConfigProperty(propertyName, propertyValue, launcherType) {
|
|
916
|
-
return { type: SET_LAUNCHER_CONFIG_PROPERTY, propertyName, propertyValue, launcherType };
|
|
917
|
-
},
|
|
918
|
-
/**
|
|
919
|
-
* Sets the give property of the {@link MessageHistory} associated with the message of the given ID to the given
|
|
920
|
-
* value.
|
|
921
|
-
*
|
|
922
|
-
* @param messageID The ID of the message to update.
|
|
923
|
-
* @param propertyName The name of the property to update.
|
|
924
|
-
* @param propertyValue The value to set on the property.
|
|
925
|
-
*/
|
|
926
|
-
setMessageHistoryProperty(messageID, propertyName, propertyValue) {
|
|
927
|
-
return { type: SET_MESSAGE_HISTORY_PROPERTY, messageID, propertyName, propertyValue };
|
|
928
|
-
},
|
|
929
|
-
setMessageErrorState(messageID, errorState) {
|
|
930
|
-
return actions.setMessageHistoryProperty(messageID, 'error_state', errorState);
|
|
931
|
-
},
|
|
932
|
-
/**
|
|
933
|
-
* Marks the given message to indicate that it has been announced and doesn't need to be announced again.
|
|
934
|
-
*/
|
|
935
|
-
setMessageWasAnnounced(messageID) {
|
|
936
|
-
return actions.setMessageUIProperty(messageID, 'needsAnnouncement', false);
|
|
937
|
-
},
|
|
938
|
-
/**
|
|
939
|
-
* Sets the given message as the current accessibility announcement so that it will immediately be read by a
|
|
940
|
-
* screen reader.
|
|
941
|
-
*/
|
|
942
|
-
announceMessage(message) {
|
|
943
|
-
return { type: ANNOUNCE_MESSAGE, message };
|
|
944
|
-
},
|
|
945
|
-
/**
|
|
946
|
-
* Changes the open status of the alternate suggestions.
|
|
947
|
-
*
|
|
948
|
-
* @param panelState The new state to set for the alternate suggestions open state.
|
|
949
|
-
* @param suggestionsToggledReason Indicates the reason for the change.
|
|
950
|
-
*/
|
|
951
|
-
setAlternateSuggestionsPanelState(panelState, suggestionsToggledReason) {
|
|
952
|
-
return { type: SET_ALTERNATE_SUGGESTIONS_OPEN, panelState, suggestionsToggledReason };
|
|
953
|
-
},
|
|
954
|
-
/**
|
|
955
|
-
* Indicates that the third strike against the alternate suggestions has been triggered.
|
|
956
|
-
*/
|
|
957
|
-
setAlternateSuggestionsThirdStrike() {
|
|
958
|
-
return { type: SET_ALTERNATE_SUGGESTIONS_THIRD_STRIKE };
|
|
959
|
-
},
|
|
960
|
-
/**
|
|
961
|
-
* Sets the property on one of the {@link ChatMessagesState} values.
|
|
962
|
-
*/
|
|
963
|
-
setChatMessagesStateProperty(propertyName, propertyValue) {
|
|
964
|
-
return { type: SET_CHAT_MESSAGES_PROPERTY, propertyName, propertyValue };
|
|
965
|
-
},
|
|
966
|
-
/**
|
|
967
|
-
* Add a notification to the state.
|
|
968
|
-
*/
|
|
969
|
-
addNotification(notification) {
|
|
970
|
-
const notificationID = uuid();
|
|
971
|
-
return { type: ADD_NOTIFICATION, notificationID, notification };
|
|
972
|
-
},
|
|
973
|
-
/**
|
|
974
|
-
* Remove notifications using the given ids.
|
|
975
|
-
*/
|
|
976
|
-
removeNotifications({ groupID, notificationID }) {
|
|
977
|
-
return { type: REMOVE_NOTIFICATIONS, groupID, notificationID };
|
|
978
|
-
},
|
|
979
|
-
/**
|
|
980
|
-
* Remove all notifications from the state.
|
|
981
|
-
*/
|
|
982
|
-
removeAllNotifications() {
|
|
983
|
-
return { type: REMOVE_ALL_NOTIFICATIONS };
|
|
984
|
-
},
|
|
985
|
-
/**
|
|
986
|
-
* Sets the disclaimer state for the current domain to true.
|
|
987
|
-
*/
|
|
988
|
-
acceptDisclaimer() {
|
|
989
|
-
return { type: ACCEPTED_DISCLAIMER };
|
|
990
|
-
},
|
|
991
|
-
/**
|
|
992
|
-
* Marks the suggestion with the given index as being the currently selected one.
|
|
993
|
-
*/
|
|
994
|
-
setSuggestionsSelectedIndex(index, section) {
|
|
995
|
-
return { type: SUGGESTIONS_SET_SELECTED_INDEX, index, section };
|
|
996
|
-
},
|
|
997
|
-
/**
|
|
998
|
-
* For toggling Home Screen open state.
|
|
999
|
-
*/
|
|
1000
|
-
setHomeScreenIsOpen(isOpen) {
|
|
1001
|
-
return { type: SET_HOME_SCREEN_IS_OPEN, isOpen };
|
|
1002
|
-
},
|
|
1003
|
-
updateHistoryUserDefinedCount(messageID) {
|
|
1004
|
-
return { type: SET_UPDATE_HISTORY_USER_DEFINED_COUNT, messageID };
|
|
1005
|
-
},
|
|
1006
|
-
updateLauncherConfig(launcherConfig) {
|
|
1007
|
-
return { type: UPDATE_LAUNCHER_CONFIG, launcherConfig };
|
|
1008
|
-
},
|
|
1009
|
-
updateBrandingConfig(brandingConfig) {
|
|
1010
|
-
return { type: UPDATE_BRANDING_CONFIG, brandingConfig };
|
|
1011
|
-
},
|
|
1012
|
-
setBrandingOverlayIsOpen(isOpen) {
|
|
1013
|
-
return { type: SET_BRANDING_OVERLAY_IS_OPEN, isOpen };
|
|
1014
|
-
},
|
|
1015
|
-
setBrandingBannerShown(showBanner) {
|
|
1016
|
-
return { type: SET_BRANDING_BANNER_SHOWN, showBanner };
|
|
1017
|
-
},
|
|
1018
|
-
setSuggestionsSearchResults(searchResultItem) {
|
|
1019
|
-
return { type: SET_SUGGESTIONS_SEARCH_RESULTS, searchResultItem };
|
|
1020
|
-
},
|
|
1021
|
-
setLauncherMinimized() {
|
|
1022
|
-
return { type: SET_LAUNCHER_MINIMIZED };
|
|
1023
|
-
},
|
|
1024
|
-
closeIFramePanel() {
|
|
1025
|
-
return { type: CLOSE_IFRAME_PANEL };
|
|
1026
|
-
},
|
|
1027
|
-
setIFrameContent(messageItem) {
|
|
1028
|
-
return { type: OPEN_IFRAME_CONTENT, messageItem };
|
|
1029
|
-
},
|
|
1030
|
-
setViewSourcePanelIsOpen(isOpen, citationItem, relatedSearchResult) {
|
|
1031
|
-
return {
|
|
1032
|
-
type: SET_CONVERSATIONAL_SEARCH_CITATION_PANEL_IS_OPEN,
|
|
1033
|
-
isOpen,
|
|
1034
|
-
citationItem,
|
|
1035
|
-
relatedSearchResult,
|
|
1036
|
-
};
|
|
1037
|
-
},
|
|
1038
|
-
setCustomPanelConfigOptions(options) {
|
|
1039
|
-
return { type: SET_CUSTOM_PANEL_OPTIONS, options };
|
|
1040
|
-
},
|
|
1041
|
-
setCustomPanelOpen(isOpen) {
|
|
1042
|
-
return { type: SET_CUSTOM_PANEL_OPEN, isOpen };
|
|
1043
|
-
},
|
|
1044
|
-
/**
|
|
1045
|
-
* Switches between the bot and home screen views.
|
|
1046
|
-
*/
|
|
1047
|
-
toggleHomeScreen() {
|
|
1048
|
-
return { type: TOGGLE_HOME_SCREEN };
|
|
1049
|
-
},
|
|
1050
|
-
/**
|
|
1051
|
-
* Updates the state of the input field.
|
|
1052
|
-
*/
|
|
1053
|
-
updateInputState(newState, isInputToAgent) {
|
|
1054
|
-
return { type: UPDATE_INPUT_STATE, newState, isInputToAgent };
|
|
1055
|
-
},
|
|
1056
|
-
/**
|
|
1057
|
-
* Changes the values that indicates whether the browser page is visible.
|
|
1058
|
-
*/
|
|
1059
|
-
setIsBrowserPageVisible(isVisible) {
|
|
1060
|
-
return { type: SET_IS_BROWSER_PAGE_VISIBLE, isVisible };
|
|
1061
|
-
},
|
|
1062
|
-
/**
|
|
1063
|
-
* Adds a new file to the input area for uploaded.
|
|
1064
|
-
*/
|
|
1065
|
-
addInputFile(file, isInputToAgent) {
|
|
1066
|
-
return { type: ADD_INPUT_FILE, file, isInputToAgent };
|
|
1067
|
-
},
|
|
1068
|
-
/**
|
|
1069
|
-
* Removes a file attachment from the upload attachments area.
|
|
1070
|
-
*/
|
|
1071
|
-
removeFileUpload(fileID, isInputToAgent) {
|
|
1072
|
-
return { type: REMOVE_INPUT_FILE, fileID, isInputToAgent };
|
|
1073
|
-
},
|
|
1074
|
-
/**
|
|
1075
|
-
* Removes the local message item with the given ID from the message list.
|
|
1076
|
-
*/
|
|
1077
|
-
removeLocalMessageItem(localMessageItemID) {
|
|
1078
|
-
return { type: REMOVE_LOCAL_MESSAGE_ITEM, localMessageItemID };
|
|
1079
|
-
},
|
|
1080
|
-
/**
|
|
1081
|
-
* Updates the input area to indicate that a file upload is in error.
|
|
1082
|
-
*/
|
|
1083
|
-
fileUploadInputError(fileID, errorMessage, isInputToAgent) {
|
|
1084
|
-
return { type: FILE_UPLOAD_INPUT_ERROR, fileID, errorMessage, isInputToAgent };
|
|
1085
|
-
},
|
|
1086
|
-
/**
|
|
1087
|
-
* Removes all the files from the input area.
|
|
1088
|
-
*/
|
|
1089
|
-
clearInputFiles(isInputToAgent) {
|
|
1090
|
-
return { type: CLEAR_INPUT_FILES, isInputToAgent };
|
|
1091
|
-
},
|
|
1092
|
-
addNestedMessages(localMessageItems) {
|
|
1093
|
-
return { type: ADD_NESTED_MESSAGES, localMessageItems };
|
|
1094
|
-
},
|
|
1095
|
-
setResponsePanelIsOpen(isOpen) {
|
|
1096
|
-
return { type: SET_RESPONSE_PANEL_IS_OPEN, isOpen };
|
|
1097
|
-
},
|
|
1098
|
-
setResponsePanelContent(localMessageItem, isMessageForInput = false) {
|
|
1099
|
-
return { type: SET_RESPONSE_PANEL_CONTENT, localMessageItem, isMessageForInput };
|
|
1100
|
-
},
|
|
1101
|
-
/**
|
|
1102
|
-
* Adds a message to the store to begin the streaming process.
|
|
1103
|
-
*/
|
|
1104
|
-
streamingStart(messageID) {
|
|
1105
|
-
return { type: STREAMING_START, messageID };
|
|
1106
|
-
},
|
|
1107
|
-
/**
|
|
1108
|
-
* Adds a new chunk of a streaming response to an existing message.
|
|
1109
|
-
*/
|
|
1110
|
-
streamingAddChunk(fullMessageID, chunkItem, isCompleteItem, disableFadeAnimation) {
|
|
1111
|
-
return { type: STREAMING_ADD_CHUNK, fullMessageID, chunkItem, isCompleteItem, disableFadeAnimation };
|
|
1112
|
-
},
|
|
1113
|
-
};
|
|
1114
|
-
|
|
1115
|
-
/**
|
|
1116
|
-
*
|
|
1117
|
-
* IBM Confidential
|
|
1118
|
-
*
|
|
1119
|
-
* (C) Copyright IBM Corp. 2019, 2023
|
|
1120
|
-
*
|
|
1121
|
-
* The source code for this program is not published or otherwise
|
|
1122
|
-
* divested of its trade secrets, irrespective of what has been
|
|
1123
|
-
* deposited with the U. S. Copyright Office
|
|
1124
|
-
*
|
|
1125
|
-
* US Government Users Restricted Rights - Use, duplication or
|
|
1126
|
-
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
|
1127
|
-
*
|
|
1128
|
-
*/
|
|
1129
|
-
/**
|
|
1130
|
-
* The different type of error states a given message can be in.
|
|
1131
|
-
*/
|
|
1132
|
-
var MessageErrorState;
|
|
1133
|
-
(function (MessageErrorState) {
|
|
1134
|
-
/**
|
|
1135
|
-
* No errors.
|
|
1136
|
-
*/
|
|
1137
|
-
MessageErrorState[MessageErrorState["NONE"] = 1] = "NONE";
|
|
1138
|
-
/**
|
|
1139
|
-
* The message failed to be sent and no more attempts will be made.
|
|
1140
|
-
*/
|
|
1141
|
-
MessageErrorState[MessageErrorState["FAILED"] = 2] = "FAILED";
|
|
1142
|
-
/**
|
|
1143
|
-
* There was an error sending the message but the system is retrying the message.
|
|
1144
|
-
*/
|
|
1145
|
-
MessageErrorState[MessageErrorState["RETRYING"] = 3] = "RETRYING";
|
|
1146
|
-
/**
|
|
1147
|
-
* Indicates that the previous message has entered the retrying state and that this message is waiting for it to
|
|
1148
|
-
* finish or fail. This message will remain in the waiting state until it finishes successfully or it enters a
|
|
1149
|
-
* retrying state itself.
|
|
1150
|
-
*/
|
|
1151
|
-
MessageErrorState[MessageErrorState["WAITING"] = 4] = "WAITING";
|
|
1152
|
-
})(MessageErrorState || (MessageErrorState = {}));
|
|
1153
|
-
|
|
1154
|
-
/**
|
|
1155
|
-
*
|
|
1156
|
-
* IBM Confidential
|
|
1157
|
-
*
|
|
1158
|
-
* (C) Copyright IBM Corp. 2019, 2023
|
|
1159
|
-
*
|
|
1160
|
-
* The source code for this program is not published or otherwise
|
|
1161
|
-
* divested of its trade secrets, irrespective of what has been
|
|
1162
|
-
* deposited with the U. S. Copyright Office
|
|
1163
|
-
*
|
|
1164
|
-
* US Government Users Restricted Rights - Use, duplication or
|
|
1165
|
-
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
|
1166
|
-
*
|
|
1167
|
-
*/
|
|
1168
|
-
/**
|
|
1169
|
-
* Calculates the text to display for a given agent message type.
|
|
1170
|
-
*/
|
|
1171
|
-
function getAgentStatusMessageText(agentMessageType, agentProfile, intl) {
|
|
1172
|
-
const name = agentProfile?.nickname;
|
|
1173
|
-
let messageKey;
|
|
1174
|
-
switch (agentMessageType) {
|
|
1175
|
-
case AgentMessageType.AGENT_JOINED: {
|
|
1176
|
-
messageKey = name ? 'agent_agentJoinedName' : 'agent_agentJoinedNoName';
|
|
1177
|
-
break;
|
|
1178
|
-
}
|
|
1179
|
-
case AgentMessageType.RELOAD_WARNING: {
|
|
1180
|
-
messageKey = 'agent_youConnectedWarning';
|
|
1181
|
-
break;
|
|
1182
|
-
}
|
|
1183
|
-
case AgentMessageType.AGENT_LEFT_CHAT: {
|
|
1184
|
-
messageKey = name ? 'agent_agentLeftChat' : 'agent_agentLeftChatNoName';
|
|
1185
|
-
break;
|
|
1186
|
-
}
|
|
1187
|
-
case AgentMessageType.AGENT_ENDED_CHAT: {
|
|
1188
|
-
messageKey = name ? 'agent_agentEndedChat' : 'agent_agentEndedChatNoName';
|
|
1189
|
-
break;
|
|
1190
|
-
}
|
|
1191
|
-
case AgentMessageType.TRANSFER_TO_AGENT: {
|
|
1192
|
-
messageKey = name ? 'agent_transferring' : 'agent_transferringNoName';
|
|
1193
|
-
break;
|
|
1194
|
-
}
|
|
1195
|
-
case AgentMessageType.USER_ENDED_CHAT: {
|
|
1196
|
-
messageKey = 'agent_youEndedChat';
|
|
1197
|
-
break;
|
|
1198
|
-
}
|
|
1199
|
-
case AgentMessageType.CHAT_WAS_ENDED: {
|
|
1200
|
-
messageKey = 'agent_conversationWasEnded';
|
|
1201
|
-
break;
|
|
1202
|
-
}
|
|
1203
|
-
case AgentMessageType.DISCONNECTED: {
|
|
1204
|
-
messageKey = 'agent_disconnected';
|
|
1205
|
-
break;
|
|
1206
|
-
}
|
|
1207
|
-
case AgentMessageType.RECONNECTED: {
|
|
1208
|
-
messageKey = 'agent_reconnected';
|
|
1209
|
-
break;
|
|
1210
|
-
}
|
|
1211
|
-
case AgentMessageType.SHARING_REQUESTED: {
|
|
1212
|
-
messageKey = 'agent_sharingRequested';
|
|
1213
|
-
break;
|
|
1214
|
-
}
|
|
1215
|
-
case AgentMessageType.SHARING_ACCEPTED: {
|
|
1216
|
-
messageKey = 'agent_sharingAccepted';
|
|
1217
|
-
break;
|
|
1218
|
-
}
|
|
1219
|
-
case AgentMessageType.SHARING_DECLINED: {
|
|
1220
|
-
messageKey = 'agent_sharingDeclined';
|
|
1221
|
-
break;
|
|
1222
|
-
}
|
|
1223
|
-
case AgentMessageType.SHARING_CANCELLED: {
|
|
1224
|
-
messageKey = 'agent_sharingCancelled';
|
|
1225
|
-
break;
|
|
1226
|
-
}
|
|
1227
|
-
case AgentMessageType.SHARING_ENDED: {
|
|
1228
|
-
messageKey = 'agent_sharingEnded';
|
|
1229
|
-
break;
|
|
1230
|
-
}
|
|
1231
|
-
default:
|
|
1232
|
-
return '';
|
|
1233
|
-
}
|
|
1234
|
-
return messageKey && intl.formatMessage({ id: messageKey }, { personName: name });
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
/**
|
|
1238
|
-
*
|
|
1239
|
-
* IBM Confidential
|
|
1240
|
-
*
|
|
1241
|
-
* (C) Copyright IBM Corp. 2022, 2023
|
|
1242
|
-
*
|
|
1243
|
-
* The source code for this program is not published or otherwise
|
|
1244
|
-
* divested of its trade secrets, irrespective of what has been
|
|
1245
|
-
* deposited with the U. S. Copyright Office
|
|
1246
|
-
*
|
|
1247
|
-
* US Government Users Restricted Rights - Use, duplication or
|
|
1248
|
-
* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
|
|
1249
|
-
*
|
|
1250
|
-
*/
|
|
1251
|
-
/**
|
|
1252
|
-
* Creates a LocalAndOriginalMessagesPair.
|
|
1253
|
-
*/
|
|
1254
|
-
function toPair(localMessages, originalMessage) {
|
|
1255
|
-
return { localMessages, originalMessage };
|
|
1256
|
-
}
|
|
1257
|
-
/**
|
|
1258
|
-
* Create a local message that represent a status message to display to the user.
|
|
1259
|
-
*/
|
|
1260
|
-
async function createAgentLocalMessage(agentMessageType, serviceManager, agentProfile, fireEvents = true) {
|
|
1261
|
-
const text = getAgentStatusMessageText(agentMessageType, agentProfile, serviceManager.intl);
|
|
1262
|
-
const result = createAgentLocalMessageForType(agentMessageType);
|
|
1263
|
-
const { originalMessage, localMessage } = result;
|
|
1264
|
-
localMessage.item.text = text;
|
|
1265
|
-
if (agentProfile) {
|
|
1266
|
-
if (!originalMessage.history) {
|
|
1267
|
-
originalMessage.history = {};
|
|
1268
|
-
}
|
|
1269
|
-
originalMessage.history.agent_profile = agentProfile;
|
|
1270
|
-
}
|
|
1271
|
-
if (fireEvents) {
|
|
1272
|
-
await serviceManager.fire({ type: "agent:pre:receive" /* BusEventType.AGENT_PRE_RECEIVE */, data: originalMessage });
|
|
1273
|
-
}
|
|
1274
|
-
deepFreeze(originalMessage);
|
|
1275
|
-
if (fireEvents) {
|
|
1276
|
-
await serviceManager.fire({ type: "agent:receive" /* BusEventType.AGENT_RECEIVE */, data: originalMessage });
|
|
1277
|
-
}
|
|
1278
|
-
return result;
|
|
1279
|
-
}
|
|
1280
|
-
/**
|
|
1281
|
-
* Creates an empty skeleton of a {@link LocalMessageItem} with the given agent message type.
|
|
1282
|
-
*/
|
|
1283
|
-
function createAgentLocalMessageForType(agentMessageType) {
|
|
1284
|
-
const messageItem = {
|
|
1285
|
-
response_type: MessageResponseTypes.TEXT,
|
|
1286
|
-
agent_message_type: agentMessageType,
|
|
1287
|
-
};
|
|
1288
|
-
const originalMessage = createMessageResponseForItem(messageItem);
|
|
1289
|
-
const localMessage = outputItemToLocalItem(messageItem, originalMessage);
|
|
1290
|
-
return { localMessage, originalMessage };
|
|
1291
|
-
}
|
|
1292
|
-
/**
|
|
1293
|
-
* Creates a message for the "bot returns" message that is displayed after a chat is ended. If there is no text in
|
|
1294
|
-
* the language pack for this message, the message will be undefined.
|
|
1295
|
-
*/
|
|
1296
|
-
function createBotReturnMessage(languagePack) {
|
|
1297
|
-
// Create a bot message to let the user know the bot has returned.
|
|
1298
|
-
const { agent_botReturned } = languagePack;
|
|
1299
|
-
if (!agent_botReturned) {
|
|
1300
|
-
// No text, so don't show anything.
|
|
1301
|
-
return null;
|
|
1302
|
-
}
|
|
1303
|
-
const { originalMessage, localMessage } = createAgentLocalMessageForType(null);
|
|
1304
|
-
localMessage.item.text = agent_botReturned;
|
|
1305
|
-
return { originalMessage, localMessage };
|
|
1306
|
-
}
|
|
1307
|
-
/**
|
|
1308
|
-
* Adds the given messages to the redux store and optionally to session history as well.
|
|
1309
|
-
*/
|
|
1310
|
-
async function addMessages(messagePairs, saveInHistory, fireHistoryEvent, skipLiveMessages, serviceManager) {
|
|
1311
|
-
if (!skipLiveMessages) {
|
|
1312
|
-
// Add to the redux store and fire any custom response events that are needed.
|
|
1313
|
-
await asyncForEach(messagePairs, async ({ localMessages, originalMessage }) => {
|
|
1314
|
-
await asyncForEach(localMessages, async (localMessage, index) => {
|
|
1315
|
-
await serviceManager.actions.handleUserDefinedResponseItems(localMessage, originalMessage);
|
|
1316
|
-
serviceManager.store.dispatch(actions.addLocalMessageItem(localMessage, originalMessage, index === 0));
|
|
1317
|
-
});
|
|
1318
|
-
});
|
|
1319
|
-
}
|
|
1320
|
-
// Send to session history.
|
|
1321
|
-
await asyncForEach(messagePairs, async ({ originalMessage }) => {
|
|
1322
|
-
const { disableAgentSessionHistory } = serviceManager.store.getState().config.public.serviceDesk;
|
|
1323
|
-
if (saveInHistory && !disableAgentSessionHistory) {
|
|
1324
|
-
try {
|
|
1325
|
-
let sessionHistoryMessage = originalMessage;
|
|
1326
|
-
if (fireHistoryEvent) {
|
|
1327
|
-
// If desired, fire an event to allow custom code to modify this message before we put it into session history.
|
|
1328
|
-
sessionHistoryMessage = cloneDeep(originalMessage);
|
|
1329
|
-
const event = {
|
|
1330
|
-
type: "agent:pre:sessionHistory" /* BusEventType.AGENT_PRE_SESSION_HISTORY */,
|
|
1331
|
-
message: sessionHistoryMessage,
|
|
1332
|
-
};
|
|
1333
|
-
await serviceManager.eventBus.fire(event, serviceManager.instance);
|
|
1334
|
-
// Custom code can assign this to null to avoid saving anything.
|
|
1335
|
-
sessionHistoryMessage = event.message;
|
|
1336
|
-
}
|
|
1337
|
-
if (sessionHistoryMessage) {
|
|
1338
|
-
await serviceManager.actions.sendUpdateHistoryEvent(sessionHistoryMessage.id, sessionHistoryMessage);
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
catch (error) {
|
|
1342
|
-
consoleError('Error in HumanAgentServiceImpl.addMessage', error);
|
|
1343
|
-
}
|
|
1344
|
-
}
|
|
1345
|
-
deepFreeze(originalMessage);
|
|
1346
|
-
});
|
|
1347
|
-
}
|
|
1348
|
-
/**
|
|
1349
|
-
* Adds an "end chat" message to the message list. Also adds a "bot return" message from the bot after (on an
|
|
1350
|
-
* optional delay). These messages will also be sent to the server to be included in the session history.
|
|
1351
|
-
*
|
|
1352
|
-
* @param agentMessageType The type of the "end chat" message.
|
|
1353
|
-
* @param agentProfile The profile of the agent who ended the chat (or null if not ended by an agent).
|
|
1354
|
-
* @param botReturnDelay The delay before adding the "bot return" message.
|
|
1355
|
-
* @param fireEvents Indicates if the agent events should be fired for the "end chat" message.
|
|
1356
|
-
* @param wasSuspended Indicates if the conversation was suspended before it was ended.
|
|
1357
|
-
* @param serviceManager The service manager to use.
|
|
1358
|
-
*/
|
|
1359
|
-
async function addEndChatMessages(agentMessageType, agentProfile, botReturnDelay, fireEvents, wasSuspended, serviceManager) {
|
|
1360
|
-
const endChatMessage = await createAgentLocalMessage(agentMessageType, serviceManager, agentProfile, fireEvents);
|
|
1361
|
-
await addMessages([toPair([endChatMessage.localMessage], endChatMessage.originalMessage)], true, false, wasSuspended, serviceManager);
|
|
1362
|
-
const botReturn = createBotReturnMessage(serviceManager.store.getState().languagePack);
|
|
1363
|
-
if (botReturn) {
|
|
1364
|
-
const initialRestartCount = serviceManager.restartCount;
|
|
1365
|
-
conditionalSetTimeout(() => {
|
|
1366
|
-
if (initialRestartCount === serviceManager.restartCount) {
|
|
1367
|
-
addMessages([toPair([botReturn.localMessage], botReturn.originalMessage)], true, false, wasSuspended, serviceManager);
|
|
1368
|
-
}
|
|
1369
|
-
}, botReturnDelay);
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
/**
|
|
1373
|
-
* Returns an array of text strings for the initial summary messages that are to be sent to an agent. If there are
|
|
1374
|
-
* no texts found, it will return an array with default text in it.
|
|
1375
|
-
*/
|
|
1376
|
-
function getSummaryMessages(connectItem, defaultText) {
|
|
1377
|
-
const messagesToAgent = connectItem?.transfer_info?.summary_message_to_agent;
|
|
1378
|
-
const texts = messagesToAgent?.map(message => message.text).filter(text => text);
|
|
1379
|
-
return texts?.length ? texts : [defaultText];
|
|
1380
|
-
}
|
|
1381
|
-
/**
|
|
1382
|
-
* The different types of built-in/out-of-the-box service desk integrations supported by web chat. The values used
|
|
1383
|
-
* here come from tooling and may refer to old or out-dated values so care should be made in modifying this list.
|
|
1384
|
-
*/
|
|
1385
|
-
var BuiltInServiceDesk;
|
|
1386
|
-
(function (BuiltInServiceDesk) {
|
|
1387
|
-
BuiltInServiceDesk["NICE_DFO"] = "nicedfo";
|
|
1388
|
-
BuiltInServiceDesk["GENESYS_MESSENGER"] = "genesyswebmessenger";
|
|
1389
|
-
BuiltInServiceDesk["SALES_FORCE"] = "salesforceweb";
|
|
1390
|
-
BuiltInServiceDesk["ZENDESK"] = "zendeskweb";
|
|
1391
|
-
})(BuiltInServiceDesk || (BuiltInServiceDesk = {}));
|
|
1392
|
-
|
|
1393
|
-
export { UPDATE_BRANDING_CONFIG as $, ADD_LOCAL_MESSAGE_ITEM as A, SET_VIEW_STATE as B, CHANGE_STATE as C, SET_VIEW_CHANGING as D, SET_INITIAL_VIEW_CHANGE_COMPLETE as E, UPDATE_BOT_NAME as F, UPDATE_BOT_AVATAR_URL as G, HYDRATE_CHAT as H, IS_SESSION_STORAGE as I, UPDATE_LAUNCHER_AVATAR_URL as J, UPDATE_MAIN_HEADER_TITLE as K, UPDATE_CSS_VARIABLES as L, MessageErrorState as M, UPDATE_THEME_CONFIG as N, UPDATE_STREAMING_CONFIG as O, UPDATE_HOME_SCREEN_CONFIG as P, SET_MESSAGE_UI_PROPERTY as Q, RESTART_CONVERSATION as R, SET_ALTERNATE_SUGGESTIONS_OPEN as S, SET_MESSAGE_HISTORY_PROPERTY as T, UPDATE_ALTERNATE_SUGGESTIONS_CONFIG as U, ANNOUNCE_MESSAGE as V, ACCEPTED_DISCLAIMER as W, SET_HOME_SCREEN_IS_OPEN as X, TOGGLE_HOME_SCREEN as Y, SET_UPDATE_HISTORY_USER_DEFINED_COUNT as Z, UPDATE_LAUNCHER_CONFIG as _, actions as a, SET_BRANDING_OVERLAY_IS_OPEN as a0, SET_BRANDING_BANNER_SHOWN as a1, SET_LAUNCHER_PROPERTY as a2, SET_LAUNCHER_CONFIG_PROPERTY as a3, SET_CHAT_MESSAGES_PROPERTY as a4, SET_LAUNCHER_MINIMIZED as a5, OPEN_IFRAME_CONTENT as a6, CLOSE_IFRAME_PANEL as a7, SET_CONVERSATIONAL_SEARCH_CITATION_PANEL_IS_OPEN as a8, SET_CUSTOM_PANEL_OPEN as a9, getIPhoneHeightOffset as aA, IS_PHONE_IN_PORTRAIT_MODE as aB, BuiltInServiceDesk as aC, BROWSER_INFO as aD, getURLHostnameAndPath as aE, IS_TABLET as aF, addEndChatMessages as aG, addMessages as aH, toPair as aI, createAgentLocalMessage as aJ, isSecureHost as aK, getSummaryMessages as aL, SET_CUSTOM_PANEL_OPTIONS as aa, SET_TOUR_DATA as ab, CLEAR_TOUR_DATA as ac, CHANGE_STEP_IN_TOUR as ad, UPDATE_INPUT_STATE as ae, SET_IS_BROWSER_PAGE_VISIBLE as af, ADD_INPUT_FILE as ag, REMOVE_INPUT_FILE as ah, REMOVE_LOCAL_MESSAGE_ITEM as ai, ADD_NOTIFICATION as aj, REMOVE_NOTIFICATIONS as ak, REMOVE_ALL_NOTIFICATIONS as al, CLEAR_INPUT_FILES as am, FILE_UPLOAD_INPUT_ERROR as an, ADD_NESTED_MESSAGES as ao, SET_RESPONSE_PANEL_IS_OPEN as ap, SET_RESPONSE_PANEL_CONTENT as aq, STREAMING_START as ar, STREAMING_ADD_CHUNK as as, IS_PHONE as at, pullValueParam as au, IS_MOBILE as av, getURLHostName as aw, MIN_PDF_VIEWER_WIDTH as ax, conditionalSetTimeout as ay, IS_IOS as az, createLocalMessageForSessionExpiration as b, createLocalMessageForChannelTransferFailure as c, createLocalMessageItemsForNestedMessageItems as d, createLocalMessageForItem as e, createLocalMessageForInlineError as f, getBrowserInfo as g, SET_ALTERNATE_SUGGESTIONS_THIRD_STRIKE as h, SUGGESTIONS_SET_SELECTED_INDEX as i, SET_SUGGESTIONS_SEARCH_RESULTS as j, SET_MAIN_CONFIG as k, HYDRATE_MESSAGE_HISTORY as l, REMOVE_MESSAGES as m, UPDATE_LOCAL_MESSAGE_ITEM as n, outputItemToLocalItem as o, UPDATE_MESSAGE as p, ADD_MESSAGE as q, resolvablePromise as r, MESSAGE_SET_OPTION_SELECTED as s, ADD_IS_TYPING_COUNTER as t, ADD_IS_LOADING_COUNTER as u, SET_APP_STATE_VALUE as v, UPDATE_SESSION_ID as w, UPDATE_SESSION_STARTED_TIMESTAMP as x, UPDATE_PERSISTED_CHAT_STATE as y, UPDATE_HAS_SENT_NON_WELCOME_MESSAGE as z };
|
|
1
|
+
import{u as e,U as t,p as a,c as s,k as n,l as o}from"./aiChatEntry2.js";import{s as i,am as r,an as E,ao as c,L as _,ap as p,aq as g,ar as S,y as l,n as u,as as d,at as T,a2 as A,au as I,ab as N,X as m,o as y}from"./messageUtils.js";function f(){let e,t;const a=new Promise(((a,s)=>{e=a,t=s}));return a.doResolve=t=>{a.isResolved=!0,a.isComplete=!0,e(t)},a.doReject=e=>{a.isRejected=!0,a.isComplete=!0,t(e)},a.isResolved=!1,a.isRejected=!1,a.isComplete=!1,a}function h(a,s,n=!1,o=!1){const c={ui_state:{id:i(s.id,a)||e(t.LOCAL_MESSAGE),needsAnnouncement:!s.history.from_history,disableFadeAnimation:o},item:a,fullMessageID:s.id};return n&&(c.ui_state.isWelcomeResponse=!0),r(c)?E(c):c}function O(e){return C({response_type:a.INLINE_ERROR,text:e})}function C(e){const t=c(e);return{originalMessage:t,localMessage:h(e,t)}}function M(e,t){const a={response_type:e,text:t},s=c(a);return{originalMessage:s,localMessage:h(a,s)}}function w(e){return M(_.SESSION_EXPIRED,e)}function R(e){return M(_.CHANNEL_TRANSFER_FAILED,e)}function D(e,t,a,s,n){const{item:o}=e;if(p(o))e.ui_state.gridLocalMessageItemIDs=o.rows.map((n=>n.cells.map((n=>{const o=[];return P("items",e,n.items,o,t,a,s,(t=>L(e.item,t)),!1),o}))));else if(g(o))e.ui_state.itemsLocalMessageItemIDs=[],P("items",e,o.items,e.ui_state.itemsLocalMessageItemIDs,t,a,s,(e=>L(o,e)),n);else{const i=o.body||o.panel?.body;if(i&&(e.ui_state.bodyLocalMessageItemIDs=[],P("body",e,i,e.ui_state.bodyLocalMessageItemIDs,t,a,s,(e=>L(o,e)),!S(o)&&!l(o))),!n)return;const r=o.footer||o.panel?.footer;r&&(e.ui_state.footerLocalMessageItemIDs=[],P("footer",e,r,e.ui_state.footerLocalMessageItemIDs,t,a,s,(e=>function(e,t){if(I(t))return!l(e)&&!S(e)||!S(t);return!1}(o,e)),!S(o)))}}function P(e,t,a,n,o,i,r,E,c){a.forEach((a=>{if(E(a)){const e=h(a,o,!1,!0);n.push(e.ui_state.id),r.push(e),u(e.item)&&D(e,o,i,r,c)}else s(`The "${t.item.response_type}" response type does not support "${a.response_type}" in "${e}" array.`)}))}function L(e,t){switch(e.response_type){case _.CARD:return!T(t)&&d(t);case _.CAROUSEL:return T(t);case _.BUTTON:return e.button_type===A.SHOW_PANEL&&d(t);case _.GRID:return!T(t)&&d(t);case _.PANEL:return d(t);default:return!1}}var b=function(e,t,a){if(a||2===arguments.length)for(var s,n=0,o=t.length;n<o;n++)!s&&n in t||(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},v=function(e,t,a){this.name=e,this.version=t,this.os=a,this.type="browser"},G=function(e){this.version=e,this.type="node",this.name="node",this.os=process.platform},U=function(e,t,a,s){this.name=e,this.version=t,this.os=a,this.bot=s,this.type="bot-device"},H=function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null},W=function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null},k=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,B=3,F=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],V=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];const x="undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new W:"undefined"!=typeof navigator?function(e){var t=function(e){return""!==e&&F.reduce((function(t,a){var s=a[0],n=a[1];if(t)return t;var o=n.exec(e);return!!o&&[s,o]}),!1)}(e);if(!t)return null;var a=t[0],s=t[1];if("searchbot"===a)return new H;var n=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);n?n.length<B&&(n=b(b([],n,!0),function(e){for(var t=[],a=0;a<e;a++)t.push("0");return t}(B-n.length),!0)):n=[];var o=n.join("."),i=function(e){for(var t=0,a=V.length;t<a;t++){var s=V[t],n=s[0];if(s[1].exec(e))return n}return null}(e),r=k.exec(e);return r&&r[1]?new U(a,o,i,r[1]):new v(a,o,i)}(navigator.userAgent):"undefined"!=typeof process&&process.version?new G(process.version.slice(1)):null,$=x,Y=/iPad/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,K="iOS"===x?.os,j=K||"Android OS"===x?.os||Y,X=j&&(window.screen.width<500||window.screen.height<500),z=X&&window.screen.width<500,J=j&&!X,q=550,Q=[[896,114],[812,114],[736,75],[667,75]];function Z(){return{browser_name:$?.name,browser_version:$?.version,browser_OS:$?.os,language:window.navigator?.language,page_url:window.location.origin+window.location.pathname,screen_resolution:`width: ${window.screen?.width}, height: ${window.screen?.height}`,user_agent:window.navigator?.userAgent}}function ee(){const e=Math.max(screen.height,screen.width);for(let t=0;t<Q.length;t++){const[a,s]=Q[t];if(e>=a)return s}return 75}function te(){const{origin:e,pathname:t}=window.location;return e+t}function ae(){return"https:"===window.location.protocol}const se=N((function(){let e=!1;try{window.sessionStorage.setItem("web-chat-test-item","true"),window.sessionStorage.getItem("web-chat-test-item"),window.sessionStorage.removeItem("web-chat-test-item"),e=!0}catch{}return e}));function ne(e){try{return new URL(e).hostname}catch{return e}}function oe(e){const t=new URLSearchParams(window.location.search).get(e);return t?(function(e){const{location:t}=window,a=new URLSearchParams(t.search);if(a.has(e)){a.delete(e);let s=a.toString();s&&(s=`?${s}`);const n=t.origin+t.pathname+s+t.hash;history.replaceState(history.state,null,n)}}(e),t):null}function ie(e,t){return t?setTimeout(e,t):(e(),null)}const re="CHANGE_STATE",Ee="UPDATE_BOT_NAME",ce="UPDATE_BOT_AVATAR_URL",_e="UPDATE_LAUNCHER_AVATAR_URL",pe="UPDATE_MAIN_HEADER_TITLE",ge="HYDRATE_CHAT",Se="SET_MAIN_CONFIG",le="HYDRATE_MESSAGE_HISTORY",ue="ADD_LOCAL_MESSAGE_ITEM",de="REMOVE_MESSAGES",Te="UPDATE_LOCAL_MESSAGE_ITEM",Ae="SET_APP_STATE_VALUE",Ie="ADD_IS_TYPING_COUNTER",Ne="ADD_IS_LOADING_COUNTER",me="SET_VIEW_STATE",ye="SET_VIEW_CHANGING",fe="SET_INITIAL_VIEW_CHANGE_COMPLETE",he="UPDATE_CSS_VARIABLES",Oe="UPDATE_THEME_CONFIG",Ce="UPDATE_STREAMING_CONFIG",Me="MESSAGE_SET_OPTION_SELECTED",we="SET_MESSAGE_UI_PROPERTY",Re="SET_MESSAGE_HISTORY_PROPERTY",De="SET_LAUNCHER_PROPERTY",Pe="SET_LAUNCHER_CONFIG_PROPERTY",Le="ANNOUNCE_MESSAGE",be="SET_ALTERNATE_SUGGESTIONS_OPEN",ve="SET_CHAT_MESSAGES_PROPERTY",Ge="RESTART_CONVERSATION",Ue="SET_ALTERNATE_SUGGESTIONS_THIRD_STRIKE",He="ACCEPTED_DISCLAIMER",We="ADD_MESSAGE",ke="UPDATE_HOME_SCREEN_CONFIG",Be="UPDATE_ALTERNATE_SUGGESTIONS_CONFIG",Fe="SUGGESTIONS_SET_SELECTED_INDEX",Ve="UPDATE_SESSION_STARTED_TIMESTAMP",xe="UPDATE_SESSION_ID",$e="UPDATE_HAS_SENT_NON_WELCOME_MESSAGE",Ye="UPDATE_PERSISTED_CHAT_STATE",Ke="SET_TOUR_DATA",je="CLEAR_TOUR_DATA",Xe="CHANGE_STEP_IN_TOUR",ze="SET_HOME_SCREEN_IS_OPEN",Je="SET_UPDATE_HISTORY_USER_DEFINED_COUNT",qe="UPDATE_LAUNCHER_CONFIG",Qe="UPDATE_BRANDING_CONFIG",Ze="SET_BRANDING_OVERLAY_IS_OPEN",et="SET_BRANDING_BANNER_SHOWN",tt="SET_SUGGESTIONS_SEARCH_RESULTS",at="UPDATE_MESSAGE",st="SET_LAUNCHER_MINIMIZED",nt="CLOSE_IFRAME_PANEL",ot="OPEN_IFRAME_CONTENT",it="SET_CONVERSATIONAL_SEARCH_CITATION_PANEL_IS_OPEN",rt="SET_CUSTOM_PANEL_OPTIONS",Et="SET_CUSTOM_PANEL_OPEN",ct="GO_BACK_TO_HOME",_t="UPDATE_INPUT_STATE",pt="SET_IS_PAGE_VISIBLE",gt="ADD_INPUT_FILE",St="CLEAR_INPUT_FILES",lt="REMOVE_INPUT_FILE",ut="REMOVE_LOCAL_MESSAGE_ITEM",dt="FILE_UPLOAD_INPUT_ERROR",Tt="ADD_NESTED_MESSAGES",At="SET_RESPONSE_PANEL_IS_OPEN",It="SET_PANEL_RESPONSE_CONTENT",Nt="STREAMING_ADD_CHUNK",mt="STREAMING_START",yt="ADD_NOTIFICATION",ft="REMOVE_ALL_NOTIFICATIONS",ht="REMOVE_NOTIFICATIONS",Ot={changeState:e=>({type:re,partialState:e}),setMainConfig:e=>({type:Se,mainConfig:e}),chatWasHydrated:()=>({type:ge}),hydrateMessageHistory:e=>({type:le,messageHistory:e}),removeMessages:e=>({type:de,messageIDs:e}),restartConversation:()=>({type:Ge}),addLocalMessageItem:(e,t,a,s)=>({type:ue,messageItem:e,message:t,addMessage:a,addAfterID:s}),addMessage:e=>({type:We,message:e}),updateLocalMessageItem:e=>({type:Te,messageItem:e}),updateMessage:e=>({type:at,message:e}),messageSetOptionSelected:(e,t)=>({type:Me,messageID:e,sentMessage:t}),updatePersistedChatState:e=>({type:Ye,chatState:e}),setTourData:e=>({type:Ke,newActiveTourMessageID:e}),clearTourData:()=>({type:je}),changeStepInTour:e=>({type:Xe,newStepNumber:e}),updateSessionID:e=>({type:xe,sessionID:e}),updateSessionStartedTimestamp:e=>({type:Ve,sessionStartedTimestamp:e}),updateHasSentNonWelcomeMessage:e=>({type:$e,hasSentNonWelcomeMessage:e}),setAppStateValue:(e,t)=>({type:Ae,key:e,value:t}),addIsTypingCounter:e=>({type:Ie,addToIsTyping:e}),addIsLoadingCounter:e=>({type:Ne,addToIsLoading:e}),updateBotName:e=>({type:Ee,name:e}),updateMainHeaderTitle:e=>({type:pe,title:e}),updateBotAvatarURL:e=>({type:ce,url:e}),updateLauncherAvatarURL:e=>({type:_e,source:e}),updateCSSVariables:(e,t,a)=>({type:he,variables:e,publicVars:t,remoteStyles:a}),updateThemeConfig:e=>({type:Oe,themeConfig:e}),updateStreamingConfig:e=>({type:Ce,streamingConfig:e}),updateHomeScreenConfig:e=>({type:ke,homeScreenConfig:e}),updateAlternateSuggestionsConfig:e=>({type:Be,config:e}),setViewState:e=>({type:me,viewState:e}),setViewChanging:e=>({type:ye,viewChanging:e}),setInitialViewChangeComplete:e=>({type:fe,changeComplete:e}),setMessageUIProperty:(e,t,a)=>({type:we,localMessageID:e,propertyName:t,propertyValue:a}),setLauncherProperty:(e,t)=>({type:De,propertyName:e,propertyValue:t}),setLauncherConfigProperty:(e,t,a)=>({type:Pe,propertyName:e,propertyValue:t,launcherType:a}),setMessageHistoryProperty:(e,t,a)=>({type:Re,messageID:e,propertyName:t,propertyValue:a}),setMessageErrorState:(e,t)=>Ot.setMessageHistoryProperty(e,"error_state",t),setMessageWasAnnounced:e=>Ot.setMessageUIProperty(e,"needsAnnouncement",!1),announceMessage:e=>({type:Le,message:e}),setAlternateSuggestionsPanelState:(e,t)=>({type:be,panelState:e,suggestionsToggledReason:t}),setAlternateSuggestionsThirdStrike:()=>({type:Ue}),setChatMessagesStateProperty:(e,t)=>({type:ve,propertyName:e,propertyValue:t}),addNotification(t){const a=e();return{type:yt,notificationID:a,notification:t}},removeNotifications:({groupID:e,notificationID:t})=>({type:ht,groupID:e,notificationID:t}),removeAllNotifications:()=>({type:ft}),acceptDisclaimer:()=>({type:He}),setSuggestionsSelectedIndex:(e,t)=>({type:Fe,index:e,section:t}),setHomeScreenIsOpen:e=>({type:ze,isOpen:e}),updateHistoryUserDefinedCount:e=>({type:Je,messageID:e}),updateLauncherConfig:e=>({type:qe,launcherConfig:e}),updateBrandingConfig:e=>({type:Qe,brandingConfig:e}),setBrandingOverlayIsOpen:e=>({type:Ze,isOpen:e}),setBrandingBannerShown:e=>({type:et,showBanner:e}),setSuggestionsSearchResults:e=>({type:tt,searchResultItem:e}),setLauncherMinimized:()=>({type:st}),closeIFramePanel:()=>({type:nt}),setIFrameContent:e=>({type:ot,messageItem:e}),setViewSourcePanelIsOpen:(e,t,a)=>({type:it,isOpen:e,citationItem:t,relatedSearchResult:a}),setCustomPanelConfigOptions:e=>({type:rt,options:e}),setCustomPanelOpen:e=>({type:Et,isOpen:e}),toggleHomeScreen:()=>({type:ct}),updateInputState:(e,t)=>({type:_t,newState:e,isInputToAgent:t}),setIsBrowserPageVisible:e=>({type:pt,isVisible:e}),addInputFile:(e,t)=>({type:gt,file:e,isInputToAgent:t}),removeFileUpload:(e,t)=>({type:lt,fileID:e,isInputToAgent:t}),removeLocalMessageItem:e=>({type:ut,localMessageItemID:e}),fileUploadInputError:(e,t,a)=>({type:dt,fileID:e,errorMessage:t,isInputToAgent:a}),clearInputFiles:e=>({type:St,isInputToAgent:e}),addNestedMessages:e=>({type:Tt,localMessageItems:e}),setResponsePanelIsOpen:e=>({type:At,isOpen:e}),setResponsePanelContent:(e,t=!1)=>({type:It,localMessageItem:e,isMessageForInput:t}),streamingStart:e=>({type:mt,messageID:e}),streamingAddChunk:(e,t,a,s)=>({type:Nt,fullMessageID:e,chunkItem:t,isCompleteItem:a,disableFadeAnimation:s})};var Ct,Mt;function wt(e,t){return{localMessages:e,originalMessage:t}}async function Rt(e,t,a,s=!0){const o=function(e,t,a){const s=t?.nickname;let n;switch(e){case m.AGENT_JOINED:n=s?"agent_agentJoinedName":"agent_agentJoinedNoName";break;case m.RELOAD_WARNING:n="agent_youConnectedWarning";break;case m.AGENT_LEFT_CHAT:n=s?"agent_agentLeftChat":"agent_agentLeftChatNoName";break;case m.AGENT_ENDED_CHAT:n=s?"agent_agentEndedChat":"agent_agentEndedChatNoName";break;case m.TRANSFER_TO_AGENT:n=s?"agent_transferring":"agent_transferringNoName";break;case m.USER_ENDED_CHAT:n="agent_youEndedChat";break;case m.CHAT_WAS_ENDED:n="agent_conversationWasEnded";break;case m.DISCONNECTED:n="agent_disconnected";break;case m.RECONNECTED:n="agent_reconnected";break;case m.SHARING_REQUESTED:n="agent_sharingRequested";break;case m.SHARING_ACCEPTED:n="agent_sharingAccepted";break;case m.SHARING_DECLINED:n="agent_sharingDeclined";break;case m.SHARING_CANCELLED:n="agent_sharingCancelled";break;case m.SHARING_ENDED:n="agent_sharingEnded";break;default:return""}return n&&a.formatMessage({id:n},{personName:s})}(e,a,t.intl),i=Dt(e),{originalMessage:r,localMessage:E}=i;return E.item.text=o,a&&(r.history||(r.history={}),r.history.agent_profile=a),s&&await t.fire({type:"agent:pre:receive",data:r}),n(r),s&&await t.fire({type:"agent:receive",data:r}),i}function Dt(e){const t={response_type:a.TEXT,agent_message_type:e},s=c(t);return{localMessage:h(t,s),originalMessage:s}}async function Pt(e,t,a,i,r){i||await y(e,(async({localMessages:e,originalMessage:t})=>{await y(e,(async(e,a)=>{await r.actions.handleUserDefinedResponseItems(e,t),r.store.dispatch(Ot.addLocalMessageItem(e,t,0===a))}))})),await y(e,(async({originalMessage:e})=>{const{disableAgentSessionHistory:i}=r.store.getState().config.public.serviceDesk;if(t&&!i)try{let t=e;if(a){t=o(e);const a={type:"agent:pre:sessionHistory",message:t};await r.eventBus.fire(a,r.instance),t=a.message}t&&await r.actions.sendUpdateHistoryEvent(t.id,t)}catch(e){s("Error in HumanAgentServiceImpl.addMessage",e)}n(e)}))}async function Lt(e,t,a,s,n,o){const i=await Rt(e,o,t,s);await Pt([wt([i.localMessage],i.originalMessage)],!0,!1,n,o);const r=function(e){const{agent_botReturned:t}=e;if(!t)return null;const{originalMessage:a,localMessage:s}=Dt(null);return s.item.text=t,{originalMessage:a,localMessage:s}}(o.store.getState().languagePack);if(r){const e=o.restartCount;ie((()=>{e===o.restartCount&&Pt([wt([r.localMessage],r.originalMessage)],!0,!1,n,o)}),a)}}function bt(e,t){const a=e?.transfer_info?.summary_message_to_agent,s=a?.map((e=>e.text)).filter((e=>e));return s?.length?s:[t]}!function(e){e[e.NONE=1]="NONE",e[e.FAILED=2]="FAILED",e[e.RETRYING=3]="RETRYING",e[e.WAITING=4]="WAITING"}(Ct||(Ct={})),function(e){e.NICE_DFO="nicedfo",e.GENESYS_MESSENGER="genesyswebmessenger",e.SALES_FORCE="salesforceweb",e.ZENDESK="zendeskweb"}(Mt||(Mt={}));export{Qe as $,ue as A,me as B,re as C,ye as D,fe as E,Ee as F,ce as G,ge as H,se as I,_e as J,pe as K,he as L,Ct as M,Oe as N,Ce as O,ke as P,we as Q,Ge as R,be as S,Re as T,Be as U,Le as V,He as W,ze as X,ct as Y,Je as Z,qe as _,Ot as a,Ze as a0,et as a1,De as a2,Pe as a3,ve as a4,st as a5,ot as a6,nt as a7,it as a8,Et as a9,ee as aA,z as aB,Mt as aC,$ as aD,te as aE,J as aF,Lt as aG,Pt as aH,wt as aI,Rt as aJ,ae as aK,bt as aL,rt as aa,Ke as ab,je as ac,Xe as ad,_t as ae,pt as af,gt as ag,lt as ah,ut as ai,yt as aj,ht as ak,ft as al,St as am,dt as an,Tt as ao,At as ap,It as aq,mt as ar,Nt as as,X as at,oe as au,j as av,ne as aw,q as ax,ie as ay,K as az,w as b,R as c,D as d,C as e,O as f,Z as g,Ue as h,Fe as i,tt as j,Se as k,le as l,de as m,Te as n,h as o,at as p,We as q,f as r,Me as s,Ie as t,Ne as u,Ae as v,xe as w,Ve as x,Ye as y,$e as z};
|