@koredev/agentai-web-sdk 3.21.0-rc → 3.22.1-rc
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/components/aaWindow/aaWindow.d.ts +1 -0
- package/dist/components/common/constants/errorcodes.d.ts +16 -0
- package/dist/components/common/constants/events.cnst.d.ts +5 -2
- package/dist/components/common/constants/projConsts.d.ts +1 -0
- package/dist/components/common/services/rootService.d.ts +7 -6
- package/dist/components/common/templatemanager/tabs/suggestions/searchai-template/searchai-template.d.ts +3 -0
- package/dist/esm/agentai-web-sdk.min.js +1 -1
- package/dist/umd/agentai-web-sdk-umd.min.js +1 -1
- package/package.json +1 -1
- package/dist/components/common/templatemanager/base/aaContainer/splitContainer.d.ts +0 -2
- package/dist/umd/agentai-web-sdk-umd.min.js.map +0 -1
- package/dist/umd/hot/hot-update.js +0 -3622
- package/dist/umd/hot/hot-update.js.map +0 -1
- package/dist/umd/hot/hot-update.json +0 -1
|
@@ -1,3622 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
self["webpackHotUpdateaa_sdk"]("KoreAASDK",{
|
|
3
|
-
|
|
4
|
-
/***/ "./src/components/aaWindow/aaWindow.ts":
|
|
5
|
-
/*!*********************************************!*\
|
|
6
|
-
!*** ./src/components/aaWindow/aaWindow.ts ***!
|
|
7
|
-
\*********************************************/
|
|
8
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
9
|
-
|
|
10
|
-
__webpack_require__.r(__webpack_exports__);
|
|
11
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
12
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
13
|
-
/* harmony export */ });
|
|
14
|
-
/* harmony import */ var _aaWindow_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_aaWindow.scss */ "./src/components/aaWindow/_aaWindow.scss");
|
|
15
|
-
/* harmony import */ var _common_utils_EventEmiter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/utils/EventEmiter */ "./src/components/common/utils/EventEmiter.ts");
|
|
16
|
-
/* harmony import */ var _common_templatemanager_base_domManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/templatemanager/base/domManager */ "./src/components/common/templatemanager/base/domManager.tsx");
|
|
17
|
-
/* harmony import */ var _common_templatemanager_base_aaContainer_aaContainer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/templatemanager/base/aaContainer/aaContainer */ "./src/components/common/templatemanager/base/aaContainer/aaContainer.tsx");
|
|
18
|
-
/* harmony import */ var _common_services_web_socket_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/services/web-socket-service */ "./src/components/common/services/web-socket-service.ts");
|
|
19
|
-
/* harmony import */ var _common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/constants/events.cnst */ "./src/components/common/constants/events.cnst.ts");
|
|
20
|
-
/* harmony import */ var _common_services_rootService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/services/rootService */ "./src/components/common/services/rootService.ts");
|
|
21
|
-
/* harmony import */ var _common_templatemanager_base_eventManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/templatemanager/base/eventManager */ "./src/components/common/templatemanager/base/eventManager.tsx");
|
|
22
|
-
/* harmony import */ var _common_utils_interceptor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/utils/interceptor */ "./src/components/common/utils/interceptor.ts");
|
|
23
|
-
/* harmony import */ var _common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/constants/projConsts */ "./src/components/common/constants/projConsts.ts");
|
|
24
|
-
/* harmony import */ var _common_services_localstorage_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../common/services/localstorage.service */ "./src/components/common/services/localstorage.service.ts");
|
|
25
|
-
/* harmony import */ var kore_web_sdk__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! kore-web-sdk */ "./node_modules/kore-web-sdk/dist/esm/kore-web-sdk-chat.min.js");
|
|
26
|
-
/* harmony import */ var _common_services_template_render_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../common/services/template-render-service */ "./src/components/common/services/template-render-service.ts");
|
|
27
|
-
/* harmony import */ var _common_services_chunkFileUpload_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../common/services/chunkFileUpload.service */ "./src/components/common/services/chunkFileUpload.service.ts");
|
|
28
|
-
/* harmony import */ var _common_templatemanager_tabs_ErrorBoundary_ErrorHandler__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../common/templatemanager/tabs/ErrorBoundary/ErrorHandler */ "./src/components/common/templatemanager/tabs/ErrorBoundary/ErrorHandler.ts");
|
|
29
|
-
/* harmony import */ var _common_constants_errorcodes__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../common/constants/errorcodes */ "./src/components/common/constants/errorcodes.ts");
|
|
30
|
-
/* harmony import */ var _config_prefs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./config/prefs */ "./src/components/aaWindow/config/prefs.ts");
|
|
31
|
-
/* harmony import */ var _index_plugins_aai18n__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../index_plugins/aai18n */ "./src/index_plugins/aai18n.ts");
|
|
32
|
-
/* harmony import */ var _common_i18n_en__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../common/i18n/en */ "./src/components/common/i18n/en.ts");
|
|
33
|
-
var __extends = (undefined && undefined.__extends) || (function () {
|
|
34
|
-
var extendStatics = function (d, b) {
|
|
35
|
-
extendStatics = Object.setPrototypeOf ||
|
|
36
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
37
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
38
|
-
return extendStatics(d, b);
|
|
39
|
-
};
|
|
40
|
-
return function (d, b) {
|
|
41
|
-
if (typeof b !== "function" && b !== null)
|
|
42
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
43
|
-
extendStatics(d, b);
|
|
44
|
-
function __() { this.constructor = d; }
|
|
45
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
46
|
-
};
|
|
47
|
-
})();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var AAWindow = /** @class */ (function (_super) {
|
|
68
|
-
__extends(AAWindow, _super);
|
|
69
|
-
function AAWindow() {
|
|
70
|
-
var _this = _super.call(this) || this;
|
|
71
|
-
_this.newSocketApproach = false;
|
|
72
|
-
_this.settingsResponseHandler = function (data) {
|
|
73
|
-
if (_this.newSocketApproach) {
|
|
74
|
-
_this.handleSettingsResponse(data, _this.config, _this.rootService.connectionDetails.channel);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
_this.handleOnReadyEvent = function (data) {
|
|
78
|
-
if (_this.rootService.isOnReadyCalled) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
_this.rootService.isOnReadyCalled = true;
|
|
82
|
-
if (data === null || data === void 0 ? void 0 : data.aa_settings) {
|
|
83
|
-
_this.settingsResponseHandler(data.aa_settings);
|
|
84
|
-
}
|
|
85
|
-
if (data === null || data === void 0 ? void 0 : data.aa_prefs) {
|
|
86
|
-
_this.handlePrefsResponse(data.aa_prefs);
|
|
87
|
-
}
|
|
88
|
-
if (data === null || data === void 0 ? void 0 : data.internal_transfer_response) {
|
|
89
|
-
_this.internalTransfer(data.internal_transfer_response);
|
|
90
|
-
}
|
|
91
|
-
_this.updateSettingsProperties();
|
|
92
|
-
if (_this.newSocketApproach) {
|
|
93
|
-
_this.commonEmitEvents(_this.config);
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
_this.handleOnSocketConnectionEvent = function (config) {
|
|
97
|
-
if (!_this.newSocketApproach) {
|
|
98
|
-
_this.commonEmitEvents(config);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
_this.handlePrefsResponse = function (data, isApiCall) {
|
|
102
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
103
|
-
var languageSelected = _this.getLanguageDetails();
|
|
104
|
-
var _8 = _this.rootService.connectionDetails, channel = _8.channel, botId = _8.botId;
|
|
105
|
-
var ordArr = [];
|
|
106
|
-
var loutcstObj = {};
|
|
107
|
-
if (data === null || data === void 0 ? void 0 : data.prefs) {
|
|
108
|
-
_this.rootService.prefsAccessObj.prefs = (_a = data.prefs[channel]) === null || _a === void 0 ? void 0 : _a.locale[languageSelected];
|
|
109
|
-
_this.rootService.prefsAccessObj.orderTabs = (_d = (_c = (_b = data.prefs[channel]) === null || _b === void 0 ? void 0 : _b.locale[languageSelected]) === null || _c === void 0 ? void 0 : _c.lout) === null || _d === void 0 ? void 0 : _d.ord;
|
|
110
|
-
_this.rootService.prefsAccessObj.defaultTab = (_g = (_f = (_e = data.prefs[channel]) === null || _e === void 0 ? void 0 : _e.locale[languageSelected]) === null || _f === void 0 ? void 0 : _f.lout) === null || _g === void 0 ? void 0 : _g.dfTb;
|
|
111
|
-
_this.localStorageService.setActiveTab(_this.rootService.prefsAccessObj.defaultTab);
|
|
112
|
-
_this.rootService.prefsOpacity = (_m = (_l = (_k = (_j = (_h = data.prefs[channel]) === null || _h === void 0 ? void 0 : _h.locale[languageSelected]) === null || _j === void 0 ? void 0 : _j.sg) === null || _k === void 0 ? void 0 : _k.dT) === null || _l === void 0 ? void 0 : _l.lbl) === null || _m === void 0 ? void 0 : _m.scVsbty;
|
|
113
|
-
ordArr = (_q = (_p = (_o = data.prefs[channel]) === null || _o === void 0 ? void 0 : _o.locale[languageSelected]) === null || _p === void 0 ? void 0 : _p.lout) === null || _q === void 0 ? void 0 : _q.ord;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
_this.rootService.prefsAccessObj.prefs = _config_prefs__WEBPACK_IMPORTED_MODULE_15__.prefsSeed[languageSelected];
|
|
117
|
-
_this.rootService.prefsAccessObj.orderTabs = (_s = (_r = _config_prefs__WEBPACK_IMPORTED_MODULE_15__.prefsSeed[languageSelected]) === null || _r === void 0 ? void 0 : _r.lout) === null || _s === void 0 ? void 0 : _s.ord;
|
|
118
|
-
_this.rootService.prefsAccessObj.defaultTab = (_u = (_t = _config_prefs__WEBPACK_IMPORTED_MODULE_15__.prefsSeed[languageSelected]) === null || _t === void 0 ? void 0 : _t.lout) === null || _u === void 0 ? void 0 : _u.dfTb;
|
|
119
|
-
_this.localStorageService.setActiveTab(_this.rootService.prefsAccessObj.defaultTab);
|
|
120
|
-
_this.rootService.prefsOpacity = ((_y = (_x = (_w = (_v = _config_prefs__WEBPACK_IMPORTED_MODULE_15__.prefsSeed[languageSelected]) === null || _v === void 0 ? void 0 : _v.sg) === null || _w === void 0 ? void 0 : _w.dT) === null || _x === void 0 ? void 0 : _x.lbl) === null || _y === void 0 ? void 0 : _y.scVsbty) || 50;
|
|
121
|
-
}
|
|
122
|
-
if ((data === null || data === void 0 ? void 0 : data.prefs) && ordArr && (ordArr === null || ordArr === void 0 ? void 0 : ordArr.length)) {
|
|
123
|
-
loutcstObj = ordArr.find(function (item) { return item.hasOwnProperty('cst'); });
|
|
124
|
-
if (loutcstObj && (loutcstObj === null || loutcstObj === void 0 ? void 0 : loutcstObj.cst) && ((_z = loutcstObj === null || loutcstObj === void 0 ? void 0 : loutcstObj.cst) === null || _z === void 0 ? void 0 : _z.isE)) {
|
|
125
|
-
_this.rootService.customTabPrefsObj.customTabEnabled = (_0 = loutcstObj.cst) === null || _0 === void 0 ? void 0 : _0.isE;
|
|
126
|
-
_this.rootService.customTabPrefsObj.customTabPrefs = loutcstObj.cst;
|
|
127
|
-
_this.rootService.customTabPrefsObj.customTabWlD = ((_3 = (_2 = (_1 = loutcstObj.cst) === null || _1 === void 0 ? void 0 : _1[botId]) === null || _2 === void 0 ? void 0 : _2.wfD) === null || _3 === void 0 ? void 0 : _3.isE) ? (_6 = (_5 = (_4 = loutcstObj.cst) === null || _4 === void 0 ? void 0 : _4[botId]) === null || _5 === void 0 ? void 0 : _5.wfD) === null || _6 === void 0 ? void 0 : _6.dgIds : [];
|
|
128
|
-
_this.rootService.customTabPrefsObj.customTablbl = ((_7 = loutcstObj.cst) === null || _7 === void 0 ? void 0 : _7.lbl) || '';
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
if (isApiCall) {
|
|
132
|
-
_this.updateSettingsProperties();
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
_this.handleOverrideMode = function (toggleOverride, dialogId) {
|
|
136
|
-
var _a;
|
|
137
|
-
var connectionDetails = _this.rootService.connectionDetails;
|
|
138
|
-
var overRideObj = {
|
|
139
|
-
"agentId": "",
|
|
140
|
-
"botId": connectionDetails.botId,
|
|
141
|
-
"conversationId": connectionDetails.conversationId,
|
|
142
|
-
"query": "",
|
|
143
|
-
"enable_override_userinput": toggleOverride,
|
|
144
|
-
'experience': (_a = _this.rootService.connectionDetails) === null || _a === void 0 ? void 0 : _a.channel,
|
|
145
|
-
"positionId": dialogId
|
|
146
|
-
};
|
|
147
|
-
// this.rootService.proactiveMode = !toggleOverride;
|
|
148
|
-
_this.socketConnection.emitEvents(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS.enable_override_userinput, overRideObj);
|
|
149
|
-
_this.rootService.OverRideMode = toggleOverride;
|
|
150
|
-
};
|
|
151
|
-
_this.prepareTabs = function (tabsNTitles, tabsTitles) {
|
|
152
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
153
|
-
var tabsRender = [];
|
|
154
|
-
tabsNTitles.forEach(function (tab) {
|
|
155
|
-
var tabObj = Object.entries(tab);
|
|
156
|
-
tabObj.forEach(function (_a) {
|
|
157
|
-
var _b, _c;
|
|
158
|
-
var key = _a[0], value = _a[1];
|
|
159
|
-
if (value.isE) {
|
|
160
|
-
tabsRender.push({
|
|
161
|
-
type: key,
|
|
162
|
-
title: tabsTitles[key],
|
|
163
|
-
isEnabled: true,
|
|
164
|
-
default: key === ((_c = (_b = _this.rootService) === null || _b === void 0 ? void 0 : _b.prefsAccessObj) === null || _c === void 0 ? void 0 : _c.defaultTab)
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
if ((_d = (_a = _this.rootService) === null || _a === void 0 ? void 0 : _a.aaSettings[(_c = (_b = _this.rootService) === null || _b === void 0 ? void 0 : _b.connectionDetails) === null || _c === void 0 ? void 0 : _c.channel]) === null || _d === void 0 ? void 0 : _d.isAgentPlaybookEnabled) {
|
|
170
|
-
tabsRender.push({
|
|
171
|
-
type: 'cl',
|
|
172
|
-
title: tabsTitles['cl'],
|
|
173
|
-
isEnabled: true,
|
|
174
|
-
default: false
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
if ((tabsNTitles === null || tabsNTitles === void 0 ? void 0 : tabsNTitles.length) > 0 && ((_h = (_g = (_f = (_e = _this.rootService) === null || _e === void 0 ? void 0 : _e.aaSettings) === null || _f === void 0 ? void 0 : _f.feedback) === null || _g === void 0 ? void 0 : _g.widget) === null || _h === void 0 ? void 0 : _h.isEnabled)) {
|
|
178
|
-
tabsRender.push({
|
|
179
|
-
type: 'mR',
|
|
180
|
-
title: 'More',
|
|
181
|
-
isEnabled: true,
|
|
182
|
-
default: false
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
return tabsRender;
|
|
186
|
-
};
|
|
187
|
-
_common_templatemanager_tabs_ErrorBoundary_ErrorHandler__WEBPACK_IMPORTED_MODULE_13__.ErrorHandler.initialize(_this);
|
|
188
|
-
return _this;
|
|
189
|
-
}
|
|
190
|
-
AAWindow.prototype.show = function (config) {
|
|
191
|
-
var _a, _b, _c, _d;
|
|
192
|
-
var _e = config.connectionDetails, conversationId = _e.conversationId, botId = _e.botId, domainURL = _e.domainURL, token = _e.token, channel = _e.channel;
|
|
193
|
-
if (!conversationId || !botId || !domainURL || !token || !channel) {
|
|
194
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.ON_ERROR, _common_constants_errorcodes__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODES['ERR_MISSING_REQUIRED_FIELDS']);
|
|
195
|
-
return;
|
|
196
|
-
}
|
|
197
|
-
if (domainURL.endsWith('/')) {
|
|
198
|
-
config.connectionDetails.domainURL = domainURL.replace(/\/+$/, "");
|
|
199
|
-
}
|
|
200
|
-
if (!((_a = config === null || config === void 0 ? void 0 : config.connectionDetails) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('isSecure'))) {
|
|
201
|
-
config.connectionDetails.isSecure = true;
|
|
202
|
-
}
|
|
203
|
-
this.languagePluginService = new _index_plugins_aai18n__WEBPACK_IMPORTED_MODULE_16__.aai18nPlugin;
|
|
204
|
-
this.languages = (_c = (_b = this.languagePluginService) === null || _b === void 0 ? void 0 : _b.config) === null || _c === void 0 ? void 0 : _c.languageStrings;
|
|
205
|
-
this.cleanupEvents();
|
|
206
|
-
if ((_d = this.socketConnection) === null || _d === void 0 ? void 0 : _d._agentAssistSocket) {
|
|
207
|
-
this.socketConnection.disconnect();
|
|
208
|
-
}
|
|
209
|
-
this.emit('DESTROY_WIDGET', {});
|
|
210
|
-
this.config = config;
|
|
211
|
-
this.dskSettings = config.dskSettings;
|
|
212
|
-
this.subscribeToEvents();
|
|
213
|
-
this.initShow(config);
|
|
214
|
-
this.eventManager = new _common_templatemanager_base_eventManager__WEBPACK_IMPORTED_MODULE_7__["default"](this);
|
|
215
|
-
};
|
|
216
|
-
;
|
|
217
|
-
AAWindow.prototype.sendUserMessage = function (_data) {
|
|
218
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
219
|
-
if (((_b = (_a = _data.author) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'user') {
|
|
220
|
-
var sanitizedValue = this.rootService.sanitizeHTML(_data.message);
|
|
221
|
-
_data.message = sanitizedValue;
|
|
222
|
-
if (_data.message) {
|
|
223
|
-
var conversationId = (_c = this.rootService.connectionDetails) === null || _c === void 0 ? void 0 : _c.conversationId;
|
|
224
|
-
var botId = (_d = this.rootService.connectionDetails) === null || _d === void 0 ? void 0 : _d.botId;
|
|
225
|
-
var data = {
|
|
226
|
-
author: _data.author,
|
|
227
|
-
type: (_f = (_e = _data.author) === null || _e === void 0 ? void 0 : _e.type) === null || _f === void 0 ? void 0 : _f.toUpperCase(),
|
|
228
|
-
conversationId: conversationId,
|
|
229
|
-
value: _data.message,
|
|
230
|
-
botId: botId,
|
|
231
|
-
message: _data.message
|
|
232
|
-
};
|
|
233
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.USER_TRANSCRIPT_MSG, data);
|
|
234
|
-
this.socketConnection.emitEvents(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS.user_sent_message, data);
|
|
235
|
-
if (this.rootService.isAgenticCoPilotEnabled) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
if (this.rootService.proactiveMode && !this.rootService.OverRideMode && !this.rootService.manualAssistOverrideMode) {
|
|
239
|
-
var agent_assist_request = {
|
|
240
|
-
author: _data.author,
|
|
241
|
-
botId: botId,
|
|
242
|
-
conversationId: conversationId,
|
|
243
|
-
experience: (_g = this.rootService.connectionDetails) === null || _g === void 0 ? void 0 : _g.channel,
|
|
244
|
-
query: _data.message,
|
|
245
|
-
positionId: this.rootService.isAutomationOnGoing ? this.rootService.currentPositionId : null
|
|
246
|
-
};
|
|
247
|
-
if (_data === null || _data === void 0 ? void 0 : _data.customData) {
|
|
248
|
-
agent_assist_request['customData'] = JSON.parse(JSON.stringify(_data === null || _data === void 0 ? void 0 : _data.customData));
|
|
249
|
-
}
|
|
250
|
-
if (_data === null || _data === void 0 ? void 0 : _data.secureCustomData) {
|
|
251
|
-
agent_assist_request['secureCustomData'] = _data === null || _data === void 0 ? void 0 : _data.secureCustomData;
|
|
252
|
-
}
|
|
253
|
-
var assistSection = (_h = this === null || this === void 0 ? void 0 : this.chatEle) === null || _h === void 0 ? void 0 : _h.querySelector("".concat(_common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.ClassMapConstanst.ASSIST_SECTION));
|
|
254
|
-
var parentNode = (((_j = assistSection === null || assistSection === void 0 ? void 0 : assistSection.childNodes) === null || _j === void 0 ? void 0 : _j.length) > 0 ? assistSection === null || assistSection === void 0 ? void 0 : assistSection.childNodes[((_k = assistSection === null || assistSection === void 0 ? void 0 : assistSection.childNodes) === null || _k === void 0 ? void 0 : _k.length) - 1] : assistSection);
|
|
255
|
-
if (parentNode) {
|
|
256
|
-
this.renderIndividualLoader(parentNode);
|
|
257
|
-
}
|
|
258
|
-
this.socketConnection.emitEvents(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS.agent_assist_request, agent_assist_request);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.ON_ERROR, _common_constants_errorcodes__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODES['ERR_USER_MISSING_REQ_FIELDS']);
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
AAWindow.prototype.sendAgentMessage = function (_data) {
|
|
267
|
-
var _a, _b, _c, _d, _e, _f;
|
|
268
|
-
if (((_b = (_a = _data.author) === null || _a === void 0 ? void 0 : _a.type) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'agent') {
|
|
269
|
-
var sanitizedValue = this.rootService.sanitizeHTML(_data.message);
|
|
270
|
-
_data.message = sanitizedValue;
|
|
271
|
-
if (_data.message) {
|
|
272
|
-
var conversationId = (_c = this.rootService.connectionDetails) === null || _c === void 0 ? void 0 : _c.conversationId;
|
|
273
|
-
var botId = (_d = this.rootService.connectionDetails) === null || _d === void 0 ? void 0 : _d.botId;
|
|
274
|
-
var data = {
|
|
275
|
-
author: _data.author,
|
|
276
|
-
type: (_f = (_e = _data.author) === null || _e === void 0 ? void 0 : _e.type) === null || _f === void 0 ? void 0 : _f.toUpperCase(),
|
|
277
|
-
conversationId: conversationId,
|
|
278
|
-
value: _data.message,
|
|
279
|
-
message: _data.message,
|
|
280
|
-
botId: botId
|
|
281
|
-
};
|
|
282
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.AGENT_TRANSCRIPT_MSG, data);
|
|
283
|
-
if (_data === null || _data === void 0 ? void 0 : _data.customData) {
|
|
284
|
-
data['customData'] = JSON.parse(JSON.stringify(_data === null || _data === void 0 ? void 0 : _data.customData));
|
|
285
|
-
}
|
|
286
|
-
if (_data === null || _data === void 0 ? void 0 : _data.secureCustomData) {
|
|
287
|
-
data['secureCustomData'] = _data === null || _data === void 0 ? void 0 : _data.secureCustomData;
|
|
288
|
-
}
|
|
289
|
-
this.socketConnection.emitEvents(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS.agent_sent_message, data);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.ON_ERROR, _common_constants_errorcodes__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODES['ERR_AGENT_MISSING_REQ_FIELDS']);
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
AAWindow.prototype.subscribeToEvents = function () {
|
|
297
|
-
this.on(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.DATA_EVENTS.SETTINGS_RESPONSE, this.settingsResponseHandler);
|
|
298
|
-
this.bindEvents();
|
|
299
|
-
};
|
|
300
|
-
AAWindow.prototype.handleSettingsResponse = function (res, config, channel) {
|
|
301
|
-
var _a, _b, _c, _d, _e, _f;
|
|
302
|
-
var widgetSettings = {};
|
|
303
|
-
if (res && res.agentAssistSettings && res.agentAssistSettings[channel]) {
|
|
304
|
-
this.rootService.accountId = res.accountId;
|
|
305
|
-
res.agentAssistSettings = this.addBackWardCompatibility(res.agentAssistSettings);
|
|
306
|
-
widgetSettings = Object.assign(res.agentAssistSettings, res.agentAssistSettings[channel]);
|
|
307
|
-
}
|
|
308
|
-
else {
|
|
309
|
-
widgetSettings = this.rootService.defaultwidgetSettings;
|
|
310
|
-
}
|
|
311
|
-
// depends on prefs
|
|
312
|
-
this.rootService.interimSummary = config.connectionDetails.interimSummary;
|
|
313
|
-
this.rootService.aaSettings = JSON.parse(JSON.stringify(widgetSettings));
|
|
314
|
-
var convItem = this.localStorageService.getStorageItem((_a = config === null || config === void 0 ? void 0 : config.connectionDetails) === null || _a === void 0 ? void 0 : _a.conversationId, {});
|
|
315
|
-
if (convItem && Object.keys(convItem).length === 0) {
|
|
316
|
-
var LanguageSelect = (_d = (_c = (_b = this.rootService) === null || _b === void 0 ? void 0 : _b.aaSettings) === null || _c === void 0 ? void 0 : _c.languageSettings) === null || _d === void 0 ? void 0 : _d.language;
|
|
317
|
-
if (LanguageSelect === 'interactiveLang') {
|
|
318
|
-
LanguageSelect = (_f = (_e = this.config) === null || _e === void 0 ? void 0 : _e.connectionDetails) === null || _f === void 0 ? void 0 : _f.interactiveLanguage;
|
|
319
|
-
}
|
|
320
|
-
this.LanguageObject(LanguageSelect);
|
|
321
|
-
}
|
|
322
|
-
this.localStorageService.initializeLocalStorageData(this.rootService.aaSettings);
|
|
323
|
-
};
|
|
324
|
-
AAWindow.prototype.initiateSocketConnection = function () {
|
|
325
|
-
var _this = this;
|
|
326
|
-
// if(!this.newSocketApproach){
|
|
327
|
-
// this.updateSettingsProperties();
|
|
328
|
-
// }
|
|
329
|
-
setTimeout(function () {
|
|
330
|
-
var language = _this.getLanguageDetails();
|
|
331
|
-
_this.socketConnection.socketConnection(_this.config, _this.rootService.grantResponseObj, language);
|
|
332
|
-
}, 100);
|
|
333
|
-
};
|
|
334
|
-
AAWindow.prototype.updateSettingsProperties = function () {
|
|
335
|
-
var chatWindowHtml;
|
|
336
|
-
chatWindowHtml = (0,_common_templatemanager_base_domManager__WEBPACK_IMPORTED_MODULE_2__.getHTML)(_common_templatemanager_base_aaContainer_aaContainer__WEBPACK_IMPORTED_MODULE_3__.AAContainer, {}, this);
|
|
337
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.BEFORE_VIEW_INIT, chatWindowHtml, { event: _common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.MAIN_CONTAINER, data: {} });
|
|
338
|
-
this.chatEle = chatWindowHtml;
|
|
339
|
-
this.render(chatWindowHtml);
|
|
340
|
-
this.hideSendAndCopy();
|
|
341
|
-
this.chatWindowInstance.chatEle = this.chatEle;
|
|
342
|
-
};
|
|
343
|
-
AAWindow.prototype.LanguageObject = function (lang) {
|
|
344
|
-
var _a, _b;
|
|
345
|
-
if (lang === 'interactiveLang') {
|
|
346
|
-
lang = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.connectionDetails) === null || _b === void 0 ? void 0 : _b.interactiveLanguage;
|
|
347
|
-
}
|
|
348
|
-
this.languagedata = this.languages[lang];
|
|
349
|
-
var enLanguage = this.languages['en'];
|
|
350
|
-
try {
|
|
351
|
-
for (var _i = 0, _c = Object.keys(enLanguage); _i < _c.length; _i++) {
|
|
352
|
-
var key = _c[_i];
|
|
353
|
-
if (key in this.languagedata) {
|
|
354
|
-
continue;
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
this.languagedata[key] = enLanguage[key];
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
catch (_d) {
|
|
362
|
-
this.languagedata = _common_i18n_en__WEBPACK_IMPORTED_MODULE_17__.en;
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
AAWindow.prototype.initShow = function (config) {
|
|
366
|
-
var _this = this;
|
|
367
|
-
var _a, _b, _c;
|
|
368
|
-
this.renderLoader();
|
|
369
|
-
this.socketConnection = new _common_services_web_socket_service__WEBPACK_IMPORTED_MODULE_4__["default"](this);
|
|
370
|
-
this.chatWindowInstance = new kore_web_sdk__WEBPACK_IMPORTED_MODULE_18__.chatWindow();
|
|
371
|
-
this.chatWindowInstance.sendMessage = function (messageText, options, serverMessageObject, clientMessageObject) {
|
|
372
|
-
console.log(messageText, options, serverMessageObject, clientMessageObject, "txt***8");
|
|
373
|
-
_this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.TEMPLATE_CLICK, { messageText: messageText, tab: _this.rootService.activeTab });
|
|
374
|
-
};
|
|
375
|
-
this.rootService = new _common_services_rootService__WEBPACK_IMPORTED_MODULE_6__["default"](this);
|
|
376
|
-
this.localStorageService = new _common_services_localstorage_service__WEBPACK_IMPORTED_MODULE_10__["default"](this);
|
|
377
|
-
this.chunkFileUploadService = new _common_services_chunkFileUpload_service__WEBPACK_IMPORTED_MODULE_12__.chunkFileUploadService(this);
|
|
378
|
-
this.rootService.connectionDetails = config.connectionDetails;
|
|
379
|
-
this.templateRenderService = new _common_services_template_render_service__WEBPACK_IMPORTED_MODULE_11__.templateRenderClassService(this);
|
|
380
|
-
//apply branding based on theme
|
|
381
|
-
var theme = (_a = this.localStorageService) === null || _a === void 0 ? void 0 : _a.getThemeLocal();
|
|
382
|
-
this.applyBranding(theme === _common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.storageConst.DARK ? _common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.DARKTHEME_COLORCODES : (_b = config.branding) === null || _b === void 0 ? void 0 : _b.colors, theme);
|
|
383
|
-
// this.chatWindowInstance.setBranding();
|
|
384
|
-
var _d = config.connectionDetails, botId = _d.botId, conversationId = _d.conversationId, token = _d.token, domainURL = _d.domainURL;
|
|
385
|
-
var isJWE = ((_c = token === null || token === void 0 ? void 0 : token.split('.')) === null || _c === void 0 ? void 0 : _c.length) === 5;
|
|
386
|
-
if (botId && conversationId && token && domainURL || isJWE) {
|
|
387
|
-
this.JWTSetup(config, isJWE)
|
|
388
|
-
.then(function (data) {
|
|
389
|
-
_this.newSocketApproach = data === null || data === void 0 ? void 0 : data.cvs;
|
|
390
|
-
(0,_common_utils_interceptor__WEBPACK_IMPORTED_MODULE_8__.updateEndPointUrl)(data === null || data === void 0 ? void 0 : data.invokeNewAAService);
|
|
391
|
-
if (data === null || data === void 0 ? void 0 : data.cId) {
|
|
392
|
-
config.connectionDetails.conversationId = data.cId;
|
|
393
|
-
_this.rootService.connectionDetails.conversationId = data.cId;
|
|
394
|
-
}
|
|
395
|
-
if (data === null || data === void 0 ? void 0 : data.isAnonymousFlowEnabled) {
|
|
396
|
-
_this.rootService.isAnonymousFlowEnabled = true;
|
|
397
|
-
}
|
|
398
|
-
_this.rootService.grantResponseObj = data;
|
|
399
|
-
config['JWT_RESP'] = data;
|
|
400
|
-
_this.socketConnection.configOptions = config;
|
|
401
|
-
var language = _this.getLanguageDetails();
|
|
402
|
-
// new socket approach
|
|
403
|
-
if (data === null || data === void 0 ? void 0 : data.cvs) {
|
|
404
|
-
_this.initiateSocketConnection();
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
var _a = config.connectionDetails, botId_1 = _a.botId, channel_1 = _a.channel;
|
|
408
|
-
_this.getAASettings(botId_1)
|
|
409
|
-
.then(function (res) {
|
|
410
|
-
_this.handleSettingsResponse(res, config, channel_1);
|
|
411
|
-
_this.initiateSocketConnection();
|
|
412
|
-
_this.getAAPrefsSettings(botId_1).then(function (res) {
|
|
413
|
-
_this.handlePrefsResponse(res, true);
|
|
414
|
-
}).catch(function (err) {
|
|
415
|
-
_this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.ON_ERROR, _common_constants_errorcodes__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODES['ERR_PREFS_API_FAILURE']);
|
|
416
|
-
});
|
|
417
|
-
}).catch(function (err) {
|
|
418
|
-
_this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.ON_ERROR, _common_constants_errorcodes__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODES['ERR_SETTINGS_API_FAILURE']);
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}).catch(function (err) {
|
|
422
|
-
_this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.ON_ERROR, _common_constants_errorcodes__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODES['ERR_TOKEN_INVALID']);
|
|
423
|
-
_this.handleNetworkError();
|
|
424
|
-
});
|
|
425
|
-
this.chatWindowInstance.on('beforeWSSendMessage', function (event) {
|
|
426
|
-
console.log('before ws send message: ', event);
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
if (Object.keys(this.localStorageService.getInternalTransferInfo()).length && !Object.keys(this.rootService.internalTransferData || {}).length) {
|
|
430
|
-
this.rootService.internalTransferData = structuredClone(this.localStorageService.getInternalTransferInfo());
|
|
431
|
-
}
|
|
432
|
-
var languageSelected = this.getLanguageDetails();
|
|
433
|
-
this.LanguageObject(languageSelected);
|
|
434
|
-
};
|
|
435
|
-
;
|
|
436
|
-
AAWindow.prototype.getLanguageDetails = function () {
|
|
437
|
-
var language = this.localStorageService.getLanguage();
|
|
438
|
-
return language;
|
|
439
|
-
};
|
|
440
|
-
AAWindow.prototype.addBackWardCompatibility = function (agentassistSettings) {
|
|
441
|
-
var _a;
|
|
442
|
-
if (agentassistSettings && (!agentassistSettings.feedback || !((_a = Object.keys(agentassistSettings.feedback)) === null || _a === void 0 ? void 0 : _a.length))) {
|
|
443
|
-
agentassistSettings.feedback = this.rootService.defaultFeedbackSettings;
|
|
444
|
-
}
|
|
445
|
-
return agentassistSettings;
|
|
446
|
-
};
|
|
447
|
-
AAWindow.prototype.hideSendAndCopy = function () {
|
|
448
|
-
var _a, _b, _c, _d;
|
|
449
|
-
this.rootService.hideActionButtons = (this.rootService.connectionDetails.channel === _common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.ProjConstants.VOICE) ? true : false;
|
|
450
|
-
if (((_b = (_a = this.rootService) === null || _a === void 0 ? void 0 : _a.aaSettings) === null || _b === void 0 ? void 0 : _b.isAgentResponseEnabled) === false) {
|
|
451
|
-
this.rootService.hideSendButton = true;
|
|
452
|
-
}
|
|
453
|
-
if (((_d = (_c = this.rootService) === null || _c === void 0 ? void 0 : _c.aaSettings) === null || _d === void 0 ? void 0 : _d.isAgentResponseCopyEnabled) === false) {
|
|
454
|
-
this.rootService.hideCopyButton = true;
|
|
455
|
-
}
|
|
456
|
-
if (this.rootService.hideSendButton && this.rootService.hideCopyButton) {
|
|
457
|
-
this.rootService.hideActionButtons = true;
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
AAWindow.prototype.getAASettings = function (botId) {
|
|
461
|
-
var channel = this.rootService.connectionDetails.channel;
|
|
462
|
-
return (0,_common_utils_interceptor__WEBPACK_IMPORTED_MODULE_8__["default"])('get_aa_settings', {
|
|
463
|
-
method: 'GET',
|
|
464
|
-
headers: {
|
|
465
|
-
'Content-Type': 'application/json',
|
|
466
|
-
},
|
|
467
|
-
}, this, { botId: botId, channel: channel });
|
|
468
|
-
};
|
|
469
|
-
AAWindow.prototype.getAAPrefsSettings = function (botId) {
|
|
470
|
-
var channel = this.rootService.connectionDetails.channel;
|
|
471
|
-
var language = this.localStorageService.getLanguage();
|
|
472
|
-
return (0,_common_utils_interceptor__WEBPACK_IMPORTED_MODULE_8__["default"])('aa_prefs_settings', {
|
|
473
|
-
method: 'GET',
|
|
474
|
-
headers: {
|
|
475
|
-
'Content-Type': 'application/json',
|
|
476
|
-
},
|
|
477
|
-
}, this, { botId: botId, channel: channel, lang: language, instanceBotId: botId });
|
|
478
|
-
};
|
|
479
|
-
AAWindow.prototype.JWTSetup = function (options, isJWE) {
|
|
480
|
-
var _a, _b;
|
|
481
|
-
var _c = options.connectionDetails || {}, token = _c.token, botId = _c.botId;
|
|
482
|
-
var payload = {
|
|
483
|
-
"assertion": token,
|
|
484
|
-
"botInfo": {
|
|
485
|
-
taskBotId: botId,
|
|
486
|
-
chatBot: 'Sample Bot'
|
|
487
|
-
},
|
|
488
|
-
"token": {}
|
|
489
|
-
};
|
|
490
|
-
// const endPoint = isJWE ? 'jwt_load' : 'jwt_grant';
|
|
491
|
-
var endPoint = ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.connectionDetails) === null || _b === void 0 ? void 0 : _b.isSecure) ? 'jwt_load' : 'jwt_grant';
|
|
492
|
-
return (0,_common_utils_interceptor__WEBPACK_IMPORTED_MODULE_8__["default"])(endPoint, {
|
|
493
|
-
method: 'POST',
|
|
494
|
-
body: JSON.stringify(payload),
|
|
495
|
-
}, this);
|
|
496
|
-
};
|
|
497
|
-
AAWindow.prototype.render = function (chatWindowHtml) {
|
|
498
|
-
this.clearContainer();
|
|
499
|
-
var container = document.getElementsByClassName(this.config.container)[0];
|
|
500
|
-
if (chatWindowHtml) {
|
|
501
|
-
container.append(chatWindowHtml);
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
|
-
;
|
|
505
|
-
AAWindow.prototype.clearContainer = function () {
|
|
506
|
-
var elements = document.getElementsByClassName(this.config.container);
|
|
507
|
-
// Loop through each element and clear its children
|
|
508
|
-
for (var i = 0; i < elements.length; i++) {
|
|
509
|
-
while (elements[i].firstChild) {
|
|
510
|
-
elements[i].removeChild(elements[i].firstChild);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
};
|
|
514
|
-
AAWindow.prototype.renderLoader = function () {
|
|
515
|
-
var loaderHtml = (0,_common_templatemanager_base_domManager__WEBPACK_IMPORTED_MODULE_2__.getHTML)(_common_templatemanager_base_aaContainer_aaContainer__WEBPACK_IMPORTED_MODULE_3__.AALoder, {}, this);
|
|
516
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.BEFORE_VIEW_INIT, loaderHtml, { event: _common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.MAIN_LOADER, data: {} });
|
|
517
|
-
var container = document.getElementsByClassName(this.config.container)[0];
|
|
518
|
-
container.append(loaderHtml);
|
|
519
|
-
};
|
|
520
|
-
AAWindow.prototype.removeLoader = function () {
|
|
521
|
-
var _a;
|
|
522
|
-
var loaderHtml = (_a = this === null || this === void 0 ? void 0 : this.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(_common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.IdMapConstant.LOADER_BLOCK_MAIN));
|
|
523
|
-
loaderHtml === null || loaderHtml === void 0 ? void 0 : loaderHtml.remove();
|
|
524
|
-
};
|
|
525
|
-
AAWindow.prototype.renderIndividualLoader = function (container) {
|
|
526
|
-
var _this = this;
|
|
527
|
-
this.removeIndividualLoader(container);
|
|
528
|
-
var loaderHtml = (0,_common_templatemanager_base_domManager__WEBPACK_IMPORTED_MODULE_2__.getHTML)(_common_templatemanager_base_aaContainer_aaContainer__WEBPACK_IMPORTED_MODULE_3__.IndividualLoader, {}, this);
|
|
529
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.BEFORE_VIEW_INIT, loaderHtml, { event: _common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.INDIVIDUAL_LOADER, data: {} });
|
|
530
|
-
container === null || container === void 0 ? void 0 : container.append(loaderHtml);
|
|
531
|
-
setTimeout(function () {
|
|
532
|
-
_this.removeIndividualLoader(container);
|
|
533
|
-
}, 5000);
|
|
534
|
-
};
|
|
535
|
-
AAWindow.prototype.removeIndividualLoader = function (parentNode) {
|
|
536
|
-
var loaderHtml = parentNode.querySelector("#".concat(_common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.IdMapConstant.LOADER_BLOCK_INDIVIDUAL));
|
|
537
|
-
loaderHtml === null || loaderHtml === void 0 ? void 0 : loaderHtml.remove();
|
|
538
|
-
};
|
|
539
|
-
AAWindow.prototype.bindEvents = function () {
|
|
540
|
-
this.on('ON_SOCKET_CONNECTION', this.handleOnSocketConnectionEvent);
|
|
541
|
-
this.on(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.DATA_EVENTS.ON_READY, this.handleOnReadyEvent);
|
|
542
|
-
this.on(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.DATA_EVENTS.PREFS_RESPONSE, this.handlePrefsResponse);
|
|
543
|
-
};
|
|
544
|
-
AAWindow.prototype.cleanupEvents = function () {
|
|
545
|
-
this.off(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.DATA_EVENTS.SETTINGS_RESPONSE, this.settingsResponseHandler);
|
|
546
|
-
this.off('ON_SOCKET_CONNECTION', this.handleOnSocketConnectionEvent);
|
|
547
|
-
this.off(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.DATA_EVENTS.ON_READY, this.handleOnReadyEvent);
|
|
548
|
-
this.off(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.DATA_EVENTS.PREFS_RESPONSE, this.handlePrefsResponse);
|
|
549
|
-
};
|
|
550
|
-
AAWindow.prototype.commonEmitEvents = function (config) {
|
|
551
|
-
var _a, _b, _c;
|
|
552
|
-
var _d = config === null || config === void 0 ? void 0 : config.connectionDetails, botId = _d.botId, conversationId = _d.conversationId, autoBotId = _d.autoBotId, interactiveLanguage = _d.interactiveLanguage, userName = _d.userName, customData = _d.customData, token = _d.token, channel = _d.channel;
|
|
553
|
-
var sendCustomData = '';
|
|
554
|
-
var sendInteractiveLanguage = '';
|
|
555
|
-
var sendAutoBotId = '';
|
|
556
|
-
if (customData && ((_a = Object.keys(customData)) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_b = config === null || config === void 0 ? void 0 : config.connectionDetails) === null || _b === void 0 ? void 0 : _b.source) !== 'smartassist-color-scheme') {
|
|
557
|
-
sendCustomData = customData;
|
|
558
|
-
}
|
|
559
|
-
;
|
|
560
|
-
if (interactiveLanguage !== null && typeof interactiveLanguage !== 'undefined' && interactiveLanguage !== "''") {
|
|
561
|
-
sendInteractiveLanguage = interactiveLanguage; // Return the default value for null, undefined, or "''"
|
|
562
|
-
}
|
|
563
|
-
;
|
|
564
|
-
if (autoBotId && autoBotId !== 'undefined') {
|
|
565
|
-
sendAutoBotId = autoBotId;
|
|
566
|
-
}
|
|
567
|
-
;
|
|
568
|
-
var welComeMsgReqParam = {
|
|
569
|
-
"waitTime": 2000,
|
|
570
|
-
"userName": userName,
|
|
571
|
-
"id": conversationId,
|
|
572
|
-
"isSendWelcomeMessage": true,
|
|
573
|
-
"agentassistInfo": {},
|
|
574
|
-
"botId": botId,
|
|
575
|
-
"sendMenuRequest": true,
|
|
576
|
-
"uId": "",
|
|
577
|
-
"sId": "",
|
|
578
|
-
"experience": channel,
|
|
579
|
-
"jToken": token,
|
|
580
|
-
"conversationId": conversationId,
|
|
581
|
-
"autoBotId": sendAutoBotId,
|
|
582
|
-
"language": sendInteractiveLanguage,
|
|
583
|
-
"allQueryParams": config === null || config === void 0 ? void 0 : config.connectionDetails,
|
|
584
|
-
"customData": sendCustomData,
|
|
585
|
-
};
|
|
586
|
-
this.welComeMsgReq(welComeMsgReqParam);
|
|
587
|
-
var overrideMode = this.rootService.proactiveMode ? false : true;
|
|
588
|
-
this.handleOverrideMode(overrideMode, null);
|
|
589
|
-
var menuReqParam = {
|
|
590
|
-
"botId": botId,
|
|
591
|
-
"conversationId": conversationId,
|
|
592
|
-
"experience": channel,
|
|
593
|
-
"autoBotId": sendAutoBotId,
|
|
594
|
-
"language": sendInteractiveLanguage
|
|
595
|
-
};
|
|
596
|
-
this.menuReq(menuReqParam);
|
|
597
|
-
if (this.rootService.isAnonymousFlowEnabled && !this.rootService.isAnonymousFlowTriggered && !this.rootService.isInitialInternalTransferTriggered) {
|
|
598
|
-
var localstorageData = this.localStorageService.getInternalTransferInfo();
|
|
599
|
-
if (!this.rootService.internalTransfer && !((_c = Object.keys((localstorageData === null || localstorageData === void 0 ? void 0 : localstorageData.participant) || {})) === null || _c === void 0 ? void 0 : _c.length) && !this.rootService.isHooksApi) {
|
|
600
|
-
this.rootService.isAnonymousFlowTriggered = true;
|
|
601
|
-
this.internalTransfer({
|
|
602
|
-
isAnonymousAgent: true
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
if (this.rootService.isInitialInternalTransferTriggered) {
|
|
607
|
-
var localstorageData = this.localStorageService.getInternalTransferInfo();
|
|
608
|
-
this.rootService.isInitialInternalTransferTriggered = false;
|
|
609
|
-
if (localstorageData) {
|
|
610
|
-
this.internalTransfer(localstorageData);
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
};
|
|
614
|
-
AAWindow.prototype.prepareAgentAssistRequestParams = function (data) {
|
|
615
|
-
var _a, _b, _c, _d, _e, _f;
|
|
616
|
-
var agent_assist_request = {
|
|
617
|
-
'conversationId': data.conversationId,
|
|
618
|
-
'query': data.value,
|
|
619
|
-
'botId': data.botId,
|
|
620
|
-
'agentId': '',
|
|
621
|
-
'experience': data === null || data === void 0 ? void 0 : data.channel,
|
|
622
|
-
'positionId': data.positionId,
|
|
623
|
-
'intType': 'assist'
|
|
624
|
-
};
|
|
625
|
-
if (data.intentName) {
|
|
626
|
-
agent_assist_request['intentName'] = data.value;
|
|
627
|
-
}
|
|
628
|
-
if (data.entities) {
|
|
629
|
-
agent_assist_request['entities'] = data.entities;
|
|
630
|
-
}
|
|
631
|
-
else {
|
|
632
|
-
agent_assist_request['entities'] = [];
|
|
633
|
-
}
|
|
634
|
-
if (data.childBotId) {
|
|
635
|
-
agent_assist_request['childBotId'] = data.childBotId;
|
|
636
|
-
}
|
|
637
|
-
if (data.childBotName) {
|
|
638
|
-
agent_assist_request['childBotName'] = data.childBotName;
|
|
639
|
-
}
|
|
640
|
-
if ((data === null || data === void 0 ? void 0 : data.autoBotId) && (data === null || data === void 0 ? void 0 : data.autoBotId) !== 'undefined') {
|
|
641
|
-
agent_assist_request['autoBotId'] = data.autoBotId;
|
|
642
|
-
}
|
|
643
|
-
else {
|
|
644
|
-
agent_assist_request['autoBotId'] = '';
|
|
645
|
-
}
|
|
646
|
-
if (data.intentName && data.userInput) {
|
|
647
|
-
agent_assist_request['query'] = data.userInput;
|
|
648
|
-
}
|
|
649
|
-
if (this.rootService.isAutomationOnGoing) {
|
|
650
|
-
agent_assist_request['positionId'] = this.rootService.currentPositionId;
|
|
651
|
-
}
|
|
652
|
-
if (Array.isArray(data.traits) && ((_a = data === null || data === void 0 ? void 0 : data.traits) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
653
|
-
agent_assist_request['traits'] = data.traits;
|
|
654
|
-
}
|
|
655
|
-
if (data.taskRefId) {
|
|
656
|
-
agent_assist_request['taskRefId'] = data.taskRefId;
|
|
657
|
-
}
|
|
658
|
-
if (data.dialogId) {
|
|
659
|
-
agent_assist_request['dialogId'] = data.dialogId;
|
|
660
|
-
}
|
|
661
|
-
if (data.isDiscard) {
|
|
662
|
-
agent_assist_request['terminateTask'] = data.isDiscard;
|
|
663
|
-
}
|
|
664
|
-
if (data === null || data === void 0 ? void 0 : data.attachments) {
|
|
665
|
-
agent_assist_request['query'] = ((_c = (_b = data === null || data === void 0 ? void 0 : data.attachments[0]) === null || _b === void 0 ? void 0 : _b.url) === null || _c === void 0 ? void 0 : _c.fileUrl) || '';
|
|
666
|
-
agent_assist_request['attachments'] = data === null || data === void 0 ? void 0 : data.attachments;
|
|
667
|
-
}
|
|
668
|
-
if (data === null || data === void 0 ? void 0 : data.author) {
|
|
669
|
-
agent_assist_request['firstName'] = ((_d = data === null || data === void 0 ? void 0 : data.author) === null || _d === void 0 ? void 0 : _d.firstName) || '';
|
|
670
|
-
agent_assist_request['lastName'] = ((_e = data === null || data === void 0 ? void 0 : data.author) === null || _e === void 0 ? void 0 : _e.lastName) || '';
|
|
671
|
-
agent_assist_request['type'] = ((_f = data === null || data === void 0 ? void 0 : data.author) === null || _f === void 0 ? void 0 : _f.type) || '';
|
|
672
|
-
}
|
|
673
|
-
agent_assist_request = this.addSourceMsgIdToRequestParams(data, agent_assist_request);
|
|
674
|
-
return agent_assist_request;
|
|
675
|
-
};
|
|
676
|
-
AAWindow.prototype.prepareAgentAssistAgentRequestParams = function (data) {
|
|
677
|
-
var _a, _b, _c;
|
|
678
|
-
var agent_assist_agent_request_params = {
|
|
679
|
-
'isSearch': data.isSearch,
|
|
680
|
-
'conversationId': data.conversationId,
|
|
681
|
-
'query': data.value,
|
|
682
|
-
'botId': data.botId,
|
|
683
|
-
'experience': data === null || data === void 0 ? void 0 : data.channel,
|
|
684
|
-
'positionId': data === null || data === void 0 ? void 0 : data.positionId,
|
|
685
|
-
'childBotId': (data === null || data === void 0 ? void 0 : data.childBotId) || '',
|
|
686
|
-
'childBotName': (data === null || data === void 0 ? void 0 : data.childBotName) || '',
|
|
687
|
-
'intType': 'myBot'
|
|
688
|
-
};
|
|
689
|
-
if (data.intentName) {
|
|
690
|
-
agent_assist_agent_request_params.intentName = data.intentName;
|
|
691
|
-
}
|
|
692
|
-
// if(data.childBotId) {
|
|
693
|
-
// agent_assist_agent_request_params['childBotId'] = data.childBotId;
|
|
694
|
-
// agent_assist_agent_request_params['childBotName'] = data.childBotName;
|
|
695
|
-
// }
|
|
696
|
-
if ((data === null || data === void 0 ? void 0 : data.autoBotId) && (data === null || data === void 0 ? void 0 : data.autoBotId) !== 'undefined') {
|
|
697
|
-
agent_assist_agent_request_params['autoBotId'] = data.autoBotId;
|
|
698
|
-
}
|
|
699
|
-
else {
|
|
700
|
-
agent_assist_agent_request_params['autoBotId'] = '';
|
|
701
|
-
}
|
|
702
|
-
if (data.intentName && data.userInput) {
|
|
703
|
-
agent_assist_agent_request_params['query'] = data.userInput;
|
|
704
|
-
}
|
|
705
|
-
// if (this.isMyBotAutomationOnGoing) {
|
|
706
|
-
// agent_assist_agent_request_params['positionId'] = this.currentPositionIdOfMyBot;
|
|
707
|
-
// }
|
|
708
|
-
if (Array.isArray(data.traits) && ((_a = data === null || data === void 0 ? void 0 : data.traits) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
709
|
-
agent_assist_agent_request_params['traits'] = data.traits;
|
|
710
|
-
}
|
|
711
|
-
if (data.taskRefId) {
|
|
712
|
-
agent_assist_agent_request_params['taskRefId'] = data.taskRefId;
|
|
713
|
-
}
|
|
714
|
-
if (data.dialogId) {
|
|
715
|
-
agent_assist_agent_request_params['dialogId'] = data.dialogId;
|
|
716
|
-
}
|
|
717
|
-
if (data.isDiscard) {
|
|
718
|
-
agent_assist_agent_request_params['terminateTask'] = data.isDiscard;
|
|
719
|
-
}
|
|
720
|
-
if (data === null || data === void 0 ? void 0 : data.attachments) {
|
|
721
|
-
agent_assist_agent_request_params['query'] = ((_c = (_b = data === null || data === void 0 ? void 0 : data.attachments[0]) === null || _b === void 0 ? void 0 : _b.url) === null || _c === void 0 ? void 0 : _c.fileUrl) || '';
|
|
722
|
-
agent_assist_agent_request_params['attachments'] = data === null || data === void 0 ? void 0 : data.attachments;
|
|
723
|
-
}
|
|
724
|
-
agent_assist_agent_request_params = this.addSourceMsgIdToRequestParams(data, agent_assist_agent_request_params);
|
|
725
|
-
return agent_assist_agent_request_params;
|
|
726
|
-
};
|
|
727
|
-
AAWindow.prototype.prepareAgentAssistCustomRequestParams = function (data) {
|
|
728
|
-
var _a, _b, _c;
|
|
729
|
-
var agent_assist_agent_request_params = {
|
|
730
|
-
'isSearch': data.isSearch,
|
|
731
|
-
'conversationId': data.conversationId,
|
|
732
|
-
'query': data.value,
|
|
733
|
-
'botId': data.botId,
|
|
734
|
-
'experience': data === null || data === void 0 ? void 0 : data.channel,
|
|
735
|
-
'positionId': data === null || data === void 0 ? void 0 : data.positionId,
|
|
736
|
-
'childBotId': (data === null || data === void 0 ? void 0 : data.childBotId) || '',
|
|
737
|
-
'childBotName': (data === null || data === void 0 ? void 0 : data.childBotName) || '',
|
|
738
|
-
'intType': 'custom',
|
|
739
|
-
'crId': 'custom'
|
|
740
|
-
};
|
|
741
|
-
if (data.intentName) {
|
|
742
|
-
agent_assist_agent_request_params.intentName = data.intentName;
|
|
743
|
-
}
|
|
744
|
-
// if(data.childBotId) {
|
|
745
|
-
// agent_assist_agent_request_params['childBotId'] = data.childBotId;
|
|
746
|
-
// agent_assist_agent_request_params['childBotName'] = data.childBotName;
|
|
747
|
-
// }
|
|
748
|
-
if ((data === null || data === void 0 ? void 0 : data.autoBotId) && (data === null || data === void 0 ? void 0 : data.autoBotId) !== 'undefined') {
|
|
749
|
-
agent_assist_agent_request_params['autoBotId'] = data.autoBotId;
|
|
750
|
-
}
|
|
751
|
-
else {
|
|
752
|
-
agent_assist_agent_request_params['autoBotId'] = '';
|
|
753
|
-
}
|
|
754
|
-
if (data.intentName && data.userInput) {
|
|
755
|
-
agent_assist_agent_request_params['query'] = data.userInput;
|
|
756
|
-
}
|
|
757
|
-
if (Array.isArray(data.traits) && ((_a = data === null || data === void 0 ? void 0 : data.traits) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
758
|
-
agent_assist_agent_request_params['traits'] = data.traits;
|
|
759
|
-
}
|
|
760
|
-
if (data.taskRefId) {
|
|
761
|
-
agent_assist_agent_request_params['taskRefId'] = data.taskRefId;
|
|
762
|
-
}
|
|
763
|
-
if (data.dialogId) {
|
|
764
|
-
agent_assist_agent_request_params['dialogId'] = data.dialogId;
|
|
765
|
-
}
|
|
766
|
-
if (data.isDiscard) {
|
|
767
|
-
agent_assist_agent_request_params['terminateTask'] = data.isDiscard;
|
|
768
|
-
}
|
|
769
|
-
if (data === null || data === void 0 ? void 0 : data.attachments) {
|
|
770
|
-
agent_assist_agent_request_params['query'] = ((_c = (_b = data === null || data === void 0 ? void 0 : data.attachments[0]) === null || _b === void 0 ? void 0 : _b.url) === null || _c === void 0 ? void 0 : _c.fileUrl) || '';
|
|
771
|
-
agent_assist_agent_request_params['attachments'] = data === null || data === void 0 ? void 0 : data.attachments;
|
|
772
|
-
}
|
|
773
|
-
if (data === null || data === void 0 ? void 0 : data.positionId) {
|
|
774
|
-
agent_assist_agent_request_params['positionId'] = data.positionId;
|
|
775
|
-
}
|
|
776
|
-
agent_assist_agent_request_params = this.addSourceMsgIdToRequestParams(data, agent_assist_agent_request_params);
|
|
777
|
-
return agent_assist_agent_request_params;
|
|
778
|
-
};
|
|
779
|
-
AAWindow.prototype.addSourceMsgIdToRequestParams = function (data, requestParams) {
|
|
780
|
-
if (data.sourceMsgId) {
|
|
781
|
-
if (data.sourceMsgId == 'fromLibrary') {
|
|
782
|
-
requestParams['fromLibrary'] = true;
|
|
783
|
-
}
|
|
784
|
-
else {
|
|
785
|
-
requestParams['sourceMsgId'] = data.sourceMsgId;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
return requestParams;
|
|
789
|
-
};
|
|
790
|
-
AAWindow.prototype.welComeMsgReq = function (welComeMsgReqParam) {
|
|
791
|
-
this.socketConnection.emitEvents(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS.welcome_message_request, welComeMsgReqParam);
|
|
792
|
-
};
|
|
793
|
-
AAWindow.prototype.menuReq = function (menuReqParam) {
|
|
794
|
-
this.socketConnection.emitEvents(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS.agent_menu_request, menuReqParam);
|
|
795
|
-
};
|
|
796
|
-
//events to handle from client
|
|
797
|
-
// selectAAFooterTab(data : any){
|
|
798
|
-
// this.emit('selectTab', data , {});
|
|
799
|
-
// }
|
|
800
|
-
AAWindow.prototype.openAssistTab = function (footerTag) {
|
|
801
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB, { activeTab: 'ast', footerTag: footerTag });
|
|
802
|
-
};
|
|
803
|
-
AAWindow.prototype.openTranscriptTab = function (footerTag) {
|
|
804
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB, { activeTab: 'trnspt', footerTag: footerTag });
|
|
805
|
-
};
|
|
806
|
-
AAWindow.prototype.openSearchTab = function (footerTag) {
|
|
807
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB, { activeTab: 'srch', footerTag: footerTag });
|
|
808
|
-
};
|
|
809
|
-
AAWindow.prototype.openMybotTab = function (footerTag) {
|
|
810
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB, { activeTab: 'mB', footerTag: footerTag });
|
|
811
|
-
};
|
|
812
|
-
AAWindow.prototype.openCustomTab = function (footerTag) {
|
|
813
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB, { activeTab: 'cst', footerTag: footerTag });
|
|
814
|
-
};
|
|
815
|
-
AAWindow.prototype.openPlaybookTab = function (footerTag) {
|
|
816
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB, { activeTab: 'playbook', footerTag: footerTag });
|
|
817
|
-
};
|
|
818
|
-
AAWindow.prototype.sendChecklistOpenedEvent = function (checklistParams) {
|
|
819
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.CHECKLIST_OPEN, checklistParams);
|
|
820
|
-
};
|
|
821
|
-
AAWindow.prototype.sendChecklistResumeEvent = function (checklistParams) {
|
|
822
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.CHECLIST_RESUME, checklistParams);
|
|
823
|
-
};
|
|
824
|
-
AAWindow.prototype.sendChecklistStepCloseEvent = function (checklistParams) {
|
|
825
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.CHECKLIST_STEP_CLOSE, checklistParams);
|
|
826
|
-
};
|
|
827
|
-
AAWindow.prototype.sendChecklistProceedToCloseEvent = function (checklistParams) {
|
|
828
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.EVENTS_TO_SDK.CHECKLIST_PROCEED_TO_CLOSE, checklistParams);
|
|
829
|
-
};
|
|
830
|
-
AAWindow.prototype.endOfConversation = function () {
|
|
831
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.END_OF_CONVERSATION);
|
|
832
|
-
};
|
|
833
|
-
AAWindow.prototype.responseResolutionCommentsFromParent = function (resolutionComments) {
|
|
834
|
-
resolutionComments.openOnResponse = true;
|
|
835
|
-
this.setSummaryPopup(resolutionComments);
|
|
836
|
-
};
|
|
837
|
-
AAWindow.prototype.setSummaryPopup = function (summaryPopup) {
|
|
838
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.SET_SUMMARY_POPUP, summaryPopup);
|
|
839
|
-
};
|
|
840
|
-
AAWindow.prototype.internalTransfer = function (data) {
|
|
841
|
-
if (!this.rootService.isInitialInternalTransferTriggered && !this.rootService.isOnReadyCalled) {
|
|
842
|
-
this.rootService.isInitialInternalTransferTriggered = true;
|
|
843
|
-
}
|
|
844
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.INTERNAL_TRANSFER, data);
|
|
845
|
-
};
|
|
846
|
-
AAWindow.prototype.disableWidget = function (isActive) {
|
|
847
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.DISABLE_WIDGET, isActive);
|
|
848
|
-
};
|
|
849
|
-
AAWindow.prototype.applyBranding = function (colors, theme) {
|
|
850
|
-
var _a, _b, _c;
|
|
851
|
-
if (theme === _common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.storageConst.DARK) {
|
|
852
|
-
colors = JSON.parse(JSON.stringify(_common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.DARKTHEME_COLORCODES));
|
|
853
|
-
colors.primay = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.branding) === null || _b === void 0 ? void 0 : _b.colors) === null || _c === void 0 ? void 0 : _c.primay;
|
|
854
|
-
}
|
|
855
|
-
var colorObj = {
|
|
856
|
-
primay: '--AA-primary-color',
|
|
857
|
-
secondary: '--AA-secondary-color',
|
|
858
|
-
primaryText: '--AA-primary-text',
|
|
859
|
-
secondaryText: '--AA-secondary-text',
|
|
860
|
-
bodyBackground: '--AA-body-background',
|
|
861
|
-
warningColor: '--AA-warning-color',
|
|
862
|
-
};
|
|
863
|
-
if (colorObj) {
|
|
864
|
-
for (var key in colorObj) {
|
|
865
|
-
if (Object.prototype.hasOwnProperty.call(colorObj, key)) {
|
|
866
|
-
var element = colorObj[key];
|
|
867
|
-
document.documentElement.style.setProperty(element, colors[key]);
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
AAWindow.prototype.destroy = function () {
|
|
873
|
-
this.cleanupEvents();
|
|
874
|
-
this.socketConnection.disconnect();
|
|
875
|
-
this.emit('DESTROY_WIDGET', {});
|
|
876
|
-
this.localStorageService.deleteLocalStorageState(this.rootService.connectionDetails.conversationId);
|
|
877
|
-
this.removeEventListenersInDOM();
|
|
878
|
-
};
|
|
879
|
-
AAWindow.prototype.removeEventListenersInDOM = function () {
|
|
880
|
-
var _this = this;
|
|
881
|
-
var _a;
|
|
882
|
-
var eventMapper = JSON.parse(JSON.stringify((_a = this.eventManager) === null || _a === void 0 ? void 0 : _a.eventMapper));
|
|
883
|
-
var eventListener = this.getEvents();
|
|
884
|
-
eventMapper.forEach(function (item) {
|
|
885
|
-
var _a;
|
|
886
|
-
(_a = _this.eventManager) === null || _a === void 0 ? void 0 : _a.removeEventListener(item.querySelector, item.event, _this.chatEle);
|
|
887
|
-
});
|
|
888
|
-
Object.keys(eventListener).forEach(function (key) {
|
|
889
|
-
if (key !== 'BEFORE_VIEW_INIT') {
|
|
890
|
-
eventListener[key].forEach(function (item) {
|
|
891
|
-
_this.off(key, item);
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
});
|
|
895
|
-
};
|
|
896
|
-
AAWindow.prototype.handleNetworkError = function () {
|
|
897
|
-
var _this = this;
|
|
898
|
-
var toastElement = this.addNetworkErrorToastrTemplate();
|
|
899
|
-
try {
|
|
900
|
-
requestAnimationFrame(function () {
|
|
901
|
-
_this.rootService.showNetworkToastr(_this);
|
|
902
|
-
if (_this.timeoutId !== undefined) {
|
|
903
|
-
clearTimeout(_this.timeoutId);
|
|
904
|
-
}
|
|
905
|
-
// this.timeoutId = window.setTimeout(() => {
|
|
906
|
-
// // this.rootService.hideNetworkToastr(this);
|
|
907
|
-
// }, 5000);
|
|
908
|
-
});
|
|
909
|
-
}
|
|
910
|
-
catch (error) {
|
|
911
|
-
console.error('Error handling network toast:', error);
|
|
912
|
-
}
|
|
913
|
-
};
|
|
914
|
-
AAWindow.prototype.addNetworkErrorToastrTemplate = function () {
|
|
915
|
-
var _this = this;
|
|
916
|
-
var _a, _b;
|
|
917
|
-
try {
|
|
918
|
-
var container = document.querySelector(".".concat(this.config.container));
|
|
919
|
-
var toastContainer = container === null || container === void 0 ? void 0 : container.querySelector(".".concat(_common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.ClassMapConstanst.NETWORK_ERROR_TOASTR));
|
|
920
|
-
if (!toastContainer) {
|
|
921
|
-
(_a = container === null || container === void 0 ? void 0 : container.classList) === null || _a === void 0 ? void 0 : _a.add('container-border');
|
|
922
|
-
var networkErrorToastTemplate = (0,_common_templatemanager_base_domManager__WEBPACK_IMPORTED_MODULE_2__.getHTML)(_common_templatemanager_base_aaContainer_aaContainer__WEBPACK_IMPORTED_MODULE_3__.NetworkErrorToast, {}, this);
|
|
923
|
-
// Add event listener for close button
|
|
924
|
-
(_b = this.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener(".".concat(_common_constants_projConsts__WEBPACK_IMPORTED_MODULE_9__.ClassMapConstanst.NETWORK_ERROR_CLOSE_BTN), 'click', function () {
|
|
925
|
-
_this.rootService.hideNetworkToastr(_this);
|
|
926
|
-
if (_this.timeoutId) {
|
|
927
|
-
clearTimeout(_this.timeoutId);
|
|
928
|
-
}
|
|
929
|
-
}, networkErrorToastTemplate);
|
|
930
|
-
// Emit event before adding to DOM
|
|
931
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.BEFORE_VIEW_INIT, networkErrorToastTemplate, {
|
|
932
|
-
event: _common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.SDK_EVENTS.NETWORK_ERROR_TOASTR,
|
|
933
|
-
data: {}
|
|
934
|
-
});
|
|
935
|
-
// Add to DOM
|
|
936
|
-
if (!container) {
|
|
937
|
-
throw new Error('Container not found');
|
|
938
|
-
}
|
|
939
|
-
container.appendChild(networkErrorToastTemplate);
|
|
940
|
-
return networkErrorToastTemplate;
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
catch (error) {
|
|
944
|
-
console.error('Error adding network error toast template:', error);
|
|
945
|
-
throw error;
|
|
946
|
-
}
|
|
947
|
-
};
|
|
948
|
-
AAWindow.prototype.pauseTranscript = function () {
|
|
949
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.PAUSE_TRANSCRIPT, 'pause');
|
|
950
|
-
};
|
|
951
|
-
AAWindow.prototype.resumeTranscript = function () {
|
|
952
|
-
this.emit(_common_constants_events_cnst__WEBPACK_IMPORTED_MODULE_5__.INTERNAL_EVENTS.RESUME_TRANSCRIPT, 'resume');
|
|
953
|
-
};
|
|
954
|
-
return AAWindow;
|
|
955
|
-
}(_common_utils_EventEmiter__WEBPACK_IMPORTED_MODULE_1__.EventEmitter));
|
|
956
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AAWindow);
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
/***/ }),
|
|
960
|
-
|
|
961
|
-
/***/ "./src/components/common/templatemanager/base/aaContainer/aaContainer.tsx":
|
|
962
|
-
/*!********************************************************************************!*\
|
|
963
|
-
!*** ./src/components/common/templatemanager/base/aaContainer/aaContainer.tsx ***!
|
|
964
|
-
\********************************************************************************/
|
|
965
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
966
|
-
|
|
967
|
-
__webpack_require__.r(__webpack_exports__);
|
|
968
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
969
|
-
/* harmony export */ AAContainer: () => (/* binding */ AAContainer),
|
|
970
|
-
/* harmony export */ AALoder: () => (/* binding */ AALoder),
|
|
971
|
-
/* harmony export */ FeedbackToast: () => (/* binding */ FeedbackToast),
|
|
972
|
-
/* harmony export */ IndividualLoader: () => (/* binding */ IndividualLoader),
|
|
973
|
-
/* harmony export */ NetworkErrorToast: () => (/* binding */ NetworkErrorToast)
|
|
974
|
-
/* harmony export */ });
|
|
975
|
-
/* harmony import */ var _aaContainer_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./aaContainer.scss */ "./src/components/common/templatemanager/base/aaContainer/aaContainer.scss");
|
|
976
|
-
/* harmony import */ var preact_hooks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! preact/hooks */ "./node_modules/preact/hooks/dist/hooks.module.js");
|
|
977
|
-
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! preact */ "./node_modules/preact/dist/preact.module.js");
|
|
978
|
-
/* harmony import */ var _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../constants/projConsts */ "./src/components/common/constants/projConsts.ts");
|
|
979
|
-
/* harmony import */ var _tabs_all_tabs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../tabs/all-tabs */ "./src/components/common/templatemanager/tabs/all-tabs.tsx");
|
|
980
|
-
/* harmony import */ var _tabs_assist_assist__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../tabs/assist/assist */ "./src/components/common/templatemanager/tabs/assist/assist.tsx");
|
|
981
|
-
/* harmony import */ var _tabs_agentic_CoPilot_agentic_CoPilot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../tabs/agentic-CoPilot/agentic-CoPilot */ "./src/components/common/templatemanager/tabs/agentic-CoPilot/agentic-CoPilot.tsx");
|
|
982
|
-
/* harmony import */ var _tabs_search_search__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../tabs/search/search */ "./src/components/common/templatemanager/tabs/search/search.tsx");
|
|
983
|
-
/* harmony import */ var _tabs_transcript_transcript__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../tabs/transcript/transcript */ "./src/components/common/templatemanager/tabs/transcript/transcript.tsx");
|
|
984
|
-
/* harmony import */ var _tabs_playbook_playbook__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../tabs/playbook/playbook */ "./src/components/common/templatemanager/tabs/playbook/playbook.tsx");
|
|
985
|
-
/* harmony import */ var _tabs_header_header__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../tabs/header/header */ "./src/components/common/templatemanager/tabs/header/header.tsx");
|
|
986
|
-
/* harmony import */ var _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../constants/events.cnst */ "./src/components/common/constants/events.cnst.ts");
|
|
987
|
-
/* harmony import */ var _tabs_mybot_mybot__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../tabs/mybot/mybot */ "./src/components/common/templatemanager/tabs/mybot/mybot.tsx");
|
|
988
|
-
/* harmony import */ var _domManager__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../domManager */ "./src/components/common/templatemanager/base/domManager.tsx");
|
|
989
|
-
/* harmony import */ var _utils_koregenerateuuid__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../utils/koregenerateuuid */ "./src/components/common/utils/koregenerateuuid.ts");
|
|
990
|
-
/* harmony import */ var _tabs_atom_dialogPopups__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../tabs/atom/dialogPopups */ "./src/components/common/templatemanager/tabs/atom/dialogPopups.tsx");
|
|
991
|
-
/* harmony import */ var _constants_settingsConsts__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../constants/settingsConsts */ "./src/components/common/constants/settingsConsts.ts");
|
|
992
|
-
/* harmony import */ var _tabs_automation_automation__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../tabs/automation/automation */ "./src/components/common/templatemanager/tabs/automation/automation.tsx");
|
|
993
|
-
/* harmony import */ var _tabs_ErrorBoundary_ErrorBoundary__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../tabs/ErrorBoundary/ErrorBoundary */ "./src/components/common/templatemanager/tabs/ErrorBoundary/ErrorBoundary.tsx");
|
|
994
|
-
/* harmony import */ var _tabs_custom_tab_custom__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../tabs/custom-tab/custom */ "./src/components/common/templatemanager/tabs/custom-tab/custom.tsx");
|
|
995
|
-
/* harmony import */ var _tabs_sentimentScore_sentimentScore__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../tabs/sentimentScore/sentimentScore */ "./src/components/common/templatemanager/tabs/sentimentScore/sentimentScore.tsx");
|
|
996
|
-
/* harmony import */ var _tabs_feedback_feedback__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../tabs/feedback/feedback */ "./src/components/common/templatemanager/tabs/feedback/feedback.tsx");
|
|
997
|
-
var __assign = (undefined && undefined.__assign) || function () {
|
|
998
|
-
__assign = Object.assign || function(t) {
|
|
999
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1000
|
-
s = arguments[i];
|
|
1001
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1002
|
-
t[p] = s[p];
|
|
1003
|
-
}
|
|
1004
|
-
return t;
|
|
1005
|
-
};
|
|
1006
|
-
return __assign.apply(this, arguments);
|
|
1007
|
-
};
|
|
1008
|
-
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
1009
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1010
|
-
if (ar || !(i in from)) {
|
|
1011
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
1012
|
-
ar[i] = from[i];
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1016
|
-
};
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
function NetworkErrorToast(props) {
|
|
1040
|
-
var _a;
|
|
1041
|
-
var languageData = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata;
|
|
1042
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "toast-custom-msg-container aa-network-error-toastr aa-hidden" },
|
|
1043
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "toast-msg-custom" },
|
|
1044
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "icon_block" },
|
|
1045
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" },
|
|
1046
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M7.17843 0.502645C3.59639 0.401083 0.604208 3.23702 0.502645 6.81905C0.401083 10.4011 3.23702 13.3972 6.81905 13.4987C10.4011 13.5964 13.3972 10.7644 13.4987 7.17843C13.5107 6.71937 13.4729 6.27055 13.3916 5.83646C13.3204 5.45632 12.8618 5.33602 12.5804 5.60138C12.445 5.72904 12.389 5.91835 12.4205 6.10172C12.4793 6.44341 12.5078 6.7945 12.4987 7.15499C12.4128 10.1862 9.87764 12.5808 6.84639 12.4987C3.81514 12.4128 1.41671 9.87764 1.49874 6.84639C1.58468 3.81514 4.11983 1.41671 7.15108 1.49874C8.00397 1.5256 8.8049 1.74585 9.51665 2.11731C9.72197 2.22446 9.97509 2.20036 10.1432 2.04103C10.3813 1.81533 10.3481 1.42597 10.0589 1.27097C9.19863 0.809842 8.22268 0.531475 7.17843 0.502645ZM12.3523 2.6921C12.157 2.49686 11.8405 2.49686 11.6452 2.6921L5.99874 8.33858L4.49874 6.84639L4.34964 6.69496C4.15628 6.49859 3.83996 6.49736 3.64509 6.69223C3.45032 6.887 3.45143 7.20312 3.64756 7.39651L3.79874 7.54559L5.64519 9.39796C5.84036 9.59376 6.15738 9.59401 6.35286 9.39853L12.3523 3.39913C12.5475 3.20389 12.5475 2.88734 12.3523 2.6921Z", fill: "#135423" }))),
|
|
1047
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("h1", { className: "toast-content-info" }, languageData === null || languageData === void 0 ? void 0 : languageData.SERVER_CONNECTION_ERROR),
|
|
1048
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "close-toast-msg aa-network-error-close-btn" },
|
|
1049
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none" },
|
|
1050
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M15 5.2002L5 15.2002M5 5.2002L15 15.2002", stroke: "#667085", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" }))))));
|
|
1051
|
-
}
|
|
1052
|
-
function FeedbackToast(props) {
|
|
1053
|
-
var _a, _b;
|
|
1054
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "toast-custom-msg-container aa-feedback-toastr aa-hidden" },
|
|
1055
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "toast-msg-custom" },
|
|
1056
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "icon_block" },
|
|
1057
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" },
|
|
1058
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M7.17843 0.502645C3.59639 0.401083 0.604208 3.23702 0.502645 6.81905C0.401083 10.4011 3.23702 13.3972 6.81905 13.4987C10.4011 13.5964 13.3972 10.7644 13.4987 7.17843C13.5107 6.71937 13.4729 6.27055 13.3916 5.83646C13.3204 5.45632 12.8618 5.33602 12.5804 5.60138C12.445 5.72904 12.389 5.91835 12.4205 6.10172C12.4793 6.44341 12.5078 6.7945 12.4987 7.15499C12.4128 10.1862 9.87764 12.5808 6.84639 12.4987C3.81514 12.4128 1.41671 9.87764 1.49874 6.84639C1.58468 3.81514 4.11983 1.41671 7.15108 1.49874C8.00397 1.5256 8.8049 1.74585 9.51665 2.11731C9.72197 2.22446 9.97509 2.20036 10.1432 2.04103C10.3813 1.81533 10.3481 1.42597 10.0589 1.27097C9.19863 0.809842 8.22268 0.531475 7.17843 0.502645ZM12.3523 2.6921C12.157 2.49686 11.8405 2.49686 11.6452 2.6921L5.99874 8.33858L4.49874 6.84639L4.34964 6.69496C4.15628 6.49859 3.83996 6.49736 3.64509 6.69223C3.45032 6.887 3.45143 7.20312 3.64756 7.39651L3.79874 7.54559L5.64519 9.39796C5.84036 9.59376 6.15738 9.59401 6.35286 9.39853L12.3523 3.39913C12.5475 3.20389 12.5475 2.88734 12.3523 2.6921Z", fill: "#135423" }))),
|
|
1059
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("h1", { className: "toast-content-info" }, (_b = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata) === null || _b === void 0 ? void 0 : _b.THANKS_FEEDBACK),
|
|
1060
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "close-toast-msg aa-feedback-close-btn" },
|
|
1061
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none" },
|
|
1062
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M15 5.2002L5 15.2002M5 5.2002L15 15.2002", stroke: "#667085", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" }))))));
|
|
1063
|
-
}
|
|
1064
|
-
function AALoder(props) {
|
|
1065
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { id: "aa-loader-main", className: "loader-progress-main" },
|
|
1066
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "loading-border" })));
|
|
1067
|
-
}
|
|
1068
|
-
function IndividualLoader(props) {
|
|
1069
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { id: "aa-loader-individual", className: "loader-progress-individual" },
|
|
1070
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "loading-border" })));
|
|
1071
|
-
}
|
|
1072
|
-
function AAContainer(props) {
|
|
1073
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1074
|
-
var hostInstance = props.hostInstance;
|
|
1075
|
-
var rootServiceInstance = hostInstance.rootService;
|
|
1076
|
-
var localStorageServiceInstance = hostInstance.localStorageService;
|
|
1077
|
-
var languageData = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata;
|
|
1078
|
-
var _m = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(false), assistTabActive = _m[0], setAssistTabActive = _m[1];
|
|
1079
|
-
var _o = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(false), mybotTabActive = _o[0], setMybotTabActive = _o[1];
|
|
1080
|
-
var _p = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(false), searchTabActive = _p[0], setSearchTabActive = _p[1];
|
|
1081
|
-
var _q = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(false), transcriptTabActive = _q[0], setTranscriptTabActive = _q[1];
|
|
1082
|
-
var _r = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(false), playbookTabActive = _r[0], setplaybookTabActive = _r[1];
|
|
1083
|
-
var _s = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(false), customTabActive = _s[0], setCustomTabActive = _s[1];
|
|
1084
|
-
var _t = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)('light'), selectedTheme = _t[0], setSelectedTheme = _t[1];
|
|
1085
|
-
var _u = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)([]), coachingHints = _u[0], setCoachingHints = _u[1];
|
|
1086
|
-
var _v = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)([]), coachingNudges = _v[0], setCoachingNudges = _v[1];
|
|
1087
|
-
var _w = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(""), editedSummaryText = _w[0], setEditedSummaryText = _w[1];
|
|
1088
|
-
var _x = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)((_b = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.aaSettings) === null || _b === void 0 ? void 0 : _b.agentAssistWidgetEnabled), showWidget = _x[0], setShowWidget = _x[1];
|
|
1089
|
-
var timeoutId = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useRef)(undefined);
|
|
1090
|
-
var hints = [];
|
|
1091
|
-
var nudges = [];
|
|
1092
|
-
var tabsNTitles = ((_c = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.prefsAccessObj) === null || _c === void 0 ? void 0 : _c.orderTabs) || [
|
|
1093
|
-
{ type: 'srch', title: 'Search', isEnabled: true },
|
|
1094
|
-
{ type: 'mB', title: 'My Bot', isEnabled: true },
|
|
1095
|
-
{ type: 'ast', title: 'Assist', isEnabled: true },
|
|
1096
|
-
{ type: 'trnspt', title: 'Transcript', isEnabled: true },
|
|
1097
|
-
{ type: 'cl', title: 'PlayBook', isEnabled: true },
|
|
1098
|
-
{ type: 'cst', title: 'Custom Tab', isEnabled: false },
|
|
1099
|
-
{ type: 'mR', title: 'More', isEnabled: true },
|
|
1100
|
-
{ type: 'ast-agentic', title: 'Agentic CoPilot', isEnabled: true }
|
|
1101
|
-
];
|
|
1102
|
-
var connectionDetails = props.connectionDetails;
|
|
1103
|
-
var sourceDesktop = 'SomeSource';
|
|
1104
|
-
var hideUserBotHistory = false;
|
|
1105
|
-
var serTabMap = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.serviceTabMap;
|
|
1106
|
-
var selectTab = (rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.activeTab) || 'ast';
|
|
1107
|
-
var classConstants = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ClassMapConstanst;
|
|
1108
|
-
var idMapConstants = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.IdMapConstant;
|
|
1109
|
-
var _y = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(0), offsetX = _y[0], setOffsetX = _y[1];
|
|
1110
|
-
var _z = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useState)(0), offsetY = _z[0], setOffsetY = _z[1];
|
|
1111
|
-
// Define a mapping of tab types to their components
|
|
1112
|
-
var tabComponents = {
|
|
1113
|
-
'srch': _tabs_search_search__WEBPACK_IMPORTED_MODULE_7__.Search,
|
|
1114
|
-
'mB': _tabs_mybot_mybot__WEBPACK_IMPORTED_MODULE_12__.MyBot,
|
|
1115
|
-
'trnspt': _tabs_transcript_transcript__WEBPACK_IMPORTED_MODULE_8__.Transcript,
|
|
1116
|
-
'cl': _tabs_playbook_playbook__WEBPACK_IMPORTED_MODULE_9__.Playbook,
|
|
1117
|
-
'cst': _tabs_custom_tab_custom__WEBPACK_IMPORTED_MODULE_19__.CustomTab,
|
|
1118
|
-
'ast': _tabs_assist_assist__WEBPACK_IMPORTED_MODULE_5__.Assist,
|
|
1119
|
-
'ast-agentic': _tabs_agentic_CoPilot_agentic_CoPilot__WEBPACK_IMPORTED_MODULE_6__.AgenticCoPilot
|
|
1120
|
-
};
|
|
1121
|
-
var moreOptions = [
|
|
1122
|
-
{
|
|
1123
|
-
className: 'feedback',
|
|
1124
|
-
title: languageData === null || languageData === void 0 ? void 0 : languageData.FEEDBACK_TITLE,
|
|
1125
|
-
icon: (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "15", height: "15", viewBox: "0 0 15 15", fill: "none" },
|
|
1126
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M4.08333 14.0833V6.75M0.75 8.08333V12.75C0.75 13.4864 1.34695 14.0833 2.08333 14.0833H11.0342C12.0213 14.0833 12.8608 13.3631 13.0109 12.3874L13.7289 7.72078C13.9152 6.50926 12.9779 5.41667 11.7521 5.41667H9.41667C9.04848 5.41667 8.75 5.11819 8.75 4.75V2.39389C8.75 1.486 8.014 0.75 7.10611 0.75C6.88956 0.75 6.69332 0.87753 6.60537 1.07542L4.25929 6.35409C4.15229 6.59484 3.91354 6.75 3.65008 6.75H2.08333C1.34695 6.75 0.75 7.34695 0.75 8.08333Z", stroke: "#667085", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" }))
|
|
1127
|
-
}
|
|
1128
|
-
];
|
|
1129
|
-
// Define a mapping of tab types to their active states
|
|
1130
|
-
var tabActiveStates = {
|
|
1131
|
-
'srch': searchTabActive,
|
|
1132
|
-
'mB': mybotTabActive,
|
|
1133
|
-
'trnspt': transcriptTabActive,
|
|
1134
|
-
'cl': playbookTabActive,
|
|
1135
|
-
'cst': customTabActive,
|
|
1136
|
-
'ast': assistTabActive
|
|
1137
|
-
};
|
|
1138
|
-
var tabTitles = {
|
|
1139
|
-
'srch': 'Search',
|
|
1140
|
-
'mB': 'My Bot',
|
|
1141
|
-
'trnspt': 'Transcript',
|
|
1142
|
-
'cl': 'PlayBook',
|
|
1143
|
-
'cst': ((_d = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.customTabPrefsObj) === null || _d === void 0 ? void 0 : _d.customTablbl) || 'Custom Tab',
|
|
1144
|
-
'ast': 'Assist',
|
|
1145
|
-
'mR': 'More'
|
|
1146
|
-
};
|
|
1147
|
-
var chatContainerClass = classConstants.SDK_MAIN_WRAPPER; //left-menu-nav-enable
|
|
1148
|
-
if ((tabsNTitles === null || tabsNTitles === void 0 ? void 0 : tabsNTitles.length) > 0 && ((_f = (_e = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.dskSettings) === null || _e === void 0 ? void 0 : _e.tabs) === null || _f === void 0 ? void 0 : _f.length) === 0) {
|
|
1149
|
-
tabsNTitles = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.prepareTabs(tabsNTitles, tabTitles);
|
|
1150
|
-
}
|
|
1151
|
-
if (((_h = (_g = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.dskSettings) === null || _g === void 0 ? void 0 : _g.tabs) === null || _h === void 0 ? void 0 : _h.length) > 0) {
|
|
1152
|
-
tabsNTitles = (_j = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.dskSettings) === null || _j === void 0 ? void 0 : _j.tabs;
|
|
1153
|
-
}
|
|
1154
|
-
rootServiceInstance.tabsNTitles = tabsNTitles;
|
|
1155
|
-
(0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
1156
|
-
var _a, _b, _c;
|
|
1157
|
-
if (!rootServiceInstance.activeTab) {
|
|
1158
|
-
rootServiceInstance.activeTab = ((_a = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.prefsAccessObj) === null || _a === void 0 ? void 0 : _a.defaultTab) || ((_b = (tabsNTitles === null || tabsNTitles === void 0 ? void 0 : tabsNTitles.find(function (item) { return item === null || item === void 0 ? void 0 : item.default; }))) === null || _b === void 0 ? void 0 : _b.type) || ((_c = tabsNTitles[0]) === null || _c === void 0 ? void 0 : _c.type);
|
|
1159
|
-
}
|
|
1160
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB, function (data) {
|
|
1161
|
-
toggleActiveTab(data.activeTab, data.footerTag);
|
|
1162
|
-
});
|
|
1163
|
-
updateTabActive(rootServiceInstance.activeTab, false);
|
|
1164
|
-
rootServiceInstance.checkTransferDetailsAndDisableWidget(hostInstance);
|
|
1165
|
-
addHeaderTemplate();
|
|
1166
|
-
addFooterTemplate();
|
|
1167
|
-
addTerminatePopupTemplate();
|
|
1168
|
-
addInterruptPopupTemplate();
|
|
1169
|
-
addFeedbackToastrTemplate();
|
|
1170
|
-
addListViewPopupTemplate();
|
|
1171
|
-
addAttachmentViewTemplate();
|
|
1172
|
-
addSettingsTemplate();
|
|
1173
|
-
addSentimentPopupTemplate();
|
|
1174
|
-
handleSentimentPopupOutSideClick();
|
|
1175
|
-
// addGenerateSummaryAction();
|
|
1176
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.DATA_EVENTS.AGENT_FEEDBACK_RESPONSE, handleFeedbackResponse);
|
|
1177
|
-
hostInstance.on('AGENT_COACHING_RESPONSES', handleCoachingEvents);
|
|
1178
|
-
hostInstance.on('END_OF_CONVERSATION', endOfConversationEvent);
|
|
1179
|
-
hostInstance.on('SET_SUMMARY_POPUP', handleSummaryPopup);
|
|
1180
|
-
hostInstance.on('RESOLUTION_COMMENTS_RESPONSE', handleSummaryResolutionComments);
|
|
1181
|
-
hostInstance.on('DESTROY_WIDGET', handleDestroyWidget);
|
|
1182
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.PAUSE_TRANSCRIPT, handlePauseResumeTranscript);
|
|
1183
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.RESUME_TRANSCRIPT, handlePauseResumeTranscript);
|
|
1184
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.GENERATE_INTERIM_SUMMARY, handleGenerateSummary);
|
|
1185
|
-
return function () {
|
|
1186
|
-
destroyContainer();
|
|
1187
|
-
};
|
|
1188
|
-
}, []);
|
|
1189
|
-
(0,preact_hooks__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {
|
|
1190
|
-
if (assistTabActive) {
|
|
1191
|
-
rootServiceInstance.handleAssistScroll(hostInstance);
|
|
1192
|
-
}
|
|
1193
|
-
if (transcriptTabActive) {
|
|
1194
|
-
rootServiceInstance.scrollBottomTranscript(hostInstance);
|
|
1195
|
-
}
|
|
1196
|
-
}, [assistTabActive, transcriptTabActive]);
|
|
1197
|
-
var handleDestroyWidget = function () {
|
|
1198
|
-
setShowWidget(false);
|
|
1199
|
-
destroyContainer();
|
|
1200
|
-
};
|
|
1201
|
-
var destroyContainer = function () {
|
|
1202
|
-
clearTimeout(timeoutId.current);
|
|
1203
|
-
hostInstance.off(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS_TO_SDK.UPDATE_ACTIVE_TAB);
|
|
1204
|
-
hostInstance.off(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.DATA_EVENTS.AGENT_FEEDBACK_RESPONSE, handleFeedbackResponse);
|
|
1205
|
-
hostInstance.off('AGENT_COACHING_RESPONSES', handleCoachingEvents);
|
|
1206
|
-
hostInstance.off('END_OF_CONVERSATION', endOfConversationEvent);
|
|
1207
|
-
hostInstance.off('SET_SUMMARY_POPUP', handleSummaryPopup);
|
|
1208
|
-
hostInstance.off('RESOLUTION_COMMENTS_RESPONSE', handleSummaryResolutionComments);
|
|
1209
|
-
hostInstance.off('DESTROY_WIDGET', function () { return setShowWidget(false); });
|
|
1210
|
-
hostInstance.off(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.PAUSE_TRANSCRIPT, handlePauseResumeTranscript);
|
|
1211
|
-
hostInstance.off(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.RESUME_TRANSCRIPT, handlePauseResumeTranscript);
|
|
1212
|
-
};
|
|
1213
|
-
var handleGenerateSummary = function (e) {
|
|
1214
|
-
var _a;
|
|
1215
|
-
if (!((_a = rootServiceInstance.generatedSummaries) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
1216
|
-
generateSummary({}, true);
|
|
1217
|
-
}
|
|
1218
|
-
else {
|
|
1219
|
-
hostInstance.setSummaryPopup({ initPopup: false, openToShowPreviousSummary: true });
|
|
1220
|
-
}
|
|
1221
|
-
};
|
|
1222
|
-
var handleCoachingEvents = function (response) { return handleCocahingResponse(response); };
|
|
1223
|
-
var chooseTheme = function () {
|
|
1224
|
-
setSelectedTheme(selectedTheme === 'light' ? 'dark' : 'light');
|
|
1225
|
-
};
|
|
1226
|
-
var endOfConversationEvent = function () {
|
|
1227
|
-
generateSummary({}, false);
|
|
1228
|
-
};
|
|
1229
|
-
var handleCocahingResponse = function (resData) {
|
|
1230
|
-
var _a, _b;
|
|
1231
|
-
if (((_a = rootServiceInstance.aaSettings) === null || _a === void 0 ? void 0 : _a.agentAssistWidgetEnabled) && ((_b = rootServiceInstance.aaSettings) === null || _b === void 0 ? void 0 : _b.isAgentCoachingEnabled)) {
|
|
1232
|
-
if ((resData === null || resData === void 0 ? void 0 : resData.action) === 'nudge') {
|
|
1233
|
-
handleNudgeData(resData);
|
|
1234
|
-
}
|
|
1235
|
-
else if ((resData === null || resData === void 0 ? void 0 : resData.action) === 'hint') {
|
|
1236
|
-
handleHintData(resData);
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
};
|
|
1240
|
-
var handleNudgeData = function (NudgeObject) {
|
|
1241
|
-
var _a, _b;
|
|
1242
|
-
var uQ = NudgeObject.actionId;
|
|
1243
|
-
nudges.unshift(NudgeObject);
|
|
1244
|
-
setCoachingNudges(function (prevNudges) { return __spreadArray([NudgeObject], prevNudges, true); });
|
|
1245
|
-
var nudgeBanner = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(nudgeHTMLEle, NudgeObject, hostInstance);
|
|
1246
|
-
var nudgeEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.getElementsByClassName(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ClassMapConstanst.NUDGE_TEMPLATE)[0];
|
|
1247
|
-
setTimeout(function () {
|
|
1248
|
-
var _a;
|
|
1249
|
-
var inx = nudges.findIndex(function (item) { return item.actionId === uQ; });
|
|
1250
|
-
if (inx >= 0) {
|
|
1251
|
-
var nudgeElement = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(uQ));
|
|
1252
|
-
if (nudgeElement) {
|
|
1253
|
-
nudgeElement.remove();
|
|
1254
|
-
coachingHints.splice(inx, 1);
|
|
1255
|
-
closeNudge(uQ);
|
|
1256
|
-
setCoachingNudges(function (prevNudges) { return prevNudges.filter(function (nudge) { return nudge.actionId !== uQ; }); });
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
}, 7000);
|
|
1260
|
-
(_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener(".".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ClassMapConstanst.NUDGE_CLOSE), 'click', function () {
|
|
1261
|
-
closeNudge(uQ);
|
|
1262
|
-
}, nudgeBanner);
|
|
1263
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, nudgeBanner, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.NUDGE_TEMPLATE, NudgeObject: NudgeObject });
|
|
1264
|
-
nudgeEle.append(nudgeBanner);
|
|
1265
|
-
};
|
|
1266
|
-
var nudgeHTMLEle = function (props) {
|
|
1267
|
-
var _a, _b, _c;
|
|
1268
|
-
var msgData = props.msgData;
|
|
1269
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { class: "nudges-card ".concat((_a = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst.NUDGE_DATA[msgData === null || msgData === void 0 ? void 0 : msgData.expression]) === null || _a === void 0 ? void 0 : _a.className), id: "".concat(msgData === null || msgData === void 0 ? void 0 : msgData.actionId) },
|
|
1270
|
-
((_b = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst.NUDGE_DATA[msgData === null || msgData === void 0 ? void 0 : msgData.expression]) === null || _b === void 0 ? void 0 : _b.icon) && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "icon_block" },
|
|
1271
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'neutral' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
1272
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M2.55371 8.35C2.55371 7.7701 3.02381 7.3 3.60371 7.3C4.18361 7.3 4.65371 7.7701 4.65371 8.35V12.55C4.65371 13.1299 4.18361 13.6 3.60371 13.6C3.02381 13.6 2.55371 13.1299 2.55371 12.55V8.35Z", fill: "white" }),
|
|
1273
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M5.35371 8.23334V12.0348C5.35371 12.565 5.65331 13.0498 6.12761 13.287L6.1625 13.3044C6.5513 13.4988 6.98002 13.6 7.4147 13.6H11.206C11.8733 13.6 12.4479 13.129 12.5788 12.4746L13.4188 8.27457C13.5921 7.40826 12.9295 6.6 12.046 6.6H9.55371V3.8C9.55371 3.0268 8.92691 2.4 8.15371 2.4C7.76711 2.4 7.45371 2.7134 7.45371 3.1V3.56667C7.45371 4.1725 7.25721 4.762 6.89371 5.24667L5.91371 6.55334C5.55021 7.038 5.35371 7.6275 5.35371 8.23334Z", fill: "white" })),
|
|
1274
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'alert' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
1275
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6.71312 3.61289C7.27776 2.60908 8.72302 2.60908 9.28766 3.61289L13.4086 10.9389C13.9624 11.9235 13.2509 13.14 12.1213 13.14H3.87949C2.74988 13.14 2.03841 11.9235 2.59222 10.9389L6.71312 3.61289ZM8.7388 10.9246C8.7388 11.3325 8.40817 11.6631 8.00033 11.6631C7.59248 11.6631 7.26185 11.3325 7.26185 10.9246C7.26185 10.5168 7.59248 10.1862 8.00033 10.1862C8.40817 10.1862 8.7388 10.5168 8.7388 10.9246ZM8.00033 5.01685C7.59248 5.01685 7.26185 5.34748 7.26185 5.75533V7.97075C7.26185 8.37859 7.59248 8.70922 8.00033 8.70922C8.40817 8.70922 8.7388 8.37859 8.7388 7.97075V5.75533C8.7388 5.34748 8.40817 5.01685 8.00033 5.01685Z", fill: "white" })),
|
|
1276
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'critical' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
1277
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M7.29961 3.1C7.29961 2.7134 7.61301 2.4 7.99961 2.4C8.38621 2.4 8.69961 2.7134 8.69961 3.1V6.95C8.69961 7.1433 8.85631 7.3 9.04961 7.3C9.24291 7.3 9.39961 7.1433 9.39961 6.95V3.8C9.39961 3.4134 9.71301 3.1 10.0996 3.1C10.4862 3.1 10.7996 3.4134 10.7996 3.8V6.95C10.7996 7.1433 10.9563 7.3 11.1496 7.3C11.3429 7.3 11.4996 7.1433 11.4996 6.95V5.2C11.4996 4.8134 11.813 4.5 12.1996 4.5C12.5862 4.5 12.8996 4.8134 12.8996 5.2V8.7C12.8996 11.4062 10.7058 13.6 7.99961 13.6C5.29341 13.6 3.09961 11.4062 3.09961 8.7V7.3C3.09961 6.9134 3.41301 6.6 3.79961 6.6C4.18621 6.6 4.49961 6.9134 4.49961 7.3V9.05C4.49961 9.2433 4.65631 9.4 4.84961 9.4C5.04291 9.4 5.19961 9.2433 5.19961 9.05V3.8C5.19961 3.4134 5.51301 3.1 5.89961 3.1C6.28621 3.1 6.59961 3.4134 6.59961 3.8V6.95C6.59961 7.1433 6.75631 7.3 6.94961 7.3C7.14291 7.3 7.29961 7.1433 7.29961 6.95V3.1Z", fill: "white" })),
|
|
1278
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'positive' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
1279
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M5.76708 0.5C5.40707 0.5 5.08084 0.712015 4.93462 1.04099L3.25425 4.82184C3.21348 4.91357 3.19219 4.96087 3.17474 4.99418L3.17319 4.99711L3.16988 4.99734C3.13236 4.99976 3.08048 5 2.9801 5L2.58073 5C2.31715 4.99999 2.08977 4.99998 1.90249 5.01528C1.70481 5.03144 1.50821 5.06709 1.31902 5.16349C1.03677 5.3073 0.807302 5.53677 0.663492 5.81901C0.567095 6.0082 0.531437 6.20481 0.515286 6.40249C0.499985 6.58977 0.499992 6.81714 0.5 7.08071V9.41927C0.499992 9.68284 0.499985 9.91023 0.515286 10.0975C0.531437 10.2952 0.567095 10.4918 0.663492 10.681C0.807302 10.9632 1.03677 11.1927 1.31902 11.3365C1.50821 11.4329 1.70481 11.4686 1.90249 11.4847C2.08977 11.5 2.31715 11.5 2.58072 11.5C2.81228 11.5 3 11.3123 3 11.0807L3 7C3 6.72386 3.22386 6.5 3.5 6.5C3.77614 6.5 4 6.72386 4 7L4 10.7C4 10.98 4 11.12 4.0545 11.227C4.10243 11.3211 4.17892 11.3976 4.27301 11.4455C4.37996 11.5 4.51997 11.5 4.8 11.5H7.9598C8.30918 11.5 8.59925 11.5 8.83792 11.4818C9.08711 11.4629 9.31681 11.4222 9.53857 11.3217C9.88536 11.1646 10.1801 10.9117 10.3881 10.5929C10.5212 10.3889 10.5963 10.1681 10.6529 9.9247C10.7072 9.69158 10.7513 9.40489 10.8044 9.05958L11.0722 7.31883C11.1426 6.86136 11.2003 6.4863 11.2207 6.18021C11.2418 5.86439 11.228 5.56971 11.1203 5.28725C10.9548 4.85354 10.6437 4.49087 10.2402 4.26142C9.9774 4.11199 9.68824 4.05357 9.37289 4.02636C9.06724 3.99999 8.68779 3.99999 8.22491 4H7.8C7.65174 4 7.57061 3.99961 7.51232 3.99485L7.50573 3.99428L7.50515 3.98768C7.50039 3.92939 7.5 3.84826 7.5 3.7V2.23292C7.5 1.27585 6.72415 0.5 5.76708 0.5Z", fill: "#039855" })))),
|
|
1280
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("p", null, (_c = msgData === null || msgData === void 0 ? void 0 : msgData.message) === null || _c === void 0 ? void 0 : _c.title),
|
|
1281
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "close-nudge aa-close-nudge", "aria-label": "button" },
|
|
1282
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
1283
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M4 12L12 4M4 4L12 12", stroke: "white", "stroke-width": "1.67", "stroke-linecap": "round", "stroke-linejoin": "round" })))));
|
|
1284
|
-
};
|
|
1285
|
-
var closeNudge = function (uQ) {
|
|
1286
|
-
var _a;
|
|
1287
|
-
var inx = nudges.findIndex(function (item) { return item.actionId === uQ; });
|
|
1288
|
-
if (inx >= 0) {
|
|
1289
|
-
var nudgeElement = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(uQ));
|
|
1290
|
-
if (nudgeElement) {
|
|
1291
|
-
nudgeElement.remove();
|
|
1292
|
-
nudges.splice(inx, 1);
|
|
1293
|
-
setCoachingNudges(function (prevNudges) { return prevNudges.filter(function (nudge) { return nudge.actionId !== uQ; }); });
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
};
|
|
1297
|
-
var handleHintData = function (hintObject) {
|
|
1298
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1299
|
-
var uQ = hintObject.actionId;
|
|
1300
|
-
hints.unshift(hintObject);
|
|
1301
|
-
setCoachingHints(function (prevHints) { return __spreadArray([hintObject], prevHints, true); });
|
|
1302
|
-
// this.hintScrollBottom(true);
|
|
1303
|
-
var HintBanner = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(hintHTMLEle, hintObject, hostInstance);
|
|
1304
|
-
var hintEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.getElementsByClassName(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ClassMapConstanst.HINT_TEMPLATE)[0];
|
|
1305
|
-
if (((_b = hintObject === null || hintObject === void 0 ? void 0 : hintObject.message) === null || _b === void 0 ? void 0 : _b.postAction) !== 'doesnot_auto_close') {
|
|
1306
|
-
setTimeout(function () {
|
|
1307
|
-
var _a;
|
|
1308
|
-
var inx = hints.findIndex(function (item) { return item.actionId === uQ; });
|
|
1309
|
-
if (inx >= 0) {
|
|
1310
|
-
var hintElement = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(uQ));
|
|
1311
|
-
if (hintElement) {
|
|
1312
|
-
hintElement.remove();
|
|
1313
|
-
hints.splice(inx, 1);
|
|
1314
|
-
setCoachingHints(function (prevHints) { return prevHints.filter(function (hints) { return hints.actionId !== uQ; }); });
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
}, (((_c = hintObject.message) === null || _c === void 0 ? void 0 : _c.time) < 900 ? (_d = hintObject.message) === null || _d === void 0 ? void 0 : _d.time : 900) * 1000);
|
|
1318
|
-
}
|
|
1319
|
-
(_e = hostInstance.eventManager) === null || _e === void 0 ? void 0 : _e.addEventListener(".".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ClassMapConstanst.HINT_CLOSE), 'click', function () {
|
|
1320
|
-
closeHint(uQ);
|
|
1321
|
-
}, HintBanner);
|
|
1322
|
-
(_f = hostInstance.eventManager) === null || _f === void 0 ? void 0 : _f.addEventListener(".".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ClassMapConstanst.ACKTEXT_CLOSE), 'click', function () {
|
|
1323
|
-
hintAckPressed(hintObject);
|
|
1324
|
-
closeHint(uQ);
|
|
1325
|
-
}, HintBanner);
|
|
1326
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, HintBanner, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.HINT_TEMPLATE, hintObject: hintObject });
|
|
1327
|
-
hintEle.append(HintBanner);
|
|
1328
|
-
};
|
|
1329
|
-
var hintHTMLEle = function (props) {
|
|
1330
|
-
var _a, _b, _c, _d, _e;
|
|
1331
|
-
var msgData = props.msgData;
|
|
1332
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "hint-card ".concat((_a = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst === null || _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst === void 0 ? void 0 : _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst.HINT_DATA[msgData === null || msgData === void 0 ? void 0 : msgData.expression]) === null || _a === void 0 ? void 0 : _a.className), style: { border: (_b = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst === null || _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst === void 0 ? void 0 : _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst.HINT_DATA[msgData === null || msgData === void 0 ? void 0 : msgData.expression]) === null || _b === void 0 ? void 0 : _b.color }, id: "".concat(msgData.actionId) },
|
|
1333
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "top-card-info" },
|
|
1334
|
-
((_c = _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst === null || _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst === void 0 ? void 0 : _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.coachingConst.HINT_DATA[msgData === null || msgData === void 0 ? void 0 : msgData.expression]) === null || _c === void 0 ? void 0 : _c.icon) && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "icon_block" },
|
|
1335
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'positive' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
1336
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M5.76708 0.5C5.40707 0.5 5.08084 0.712015 4.93462 1.04099L3.25425 4.82184C3.21348 4.91357 3.19219 4.96087 3.17474 4.99418L3.17319 4.99711L3.16988 4.99734C3.13236 4.99976 3.08048 5 2.9801 5L2.58073 5C2.31715 4.99999 2.08977 4.99998 1.90249 5.01528C1.70481 5.03144 1.50821 5.06709 1.31902 5.16349C1.03677 5.3073 0.807302 5.53677 0.663492 5.81901C0.567095 6.0082 0.531437 6.20481 0.515286 6.40249C0.499985 6.58977 0.499992 6.81714 0.5 7.08071V9.41927C0.499992 9.68284 0.499985 9.91023 0.515286 10.0975C0.531437 10.2952 0.567095 10.4918 0.663492 10.681C0.807302 10.9632 1.03677 11.1927 1.31902 11.3365C1.50821 11.4329 1.70481 11.4686 1.90249 11.4847C2.08977 11.5 2.31715 11.5 2.58072 11.5C2.81228 11.5 3 11.3123 3 11.0807L3 7C3 6.72386 3.22386 6.5 3.5 6.5C3.77614 6.5 4 6.72386 4 7L4 10.7C4 10.98 4 11.12 4.0545 11.227C4.10243 11.3211 4.17892 11.3976 4.27301 11.4455C4.37996 11.5 4.51997 11.5 4.8 11.5H7.9598C8.30918 11.5 8.59925 11.5 8.83792 11.4818C9.08711 11.4629 9.31681 11.4222 9.53857 11.3217C9.88536 11.1646 10.1801 10.9117 10.3881 10.5929C10.5212 10.3889 10.5963 10.1681 10.6529 9.9247C10.7072 9.69158 10.7513 9.40489 10.8044 9.05958L11.0722 7.31883C11.1426 6.86136 11.2003 6.4863 11.2207 6.18021C11.2418 5.86439 11.228 5.56971 11.1203 5.28725C10.9548 4.85354 10.6437 4.49087 10.2402 4.26142C9.9774 4.11199 9.68824 4.05357 9.37289 4.02636C9.06724 3.99999 8.68779 3.99999 8.22491 4H7.8C7.65174 4 7.57061 3.99961 7.51232 3.99485L7.50573 3.99428L7.50515 3.98768C7.50039 3.92939 7.5 3.84826 7.5 3.7V2.23292C7.5 1.27585 6.72415 0.5 5.76708 0.5Z", fill: "#039855" })),
|
|
1337
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'neutral' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
1338
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10.2008 6.00005C10.2008 8.31964 8.32038 10.2 6.00078 10.2C3.68119 10.2 1.80078 8.31964 1.80078 6.00005C1.80078 3.68045 3.68119 1.80005 6.00078 1.80005C8.32038 1.80005 10.2008 3.68045 10.2008 6.00005ZM6.52578 8.10005C6.52578 8.39 6.29073 8.62505 6.00078 8.62505C5.71083 8.62505 5.47578 8.39 5.47578 8.10005C5.47578 7.8101 5.71083 7.57505 6.00078 7.57505C6.29073 7.57505 6.52578 7.8101 6.52578 8.10005ZM6.00078 3.37505C5.71083 3.37505 5.47578 3.6101 5.47578 3.90005V6.00005C5.47578 6.29 5.71083 6.52505 6.00078 6.52505C6.29073 6.52505 6.52578 6.29 6.52578 6.00005V3.90005C6.52578 3.6101 6.29073 3.37505 6.00078 3.37505Z", fill: "#667085" })),
|
|
1339
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'alert' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
1340
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M6.40714 0.834185C6.14848 0.719172 5.8532 0.719172 5.59454 0.834185C5.39478 0.923011 5.26501 1.07947 5.17471 1.20696C5.08593 1.3323 4.99087 1.49651 4.88634 1.67711L0.75276 8.81693C0.647804 8.99818 0.552428 9.16289 0.487757 9.30268C0.422033 9.44475 0.35073 9.63572 0.373455 9.85369C0.40286 10.1357 0.550631 10.392 0.779988 10.5588C0.957236 10.6877 1.15823 10.7217 1.31411 10.736C1.46749 10.75 1.65782 10.75 1.86726 10.75H10.1344C10.3438 10.75 10.5342 10.75 10.6876 10.736C10.8434 10.7217 11.0444 10.6877 11.2217 10.5588C11.451 10.392 11.5988 10.1357 11.6282 9.85369C11.651 9.63572 11.5796 9.44475 11.5139 9.30268C11.4493 9.1629 11.3539 8.9982 11.2489 8.81697L7.11533 1.67709C7.0108 1.49651 6.91575 1.3323 6.82697 1.20696C6.73667 1.07947 6.6069 0.923011 6.40714 0.834185ZM6.50085 4.5C6.50085 4.22386 6.277 4 6.00085 4C5.72471 4 5.50085 4.22386 5.50085 4.5V6.5C5.50085 6.77614 5.72471 7 6.00085 7C6.277 7 6.50085 6.77614 6.50085 6.5V4.5ZM6.00085 8C5.72471 8 5.50085 8.22386 5.50085 8.5C5.50085 8.77614 5.72471 9 6.00085 9H6.00585C6.282 9 6.50585 8.77614 6.50585 8.5C6.50585 8.22386 6.282 8 6.00585 8H6.00085Z", fill: "#F79009" })),
|
|
1341
|
-
(msgData === null || msgData === void 0 ? void 0 : msgData.expression) === 'critical' && (0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
1342
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M3.45 5.72222V7.11111M3.45 5.72222V2.38889C3.45 1.92865 3.83056 1.55556 4.3 1.55556C4.76944 1.55556 5.15 1.92865 5.15 2.38889M3.45 5.72222C3.45 5.26198 3.06944 4.88889 2.6 4.88889C2.13056 4.88889 1.75 5.26198 1.75 5.72222V6.83333C1.75 9.13452 3.65279 11 6 11C8.34721 11 10.25 9.13452 10.25 6.83333V4.05556C10.25 3.59532 9.86944 3.22222 9.4 3.22222C8.93056 3.22222 8.55 3.59532 8.55 4.05556M5.15 2.38889V5.44444M5.15 2.38889V1.83333C5.15 1.3731 5.53056 1 6 1C6.46944 1 6.85 1.3731 6.85 1.83333V2.38889M6.85 2.38889V5.44444M6.85 2.38889C6.85 1.92865 7.23056 1.55556 7.7 1.55556C8.16944 1.55556 8.55 1.92865 8.55 2.38889V4.05556M8.55 4.05556V5.44444", stroke: "#F04438", "stroke-linecap": "round", "stroke-linejoin": "round" })))),
|
|
1343
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("h1", null, msgData.message.title),
|
|
1344
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "close-hint aa-close-hint", "aria-label": "button" },
|
|
1345
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
|
|
1346
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M15 5L5 15M5 5L15 15", stroke: "#E3E8EF", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" })))),
|
|
1347
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "body-hint" },
|
|
1348
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("p", null, msgData.message.body)),
|
|
1349
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "footer-hint" }, ((_d = msgData.adherence) === null || _d === void 0 ? void 0 : _d.adType) === 'ack' && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "aa-ackText-close" }, (_e = msgData.adherence) === null || _e === void 0 ? void 0 : _e.ackText)))));
|
|
1350
|
-
};
|
|
1351
|
-
var closeHint = function (uQ) {
|
|
1352
|
-
var _a;
|
|
1353
|
-
var inx = hints.findIndex(function (item) { return item.actionId === uQ; });
|
|
1354
|
-
if (inx >= 0) {
|
|
1355
|
-
var hintElement = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(uQ));
|
|
1356
|
-
if (hintElement) {
|
|
1357
|
-
hintElement.remove();
|
|
1358
|
-
hints.splice(inx, 1);
|
|
1359
|
-
setCoachingHints(function (prevHints) { return prevHints.filter(function (hints) { return hints.actionId !== uQ; }); });
|
|
1360
|
-
}
|
|
1361
|
-
}
|
|
1362
|
-
};
|
|
1363
|
-
// const hintScrollBottom = (flag: any) => {
|
|
1364
|
-
// if(flag && this.overlayhint){
|
|
1365
|
-
// this.overlayhint.nativeElement.scrollTop = 0;
|
|
1366
|
-
// }
|
|
1367
|
-
// }
|
|
1368
|
-
var hintAckPressed = function (data) {
|
|
1369
|
-
data["ackPressed"] = true;
|
|
1370
|
-
hostInstance.socketConnection.emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS.agent_coaching_ackpress, data);
|
|
1371
|
-
};
|
|
1372
|
-
var handleSentimentPopupOutSideClick = function () {
|
|
1373
|
-
window.onclick = function (event) {
|
|
1374
|
-
var _a, _b;
|
|
1375
|
-
if (!event.target.matches('aa-sentiment-popup-wrapper') && !event.target.matches('sentiment-btn')) {
|
|
1376
|
-
var sentimentPopup = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SENTIMENT_POPUP_WRAPPER));
|
|
1377
|
-
if (sentimentPopup) {
|
|
1378
|
-
sentimentPopup.classList.add(classConstants.HIDE_ELEMENT);
|
|
1379
|
-
}
|
|
1380
|
-
}
|
|
1381
|
-
};
|
|
1382
|
-
};
|
|
1383
|
-
var addSentimentPopupTemplate = function () {
|
|
1384
|
-
var _a, _b;
|
|
1385
|
-
var sentimentPopupTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_sentimentScore_sentimentScore__WEBPACK_IMPORTED_MODULE_20__.sentimentScore, { hostInstance: hostInstance }, hostInstance);
|
|
1386
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, sentimentPopupTemplate, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.SENTIMENT_POPUP_TEMPLATE, data: {} });
|
|
1387
|
-
var sentimentChart = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector('.sentiment-chart-drp');
|
|
1388
|
-
sentimentChart === null || sentimentChart === void 0 ? void 0 : sentimentChart.append(sentimentPopupTemplate);
|
|
1389
|
-
(_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener("#".concat(idMapConstants.SENTIMENT_POPUP_CLOSE_BTN), 'click', function (e) {
|
|
1390
|
-
var _a, _b, _c;
|
|
1391
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SENTIMENT_POPUP_WRAPPER)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1392
|
-
}, sentimentPopupTemplate);
|
|
1393
|
-
};
|
|
1394
|
-
var addHeaderTemplate = function () {
|
|
1395
|
-
var _a, _b, _c, _d, _e;
|
|
1396
|
-
var headerTemplate;
|
|
1397
|
-
var theme = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.localStorageService) === null || _a === void 0 ? void 0 : _a.getThemeLocal();
|
|
1398
|
-
headerTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_header_header__WEBPACK_IMPORTED_MODULE_10__.Header, { hostInstance: hostInstance, theme: theme }, hostInstance);
|
|
1399
|
-
var headerSection = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector(classConstants.HEADER);
|
|
1400
|
-
if (headerSection && headerTemplate) {
|
|
1401
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, headerTemplate, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.HEADER_TEMPLATE, data: {} });
|
|
1402
|
-
headerSection.append(headerTemplate);
|
|
1403
|
-
(_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _c === void 0 ? void 0 : _c.addEventListener("#".concat(idMapConstants.SETTINGS_BTN), 'click', function (event) {
|
|
1404
|
-
var _a, _b, _c;
|
|
1405
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, '', { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.SETTINGS_CLICK_EVENT, data: {} });
|
|
1406
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SETTINGS_POPUP)).classList) === null || _c === void 0 ? void 0 : _c.remove(classConstants.HIDE_ELEMENT);
|
|
1407
|
-
}, headerTemplate);
|
|
1408
|
-
(_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _d === void 0 ? void 0 : _d.addEventListener("#".concat(idMapConstants.DARK_THEME_BTN), 'click', function (event) {
|
|
1409
|
-
toggleTheme(headerTemplate);
|
|
1410
|
-
}, headerTemplate);
|
|
1411
|
-
(_e = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _e === void 0 ? void 0 : _e.addEventListener("#".concat(idMapConstants.LIGHT_THEME_BTN), 'click', function (event) {
|
|
1412
|
-
toggleTheme(headerTemplate);
|
|
1413
|
-
}, headerTemplate);
|
|
1414
|
-
}
|
|
1415
|
-
};
|
|
1416
|
-
var toggleTheme = function (headerTemplate) {
|
|
1417
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1418
|
-
var darkThemeBtn = (_a = headerTemplate === null || headerTemplate === void 0 ? void 0 : headerTemplate.querySelector) === null || _a === void 0 ? void 0 : _a.call(headerTemplate, "#".concat(idMapConstants.DARK_THEME_BTN));
|
|
1419
|
-
var lightThemeBtn = (_b = headerTemplate === null || headerTemplate === void 0 ? void 0 : headerTemplate.querySelector) === null || _b === void 0 ? void 0 : _b.call(headerTemplate, "#".concat(idMapConstants.LIGHT_THEME_BTN));
|
|
1420
|
-
var theme = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.localStorageService) === null || _c === void 0 ? void 0 : _c.getThemeLocal();
|
|
1421
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, '', { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.THEME_CHANGE_EVENT, data: { theme: theme === _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.LIGHT ? _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.DARK : _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.LIGHT } });
|
|
1422
|
-
if (theme === _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.LIGHT) {
|
|
1423
|
-
hostInstance.applyBranding(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.DARKTHEME_COLORCODES, _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.DARK);
|
|
1424
|
-
hostInstance.localStorageService.setThemeLocal(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.DARK);
|
|
1425
|
-
(_d = darkThemeBtn === null || darkThemeBtn === void 0 ? void 0 : darkThemeBtn.classList) === null || _d === void 0 ? void 0 : _d.add(classConstants.HIDE_ELEMENT);
|
|
1426
|
-
(_e = lightThemeBtn === null || lightThemeBtn === void 0 ? void 0 : lightThemeBtn.classList) === null || _e === void 0 ? void 0 : _e.remove(classConstants.HIDE_ELEMENT);
|
|
1427
|
-
}
|
|
1428
|
-
else {
|
|
1429
|
-
hostInstance.applyBranding((_g = (_f = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.config) === null || _f === void 0 ? void 0 : _f.branding) === null || _g === void 0 ? void 0 : _g.colors, _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.LIGHT);
|
|
1430
|
-
hostInstance.localStorageService.setThemeLocal(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.storageConst.LIGHT);
|
|
1431
|
-
(_h = darkThemeBtn === null || darkThemeBtn === void 0 ? void 0 : darkThemeBtn.classList) === null || _h === void 0 ? void 0 : _h.remove(classConstants.HIDE_ELEMENT);
|
|
1432
|
-
(_j = lightThemeBtn === null || lightThemeBtn === void 0 ? void 0 : lightThemeBtn.classList) === null || _j === void 0 ? void 0 : _j.add(classConstants.HIDE_ELEMENT);
|
|
1433
|
-
}
|
|
1434
|
-
};
|
|
1435
|
-
var addFooterTemplate = function () {
|
|
1436
|
-
var _a, _b, _c, _d;
|
|
1437
|
-
var allTabs;
|
|
1438
|
-
var showTranscript = (hostInstance.rootService.connectionDetails.channel === _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ProjConstants.VOICE) && ((_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.rootService) === null || _a === void 0 ? void 0 : _a.aaSettings) === null || _b === void 0 ? void 0 : _b.transcripts) === null || _c === void 0 ? void 0 : _c.isEnabled);
|
|
1439
|
-
allTabs = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_all_tabs__WEBPACK_IMPORTED_MODULE_4__.AllTabs, {
|
|
1440
|
-
tabsNTitles: tabsNTitles,
|
|
1441
|
-
selectedTab: serTabMap[selectTab],
|
|
1442
|
-
showTranscript: showTranscript,
|
|
1443
|
-
connectionDetails: connectionDetails,
|
|
1444
|
-
sourceDesktop: sourceDesktop,
|
|
1445
|
-
hideUserBotHistory: hideUserBotHistory,
|
|
1446
|
-
projConstants: _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.Tabs,
|
|
1447
|
-
selectedTheme: selectedTheme,
|
|
1448
|
-
chooseTheme: chooseTheme,
|
|
1449
|
-
hostInstance: hostInstance,
|
|
1450
|
-
rootServiceInstance: rootServiceInstance
|
|
1451
|
-
}, hostInstance);
|
|
1452
|
-
var footerTag = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelector(classConstants.FOOTER);
|
|
1453
|
-
if (footerTag) {
|
|
1454
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, allTabs, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.FOOTER_TEMPLATE, data: { tabsNTitles: tabsNTitles, footerTag: footerTag } });
|
|
1455
|
-
footerTag.append(allTabs);
|
|
1456
|
-
tabsNTitles.forEach(function (tab) {
|
|
1457
|
-
var _a, _b;
|
|
1458
|
-
if ((tab === null || tab === void 0 ? void 0 : tab.type) !== _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.Tabs.MORE) {
|
|
1459
|
-
(_a = hostInstance.eventManager) === null || _a === void 0 ? void 0 : _a.addEventListener("".concat(classConstants.FOOTER_BTN).concat(tab.type), 'click', function () {
|
|
1460
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1461
|
-
(_d = (_c = (_b = (_a = hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.HINTS_WRAPPER_FIXED))) === null || _c === void 0 ? void 0 : _c.classList) === null || _d === void 0 ? void 0 : _d.remove(classConstants.HIDE_ELEMENT);
|
|
1462
|
-
(_h = (_g = (_f = (_e = hostInstance.chatEle) === null || _e === void 0 ? void 0 : _e.querySelector) === null || _f === void 0 ? void 0 : _f.call(_e, "".concat(classConstants.NUDGES_WRAPPER_FIXED))) === null || _g === void 0 ? void 0 : _g.classList) === null || _h === void 0 ? void 0 : _h.remove(classConstants.HIDE_ELEMENT);
|
|
1463
|
-
toggleActiveTab(tab.type, footerTag);
|
|
1464
|
-
}, footerTag);
|
|
1465
|
-
}
|
|
1466
|
-
else {
|
|
1467
|
-
(_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener("".concat(classConstants.FOOTER_BTN).concat(tab.type), 'click', function () {
|
|
1468
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1469
|
-
(_d = (_c = (_b = (_a = hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.HINTS_WRAPPER_FIXED))) === null || _c === void 0 ? void 0 : _c.classList) === null || _d === void 0 ? void 0 : _d.add(classConstants.HIDE_ELEMENT);
|
|
1470
|
-
(_h = (_g = (_f = (_e = hostInstance.chatEle) === null || _e === void 0 ? void 0 : _e.querySelector) === null || _f === void 0 ? void 0 : _f.call(_e, "".concat(classConstants.NUDGES_WRAPPER_FIXED))) === null || _g === void 0 ? void 0 : _g.classList) === null || _h === void 0 ? void 0 : _h.add(classConstants.HIDE_ELEMENT);
|
|
1471
|
-
rootServiceInstance.moreBtnActive = !rootServiceInstance.moreBtnActive;
|
|
1472
|
-
toggleMoreTab(footerTag);
|
|
1473
|
-
}, footerTag);
|
|
1474
|
-
}
|
|
1475
|
-
});
|
|
1476
|
-
}
|
|
1477
|
-
};
|
|
1478
|
-
var toggleMoreTab = function (footerTag) {
|
|
1479
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1480
|
-
if (!rootServiceInstance.isWidgetFeedbackAPICalled) {
|
|
1481
|
-
rootServiceInstance.isWidgetFeedbackAPICalled = true;
|
|
1482
|
-
var params = {
|
|
1483
|
-
botId: hostInstance.rootService.connectionDetails.botId,
|
|
1484
|
-
conversationId: hostInstance.rootService.connectionDetails.conversationId
|
|
1485
|
-
};
|
|
1486
|
-
rootServiceInstance.getWidgetFeedbackHistory(params, hostInstance).then(function (response) {
|
|
1487
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1488
|
-
if (response && ((_a = response === null || response === void 0 ? void 0 : response.results) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
1489
|
-
rootServiceInstance.widgetFeedbackData.positionId = ((_b = response === null || response === void 0 ? void 0 : response.results[0]) === null || _b === void 0 ? void 0 : _b.positionId) || '';
|
|
1490
|
-
rootServiceInstance.widgetFeedbackData.type = ((_c = response === null || response === void 0 ? void 0 : response.results[0]) === null || _c === void 0 ? void 0 : _c.feedback) === 'like' ? 'positive' : 'negative';
|
|
1491
|
-
rootServiceInstance.widgetFeedbackData.selectedSuggestions = ((_d = response === null || response === void 0 ? void 0 : response.results[0]) === null || _d === void 0 ? void 0 : _d.feedbackDetails) || [];
|
|
1492
|
-
rootServiceInstance.widgetFeedbackData.comment = ((_e = response === null || response === void 0 ? void 0 : response.results[0]) === null || _e === void 0 ? void 0 : _e.comment) || '';
|
|
1493
|
-
rootServiceInstance.widgetHistoryType = ((_f = response === null || response === void 0 ? void 0 : response.results[0]) === null || _f === void 0 ? void 0 : _f.feedback) === 'like' ? 'positive' : 'negative';
|
|
1494
|
-
}
|
|
1495
|
-
}).catch(function (error) {
|
|
1496
|
-
console.error('error in getting the Widget Feedback History', error);
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
|
-
var existingOptionsTemplate = footerTag === null || footerTag === void 0 ? void 0 : footerTag.querySelector("".concat(classConstants.MULTIPLE_OPTIONS_POPUP));
|
|
1500
|
-
if (rootServiceInstance.moreBtnActive) {
|
|
1501
|
-
if (existingOptionsTemplate) {
|
|
1502
|
-
(_a = existingOptionsTemplate === null || existingOptionsTemplate === void 0 ? void 0 : existingOptionsTemplate.classList) === null || _a === void 0 ? void 0 : _a.remove(classConstants.HIDE_ELEMENT);
|
|
1503
|
-
}
|
|
1504
|
-
else {
|
|
1505
|
-
addMultipleOptionsPopupTemplate(footerTag);
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
else {
|
|
1509
|
-
(_e = (_d = (_c = (_b = hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.HINTS_WRAPPER_FIXED))) === null || _d === void 0 ? void 0 : _d.classList) === null || _e === void 0 ? void 0 : _e.remove(classConstants.HIDE_ELEMENT);
|
|
1510
|
-
(_j = (_h = (_g = (_f = hostInstance.chatEle) === null || _f === void 0 ? void 0 : _f.querySelector) === null || _g === void 0 ? void 0 : _g.call(_f, "".concat(classConstants.NUDGES_WRAPPER_FIXED))) === null || _h === void 0 ? void 0 : _h.classList) === null || _j === void 0 ? void 0 : _j.remove(classConstants.HIDE_ELEMENT);
|
|
1511
|
-
(_k = existingOptionsTemplate === null || existingOptionsTemplate === void 0 ? void 0 : existingOptionsTemplate.classList) === null || _k === void 0 ? void 0 : _k.add(classConstants.HIDE_ELEMENT);
|
|
1512
|
-
}
|
|
1513
|
-
};
|
|
1514
|
-
var addMultipleOptionsPopupTemplate = function (footerTag) {
|
|
1515
|
-
var _a, _b, _c;
|
|
1516
|
-
var optionsTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_atom_dialogPopups__WEBPACK_IMPORTED_MODULE_15__.RenderMultipleOptionsPopup, { moreOptions: moreOptions }, hostInstance);
|
|
1517
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, optionsTemplate, {
|
|
1518
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.OVERALL_MORE_OPTIONS_TEMPLATE,
|
|
1519
|
-
data: {}
|
|
1520
|
-
});
|
|
1521
|
-
(_a = footerTag === null || footerTag === void 0 ? void 0 : footerTag.querySelector("".concat(classConstants.FOOTER_BTN).concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.Tabs.MORE))) === null || _a === void 0 ? void 0 : _a.prepend(optionsTemplate);
|
|
1522
|
-
var optionsTemplateSelected = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector("".concat(classConstants.MULTIPLE_OPTIONS_POPUP));
|
|
1523
|
-
(_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _c === void 0 ? void 0 : _c.addEventListener("".concat(classConstants.OPTION_FEEDBACK), 'click', function () {
|
|
1524
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
1525
|
-
(_d = (_c = (_b = (_a = hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.HINTS_WRAPPER_FIXED))) === null || _c === void 0 ? void 0 : _c.classList) === null || _d === void 0 ? void 0 : _d.remove(classConstants.HIDE_ELEMENT);
|
|
1526
|
-
(_h = (_g = (_f = (_e = hostInstance.chatEle) === null || _e === void 0 ? void 0 : _e.querySelector) === null || _f === void 0 ? void 0 : _f.call(_e, "".concat(classConstants.NUDGES_WRAPPER_FIXED))) === null || _g === void 0 ? void 0 : _g.classList) === null || _h === void 0 ? void 0 : _h.remove(classConstants.HIDE_ELEMENT);
|
|
1527
|
-
var feedbackPopupOverlay = (_k = (_j = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _j === void 0 ? void 0 : _j.querySelector) === null || _k === void 0 ? void 0 : _k.call(_j, "".concat(classConstants.FEEDBACK_POPUP_OVERLAY));
|
|
1528
|
-
if (feedbackPopupOverlay) {
|
|
1529
|
-
(_l = feedbackPopupOverlay === null || feedbackPopupOverlay === void 0 ? void 0 : feedbackPopupOverlay.classList) === null || _l === void 0 ? void 0 : _l.remove(classConstants.HIDE_ELEMENT);
|
|
1530
|
-
}
|
|
1531
|
-
else {
|
|
1532
|
-
addFeedbackPopupTemplate();
|
|
1533
|
-
}
|
|
1534
|
-
}, optionsTemplateSelected);
|
|
1535
|
-
};
|
|
1536
|
-
var addListViewPopupTemplate = function () {
|
|
1537
|
-
var _a, _b, _c;
|
|
1538
|
-
var listViewTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_atom_dialogPopups__WEBPACK_IMPORTED_MODULE_15__.RenderListView, {}, hostInstance);
|
|
1539
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, listViewTemplate, {
|
|
1540
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.LIST_VIEW_TEMPLATE,
|
|
1541
|
-
data: {}
|
|
1542
|
-
});
|
|
1543
|
-
(_a = hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.append(listViewTemplate);
|
|
1544
|
-
(_c = (_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.LIST_VIEW_CLOSE_BTN), 'click', function (e) {
|
|
1545
|
-
rootServiceInstance.closeListView(hostInstance);
|
|
1546
|
-
}, listViewTemplate);
|
|
1547
|
-
};
|
|
1548
|
-
var addFeedbackPopupTemplate = function () {
|
|
1549
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1550
|
-
var feedbackPopupTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(FeedbackPopupHTMLEle, {}, hostInstance);
|
|
1551
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, feedbackPopupTemplate, {
|
|
1552
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.OVERALL_FEEDBACK_POPUP_TEMPLATE,
|
|
1553
|
-
data: {}
|
|
1554
|
-
});
|
|
1555
|
-
(_a = hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.append(feedbackPopupTemplate);
|
|
1556
|
-
if (rootServiceInstance.widgetFeedbackData.type) {
|
|
1557
|
-
var positiveFeedbackBlock = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector("".concat(classConstants.POSITIVE_FEEDBACK_INFO));
|
|
1558
|
-
var negativeFeedbackBlock = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector("".concat(classConstants.NEGATIVE_FEEDBACK_INFO));
|
|
1559
|
-
if (rootServiceInstance.widgetFeedbackData.type === 'positive') {
|
|
1560
|
-
addFeedbackPositiveSuggestion(feedbackPopupTemplate, positiveFeedbackBlock);
|
|
1561
|
-
}
|
|
1562
|
-
else {
|
|
1563
|
-
addFeedbackNegativeSuggestion(feedbackPopupTemplate, negativeFeedbackBlock);
|
|
1564
|
-
}
|
|
1565
|
-
}
|
|
1566
|
-
(_c = (_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.FEEDBACK_POPUP_CLOSE_BTN), 'click', function (e) {
|
|
1567
|
-
var _a, _b, _c;
|
|
1568
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.FEEDBACK_POPUP_OVERLAY)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1569
|
-
}, feedbackPopupTemplate);
|
|
1570
|
-
(_e = (_d = hostInstance.eventManager) === null || _d === void 0 ? void 0 : _d.addEventListener) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.FEEDBACK_SUBMIT_BTN), 'click', function (e) {
|
|
1571
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1572
|
-
if (!((_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.FEEDBACK_SUBMIT_BTN))) === null || _c === void 0 ? void 0 : _c.hasAttribute('disabled'))) {
|
|
1573
|
-
(_f = (_e = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelector) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.FEEDBACK_SUBMIT_BTN))) === null || _f === void 0 ? void 0 : _f.setAttribute('disabled', true);
|
|
1574
|
-
}
|
|
1575
|
-
(_j = (_h = (_g = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _g === void 0 ? void 0 : _g.querySelector) === null || _h === void 0 ? void 0 : _h.call(_g, "".concat(classConstants.FEEDBACK_POPUP_OVERLAY)).classList) === null || _j === void 0 ? void 0 : _j.add(classConstants.HIDE_ELEMENT);
|
|
1576
|
-
rootServiceInstance.prepareAndMakeWidgetFeedbackRequest(hostInstance);
|
|
1577
|
-
}, feedbackPopupTemplate);
|
|
1578
|
-
(_g = (_f = hostInstance.eventManager) === null || _f === void 0 ? void 0 : _f.addEventListener) === null || _g === void 0 ? void 0 : _g.call(_f, "".concat(classConstants.FEEDBACK_SATISFIED_BTN), 'click', function (e) {
|
|
1579
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1580
|
-
if ((_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.FEEDBACK_SUBMIT_BTN))) === null || _c === void 0 ? void 0 : _c.hasAttribute('disabled')) {
|
|
1581
|
-
(_f = (_e = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelector) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.FEEDBACK_SUBMIT_BTN))) === null || _f === void 0 ? void 0 : _f.removeAttribute('disabled');
|
|
1582
|
-
}
|
|
1583
|
-
var positiveFeedbackBlock = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector("".concat(classConstants.POSITIVE_FEEDBACK_INFO));
|
|
1584
|
-
var negativeFeedbackBlock = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector("".concat(classConstants.NEGATIVE_FEEDBACK_INFO));
|
|
1585
|
-
toggleOverallFeedbackActiveButton(true);
|
|
1586
|
-
if (rootServiceInstance.widgetFeedbackData.type === 'negative') {
|
|
1587
|
-
rootServiceInstance.widgetFeedbackData.type = 'positive';
|
|
1588
|
-
rootServiceInstance.widgetFeedbackData.selectedSuggestions = [];
|
|
1589
|
-
rootServiceInstance.widgetFeedbackData.comment = '';
|
|
1590
|
-
}
|
|
1591
|
-
if (negativeFeedbackBlock) {
|
|
1592
|
-
(_g = negativeFeedbackBlock === null || negativeFeedbackBlock === void 0 ? void 0 : negativeFeedbackBlock.classList) === null || _g === void 0 ? void 0 : _g.add(classConstants.HIDE_ELEMENT);
|
|
1593
|
-
}
|
|
1594
|
-
addFeedbackPositiveSuggestion(feedbackPopupTemplate, positiveFeedbackBlock);
|
|
1595
|
-
}, feedbackPopupTemplate);
|
|
1596
|
-
(_j = (_h = hostInstance.eventManager) === null || _h === void 0 ? void 0 : _h.addEventListener) === null || _j === void 0 ? void 0 : _j.call(_h, "".concat(classConstants.FEEDBACK_UNSATISFIED_BTN), 'click', function (e) {
|
|
1597
|
-
var _a;
|
|
1598
|
-
var positiveFeedbackBlock = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector("".concat(classConstants.POSITIVE_FEEDBACK_INFO));
|
|
1599
|
-
var negativeFeedbackBlock = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector("".concat(classConstants.NEGATIVE_FEEDBACK_INFO));
|
|
1600
|
-
toggleOverallFeedbackActiveButton(false);
|
|
1601
|
-
if (positiveFeedbackBlock) {
|
|
1602
|
-
(_a = positiveFeedbackBlock === null || positiveFeedbackBlock === void 0 ? void 0 : positiveFeedbackBlock.classList) === null || _a === void 0 ? void 0 : _a.add(classConstants.HIDE_ELEMENT);
|
|
1603
|
-
}
|
|
1604
|
-
addFeedbackNegativeSuggestion(feedbackPopupTemplate, negativeFeedbackBlock);
|
|
1605
|
-
}, feedbackPopupTemplate);
|
|
1606
|
-
};
|
|
1607
|
-
var addFeedbackPositiveSuggestion = function (feedbackPopupTemplate, positiveFeedbackBlock) {
|
|
1608
|
-
var _a;
|
|
1609
|
-
if (positiveFeedbackBlock) {
|
|
1610
|
-
(_a = positiveFeedbackBlock === null || positiveFeedbackBlock === void 0 ? void 0 : positiveFeedbackBlock.classList) === null || _a === void 0 ? void 0 : _a.remove(classConstants.HIDE_ELEMENT);
|
|
1611
|
-
}
|
|
1612
|
-
else {
|
|
1613
|
-
addPositiveFeedbackBlock(feedbackPopupTemplate);
|
|
1614
|
-
}
|
|
1615
|
-
};
|
|
1616
|
-
var addPositiveFeedbackBlock = function (feedbackPopupTemplate) {
|
|
1617
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
1618
|
-
var positiveSuggestionList = [];
|
|
1619
|
-
var isDefaultSuggestionList = false;
|
|
1620
|
-
var language = ((_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.localStorageService) === null || _a === void 0 ? void 0 : _a.getLanguage()) || 'en';
|
|
1621
|
-
if (((_f = (_e = (_d = (_c = (_b = rootServiceInstance.aaSettings) === null || _b === void 0 ? void 0 : _b.feedback) === null || _c === void 0 ? void 0 : _c.widget) === null || _d === void 0 ? void 0 : _d.positiveKeyWords) === null || _e === void 0 ? void 0 : _e[language]) === null || _f === void 0 ? void 0 : _f.length) > 0) {
|
|
1622
|
-
positiveSuggestionList = (_l = (_k = (_j = (_h = (_g = rootServiceInstance.aaSettings) === null || _g === void 0 ? void 0 : _g.feedback) === null || _h === void 0 ? void 0 : _h.widget) === null || _j === void 0 ? void 0 : _j.positiveKeyWords) === null || _k === void 0 ? void 0 : _k[language]) === null || _l === void 0 ? void 0 : _l.filter(function (item) { return item === null || item === void 0 ? void 0 : item.isEnabled; });
|
|
1623
|
-
}
|
|
1624
|
-
else {
|
|
1625
|
-
isDefaultSuggestionList = true;
|
|
1626
|
-
positiveSuggestionList = _constants_settingsConsts__WEBPACK_IMPORTED_MODULE_16__.FeebackConst.DEFAULT_SUGGESTION.positiveDialogs[language];
|
|
1627
|
-
}
|
|
1628
|
-
var showComments = (_p = (_o = (_m = rootServiceInstance.aaSettings) === null || _m === void 0 ? void 0 : _m.feedback) === null || _o === void 0 ? void 0 : _o.widget) === null || _p === void 0 ? void 0 : _p.acceptComment;
|
|
1629
|
-
var overallFeedbackSection = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_feedback_feedback__WEBPACK_IMPORTED_MODULE_21__.OverallFeedbackSection, { suggestionList: positiveSuggestionList, isDefaultSuggestionList: isDefaultSuggestionList, showComments: showComments, type: 'positive' }, hostInstance);
|
|
1630
|
-
if (overallFeedbackSection) {
|
|
1631
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, overallFeedbackSection, {
|
|
1632
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.OVERALL_WIDGET_FEEDBACK_POSITIVE_TEMPLATE,
|
|
1633
|
-
data: { suggestionList: positiveSuggestionList, isDefaultSuggestionList: isDefaultSuggestionList, showComments: showComments, type: 'positive' }
|
|
1634
|
-
});
|
|
1635
|
-
(_r = (_q = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector) === null || _q === void 0 ? void 0 : _q.call(feedbackPopupTemplate, "".concat(classConstants.FEEDBACK_POPUP_BODY))) === null || _r === void 0 ? void 0 : _r.append(overallFeedbackSection);
|
|
1636
|
-
rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.handleWidgetFeedbackClickEvents(overallFeedbackSection, 'positive', hostInstance);
|
|
1637
|
-
}
|
|
1638
|
-
};
|
|
1639
|
-
var addFeedbackNegativeSuggestion = function (feedbackPopupTemplate, negativeFeedbackBlock) {
|
|
1640
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1641
|
-
if (negativeFeedbackBlock) {
|
|
1642
|
-
if ((((_a = rootServiceInstance.widgetFeedbackData.selectedSuggestions) === null || _a === void 0 ? void 0 : _a.length) > 0 || ((_b = rootServiceInstance.widgetFeedbackData.comment) === null || _b === void 0 ? void 0 : _b.length) > 0) && rootServiceInstance.widgetFeedbackData.type !== 'negative') {
|
|
1643
|
-
(_e = (_d = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _c === void 0 ? void 0 : _c.querySelector) === null || _d === void 0 ? void 0 : _d.call(_c, "".concat(classConstants.FEEDBACK_SUBMIT_BTN))) === null || _e === void 0 ? void 0 : _e.setAttribute('disabled', true);
|
|
1644
|
-
}
|
|
1645
|
-
(_f = negativeFeedbackBlock === null || negativeFeedbackBlock === void 0 ? void 0 : negativeFeedbackBlock.classList) === null || _f === void 0 ? void 0 : _f.remove(classConstants.HIDE_ELEMENT);
|
|
1646
|
-
}
|
|
1647
|
-
else {
|
|
1648
|
-
addNegativeFeedbackBlock(feedbackPopupTemplate);
|
|
1649
|
-
}
|
|
1650
|
-
};
|
|
1651
|
-
var addNegativeFeedbackBlock = function (feedbackPopupTemplate) {
|
|
1652
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1653
|
-
var negativeSuggestionList = [];
|
|
1654
|
-
var isDefaultSuggestionList = false;
|
|
1655
|
-
var language = ((_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.localStorageService) === null || _a === void 0 ? void 0 : _a.getLanguage()) || 'en';
|
|
1656
|
-
if (((_f = (_e = (_d = (_c = (_b = rootServiceInstance.aaSettings) === null || _b === void 0 ? void 0 : _b.feedback) === null || _c === void 0 ? void 0 : _c.widget) === null || _d === void 0 ? void 0 : _d.negativeKeyWords) === null || _e === void 0 ? void 0 : _e[language]) === null || _f === void 0 ? void 0 : _f.length) > 0) {
|
|
1657
|
-
negativeSuggestionList = (_l = (_k = (_j = (_h = (_g = rootServiceInstance.aaSettings) === null || _g === void 0 ? void 0 : _g.feedback) === null || _h === void 0 ? void 0 : _h.widget) === null || _j === void 0 ? void 0 : _j.negativeKeyWords) === null || _k === void 0 ? void 0 : _k[language]) === null || _l === void 0 ? void 0 : _l.filter(function (item) { return item === null || item === void 0 ? void 0 : item.isEnabled; });
|
|
1658
|
-
}
|
|
1659
|
-
else {
|
|
1660
|
-
isDefaultSuggestionList = true;
|
|
1661
|
-
negativeSuggestionList = _constants_settingsConsts__WEBPACK_IMPORTED_MODULE_16__.FeebackConst.DEFAULT_SUGGESTION.dialogs[language];
|
|
1662
|
-
}
|
|
1663
|
-
var showComments = (_p = (_o = (_m = rootServiceInstance.aaSettings) === null || _m === void 0 ? void 0 : _m.feedback) === null || _o === void 0 ? void 0 : _o.widget) === null || _p === void 0 ? void 0 : _p.acceptComment;
|
|
1664
|
-
var overallFeedbackSection = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_feedback_feedback__WEBPACK_IMPORTED_MODULE_21__.OverallFeedbackSection, { suggestionList: negativeSuggestionList, isDefaultSuggestionList: isDefaultSuggestionList, showComments: showComments, type: 'negative' }, hostInstance);
|
|
1665
|
-
if (overallFeedbackSection) {
|
|
1666
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, overallFeedbackSection, {
|
|
1667
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.OVERALL_WIDGET_FEEDBACK_NEGATIVE_TEMPLATE,
|
|
1668
|
-
data: { suggestionList: negativeSuggestionList, isDefaultSuggestionList: isDefaultSuggestionList, showComments: showComments, type: 'negative' }
|
|
1669
|
-
});
|
|
1670
|
-
(_r = (_q = feedbackPopupTemplate === null || feedbackPopupTemplate === void 0 ? void 0 : feedbackPopupTemplate.querySelector) === null || _q === void 0 ? void 0 : _q.call(feedbackPopupTemplate, "".concat(classConstants.FEEDBACK_POPUP_BODY))) === null || _r === void 0 ? void 0 : _r.append(overallFeedbackSection);
|
|
1671
|
-
(_u = (_t = (_s = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _s === void 0 ? void 0 : _s.querySelector) === null || _t === void 0 ? void 0 : _t.call(_s, "".concat(classConstants.FEEDBACK_SUBMIT_BTN))) === null || _u === void 0 ? void 0 : _u.setAttribute('disabled', true);
|
|
1672
|
-
rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.handleWidgetFeedbackClickEvents(overallFeedbackSection, 'negative', hostInstance);
|
|
1673
|
-
}
|
|
1674
|
-
};
|
|
1675
|
-
var toggleOverallFeedbackActiveButton = function (isLike) {
|
|
1676
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1677
|
-
var activeElement;
|
|
1678
|
-
var inactiveElement;
|
|
1679
|
-
if (isLike) {
|
|
1680
|
-
activeElement = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.FEEDBACK_SATISFIED_BTN));
|
|
1681
|
-
inactiveElement = (_d = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _c === void 0 ? void 0 : _c.querySelector) === null || _d === void 0 ? void 0 : _d.call(_c, "".concat(classConstants.FEEDBACK_UNSATISFIED_BTN));
|
|
1682
|
-
}
|
|
1683
|
-
else {
|
|
1684
|
-
activeElement = (_f = (_e = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _e === void 0 ? void 0 : _e.querySelector) === null || _f === void 0 ? void 0 : _f.call(_e, "".concat(classConstants.FEEDBACK_UNSATISFIED_BTN));
|
|
1685
|
-
inactiveElement = (_h = (_g = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _g === void 0 ? void 0 : _g.querySelector) === null || _h === void 0 ? void 0 : _h.call(_g, "".concat(classConstants.FEEDBACK_SATISFIED_BTN));
|
|
1686
|
-
}
|
|
1687
|
-
(_j = activeElement === null || activeElement === void 0 ? void 0 : activeElement.classList) === null || _j === void 0 ? void 0 : _j.add('active');
|
|
1688
|
-
(_k = inactiveElement === null || inactiveElement === void 0 ? void 0 : inactiveElement.classList) === null || _k === void 0 ? void 0 : _k.remove('active');
|
|
1689
|
-
};
|
|
1690
|
-
var addTerminatePopupTemplate = function () {
|
|
1691
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1692
|
-
var terminatePopupTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_atom_dialogPopups__WEBPACK_IMPORTED_MODULE_15__.RenderTerminatePopup, {}, hostInstance);
|
|
1693
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, terminatePopupTemplate, {
|
|
1694
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.TERMINATE_POPUP_TEMPLATE,
|
|
1695
|
-
data: {}
|
|
1696
|
-
});
|
|
1697
|
-
(_a = hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.append(terminatePopupTemplate);
|
|
1698
|
-
(_c = (_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.TERMINATE_YES_BTN), 'click', function (e) {
|
|
1699
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, '', { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.TERMINATE_CLICK_EVENT, data: { activeTab: rootServiceInstance.activeTab } });
|
|
1700
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.TERMINATE_EVENT, { activeTab: rootServiceInstance.activeTab });
|
|
1701
|
-
}, terminatePopupTemplate);
|
|
1702
|
-
(_e = (_d = hostInstance.eventManager) === null || _d === void 0 ? void 0 : _d.addEventListener) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.TERMINATE_CANCEL_BTN), 'click', function (e) {
|
|
1703
|
-
var _a, _b, _c;
|
|
1704
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.TERMIANTE_POPUP)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1705
|
-
}, terminatePopupTemplate);
|
|
1706
|
-
(_g = (_f = hostInstance.eventManager) === null || _f === void 0 ? void 0 : _f.addEventListener) === null || _g === void 0 ? void 0 : _g.call(_f, "".concat(classConstants.TERMINATE_OVERRIDE_BTN), 'click', function (e) {
|
|
1707
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, '', { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.TERMINATE_CLICK_EVENT, data: { activeTab: rootServiceInstance.activeTab } });
|
|
1708
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.TERMINATE_OVERRIDE_EVENT, { activeTab: rootServiceInstance.activeTab });
|
|
1709
|
-
}, terminatePopupTemplate);
|
|
1710
|
-
(_j = (_h = hostInstance.eventManager) === null || _h === void 0 ? void 0 : _h.addEventListener) === null || _j === void 0 ? void 0 : _j.call(_h, "".concat(classConstants.TERMINATE_CLOSE_BTN), 'click', function (e) {
|
|
1711
|
-
var _a, _b, _c;
|
|
1712
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.TERMIANTE_POPUP)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1713
|
-
}, terminatePopupTemplate);
|
|
1714
|
-
};
|
|
1715
|
-
var addInterruptPopupTemplate = function () {
|
|
1716
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1717
|
-
var interruptPopupTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_atom_dialogPopups__WEBPACK_IMPORTED_MODULE_15__.RenderInterruptionPopup, {}, hostInstance);
|
|
1718
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, interruptPopupTemplate, {
|
|
1719
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.INTERRUPT_POPUP_TEMPLATE,
|
|
1720
|
-
data: {}
|
|
1721
|
-
});
|
|
1722
|
-
(_a = hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.append(interruptPopupTemplate);
|
|
1723
|
-
(_c = (_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.INTERRUPT_ACCEPT_BTN), 'click', function (e) {
|
|
1724
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, '', { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.INTERRUPT_CLICK_EVENT, data: { activeTab: rootServiceInstance.activeTab } });
|
|
1725
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.INTERRUPT_ACCEPT_EVENT, { activeTab: rootServiceInstance.activeTab });
|
|
1726
|
-
}, interruptPopupTemplate);
|
|
1727
|
-
(_e = (_d = hostInstance.eventManager) === null || _d === void 0 ? void 0 : _d.addEventListener) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.INTERRUPT_CANCE_BTN), 'click', function (e) {
|
|
1728
|
-
var _a, _b, _c;
|
|
1729
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.INTERRUPT_POPUP)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1730
|
-
}, interruptPopupTemplate);
|
|
1731
|
-
(_g = (_f = hostInstance.eventManager) === null || _f === void 0 ? void 0 : _f.addEventListener) === null || _g === void 0 ? void 0 : _g.call(_f, "".concat(classConstants.INTERRUPT_RUNLATER_BTN), 'click', function (e) {
|
|
1732
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.INTERRUPT_RUNLATER_EVENT, { activeTab: rootServiceInstance.activeTab });
|
|
1733
|
-
}, interruptPopupTemplate);
|
|
1734
|
-
(_j = (_h = hostInstance.eventManager) === null || _h === void 0 ? void 0 : _h.addEventListener) === null || _j === void 0 ? void 0 : _j.call(_h, "".concat(classConstants.INTERRUPT_CLOSE_BTN), 'click', function (e) {
|
|
1735
|
-
var _a, _b, _c;
|
|
1736
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.INTERRUPT_POPUP)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1737
|
-
}, interruptPopupTemplate);
|
|
1738
|
-
};
|
|
1739
|
-
var addSettingsTemplate = function () {
|
|
1740
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
1741
|
-
var settingsTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_atom_dialogPopups__WEBPACK_IMPORTED_MODULE_15__.RenderSettingsPopup, {}, hostInstance);
|
|
1742
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, settingsTemplate, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.SETTINGS_TEMPLATE, data: {} });
|
|
1743
|
-
(_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.append(settingsTemplate);
|
|
1744
|
-
(_c = (_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.SETTINGS_POPUP_CLOSE_BTN), 'click', function (e) {
|
|
1745
|
-
var _a, _b, _c;
|
|
1746
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SETTINGS_POPUP)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1747
|
-
}, settingsTemplate);
|
|
1748
|
-
(_e = (_d = hostInstance.eventManager) === null || _d === void 0 ? void 0 : _d.addEventListener) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.SETTINGS_POPUP_BACK_BTN), 'click', function (e) {
|
|
1749
|
-
toggleSettingsElements('add', 'both');
|
|
1750
|
-
}, settingsTemplate);
|
|
1751
|
-
(_g = (_f = hostInstance.eventManager) === null || _f === void 0 ? void 0 : _f.addEventListener) === null || _g === void 0 ? void 0 : _g.call(_f, "".concat(classConstants.SETTINGS_HELP_BTN), 'click', function (e) {
|
|
1752
|
-
toggleSettingsElements('remove', 'help');
|
|
1753
|
-
}, settingsTemplate);
|
|
1754
|
-
(_j = (_h = hostInstance.eventManager) === null || _h === void 0 ? void 0 : _h.addEventListener) === null || _j === void 0 ? void 0 : _j.call(_h, "".concat(classConstants.SETTINGS_HELP_SECTION), 'click', function (e) {
|
|
1755
|
-
toggleSettingsElements('remove', 'help');
|
|
1756
|
-
}, settingsTemplate);
|
|
1757
|
-
(_k = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _k === void 0 ? void 0 : _k.addEventListener("".concat(classConstants.SETTINGS_LANGUAGE_SECTION), 'click', function (event) {
|
|
1758
|
-
toggleSettingsLanguageElements('remove');
|
|
1759
|
-
}, settingsTemplate);
|
|
1760
|
-
(_o = (_m = (_l = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _l === void 0 ? void 0 : _l.querySelector("".concat(classConstants.SETTINGS_LANGUAGE_GROUP))) === null || _m === void 0 ? void 0 : _m.querySelectorAll("".concat(classConstants.SETTINGS_LANGUAGE_SELECT))) === null || _o === void 0 ? void 0 : _o.forEach(function (element) {
|
|
1761
|
-
element.addEventListener('change', function (event) {
|
|
1762
|
-
var _a, _b;
|
|
1763
|
-
event.stopPropagation();
|
|
1764
|
-
var inputElement = event.target;
|
|
1765
|
-
if (inputElement) {
|
|
1766
|
-
disableLanguageSettingsElements((_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(classConstants.SETTINGS_LANGUAGE_GROUP)));
|
|
1767
|
-
localStorageServiceInstance.setLanguageInfo(event.target.value);
|
|
1768
|
-
hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.removeEventListenersInDOM();
|
|
1769
|
-
hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.show(hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.config, (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.languagePluginService) === null || _b === void 0 ? void 0 : _b.config);
|
|
1770
|
-
}
|
|
1771
|
-
});
|
|
1772
|
-
});
|
|
1773
|
-
(_p = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _p === void 0 ? void 0 : _p.addEventListener("".concat(classConstants.SETTINGS_AUTO_SCROLL), 'click', function (event) {
|
|
1774
|
-
var _a;
|
|
1775
|
-
var inputElement;
|
|
1776
|
-
if (event.target.nodeName === 'INPUT') {
|
|
1777
|
-
inputElement = event === null || event === void 0 ? void 0 : event.target;
|
|
1778
|
-
inputElement.checked = !inputElement.checked;
|
|
1779
|
-
}
|
|
1780
|
-
else {
|
|
1781
|
-
inputElement = (_a = event === null || event === void 0 ? void 0 : event.currentTarget) === null || _a === void 0 ? void 0 : _a.querySelector('input[type="checkbox"]');
|
|
1782
|
-
}
|
|
1783
|
-
if (inputElement && !inputElement.disabled) {
|
|
1784
|
-
inputElement.checked = !inputElement.checked;
|
|
1785
|
-
rootServiceInstance.autoScrollStatus = inputElement.checked;
|
|
1786
|
-
hostInstance.localStorageService.setAutoScroll(inputElement.checked);
|
|
1787
|
-
hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.DATA_EVENTS.AUTO_SCROLL_CHANGE, inputElement.checked);
|
|
1788
|
-
}
|
|
1789
|
-
}, settingsTemplate);
|
|
1790
|
-
(_q = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _q === void 0 ? void 0 : _q.addEventListener("#".concat(idMapConstants.PROACTIVE_BTN), 'click', function (event) {
|
|
1791
|
-
var _a;
|
|
1792
|
-
var inputElement;
|
|
1793
|
-
if (event.target.nodeName === 'INPUT') {
|
|
1794
|
-
inputElement = event === null || event === void 0 ? void 0 : event.target;
|
|
1795
|
-
inputElement.checked = !inputElement.checked;
|
|
1796
|
-
}
|
|
1797
|
-
else {
|
|
1798
|
-
inputElement = (_a = event === null || event === void 0 ? void 0 : event.currentTarget) === null || _a === void 0 ? void 0 : _a.querySelector('input[type="checkbox"]');
|
|
1799
|
-
}
|
|
1800
|
-
if (inputElement && !inputElement.disabled) {
|
|
1801
|
-
// Toggle the checked state
|
|
1802
|
-
inputElement.checked = !inputElement.checked;
|
|
1803
|
-
// Trigger any logic that depends on the checked state
|
|
1804
|
-
rootServiceInstance.proactiveMode = inputElement.checked;
|
|
1805
|
-
hostInstance.localStorageService.setProactiveMode(inputElement.checked);
|
|
1806
|
-
hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.DATA_EVENTS.PRO_ACTIVE_CHANGE, inputElement.checked);
|
|
1807
|
-
hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.handleOverrideMode(!inputElement.checked);
|
|
1808
|
-
if (event.isTrusted) {
|
|
1809
|
-
hostInstance.socketConnection.dialogEntityExtraction = false;
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
}, settingsTemplate);
|
|
1813
|
-
(_r = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _r === void 0 ? void 0 : _r.addEventListener("".concat(classConstants.SETTINGS_FAQ_LINK), 'click', function (event) {
|
|
1814
|
-
openLink(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ProjConstants.FAQ_LINK, _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ProjConstants.SETTINGS_FAQ);
|
|
1815
|
-
}, settingsTemplate);
|
|
1816
|
-
(_s = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _s === void 0 ? void 0 : _s.addEventListener("".concat(classConstants.SETTINGS_DOCUMENTATION_LINK), 'click', function (event) {
|
|
1817
|
-
openLink(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ProjConstants.DOCUMENTATION_LINK, _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ProjConstants.SETTINGS_DOCUMENTATION);
|
|
1818
|
-
}, settingsTemplate);
|
|
1819
|
-
(_t = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _t === void 0 ? void 0 : _t.addEventListener("".concat(classConstants.SETTINGS_KORE_ACADEMY_LINK), 'click', function (event) {
|
|
1820
|
-
openLink(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ProjConstants.KOREACADEMY_LINK, _constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.ProjConstants.SETTINGS_KOREACADEMY);
|
|
1821
|
-
}, settingsTemplate);
|
|
1822
|
-
};
|
|
1823
|
-
function openLink(url, type) {
|
|
1824
|
-
var _a, _b;
|
|
1825
|
-
var openUrl = ((_b = (_a = rootServiceInstance.settingsData) === null || _a === void 0 ? void 0 : _a.showHelp[type]) === null || _b === void 0 ? void 0 : _b.resource) || url;
|
|
1826
|
-
rootServiceInstance.openurlInBrowser(openUrl);
|
|
1827
|
-
}
|
|
1828
|
-
function disableLanguageSettingsElements(element) {
|
|
1829
|
-
var _a;
|
|
1830
|
-
hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.renderIndividualLoader(element);
|
|
1831
|
-
var inputElementArr = (_a = element.querySelectorAll) === null || _a === void 0 ? void 0 : _a.call(element, "input");
|
|
1832
|
-
inputElementArr.forEach(function (inputElement) {
|
|
1833
|
-
inputElement.disabled = true;
|
|
1834
|
-
});
|
|
1835
|
-
}
|
|
1836
|
-
function toggleSettingsElements(action, type) {
|
|
1837
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
1838
|
-
var method = action === 'add' ? 'add' : 'remove';
|
|
1839
|
-
var settingsMethod = action === 'add' ? 'remove' : 'add';
|
|
1840
|
-
var settingsQuerySelector = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SETTINGS_POPUP));
|
|
1841
|
-
if (type === 'both') {
|
|
1842
|
-
(_e = (_d = (_c = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _c === void 0 ? void 0 : _c.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_HELP_GROUP))) === null || _d === void 0 ? void 0 : _d.classList) === null || _e === void 0 ? void 0 : _e[method](classConstants.HIDE_ELEMENT);
|
|
1843
|
-
(_h = (_g = (_f = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _f === void 0 ? void 0 : _f.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_LANGUAGE_GROUP))) === null || _g === void 0 ? void 0 : _g.classList) === null || _h === void 0 ? void 0 : _h[method](classConstants.HIDE_ELEMENT);
|
|
1844
|
-
}
|
|
1845
|
-
else {
|
|
1846
|
-
(_l = (_k = (_j = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _j === void 0 ? void 0 : _j.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_HELP_GROUP))) === null || _k === void 0 ? void 0 : _k.classList) === null || _l === void 0 ? void 0 : _l[method](classConstants.HIDE_ELEMENT);
|
|
1847
|
-
}
|
|
1848
|
-
(_p = (_o = (_m = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _m === void 0 ? void 0 : _m.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_NEXT_BTN))) === null || _o === void 0 ? void 0 : _o.classList) === null || _p === void 0 ? void 0 : _p[method](classConstants.HIDE_ELEMENT);
|
|
1849
|
-
(_s = (_r = (_q = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _q === void 0 ? void 0 : _q.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_MAIN_SECTION))) === null || _r === void 0 ? void 0 : _r.classList) === null || _s === void 0 ? void 0 : _s[settingsMethod](classConstants.HIDE_ELEMENT);
|
|
1850
|
-
(_v = (_u = (_t = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _t === void 0 ? void 0 : _t.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_POPUP_BACK_BTN))) === null || _u === void 0 ? void 0 : _u.classList) === null || _v === void 0 ? void 0 : _v[method](classConstants.HIDE_ELEMENT);
|
|
1851
|
-
if (action === 'remove') {
|
|
1852
|
-
hostInstance.chatEle.querySelector("".concat(classConstants.SETTINGS_POPUP)).querySelector("".concat(classConstants.SETTINGS_NEXT_BTN)).textContent = " / ".concat(languageData === null || languageData === void 0 ? void 0 : languageData.HELP);
|
|
1853
|
-
}
|
|
1854
|
-
}
|
|
1855
|
-
function toggleSettingsLanguageElements(action) {
|
|
1856
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1857
|
-
var settingsQuerySelector = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SETTINGS_POPUP));
|
|
1858
|
-
var method = action === 'add' ? 'add' : 'remove';
|
|
1859
|
-
var settingsMethod = action === 'add' ? 'remove' : 'add';
|
|
1860
|
-
(_e = (_d = (_c = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _c === void 0 ? void 0 : _c.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_LANGUAGE_GROUP))) === null || _d === void 0 ? void 0 : _d.classList) === null || _e === void 0 ? void 0 : _e[method](classConstants.HIDE_ELEMENT);
|
|
1861
|
-
(_h = (_g = (_f = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _f === void 0 ? void 0 : _f.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_NEXT_BTN))) === null || _g === void 0 ? void 0 : _g.classList) === null || _h === void 0 ? void 0 : _h[method](classConstants.HIDE_ELEMENT);
|
|
1862
|
-
(_l = (_k = (_j = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _j === void 0 ? void 0 : _j.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_MAIN_SECTION))) === null || _k === void 0 ? void 0 : _k.classList) === null || _l === void 0 ? void 0 : _l[settingsMethod](classConstants.HIDE_ELEMENT);
|
|
1863
|
-
(_p = (_o = (_m = settingsQuerySelector === null || settingsQuerySelector === void 0 ? void 0 : settingsQuerySelector.querySelector) === null || _m === void 0 ? void 0 : _m.call(settingsQuerySelector, "".concat(classConstants.SETTINGS_POPUP_BACK_BTN))) === null || _o === void 0 ? void 0 : _o.classList) === null || _p === void 0 ? void 0 : _p[method](classConstants.HIDE_ELEMENT);
|
|
1864
|
-
if (action === 'remove') {
|
|
1865
|
-
hostInstance.chatEle.querySelector("".concat(classConstants.SETTINGS_POPUP)).querySelector("".concat(classConstants.SETTINGS_NEXT_BTN)).textContent = " / ".concat(languageData === null || languageData === void 0 ? void 0 : languageData.LANGUAGE);
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
var addAttachmentViewTemplate = function () {
|
|
1869
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1870
|
-
var attachmentviewTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_atom_dialogPopups__WEBPACK_IMPORTED_MODULE_15__.RenderAttachmentImageView, {}, hostInstance);
|
|
1871
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, attachmentviewTemplate, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.ATTACHMENT_VIEW, data: {} });
|
|
1872
|
-
(_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.append(attachmentviewTemplate);
|
|
1873
|
-
var attachmentView = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector("".concat(classConstants.ENTITY_ATTACHMENT_VIEW_MODAL));
|
|
1874
|
-
(_d = (_c = hostInstance.eventManager) === null || _c === void 0 ? void 0 : _c.addEventListener) === null || _d === void 0 ? void 0 : _d.call(_c, "".concat(classConstants.ENTITY_ATTACHMENT_BACK_BTN), 'click', function (e) {
|
|
1875
|
-
var _a;
|
|
1876
|
-
(_a = attachmentView === null || attachmentView === void 0 ? void 0 : attachmentView.classList) === null || _a === void 0 ? void 0 : _a.add(classConstants.HIDE_ELEMENT);
|
|
1877
|
-
}, attachmentviewTemplate);
|
|
1878
|
-
(_f = (_e = hostInstance.eventManager) === null || _e === void 0 ? void 0 : _e.addEventListener) === null || _f === void 0 ? void 0 : _f.call(_e, "".concat(classConstants.ENTITY_ATTACHMENT_CLOSE_BTN), 'click', function (e) {
|
|
1879
|
-
var _a;
|
|
1880
|
-
(_a = attachmentView === null || attachmentView === void 0 ? void 0 : attachmentView.classList) === null || _a === void 0 ? void 0 : _a.add(classConstants.HIDE_ELEMENT);
|
|
1881
|
-
}, attachmentviewTemplate);
|
|
1882
|
-
};
|
|
1883
|
-
var addFeedbackToastrTemplate = function () {
|
|
1884
|
-
var _a, _b, _c;
|
|
1885
|
-
var feedbackToastTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(FeedbackToast, {}, hostInstance);
|
|
1886
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, feedbackToastTemplate, {
|
|
1887
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.FEEDBACK_TOAST_TEMPLATE,
|
|
1888
|
-
data: {}
|
|
1889
|
-
});
|
|
1890
|
-
(_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.append(feedbackToastTemplate);
|
|
1891
|
-
(_c = (_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.FEEDBACK_CLOSE_BTN), 'click', function (e) {
|
|
1892
|
-
hideFeedbackToastr();
|
|
1893
|
-
}, feedbackToastTemplate);
|
|
1894
|
-
};
|
|
1895
|
-
var hideFeedbackToastr = function () {
|
|
1896
|
-
var _a, _b, _c;
|
|
1897
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.FEEDBACK_TOASTR)).classList) === null || _c === void 0 ? void 0 : _c.add(classConstants.HIDE_ELEMENT);
|
|
1898
|
-
};
|
|
1899
|
-
var showFeedbackToastr = function () {
|
|
1900
|
-
var _a, _b, _c;
|
|
1901
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.FEEDBACK_TOASTR)).classList) === null || _c === void 0 ? void 0 : _c.remove(classConstants.HIDE_ELEMENT);
|
|
1902
|
-
};
|
|
1903
|
-
var handleFeedbackResponse = function (response) {
|
|
1904
|
-
var _a;
|
|
1905
|
-
if (response && ((_a = Object.keys(response)) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
1906
|
-
if ((response === null || response === void 0 ? void 0 : response.feedback) === 'like' || ((response === null || response === void 0 ? void 0 : response.feedback) === 'dislike' && ((rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.isUpdateFeedBackDetailsFlag) || (response === null || response === void 0 ? void 0 : response.interactionType) === 'widget'))) {
|
|
1907
|
-
showFeedbackToastr();
|
|
1908
|
-
if (timeoutId.current !== undefined) {
|
|
1909
|
-
clearTimeout(timeoutId.current); // Clear existing timeout if any
|
|
1910
|
-
}
|
|
1911
|
-
timeoutId.current = window.setTimeout(function () {
|
|
1912
|
-
hideFeedbackToastr();
|
|
1913
|
-
}, 5000);
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
if (response.type === 'summary') {
|
|
1917
|
-
var positionId_1 = response.positionId;
|
|
1918
|
-
var feedbackSummaryData = rootServiceInstance.generatedSummaries.find(function (item) { return item.positionId === positionId_1; });
|
|
1919
|
-
if (feedbackSummaryData) {
|
|
1920
|
-
feedbackSummaryData.summaryFeedbackData = response;
|
|
1921
|
-
}
|
|
1922
|
-
}
|
|
1923
|
-
};
|
|
1924
|
-
var toggleActiveTab = function (activeTab, footerTag) {
|
|
1925
|
-
var _a;
|
|
1926
|
-
var isEnabled = (_a = tabsNTitles.find(function (tab) { return tab.type === activeTab; })) === null || _a === void 0 ? void 0 : _a.isEnabled;
|
|
1927
|
-
if (isEnabled) {
|
|
1928
|
-
updateTabActive(activeTab);
|
|
1929
|
-
tabsNTitles.forEach(function (tab) {
|
|
1930
|
-
var _a, _b;
|
|
1931
|
-
var footerTabEle = footerTag.querySelector("".concat(classConstants.FOOTER_BTN).concat(tab.type));
|
|
1932
|
-
if (footerTabEle && tab.type === activeTab) {
|
|
1933
|
-
(_a = footerTabEle === null || footerTabEle === void 0 ? void 0 : footerTabEle.classList) === null || _a === void 0 ? void 0 : _a.add.apply(_a, ["selected-tab", "sel-bg"]);
|
|
1934
|
-
}
|
|
1935
|
-
else if (footerTabEle) {
|
|
1936
|
-
(_b = footerTabEle === null || footerTabEle === void 0 ? void 0 : footerTabEle.classList) === null || _b === void 0 ? void 0 : _b.remove.apply(_b, ["selected-tab", "sel-bg"]);
|
|
1937
|
-
}
|
|
1938
|
-
});
|
|
1939
|
-
}
|
|
1940
|
-
};
|
|
1941
|
-
var updateTabActive = function (tab, removeOtherTabs) {
|
|
1942
|
-
if (removeOtherTabs === void 0) { removeOtherTabs = true; }
|
|
1943
|
-
if (tab) {
|
|
1944
|
-
rootServiceInstance.activeTab = tab;
|
|
1945
|
-
selectTab = tab;
|
|
1946
|
-
}
|
|
1947
|
-
else {
|
|
1948
|
-
rootServiceInstance.activeTab = localStorageServiceInstance.getActiveTab();
|
|
1949
|
-
tab = rootServiceInstance.activeTab;
|
|
1950
|
-
selectTab = rootServiceInstance.activeTab;
|
|
1951
|
-
}
|
|
1952
|
-
if (removeOtherTabs) {
|
|
1953
|
-
setAssistTabActive(false);
|
|
1954
|
-
setMybotTabActive(false);
|
|
1955
|
-
setSearchTabActive(false);
|
|
1956
|
-
setTranscriptTabActive(false);
|
|
1957
|
-
setplaybookTabActive(false);
|
|
1958
|
-
setCustomTabActive(false);
|
|
1959
|
-
}
|
|
1960
|
-
switch (tab) {
|
|
1961
|
-
case 'ast':
|
|
1962
|
-
setAssistTabActive(true);
|
|
1963
|
-
break;
|
|
1964
|
-
case 'srch':
|
|
1965
|
-
setSearchTabActive(true);
|
|
1966
|
-
break;
|
|
1967
|
-
case 'mB':
|
|
1968
|
-
setMybotTabActive(true);
|
|
1969
|
-
break;
|
|
1970
|
-
case 'trnspt':
|
|
1971
|
-
setTranscriptTabActive(true);
|
|
1972
|
-
break;
|
|
1973
|
-
case 'cl':
|
|
1974
|
-
setplaybookTabActive(true);
|
|
1975
|
-
break;
|
|
1976
|
-
case 'cst':
|
|
1977
|
-
setCustomTabActive(true);
|
|
1978
|
-
break;
|
|
1979
|
-
default:
|
|
1980
|
-
setAssistTabActive(true);
|
|
1981
|
-
break;
|
|
1982
|
-
}
|
|
1983
|
-
if (tab) {
|
|
1984
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, '', { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.TAB_CHANGE_EVENT, data: { activeTab: tab } });
|
|
1985
|
-
localStorageServiceInstance.setActiveTab(_constants_projConsts__WEBPACK_IMPORTED_MODULE_3__.serviceTabMap[tab]);
|
|
1986
|
-
}
|
|
1987
|
-
};
|
|
1988
|
-
var handlePauseResumeTranscript = function (transcriptionStatus) {
|
|
1989
|
-
var payload = {
|
|
1990
|
-
conversationId: hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.rootService.connectionDetails.conversationId,
|
|
1991
|
-
botId: hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.rootService.connectionDetails.botId,
|
|
1992
|
-
transcriptionStatus: transcriptionStatus,
|
|
1993
|
-
experience: hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.rootService.connectionDetails.channel
|
|
1994
|
-
};
|
|
1995
|
-
hostInstance.socketConnection.emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS.desktop_activity_request, payload);
|
|
1996
|
-
};
|
|
1997
|
-
// intermittent summary changes start
|
|
1998
|
-
var updateFeedbackForEachPrevSummary = function () {
|
|
1999
|
-
setTimeout(function () {
|
|
2000
|
-
var _a;
|
|
2001
|
-
(_a = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.generatedSummaries) === null || _a === void 0 ? void 0 : _a.map(function (item, index) {
|
|
2002
|
-
var _a;
|
|
2003
|
-
if ((item === null || item === void 0 ? void 0 : item.type) != 'final') {
|
|
2004
|
-
var prevSummaryFeedbackWrapper = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(classConstants.PREV_SUMMARY_FEEDBACK_WRAPPER).concat(index));
|
|
2005
|
-
if (prevSummaryFeedbackWrapper) {
|
|
2006
|
-
removeFeedbackSummary(prevSummaryFeedbackWrapper);
|
|
2007
|
-
updateSummaryFeedback(prevSummaryFeedbackWrapper, item === null || item === void 0 ? void 0 : item.positionId, item === null || item === void 0 ? void 0 : item.summaryId, item === null || item === void 0 ? void 0 : item.traceId, item === null || item === void 0 ? void 0 : item.exeStartTime);
|
|
2008
|
-
}
|
|
2009
|
-
}
|
|
2010
|
-
});
|
|
2011
|
-
});
|
|
2012
|
-
};
|
|
2013
|
-
var handleSummaryPopup = function (respData) {
|
|
2014
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2015
|
-
var summaryPopupModal = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector('#aa-conv-summary');
|
|
2016
|
-
var summaryWrapper = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector("#".concat(idMapConstants.SUMMARY_WRAPPER));
|
|
2017
|
-
var summaryClassList = summaryWrapper === null || summaryWrapper === void 0 ? void 0 : summaryWrapper.classList;
|
|
2018
|
-
// addToPrevioisAndClearSummary(respData);
|
|
2019
|
-
var isSummaryEnabled = (_d = (_c = rootServiceInstance.aaSettings) === null || _c === void 0 ? void 0 : _c.summarization['localeData'][rootServiceInstance.connectionDetails.interactiveLanguage || 'en']) === null || _d === void 0 ? void 0 : _d.isEnabled;
|
|
2020
|
-
if (!isSummaryEnabled) {
|
|
2021
|
-
localStorageServiceInstance.deleteLocalStorageState(rootServiceInstance.connectionDetails.conversationId);
|
|
2022
|
-
return;
|
|
2023
|
-
}
|
|
2024
|
-
var summaryOverlayEle = document.getElementsByClassName(idMapConstants.SUMMARY_OVERLAY_BLOCK)[0];
|
|
2025
|
-
if (isSummaryEnabled && (respData.initPopup || respData.openOnResponse || respData.openToShowPreviousSummary) && !summaryPopupModal) {
|
|
2026
|
-
var summaryObj = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(SummaryPopupHTMLEle, respData, hostInstance);
|
|
2027
|
-
summaryOverlayEle === null || summaryOverlayEle === void 0 ? void 0 : summaryOverlayEle.append(summaryObj);
|
|
2028
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, summaryObj, {
|
|
2029
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.SUMMARY_POPUP_TEMPLATE,
|
|
2030
|
-
data: respData
|
|
2031
|
-
});
|
|
2032
|
-
(_e = hostInstance.eventManager) === null || _e === void 0 ? void 0 : _e.addEventListener('.aa-delete-summary-text', 'click', function () {
|
|
2033
|
-
deleteSummaryText();
|
|
2034
|
-
disableOrEnableSummaryCloseButton(true);
|
|
2035
|
-
disableOrEnableSummarySubmitButton(true);
|
|
2036
|
-
disableOrEnableSummaryCopyButton(true);
|
|
2037
|
-
removeOrAddDeleteSummaryButton(true);
|
|
2038
|
-
}, summaryObj);
|
|
2039
|
-
(_f = hostInstance.eventManager) === null || _f === void 0 ? void 0 : _f.addEventListener('.aa-summit-summary-text', 'click', function () {
|
|
2040
|
-
submitSummaryResolution();
|
|
2041
|
-
}, summaryObj);
|
|
2042
|
-
(_g = hostInstance.eventManager) === null || _g === void 0 ? void 0 : _g.addEventListener('.aa-copy-summary-text', 'click', function (event) {
|
|
2043
|
-
event.target.textContent = 'Copied';
|
|
2044
|
-
setTimeout(function () {
|
|
2045
|
-
event.target.textContent = 'Copy';
|
|
2046
|
-
}, 3000);
|
|
2047
|
-
copySummaryResolution();
|
|
2048
|
-
}, summaryObj);
|
|
2049
|
-
(_h = hostInstance.eventManager) === null || _h === void 0 ? void 0 : _h.addEventListener("".concat(classConstants.SUMMARY_REFRESH_BTN), 'click', function () {
|
|
2050
|
-
regenerateSummary();
|
|
2051
|
-
}, summaryObj);
|
|
2052
|
-
(_j = hostInstance.eventManager) === null || _j === void 0 ? void 0 : _j.addEventListener("".concat(classConstants.SUMMARY_CLOSE_BTN), 'click', function () {
|
|
2053
|
-
submitSummaryResolution();
|
|
2054
|
-
}, summaryObj);
|
|
2055
|
-
(_k = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.eventManager) === null || _k === void 0 ? void 0 : _k.addEventListener('.aa-summary-text-input', 'input', function (event) {
|
|
2056
|
-
if (event.target.value) {
|
|
2057
|
-
removeOrAddDeleteSummaryButton(false);
|
|
2058
|
-
disableOrEnableSummarySubmitButton(false);
|
|
2059
|
-
disableOrEnableSummaryCopyButton(false);
|
|
2060
|
-
disableOrEnableSummaryCloseButton(false);
|
|
2061
|
-
}
|
|
2062
|
-
else {
|
|
2063
|
-
removeOrAddDeleteSummaryButton(true);
|
|
2064
|
-
disableOrEnableSummarySubmitButton(true);
|
|
2065
|
-
disableOrEnableSummaryCopyButton(true);
|
|
2066
|
-
disableOrEnableSummaryCloseButton(true);
|
|
2067
|
-
}
|
|
2068
|
-
}, summaryOverlayEle);
|
|
2069
|
-
(_l = hostInstance.eventManager) === null || _l === void 0 ? void 0 : _l.addEventListener("".concat(classConstants.SUMMARY_PREVIOUS_BTN), 'click', function () {
|
|
2070
|
-
var summaryContentCollapse = summaryOverlayEle.querySelector("".concat(classConstants.SUMMARY_CONTENT_COLLAPSE));
|
|
2071
|
-
summaryContentCollapse === null || summaryContentCollapse === void 0 ? void 0 : summaryContentCollapse.classList.toggle('aa-hidden');
|
|
2072
|
-
}, summaryObj);
|
|
2073
|
-
(_m = hostInstance.eventManager) === null || _m === void 0 ? void 0 : _m.addEventListener("".concat(classConstants.SUMMARY_MINIMIZE_BTN), 'click', function () {
|
|
2074
|
-
dragIntermSumm();
|
|
2075
|
-
hideSummary();
|
|
2076
|
-
}, summaryObj);
|
|
2077
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, summaryObj, {
|
|
2078
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.CONVERSATION_SUMMARY_TEMPLATE,
|
|
2079
|
-
respData: respData
|
|
2080
|
-
});
|
|
2081
|
-
}
|
|
2082
|
-
else if (!respData.initPopup && respData.openToShowPreviousSummary) {
|
|
2083
|
-
showSummary();
|
|
2084
|
-
}
|
|
2085
|
-
else if (rootServiceInstance.finalSummaryGenerated && respData.openOnResponse) {
|
|
2086
|
-
showSummary();
|
|
2087
|
-
}
|
|
2088
|
-
if (rootServiceInstance.finalSummaryGenerated) {
|
|
2089
|
-
showOrHideSummaryTextArea(true);
|
|
2090
|
-
}
|
|
2091
|
-
else if (!respData.positionId && !respData.summaryId) {
|
|
2092
|
-
showOrHideSummaryTextArea(false);
|
|
2093
|
-
}
|
|
2094
|
-
addSummaryToList(respData);
|
|
2095
|
-
updateTextAreaSummary(__assign({}, respData));
|
|
2096
|
-
updateGeneratedSummariesCount();
|
|
2097
|
-
enableOrDisableButtons(respData, summaryOverlayEle);
|
|
2098
|
-
updateFeedbackForEachPrevSummary();
|
|
2099
|
-
};
|
|
2100
|
-
var enableOrDisableButtons = function (respData, summaryOverlayEle) {
|
|
2101
|
-
if (respData.initPopup) {
|
|
2102
|
-
disableOrEnableSummarySubmitButton(true);
|
|
2103
|
-
disableOrEnableSummaryCopyButton(true);
|
|
2104
|
-
disableOrEnableSummaryCloseButton(true);
|
|
2105
|
-
disableOrEnableSummaryRefreshButton(true);
|
|
2106
|
-
removeOrAddDeleteSummaryButton(true);
|
|
2107
|
-
addOrRemoveLoaderToSummary(true);
|
|
2108
|
-
}
|
|
2109
|
-
else {
|
|
2110
|
-
addOrRemoveLoaderToSummary(false);
|
|
2111
|
-
disableOrEnableSummaryCloseButton(false);
|
|
2112
|
-
var hideRefreshButton = rootServiceInstance.summaryInProgress || rootServiceInstance.maxIntSummaryCount <= rootServiceInstance.currentGenIntSummaryCount || rootServiceInstance.finalSummaryGenerated;
|
|
2113
|
-
disableOrEnableSummaryRefreshButton(hideRefreshButton);
|
|
2114
|
-
}
|
|
2115
|
-
var summaryTextArea = summaryOverlayEle === null || summaryOverlayEle === void 0 ? void 0 : summaryOverlayEle.querySelector('#summaryText');
|
|
2116
|
-
if (!(summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.value) || (summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.value) === 'undefined') {
|
|
2117
|
-
disableOrEnableSummarySubmitButton(true);
|
|
2118
|
-
disableOrEnableSummaryCopyButton(true);
|
|
2119
|
-
}
|
|
2120
|
-
else {
|
|
2121
|
-
disableOrEnableSummarySubmitButton(false);
|
|
2122
|
-
disableOrEnableSummaryCopyButton(false);
|
|
2123
|
-
removeOrAddDeleteSummaryButton(false);
|
|
2124
|
-
}
|
|
2125
|
-
if (rootServiceInstance.finalSummaryGenerated && respData.openToShowPreviousSummary) {
|
|
2126
|
-
disableOrEnableSummarySubmitButton(true);
|
|
2127
|
-
disableOrEnableSummaryCopyButton(true);
|
|
2128
|
-
removeOrAddDeleteSummaryButton(true);
|
|
2129
|
-
}
|
|
2130
|
-
};
|
|
2131
|
-
var disableOrEnableSummarySubmitButton = function (disable) {
|
|
2132
|
-
var _a;
|
|
2133
|
-
var summarySubmitButton = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(classConstants.SUMMARY_SUBMIT_BTN));
|
|
2134
|
-
if (summarySubmitButton) {
|
|
2135
|
-
if (disable) {
|
|
2136
|
-
summarySubmitButton.setAttribute('disabled', 'disabled');
|
|
2137
|
-
}
|
|
2138
|
-
else {
|
|
2139
|
-
summarySubmitButton.removeAttribute('disabled');
|
|
2140
|
-
}
|
|
2141
|
-
}
|
|
2142
|
-
};
|
|
2143
|
-
var disableOrEnableSummaryCopyButton = function (disable) {
|
|
2144
|
-
var _a;
|
|
2145
|
-
var summaryCopyButton = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(classConstants.SUMMARY_COPY_BTN));
|
|
2146
|
-
if (summaryCopyButton) {
|
|
2147
|
-
if (disable) {
|
|
2148
|
-
summaryCopyButton.setAttribute('disabled', 'disabled');
|
|
2149
|
-
}
|
|
2150
|
-
else {
|
|
2151
|
-
summaryCopyButton.removeAttribute('disabled');
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
};
|
|
2155
|
-
var disableOrEnableSummaryCloseButton = function (disable) {
|
|
2156
|
-
var _a;
|
|
2157
|
-
var summaryCloseButton = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(classConstants.SUMMARY_CLOSE_BTN));
|
|
2158
|
-
if (summaryCloseButton) {
|
|
2159
|
-
if (disable) {
|
|
2160
|
-
summaryCloseButton.setAttribute('disabled', 'disabled');
|
|
2161
|
-
}
|
|
2162
|
-
else {
|
|
2163
|
-
summaryCloseButton.removeAttribute('disabled');
|
|
2164
|
-
}
|
|
2165
|
-
}
|
|
2166
|
-
};
|
|
2167
|
-
var disableOrEnableSummaryRefreshButton = function (disable) {
|
|
2168
|
-
var _a;
|
|
2169
|
-
var summaryRefreshButton = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(classConstants.SUMMARY_REFRESH_BTN));
|
|
2170
|
-
var disabled = disable || rootServiceInstance.generatedSummaries.length > 1;
|
|
2171
|
-
if (summaryRefreshButton) {
|
|
2172
|
-
if (disabled) {
|
|
2173
|
-
summaryRefreshButton.setAttribute('disabled', 'disabled');
|
|
2174
|
-
}
|
|
2175
|
-
else {
|
|
2176
|
-
summaryRefreshButton.removeAttribute('disabled');
|
|
2177
|
-
}
|
|
2178
|
-
}
|
|
2179
|
-
};
|
|
2180
|
-
var removeOrAddDeleteSummaryButton = function (remove) {
|
|
2181
|
-
var _a;
|
|
2182
|
-
var summaryDeleteButton = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(classConstants.SUMMARY_DELETE_BTN));
|
|
2183
|
-
if (summaryDeleteButton) {
|
|
2184
|
-
summaryDeleteButton.classList.toggle('aa-hidden', remove);
|
|
2185
|
-
}
|
|
2186
|
-
};
|
|
2187
|
-
var updateTextAreaSummary = function (respData) {
|
|
2188
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2189
|
-
var summaryWrapper = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(idMapConstants.SUMMARY_WRAPPER));
|
|
2190
|
-
var summaryContentArea = (_c = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.SUMMARY_CONTENT_AREA));
|
|
2191
|
-
if ((rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.finalSummaryGenerated) && !(respData === null || respData === void 0 ? void 0 : respData.openToShowPreviousSummary)) {
|
|
2192
|
-
(_d = summaryContentArea === null || summaryContentArea === void 0 ? void 0 : summaryContentArea.classList) === null || _d === void 0 ? void 0 : _d.remove(classConstants.HIDE_ELEMENT);
|
|
2193
|
-
}
|
|
2194
|
-
var summaryTextArea = (_e = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _e === void 0 ? void 0 : _e.querySelector('#summaryText');
|
|
2195
|
-
// let finalSummaryText = rootServiceInstance?.generatedSummaries?.find((item : any) => item?.type === 'final')?.summary || respData?.summaryText || '';
|
|
2196
|
-
var finalSummaryObj = ((_f = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.generatedSummaries) === null || _f === void 0 ? void 0 : _f.find(function (item) { return (item === null || item === void 0 ? void 0 : item.type) === 'final'; })) || respData;
|
|
2197
|
-
if (summaryTextArea) {
|
|
2198
|
-
//add attributes to the text area
|
|
2199
|
-
summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.setAttribute('data-summaryId', (finalSummaryObj === null || finalSummaryObj === void 0 ? void 0 : finalSummaryObj.summaryId) || '');
|
|
2200
|
-
summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.setAttribute('data-positionId', (finalSummaryObj === null || finalSummaryObj === void 0 ? void 0 : finalSummaryObj.positionId) || '');
|
|
2201
|
-
summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.setAttribute('data-traceId', (respData === null || respData === void 0 ? void 0 : respData.traceId) || '');
|
|
2202
|
-
summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.setAttribute('data-exeStartTime', (respData === null || respData === void 0 ? void 0 : respData.exeStartTime) || '');
|
|
2203
|
-
summaryTextArea.value = finalSummaryObj.editedSummary || finalSummaryObj.summary;
|
|
2204
|
-
if (!respData.initPopup && !((_g = summaryContentArea === null || summaryContentArea === void 0 ? void 0 : summaryContentArea.classList) === null || _g === void 0 ? void 0 : _g.contains(classConstants.HIDE_ELEMENT))) {
|
|
2205
|
-
removeFeedbackSummary(summaryWrapper === null || summaryWrapper === void 0 ? void 0 : summaryWrapper.querySelector(".actions-footer"));
|
|
2206
|
-
addFeedbackToSummary();
|
|
2207
|
-
updateFeedbackForMainSummary();
|
|
2208
|
-
}
|
|
2209
|
-
else {
|
|
2210
|
-
removeFeedbackSummary(summaryWrapper === null || summaryWrapper === void 0 ? void 0 : summaryWrapper.querySelector(".actions-footer"));
|
|
2211
|
-
}
|
|
2212
|
-
}
|
|
2213
|
-
};
|
|
2214
|
-
var hideSummary = function () {
|
|
2215
|
-
var _a, _b;
|
|
2216
|
-
var summaryWrapper = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(idMapConstants.SUMMARY_WRAPPER));
|
|
2217
|
-
(_b = summaryWrapper === null || summaryWrapper === void 0 ? void 0 : summaryWrapper.classList) === null || _b === void 0 ? void 0 : _b.add('aa-hidden');
|
|
2218
|
-
};
|
|
2219
|
-
var handleSummaryResolutionComments = function (respData) {
|
|
2220
|
-
var summary = (respData === null || respData === void 0 ? void 0 : respData.isError) ?
|
|
2221
|
-
languageData === null || languageData === void 0 ? void 0 : languageData.SUMMARY_ERROR_TEXT
|
|
2222
|
-
: respData.summary[0];
|
|
2223
|
-
setEditedSummaryText(summary);
|
|
2224
|
-
hostInstance.socketConnection.emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS.response_resolution_comments_ack, respData, true);
|
|
2225
|
-
hostInstance.setSummaryPopup(__assign(__assign({}, respData), { summaryText: summary, openOnResponse: true }));
|
|
2226
|
-
};
|
|
2227
|
-
var updatePreviousSummary = function (props) {
|
|
2228
|
-
var _a, _b;
|
|
2229
|
-
var summaryText = (_a = props === null || props === void 0 ? void 0 : props.msgData) === null || _a === void 0 ? void 0 : _a.summaryText;
|
|
2230
|
-
var index = (_b = props === null || props === void 0 ? void 0 : props.msgData) === null || _b === void 0 ? void 0 : _b.summaryIndex;
|
|
2231
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content" },
|
|
2232
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content-inner-sec" },
|
|
2233
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content-inner-sec-item aa-text-xs" }, summaryText)),
|
|
2234
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content-item-date-time aa-prev-summary-".concat(index) })));
|
|
2235
|
-
};
|
|
2236
|
-
var FeedbackPopupHTMLEle = function (props) {
|
|
2237
|
-
var _a;
|
|
2238
|
-
var languageData = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata;
|
|
2239
|
-
var widgetFeedbackData = props === null || props === void 0 ? void 0 : props.hostInstance.rootService.widgetFeedbackData;
|
|
2240
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "aa-feedback-popup-overlay feedback-popup-overlay a-position-absolute a-flex a-justify-content-center a-align-items-center a-width-100 a-height-100" },
|
|
2241
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "feedback-popup-container a-radius-8 a-padding-sm a-flex a-flex-column a-gap-8" },
|
|
2242
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "feedback-popup-header a-flex a-align-items-center a-width-100" },
|
|
2243
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("span", { className: "feedback-popup-title aa-text-sm semibold w-100 text-truncate" }, languageData === null || languageData === void 0 ? void 0 : languageData.SUBMIT_OVERALL_FEEDBACK),
|
|
2244
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "feedback-popup-close-btn aa-feedback-popup-close-btn cursor-pointer", "aria-label": "Close feedback dialog" },
|
|
2245
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
2246
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M12 4L4 12M4 4L12 12", stroke: "#667085", "stroke-width": "1.2", "stroke-linecap": "round", "stroke-linejoin": "round" })))),
|
|
2247
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "feedback-popup-body aa-feedback-popup-body a-width-100 a-flex a-flex-column a-gap-4" },
|
|
2248
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "feedback-popup-body-content a-padding-sm a-radius-8 a-width-100 a-flex a-flex-column a-gap-4" },
|
|
2249
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("p", { className: "aa-text-xs medium" }, languageData === null || languageData === void 0 ? void 0 : languageData.FEEDBACK_QUESTION),
|
|
2250
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "feedback-satisfaction-options a-flex a-gap-8 a-width-100" },
|
|
2251
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "feedback-option-btn feedback-satisfied-btn aa-feedback-satisfied-btn a-flex a-align-items-center a-justify-content-center a-gap-4 a-radius-6 cursor-pointer aa-text-xs medium a-width-100 ".concat(widgetFeedbackData.type === 'positive' ? 'active' : '') },
|
|
2252
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "11", height: "11", viewBox: "0 0 11 11", fill: "none" },
|
|
2253
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M3 10.5V5M0.5 6V9.5C0.5 10.0523 0.947715 10.5 1.5 10.5H8.21312C8.95348 10.5 9.5831 9.95983 9.69568 9.22809L10.2341 5.72809C10.3739 4.81945 9.67091 4 8.75158 4H7C6.72386 4 6.5 3.77614 6.5 3.5V1.73292C6.5 1.052 5.948 0.5 5.26708 0.5C5.10467 0.5 4.95749 0.595648 4.89153 0.744061L3.13197 4.70307C3.05172 4.88363 2.87266 5 2.67506 5H1.5C0.947715 5 0.5 5.44772 0.5 6Z", stroke: "#079455", "stroke-linecap": "round", "stroke-linejoin": "round" })), languageData === null || languageData === void 0 ? void 0 :
|
|
2254
|
-
languageData.FEEDBACK_SATISFIED),
|
|
2255
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "feedback-option-btn feedback-unsatisfied-btn aa-feedback-unsatisfied-btn a-flex a-align-items-center a-justify-content-center a-gap-4 a-radius-6 cursor-pointer aa-text-xs medium a-width-100 ".concat(widgetFeedbackData.type === 'negative' ? 'active' : '') },
|
|
2256
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" },
|
|
2257
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M8.49954 1V6.5M10.9995 4.9V2.6C10.9995 2.03995 10.9995 1.75992 10.8905 1.54601C10.7947 1.35785 10.6417 1.20487 10.4535 1.10899C10.2396 1 9.95959 1 9.39954 1H4.05854C3.3278 1 2.96243 1 2.66733 1.13372C2.40724 1.25157 2.18619 1.44121 2.03016 1.68036C1.85312 1.9517 1.79757 2.31282 1.68645 3.03506L1.42491 4.73506C1.27836 5.68766 1.20508 6.16395 1.34644 6.53456C1.47051 6.85985 1.70386 7.13185 2.0065 7.30393C2.3513 7.5 2.8332 7.5 3.79701 7.5H4.19954C4.47956 7.5 4.61958 7.5 4.72653 7.5545C4.82061 7.60243 4.8971 7.67892 4.94504 7.773C4.99954 7.87996 4.99954 8.01997 4.99954 8.3V9.76708C4.99954 10.448 5.55154 11 6.23246 11C6.39487 11 6.54205 10.9044 6.60801 10.7559L8.28839 6.97509C8.36482 6.80312 8.40303 6.71714 8.46344 6.65409C8.51683 6.59836 8.5824 6.55575 8.65501 6.52959C8.73716 6.5 8.83125 6.5 9.01944 6.5H9.39954C9.95959 6.5 10.2396 6.5 10.4535 6.39101C10.6417 6.29513 10.7947 6.14215 10.8905 5.95399C10.9995 5.74008 10.9995 5.46005 10.9995 4.9Z", stroke: "#B42318", "stroke-linecap": "round", "stroke-linejoin": "round" })), languageData === null || languageData === void 0 ? void 0 :
|
|
2258
|
-
languageData.FEEDBACK_UNSATISFIED)))),
|
|
2259
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "feedback-popup-footer a-flex a-justify-content-end a-padding-md-top" },
|
|
2260
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "aa_btn primaryBtn aa-widget-feedback-submit-btn", disabled: true }, languageData === null || languageData === void 0 ? void 0 : languageData.SUBMIT)))));
|
|
2261
|
-
};
|
|
2262
|
-
var SummaryPopupHTMLEle = function (props) {
|
|
2263
|
-
var _a, _b, _c, _d, _e, _f;
|
|
2264
|
-
var msgData = props.msgData;
|
|
2265
|
-
var rootServiceInstance = hostInstance.rootService;
|
|
2266
|
-
var initPopup = (msgData === null || msgData === void 0 ? void 0 : msgData.initPopup) || false;
|
|
2267
|
-
var submitEnabled = (_c = (_a = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.aaSettings) === null || _a === void 0 ? void 0 : _a.summarization['localeData'][((_b = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.connectionDetails) === null || _b === void 0 ? void 0 : _b.interactiveLanguage) || 'en']) === null || _c === void 0 ? void 0 : _c.canSubmit;
|
|
2268
|
-
var hideRegenerateButton = function () {
|
|
2269
|
-
return !rootServiceInstance.summaryInProgress && rootServiceInstance.currentGenIntSummaryCount < rootServiceInstance.maxIntSummaryCount && !rootServiceInstance.finalSummaryGenerated;
|
|
2270
|
-
};
|
|
2271
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-wrapper-container a-padding-xl", id: "aa-summary-wrapper-container" },
|
|
2272
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-popup-data", id: "aa-conv-summary" },
|
|
2273
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "title-block" },
|
|
2274
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "19", height: "14", viewBox: "0 0 19 14", fill: "none" },
|
|
2275
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M9.99979 5.81524V8.01866C9.56245 8.60838 8.98161 8.80996 8.40024 8.80996C7.3657 8.80996 6.64453 7.93073 6.64453 6.92499C6.64453 5.90316 7.3657 5.00732 8.40024 5.00732C8.98161 5.00732 9.56245 5.21212 9.99979 5.81524Z", fill: "#111827" }),
|
|
2276
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M16.4016 0.310059H4.49325C4.21767 0.309988 3.94477 0.36504 3.69014 0.47207C3.43552 0.579099 3.20415 0.73601 3.00926 0.93384C2.81437 1.13167 2.65978 1.36654 2.5543 1.62505C2.44882 1.88355 2.39453 2.16062 2.39453 2.44043V9.25632C3.97002 9.26274 5.2009 10.4831 5.2009 12.0474C5.20345 12.5621 5.06557 13.0674 4.80255 13.5074H16.4016C16.9579 13.507 17.4914 13.2824 17.8848 12.883C18.2782 12.4836 18.4994 11.9419 18.4998 11.3771V2.44257C18.5001 2.1626 18.4461 1.88532 18.3408 1.62657C18.2355 1.36782 18.081 1.13269 17.8861 0.934628C17.6913 0.736565 17.4598 0.579454 17.2051 0.472284C16.9504 0.365115 16.6773 0.309988 16.4016 0.310059ZM12.2015 10.4932H10.234V9.94594C9.71132 10.2921 9.0748 10.4932 8.3113 10.4932C6.44232 10.4932 4.92796 8.91285 4.92796 6.91516C4.92796 4.88858 6.44232 3.32104 8.3113 3.32104C9.07322 3.32104 9.71132 3.5222 10.234 3.86834V3.32104H12.2015V10.4932ZM15.9679 10.4932H14.0004V3.32104H15.9706L15.9679 10.4932Z", fill: "#111827" }),
|
|
2277
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M2.16101 10.5996C1.30956 10.5996 0.605469 11.2231 0.605469 12.0442C0.605469 12.884 1.30956 13.5075 2.16101 13.5075C3.03295 13.5075 3.73705 12.884 3.73705 12.0442C3.73705 11.2226 3.03295 10.5996 2.16101 10.5996Z", fill: "#111827" })),
|
|
2278
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("h1", null, languageData === null || languageData === void 0 ? void 0 : languageData.SUMMARY_TEXT),
|
|
2279
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "ai-block" },
|
|
2280
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { type: "button", className: "close-summery aa-minimize-summary" },
|
|
2281
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "17", viewBox: "0 0 16 17", fill: "none" },
|
|
2282
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M2 5.83333H2.13333C3.25344 5.83333 3.81349 5.83333 4.24131 5.61535C4.61764 5.4236 4.9236 5.11764 5.11535 4.74131C5.33333 4.31349 5.33333 3.75344 5.33333 2.63333V2.5M2 11.1667H2.13333C3.25344 11.1667 3.81349 11.1667 4.24131 11.3847C4.61764 11.5764 4.9236 11.8824 5.11535 12.2587C5.33333 12.6865 5.33333 13.2466 5.33333 14.3667V14.5M10.6667 2.5V2.63333C10.6667 3.75344 10.6667 4.31349 10.8847 4.74131C11.0764 5.11764 11.3824 5.4236 11.7587 5.61535C12.1865 5.83333 12.7466 5.83333 13.8667 5.83333H14M10.6667 14.5V14.3667C10.6667 13.2466 10.6667 12.6865 10.8847 12.2587C11.0764 11.8824 11.3824 11.5764 11.7587 11.3847C12.1865 11.1667 12.7466 11.1667 13.8667 11.1667H14", stroke: "#667085", "stroke-width": "1.2", "stroke-linecap": "round", "stroke-linejoin": "round" }))),
|
|
2283
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { type: "button", className: "close-summery aa-close-summary-text" },
|
|
2284
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none" },
|
|
2285
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M15 5.2002L5 15.2002M5 5.2002L15 15.2002", stroke: "#667085", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" }))))),
|
|
2286
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summary-intent-block-data-accordion a-padding-smm" },
|
|
2287
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summary-intent-block-data-accordion-item aa-summary-accordion-interim ".concat(((_d = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.generatedSummaries) === null || _d === void 0 ? void 0 : _d.length) > 0 ? '' : 'aa-hidden') },
|
|
2288
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { type: "button", className: "acc-summary-btn a-flex a-align-items-center a-gap-4 aa-previous-summary-btn", "aria-expanded": "false", "aria-controls": "collapseExample" },
|
|
2289
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "text-truncate aa-text-xs medium" }, languageData === null || languageData === void 0 ? void 0 : languageData.PREV_SUMMARIES),
|
|
2290
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("span", { className: "aa-summary-count" }, (_e = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.generatedSummaries) === null || _e === void 0 ? void 0 : _e.length),
|
|
2291
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-icon" },
|
|
2292
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
2293
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M4 6L8 10L12 6", stroke: "#344054", "stroke-width": "1.2", "stroke-linecap": "round", "stroke-linejoin": "round" })))),
|
|
2294
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "acc-summary-content-collapse aa-summary-content-collapse aa-hidden" }, (_f = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.generatedSummaries) === null || _f === void 0 ? void 0 : _f.map(function (item, index) { return ((item === null || item === void 0 ? void 0 : item.type) != 'final' && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content" },
|
|
2295
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content-inner-sec" },
|
|
2296
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content-inner-sec-item aa-text-xs", "data-positionId": item.positionId, "data-type": item.type }, item.editedSummary ? item.editedSummary : item.summary)),
|
|
2297
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summery-accordion-content-item-date-time aa-summary-content-feedback-wrapper aa-prev-summary-".concat(index) })))); }))),
|
|
2298
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "summary-intent-block-data-accordion-item new-summary-intent aa-summary-content-area" },
|
|
2299
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "acc-summary-content-collapse" },
|
|
2300
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "text-block-summary aa-summary-text-input-wrapper" },
|
|
2301
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("textarea", { className: "input-control aa-summary-text-input aa-summary-text-input-new", id: "summaryText", placeholder: 'Type Summary...', rows: 4, cols: 50, value: "" }),
|
|
2302
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "recylin-bin-btn aa-delete-summary-text" },
|
|
2303
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
|
|
2304
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M13.3333 4.99996V4.33329C13.3333 3.39987 13.3333 2.93316 13.1517 2.57664C12.9919 2.26304 12.7369 2.00807 12.4233 1.84828C12.0668 1.66663 11.6001 1.66663 10.6667 1.66663H9.33333C8.39991 1.66663 7.9332 1.66663 7.57668 1.84828C7.26308 2.00807 7.00811 2.26304 6.84832 2.57664C6.66667 2.93316 6.66667 3.39987 6.66667 4.33329V4.99996M8.33333 9.58329V13.75M11.6667 9.58329V13.75M2.5 4.99996H17.5M15.8333 4.99996V14.3333C15.8333 15.7334 15.8333 16.4335 15.5608 16.9683C15.3212 17.4387 14.9387 17.8211 14.4683 18.0608C13.9335 18.3333 13.2335 18.3333 11.8333 18.3333H8.16667C6.76654 18.3333 6.06647 18.3333 5.53169 18.0608C5.06129 17.8211 4.67883 17.4387 4.43915 16.9683C4.16667 16.4335 4.16667 15.7334 4.16667 14.3333V4.99996", stroke: "#D92D20", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))),
|
|
2305
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "actions-footer" },
|
|
2306
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "footer-btns-left-sec" },
|
|
2307
|
-
submitEnabled && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "aa_btn primaryBtn aa-summit-summary-text aa-summary-submit-btn", disabled: initPopup, id: "summarySubmit" }, languageData === null || languageData === void 0 ? void 0 : languageData.SUBMIT)),
|
|
2308
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "aa_btn aa-solidbtn aa-copy-summary-text aa-summary-copy-btn", disabled: initPopup, id: "summaryCopy" }, languageData === null || languageData === void 0 ? void 0 : languageData.COPY),
|
|
2309
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("button", { className: "aa_btn aa-solidbtn refresh-btn aa-summary-refresh-btn", disabled: !hideRegenerateButton() },
|
|
2310
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" },
|
|
2311
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M7.12246 16.4733C9.12174 17.3603 11.503 17.3121 13.5421 16.1348C16.93 14.1788 18.0908 9.84667 16.1348 6.45876L15.9265 6.09792M3.86571 13.5422C1.9097 10.1543 3.07048 5.82219 6.45839 3.86618C8.49754 2.68888 10.8788 2.64071 12.878 3.52768M2.07812 13.6119L4.35483 14.2219L4.96488 11.9452M15.0358 8.05528L15.6459 5.77857L17.9226 6.38861", stroke: "#344054", "stroke-width": "1.33", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
|
|
2312
|
-
};
|
|
2313
|
-
var submitSummaryResolution = function () {
|
|
2314
|
-
var _a, _b, _c;
|
|
2315
|
-
var editedSummaryText = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SUMMARY_EDITED_TEXT));
|
|
2316
|
-
var summaryTextValue = (editedSummaryText === null || editedSummaryText === void 0 ? void 0 : editedSummaryText.value) || "";
|
|
2317
|
-
var summaryId = (editedSummaryText === null || editedSummaryText === void 0 ? void 0 : editedSummaryText.getAttribute('data-summaryId')) || "";
|
|
2318
|
-
var positionId = (editedSummaryText === null || editedSummaryText === void 0 ? void 0 : editedSummaryText.getAttribute('data-positionId')) || "";
|
|
2319
|
-
var traceId = (editedSummaryText === null || editedSummaryText === void 0 ? void 0 : editedSummaryText.getAttribute('data-traceId')) || "";
|
|
2320
|
-
var connectionDetails = hostInstance.rootService.connectionDetails;
|
|
2321
|
-
if (positionId && summaryId) {
|
|
2322
|
-
var submitSummaryRequestParams = {
|
|
2323
|
-
conversationId: connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails.conversationId,
|
|
2324
|
-
botId: connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails.botId,
|
|
2325
|
-
experience: connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails.experience,
|
|
2326
|
-
isExtAD: true,
|
|
2327
|
-
language: connectionDetails === null || connectionDetails === void 0 ? void 0 : connectionDetails.interactiveLanguage,
|
|
2328
|
-
positionId: positionId || '',
|
|
2329
|
-
summary: [
|
|
2330
|
-
{
|
|
2331
|
-
'summary_text': summaryTextValue || '',
|
|
2332
|
-
'summaryId': summaryId || ''
|
|
2333
|
-
}
|
|
2334
|
-
],
|
|
2335
|
-
traceId: traceId
|
|
2336
|
-
};
|
|
2337
|
-
var generatedSummaryObj = (_c = rootServiceInstance.generatedSummaries) === null || _c === void 0 ? void 0 : _c.find(function (item) { return item.summaryId === summaryId; });
|
|
2338
|
-
if (generatedSummaryObj) {
|
|
2339
|
-
generatedSummaryObj.editedSummary = summaryTextValue;
|
|
2340
|
-
}
|
|
2341
|
-
hostInstance.socketConnection.emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS.submit_summary_request, submitSummaryRequestParams);
|
|
2342
|
-
}
|
|
2343
|
-
closeSummaryPopup(editedSummaryText);
|
|
2344
|
-
};
|
|
2345
|
-
var copySummaryResolution = function () {
|
|
2346
|
-
var _a;
|
|
2347
|
-
var summaryTextValue = ((_a = document.getElementById("summaryText")) === null || _a === void 0 ? void 0 : _a.value) || "";
|
|
2348
|
-
navigator.clipboard.writeText(summaryTextValue).then(function () {
|
|
2349
|
-
}).catch(function (err) {
|
|
2350
|
-
});
|
|
2351
|
-
};
|
|
2352
|
-
var closeSummaryPopup = function (editedSummaryText) {
|
|
2353
|
-
var _a;
|
|
2354
|
-
var finalSummary = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.finalSummaryGenerated;
|
|
2355
|
-
var summaryType = finalSummary ? 'final' : 'interim';
|
|
2356
|
-
// rootServiceInstance.isSummaryMinimized = false;
|
|
2357
|
-
var summaryTextValue = ((_a = document.getElementById("summaryText")) === null || _a === void 0 ? void 0 : _a.value) || "";
|
|
2358
|
-
if (summaryTextValue && (summaryType == 'final' || finalSummary)) {
|
|
2359
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.INTERNAL_EVENTS.CONVERSATION_SUMMARY_IN_ASSIST, summaryTextValue);
|
|
2360
|
-
}
|
|
2361
|
-
hideSummary();
|
|
2362
|
-
if (!rootServiceInstance.finalSummaryGenerated) {
|
|
2363
|
-
addToPreviouSummary(editedSummaryText, summaryType);
|
|
2364
|
-
showOrHideSummaryTextArea(false);
|
|
2365
|
-
}
|
|
2366
|
-
else {
|
|
2367
|
-
showOrHideSummaryTextArea(true);
|
|
2368
|
-
}
|
|
2369
|
-
};
|
|
2370
|
-
var addToPreviouSummary = function (editedSummaryText, type) {
|
|
2371
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2372
|
-
var positionId = editedSummaryText.getAttribute('data-positionId');
|
|
2373
|
-
if (positionId && type == 'interim' && ((_a = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.generatedSummaries) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
2374
|
-
var summaryContentCollapse = (_c = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.SUMMARY_CONTENT_COLLAPSE));
|
|
2375
|
-
var summaryAccordionInterim = (_e = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelector) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.SUMMARY_ACCORDION_INTERIM));
|
|
2376
|
-
var summaryContentArea = (_g = (_f = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _f === void 0 ? void 0 : _f.querySelector) === null || _g === void 0 ? void 0 : _g.call(_f, "".concat(classConstants.SUMMARY_CONTENT_AREA));
|
|
2377
|
-
updateGeneratedSummariesCount();
|
|
2378
|
-
if (summaryContentCollapse && summaryAccordionInterim) {
|
|
2379
|
-
var interimSummaries = (_h = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.generatedSummaries) === null || _h === void 0 ? void 0 : _h.filter(function (summary) { return summary.type === 'interim'; });
|
|
2380
|
-
var index = (interimSummaries === null || interimSummaries === void 0 ? void 0 : interimSummaries.length) - 1;
|
|
2381
|
-
summaryAccordionInterim.classList.remove(classConstants.HIDE_ELEMENT);
|
|
2382
|
-
var summaryContent = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(updatePreviousSummary, { summaryText: editedSummaryText.value, summaryIndex: index }, hostInstance);
|
|
2383
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, summaryContent, {
|
|
2384
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.SUMMARY_PREVIOUS_TEMPLATE,
|
|
2385
|
-
data: { summaryText: editedSummaryText.value, summaryIndex: index }
|
|
2386
|
-
});
|
|
2387
|
-
summaryContentCollapse === null || summaryContentCollapse === void 0 ? void 0 : summaryContentCollapse.append(summaryContent);
|
|
2388
|
-
}
|
|
2389
|
-
if (editedSummaryText) {
|
|
2390
|
-
editedSummaryText.value = '';
|
|
2391
|
-
}
|
|
2392
|
-
(_j = summaryContentArea === null || summaryContentArea === void 0 ? void 0 : summaryContentArea.classList) === null || _j === void 0 ? void 0 : _j.remove(classConstants.HIDE_ELEMENT);
|
|
2393
|
-
}
|
|
2394
|
-
};
|
|
2395
|
-
var deleteSummaryText = function () {
|
|
2396
|
-
setEditedSummaryText("");
|
|
2397
|
-
document.getElementById("summaryText").value = '';
|
|
2398
|
-
};
|
|
2399
|
-
var handleMinimizedIcon = function () {
|
|
2400
|
-
var _a;
|
|
2401
|
-
var summaryOverlayEle = document.getElementsByClassName(idMapConstants.SUMMARY_OVERLAY_BLOCK)[0];
|
|
2402
|
-
var minimizedIcon = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(minimizedSummPreHTML, '', hostInstance);
|
|
2403
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, minimizedIcon, {
|
|
2404
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.SUMMARY_PREVIOUS_TEMPLATE,
|
|
2405
|
-
data: {}
|
|
2406
|
-
});
|
|
2407
|
-
summaryOverlayEle.append(minimizedIcon);
|
|
2408
|
-
(_a = summaryOverlayEle.querySelector("".concat(classConstants.SUMMARY_ACTION_MINIMIZED))) === null || _a === void 0 ? void 0 : _a.addEventListener('click', function () {
|
|
2409
|
-
summaryOverlayEle.removeChild(minimizedIcon);
|
|
2410
|
-
showSummary();
|
|
2411
|
-
});
|
|
2412
|
-
return minimizedIcon;
|
|
2413
|
-
};
|
|
2414
|
-
var minimizedSummPreHTML = function () {
|
|
2415
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "generate-summary-action-minimized aa-generate-summary-action-minimized" },
|
|
2416
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", className: "svg-inner" },
|
|
2417
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M8 3C8.27614 3 8.5 2.77614 8.5 2.5C8.5 2.22386 8.27614 2 8 2C7.72386 2 7.5 2.22386 7.5 2.5C7.5 2.77614 7.72386 3 8 3Z", stroke: "white", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
2418
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M8 6.5C8.27614 6.5 8.5 6.27614 8.5 6C8.5 5.72386 8.27614 5.5 8 5.5C7.72386 5.5 7.5 5.72386 7.5 6C7.5 6.27614 7.72386 6.5 8 6.5Z", stroke: "white", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
2419
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M8 10C8.27614 10 8.5 9.77614 8.5 9.5C8.5 9.22386 8.27614 9 8 9C7.72386 9 7.5 9.22386 7.5 9.5C7.5 9.77614 7.72386 10 8 10Z", stroke: "white", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
2420
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M4.5 3C4.77614 3 5 2.77614 5 2.5C5 2.22386 4.77614 2 4.5 2C4.22386 2 4 2.22386 4 2.5C4 2.77614 4.22386 3 4.5 3Z", stroke: "white", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
2421
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M4.5 6.5C4.77614 6.5 5 6.27614 5 6C5 5.72386 4.77614 5.5 4.5 5.5C4.22386 5.5 4 5.72386 4 6C4 6.27614 4.22386 6.5 4.5 6.5Z", stroke: "white", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }),
|
|
2422
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M4.5 10C4.77614 10 5 9.77614 5 9.5C5 9.22386 4.77614 9 4.5 9C4.22386 9 4 9.22386 4 9.5C4 9.77614 4.22386 10 4.5 10Z", stroke: "white", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })),
|
|
2423
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "19", height: "14", viewBox: "0 0 19 14", fill: "none" },
|
|
2424
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M9.99979 5.81524V8.01866C9.56245 8.60838 8.98161 8.80996 8.40024 8.80996C7.3657 8.80996 6.64453 7.93073 6.64453 6.92499C6.64453 5.90316 7.3657 5.00732 8.40024 5.00732C8.98161 5.00732 9.56245 5.21212 9.99979 5.81524Z", fill: "#111827" }),
|
|
2425
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M16.4016 0.310059H4.49325C4.21767 0.309988 3.94477 0.36504 3.69014 0.47207C3.43552 0.579099 3.20415 0.73601 3.00926 0.93384C2.81437 1.13167 2.65978 1.36654 2.5543 1.62505C2.44882 1.88355 2.39453 2.16062 2.39453 2.44043V9.25632C3.97002 9.26274 5.2009 10.4831 5.2009 12.0474C5.20345 12.5621 5.06557 13.0674 4.80255 13.5074H16.4016C16.9579 13.507 17.4914 13.2824 17.8848 12.883C18.2782 12.4836 18.4994 11.9419 18.4998 11.3771V2.44257C18.5001 2.1626 18.4461 1.88532 18.3408 1.62657C18.2355 1.36782 18.081 1.13269 17.8861 0.934628C17.6913 0.736565 17.4598 0.579454 17.2051 0.472284C16.9504 0.365115 16.6773 0.309988 16.4016 0.310059ZM12.2015 10.4932H10.234V9.94594C9.71132 10.2921 9.0748 10.4932 8.3113 10.4932C6.44232 10.4932 4.92796 8.91285 4.92796 6.91516C4.92796 4.88858 6.44232 3.32104 8.3113 3.32104C9.07322 3.32104 9.71132 3.5222 10.234 3.86834V3.32104H12.2015V10.4932ZM15.9679 10.4932H14.0004V3.32104H15.9706L15.9679 10.4932Z", fill: "#111827" }),
|
|
2426
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M2.16101 10.5996C1.30956 10.5996 0.605469 11.2231 0.605469 12.0442C0.605469 12.884 1.30956 13.5075 2.16101 13.5075C3.03295 13.5075 3.73705 12.884 3.73705 12.0442C3.73705 11.2226 3.03295 10.5996 2.16101 10.5996Z", fill: "#111827" })),
|
|
2427
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("span", { className: "status-summary-indicator" })));
|
|
2428
|
-
};
|
|
2429
|
-
var dragIntermSumm = function () {
|
|
2430
|
-
var _a;
|
|
2431
|
-
var miniIcon = handleMinimizedIcon();
|
|
2432
|
-
var summaryAction = miniIcon;
|
|
2433
|
-
var container = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector(".section-agent-aa-wrapper"); // Replace with actual container class
|
|
2434
|
-
if (summaryAction && container) {
|
|
2435
|
-
// Set default position using bottom and right within container
|
|
2436
|
-
summaryAction.style.position = 'absolute';
|
|
2437
|
-
summaryAction.style.bottom = '150px';
|
|
2438
|
-
summaryAction.style.right = '20px';
|
|
2439
|
-
summaryAction.style.zIndex = '999';
|
|
2440
|
-
var isDragging_1 = false;
|
|
2441
|
-
var offsetX_1 = 0, offsetY_1 = 0;
|
|
2442
|
-
var stopDragging = function () {
|
|
2443
|
-
isDragging_1 = false;
|
|
2444
|
-
};
|
|
2445
|
-
summaryAction.addEventListener('mousedown', function (event) {
|
|
2446
|
-
isDragging_1 = true;
|
|
2447
|
-
try {
|
|
2448
|
-
// Get element and container bounds with safety checks
|
|
2449
|
-
if (!summaryAction.isConnected || !container.isConnected)
|
|
2450
|
-
return;
|
|
2451
|
-
var rect = summaryAction.getBoundingClientRect();
|
|
2452
|
-
var containerRect = container.getBoundingClientRect();
|
|
2453
|
-
// Calculate offset from bottom-right within container
|
|
2454
|
-
offsetX_1 = containerRect.right - event.clientX;
|
|
2455
|
-
offsetY_1 = containerRect.bottom - event.clientY;
|
|
2456
|
-
}
|
|
2457
|
-
catch (error) {
|
|
2458
|
-
console.warn('Drag initialization failed:', error);
|
|
2459
|
-
isDragging_1 = false;
|
|
2460
|
-
return;
|
|
2461
|
-
}
|
|
2462
|
-
event.preventDefault();
|
|
2463
|
-
});
|
|
2464
|
-
document.addEventListener('mousemove', function (event) {
|
|
2465
|
-
if (!isDragging_1)
|
|
2466
|
-
return;
|
|
2467
|
-
try {
|
|
2468
|
-
// Safety checks before DOM measurements
|
|
2469
|
-
if (!summaryAction.isConnected || !container.isConnected) {
|
|
2470
|
-
isDragging_1 = false;
|
|
2471
|
-
return;
|
|
2472
|
-
}
|
|
2473
|
-
var containerRect = container.getBoundingClientRect();
|
|
2474
|
-
var elementRect = summaryAction.getBoundingClientRect();
|
|
2475
|
-
// Calculate new position relative to container
|
|
2476
|
-
var right = containerRect.right - event.clientX - offsetX_1;
|
|
2477
|
-
var bottom = containerRect.bottom - event.clientY - offsetY_1;
|
|
2478
|
-
// Ensure it stays within container boundaries
|
|
2479
|
-
right = Math.max(0, Math.min(right, containerRect.width - elementRect.width));
|
|
2480
|
-
bottom = Math.max(0, Math.min(bottom, containerRect.height - elementRect.height));
|
|
2481
|
-
// Apply new position
|
|
2482
|
-
summaryAction.style.right = "".concat(right, "px");
|
|
2483
|
-
summaryAction.style.bottom = "".concat(bottom, "px");
|
|
2484
|
-
}
|
|
2485
|
-
catch (error) {
|
|
2486
|
-
console.warn('Drag movement failed:', error);
|
|
2487
|
-
isDragging_1 = false;
|
|
2488
|
-
}
|
|
2489
|
-
event.preventDefault();
|
|
2490
|
-
});
|
|
2491
|
-
document.addEventListener('mouseup', stopDragging);
|
|
2492
|
-
document.addEventListener('mouseleave', stopDragging);
|
|
2493
|
-
summaryAction.removeAttribute('draggable');
|
|
2494
|
-
}
|
|
2495
|
-
};
|
|
2496
|
-
var showSummary = function () {
|
|
2497
|
-
var _a, _b, _c, _d;
|
|
2498
|
-
(_d = (_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "#".concat(idMapConstants.SUMMARY_WRAPPER))) === null || _c === void 0 ? void 0 : _c.classList) === null || _d === void 0 ? void 0 : _d.remove(classConstants.HIDE_ELEMENT);
|
|
2499
|
-
};
|
|
2500
|
-
var showOrHideSummaryTextArea = function (show) {
|
|
2501
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
2502
|
-
var summaryContentArea = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SUMMARY_CONTENT_AREA));
|
|
2503
|
-
var summaryTextArea = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _c === void 0 ? void 0 : _c.querySelector('#summaryText');
|
|
2504
|
-
var actionsFooter = (_e = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelector) === null || _e === void 0 ? void 0 : _e.call(_d, "".concat(classConstants.SUMMARY_ACTION_FOOTER));
|
|
2505
|
-
var formFeedback = (_f = actionsFooter === null || actionsFooter === void 0 ? void 0 : actionsFooter.querySelector) === null || _f === void 0 ? void 0 : _f.call(actionsFooter, "".concat(classConstants.FORM_FEEDBACK));
|
|
2506
|
-
if (summaryContentArea && !show) {
|
|
2507
|
-
(_g = formFeedback === null || formFeedback === void 0 ? void 0 : formFeedback.classList) === null || _g === void 0 ? void 0 : _g.add(classConstants.HIDE_ELEMENT);
|
|
2508
|
-
(_h = summaryContentArea === null || summaryContentArea === void 0 ? void 0 : summaryContentArea.classList) === null || _h === void 0 ? void 0 : _h.add(classConstants.HIDE_ELEMENT);
|
|
2509
|
-
if (summaryTextArea) {
|
|
2510
|
-
summaryTextArea.value = '';
|
|
2511
|
-
summaryTextArea.textContent = '';
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2514
|
-
else {
|
|
2515
|
-
(_j = formFeedback === null || formFeedback === void 0 ? void 0 : formFeedback.classList) === null || _j === void 0 ? void 0 : _j.remove(classConstants.HIDE_ELEMENT);
|
|
2516
|
-
(_k = summaryContentArea === null || summaryContentArea === void 0 ? void 0 : summaryContentArea.classList) === null || _k === void 0 ? void 0 : _k.remove(classConstants.HIDE_ELEMENT);
|
|
2517
|
-
}
|
|
2518
|
-
};
|
|
2519
|
-
var removeFeedbackSummary = function (actionsFooter) {
|
|
2520
|
-
var _a;
|
|
2521
|
-
var feedbackWrapper = (_a = actionsFooter === null || actionsFooter === void 0 ? void 0 : actionsFooter.querySelector) === null || _a === void 0 ? void 0 : _a.call(actionsFooter, "".concat(classConstants.FORM_FEEDBACK));
|
|
2522
|
-
if (feedbackWrapper) {
|
|
2523
|
-
feedbackWrapper === null || feedbackWrapper === void 0 ? void 0 : feedbackWrapper.remove();
|
|
2524
|
-
}
|
|
2525
|
-
};
|
|
2526
|
-
var addFeedbackToSummary = function (initiateFeedback) {
|
|
2527
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2528
|
-
if (initiateFeedback === void 0) { initiateFeedback = true; }
|
|
2529
|
-
var summaryWrapper = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(idMapConstants.SUMMARY_WRAPPER));
|
|
2530
|
-
var summaryTextArea = (_c = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector) === null || _c === void 0 ? void 0 : _c.call(_b, "".concat(classConstants.SUMMARY_EDITED_TEXT));
|
|
2531
|
-
var summaryFooter = summaryWrapper === null || summaryWrapper === void 0 ? void 0 : summaryWrapper.querySelector(".actions-footer");
|
|
2532
|
-
var feedbackWrapper = (_d = summaryFooter === null || summaryFooter === void 0 ? void 0 : summaryFooter.querySelector) === null || _d === void 0 ? void 0 : _d.call(summaryFooter, "".concat(classConstants.FORM_FEEDBACK));
|
|
2533
|
-
if (!feedbackWrapper && !((_e = summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.classList) === null || _e === void 0 ? void 0 : _e.contains(classConstants.HIDE_ELEMENT))) {
|
|
2534
|
-
var positionId = summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.getAttribute('data-positionId');
|
|
2535
|
-
var summaryId = summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.getAttribute('data-summaryId');
|
|
2536
|
-
var traceId = summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.getAttribute('data-traceId');
|
|
2537
|
-
if ((_g = (_f = rootServiceInstance.aaSettings) === null || _f === void 0 ? void 0 : _f.feedback[_constants_settingsConsts__WEBPACK_IMPORTED_MODULE_16__.FeebackConst.SUMMARY]) === null || _g === void 0 ? void 0 : _g.isEnabled) {
|
|
2538
|
-
var feedbackWrapperTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_automation_automation__WEBPACK_IMPORTED_MODULE_17__.FeedbackWrapperInsideDialog, { dialog: { dialogId: positionId, summaryId: summaryId, traceId: traceId } }, hostInstance);
|
|
2539
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, feedbackWrapperTemplate, {
|
|
2540
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.SUMMARY_FEEDBACK_TEMPLATE,
|
|
2541
|
-
data: { dialog: { dialogId: positionId, summaryId: summaryId, traceId: traceId } }
|
|
2542
|
-
});
|
|
2543
|
-
if (initiateFeedback) {
|
|
2544
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, feedbackWrapperTemplate, {
|
|
2545
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.FEEDBACK_WRAPER_TEMPLATE,
|
|
2546
|
-
data: { dialog: { dialogId: positionId } }
|
|
2547
|
-
});
|
|
2548
|
-
summaryFooter.append(feedbackWrapperTemplate);
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
}
|
|
2552
|
-
};
|
|
2553
|
-
var updateFeedbackForMainSummary = function () {
|
|
2554
|
-
var _a, _b, _c, _d, _e;
|
|
2555
|
-
var summaryWrapper = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(idMapConstants.SUMMARY_WRAPPER));
|
|
2556
|
-
var summaryFooter = summaryWrapper === null || summaryWrapper === void 0 ? void 0 : summaryWrapper.querySelector(".actions-footer");
|
|
2557
|
-
var feedbackWrapper = (_b = summaryFooter === null || summaryFooter === void 0 ? void 0 : summaryFooter.querySelector) === null || _b === void 0 ? void 0 : _b.call(summaryFooter, "".concat(classConstants.FORM_FEEDBACK));
|
|
2558
|
-
var summaryTextArea = (_d = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _c === void 0 ? void 0 : _c.querySelector) === null || _d === void 0 ? void 0 : _d.call(_c, "".concat(classConstants.SUMMARY_EDITED_TEXT));
|
|
2559
|
-
if (feedbackWrapper && summaryTextArea) {
|
|
2560
|
-
var positionId_2 = summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.getAttribute('data-positionId');
|
|
2561
|
-
var summaryId = summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.getAttribute('data-summaryId');
|
|
2562
|
-
var traceId = summaryTextArea === null || summaryTextArea === void 0 ? void 0 : summaryTextArea.getAttribute('data-traceId');
|
|
2563
|
-
var feedbackData = ((_e = rootServiceInstance.generatedSummaries.find(function (item) { return item.positionId === positionId_2; })) === null || _e === void 0 ? void 0 : _e.summaryFeedbackData) || { positionId: positionId_2, summaryId: summaryId, traceId: traceId };
|
|
2564
|
-
removeExistingFeedback(summaryFooter, positionId_2);
|
|
2565
|
-
rootServiceInstance.handleFeedbackType({ dialogId: positionId_2, feedbackData: rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.prepareFeedbackForSummary(feedbackData) }, summaryFooter, _constants_settingsConsts__WEBPACK_IMPORTED_MODULE_16__.FeebackConst.SUMMARY, hostInstance);
|
|
2566
|
-
}
|
|
2567
|
-
};
|
|
2568
|
-
var removeExistingFeedback = function (summaryFooter, positionId) {
|
|
2569
|
-
var _a, _b;
|
|
2570
|
-
var feedbackHelpfulSection = (_a = summaryFooter === null || summaryFooter === void 0 ? void 0 : summaryFooter.querySelector) === null || _a === void 0 ? void 0 : _a.call(summaryFooter, ".form-feedback-div");
|
|
2571
|
-
var feedbackWrapper = (_b = summaryFooter === null || summaryFooter === void 0 ? void 0 : summaryFooter.querySelector) === null || _b === void 0 ? void 0 : _b.call(summaryFooter, ".improve-feedback-block");
|
|
2572
|
-
feedbackHelpfulSection && (feedbackHelpfulSection === null || feedbackHelpfulSection === void 0 ? void 0 : feedbackHelpfulSection.remove());
|
|
2573
|
-
feedbackWrapper && (feedbackWrapper === null || feedbackWrapper === void 0 ? void 0 : feedbackWrapper.remove());
|
|
2574
|
-
};
|
|
2575
|
-
var updateSummaryFeedback = function (wrapper, positionId, summaryId, traceId, exeStartTime) {
|
|
2576
|
-
var _a, _b, _c;
|
|
2577
|
-
if ((_b = (_a = rootServiceInstance.aaSettings) === null || _a === void 0 ? void 0 : _a.feedback[_constants_settingsConsts__WEBPACK_IMPORTED_MODULE_16__.FeebackConst.SUMMARY]) === null || _b === void 0 ? void 0 : _b.isEnabled) {
|
|
2578
|
-
var feedbackWrapperTemplate = (0,_domManager__WEBPACK_IMPORTED_MODULE_13__.getHTML)(_tabs_automation_automation__WEBPACK_IMPORTED_MODULE_17__.FeedbackWrapperInsideDialog, { dialog: { dialogId: positionId, summaryId: summaryId, traceId: traceId, exeStartTime: exeStartTime } }, hostInstance);
|
|
2579
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.BEFORE_VIEW_INIT, feedbackWrapperTemplate, {
|
|
2580
|
-
event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.SDK_EVENTS.FEEDBACK_WRAPER_TEMPLATE,
|
|
2581
|
-
data: { dialog: { dialogId: positionId } }
|
|
2582
|
-
});
|
|
2583
|
-
wrapper.append(feedbackWrapperTemplate);
|
|
2584
|
-
var feedbackData = ((_c = rootServiceInstance.generatedSummaries.find(function (item) { return item.positionId === positionId; })) === null || _c === void 0 ? void 0 : _c.summaryFeedbackData) || { positionId: positionId, summaryId: summaryId, traceId: traceId };
|
|
2585
|
-
rootServiceInstance.handleFeedbackType({ dialogId: positionId, feedbackData: rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.prepareFeedbackForSummary(feedbackData) }, wrapper, _constants_settingsConsts__WEBPACK_IMPORTED_MODULE_16__.FeebackConst.SUMMARY, hostInstance);
|
|
2586
|
-
}
|
|
2587
|
-
};
|
|
2588
|
-
var regenerateSummary = function () {
|
|
2589
|
-
var _a, _b;
|
|
2590
|
-
var editedSummaryText = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SUMMARY_EDITED_TEXT));
|
|
2591
|
-
showOrHideSummaryTextArea(true);
|
|
2592
|
-
addToPreviouSummary(editedSummaryText, 'interim');
|
|
2593
|
-
generateSummary({}, true, true);
|
|
2594
|
-
updateGeneratedSummariesCount();
|
|
2595
|
-
};
|
|
2596
|
-
var addOrRemoveLoaderToSummary = function (flag) {
|
|
2597
|
-
var _a, _b;
|
|
2598
|
-
var summaryOverlayEle = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "#".concat(idMapConstants.SUMMARY_WRAPPER));
|
|
2599
|
-
if (flag && summaryOverlayEle) {
|
|
2600
|
-
hostInstance.renderIndividualLoader(summaryOverlayEle);
|
|
2601
|
-
}
|
|
2602
|
-
else if (!flag && summaryOverlayEle) {
|
|
2603
|
-
hostInstance.removeIndividualLoader(summaryOverlayEle);
|
|
2604
|
-
}
|
|
2605
|
-
};
|
|
2606
|
-
var addSummaryToList = function (respData) {
|
|
2607
|
-
var _a, _b, _c, _d, _e;
|
|
2608
|
-
if (respData === null || respData === void 0 ? void 0 : respData.summaryText) {
|
|
2609
|
-
var positionId_3 = respData === null || respData === void 0 ? void 0 : respData.positionId;
|
|
2610
|
-
var inx = rootServiceInstance.generatedSummaries.findIndex(function (item) { return item.positionId === positionId_3; });
|
|
2611
|
-
if (inx === -1 && positionId_3) {
|
|
2612
|
-
var data = {
|
|
2613
|
-
summary: [respData.summaryText],
|
|
2614
|
-
editedSummary: respData.summaryText,
|
|
2615
|
-
positionId: positionId_3,
|
|
2616
|
-
type: (respData === null || respData === void 0 ? void 0 : respData.type) || 'interim',
|
|
2617
|
-
traceId: respData === null || respData === void 0 ? void 0 : respData.traceId,
|
|
2618
|
-
summaryId: respData === null || respData === void 0 ? void 0 : respData.summaryId,
|
|
2619
|
-
exeStartTime: respData === null || respData === void 0 ? void 0 : respData.exeStartTime
|
|
2620
|
-
};
|
|
2621
|
-
rootServiceInstance.generatedSummaries.push(JSON.parse(JSON.stringify(data)));
|
|
2622
|
-
}
|
|
2623
|
-
}
|
|
2624
|
-
if ((respData === null || respData === void 0 ? void 0 : respData.type) === 'final') {
|
|
2625
|
-
var summaryContentArea = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(classConstants.SUMMARY_CONTENT_AREA));
|
|
2626
|
-
var editedSummaryText_1 = (_d = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _c === void 0 ? void 0 : _c.querySelector) === null || _d === void 0 ? void 0 : _d.call(_c, "".concat(classConstants.SUMMARY_EDITED_TEXT));
|
|
2627
|
-
if (!((_e = summaryContentArea === null || summaryContentArea === void 0 ? void 0 : summaryContentArea.classList) === null || _e === void 0 ? void 0 : _e.contains(classConstants.HIDE_ELEMENT)) && editedSummaryText_1) {
|
|
2628
|
-
addToPreviouSummary(editedSummaryText_1, 'interim');
|
|
2629
|
-
// addFeedbackToSummary(false);
|
|
2630
|
-
}
|
|
2631
|
-
}
|
|
2632
|
-
};
|
|
2633
|
-
var updateGeneratedSummariesCount = function () {
|
|
2634
|
-
//generatedSummaries Count update.
|
|
2635
|
-
var _a, _b;
|
|
2636
|
-
var generatedSummariesCount = (_b = (_a = rootServiceInstance.generatedSummaries) === null || _a === void 0 ? void 0 : _a.filter(function (item) { return item.type !== 'final'; })) === null || _b === void 0 ? void 0 : _b.length;
|
|
2637
|
-
var summaryCountEle = hostInstance.chatEle.querySelector("".concat(classConstants.SUMMARY_COUNT));
|
|
2638
|
-
if (summaryCountEle) {
|
|
2639
|
-
summaryCountEle.textContent = generatedSummariesCount;
|
|
2640
|
-
}
|
|
2641
|
-
};
|
|
2642
|
-
var generateSummary = function (e, interim, regenerate) {
|
|
2643
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2644
|
-
if (interim === void 0) { interim = false; }
|
|
2645
|
-
if (regenerate === void 0) { regenerate = false; }
|
|
2646
|
-
var summaryWrapper = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(idMapConstants.SUMMARY_WRAPPER));
|
|
2647
|
-
var summaryClassList = summaryWrapper === null || summaryWrapper === void 0 ? void 0 : summaryWrapper.classList;
|
|
2648
|
-
if ((!summaryClassList || (summaryClassList === null || summaryClassList === void 0 ? void 0 : summaryClassList.contains(classConstants.HIDE_ELEMENT))) && (rootServiceInstance.finalSummaryGenerated || hostInstance.localStorageService.getFinalSummaryGenerated())) {
|
|
2649
|
-
rootServiceInstance.fetchSummaries(hostInstance);
|
|
2650
|
-
return;
|
|
2651
|
-
}
|
|
2652
|
-
addOrRemoveLoaderToSummary(true);
|
|
2653
|
-
var connectionDetails = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.rootService) === null || _b === void 0 ? void 0 : _b.connectionDetails;
|
|
2654
|
-
var conversationId = connectionDetails.conversationId;
|
|
2655
|
-
if (hostInstance.localStorageService.getConvObjFromLS()) {
|
|
2656
|
-
var request_resolution_comments = {
|
|
2657
|
-
userId: '',
|
|
2658
|
-
conversationId: conversationId,
|
|
2659
|
-
botId: connectionDetails.botId,
|
|
2660
|
-
sessionId: (0,_utils_koregenerateuuid__WEBPACK_IMPORTED_MODULE_14__["default"])(),
|
|
2661
|
-
chatHistory: (_d = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.rootService) === null || _c === void 0 ? void 0 : _c.connectionDetails) === null || _d === void 0 ? void 0 : _d.chatHistory,
|
|
2662
|
-
participant: ((_e = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.internalTransferData) === null || _e === void 0 ? void 0 : _e.participant) || {},
|
|
2663
|
-
interimSummary: !!(rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.interimSummary),
|
|
2664
|
-
};
|
|
2665
|
-
request_resolution_comments['type'] = interim ? 'interim' : 'final';
|
|
2666
|
-
if (!interim) {
|
|
2667
|
-
rootServiceInstance.finalSummaryGenerated = true;
|
|
2668
|
-
}
|
|
2669
|
-
if (summaryClassList === null || summaryClassList === void 0 ? void 0 : summaryClassList.contains(classConstants.HIDE_ELEMENT)) {
|
|
2670
|
-
hostInstance.setSummaryPopup({ initPopup: true });
|
|
2671
|
-
}
|
|
2672
|
-
request_resolution_comments['model'] = (_g = (_f = rootServiceInstance.aaSettings) === null || _f === void 0 ? void 0 : _f.summarization['localeData'][connectionDetails.interactiveLanguage || 'en']) === null || _g === void 0 ? void 0 : _g.model;
|
|
2673
|
-
hostInstance.socketConnection.emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS.request_resolution_comments, request_resolution_comments);
|
|
2674
|
-
if (!interim) {
|
|
2675
|
-
request_resolution_comments['crId'] = 'custom';
|
|
2676
|
-
request_resolution_comments['cTPositionId'] = rootServiceInstance.currentCustomTabAutomationId;
|
|
2677
|
-
hostInstance.socketConnection.emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_11__.EVENTS.end_of_conversation, request_resolution_comments);
|
|
2678
|
-
}
|
|
2679
|
-
disableOrEnableSummaryRefreshButton(false);
|
|
2680
|
-
}
|
|
2681
|
-
};
|
|
2682
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)(preact__WEBPACK_IMPORTED_MODULE_2__.Fragment, null,
|
|
2683
|
-
showWidget && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)(_tabs_ErrorBoundary_ErrorBoundary__WEBPACK_IMPORTED_MODULE_18__["default"], { hostInstance: hostInstance },
|
|
2684
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: chatContainerClass, "aria-label": 'agent-window-section' },
|
|
2685
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("section", { className: "section-agent-aa-wrapper" },
|
|
2686
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("header", { className: "aa-header" }),
|
|
2687
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("section", { className: "body-container-aa" }, tabsNTitles.map(function (tab) {
|
|
2688
|
-
var _a, _b;
|
|
2689
|
-
if (!tab.isEnabled)
|
|
2690
|
-
return null;
|
|
2691
|
-
if (tab.type === 'cl' && !((_a = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.aaSettings) === null || _a === void 0 ? void 0 : _a.isAgentPlaybookEnabled))
|
|
2692
|
-
return null;
|
|
2693
|
-
if (tab.type === 'cst' && !((_b = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.customTabPrefsObj) === null || _b === void 0 ? void 0 : _b.customTabEnabled)) {
|
|
2694
|
-
return null;
|
|
2695
|
-
}
|
|
2696
|
-
var TabComponent = tabComponents[tab.type];
|
|
2697
|
-
var isActive = tabActiveStates[tab.type];
|
|
2698
|
-
return TabComponent ? ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { key: tab.type, className: isActive ? 'animate-compo-slide-up-wrapper' : 'aa-hidden' },
|
|
2699
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)(TabComponent, { hostInstance: hostInstance }))) : null;
|
|
2700
|
-
})),
|
|
2701
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("footer", { className: "aa-footer" }),
|
|
2702
|
-
((_k = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.aaSettings) === null || _k === void 0 ? void 0 : _k.isAgentCoachingEnabled) && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "nudges-wrapper-fixed aa-nudges-wrapper-fixed" },
|
|
2703
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "nudges-template-data aa-nudges-template-data" }))),
|
|
2704
|
-
((_l = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.aaSettings) === null || _l === void 0 ? void 0 : _l.isAgentCoachingEnabled) && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "hints-wrapper-fixed aa-hints-wrapper-fixed" },
|
|
2705
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: "hints-template-data aa-hints-template-data" })))),
|
|
2706
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: 'p-none visibility-hidden agentic-co-pilot-wrapper' },
|
|
2707
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)(_tabs_agentic_CoPilot_agentic_CoPilot__WEBPACK_IMPORTED_MODULE_6__.AgenticCoPilot, { hostInstance: hostInstance }))))),
|
|
2708
|
-
!showWidget && ((0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { className: chatContainerClass, "aria-label": 'agent-window-section' },
|
|
2709
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("section", { className: "section-agent-aa-wrapper" },
|
|
2710
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { class: "widgets-disabled-card-wrapper" },
|
|
2711
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { class: "widgets-info-disabled-content" },
|
|
2712
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { class: "icon_block" },
|
|
2713
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
2714
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("path", { d: "M8 6.00015V8.66682M8 11.3335H8.00667M7.07688 2.59464L1.59362 12.0657C1.28948 12.591 1.13742 12.8537 1.15989 13.0693C1.1795 13.2573 1.27801 13.4282 1.43091 13.5394C1.60622 13.6668 1.90973 13.6668 2.51674 13.6668H13.4833C14.0903 13.6668 14.3938 13.6668 14.5691 13.5394C14.722 13.4282 14.8205 13.2573 14.8401 13.0693C14.8626 12.8537 14.7105 12.591 14.4064 12.0657L8.92312 2.59463C8.62007 2.07119 8.46855 1.80947 8.27087 1.72157C8.09843 1.64489 7.90157 1.64489 7.72913 1.72157C7.53145 1.80947 7.37992 2.07119 7.07688 2.59464Z", stroke: "#F79009", "stroke-width": "1.2", "stroke-linecap": "round", "stroke-linejoin": "round" }))),
|
|
2715
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("div", { class: "content-info-widget" },
|
|
2716
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("h1", null, languageData === null || languageData === void 0 ? void 0 : languageData.WIDGET_DISABLED),
|
|
2717
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_2__.h)("p", null, languageData === null || languageData === void 0 ? void 0 : languageData.AI_SETTINGS_DISABLED)))))))));
|
|
2718
|
-
}
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
/***/ }),
|
|
2722
|
-
|
|
2723
|
-
/***/ "./src/components/common/templatemanager/tabs/playbook/playbook.tsx":
|
|
2724
|
-
/*!**************************************************************************!*\
|
|
2725
|
-
!*** ./src/components/common/templatemanager/tabs/playbook/playbook.tsx ***!
|
|
2726
|
-
\**************************************************************************/
|
|
2727
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2728
|
-
|
|
2729
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2730
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2731
|
-
/* harmony export */ Playbook: () => (/* binding */ Playbook),
|
|
2732
|
-
/* harmony export */ RenderChecklistBody: () => (/* binding */ RenderChecklistBody),
|
|
2733
|
-
/* harmony export */ RenderEachDynamicChecklistItem: () => (/* binding */ RenderEachDynamicChecklistItem),
|
|
2734
|
-
/* harmony export */ RenderEachPrimaryChecklistItem: () => (/* binding */ RenderEachPrimaryChecklistItem),
|
|
2735
|
-
/* harmony export */ RenderEachStageItem: () => (/* binding */ RenderEachStageItem),
|
|
2736
|
-
/* harmony export */ RenderEachTriggeredChecklist: () => (/* binding */ RenderEachTriggeredChecklist),
|
|
2737
|
-
/* harmony export */ RenderEmptyPlaybookMsg: () => (/* binding */ RenderEmptyPlaybookMsg),
|
|
2738
|
-
/* harmony export */ RenderEmptyPlaybookScreen: () => (/* binding */ RenderEmptyPlaybookScreen),
|
|
2739
|
-
/* harmony export */ RenderPlaybookHeader: () => (/* binding */ RenderPlaybookHeader)
|
|
2740
|
-
/* harmony export */ });
|
|
2741
|
-
/* harmony import */ var preact__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! preact */ "./node_modules/preact/dist/preact.module.js");
|
|
2742
|
-
/* harmony import */ var _playbook_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./playbook.scss */ "./src/components/common/templatemanager/tabs/playbook/playbook.scss");
|
|
2743
|
-
/* harmony import */ var preact_hooks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! preact/hooks */ "./node_modules/preact/hooks/dist/hooks.module.js");
|
|
2744
|
-
/* harmony import */ var _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../constants/events.cnst */ "./src/components/common/constants/events.cnst.ts");
|
|
2745
|
-
/* harmony import */ var _utils_interceptor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../utils/interceptor */ "./src/components/common/utils/interceptor.ts");
|
|
2746
|
-
/* harmony import */ var _base_domManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../base/domManager */ "./src/components/common/templatemanager/base/domManager.tsx");
|
|
2747
|
-
/* harmony import */ var _constants_projConsts__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../constants/projConsts */ "./src/components/common/constants/projConsts.ts");
|
|
2748
|
-
/* harmony import */ var _constants_errorcodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../constants/errorcodes */ "./src/components/common/constants/errorcodes.ts");
|
|
2749
|
-
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {
|
|
2750
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2751
|
-
if (ar || !(i in from)) {
|
|
2752
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
2753
|
-
ar[i] = from[i];
|
|
2754
|
-
}
|
|
2755
|
-
}
|
|
2756
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
2757
|
-
};
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
function RenderEachStageItem(props) {
|
|
2767
|
-
var _a, _b;
|
|
2768
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", null, (_b = (_a = props === null || props === void 0 ? void 0 : props.msgData) === null || _a === void 0 ? void 0 : _a.stageList) === null || _b === void 0 ? void 0 : _b.map(function (stage, stInx) {
|
|
2769
|
-
var _a;
|
|
2770
|
-
var stageCompleted = ((stage === null || stage === void 0 ? void 0 : stage.steps) || []).every(function (item) { return item.complete; });
|
|
2771
|
-
var stageDrpClass = ['aa-dropdown-item', "aa-stage-drp-".concat(stInx)];
|
|
2772
|
-
if (stage.name === 'Close')
|
|
2773
|
-
stageDrpClass.push('aa-close-stage-btn');
|
|
2774
|
-
if (stage.name === 'Close' && !stageCompleted)
|
|
2775
|
-
stageDrpClass.push('disabled-msg');
|
|
2776
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { "aria-disabled": "true", className: "".concat(stageDrpClass.join(' ')) },
|
|
2777
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("p", null, stage.name),
|
|
2778
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", className: "aa-selected-stage-".concat(stInx, " ").concat(stInx !== ((_a = props.msgData) === null || _a === void 0 ? void 0 : _a.selectedStInx) ? 'aa-hidden' : '') },
|
|
2779
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M15 4.5L6.75 12.75L3 9", stroke: "#2970FF", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))));
|
|
2780
|
-
})));
|
|
2781
|
-
}
|
|
2782
|
-
function RenderEachPrimaryChecklistItem(props) {
|
|
2783
|
-
var _a, _b, _c;
|
|
2784
|
-
var languageData = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata;
|
|
2785
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", null, (_c = (_b = props === null || props === void 0 ? void 0 : props.msgData) === null || _b === void 0 ? void 0 : _b.allChecklists) === null || _c === void 0 ? void 0 : _c.map(function (cl, clInx) {
|
|
2786
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,
|
|
2787
|
-
clInx == 0 && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "heading-text-scripts aa-primary-scripts" }, languageData === null || languageData === void 0 ? void 0 : languageData.PRIMARY_SCRIPTS),
|
|
2788
|
-
cl.type === 'primary' && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { "aria-disabled": "true", className: "aa-dropdown-item aa-primary-cl-".concat(clInx) },
|
|
2789
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("p", null, cl.name),
|
|
2790
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "primaryBtn aa-hidden aa-cl-resume-".concat(clInx) }, languageData === null || languageData === void 0 ? void 0 : languageData.RESUME),
|
|
2791
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", className: "aa-cl-check-".concat(clInx, " aa-cl-item aa-hidden") },
|
|
2792
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M15 4.5L6.75 12.75L3 9", stroke: "#2970FF", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))));
|
|
2793
|
-
})));
|
|
2794
|
-
}
|
|
2795
|
-
function RenderEachDynamicChecklistItem(props) {
|
|
2796
|
-
var _a, _b, _c;
|
|
2797
|
-
var languageData = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata;
|
|
2798
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", null, (_c = (_b = props === null || props === void 0 ? void 0 : props.msgData) === null || _b === void 0 ? void 0 : _b.allChecklists) === null || _c === void 0 ? void 0 : _c.map(function (cl, clInx) {
|
|
2799
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,
|
|
2800
|
-
clInx == 0 && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "heading-text-scripts aa-dynamic-scripts" }, languageData === null || languageData === void 0 ? void 0 : languageData.DYNAMIC_SCRIPTS),
|
|
2801
|
-
cl.type === 'dynamic' && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { "aria-disabled": "true", className: "aa-dropdown-item aa-dynamic-cl-".concat(clInx) },
|
|
2802
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("p", null, cl.name),
|
|
2803
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "primaryBtn aa-hidden aa-cl-resume-".concat(clInx) }, languageData === null || languageData === void 0 ? void 0 : languageData.RESUME),
|
|
2804
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", className: "aa-cl-check-".concat(clInx, " aa-cl-item aa-hidden") },
|
|
2805
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M15 4.5L6.75 12.75L3 9", stroke: "#2970FF", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" })))));
|
|
2806
|
-
})));
|
|
2807
|
-
}
|
|
2808
|
-
function RenderEachTriggeredChecklist(props) {
|
|
2809
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
2810
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { "aria-disabled": "true", className: "aa-dropdown-item aa-trigger-checklist-btn-".concat((_b = (_a = props === null || props === void 0 ? void 0 : props.msgData) === null || _a === void 0 ? void 0 : _a.checklist) === null || _b === void 0 ? void 0 : _b._id) },
|
|
2811
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("p", { className: "aa-trigger-checklist-name" }, (_d = (_c = props === null || props === void 0 ? void 0 : props.msgData) === null || _c === void 0 ? void 0 : _c.checklist) === null || _d === void 0 ? void 0 : _d.name),
|
|
2812
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("span", { className: "aa-trigger-checklist-stepcount" }, (_g = (_f = (_e = props === null || props === void 0 ? void 0 : props.msgData) === null || _e === void 0 ? void 0 : _e.checklist) === null || _f === void 0 ? void 0 : _f.stages) === null || _g === void 0 ? void 0 :
|
|
2813
|
-
_g.length,
|
|
2814
|
-
" ", (_j = (_h = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _h === void 0 ? void 0 : _h.languagedata) === null || _j === void 0 ? void 0 :
|
|
2815
|
-
_j.STEP)));
|
|
2816
|
-
}
|
|
2817
|
-
function RenderEmptyPlaybookScreen(props) {
|
|
2818
|
-
var _a, _b;
|
|
2819
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "empty-listing-triggers aa-checklist-empty" },
|
|
2820
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("h1", { className: "aa-text-sm medium" }, (_b = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata) === null || _b === void 0 ? void 0 : _b.NO_ACTIVE_PLAYBOOK)));
|
|
2821
|
-
}
|
|
2822
|
-
function RenderEmptyPlaybookMsg(props) {
|
|
2823
|
-
var _a;
|
|
2824
|
-
var languageData = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata;
|
|
2825
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "empty-listing-triggers aa-checklist-empty" },
|
|
2826
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("h1", { className: "aa-text-sm medium" }, languageData === null || languageData === void 0 ? void 0 : languageData.PLAYBOOK_EMPTY_MSG),
|
|
2827
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("p", { className: "aa-desc-xs center" }, languageData === null || languageData === void 0 ? void 0 : languageData.PLAYBOOK_EMPTY_DESC)));
|
|
2828
|
-
}
|
|
2829
|
-
function RenderPlaybookHeader(props) {
|
|
2830
|
-
var _a;
|
|
2831
|
-
var languageData = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata;
|
|
2832
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-header-data aa-playbook-header" },
|
|
2833
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "left-sec-data" },
|
|
2834
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "aa-dropdown aa-triggerList-drp-wrapper aa-hidden" },
|
|
2835
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { type: "button", id: "playbookDrpTriggerChecklist", className: "aa-dropdown-toggle playbook-suggestion aa-trigger-checklist-count-btn" },
|
|
2836
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("sub", { className: "aa-triggerDynChecklist-bulb-count" }),
|
|
2837
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
|
|
2838
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M13.0496 4.64998C13.0496 4.07008 12.5795 3.59998 11.9996 3.59998C11.4197 3.59998 10.9496 4.07008 10.9496 4.64998V5.69998C10.9496 6.27987 11.4197 6.74998 11.9996 6.74998C12.5795 6.74998 13.0496 6.27987 13.0496 5.69998V4.64998Z", fill: "#2B75E4" }),
|
|
2839
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M17.9393 7.54515C18.3493 7.1351 18.3493 6.47027 17.9393 6.06022C17.5292 5.65017 16.8644 5.65017 16.4543 6.06022L15.7119 6.80269C15.3018 7.21274 15.3018 7.87756 15.7119 8.28761C16.1219 8.69766 16.7868 8.69766 17.1968 8.28761L17.9393 7.54515Z", fill: "#2B75E4" }),
|
|
2840
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M20.3996 12C20.3996 12.5799 19.9295 13.05 19.3496 13.05H18.2996C17.7197 13.05 17.2496 12.5799 17.2496 12C17.2496 11.4201 17.7197 10.95 18.2996 10.95H19.3496C19.9295 10.95 20.3996 11.4201 20.3996 12Z", fill: "#2B75E4" }),
|
|
2841
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M6.80231 8.28763C7.21236 8.69768 7.87718 8.69768 8.28723 8.28763C8.69728 7.87758 8.69728 7.21275 8.28723 6.8027L7.54477 6.06024C7.13472 5.65019 6.4699 5.65019 6.05984 6.06024C5.64979 6.47029 5.64979 7.13512 6.05984 7.54517L6.80231 8.28763Z", fill: "#2B75E4" }),
|
|
2842
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M6.74961 12C6.74961 12.5799 6.27951 13.05 5.69961 13.05H4.64961C4.06971 13.05 3.59961 12.5799 3.59961 12C3.59961 11.4201 4.06971 10.95 4.64961 10.95H5.69961C6.27951 10.95 6.74961 11.4201 6.74961 12Z", fill: "#2B75E4" }),
|
|
2843
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M9.89961 18.3V17.25H14.0996V18.3C14.0996 19.4598 13.1594 20.4 11.9996 20.4C10.8398 20.4 9.89961 19.4598 9.89961 18.3Z", fill: "#2B75E4" }),
|
|
2844
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M14.1005 16.2C14.1159 15.8426 14.3176 15.5214 14.6003 15.2982C15.5744 14.529 16.1996 13.3375 16.1996 12C16.1996 9.68038 14.3192 7.79998 11.9996 7.79998C9.68001 7.79998 7.79961 9.68038 7.79961 12C7.79961 13.3375 8.42483 14.529 9.39896 15.2982C9.68164 15.5214 9.88335 15.8426 9.89867 16.2H14.1005Z", fill: "#2B75E4" }))),
|
|
2845
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-dropdown-content aa-dropdown-content aa-trigger-checklist-drp", "aria-labelledby": "playbookDrpTriggerChecklist" },
|
|
2846
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "heading-text-scripts" }, languageData === null || languageData === void 0 ? void 0 : languageData.RECOMENDED_PLAYBOOK))),
|
|
2847
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "dropdowns-text-info" },
|
|
2848
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "aa-dropdown aa-checklist-drp-wrapper aa-hidden" },
|
|
2849
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { type: "button", id: "playbookDrpListBtn", className: "aa-dropdown-toggle" },
|
|
2850
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("span", { className: "aa-selected-checklist" }),
|
|
2851
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { className: "arrow-icon aa-selected-checklist-arrow", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
2852
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M3.52876 5.52858C3.78911 5.26823 4.21122 5.26823 4.47157 5.52858L8.00016 9.05717L11.5288 5.52858C11.7891 5.26823 12.2112 5.26823 12.4716 5.52858C12.7319 5.78892 12.7319 6.21103 12.4716 6.47138L8.47157 10.4714C8.21122 10.7317 7.78911 10.7317 7.52876 10.4714L3.52876 6.47138C3.26841 6.21103 3.26841 5.78892 3.52876 5.52858Z", fill: "#667085" }))),
|
|
2853
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-dropdown-content aa-dropdown-content aa-checklist-drp", "aria-labelledby": "playbookDrpListBtn" })),
|
|
2854
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "bottom-titles-info aa-stage-drp-wrapper-main aa-hidden" },
|
|
2855
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("h6", null, languageData === null || languageData === void 0 ? void 0 :
|
|
2856
|
-
languageData.STAGE,
|
|
2857
|
-
" : "),
|
|
2858
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "aa-dropdown aa-stage-drp-wrapper" },
|
|
2859
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { type: "button", id: "playbookStageDrpBtn", className: "aa-dropdown-toggle" },
|
|
2860
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("span", { className: "aa-selected-stage" }),
|
|
2861
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { className: "arrow-icon aa-selected-stage-arrow", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
2862
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M3.52876 5.52858C3.78911 5.26823 4.21122 5.26823 4.47157 5.52858L8.00016 9.05717L11.5288 5.52858C11.7891 5.26823 12.2112 5.26823 12.4716 5.52858C12.7319 5.78892 12.7319 6.21103 12.4716 6.47138L8.47157 10.4714C8.21122 10.7317 7.78911 10.7317 7.52876 10.4714L3.52876 6.47138C3.26841 6.21103 3.26841 5.78892 3.52876 5.52858Z", fill: "#667085" }))),
|
|
2863
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-dropdown-content aa-dropdown-content aa-stage-drp", "aria-labelledby": "playbookStageDrpBtn" }))))),
|
|
2864
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "actions-checklist-header" },
|
|
2865
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "solid-action step-complete aa-step-complete-count aa-hidden", "aria-label": "button" }),
|
|
2866
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "solid-action stop-assist aa-proceedtoclose-btn aa-hidden", "aria-label": "button", title: "".concat(languageData === null || languageData === void 0 ? void 0 : languageData.PROCEED_TO_CLOSE) },
|
|
2867
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none" },
|
|
2868
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("g", { "clip-path": "url(#clip0_9531_17675)" },
|
|
2869
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M8.24998 4V2.5L9.74998 1L10.25 2L11.25 2.5L9.74998 4H8.24998ZM8.24998 4L6.24999 5.99997M11.25 6C11.25 8.76142 9.01142 11 6.25 11C3.48858 11 1.25 8.76142 1.25 6C1.25 3.23858 3.48858 1 6.25 1M8.75 6C8.75 7.38071 7.63071 8.5 6.25 8.5C4.86929 8.5 3.75 7.38071 3.75 6C3.75 4.61929 4.86929 3.5 6.25 3.5", stroke: "#DC2626", "stroke-width": "0.7", "stroke-linecap": "round", "stroke-linejoin": "round" })),
|
|
2870
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("defs", null,
|
|
2871
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("clipPath", { id: "clip0_9531_17675" },
|
|
2872
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("rect", { width: "12", height: "12", fill: "white", transform: "translate(0.25)" }))))))));
|
|
2873
|
-
}
|
|
2874
|
-
function RenderChecklistBody(props) {
|
|
2875
|
-
var _a, _b, _c;
|
|
2876
|
-
var rootServiceInstance = (_b = (_a = props === null || props === void 0 ? void 0 : props.msgData) === null || _a === void 0 ? void 0 : _a.hostInstance) === null || _b === void 0 ? void 0 : _b.rootService;
|
|
2877
|
-
var _d = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useState)(rootServiceInstance.hideActionButtons), hideActionButtons = _d[0], setHideActionButtons = _d[1];
|
|
2878
|
-
var _e = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useState)(rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.hideSendButton), hideSendButton = _e[0], setHideSendButton = _e[1];
|
|
2879
|
-
var _f = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useState)(rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.hideCopyButton), hideCopyButton = _f[0], setHideCopyButton = _f[1];
|
|
2880
|
-
(0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
2881
|
-
}, []);
|
|
2882
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-steps-repeat-data" }, (_c = props === null || props === void 0 ? void 0 : props.msgData) === null || _c === void 0 ? void 0 : _c.stages.map(function (stage, stInx) {
|
|
2883
|
-
var _a;
|
|
2884
|
-
var stageCompleted = ((stage === null || stage === void 0 ? void 0 : stage.steps) || []).every(function (item) { return item.complete; });
|
|
2885
|
-
var stageClass = ['close-playbook-data', "aa-playbook-stage-".concat(stInx)];
|
|
2886
|
-
if (stage.name === 'Close')
|
|
2887
|
-
stageClass.push('aa-close-stage');
|
|
2888
|
-
if (!stageCompleted)
|
|
2889
|
-
stageClass.push('aa-hidden');
|
|
2890
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)(preact__WEBPACK_IMPORTED_MODULE_0__.Fragment, { key: stInx },
|
|
2891
|
-
stInx != 0 && (0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "".concat(stageClass.join(' ')) },
|
|
2892
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("span", null),
|
|
2893
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("p", null, stage.name),
|
|
2894
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("span", null)), (_a = stage === null || stage === void 0 ? void 0 : stage.steps) === null || _a === void 0 ? void 0 :
|
|
2895
|
-
_a.map(function (step, stepInx) {
|
|
2896
|
-
var _a, _b, _c, _d;
|
|
2897
|
-
var stepClass = ['playbook-step', "aa-playbook-step-".concat(stInx, "-").concat(stepInx, " ")];
|
|
2898
|
-
if (stage.name === 'Close')
|
|
2899
|
-
stepClass.push('aa-close-steps');
|
|
2900
|
-
if (step === null || step === void 0 ? void 0 : step.ongoing)
|
|
2901
|
-
stepClass.push('playbook-step-ongoing');
|
|
2902
|
-
if (stage.name === 'Close' && !stageCompleted)
|
|
2903
|
-
stepClass.push('aa-hidden');
|
|
2904
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { key: stepInx, className: "".concat(stepClass.join(' ')), id: "".concat(step._id) },
|
|
2905
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "heading-step aa-heading-step ".concat((step === null || step === void 0 ? void 0 : step.ongoing) ? '' : 'disabled-msg') },
|
|
2906
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("h1", { className: "aa-step-header-name ".concat(step.complete ? 'strike-text' : '') }, step.name),
|
|
2907
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "check-btn aa-step-complete-".concat(stInx, "-").concat(stepInx, " ").concat((step === null || step === void 0 ? void 0 : step.ongoing) ? '' : 'aa-hidden') },
|
|
2908
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { width: "10", height: "10", viewBox: "0 0 7 6", fill: "none" },
|
|
2909
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M6.34755 0.999929C6.67364 1.32601 6.67365 1.85471 6.34756 2.1808L4.79202 3.73638L3.23648 5.29196C3.07989 5.44856 2.8675 5.53653 2.64604 5.53653C2.42458 5.53653 2.21219 5.44855 2.0556 5.29196L0.50005 3.73636C0.173967 3.41026 0.173975 2.88157 0.500069 2.55549C0.826161 2.2294 1.35485 2.22941 1.68094 2.55551L2.64605 3.52065L5.16668 0.999945C5.49276 0.673852 6.02146 0.673846 6.34755 0.999929Z", fill: "#D4D4D4" })))),
|
|
2910
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "step-text-send-block ".concat(step.ongoing ? '' : 'aa-hidden') },
|
|
2911
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "step-actions-send-copy ".concat(!hideActionButtons ? '' : 'aa-hidden') },
|
|
2912
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "solidbtn aa-step-copy-btn ".concat(!hideCopyButton && (step === null || step === void 0 ? void 0 : step.isSendCopy) ? '' : 'aa-hidden') },
|
|
2913
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none" },
|
|
2914
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("g", { "clip-path": "url(#clip0_9531_13889)" },
|
|
2915
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("path", { d: "M10.6663 10.6667V12.5333C10.6663 13.2801 10.6663 13.6534 10.521 13.9387C10.3932 14.1895 10.1892 14.3935 9.93833 14.5214C9.65311 14.6667 9.27974 14.6667 8.53301 14.6667H3.46634C2.7196 14.6667 2.34624 14.6667 2.06102 14.5214C1.81014 14.3935 1.60616 14.1895 1.47833 13.9387C1.33301 13.6534 1.33301 13.2801 1.33301 12.5333V7.46668C1.33301 6.71994 1.33301 6.34657 1.47833 6.06136C1.60616 5.81047 1.81014 5.6065 2.06102 5.47867C2.34624 5.33334 2.7196 5.33334 3.46634 5.33334H5.33301M7.46634 10.6667H12.533C13.2797 10.6667 13.6531 10.6667 13.9383 10.5214C14.1892 10.3935 14.3932 10.1895 14.521 9.93866C14.6663 9.65345 14.6663 9.28008 14.6663 8.53334V3.46668C14.6663 2.71994 14.6663 2.34657 14.521 2.06136C14.3932 1.81047 14.1892 1.6065 13.9383 1.47867C13.6531 1.33334 13.2797 1.33334 12.533 1.33334H7.46634C6.7196 1.33334 6.34624 1.33334 6.06102 1.47867C5.81014 1.6065 5.60616 1.81047 5.47833 2.06136C5.33301 2.34657 5.33301 2.71994 5.33301 3.46668V8.53334C5.33301 9.28008 5.33301 9.65345 5.47833 9.93866C5.60616 10.1895 5.81014 10.3935 6.06102 10.5214C6.34624 10.6667 6.7196 10.6667 7.46634 10.6667Z", stroke: "#101828", "stroke-linecap": "round", "stroke-linejoin": "round" })),
|
|
2916
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("defs", null,
|
|
2917
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("clipPath", { id: "clip0_9531_13889" },
|
|
2918
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("rect", { width: "16", height: "16", fill: "white" }))))),
|
|
2919
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "solidbtn aa-step-send-btn ".concat(!hideSendButton && (step === null || step === void 0 ? void 0 : step.isSendCopy) ? '' : 'aa-hidden') }, (_b = (_a = props === null || props === void 0 ? void 0 : props.hostInstance) === null || _a === void 0 ? void 0 : _a.languagedata) === null || _b === void 0 ? void 0 : _b.SEND)),
|
|
2920
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("p", null, step.description),
|
|
2921
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "border-bottom-pad ".concat(((_c = step === null || step === void 0 ? void 0 : step.confirmButtons) === null || _c === void 0 ? void 0 : _c.length) > 0 ? '' : 'aa-hidden') },
|
|
2922
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "bottom-data-info" },
|
|
2923
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("h1", null),
|
|
2924
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "right-info-data" }, (_d = step === null || step === void 0 ? void 0 : step.confirmButtons) === null || _d === void 0 ? void 0 : _d.map(function (btn, btnInx) {
|
|
2925
|
-
var _a;
|
|
2926
|
-
var buttonStyle = {
|
|
2927
|
-
backgroundColor: (_a = props === null || props === void 0 ? void 0 : props.msgData) === null || _a === void 0 ? void 0 : _a.colors[btn.color],
|
|
2928
|
-
color: btn.color
|
|
2929
|
-
};
|
|
2930
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("button", { className: "_btn primaryBtn aa-step-confirmation-btn-".concat(btnInx), style: buttonStyle }, btn.title));
|
|
2931
|
-
})))))));
|
|
2932
|
-
})));
|
|
2933
|
-
})));
|
|
2934
|
-
}
|
|
2935
|
-
function Playbook(_a) {
|
|
2936
|
-
var hostInstance = _a.hostInstance;
|
|
2937
|
-
var _b = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useState)({}), allCheckListsData = _b[0], setAllCheckListData = _b[1];
|
|
2938
|
-
var _c = (0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useState)([]), triggeredDynCheckLists = _c[0], setTriggeredDynCheckLists = _c[1];
|
|
2939
|
-
var primaryCLList = [];
|
|
2940
|
-
var dynamicCLList = [];
|
|
2941
|
-
var currentStageIndex = 0;
|
|
2942
|
-
var rootServiceInstance = hostInstance.rootService;
|
|
2943
|
-
var languageData = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.languagedata;
|
|
2944
|
-
// clicking outside hide dropdown content (checklist, stage).
|
|
2945
|
-
var handleDropdownClickEvent = function () {
|
|
2946
|
-
window.onclick = function (event) {
|
|
2947
|
-
if (!event.target.matches('aa-stage-drp-wrapper')) {
|
|
2948
|
-
rootServiceInstance.hideDropdownTemplate('aa-stage-drp-wrapper', hostInstance);
|
|
2949
|
-
}
|
|
2950
|
-
if (!event.target.matches('aa-checklist-drp-wrapper')) {
|
|
2951
|
-
rootServiceInstance.hideDropdownTemplate('aa-checklist-drp-wrapper', hostInstance);
|
|
2952
|
-
}
|
|
2953
|
-
if (!event.target.matches('aa-triggerList-drp-wrapper')) {
|
|
2954
|
-
rootServiceInstance.hideDropdownTemplate('aa-triggerList-drp-wrapper', hostInstance);
|
|
2955
|
-
}
|
|
2956
|
-
};
|
|
2957
|
-
};
|
|
2958
|
-
(0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
2959
|
-
var _a, _b, _c;
|
|
2960
|
-
var triggerDropdownWrapperEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGER_CHECKLIST_DROPDOWN_WRAPPER));
|
|
2961
|
-
if ((triggeredDynCheckLists === null || triggeredDynCheckLists === void 0 ? void 0 : triggeredDynCheckLists.length) > 0) {
|
|
2962
|
-
(_b = triggerDropdownWrapperEle === null || triggerDropdownWrapperEle === void 0 ? void 0 : triggerDropdownWrapperEle.classList) === null || _b === void 0 ? void 0 : _b.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
2963
|
-
}
|
|
2964
|
-
else {
|
|
2965
|
-
(_c = triggerDropdownWrapperEle === null || triggerDropdownWrapperEle === void 0 ? void 0 : triggerDropdownWrapperEle.classList) === null || _c === void 0 ? void 0 : _c.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
2966
|
-
}
|
|
2967
|
-
updateTriggerChecklistCount(triggeredDynCheckLists);
|
|
2968
|
-
}, triggeredDynCheckLists);
|
|
2969
|
-
(0,preact_hooks__WEBPACK_IMPORTED_MODULE_2__.useEffect)(function () {
|
|
2970
|
-
var handleGetChecklistsData = (function (flag) {
|
|
2971
|
-
if (flag) {
|
|
2972
|
-
getAllChecklists();
|
|
2973
|
-
}
|
|
2974
|
-
});
|
|
2975
|
-
var handleChecklistResponse = function (checklistResponse) {
|
|
2976
|
-
if (checklistResponse && checklistResponse.checklistsIdentified) {
|
|
2977
|
-
(checklistResponse.checklistsIdentified || []).forEach(function (item) {
|
|
2978
|
-
var id = (item.checklistId || item.id || item._id);
|
|
2979
|
-
setTriggeredDynCheckLists(function (prevTriggeredDynChecklists) {
|
|
2980
|
-
var inx = prevTriggeredDynChecklists.findIndex(function (cl) { return cl._id === id; });
|
|
2981
|
-
if (inx < 0) {
|
|
2982
|
-
if (rootServiceInstance.dynClObjs[id]) {
|
|
2983
|
-
addTriggerChecklistItem(rootServiceInstance.dynClObjs[id], prevTriggeredDynChecklists === null || prevTriggeredDynChecklists === void 0 ? void 0 : prevTriggeredDynChecklists.length);
|
|
2984
|
-
var triggeredDynCheckLists_1 = __spreadArray(__spreadArray([], prevTriggeredDynChecklists, true), [(JSON.parse(JSON.stringify(rootServiceInstance.dynClObjs[id])))], false);
|
|
2985
|
-
return triggeredDynCheckLists_1;
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
return prevTriggeredDynChecklists;
|
|
2989
|
-
});
|
|
2990
|
-
});
|
|
2991
|
-
}
|
|
2992
|
-
};
|
|
2993
|
-
var handleChecklistStepResponse = function (checklistStepResponse) {
|
|
2994
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
2995
|
-
var clObj = checklistStepResponse === null || checklistStepResponse === void 0 ? void 0 : checklistStepResponse.checklistStepsIdentified;
|
|
2996
|
-
(clObj || [])
|
|
2997
|
-
.forEach(function (item) {
|
|
2998
|
-
var _a;
|
|
2999
|
-
var stage = {};
|
|
3000
|
-
var step = {};
|
|
3001
|
-
var clInx = prevCheckListsData.checklists.findIndex(function (cl) { return cl._id === item.id; });
|
|
3002
|
-
var stInx = (prevCheckListsData.checklists[clInx].stages || []).findIndex(function (s) {
|
|
3003
|
-
if (s._id === item.stageId) {
|
|
3004
|
-
stage = s;
|
|
3005
|
-
return true;
|
|
3006
|
-
}
|
|
3007
|
-
});
|
|
3008
|
-
var stepInx = (prevCheckListsData.checklists[clInx].stages[stInx].steps || []).findIndex(function (st) {
|
|
3009
|
-
if (st._id === item.stepId) {
|
|
3010
|
-
step = st;
|
|
3011
|
-
return true;
|
|
3012
|
-
}
|
|
3013
|
-
});
|
|
3014
|
-
if (stage.name === 'Close' && !rootServiceInstance.isProceedToClose) {
|
|
3015
|
-
var proceedToCloseBtn = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.PROCEEDTOCLOSE_BTN));
|
|
3016
|
-
handleCloseStage(false, proceedToCloseBtn);
|
|
3017
|
-
}
|
|
3018
|
-
stepComplete(prevCheckListsData, stage, step, clInx, stInx, stepInx, false, _constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ProjConstants.COACHING_ENGINE);
|
|
3019
|
-
});
|
|
3020
|
-
return prevCheckListsData;
|
|
3021
|
-
});
|
|
3022
|
-
};
|
|
3023
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.INTERNAL_EVENTS.GET_CHECKLISTS, handleGetChecklistsData);
|
|
3024
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.DATA_EVENTS.CHECKLIST_RESPONSE, handleChecklistResponse);
|
|
3025
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.DATA_EVENTS.CHECKLIST_STEP_RESPONSE, handleChecklistStepResponse);
|
|
3026
|
-
handleDropdownClickEvent();
|
|
3027
|
-
subscribeEvents();
|
|
3028
|
-
handleGetChecklistsData(true);
|
|
3029
|
-
return function () {
|
|
3030
|
-
hostInstance.off(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.INTERNAL_EVENTS.GET_CHECKLISTS, handleGetChecklistsData);
|
|
3031
|
-
hostInstance.off(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.DATA_EVENTS.CHECKLIST_RESPONSE, handleChecklistResponse);
|
|
3032
|
-
hostInstance.off(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.DATA_EVENTS.CHECKLIST_STEP_RESPONSE, handleChecklistStepResponse);
|
|
3033
|
-
};
|
|
3034
|
-
}, []);
|
|
3035
|
-
var subscribeEvents = function () {
|
|
3036
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS_TO_SDK.CHECKLIST_OPEN, function (data) {
|
|
3037
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_opened, data, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_OPENED_EVENT);
|
|
3038
|
-
});
|
|
3039
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS_TO_SDK.CHECLIST_RESUME, function (data) {
|
|
3040
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_resume, data, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_RESUME_EVENT);
|
|
3041
|
-
});
|
|
3042
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS_TO_SDK.CHECKLIST_STEP_CLOSE, function (data) {
|
|
3043
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_step_closed, data, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_STEP_CLOSED_EVENT);
|
|
3044
|
-
});
|
|
3045
|
-
hostInstance.on(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS_TO_SDK.CHECKLIST_PROCEED_TO_CLOSE, function (data) {
|
|
3046
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_proceed_to_closed, data, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_PROCEED_TO_CLOSE_EVENT);
|
|
3047
|
-
});
|
|
3048
|
-
};
|
|
3049
|
-
var emitEvents = function (eventName, checklistParams, sdkEventName) {
|
|
3050
|
-
hostInstance.socketConnection.emitEvents(eventName, checklistParams);
|
|
3051
|
-
hostInstance.emit(sdkEventName, checklistParams);
|
|
3052
|
-
};
|
|
3053
|
-
var getChecklistData = function () {
|
|
3054
|
-
var _a, _b, _c;
|
|
3055
|
-
var botId = rootServiceInstance.connectionDetails.botId;
|
|
3056
|
-
return (0,_utils_interceptor__WEBPACK_IMPORTED_MODULE_4__["default"])('get_checklist', {
|
|
3057
|
-
method: 'GET',
|
|
3058
|
-
headers: {
|
|
3059
|
-
'Content-Type': 'application/json',
|
|
3060
|
-
},
|
|
3061
|
-
}, hostInstance, { botId: botId, cId: (_a = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.connectionDetails) === null || _a === void 0 ? void 0 : _a.conversationId, pId: (_c = (_b = rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.internalTransferData) === null || _b === void 0 ? void 0 : _b.participant) === null || _c === void 0 ? void 0 : _c.identity });
|
|
3062
|
-
};
|
|
3063
|
-
var getAllChecklists = function () {
|
|
3064
|
-
getChecklistData()
|
|
3065
|
-
.then(function (data) {
|
|
3066
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
3067
|
-
var channel = rootServiceInstance.connectionDetails.channel;
|
|
3068
|
-
data.checklists = (_a = data === null || data === void 0 ? void 0 : data.checklists) === null || _a === void 0 ? void 0 : _a.filter(function (cL) { var _a; return (_a = cL === null || cL === void 0 ? void 0 : cL.channels) === null || _a === void 0 ? void 0 : _a.includes(channel); });
|
|
3069
|
-
if (((_b = data === null || data === void 0 ? void 0 : data.checklists) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
3070
|
-
checkAndPrepareCheckListData(data);
|
|
3071
|
-
dynamicCLList = data.checklists.filter(function (check) { return check.type === "dynamic"; });
|
|
3072
|
-
primaryCLList = data.checklists.filter(function (check) { return check.type === "primary"; });
|
|
3073
|
-
setAllCheckListData(data);
|
|
3074
|
-
prepareCheckListHeader(data, primaryCLList, dynamicCLList);
|
|
3075
|
-
rootServiceInstance.dynClObjs = (dynamicCLList || [])
|
|
3076
|
-
.reduce(function (acc, item) {
|
|
3077
|
-
acc[item._id] = item;
|
|
3078
|
-
return acc;
|
|
3079
|
-
}, {});
|
|
3080
|
-
rootServiceInstance.currCl = (_c = data === null || data === void 0 ? void 0 : data.currentState) === null || _c === void 0 ? void 0 : _c.playbookId;
|
|
3081
|
-
rootServiceInstance.currSt = (_d = data === null || data === void 0 ? void 0 : data.currentState) === null || _d === void 0 ? void 0 : _d.stageId;
|
|
3082
|
-
if (((_e = data === null || data === void 0 ? void 0 : data.currentState) === null || _e === void 0 ? void 0 : _e.playbookId) && ((_f = data === null || data === void 0 ? void 0 : data.currentState) === null || _f === void 0 ? void 0 : _f.stageId)) {
|
|
3083
|
-
rootServiceInstance.isPlaybookHistory = true;
|
|
3084
|
-
renderPlaybookHistory((_g = data === null || data === void 0 ? void 0 : data.currentState) === null || _g === void 0 ? void 0 : _g.playbookId, (_h = data === null || data === void 0 ? void 0 : data.currentState) === null || _h === void 0 ? void 0 : _h.stageId, data);
|
|
3085
|
-
return;
|
|
3086
|
-
}
|
|
3087
|
-
sendOpenCheckListEvent(primaryCLList, dynamicCLList);
|
|
3088
|
-
}
|
|
3089
|
-
else {
|
|
3090
|
-
var bodyTemplate = (_j = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _j === void 0 ? void 0 : _j.querySelector("#".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.IdMapConstant.CHECKLIST_BODY_TEMPLATE));
|
|
3091
|
-
var emptyPlaybookScreen = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderEmptyPlaybookScreen, { hostInstance: hostInstance }, hostInstance);
|
|
3092
|
-
if (bodyTemplate) {
|
|
3093
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, emptyPlaybookScreen, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_EMPTY_SCREEN, data: {} });
|
|
3094
|
-
bodyTemplate.append(emptyPlaybookScreen);
|
|
3095
|
-
}
|
|
3096
|
-
}
|
|
3097
|
-
})
|
|
3098
|
-
.catch(function (err) {
|
|
3099
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.ON_ERROR, _constants_errorcodes__WEBPACK_IMPORTED_MODULE_7__.ERROR_CODES['ERR_CHECKLIST_API_FAILURE']);
|
|
3100
|
-
});
|
|
3101
|
-
};
|
|
3102
|
-
var checkAndPrepareCheckListData = function (data) {
|
|
3103
|
-
data.checklists.forEach(function (cL) {
|
|
3104
|
-
var _a;
|
|
3105
|
-
(_a = cL === null || cL === void 0 ? void 0 : cL.stages) === null || _a === void 0 ? void 0 : _a.forEach(function (sL) {
|
|
3106
|
-
var _a;
|
|
3107
|
-
(_a = sL === null || sL === void 0 ? void 0 : sL.steps) === null || _a === void 0 ? void 0 : _a.forEach(function (step) {
|
|
3108
|
-
if (step === null || step === void 0 ? void 0 : step.isAdhered) {
|
|
3109
|
-
step.complete = true;
|
|
3110
|
-
cL.openedChecklist = true;
|
|
3111
|
-
sL.stageOpened = true;
|
|
3112
|
-
}
|
|
3113
|
-
});
|
|
3114
|
-
});
|
|
3115
|
-
});
|
|
3116
|
-
};
|
|
3117
|
-
// empty msg if primary checklist not present.
|
|
3118
|
-
var checkAndHideEmptyMsg = function () {
|
|
3119
|
-
var _a, _b, _c;
|
|
3120
|
-
var checkListEmptyEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_EMPTY));
|
|
3121
|
-
if (!((_b = checkListEmptyEle === null || checkListEmptyEle === void 0 ? void 0 : checkListEmptyEle.classList) === null || _b === void 0 ? void 0 : _b.contains(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT))) {
|
|
3122
|
-
(_c = checkListEmptyEle === null || checkListEmptyEle === void 0 ? void 0 : checkListEmptyEle.classList) === null || _c === void 0 ? void 0 : _c.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3123
|
-
}
|
|
3124
|
-
};
|
|
3125
|
-
var renderPlaybookHistory = function (currCl, currSt, data) {
|
|
3126
|
-
var _a, _b, _c;
|
|
3127
|
-
if (currCl && currSt) {
|
|
3128
|
-
var channel = rootServiceInstance.connectionDetails.channel;
|
|
3129
|
-
var checkList_1 = data.checklists.find(function (cl) { return cl._id === currCl; });
|
|
3130
|
-
var checkListIndex_1 = data.checklists.findIndex(function (cl) { return cl._id === currCl; });
|
|
3131
|
-
currentStageIndex = (_a = checkList_1 === null || checkList_1 === void 0 ? void 0 : checkList_1.stages) === null || _a === void 0 ? void 0 : _a.findIndex(function (st) { return (st === null || st === void 0 ? void 0 : st._id) === currSt; });
|
|
3132
|
-
if (((_b = checkList_1 === null || checkList_1 === void 0 ? void 0 : checkList_1.channels) === null || _b === void 0 ? void 0 : _b.includes(channel)) && (checkList_1 === null || checkList_1 === void 0 ? void 0 : checkList_1.type) === 'primary') {
|
|
3133
|
-
sendOpenCheckListEvent(primaryCLList, dynamicCLList, currentStageIndex, 'primary');
|
|
3134
|
-
}
|
|
3135
|
-
else if (((_c = checkList_1 === null || checkList_1 === void 0 ? void 0 : checkList_1.channels) === null || _c === void 0 ? void 0 : _c.includes(channel)) && (checkList_1 === null || checkList_1 === void 0 ? void 0 : checkList_1.type) === 'dynamic') {
|
|
3136
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3137
|
-
if (checkListIndex_1 >= 0) {
|
|
3138
|
-
rootServiceInstance.selCLInx = checkListIndex_1;
|
|
3139
|
-
selectDynCl(prevCheckListsData, checkList_1, checkListIndex_1);
|
|
3140
|
-
}
|
|
3141
|
-
return prevCheckListsData;
|
|
3142
|
-
});
|
|
3143
|
-
}
|
|
3144
|
-
rootServiceInstance.isPlaybookHistory = false;
|
|
3145
|
-
}
|
|
3146
|
-
};
|
|
3147
|
-
// preparing header template of playbook.
|
|
3148
|
-
var prepareCheckListHeader = function (prevCheckListsData, primaryChecklist, dynamicChecklist) {
|
|
3149
|
-
var _a, _b, _c, _d, _e;
|
|
3150
|
-
var checklistHeaderEle = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderPlaybookHeader, { hostInstance: hostInstance, checklistData: prevCheckListsData }, hostInstance);
|
|
3151
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, checklistHeaderEle, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_HEADER_TEMPLATE, data: { checklists: prevCheckListsData.checklists } });
|
|
3152
|
-
(_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.IdMapConstant.CHECKLIST_MAIN_TEMPLATE)).prepend(checklistHeaderEle);
|
|
3153
|
-
var checklistDropdownWrapperEle = checklistHeaderEle === null || checklistHeaderEle === void 0 ? void 0 : checklistHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_DROPDOWN_WRAPPER));
|
|
3154
|
-
var stageDropdwonWrapperEle = checklistHeaderEle === null || checklistHeaderEle === void 0 ? void 0 : checklistHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.STAGE_DRP_WRAPPER));
|
|
3155
|
-
var triggerDropdownWrapperEle = checklistHeaderEle === null || checklistHeaderEle === void 0 ? void 0 : checklistHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGER_CHECKLIST_DROPDOWN_WRAPPER));
|
|
3156
|
-
if ((primaryChecklist === null || primaryChecklist === void 0 ? void 0 : primaryChecklist.length) > 0) {
|
|
3157
|
-
var primaryChecklistDropdownEle = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderEachPrimaryChecklistItem, { hostInstance: hostInstance, primaryChecklists: primaryChecklist, allChecklists: prevCheckListsData.checklists }, hostInstance);
|
|
3158
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, primaryChecklistDropdownEle, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_PRIMARYLIST_TEMPLATE, data: { checklists: prevCheckListsData.checklists, primaryChecklist: primaryChecklist } });
|
|
3159
|
-
checklistHeaderEle === null || checklistHeaderEle === void 0 ? void 0 : checklistHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_DROPDOWN)).append(primaryChecklistDropdownEle);
|
|
3160
|
-
}
|
|
3161
|
-
if ((dynamicChecklist === null || dynamicChecklist === void 0 ? void 0 : dynamicChecklist.length) > 0) {
|
|
3162
|
-
var dynamicChecklistDropdownEle = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderEachDynamicChecklistItem, { hostInstance: hostInstance, dynamicChecklists: dynamicChecklist, allChecklists: prevCheckListsData.checklists }, hostInstance);
|
|
3163
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, dynamicChecklistDropdownEle, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_DYNAMICLIST_TEMPLATE, data: { checklists: prevCheckListsData.checklists, dynamicChecklist: dynamicChecklist } });
|
|
3164
|
-
checklistHeaderEle === null || checklistHeaderEle === void 0 ? void 0 : checklistHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_DROPDOWN)).append(dynamicChecklistDropdownEle);
|
|
3165
|
-
}
|
|
3166
|
-
if ((primaryChecklist === null || primaryChecklist === void 0 ? void 0 : primaryChecklist.length) || (dynamicChecklist === null || dynamicChecklist === void 0 ? void 0 : dynamicChecklist.length)) {
|
|
3167
|
-
(_b = checklistDropdownWrapperEle === null || checklistDropdownWrapperEle === void 0 ? void 0 : checklistDropdownWrapperEle.classList) === null || _b === void 0 ? void 0 : _b.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3168
|
-
prevCheckListsData === null || prevCheckListsData === void 0 ? void 0 : prevCheckListsData.checklists.map(function (cl, clInx) {
|
|
3169
|
-
var _a;
|
|
3170
|
-
var clsName = cl.type === 'primary' ? _constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.PRIMARY_CHECKLIST_BTN : _constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.DYNAMIC_CHECKLIST_BTN;
|
|
3171
|
-
(_a = hostInstance.eventManager) === null || _a === void 0 ? void 0 : _a.addEventListener("".concat(clsName).concat(clInx), 'click', function () {
|
|
3172
|
-
var _a;
|
|
3173
|
-
(_a = checklistDropdownWrapperEle === null || checklistDropdownWrapperEle === void 0 ? void 0 : checklistDropdownWrapperEle.classList) === null || _a === void 0 ? void 0 : _a.remove('show');
|
|
3174
|
-
handleChecklistClickEvent(prevCheckListsData, cl);
|
|
3175
|
-
}, checklistHeaderEle);
|
|
3176
|
-
});
|
|
3177
|
-
}
|
|
3178
|
-
(_c = hostInstance.eventManager) === null || _c === void 0 ? void 0 : _c.addEventListener(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.SELECTED_CHECKLIST_ARROW, 'click', function () {
|
|
3179
|
-
var _a;
|
|
3180
|
-
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
3181
|
-
(_a = checklistDropdownWrapperEle === null || checklistDropdownWrapperEle === void 0 ? void 0 : checklistDropdownWrapperEle.classList) === null || _a === void 0 ? void 0 : _a.toggle('show');
|
|
3182
|
-
}, checklistDropdownWrapperEle);
|
|
3183
|
-
(_d = hostInstance.eventManager) === null || _d === void 0 ? void 0 : _d.addEventListener(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.SELECTED_STAGE_ARROW, 'click', function () {
|
|
3184
|
-
var _a;
|
|
3185
|
-
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
3186
|
-
(_a = stageDropdwonWrapperEle === null || stageDropdwonWrapperEle === void 0 ? void 0 : stageDropdwonWrapperEle.classList) === null || _a === void 0 ? void 0 : _a.toggle('show');
|
|
3187
|
-
}, stageDropdwonWrapperEle);
|
|
3188
|
-
(_e = hostInstance.eventManager) === null || _e === void 0 ? void 0 : _e.addEventListener(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGER_CHECKLIST_COUNT_BTN, 'click', function () {
|
|
3189
|
-
var _a;
|
|
3190
|
-
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
3191
|
-
(_a = triggerDropdownWrapperEle === null || triggerDropdownWrapperEle === void 0 ? void 0 : triggerDropdownWrapperEle.classList) === null || _a === void 0 ? void 0 : _a.toggle('show');
|
|
3192
|
-
}, checklistHeaderEle);
|
|
3193
|
-
};
|
|
3194
|
-
// open primary checklist bydefault if present.
|
|
3195
|
-
var sendOpenCheckListEvent = function (primaryClList, dynamicClist, sTIndex, checklistType) {
|
|
3196
|
-
var _a, _b, _c, _d;
|
|
3197
|
-
if (sTIndex === void 0) { sTIndex = 0; }
|
|
3198
|
-
if (checklistType === void 0) { checklistType = 'primary'; }
|
|
3199
|
-
var checkListHeaderEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_HEADER));
|
|
3200
|
-
if ((primaryClList === null || primaryClList === void 0 ? void 0 : primaryClList.length) > 0) {
|
|
3201
|
-
var channel = rootServiceInstance.connectionDetails.channel;
|
|
3202
|
-
if ((_c = (_b = primaryClList[0]) === null || _b === void 0 ? void 0 : _b.channels) === null || _c === void 0 ? void 0 : _c.includes(channel)) {
|
|
3203
|
-
rootServiceInstance.proceedToClose = true;
|
|
3204
|
-
if (!sTIndex) {
|
|
3205
|
-
getCheckListIndex(primaryCLList[0]);
|
|
3206
|
-
handleProceedToCloseBtn(checkListHeaderEle, true, true);
|
|
3207
|
-
}
|
|
3208
|
-
else {
|
|
3209
|
-
getCheckListIndex(primaryClList[0], sTIndex);
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
}
|
|
3213
|
-
else if ((dynamicClist === null || dynamicClist === void 0 ? void 0 : dynamicClist.length) > 0) {
|
|
3214
|
-
var bodyTemplate = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelector("#".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.IdMapConstant.CHECKLIST_BODY_TEMPLATE));
|
|
3215
|
-
var checklistEmptyMsgEle = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderEmptyPlaybookMsg, { hostInstance: hostInstance }, hostInstance);
|
|
3216
|
-
if (bodyTemplate) {
|
|
3217
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, checklistEmptyMsgEle, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_EMPTY_TEMPLATE, data: { primaryClList: primaryClList, dynamicClist: dynamicClist } });
|
|
3218
|
-
bodyTemplate.append(checklistEmptyMsgEle);
|
|
3219
|
-
}
|
|
3220
|
-
updateChecklistName(checkListHeaderEle, "".concat(languageData === null || languageData === void 0 ? void 0 : languageData.PLAYBOOK_EMPTY_MSG), -1);
|
|
3221
|
-
}
|
|
3222
|
-
};
|
|
3223
|
-
var proceedToCloseButtonClick = function (sendEvent) {
|
|
3224
|
-
if (sendEvent === void 0) { sendEvent = false; }
|
|
3225
|
-
var obj = {
|
|
3226
|
-
stageId: '',
|
|
3227
|
-
id: ''
|
|
3228
|
-
};
|
|
3229
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3230
|
-
prevCheckListsData.checklists.forEach(function (item, index) {
|
|
3231
|
-
var _a;
|
|
3232
|
-
if (item.type === 'primary') {
|
|
3233
|
-
updateResumeBtnStatus(prevCheckListsData.checklists, index);
|
|
3234
|
-
obj['stageId'] = item.stages[1]._id;
|
|
3235
|
-
obj['id'] = item._id;
|
|
3236
|
-
rootServiceInstance.selCLInx = index;
|
|
3237
|
-
rootServiceInstance.selStInx = 1;
|
|
3238
|
-
rootServiceInstance.isProceedToClose = true;
|
|
3239
|
-
rootServiceInstance.selectNextStep(prevCheckListsData, index, 1, hostInstance);
|
|
3240
|
-
var checkListHeaderEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_HEADER));
|
|
3241
|
-
updateChecklistName(checkListHeaderEle, item.name, index);
|
|
3242
|
-
prepareAndUpdateStageDropdown(checkListHeaderEle, item === null || item === void 0 ? void 0 : item.stages, 1);
|
|
3243
|
-
updateChecklistBodyTemplate(prevCheckListsData, rootServiceInstance.selCLInx);
|
|
3244
|
-
updateStepNumberInfo();
|
|
3245
|
-
}
|
|
3246
|
-
});
|
|
3247
|
-
if (sendEvent) {
|
|
3248
|
-
var checklistParams = rootServiceInstance.prepareChecklistPayload(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_proceed_to_closed, prevCheckListsData, obj);
|
|
3249
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_proceed_to_closed, checklistParams, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_PROCEED_TO_CLOSE_EVENT);
|
|
3250
|
-
}
|
|
3251
|
-
return prevCheckListsData;
|
|
3252
|
-
});
|
|
3253
|
-
};
|
|
3254
|
-
var handleProceedToCloseBtn = function (checklistHeaderEle, show, clickEvent, stType) {
|
|
3255
|
-
var _a;
|
|
3256
|
-
if (stType === void 0) { stType = ''; }
|
|
3257
|
-
var proceedToClostBtn = checklistHeaderEle === null || checklistHeaderEle === void 0 ? void 0 : checklistHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.PROCEEDTOCLOSE_BTN));
|
|
3258
|
-
if (show) {
|
|
3259
|
-
proceedToClostBtn === null || proceedToClostBtn === void 0 ? void 0 : proceedToClostBtn.classList.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3260
|
-
}
|
|
3261
|
-
else {
|
|
3262
|
-
proceedToClostBtn === null || proceedToClostBtn === void 0 ? void 0 : proceedToClostBtn.classList.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3263
|
-
}
|
|
3264
|
-
if (clickEvent) {
|
|
3265
|
-
(_a = hostInstance.eventManager) === null || _a === void 0 ? void 0 : _a.addEventListener(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.PROCEEDTOCLOSE_BTN, 'click', function (e) {
|
|
3266
|
-
handleCloseStage(true, proceedToClostBtn);
|
|
3267
|
-
}, checklistHeaderEle);
|
|
3268
|
-
}
|
|
3269
|
-
if (stType === 'Close') {
|
|
3270
|
-
handleCloseStage(true, proceedToClostBtn);
|
|
3271
|
-
}
|
|
3272
|
-
};
|
|
3273
|
-
var handleCloseStage = function (flag, proceedToClostBtn) {
|
|
3274
|
-
var _a, _b, _c, _d, _e;
|
|
3275
|
-
proceedToCloseButtonClick(flag);
|
|
3276
|
-
proceedToClostBtn.classList.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3277
|
-
(_c = (_b = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_CLOSE_STAGE)) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3278
|
-
(_e = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelectorAll(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_CLOSE_STEPS)) === null || _e === void 0 ? void 0 : _e.forEach(function (el) { var _a; return (_a = el === null || el === void 0 ? void 0 : el.classList) === null || _a === void 0 ? void 0 : _a.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT); });
|
|
3279
|
-
};
|
|
3280
|
-
// end of proceed to close btn logic
|
|
3281
|
-
//checklist related logic (resume and update checklist);
|
|
3282
|
-
var getCheckListIndex = function (clT, sTIndex, flag) {
|
|
3283
|
-
if (sTIndex === void 0) { sTIndex = 0; }
|
|
3284
|
-
if (flag === void 0) { flag = false; }
|
|
3285
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3286
|
-
var _a, _b, _c;
|
|
3287
|
-
var index = (_a = prevCheckListsData === null || prevCheckListsData === void 0 ? void 0 : prevCheckListsData.checklists) === null || _a === void 0 ? void 0 : _a.findIndex(function (obj) { return obj._id == clT._id; });
|
|
3288
|
-
if (index >= 0) {
|
|
3289
|
-
updateCheckList(prevCheckListsData, index, sTIndex, flag);
|
|
3290
|
-
if (!sTIndex) {
|
|
3291
|
-
updateChecklistBodyTemplate(prevCheckListsData, index);
|
|
3292
|
-
}
|
|
3293
|
-
if (!prevCheckListsData.checklists[index].openedChecklist && !rootServiceInstance.isPlaybookHistory) {
|
|
3294
|
-
prevCheckListsData.checklists[index].openedChecklist = true;
|
|
3295
|
-
var stageId = ((_c = (_b = prevCheckListsData === null || prevCheckListsData === void 0 ? void 0 : prevCheckListsData.checklists[index]) === null || _b === void 0 ? void 0 : _b.stages[rootServiceInstance.selStInx]) === null || _c === void 0 ? void 0 : _c._id) || '';
|
|
3296
|
-
var checklistParams = rootServiceInstance.prepareChecklistPayload(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_opened, prevCheckListsData, { "id": clT._id }, false, stageId);
|
|
3297
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_opened, checklistParams, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_OPENED_EVENT);
|
|
3298
|
-
}
|
|
3299
|
-
updateStepNumberInfo();
|
|
3300
|
-
}
|
|
3301
|
-
return prevCheckListsData;
|
|
3302
|
-
});
|
|
3303
|
-
};
|
|
3304
|
-
var updateCheckList = function (prevCheckListsData, clInx, sTIndex, flag) {
|
|
3305
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
3306
|
-
if (sTIndex === void 0) { sTIndex = 0; }
|
|
3307
|
-
if (flag === void 0) { flag = false; }
|
|
3308
|
-
var checklists = prevCheckListsData.checklists;
|
|
3309
|
-
var selStInx = ((_b = (_a = checklists[clInx]) === null || _a === void 0 ? void 0 : _a.stages) === null || _b === void 0 ? void 0 : _b.length) ? sTIndex : -1;
|
|
3310
|
-
rootServiceInstance.selCLInx = clInx;
|
|
3311
|
-
rootServiceInstance.selStInx = selStInx;
|
|
3312
|
-
if (((_d = (_c = checklists[clInx]) === null || _c === void 0 ? void 0 : _c.stages[selStInx]) === null || _d === void 0 ? void 0 : _d.steps[0]) && !(rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.isPlaybookHistory)) {
|
|
3313
|
-
checklists[clInx].stages[selStInx].steps[0].ongoing = true;
|
|
3314
|
-
rootServiceInstance.selSpInx = 0;
|
|
3315
|
-
var stepId = checklists[clInx].stages[selStInx].steps[0]._id;
|
|
3316
|
-
rootServiceInstance.scrollView(stepId, hostInstance);
|
|
3317
|
-
}
|
|
3318
|
-
if ((rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.currSt) && ((rootServiceInstance === null || rootServiceInstance === void 0 ? void 0 : rootServiceInstance.isPlaybookHistory) || flag)) {
|
|
3319
|
-
if (selStInx === 1) {
|
|
3320
|
-
handleProceedToCloseBtn((_e = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _e === void 0 ? void 0 : _e.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_HEADER)), false, false, 'Close');
|
|
3321
|
-
}
|
|
3322
|
-
updateStepNumberInfo();
|
|
3323
|
-
rootServiceInstance.selectNextStage(prevCheckListsData, clInx, selStInx, hostInstance);
|
|
3324
|
-
rootServiceInstance.checkAllStagesCompleted(prevCheckListsData, checklists[clInx]._id, hostInstance);
|
|
3325
|
-
}
|
|
3326
|
-
var checkListHeaderEle = (_f = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _f === void 0 ? void 0 : _f.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_HEADER));
|
|
3327
|
-
updateChecklistName(checkListHeaderEle, checklists[clInx].name, clInx);
|
|
3328
|
-
prepareAndUpdateStageDropdown(checkListHeaderEle, (_g = checklists[clInx]) === null || _g === void 0 ? void 0 : _g.stages, selStInx);
|
|
3329
|
-
};
|
|
3330
|
-
var updateChecklistName = function (checkListHeaderEle, name, clInx) {
|
|
3331
|
-
var _a, _b;
|
|
3332
|
-
var selectedChecklistSpan = checkListHeaderEle === null || checkListHeaderEle === void 0 ? void 0 : checkListHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.SELECTED_CHECKLIST));
|
|
3333
|
-
if (selectedChecklistSpan) {
|
|
3334
|
-
selectedChecklistSpan.innerText = name;
|
|
3335
|
-
}
|
|
3336
|
-
(_b = (_a = checkListHeaderEle === null || checkListHeaderEle === void 0 ? void 0 : checkListHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_ITEM_CHECK).concat(clInx))) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3337
|
-
};
|
|
3338
|
-
var updateChecklistBodyTemplate = function (prevCheckListsData, index) {
|
|
3339
|
-
var _a, _b, _c;
|
|
3340
|
-
var bodyTemplate = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("#".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.IdMapConstant.CHECKLIST_STEP_TEMPLATE));
|
|
3341
|
-
var checklistBodyEle = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderChecklistBody, { hostInstance: hostInstance, stages: (_b = prevCheckListsData.checklists[index]) === null || _b === void 0 ? void 0 : _b.stages, colors: _constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.PlaybookColorMap }, hostInstance);
|
|
3342
|
-
if (bodyTemplate) {
|
|
3343
|
-
bodyTemplate.innerHTML = '';
|
|
3344
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, checklistBodyEle, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_BODY_TEMPLATE, data: { stages: (_c = prevCheckListsData.checklists[index]) === null || _c === void 0 ? void 0 : _c.stages, colors: _constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.PlaybookColorMap } });
|
|
3345
|
-
bodyTemplate.append(checklistBodyEle);
|
|
3346
|
-
}
|
|
3347
|
-
if (checklistBodyEle) {
|
|
3348
|
-
handleStepClickEvents(checklistBodyEle, prevCheckListsData, index);
|
|
3349
|
-
}
|
|
3350
|
-
};
|
|
3351
|
-
var handleChecklistClickEvent = function (prevCheckListsData, clT) {
|
|
3352
|
-
var index = prevCheckListsData.checklists.findIndex(function (obj) { return obj._id == clT._id; });
|
|
3353
|
-
if (prevCheckListsData.checklists[index]) {
|
|
3354
|
-
resumeAndUpdateCheckList(index);
|
|
3355
|
-
}
|
|
3356
|
-
};
|
|
3357
|
-
var resumeAndUpdateCheckList = function (i) {
|
|
3358
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3359
|
-
var _a, _b, _c, _d, _e, _f;
|
|
3360
|
-
var checklists = prevCheckListsData.checklists;
|
|
3361
|
-
if (((_a = checklists[i]) === null || _a === void 0 ? void 0 : _a.openedChecklist) && ((_b = checklists[i]) === null || _b === void 0 ? void 0 : _b.name) === checklists[rootServiceInstance.selCLInx].name && rootServiceInstance.isPlaybookHistory) {
|
|
3362
|
-
getCheckListIndex(checklists[i]);
|
|
3363
|
-
}
|
|
3364
|
-
updateResumeBtnStatus(checklists, i);
|
|
3365
|
-
if (!checklists[i].openedChecklist) {
|
|
3366
|
-
getCheckListIndex(checklists[i]);
|
|
3367
|
-
}
|
|
3368
|
-
else if (checklists[i].name != checklists[rootServiceInstance.selCLInx].name) {
|
|
3369
|
-
if (((_c = checklists[i]) === null || _c === void 0 ? void 0 : _c.type) === 'primary') {
|
|
3370
|
-
var isCloseStageOpened = (_e = (_d = checklists[i]) === null || _d === void 0 ? void 0 : _d.stages[1]) === null || _e === void 0 ? void 0 : _e.stageOpened;
|
|
3371
|
-
if (!isCloseStageOpened) {
|
|
3372
|
-
handleProceedToCloseBtn((_f = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _f === void 0 ? void 0 : _f.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_HEADER)), true, true);
|
|
3373
|
-
}
|
|
3374
|
-
getCheckListIndex(checklists[i], isCloseStageOpened ? 1 : 0, true);
|
|
3375
|
-
checkListResume(prevCheckListsData, i, isCloseStageOpened ? 1 : 0, isCloseStageOpened);
|
|
3376
|
-
rootServiceInstance.selectNextStage(prevCheckListsData, i, isCloseStageOpened ? 1 : 0, hostInstance);
|
|
3377
|
-
updateStepNumberInfo();
|
|
3378
|
-
checkAndHideEmptyMsg();
|
|
3379
|
-
return prevCheckListsData;
|
|
3380
|
-
}
|
|
3381
|
-
rootServiceInstance.selCLInx = i;
|
|
3382
|
-
rootServiceInstance.selStInx = 0;
|
|
3383
|
-
checkListResume(prevCheckListsData, i, 0);
|
|
3384
|
-
rootServiceInstance.selectNextStage(prevCheckListsData, i, 0, hostInstance);
|
|
3385
|
-
updateStepNumberInfo();
|
|
3386
|
-
}
|
|
3387
|
-
checkAndHideEmptyMsg();
|
|
3388
|
-
return prevCheckListsData;
|
|
3389
|
-
});
|
|
3390
|
-
};
|
|
3391
|
-
var updateResumeBtnStatus = function (checklists, currentClIndex) {
|
|
3392
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
3393
|
-
var prevCLIndex = rootServiceInstance.selCLInx;
|
|
3394
|
-
if (currentClIndex != prevCLIndex && !((_a = checklists[prevCLIndex]) === null || _a === void 0 ? void 0 : _a.completed) && ((_b = checklists[prevCLIndex]) === null || _b === void 0 ? void 0 : _b.openedChecklist)) {
|
|
3395
|
-
(_d = (_c = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _c === void 0 ? void 0 : _c.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_EACH_RESUME).concat(prevCLIndex))) === null || _d === void 0 ? void 0 : _d.classList.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3396
|
-
(_f = (_e = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _e === void 0 ? void 0 : _e.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_ITEM_CHECK).concat(prevCLIndex))) === null || _f === void 0 ? void 0 : _f.classList.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3397
|
-
}
|
|
3398
|
-
else if (currentClIndex != prevCLIndex && ((_g = checklists[prevCLIndex]) === null || _g === void 0 ? void 0 : _g.completed)) {
|
|
3399
|
-
(_j = (_h = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _h === void 0 ? void 0 : _h.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_ITEM_CHECK).concat(prevCLIndex))) === null || _j === void 0 ? void 0 : _j.classList.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3400
|
-
}
|
|
3401
|
-
var currentResumeBtn = (_k = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _k === void 0 ? void 0 : _k.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_EACH_RESUME).concat(currentClIndex));
|
|
3402
|
-
if (!((_l = currentResumeBtn === null || currentResumeBtn === void 0 ? void 0 : currentResumeBtn.classList) === null || _l === void 0 ? void 0 : _l.contains(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT))) {
|
|
3403
|
-
(_m = currentResumeBtn === null || currentResumeBtn === void 0 ? void 0 : currentResumeBtn.classList) === null || _m === void 0 ? void 0 : _m.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3404
|
-
}
|
|
3405
|
-
};
|
|
3406
|
-
var checkListResume = function (prevCheckListsData, i, stInx, flag) {
|
|
3407
|
-
var _a, _b, _c, _d;
|
|
3408
|
-
if (flag === void 0) { flag = false; }
|
|
3409
|
-
rootServiceInstance.isProceedToClose = flag;
|
|
3410
|
-
if (!flag) {
|
|
3411
|
-
var checkListHeaderEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_HEADER));
|
|
3412
|
-
updateChecklistName(checkListHeaderEle, prevCheckListsData.checklists[i].name, i);
|
|
3413
|
-
prepareAndUpdateStageDropdown(checkListHeaderEle, (_b = prevCheckListsData.checklists[i]) === null || _b === void 0 ? void 0 : _b.stages, stInx);
|
|
3414
|
-
updateChecklistBodyTemplate(prevCheckListsData, i);
|
|
3415
|
-
rootServiceInstance.showProceedToCloseBtn(hostInstance);
|
|
3416
|
-
}
|
|
3417
|
-
var cl = prevCheckListsData.checklists[i];
|
|
3418
|
-
var stageId = ((_d = (_c = prevCheckListsData === null || prevCheckListsData === void 0 ? void 0 : prevCheckListsData.checklists[i]) === null || _c === void 0 ? void 0 : _c.stages[stInx]) === null || _d === void 0 ? void 0 : _d._id) || '';
|
|
3419
|
-
var checklistParams = rootServiceInstance.prepareChecklistPayload(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_resume, prevCheckListsData, { "id": cl._id }, false, stageId);
|
|
3420
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_resume, checklistParams, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_RESUME_EVENT);
|
|
3421
|
-
};
|
|
3422
|
-
// end of checklist logic
|
|
3423
|
-
// stage related logic (stage selection)
|
|
3424
|
-
var prepareAndUpdateStageDropdown = function (checkListHeaderEle, stageList, stageInx) {
|
|
3425
|
-
var _a, _b, _c;
|
|
3426
|
-
var stageName = stageList[stageInx].name;
|
|
3427
|
-
var stageDropdownWrapper = checkListHeaderEle === null || checkListHeaderEle === void 0 ? void 0 : checkListHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.STAGE_DRP_WRAPPER_MAIN));
|
|
3428
|
-
var selectedStageSpan = checkListHeaderEle === null || checkListHeaderEle === void 0 ? void 0 : checkListHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.SELECTED_STAGE));
|
|
3429
|
-
var stageDropdown = checkListHeaderEle === null || checkListHeaderEle === void 0 ? void 0 : checkListHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.STAGE_DROPDOWN));
|
|
3430
|
-
(_a = stageDropdownWrapper === null || stageDropdownWrapper === void 0 ? void 0 : stageDropdownWrapper.classList) === null || _a === void 0 ? void 0 : _a.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3431
|
-
if (selectedStageSpan) {
|
|
3432
|
-
selectedStageSpan.innerText = stageName;
|
|
3433
|
-
}
|
|
3434
|
-
var stageDropdownEle = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderEachStageItem, { hostInstance: hostInstance, stageList: stageList, selectedStInx: stageInx, isProceedToClose: rootServiceInstance.isProceedToClose }, hostInstance);
|
|
3435
|
-
if (stageDropdownEle) {
|
|
3436
|
-
stageDropdown.innerHTML = '';
|
|
3437
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, stageDropdownEle, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_STAGE_DROPDOWN_TEMPLATE, data: { stageList: stageList, selectedStInx: stageInx, isProceedToClose: rootServiceInstance.isProceedToClose } });
|
|
3438
|
-
stageDropdown.append(stageDropdownEle);
|
|
3439
|
-
}
|
|
3440
|
-
var stageDropdownIcon = checkListHeaderEle === null || checkListHeaderEle === void 0 ? void 0 : checkListHeaderEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.SELECTED_STAGE_ARROW));
|
|
3441
|
-
if (stageDropdownIcon) {
|
|
3442
|
-
(stageList === null || stageList === void 0 ? void 0 : stageList.length) <= 1 ? stageDropdownIcon.classList.add(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT) : stageDropdownIcon.classList.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3443
|
-
}
|
|
3444
|
-
if (rootServiceInstance.isProceedToClose) {
|
|
3445
|
-
(_c = (_b = stageDropdownEle === null || stageDropdownEle === void 0 ? void 0 : stageDropdownEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_CLOSE_STAGE_BTN))) === null || _b === void 0 ? void 0 : _b.classList) === null || _c === void 0 ? void 0 : _c.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_DISABLE_MSG);
|
|
3446
|
-
}
|
|
3447
|
-
stageList === null || stageList === void 0 ? void 0 : stageList.map(function (stage, stInx) {
|
|
3448
|
-
var _a;
|
|
3449
|
-
(_a = hostInstance.eventManager) === null || _a === void 0 ? void 0 : _a.addEventListener("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_EACH_STAGE_DRP_ITEM).concat(stInx), 'click', function () {
|
|
3450
|
-
rootServiceInstance.selStInx = stInx;
|
|
3451
|
-
updateStepNumberInfo();
|
|
3452
|
-
handleStageDropdownClickEvent(stageDropdownEle, stInx, stageList);
|
|
3453
|
-
}, stageDropdownEle);
|
|
3454
|
-
});
|
|
3455
|
-
setAllCheckListData(function (prevCheckListData) {
|
|
3456
|
-
var _a, _b;
|
|
3457
|
-
var checklists = prevCheckListData.checklists;
|
|
3458
|
-
if (!(((_a = checklists[rootServiceInstance.selCLInx]) === null || _a === void 0 ? void 0 : _a.type) == 'primary' && checklists[rootServiceInstance.selCLInx].stages[rootServiceInstance.selStInx].name == 'Close')) {
|
|
3459
|
-
rootServiceInstance.isProceedToClose = false;
|
|
3460
|
-
rootServiceInstance.showProceedToCloseBtn(hostInstance);
|
|
3461
|
-
handleProceedToCloseBtn((_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_HEADER)), true, true);
|
|
3462
|
-
}
|
|
3463
|
-
return prevCheckListData;
|
|
3464
|
-
});
|
|
3465
|
-
};
|
|
3466
|
-
var handleStageDropdownClickEvent = function (stageDropdownEle, stInx, stageList) {
|
|
3467
|
-
rootServiceInstance.handleStageCheck(stageDropdownEle, stInx, stageList, hostInstance);
|
|
3468
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3469
|
-
rootServiceInstance.selectStage(prevCheckListsData, rootServiceInstance.selCLInx, stInx, hostInstance);
|
|
3470
|
-
return prevCheckListsData;
|
|
3471
|
-
});
|
|
3472
|
-
};
|
|
3473
|
-
// end of stage selection logic.
|
|
3474
|
-
// step related logic (step selection, step ongoing, step complete etc...)
|
|
3475
|
-
var handleStepClickEvents = function (currentChecklistEle, prevCheckListsData, clIndex) {
|
|
3476
|
-
var _a, _b;
|
|
3477
|
-
(_b = (_a = prevCheckListsData.checklists[clIndex]) === null || _a === void 0 ? void 0 : _a.stages) === null || _b === void 0 ? void 0 : _b.map(function (stage, stInx) {
|
|
3478
|
-
var _a;
|
|
3479
|
-
(_a = stage === null || stage === void 0 ? void 0 : stage.steps) === null || _a === void 0 ? void 0 : _a.map(function (step, stepInx) {
|
|
3480
|
-
var _a, _b, _c, _d, _e;
|
|
3481
|
-
var eachPlaybookStep = currentChecklistEle === null || currentChecklistEle === void 0 ? void 0 : currentChecklistEle.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_EACH_STEP).concat(stInx, "-").concat(stepInx));
|
|
3482
|
-
(_a = hostInstance.eventManager) === null || _a === void 0 ? void 0 : _a.addEventListener("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_EACH_STEP).concat(stInx, "-").concat(stepInx), 'click', function (e) {
|
|
3483
|
-
if (!step.complete) {
|
|
3484
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3485
|
-
rootServiceInstance.clickStep(prevCheckListsData, stInx, step, stepInx, hostInstance);
|
|
3486
|
-
return prevCheckListsData;
|
|
3487
|
-
});
|
|
3488
|
-
}
|
|
3489
|
-
}, currentChecklistEle);
|
|
3490
|
-
(_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_STEP_COMPLETE_BTN).concat(stInx, "-").concat(stepInx), 'click', function (e) {
|
|
3491
|
-
e.stopPropagation();
|
|
3492
|
-
if (!step.complete) {
|
|
3493
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3494
|
-
stepComplete(prevCheckListsData, stage, step, clIndex, stInx, stepInx);
|
|
3495
|
-
return prevCheckListsData;
|
|
3496
|
-
});
|
|
3497
|
-
}
|
|
3498
|
-
}, currentChecklistEle);
|
|
3499
|
-
(_c = hostInstance.eventManager) === null || _c === void 0 ? void 0 : _c.addEventListener(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_STEP_COPY_BTN, 'click', function () {
|
|
3500
|
-
rootServiceInstance.sendAndCopyForPlaybook(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ProjConstants.COPY_METHOD, step.description, eachPlaybookStep, hostInstance);
|
|
3501
|
-
stepComplete(prevCheckListsData, stage, step, clIndex, stInx, stepInx);
|
|
3502
|
-
}, eachPlaybookStep);
|
|
3503
|
-
(_d = hostInstance.eventManager) === null || _d === void 0 ? void 0 : _d.addEventListener(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_STEP_SEND_BTN, 'click', function () {
|
|
3504
|
-
rootServiceInstance.sendAndCopyForPlaybook(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ProjConstants.SEND_METHOD, step.description, eachPlaybookStep, hostInstance);
|
|
3505
|
-
stepComplete(prevCheckListsData, stage, step, clIndex, stInx, stepInx);
|
|
3506
|
-
}, eachPlaybookStep);
|
|
3507
|
-
(_e = step.confirmButtons) === null || _e === void 0 ? void 0 : _e.map(function (btn, btnInx) {
|
|
3508
|
-
var _a;
|
|
3509
|
-
(_a = hostInstance.eventManager) === null || _a === void 0 ? void 0 : _a.addEventListener("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.CHECKLIST_STEP_CONFIRMATION_BTN).concat(btnInx), 'click', function () {
|
|
3510
|
-
stepComplete(prevCheckListsData, stage, step, clIndex, stInx, stepInx);
|
|
3511
|
-
rootServiceInstance.confirmationBtnForPlaybook(btn, eachPlaybookStep, hostInstance);
|
|
3512
|
-
}, eachPlaybookStep);
|
|
3513
|
-
});
|
|
3514
|
-
});
|
|
3515
|
-
});
|
|
3516
|
-
};
|
|
3517
|
-
var updateStepNumberInfo = function () {
|
|
3518
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3519
|
-
var _a, _b, _c, _d;
|
|
3520
|
-
var totalSteps = (_c = (_b = (_a = prevCheckListsData.checklists[rootServiceInstance.selCLInx]) === null || _a === void 0 ? void 0 : _a.stages[rootServiceInstance.selStInx]) === null || _b === void 0 ? void 0 : _b.steps) === null || _c === void 0 ? void 0 : _c.length;
|
|
3521
|
-
var completedSteps = rootServiceInstance.getNumberstepCompInStage(prevCheckListsData);
|
|
3522
|
-
var totalStepCountEle = (_d = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _d === void 0 ? void 0 : _d.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.STEP_COMPLETE_COUNT));
|
|
3523
|
-
if (totalStepCountEle) {
|
|
3524
|
-
totalStepCountEle.classList.remove(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.HIDE_ELEMENT);
|
|
3525
|
-
totalStepCountEle.innerText = completedSteps + '/' + totalSteps;
|
|
3526
|
-
}
|
|
3527
|
-
return prevCheckListsData;
|
|
3528
|
-
});
|
|
3529
|
-
};
|
|
3530
|
-
var stepComplete = function (prevCheckListsData, stage, step, clIndex, stInx, stepInx, isAdhered, adheredBy) {
|
|
3531
|
-
if (isAdhered === void 0) { isAdhered = false; }
|
|
3532
|
-
if (adheredBy === void 0) { adheredBy = 'manual'; }
|
|
3533
|
-
var id = prevCheckListsData.checklists[clIndex]._id;
|
|
3534
|
-
var stageId = stage._id;
|
|
3535
|
-
var stepId = step._id;
|
|
3536
|
-
step.ongoing = false;
|
|
3537
|
-
step.complete = true;
|
|
3538
|
-
var checklistParams = rootServiceInstance.prepareChecklistPayload(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_step_closed, prevCheckListsData, {
|
|
3539
|
-
id: id,
|
|
3540
|
-
stageId: stageId,
|
|
3541
|
-
stepId: stepId,
|
|
3542
|
-
"adheredBy": adheredBy // coachingEngine / manual
|
|
3543
|
-
}, true);
|
|
3544
|
-
emitEvents(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.EVENTS.checklist_step_closed, checklistParams, _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_STEP_CLOSED_EVENT);
|
|
3545
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3546
|
-
updateStepNumberInfo();
|
|
3547
|
-
rootServiceInstance.selectNextStage(prevCheckListsData, clIndex, stInx, hostInstance);
|
|
3548
|
-
rootServiceInstance.checkAllStagesCompleted(prevCheckListsData, id, hostInstance);
|
|
3549
|
-
return prevCheckListsData;
|
|
3550
|
-
});
|
|
3551
|
-
};
|
|
3552
|
-
// end of step logic
|
|
3553
|
-
//trigger dynamic checklist
|
|
3554
|
-
var updateTriggerChecklistCount = function (triggeredCheckLists) {
|
|
3555
|
-
var _a;
|
|
3556
|
-
var checklistCountEle = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGER_CHECKLIST_BULB_COUNT));
|
|
3557
|
-
if (checklistCountEle) {
|
|
3558
|
-
checklistCountEle.innerText = triggeredCheckLists === null || triggeredCheckLists === void 0 ? void 0 : triggeredCheckLists.length;
|
|
3559
|
-
}
|
|
3560
|
-
};
|
|
3561
|
-
var addTriggerChecklistItem = function (checklist, triggerChecklistIndex) {
|
|
3562
|
-
var _a, _b;
|
|
3563
|
-
var triggerChecklistDropdownContainer = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGET_CHECKLIST_DROPDOWN));
|
|
3564
|
-
var checklistItem = (0,_base_domManager__WEBPACK_IMPORTED_MODULE_5__.getHTML)(RenderEachTriggeredChecklist, { hostInstance: hostInstance, checklist: checklist }, hostInstance);
|
|
3565
|
-
if (checklistItem && triggerChecklistDropdownContainer) {
|
|
3566
|
-
hostInstance.emit(_constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.BEFORE_VIEW_INIT, checklistItem, { event: _constants_events_cnst__WEBPACK_IMPORTED_MODULE_3__.SDK_EVENTS.PLAYBOOK_TRIGGERED_LIST_TEMPLATE, data: { checklist: checklist } });
|
|
3567
|
-
triggerChecklistDropdownContainer.append(checklistItem);
|
|
3568
|
-
(_b = hostInstance.eventManager) === null || _b === void 0 ? void 0 : _b.addEventListener("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGER_CHECKLIST_BTN).concat(checklist === null || checklist === void 0 ? void 0 : checklist._id), 'click', function () {
|
|
3569
|
-
setAllCheckListData(function (prevCheckListsData) {
|
|
3570
|
-
selectDynCl(prevCheckListsData, checklist, triggerChecklistIndex, true);
|
|
3571
|
-
return prevCheckListsData;
|
|
3572
|
-
});
|
|
3573
|
-
}, triggerChecklistDropdownContainer);
|
|
3574
|
-
}
|
|
3575
|
-
};
|
|
3576
|
-
var selectDynCl = function (prevCheckListsData, clT, i, isTriggered) {
|
|
3577
|
-
if (isTriggered === void 0) { isTriggered = false; }
|
|
3578
|
-
setTriggeredDynCheckLists(function (prevTriggetDynChecklists) {
|
|
3579
|
-
if (prevTriggetDynChecklists === null || prevTriggetDynChecklists === void 0 ? void 0 : prevTriggetDynChecklists.length) {
|
|
3580
|
-
removeTriggeredChecklistItem(prevTriggetDynChecklists[i], i);
|
|
3581
|
-
var triggeredDynCheckLists_2 = prevTriggetDynChecklists.slice(0, i).concat(prevTriggetDynChecklists.slice(i + 1));
|
|
3582
|
-
return triggeredDynCheckLists_2;
|
|
3583
|
-
}
|
|
3584
|
-
return prevTriggetDynChecklists;
|
|
3585
|
-
});
|
|
3586
|
-
var index = prevCheckListsData.checklists.findIndex(function (obj) { return obj._id == clT._id; });
|
|
3587
|
-
if (prevCheckListsData.checklists[index]) {
|
|
3588
|
-
if (isTriggered) {
|
|
3589
|
-
prevCheckListsData.isSuggestedCL = isTriggered;
|
|
3590
|
-
}
|
|
3591
|
-
resumeAndUpdateCheckList(index);
|
|
3592
|
-
}
|
|
3593
|
-
};
|
|
3594
|
-
var removeTriggeredChecklistItem = function (checklistItem, i) {
|
|
3595
|
-
var _a, _b, _c;
|
|
3596
|
-
var triggerChecklistDropdownContainer = (_a = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _a === void 0 ? void 0 : _a.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGET_CHECKLIST_DROPDOWN));
|
|
3597
|
-
var triggerDropdownWrapperEle = (_b = hostInstance === null || hostInstance === void 0 ? void 0 : hostInstance.chatEle) === null || _b === void 0 ? void 0 : _b.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGER_CHECKLIST_DROPDOWN_WRAPPER));
|
|
3598
|
-
var checklistEle = triggerChecklistDropdownContainer.querySelector("".concat(_constants_projConsts__WEBPACK_IMPORTED_MODULE_6__.ClassMapConstanst.TRIGGER_CHECKLIST_BTN).concat(checklistItem._id));
|
|
3599
|
-
if (checklistEle) {
|
|
3600
|
-
checklistEle === null || checklistEle === void 0 ? void 0 : checklistEle.remove();
|
|
3601
|
-
(_c = triggerDropdownWrapperEle === null || triggerDropdownWrapperEle === void 0 ? void 0 : triggerDropdownWrapperEle.classList) === null || _c === void 0 ? void 0 : _c.toggle('show');
|
|
3602
|
-
}
|
|
3603
|
-
};
|
|
3604
|
-
return ((0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-wrapper-template" },
|
|
3605
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-template-data", id: "checkListMainTemplate" },
|
|
3606
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-wrapper-body", id: "checkListBodyTemplate" },
|
|
3607
|
-
(0,preact__WEBPACK_IMPORTED_MODULE_0__.h)("div", { className: "playbook-steps-info", id: "checklistStepTemplate" })))));
|
|
3608
|
-
}
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
/***/ })
|
|
3612
|
-
|
|
3613
|
-
},
|
|
3614
|
-
/******/ function(__webpack_require__) { // webpackRuntimeModules
|
|
3615
|
-
/******/ /* webpack/runtime/getFullHash */
|
|
3616
|
-
/******/ (() => {
|
|
3617
|
-
/******/ __webpack_require__.h = () => ("290a19db34f18f5c2ea4")
|
|
3618
|
-
/******/ })();
|
|
3619
|
-
/******/
|
|
3620
|
-
/******/ }
|
|
3621
|
-
);
|
|
3622
|
-
//# sourceMappingURL=hot-update.js.map
|