ai12z 3.16.2 → 3.17.1-alpha.3
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/cjs/ai12z-beacon.cjs.entry.js +15 -6
- package/dist/cjs/ai12z-bot.cjs.entry.js +50 -41
- package/dist/cjs/ai12z-category_2.cjs.entry.js +21 -13
- package/dist/cjs/ai12z-chat-message.cjs.entry.js +2 -2
- package/dist/cjs/ai12z-chat_2.cjs.entry.js +33 -24
- package/dist/cjs/ai12z-container.cjs.entry.js +7 -1392
- package/dist/cjs/ai12z-cta.cjs.entry.js +34 -27
- package/dist/cjs/ai12z-form.cjs.entry.js +2 -2
- package/dist/cjs/ai12z-inline-search.cjs.entry.js +2 -2
- package/dist/cjs/ai12z-knowledge-box.cjs.entry.js +14 -11
- package/dist/cjs/ai12z-search-panel.cjs.entry.js +1 -1
- package/dist/cjs/{beacon-Bhd49ADQ.js → beacon-DwOvY6Ne.js} +26 -36
- package/dist/cjs/chat-avatar_6.cjs.entry.js +1 -1
- package/dist/cjs/{ctaHelpers-DL-PGlAx.js → ctaHelpers-CdztrD6A.js} +1 -1
- package/dist/cjs/dynamic-form.cjs.entry.js +1 -1
- package/dist/cjs/image-uploader_2.cjs.entry.js +1 -1
- package/dist/cjs/{index-CHyfwy-h.js → index-B6xfVjPU.js} +1 -1
- package/dist/cjs/index.cjs.js +12 -11
- package/dist/cjs/item-list.cjs.entry.js +2 -2
- package/dist/cjs/{keyboard-shortcuts-BfEhZKK-.js → keyboard-shortcuts-CBUd9KfQ.js} +2 -2
- package/dist/cjs/library.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{parseHelper-B8pslVtS.js → parseHelper-BuoIRCbd.js} +1 -1
- package/dist/cjs/{processCarouselData-DVJtwUsv.js → processCarouselData-BXglENd8.js} +1 -1
- package/dist/cjs/purify.es-B7Ashs9w.js +1389 -0
- package/dist/cjs/{reCaptchaHelpers-Djq71pt4.js → reCaptchaHelpers-DIDQT22p.js} +1 -1
- package/dist/cjs/search-results-page.cjs.entry.js +51 -46
- package/dist/cjs/{socket-service-Dqfi4_qU.js → socket-service-j9VBg1pS.js} +1 -1
- package/dist/cjs/{styleSheetRegistry-CsHfoS0d.js → styleSheetRegistry-kcL2qS1d.js} +1 -1
- package/dist/cjs/{surveyHelpers-D0AfNAN8.js → surveyHelpers-B9t5lxy4.js} +1 -1
- package/dist/cjs/{utils-BsCPba57.js → utils-DZMolZh2.js} +3 -0
- package/dist/collection/components/ai12z-beacon/ai12z-beacon.js +33 -4
- package/dist/collection/components/ai12z-bot/ai12z-bot.js +41 -32
- package/dist/collection/components/ai12z-cta/ai12z-cta.css +29 -1
- package/dist/collection/components/ai12z-cta/ai12z-cta.js +27 -20
- package/dist/collection/components/ai12z-cta/components/Category.js +12 -4
- package/dist/collection/components/ai12z-cta/components/Chat.js +14 -5
- package/dist/collection/components/ai12z-cta/components/audiorecorder/audio-recorder.js +7 -6
- package/dist/collection/components/ai12z-knowledge-box/ai12z-knowledge-box.js +8 -5
- package/dist/collection/components/ai12z-search-panel/search-results-view.css +78 -46
- package/dist/collection/components/ai12z-search-panel/search-results-view.js +45 -40
- package/dist/collection/components/input/Input.js +9 -9
- package/dist/collection/components/input/input.css +9 -2
- package/dist/collection/global/tailwind.css +1 -1
- package/dist/collection/utils/beacon.js +25 -35
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/ai12z-beacon.js +1 -1
- package/dist/components/ai12z-bot.js +1 -1
- package/dist/components/ai12z-category.js +1 -1
- package/dist/components/ai12z-chat-message.js +1 -1
- package/dist/components/ai12z-chat.js +1 -1
- package/dist/components/ai12z-container.js +1 -1
- package/dist/components/ai12z-cta.js +1 -1
- package/dist/components/ai12z-form.js +1 -1
- package/dist/components/ai12z-inline-search.js +1 -1
- package/dist/components/ai12z-input-form.js +1 -1
- package/dist/components/ai12z-knowledge-box.js +1 -1
- package/dist/components/ai12z-search-panel.js +1 -1
- package/dist/components/audio-recorder.js +1 -1
- package/dist/components/dynamic-form.js +1 -1
- package/dist/components/image-uploader.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/interaction-buttons.js +1 -1
- package/dist/components/item-list.js +1 -1
- package/dist/components/p-1xDC9Sfq.js +1 -0
- package/dist/components/p-82j2i1Bw.js +2 -0
- package/dist/components/{p-BO2WmSX3.js → p-BBIvme7X.js} +1 -1
- package/dist/components/{p-Cywgam3s.js → p-BJOnT4k4.js} +1 -1
- package/dist/components/{p-Dcj3Mokc.js → p-BO_7DTeV.js} +1 -1
- package/dist/components/p-BpnC79Lm.js +1 -0
- package/dist/components/{p-9LYL2tKU.js → p-BswGpAXe.js} +1 -1
- package/dist/components/{p-D_3pXSAZ.js → p-C-Bd680U.js} +1 -1
- package/dist/components/p-C0ycOUZ8.js +1 -0
- package/dist/components/{p-DOynMJxg.js → p-CNxI_jB-.js} +1 -1
- package/dist/components/{p-BeRVlX-3.js → p-CW_iO9zy.js} +1 -1
- package/dist/components/p-CaMH5wYq.js +1 -0
- package/dist/components/{p-fVj5IyS0.js → p-ChhV7973.js} +1 -1
- package/dist/components/p-CmXVb_3J.js +1 -0
- package/dist/components/{p-UVgSZ7fz.js → p-D338smYm.js} +1 -1
- package/dist/components/p-D4Bi4PpL.js +1 -0
- package/dist/components/{p-BRLTYejK.js → p-DM33B5uU.js} +1 -1
- package/dist/components/p-DVE50Spy.js +1 -0
- package/dist/components/p-DVU3eIHC.js +1 -0
- package/dist/components/{p-Dc7unp-V.js → p-DkBtust7.js} +1 -1
- package/dist/components/p-DqZdaqsU.js +1 -0
- package/dist/components/{p-DURIlC18.js → p-M51H23z5.js} +1 -1
- package/dist/components/{p-BjX5cCOG.js → p-VL7c6YwM.js} +1 -1
- package/dist/components/p-wcfgc9LM.js +1 -0
- package/dist/components/p-yhzHvmpm.js +1 -0
- package/dist/components/privacy-modal.js +1 -1
- package/dist/components/search-results-page.js +1 -1
- package/dist/esm/ai12z-beacon.entry.js +15 -6
- package/dist/esm/ai12z-bot.entry.js +50 -41
- package/dist/esm/ai12z-category_2.entry.js +21 -13
- package/dist/esm/ai12z-chat-message.entry.js +2 -2
- package/dist/esm/ai12z-chat_2.entry.js +33 -24
- package/dist/esm/ai12z-container.entry.js +4 -1389
- package/dist/esm/ai12z-cta.entry.js +34 -27
- package/dist/esm/ai12z-form.entry.js +2 -2
- package/dist/esm/ai12z-inline-search.entry.js +2 -2
- package/dist/esm/ai12z-knowledge-box.entry.js +14 -11
- package/dist/esm/ai12z-search-panel.entry.js +1 -1
- package/dist/esm/{beacon-BLOfGU2-.js → beacon-DOd-Eyt3.js} +26 -36
- package/dist/esm/chat-avatar_6.entry.js +1 -1
- package/dist/esm/{ctaHelpers-GH6upqgA.js → ctaHelpers-CA0BowjW.js} +1 -1
- package/dist/esm/dynamic-form.entry.js +1 -1
- package/dist/esm/image-uploader_2.entry.js +1 -1
- package/dist/esm/{index-CjSLTZFw.js → index-DhYLboA_.js} +1 -1
- package/dist/esm/index.js +12 -11
- package/dist/esm/item-list.entry.js +2 -2
- package/dist/esm/{keyboard-shortcuts-DNhwh88a.js → keyboard-shortcuts-IO5j9uXN.js} +2 -2
- package/dist/esm/library.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{parseHelper-B4cZLEeX.js → parseHelper-DD7WYvgn.js} +1 -1
- package/dist/esm/{processCarouselData-CgoPoIF_.js → processCarouselData-CAknSAMc.js} +1 -1
- package/dist/esm/purify.es-82j2i1Bw.js +1387 -0
- package/dist/esm/{reCaptchaHelpers-O2ugKpWf.js → reCaptchaHelpers-CaQ3SVz2.js} +1 -1
- package/dist/esm/search-results-page.entry.js +51 -46
- package/dist/esm/{socket-service-B6aew9Me.js → socket-service-BOJYqySQ.js} +1 -1
- package/dist/esm/{styleSheetRegistry-DxStYIoa.js → styleSheetRegistry-CN6-rDNE.js} +1 -1
- package/dist/esm/{surveyHelpers-Cbq2vpWj.js → surveyHelpers-Bz38XWys.js} +1 -1
- package/dist/esm/{utils-qg8o2dBJ.js → utils-BRjWPcMA.js} +3 -0
- package/dist/library/index.esm.js +1 -1
- package/dist/library/library.esm.js +1 -1
- package/dist/library/{p-f5bb347f.entry.js → p-167a95fa.entry.js} +1 -1
- package/dist/library/{p-751e9420.entry.js → p-1f95c06c.entry.js} +1 -1
- package/dist/library/{p-4e8c0e1b.entry.js → p-221d7e46.entry.js} +1 -1
- package/dist/library/p-22c17745.entry.js +1 -0
- package/dist/library/{p-ad825010.entry.js → p-26a8cb6b.entry.js} +1 -1
- package/dist/library/{p-DPxJK7tl.js → p-2OHqjSAB.js} +1 -1
- package/dist/library/{p-eb4f0ea7.entry.js → p-2b22db24.entry.js} +1 -1
- package/dist/library/p-43279753.entry.js +1 -0
- package/dist/library/{p-2d8497d9.entry.js → p-4f2ffc41.entry.js} +1 -1
- package/dist/library/p-551a3f1d.entry.js +1 -0
- package/dist/library/p-673c9f70.entry.js +1 -0
- package/dist/library/p-82j2i1Bw.js +2 -0
- package/dist/library/p-8f1bffc1.entry.js +1 -0
- package/dist/library/p-910a4e9a.entry.js +1 -0
- package/dist/library/{p-FOOni1Nh.js → p-BBdGlaiy.js} +1 -1
- package/dist/library/{p-CrPwKEk_.js → p-BdxoiM8M.js} +1 -1
- package/dist/library/{p-DkZf86Si.js → p-CliFNIj3.js} +1 -1
- package/dist/library/{p-TJudQcMS.js → p-DKkcidUt.js} +2 -2
- package/dist/library/p-De893Lcf.js +1 -0
- package/dist/library/{p-DheNz53W.js → p-G2JbXetS.js} +1 -1
- package/dist/library/{p-CZBOULiw.js → p-NAZgDh2j.js} +1 -1
- package/dist/library/p-bbcbf218.entry.js +1 -0
- package/dist/library/p-cca567b2.entry.js +1 -0
- package/dist/library/p-d7128597.entry.js +1 -0
- package/dist/library/{p-bb534b71.entry.js → p-dd288c1f.entry.js} +1 -1
- package/dist/library/{p-Cwv5wtEw.js → p-hl4njVg0.js} +1 -1
- package/dist/library/{p-CzTa5Msf.js → p-usGJJG-Q.js} +1 -1
- package/dist/types/components/ai12z-beacon/ai12z-beacon.d.ts +2 -1
- package/dist/types/components/ai12z-bot/ai12z-bot.d.ts +3 -0
- package/dist/types/components/ai12z-cta/ai12z-cta.d.ts +1 -0
- package/dist/types/components/ai12z-cta/components/Category.d.ts +2 -1
- package/dist/types/components/ai12z-search-panel/search-results-view.d.ts +1 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +2 -2
- package/readme.md +0 -2
- package/dist/components/p-7D8UwFfY.js +0 -1
- package/dist/components/p-B_GRAsXZ.js +0 -1
- package/dist/components/p-CAK1__lu.js +0 -2
- package/dist/components/p-CMc63lZp.js +0 -1
- package/dist/components/p-CO7OM6cu.js +0 -1
- package/dist/components/p-CWoExQML.js +0 -1
- package/dist/components/p-CYh3so8v.js +0 -1
- package/dist/components/p-CnIXGAt8.js +0 -1
- package/dist/components/p-DKF8ThBg.js +0 -1
- package/dist/components/p-DxKyMupy.js +0 -1
- package/dist/components/p-HTPyCRCK.js +0 -1
- package/dist/library/p-03851cc8.entry.js +0 -1
- package/dist/library/p-25f8585a.entry.js +0 -1
- package/dist/library/p-4a41a902.entry.js +0 -2
- package/dist/library/p-516bf868.entry.js +0 -1
- package/dist/library/p-65d17a5b.entry.js +0 -1
- package/dist/library/p-CTRVp5uQ.js +0 -1
- package/dist/library/p-b01d3dff.entry.js +0 -1
- package/dist/library/p-d45bc8fa.entry.js +0 -1
- package/dist/library/p-d4e410ff.entry.js +0 -1
- package/dist/library/p-f1b93099.entry.js +0 -1
- /package/dist/components/{p-CHrTVomR.js → p-djQQf6su.js} +0 -0
- /package/dist/library/{p-D5HnlfHT.js → p-OGzQSgcP.js} +0 -0
|
@@ -1,33 +1,42 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-v8T1EJAJ.js');
|
|
4
|
-
var beacon = require('./beacon-
|
|
5
|
-
require('./utils-
|
|
4
|
+
var beacon = require('./beacon-DwOvY6Ne.js');
|
|
5
|
+
require('./utils-DZMolZh2.js');
|
|
6
6
|
|
|
7
7
|
const Ai12zBeacon = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
this.dataKey = index.Env.DATA_KEY || "";
|
|
11
11
|
this.dataMode = index.Env.DATA_MODE || "prod";
|
|
12
|
+
this.disable = false;
|
|
12
13
|
}
|
|
13
14
|
componentWillLoad() {
|
|
14
15
|
this.initializeBeacon();
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
onPropChange() {
|
|
17
18
|
this.initializeBeacon();
|
|
18
19
|
}
|
|
19
20
|
initializeBeacon() {
|
|
20
21
|
if (!this.dataKey) {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
+
if (!this.disable) {
|
|
25
|
+
beacon.initBeacon(this.dataKey, this.dataMode);
|
|
26
|
+
}
|
|
24
27
|
}
|
|
25
28
|
render() {
|
|
26
|
-
return index.h(index.Host, { key: '
|
|
29
|
+
return index.h(index.Host, { key: '84462e1e48427855a56beeca8262cb97f6752302', hidden: true });
|
|
27
30
|
}
|
|
28
31
|
static get watchers() { return {
|
|
29
32
|
"dataKey": [{
|
|
30
|
-
"
|
|
33
|
+
"onPropChange": 0
|
|
34
|
+
}],
|
|
35
|
+
"dataMode": [{
|
|
36
|
+
"onPropChange": 0
|
|
37
|
+
}],
|
|
38
|
+
"disable": [{
|
|
39
|
+
"onPropChange": 0
|
|
31
40
|
}]
|
|
32
41
|
}; }
|
|
33
42
|
};
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-v8T1EJAJ.js');
|
|
4
4
|
var responseAdapter = require('./response-adapter-CKKyyhMj.js');
|
|
5
|
-
var processCarouselData = require('./processCarouselData-
|
|
5
|
+
var processCarouselData = require('./processCarouselData-BXglENd8.js');
|
|
6
6
|
var logger$2 = require('./logger-2ZBZCKdM.js');
|
|
7
|
-
var utils = require('./utils-
|
|
8
|
-
var index$1 = require('./index-
|
|
7
|
+
var utils = require('./utils-DZMolZh2.js');
|
|
8
|
+
var index$1 = require('./index-B6xfVjPU.js');
|
|
9
9
|
var globalStore = require('./global-store-R6x06KvJ.js');
|
|
10
|
-
var reCaptchaHelpers = require('./reCaptchaHelpers-
|
|
10
|
+
var reCaptchaHelpers = require('./reCaptchaHelpers-DIDQT22p.js');
|
|
11
11
|
var botHelpers = require('./botHelpers-D5Dj7TRA.js');
|
|
12
|
-
var surveyHelpers = require('./surveyHelpers-
|
|
12
|
+
var surveyHelpers = require('./surveyHelpers-B9t5lxy4.js');
|
|
13
13
|
var scriptStyleLoader = require('./scriptStyleLoader-D-bqKqSb.js');
|
|
14
|
-
var keyboardShortcuts = require('./keyboard-shortcuts-
|
|
15
|
-
var ctaHelpers = require('./ctaHelpers-
|
|
14
|
+
var keyboardShortcuts = require('./keyboard-shortcuts-CBUd9KfQ.js');
|
|
15
|
+
var ctaHelpers = require('./ctaHelpers-CdztrD6A.js');
|
|
16
16
|
var appStore = require('./app-store-BtkiHvcw.js');
|
|
17
|
-
var parseHelper = require('./parseHelper-
|
|
18
|
-
var beacon = require('./beacon-
|
|
17
|
+
var parseHelper = require('./parseHelper-BuoIRCbd.js');
|
|
18
|
+
var beacon = require('./beacon-DwOvY6Ne.js');
|
|
19
19
|
var bodyScrollLock = require('./bodyScrollLock-C7gKTAfx.js');
|
|
20
20
|
require('./_commonjsHelpers-MBWFX2dn.js');
|
|
21
21
|
|
|
@@ -1092,6 +1092,7 @@ const Ai12zBot = class {
|
|
|
1092
1092
|
// finding-agent placeholder is tracked via data-finding-agent attribute in the DOM
|
|
1093
1093
|
// private originalTitle: string = document.title
|
|
1094
1094
|
this.unreadCount = 0;
|
|
1095
|
+
this.hasPersistedConversationId = false;
|
|
1095
1096
|
this.liveAgentButtonText = "Talk to a Live Agent";
|
|
1096
1097
|
this.isLiveAgentEnabled = false;
|
|
1097
1098
|
this.isTypingIndicatorVisible = false;
|
|
@@ -1807,7 +1808,9 @@ const Ai12zBot = class {
|
|
|
1807
1808
|
this.timestamp = utils.formatTimestamp(new Date());
|
|
1808
1809
|
this.updateScreenSize();
|
|
1809
1810
|
await this.configBot();
|
|
1810
|
-
|
|
1811
|
+
if (!this.botSettings.disableBeacon) {
|
|
1812
|
+
void beacon.initBeacon(this.dataKey, this.dataMode);
|
|
1813
|
+
}
|
|
1811
1814
|
this.visitorID = "ai12z-" + localStorage.getItem(`ai12z-visitorId`);
|
|
1812
1815
|
// Now safely read state with valid pId
|
|
1813
1816
|
this.hydrateStateFromStorage();
|
|
@@ -1835,6 +1838,7 @@ const Ai12zBot = class {
|
|
|
1835
1838
|
}
|
|
1836
1839
|
this.isExpanded = botState.isExpanded;
|
|
1837
1840
|
this.conversationId = botState.conversationId;
|
|
1841
|
+
this.hasPersistedConversationId = Boolean(botState.conversationId);
|
|
1838
1842
|
if (!botState.newChat) {
|
|
1839
1843
|
this.messages = [...(botState.messages || [])];
|
|
1840
1844
|
}
|
|
@@ -2019,6 +2023,9 @@ const Ai12zBot = class {
|
|
|
2019
2023
|
this.announceMessage = "";
|
|
2020
2024
|
}, 1000);
|
|
2021
2025
|
}
|
|
2026
|
+
isFirstExchange() {
|
|
2027
|
+
return !this.hasPersistedConversationId;
|
|
2028
|
+
}
|
|
2022
2029
|
syncBodyScrollLock(shouldOpen, wasOpen = this.isOpened) {
|
|
2023
2030
|
if (shouldOpen && !wasOpen) {
|
|
2024
2031
|
bodyScrollLock.bodyScrollLock.acquire("ai12z-bot");
|
|
@@ -2261,10 +2268,12 @@ const Ai12zBot = class {
|
|
|
2261
2268
|
this.currentDomId = id;
|
|
2262
2269
|
if (idChanged)
|
|
2263
2270
|
this.messages = [...this.messages];
|
|
2264
|
-
// capture once, before handleEndResponse mutates this.messages
|
|
2265
|
-
const isFirstExchange = this.
|
|
2266
|
-
if (isFirstExchange) {
|
|
2271
|
+
// capture once, before handleEndResponse mutates this.messages and the submit flow advances.
|
|
2272
|
+
const isFirstExchange = this.isFirstExchange();
|
|
2273
|
+
if (isFirstExchange && !this.botSettings.disableBeacon) {
|
|
2274
|
+
// Persist before emitting so downstream listeners see the conversation id as already stored.
|
|
2267
2275
|
beacon.setConversationId(this.dataKey, this.dataMode, data.conversationId);
|
|
2276
|
+
this.hasPersistedConversationId = true;
|
|
2268
2277
|
}
|
|
2269
2278
|
if (!orphaned) {
|
|
2270
2279
|
this.messageReceived.emit({ data, domId: this.currentDomId });
|
|
@@ -2732,8 +2741,14 @@ const Ai12zBot = class {
|
|
|
2732
2741
|
clearTimeout(this.autoScrollTimer);
|
|
2733
2742
|
this.autoScrollTimer = setTimeout(() => this.scrollToBottom(), 60);
|
|
2734
2743
|
}
|
|
2744
|
+
checkLiveAgentBusinessHours() {
|
|
2745
|
+
var _a, _b, _c, _d, _f, _g;
|
|
2746
|
+
const businessHours = (_c = (_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) === null || _b === void 0 ? void 0 : _b.businessHours) !== null && _c !== void 0 ? _c : null;
|
|
2747
|
+
const timezone = (_g = (_f = (_d = this.botSettings) === null || _d === void 0 ? void 0 : _d.liveagent) === null || _f === void 0 ? void 0 : _f.timezone) !== null && _g !== void 0 ? _g : null;
|
|
2748
|
+
return businessHours && timezone ? botHelpers.checkBusinessHours(businessHours, timezone) : true;
|
|
2749
|
+
}
|
|
2735
2750
|
checkLiveAgentMode() {
|
|
2736
|
-
var _a, _b, _c, _d
|
|
2751
|
+
var _a, _b, _c, _d;
|
|
2737
2752
|
const isLiveAgentConfigured = ((_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) === null || _b === void 0 ? void 0 : _b.providers) && Object.keys((_d = (_c = this.botSettings) === null || _c === void 0 ? void 0 : _c.liveagent) === null || _d === void 0 ? void 0 : _d.providers).length > 0;
|
|
2738
2753
|
/**
|
|
2739
2754
|
* Check if live agent is enabled
|
|
@@ -2743,9 +2758,7 @@ const Ai12zBot = class {
|
|
|
2743
2758
|
* and there is a conversation history to refer to.
|
|
2744
2759
|
* This prevents the live agent from being connected immediately when the chat is opened.
|
|
2745
2760
|
*/
|
|
2746
|
-
const
|
|
2747
|
-
const tz = (_l = (_k = (_j = this.botSettings) === null || _j === void 0 ? void 0 : _j.liveagent) === null || _k === void 0 ? void 0 : _k.timezone) !== null && _l !== void 0 ? _l : null;
|
|
2748
|
-
const withinHours = bh && tz ? botHelpers.checkBusinessHours(bh, tz) : true;
|
|
2761
|
+
const withinHours = this.checkLiveAgentBusinessHours();
|
|
2749
2762
|
this.isLiveAgentEnabled = isLiveAgentConfigured && this.messages.length > 1 && withinHours;
|
|
2750
2763
|
}
|
|
2751
2764
|
openEndLiveAgentDialog() {
|
|
@@ -2818,7 +2831,7 @@ const Ai12zBot = class {
|
|
|
2818
2831
|
ChatEventBus.off("AGENT_SESSION_INFO", this.handleAgentSessionInfo);
|
|
2819
2832
|
}
|
|
2820
2833
|
async connectLiveChat() {
|
|
2821
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o
|
|
2834
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
2822
2835
|
this.announce("Connecting to live agent");
|
|
2823
2836
|
this.clearEvents();
|
|
2824
2837
|
const liveAgentProviderNames = Object.keys((_c = (_b = (_a = this.botSettings) === null || _a === void 0 ? void 0 : _a.liveagent) === null || _b === void 0 ? void 0 : _b.providers) !== null && _c !== void 0 ? _c : {});
|
|
@@ -2831,8 +2844,6 @@ const Ai12zBot = class {
|
|
|
2831
2844
|
console.warn("Multiple live agent providers found, using the first one");
|
|
2832
2845
|
}
|
|
2833
2846
|
let liveAgentSettings = (_h = (_g = (_f = (_d = this.botSettings) === null || _d === void 0 ? void 0 : _d.liveagent) === null || _f === void 0 ? void 0 : _f.providers) === null || _g === void 0 ? void 0 : _g[liveAgentProviderNames[0]]) !== null && _h !== void 0 ? _h : null;
|
|
2834
|
-
let liveAgentBusinessHours = (_l = (_k = (_j = this.botSettings) === null || _j === void 0 ? void 0 : _j.liveagent) === null || _k === void 0 ? void 0 : _k.businessHours) !== null && _l !== void 0 ? _l : null;
|
|
2835
|
-
let liveAgentTimezone = (_p = (_o = (_m = this.botSettings) === null || _m === void 0 ? void 0 : _m.liveagent) === null || _o === void 0 ? void 0 : _o.timezone) !== null && _p !== void 0 ? _p : null;
|
|
2836
2847
|
if (!liveAgentSettings) {
|
|
2837
2848
|
console.error("No live agent settings found for the provider", liveAgentProviderNames[0]);
|
|
2838
2849
|
this.announce("Live agent settings are unavailable");
|
|
@@ -2856,25 +2867,23 @@ const Ai12zBot = class {
|
|
|
2856
2867
|
extraPrechatFormDetails,
|
|
2857
2868
|
};
|
|
2858
2869
|
this.liveAgentProviderName = liveAgentProviderNames[0];
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
return;
|
|
2877
|
-
}
|
|
2870
|
+
let isWithinBusinessHours;
|
|
2871
|
+
try {
|
|
2872
|
+
isWithinBusinessHours = this.checkLiveAgentBusinessHours();
|
|
2873
|
+
}
|
|
2874
|
+
catch (e) {
|
|
2875
|
+
console.error("AI12Z: unexpected error evaluating business hours — blocking live agent connection", e);
|
|
2876
|
+
this.announce("Unexpected error evaluating business hours. Live agent connection blocked.");
|
|
2877
|
+
this.addEventMessage("Unexpected error evaluating business hours. Please try again later.");
|
|
2878
|
+
this.isTypingIndicatorVisible = false;
|
|
2879
|
+
return;
|
|
2880
|
+
}
|
|
2881
|
+
if (!isWithinBusinessHours) {
|
|
2882
|
+
const outsideHoursMsg = (_k = (_j = liveAgentSettings.config) === null || _j === void 0 ? void 0 : _j.outsideBusinessHoursMessage) !== null && _k !== void 0 ? _k : "Our live agents are currently offline. Please try again during our business hours.";
|
|
2883
|
+
this.addEventMessage(outsideHoursMsg);
|
|
2884
|
+
this.announce("Live agents are currently offline");
|
|
2885
|
+
this.isTypingIndicatorVisible = false;
|
|
2886
|
+
return;
|
|
2878
2887
|
}
|
|
2879
2888
|
if (liveAgentProviderNames[0] === "liveagent") {
|
|
2880
2889
|
if (!this.liveAgentRef) {
|
|
@@ -2891,7 +2900,7 @@ const Ai12zBot = class {
|
|
|
2891
2900
|
else {
|
|
2892
2901
|
// Coerce to number; enforce minimum of 5 s to prevent misconfigured values;
|
|
2893
2902
|
// fall back to 30 s when unset, non-numeric, or below the minimum.
|
|
2894
|
-
const rawWait = Number((
|
|
2903
|
+
const rawWait = Number((_l = liveAgentSettings === null || liveAgentSettings === void 0 ? void 0 : liveAgentSettings.config) === null || _l === void 0 ? void 0 : _l.maxWaitTime);
|
|
2895
2904
|
const waitSeconds = Number.isFinite(rawWait) && rawWait >= 5 ? rawWait : 300;
|
|
2896
2905
|
const timeoutMs = waitSeconds * 1000;
|
|
2897
2906
|
// Step 1: register all listeners before connecting so no events are missed
|
|
@@ -2933,7 +2942,7 @@ const Ai12zBot = class {
|
|
|
2933
2942
|
this.liveAgentConversationId = "";
|
|
2934
2943
|
this.isLiveAgent = false;
|
|
2935
2944
|
this.isTypingIndicatorVisible = false;
|
|
2936
|
-
const timeoutMsg = (
|
|
2945
|
+
const timeoutMsg = (_o = (_m = liveAgentSettings.config) === null || _m === void 0 ? void 0 : _m.maxWaitMessage) !== null && _o !== void 0 ? _o : "Sorry, no agents are available at the moment.";
|
|
2937
2946
|
this.removeFindingAgentPlaceholder();
|
|
2938
2947
|
this.addEventMessage(timeoutMsg);
|
|
2939
2948
|
this.liveAgentEventHandler.disconnectLiveAgent();
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-v8T1EJAJ.js');
|
|
4
4
|
var SearchResult = require('./SearchResult-CvTJr55G.js');
|
|
5
|
-
var utils = require('./utils-
|
|
5
|
+
var utils = require('./utils-DZMolZh2.js');
|
|
6
6
|
var _commonjsHelpers = require('./_commonjsHelpers-MBWFX2dn.js');
|
|
7
7
|
var appStore = require('./app-store-BtkiHvcw.js');
|
|
8
|
-
var parseHelper = require('./parseHelper-
|
|
9
|
-
require('./ctaHelpers-
|
|
8
|
+
var parseHelper = require('./parseHelper-BuoIRCbd.js');
|
|
9
|
+
require('./ctaHelpers-CdztrD6A.js');
|
|
10
10
|
require('./logger-2ZBZCKdM.js');
|
|
11
11
|
|
|
12
12
|
const categoryCss = () => `ai12z-category{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-search-font-size, var(--ai12z-font-size)) !important}.custom-title{font-size:var(--ai12z-category-font-size);color:var(--ai12z-category-font-color)}`;
|
|
@@ -19,11 +19,10 @@ const Category = class {
|
|
|
19
19
|
clearResultsHandler(_state) {
|
|
20
20
|
this.categories = {};
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (this.categoryList && this.categoryList.length > 0) {
|
|
22
|
+
watchCategoryList(newValue) {
|
|
23
|
+
if (newValue && newValue.length > 0) {
|
|
25
24
|
/*group by category*/
|
|
26
|
-
let grouped =
|
|
25
|
+
let grouped = newValue.reduce((result, currentValue) => {
|
|
27
26
|
(result[currentValue["category"]] = result[currentValue["category"]] || []).push(currentValue);
|
|
28
27
|
return result;
|
|
29
28
|
}, {});
|
|
@@ -33,11 +32,19 @@ const Category = class {
|
|
|
33
32
|
this.categories = {};
|
|
34
33
|
}
|
|
35
34
|
}
|
|
35
|
+
componentWillLoad() {
|
|
36
|
+
this.watchCategoryList(this.categoryList);
|
|
37
|
+
}
|
|
36
38
|
render() {
|
|
37
39
|
return Object.entries(this.categories).map(([key, value], _index) => {
|
|
38
40
|
return (index.h(index.Fragment, null, index.h("div", null, index.h("h1", { class: "custom-title" }, key)), index.h(SearchResult.SearchResult, { results: value, linkTarget: this.linkTarget })));
|
|
39
41
|
});
|
|
40
42
|
}
|
|
43
|
+
static get watchers() { return {
|
|
44
|
+
"categoryList": [{
|
|
45
|
+
"watchCategoryList": 0
|
|
46
|
+
}]
|
|
47
|
+
}; }
|
|
41
48
|
};
|
|
42
49
|
Category.style = categoryCss();
|
|
43
50
|
|
|
@@ -6543,8 +6550,9 @@ const AudioRecorder = class {
|
|
|
6543
6550
|
this.record = this.wavesurfer.registerPlugin(n.create({
|
|
6544
6551
|
renderRecordedAudio: false,
|
|
6545
6552
|
scrollingWaveform: true,
|
|
6546
|
-
continuousWaveform: true,
|
|
6547
|
-
|
|
6553
|
+
// continuousWaveform: true,
|
|
6554
|
+
continuousWaveform: false,
|
|
6555
|
+
// continuousWaveformDuration: 30, // optional
|
|
6548
6556
|
mimeType: "audio/wav",
|
|
6549
6557
|
}));
|
|
6550
6558
|
// Render recorded audio
|
|
@@ -6669,17 +6677,17 @@ const AudioRecorder = class {
|
|
|
6669
6677
|
render() {
|
|
6670
6678
|
const minutes = Math.floor(this.time / 60);
|
|
6671
6679
|
const seconds = this.time % 60;
|
|
6672
|
-
return (index.h("div", { key: '
|
|
6680
|
+
return (index.h("div", { key: 'c381efb6f2754190186c3dce1bc87e7087ccf596', class: "flex w-full" }, (this.isRecording || this.isProcessing) && (index.h("div", { key: 'e9d618072d84648011e7c4740042685508312a2d', class: `relative flex items-center w-full rounded-full` }, this.isRecording && (index.h("button", { key: 'd291a135e07fb3caa77eafbca64e8fef837d440b', "aria-label": "Cancel Recording", onClick: e => {
|
|
6673
6681
|
e.preventDefault();
|
|
6674
6682
|
this.stopRecording("cancel");
|
|
6675
|
-
}, class: "w-10 h-10 rounded-full flex items-center justify-center text-white" }, "\u274C")), index.h("div", { key: '
|
|
6683
|
+
}, class: "w-10 h-10 rounded-full flex items-center justify-center text-white" }, "\u274C")), index.h("div", { key: '9d018b5a3b0a450d67a88de1745337830519eb36', id: "mic", style: { width: "100%" } }), this.isRecording && !this.isProcessing ? (index.h("div", { class: "ml-auto text-blue-600 font-semibold" }, String(minutes).padStart(2, "0"), ":", String(seconds).padStart(2, "0"))) : null, (this.isRecording || this.isProcessing) && (index.h("button", { key: 'b55a697513fb7de3c4087f933e03403e6f6a381e', "aria-label": "Confirm Recording", disabled: this.isProcessing, onClick: e => {
|
|
6676
6684
|
e.preventDefault();
|
|
6677
6685
|
if (!this.isProcessing)
|
|
6678
6686
|
this.stopRecording("stop");
|
|
6679
|
-
}, class: `w-10 h-10 ml-2 rounded-full flex items-center justify-center ${this.isProcessing ? "cursor-not-allowed" : "text-blue-600"}` }, this.isProcessing ? (index.h("svg", { class: "activity-spinner", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("line", { x1: "12", y1: "2", x2: "12", y2: "5", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "0" } }), index.h("line", { x1: "16.24", y1: "3.76", x2: "14.12", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "1" } }), index.h("line", { x1: "19", y1: "7.76", x2: "16.24", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "2" } }), index.h("line", { x1: "20", y1: "12", x2: "17", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "3" } }), index.h("line", { x1: "19", y1: "16.24", x2: "16.24", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "4" } }), index.h("line", { x1: "16.24", y1: "20.24", x2: "14.12", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "5" } }), index.h("line", { x1: "12", y1: "22", x2: "12", y2: "19", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "6" } }), index.h("line", { x1: "7.76", y1: "20.24", x2: "9.88", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "7" } }), index.h("line", { x1: "5", y1: "16.24", x2: "7.76", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "8" } }), index.h("line", { x1: "4", y1: "12", x2: "7", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "9" } }), index.h("line", { x1: "5", y1: "7.76", x2: "7.76", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "10" } }), index.h("line", { x1: "7.76", y1: "3.76", x2: "9.88", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "11" } }))) : (index.h("span", { class: "text-blue-600 font-sans" }, "\u2714")))))), !this.isRecording && !this.isProcessing && (index.h("button", { key: '
|
|
6687
|
+
}, class: `w-10 h-10 ml-2 rounded-full flex items-center justify-center ${this.isProcessing ? "cursor-not-allowed" : "text-blue-600"}` }, this.isProcessing ? (index.h("svg", { class: "activity-spinner", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("line", { x1: "12", y1: "2", x2: "12", y2: "5", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "0" } }), index.h("line", { x1: "16.24", y1: "3.76", x2: "14.12", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "1" } }), index.h("line", { x1: "19", y1: "7.76", x2: "16.24", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "2" } }), index.h("line", { x1: "20", y1: "12", x2: "17", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "3" } }), index.h("line", { x1: "19", y1: "16.24", x2: "16.24", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "4" } }), index.h("line", { x1: "16.24", y1: "20.24", x2: "14.12", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "5" } }), index.h("line", { x1: "12", y1: "22", x2: "12", y2: "19", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "6" } }), index.h("line", { x1: "7.76", y1: "20.24", x2: "9.88", y2: "18.12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "7" } }), index.h("line", { x1: "5", y1: "16.24", x2: "7.76", y2: "14.76", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "8" } }), index.h("line", { x1: "4", y1: "12", x2: "7", y2: "12", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "9" } }), index.h("line", { x1: "5", y1: "7.76", x2: "7.76", y2: "9.24", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "10" } }), index.h("line", { x1: "7.76", y1: "3.76", x2: "9.88", y2: "5.88", "stroke-width": "2", "stroke-linecap": "round", style: { "--n": "11" } }))) : (index.h("span", { class: "text-blue-600 font-sans" }, "\u2714")))))), !this.isRecording && !this.isProcessing && (index.h("button", { key: '0a321fb59ced6d858534e5817a2a0ac9f5c7a4a1', "aria-label": "Start Recording", title: "Start Recording", onClick: e => {
|
|
6680
6688
|
e.preventDefault();
|
|
6681
6689
|
this.startRecording();
|
|
6682
|
-
}, class: `flex ${this.componentType === "search" || this.componentType === "cta" ? "p-1.5 mr-0.5 self-center mt-0.5" : "w-10 h-8 p-0 mt-4"}` }, index.h("svg", { key: '
|
|
6690
|
+
}, class: `flex ${this.componentType === "search" || this.componentType === "cta" ? "p-1.5 mr-0.5 self-center mt-0.5" : "w-10 h-8 p-0 mt-4"}` }, index.h("svg", { key: '48882741d3a1bcfaded9cbaf5094f0b89c73cb78', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", class: `w-5 h-5 translate-y-[0.5px] ${this.componentType === "search" || this.componentType === "cta" ? "mic-icon" : "mic-botIcon"}` }, index.h("path", { key: 'e344d7404f71e5fd86246e3422b5f826abb4b85c', d: "M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z" }), index.h("path", { key: '797aac54042925a574342e203114e9c133fc9f95', d: "M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5h-1.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z" }))))));
|
|
6683
6691
|
}
|
|
6684
6692
|
get element() { return index.getElement(this); }
|
|
6685
6693
|
};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-v8T1EJAJ.js');
|
|
4
4
|
var botHelpers = require('./botHelpers-D5Dj7TRA.js');
|
|
5
|
-
var styleSheetRegistry = require('./styleSheetRegistry-
|
|
6
|
-
require('./utils-
|
|
5
|
+
var styleSheetRegistry = require('./styleSheetRegistry-kcL2qS1d.js');
|
|
6
|
+
require('./utils-DZMolZh2.js');
|
|
7
7
|
|
|
8
8
|
const ai12zChatMessageCss = () => `.show-more-btn{background:none;color:var(--ai12z-knowledge-box-show-more-color, #4a8aff);font-size:16px;cursor:pointer;font-weight:500;border-radius:6px;transition:color 0.2s ease, background 0.2s ease;border:1px solid var(--ai12z-knowledge-box-show-more-border, blue);padding:10px;border-radius:20px;align-items:center;justify-content:center;margin:auto;display:block;z-index:20;position:relative;width:30%}.show-more-btn:hover{color:var(--ai12z-knowledge-box-show-more-hover-color, #1a73e8);background:rgba(74, 138, 255, 0.08)}.show-more-btn:active{background:rgba(74, 138, 255, 0.15)}.show-more-btn svg{vertical-align:middle;gap:5px;transition:transform 0.3s ease-in-out;display:inline-block;margin-left:10px;font-size:20}.message-text{line-height:1.55;font-size:15px;color:var(--ai12z-knowledge-box-text-color, #1e1e1e);transition:max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden}.fade-overlay{position:absolute;bottom:0;left:0;right:0;height:100px;z-index:10;pointer-events:none;opacity:1;transition:opacity 0.3s ease-in-out;background:linear-gradient( to bottom, rgba(255, 255, 255, 0) 0%, var(--ai12z-knowledge-box-bg-color, #ffffff) 85% )}.chat-message{position:relative;}.custom-line-clamp{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--line-clamp);line-clamp:var(--line-clamp)}.ai12z-form-honeypot{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.ai12zBtn{background-color:var(--ai12z-knowledge-box-primary-color);color:white;padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}`;
|
|
9
9
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-v8T1EJAJ.js');
|
|
4
|
-
var processCarouselData = require('./processCarouselData-
|
|
5
|
-
var parseHelper = require('./parseHelper-
|
|
6
|
-
var utils = require('./utils-
|
|
7
|
-
var ctaHelpers = require('./ctaHelpers-
|
|
8
|
-
var index$1 = require('./index-
|
|
9
|
-
var socketService = require('./socket-service-
|
|
10
|
-
var surveyHelpers = require('./surveyHelpers-
|
|
11
|
-
var keyboardShortcuts = require('./keyboard-shortcuts-
|
|
4
|
+
var processCarouselData = require('./processCarouselData-BXglENd8.js');
|
|
5
|
+
var parseHelper = require('./parseHelper-BuoIRCbd.js');
|
|
6
|
+
var utils = require('./utils-DZMolZh2.js');
|
|
7
|
+
var ctaHelpers = require('./ctaHelpers-CdztrD6A.js');
|
|
8
|
+
var index$1 = require('./index-B6xfVjPU.js');
|
|
9
|
+
var socketService = require('./socket-service-j9VBg1pS.js');
|
|
10
|
+
var surveyHelpers = require('./surveyHelpers-B9t5lxy4.js');
|
|
11
|
+
var keyboardShortcuts = require('./keyboard-shortcuts-CBUd9KfQ.js');
|
|
12
12
|
var analyticsService = require('./analyticsService-CkAva47S.js');
|
|
13
13
|
var botHelpers = require('./botHelpers-D5Dj7TRA.js');
|
|
14
|
-
var beacon = require('./beacon-
|
|
14
|
+
var beacon = require('./beacon-DwOvY6Ne.js');
|
|
15
15
|
require('./_commonjsHelpers-MBWFX2dn.js');
|
|
16
16
|
require('./logger-2ZBZCKdM.js');
|
|
17
17
|
require('./response-adapter-CKKyyhMj.js');
|
|
@@ -400,7 +400,7 @@ const MyChat = class {
|
|
|
400
400
|
}
|
|
401
401
|
this.scrollToLatestBubble();
|
|
402
402
|
this.isProcessingEndResponse = true;
|
|
403
|
-
if (this.chats.length === 2) {
|
|
403
|
+
if (this.chats.length === 2 && !this.settings.disableBeacon) {
|
|
404
404
|
beacon.setConversationId(this.apiKey, this.env, event.detail.conversationId);
|
|
405
405
|
}
|
|
406
406
|
// const idx = this.chats.findIndex(item => item.id === this.aiMessageId)
|
|
@@ -1142,7 +1142,7 @@ const MyChat = class {
|
|
|
1142
1142
|
render() {
|
|
1143
1143
|
var _a;
|
|
1144
1144
|
const email = "";
|
|
1145
|
-
return (index.h("div", { key: '
|
|
1145
|
+
return (index.h("div", { key: '5883ac798ea9966385dc63a39f5e4bc2afb4c866' }, index.h("ul", { key: 'f46ac1484464dac37be35530bd44f4702ddbdb97', id: "main-content", tabindex: "-1", class: {
|
|
1146
1146
|
"chat-list": true,
|
|
1147
1147
|
"custom-list": this.componentType === "search",
|
|
1148
1148
|
// "custom-chat-top-height": this.componentType === "search",
|
|
@@ -1171,7 +1171,7 @@ const MyChat = class {
|
|
|
1171
1171
|
let popup = e.target.querySelector(".non-user-container");
|
|
1172
1172
|
if (popup)
|
|
1173
1173
|
popup.style.display = "none";
|
|
1174
|
-
} }, chat.status !== "pending" && !(chat.type === "user" && chat.isHide) && (index.h("div", { class: {
|
|
1174
|
+
}, style: { width: chat.type !== "user" ? "90%" : "auto" } }, chat.status !== "pending" && !(chat.type === "user" && chat.isHide) && (index.h("div", { class: {
|
|
1175
1175
|
"p-4": true,
|
|
1176
1176
|
"max-w-full": this.componentType === "search" ? true : false,
|
|
1177
1177
|
"prose": true,
|
|
@@ -1186,7 +1186,16 @@ const MyChat = class {
|
|
|
1186
1186
|
}, id: chat.id, innerHTML: chat.message }, (_c = chat === null || chat === void 0 ? void 0 : chat.images) === null || _c === void 0 ? void 0 :
|
|
1187
1187
|
_c.map(img => {
|
|
1188
1188
|
return index.h("img", { src: img, class: "thumbnail", alt: "thumbnail", width: "70", height: "50" });
|
|
1189
|
-
}), chat.type !== "user" && (
|
|
1189
|
+
}), chat.type !== "user" && (
|
|
1190
|
+
// <svg class="animate-spin h-5 w-5 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" id="spinner">
|
|
1191
|
+
// <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
|
1192
|
+
// <path
|
|
1193
|
+
// class="opacity-75"
|
|
1194
|
+
// fill="currentColor"
|
|
1195
|
+
// d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 0 1 4 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
1196
|
+
// ></path>
|
|
1197
|
+
// </svg>
|
|
1198
|
+
index.h("div", { class: "w-full rounded-md", id: "spinner" }, index.h("div", { class: "flex animate-pulse space-x-4" }, index.h("div", { class: "flex-1 space-y-3 py-1" }, index.h("div", { class: "h-4 rounded bg-gray-200" }), index.h("div", { class: "space-y-3" }, index.h("div", { class: "grid grid-cols-3 gap-4" }, index.h("div", { class: "col-span-2 h-4 rounded bg-gray-200" }), index.h("div", { class: "col-span-1 h-4 rounded bg-gray-200" })), index.h("div", { class: "h-4 rounded bg-gray-200" })))))))), chat.type !== "user" && chat.clipboard && ((_d = this.settings.showMessageIcons) !== null && _d !== void 0 ? _d : true) && !chat.surveyDomId && (index.h("div", { class: "non-user-container", style: { display: "none" } }, this.isPlayed && (index.h("button", { class: "copy-btn", "aria-label": "Stop", tabindex: "0", onClick: () => {
|
|
1190
1199
|
this.isPlayed = false;
|
|
1191
1200
|
window.speechSynthesis.cancel();
|
|
1192
1201
|
if (this.audioElement) {
|
|
@@ -1209,7 +1218,7 @@ const MyChat = class {
|
|
|
1209
1218
|
projectId: this.getProjectId(),
|
|
1210
1219
|
questionText: analyticsService.getQuestionText(this.chats, chat.insightId) || "",
|
|
1211
1220
|
}), class: "chat-thumbs-up", "aria-label": "Thumbs Down", tabindex: "0" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "w-6 h-6" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54" }))), index.h("button", { class: "copy-btn", tabindex: "0", "aria-label": "Send Email" }, index.h("a", { href: `mailto:${email}?subject=${encodeURIComponent((_e = this.chats[idx - 1]) === null || _e === void 0 ? void 0 : _e.message)}&body=${encodeURIComponent(this.removeHtmlTags(chat.clipboard))}`, target: "_blank", "aria-label": "Send Email" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", "stroke-width": "0.3", class: "w-6 h-6" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M3.75 5.25L3 6V18L3.75 18.75H20.25L21 18V6L20.25 5.25H3.75ZM4.5 7.6955V17.25H19.5V7.69525L11.9999 14.5136L4.5 7.6955ZM18.3099 6.75H5.68986L11.9999 12.4864L18.3099 6.75Z", fill: "currentColor" }), " "))))))));
|
|
1212
|
-
}), index.h("div", { key: '
|
|
1221
|
+
}), index.h("div", { key: '53802e68891a2c65e85f5df2086b129bcd15fb04', class: "scroll-bottom" }))));
|
|
1213
1222
|
}
|
|
1214
1223
|
get element() { return index.getElement(this); }
|
|
1215
1224
|
static get watchers() { return {
|
|
@@ -1220,7 +1229,7 @@ const MyChat = class {
|
|
|
1220
1229
|
};
|
|
1221
1230
|
MyChat.style = ai12zChatCss();
|
|
1222
1231
|
|
|
1223
|
-
const inputCss = () => `:host{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-font-size) !important}.input-form{display:flex;flex-direction:column;width:100%;margin-bottom:16px}.input-container{margin-right:16px;position:relative;border-radius:64px;border-width:1px;align-items:stretch;display:flex;}.inner-container{flex-grow:1;padding:12px}.custom-input{color:black;border-width:0;max-height:300px;resize:none;overflow:hidden;background-color:inherit}.custom-input::-moz-placeholder{color:var(--ai12z-input-placeholder-color);opacity:1;font-size:var(--ai12z-input-placeholder-font-size)}.custom-input::placeholder{color:var(--ai12z-input-placeholder-color);opacity:1;font-size:var(--ai12z-input-placeholder-font-size)}.custom-input:focus{outline:none;box-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--ai12z-border-color)}.input-focus-color{border-color:
|
|
1232
|
+
const inputCss = () => `:host{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-font-size) !important}.input-form{display:flex;flex-direction:column;width:100%;margin-bottom:16px}.input-container{margin-right:16px;position:relative;border-radius:64px;border-width:1px;align-items:stretch;display:flex;}.inner-container{flex-grow:1;padding:12px}.custom-input{color:black;border-width:0;max-height:300px;resize:none;overflow:hidden;background-color:inherit}.custom-input::-moz-placeholder{color:var(--ai12z-input-placeholder-color);opacity:1;font-size:var(--ai12z-input-placeholder-font-size)}.custom-input::placeholder{color:var(--ai12z-input-placeholder-color);opacity:1;font-size:var(--ai12z-input-placeholder-font-size)}.custom-input:focus{outline:none;box-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--ai12z-border-color)}.input-focus-color{border-color:black !important}.plus-icon{color:#fff;background-color:var(--ai12z-plus-icon-color)}.ai12z-plus-anchor{position:relative;display:inline-block}.ai12z-plus-menu{position:absolute;top:100%;left:0;margin-top:0.5rem;width:var(--ai12z-menu-width, 15rem);z-index:30;padding:0.375rem;background-color:var(--ai12z-menu-bg, #fff);border:1px solid var(--ai12z-menu-border-color, rgba(17, 24, 39, 0.08));border-radius:var(--ai12z-menu-radius, 0.875rem);box-shadow:var( --ai12z-menu-shadow, 0 12px 28px -12px rgba(17, 24, 39, 0.28), 0 4px 10px -6px rgba(17, 24, 39, 0.15) );transform-origin:top left;transition:opacity 0.16s ease, transform 0.16s ease}.ai12z-plus-menu[data-open="false"]{opacity:0;transform:scale(0.95);pointer-events:none}.ai12z-plus-menu[data-open="true"]{opacity:1;transform:scale(1);pointer-events:auto}.ai12z-menu-list{display:flex;flex-direction:column;gap:0.125rem;margin:0;padding:0;list-style:none}.ai12z-menu-item,.ai12z-menu-item--uploader .image-uploader>button{display:flex;align-items:center;gap:0.625rem;width:100%;padding:0.5rem 0.625rem;border:0;background:transparent;border-radius:0.5rem;font-family:inherit;font-size:var(--ai12z-menu-item-font-size, 0.875rem);line-height:1.25rem;color:var(--ai12z-menu-item-color, #374151);text-align:left;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease}.ai12z-menu-item:hover:not([disabled]):not([aria-disabled="true"]),.ai12z-menu-item:focus-visible,.ai12z-menu-item--uploader .image-uploader>button:hover:not([disabled]){background-color:var(--ai12z-menu-item-hover-bg, #f3f4f6)}.ai12z-menu-item:focus-visible,.ai12z-menu-item--uploader .image-uploader>button:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 2px var(--ai12z-menu-focus-ring, rgba(59, 130, 246, 0.55))}.ai12z-menu-item[disabled],.ai12z-menu-item[aria-disabled="true"]{opacity:0.45;cursor:not-allowed}.ai12z-menu-item__icon,.ai12z-menu-item--uploader .image-uploader>button svg{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25rem;height:1.25rem;color:var(--ai12z-menu-icon-color, #6b7280)}.ai12z-menu-item__label{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ai12z-menu-item--uploader{padding:0}.ai12z-menu-item--uploader .image-uploader,.ai12z-menu-item--uploader .image-uploader>button{width:100%}@media (prefers-color-scheme: dark){.ai12z-plus-menu{--ai12z-menu-bg:#1f2937;--ai12z-menu-border-color:rgba(255, 255, 255, 0.08);--ai12z-menu-shadow:0 14px 34px -12px rgba(0, 0, 0, 0.65), 0 4px 12px -6px rgba(0, 0, 0, 0.5);--ai12z-menu-item-color:#e5e7eb;--ai12z-menu-item-hover-bg:rgba(55, 65, 81, 0.7);--ai12z-menu-icon-color:#9ca3af}}.ai-button{border-left-width:1px;padding-left:16px;padding-right:16px;white-space:nowrap;display:inline-flex;place-items:center;color:var(--ai12z-button-font-color);font-size:var(--ai12z-button-font-size);}.ai-button:hover{background-color:var(--ai12z-primary-color);color:rgb(255 255 255)}.custom-svg-checkbox{margin-top:4px;width:16px;height:16px;position:absolute}.hide-svg{display:none}.icon-width{width:28px}.custom-attachment{border-right-width:1px;padding-top:10px;padding-left:16px;padding-right:32px;cursor:pointer;width:5%}#fileInput{display:none}.error-msg{color:red;font-size:12px;margin-top:4px;text-align:center}.image-Container{position:relative;display:inline-block;margin-right:10px}.delete-image{opacity:3;position:absolute;right:3px;top:0;cursor:pointer;line-height:10px}.btn-bg-color{background-color:var(--ai12z-button-bgcolor)}.searchbar-bgcolor{background-color:var(--ai12z-searchbar-bgcolor)}.searchbar-bordercolor{border:1px solid grey}.inline-searchbar-bgcolor{border-color:var(--ai12z-inlinesearchbar-border-color);background-color:var(--ai12z-inlinesearchbar-bgcolor);border-width:1px}.enter-tip{font-size:12px;color:#666;margin-left:10px}#message-error{margin-left:10px}`;
|
|
1224
1233
|
|
|
1225
1234
|
const InputForm = class {
|
|
1226
1235
|
constructor(hostRef) {
|
|
@@ -1567,21 +1576,21 @@ const InputForm = class {
|
|
|
1567
1576
|
// this.icon_width = url.searchParams.get("w") || "28"
|
|
1568
1577
|
// this.icon_height = url.searchParams.get("h") || "28"
|
|
1569
1578
|
// }
|
|
1570
|
-
return (index.h("div", { key: 'c59679b3a11b641402f5c2b328356ad114b43833' }, index.h("form", { key: 'a804577f24fc37e7da8fbec9fae402122c72ac89', class: "w-full flex flex-col gap-1.5 sticky", onSubmit: this.handleFormSubmit }, index.h("div", { key: '
|
|
1579
|
+
return (index.h("div", { key: 'c59679b3a11b641402f5c2b328356ad114b43833' }, index.h("form", { key: 'a804577f24fc37e7da8fbec9fae402122c72ac89', class: "w-full flex flex-col gap-1.5 sticky", onSubmit: this.handleFormSubmit }, index.h("div", { key: '7aa25122583eb481fc813803409e1d7f8f341b11', class: `flex-1 flex flex-col relative w-full rounded-3xl px-1 ${this.componentType === "inline" ? "inline-searchbar-bgcolor" : "searchbar-bgcolor searchbar-bordercolor"}`, dir: "LTR", ref: el => (this.searchFormElem = el) }, index.h("div", { key: '8a023eb115800c83962d191caaff210154a7d6a0', class: "flex items-center" }, index.h("div", { key: 'f4faaf4508c2e2a56b890af2d173352edffcb99f', class: "ml-1 self-center flex space-x-1" }, !this.hideAllButtons && (index.h("div", { key: '4300e90cc7256a0b799b910b7e452d3cd4c6830f', class: "ai12z-plus-anchor relative inline-block", style: { width: "5%" } }, index.h("button", { key: 'abfeb315a8bbb5be023bd5dde8eccdfa691ff7a9', class: "plus-icon rounded-full p-1.5", "aria-label": "Options", title: "Add images or capture screen", tabindex: "0", "aria-haspopup": "menu", "aria-expanded": this.isOpen ? "true" : "false", "aria-controls": `ai12z-options-menu-${this.instanceId}`, ref: el => (this.plusButtonElem = el), onKeyDown: this.handleTriggerKeyDown, onClick: e => {
|
|
1571
1580
|
e.stopPropagation();
|
|
1572
1581
|
this.toggleBox(e);
|
|
1573
|
-
} }, index.h("svg", { key: '
|
|
1582
|
+
} }, index.h("svg", { key: '5300f423cada715d556a1694b170090e58465b06', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '6a6de741c48a4984384af07a7f10088bed4afe01', d: "M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z" }))), index.h("div", { key: 'c42e95662bd835bfa39b89a9de4f6c1e460d62fe', class: "ai12z-plus-menu", id: `ai12z-options-menu-${this.instanceId}`, "data-open": this.isOpen ? "true" : "false", role: "menu", "aria-orientation": "vertical", "aria-label": "Input options", onKeyDown: this.handleMenuKeyDown, ref: el => (this.menuElem = el) }, index.h("ul", { key: 'ba781458c49fa5060751cf5790cbec739dbe1f3b', class: "ai12z-menu-list" }, this.isImageUpload && (index.h("li", { key: '1fd2ddff8bc73553a645388a0a7d967c9fe2e8da', role: "none", class: "ai12z-menu-item--uploader" }, index.h("image-uploader", { key: 'bc61d3d1789184cbc612a122be4a8e3529f6091e', maxImages: 10, images: this.imagesBase64List, targetElement: this.searchInputElem, onImagesChange: this.handleImageChange, onError: this.handleImageError, ref: el => (this.imageUploaderRef = el) }))), index.h("li", { key: '010ceb2b8240d4f4cf35a37ef5899efbee9f4fd1', role: "none" }, index.h("button", { key: '47699e693a3b731896294ef7d74027d2c0f475f7', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Capture screen", onClick: () => {
|
|
1574
1583
|
this.captureScreen();
|
|
1575
1584
|
this.closeMenu(true);
|
|
1576
|
-
} }, index.h("span", { key: '
|
|
1585
|
+
} }, index.h("span", { key: 'b1afc23600c64684093f19b19b03c63a212254c6', class: "ai12z-menu-item__icon" }, index.h("svg", { key: '91e5aa67bcd8732f82a07504a65542304a8119a9', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '3ca1688a7176f77357daa3d4ea25583f1be09c96', d: "M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" }), index.h("path", { key: '4819afb3d8e7fd2234bc3cbbc7b2eb9b36740509', "fill-rule": "evenodd", d: "M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z", "clip-rule": "evenodd" }))), index.h("span", { key: 'd74e0d316d7aae01343ff52f5285fab133ee01eb', class: "ai12z-menu-item__label" }, "Capture"))), index.h("li", { key: '704863f7e0fea6036380d88359715c3b4613ca84', role: "none" }, index.h("button", { key: '96386341f068862e5f9017a1efe81f8145bfe693', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Start Over", "aria-disabled": this.chatLength === 0 ? "true" : "false", onClick: e => {
|
|
1577
1586
|
if (this.chatLength === 0)
|
|
1578
1587
|
return;
|
|
1579
1588
|
this.handleFollowUp(e);
|
|
1580
1589
|
this.closeMenu(true);
|
|
1581
|
-
} }, index.h("span", { key: '
|
|
1590
|
+
} }, index.h("span", { key: 'a0cbeeeaacf902ddfd505e3fb0488b1139fc14bf', class: "ai12z-menu-item__icon" }, index.h("svg", { key: 'a67d1363c4db34efc0ef8a1efceed2794746b9e9', width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '8bad81e7ac00aff9de9a5f481f30cba394b3492c', d: "M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2" }))), index.h("span", { key: '923ff23c54c4da16eb354cb814938aad7dbe3848', class: "ai12z-menu-item__label" }, "Start Over"))), index.h("li", { key: 'edcef70bd7c4eaed65b22948a8893d046b5c22b4', role: "none" }, index.h("button", { key: '9dffd637d14f75a836be0586fec2757dbf9ec1bd', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "View Recent Chat", onClick: e => {
|
|
1582
1591
|
this.handleRecentChat(e);
|
|
1583
1592
|
this.closeMenu(true);
|
|
1584
|
-
} }, index.h("span", { key: '
|
|
1593
|
+
} }, index.h("span", { key: 'fa76c265e229a4c967540ff10204d8c801ed29ab', class: "ai12z-menu-item__icon" }, index.h("svg", { key: 'bf3363b0ece370dd5aa5b6e3fedfebc4fed2dc04', xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: 'c1de8f7a7ecc3663430c0eda0aef7596a4bfe024', d: "M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z" }), index.h("path", { key: 'c70b69583d3568feea22746e53aafc2e126c515b', d: "M12 7v5l3 2" }))), index.h("span", { key: 'dbe600795088274027d6ae7d9b9659e7dc877a9e', class: "ai12z-menu-item__label" }, "View Recent Chat")))))))), !this.hideAllButtons && (index.h("div", { key: '46bb01b59bc75941717b29336ca135b78da02ba4', class: "scrollbar-hidden text-left bg-transparent dark:text-gray-100 outline-none w-full rounded-xl resize-none h-fit max-h-80 overflow-auto" }, index.h("div", { key: '8316ebe388c800d2749f48a373eed18f4d8cc12f', class: "relative w-full min-w-full h-full min-h-fit flex items-center input-prose" }, index.h("div", { key: '5233d660b64cbce8b5b1d4531a442a277001608b', id: `previewContainer-${this.instanceId}`, draggable: true }), index.h("label", { key: '17fbc8d286e714c7aa3032910c947b59974c5cb0', htmlFor: `searchInput-${this.instanceId}`, class: "sr-only" }, "Your message"), index.h("textarea", { key: '9a527bf5e1157553950b803928dd7e35b2c63647', readOnly: this.submitted, "aria-describedby": this.emptyMessageError ? `message-error-${this.instanceId} search-hint-${this.instanceId}` : `search-hint-${this.instanceId}`, "aria-invalid": this.emptyMessageError, id: `searchInput-${this.instanceId}`, ref: el => {
|
|
1585
1594
|
this.searchInputElem = el;
|
|
1586
1595
|
// Autofocus once on first mount, and never while the
|
|
1587
1596
|
// options menu is open — otherwise unrelated re-renders
|
|
@@ -1593,7 +1602,7 @@ const InputForm = class {
|
|
|
1593
1602
|
}
|
|
1594
1603
|
}, placeholder: this.placeholder, autoComplete: "off", class: "w-full p-1 custom-input", value: this.searchInput, rows: 1, onInput: utils.debounce(e => this.handleInputChange(e), 500), onKeyUp: this.adjustHeight, onKeyDown: this.handleKeyDown, onFocus: () => this.searchFormElem.classList.add("input-focus-color"), onBlur: () => this.searchFormElem.classList.remove("input-focus-color"), onPaste: e => {
|
|
1595
1604
|
this.handlePaste(e);
|
|
1596
|
-
} }), index.h("div", { key: '
|
|
1605
|
+
} }), index.h("div", { key: '54d33e51786f35610bcafd28a5df672479601cf0', role: "status", "aria-live": "polite", "aria-atomic": "true", class: "sr-only" }, this.announceMessage), index.h("span", { key: 'a71eb1d8a69ff19ad0a25c109a10ad131b057da9', id: `search-hint-${this.instanceId}`, class: "sr-only" }, "Press Enter to send, Shift+Enter for new line")))), index.h("div", { key: 'c48bea326d1664fc38eeca340367e0a3e162705a', class: "p-1 self-end flex space-x-1 flex-row", style: { width: this.hideAllButtons ? "100%" : "auto" } }, index.h("div", { key: 'b6fd11d68b22ee353231a2992922d1c0d992a068', "aria-label": "Record voice", class: "flex self-center", style: { width: this.hideAllButtons ? "100%" : "auto" } }, this.isEnableMic && (index.h("audio-recorder", { key: '53cdabee4d2bfa8ca2722b986485c6120663dc2c', "component-type": "cta", onStartRecord: _ev => {
|
|
1597
1606
|
// console.log("test", ev)
|
|
1598
1607
|
this.hideAllButtons = true;
|
|
1599
1608
|
}, onStopRecord: _ev => {
|
|
@@ -1611,14 +1620,14 @@ const InputForm = class {
|
|
|
1611
1620
|
});
|
|
1612
1621
|
}
|
|
1613
1622
|
}, 1000);
|
|
1614
|
-
}, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: '
|
|
1623
|
+
}, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: 'a3c6d7e8f5d52dbe6d2d6cc182829b91ce8b8466', class: "flex items-center" }, index.h("div", { key: '2d6c1e44fcd211cbb7927decc8ebc1a58e2c2ee2', "aria-label": "Send message", class: "flex" }, index.h("button", { key: '4f886d15573c290c41daf52fcd0a2e82ef12fbd8', id: `send-message-button-${this.instanceId}`, class: "btn-bg-color text-white transition rounded-full p-1.5 self-center",
|
|
1615
1624
|
// type="submit"
|
|
1616
|
-
disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '
|
|
1625
|
+
disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '720a1bf26391041ae0093ad226eeeb7c791cdf1d', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-6" }, index.h("path", { key: 'e910efa1cb7e905fb734d32007f18eec13c8f97a', "fill-rule": "evenodd", d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z", "clip-rule": "evenodd" })))))))), this.imagesBase64List.length > 0 && (index.h("div", { key: 'd47b58901e9518deddb8d3d65d4e4179eec4a05c', class: "flex flex-wrap gap-2 mx-1 mt-2.5 mb-1" }, this.imagesBase64List.map((img, idx) => (index.h("div", { class: "image-Container sc-ai12z-input-form", key: idx }, index.h("img", { src: img, style: { width: "70px", height: "50px", borderRadius: "12px" } }), index.h("span", { class: "delete-image sc-ai12z-input-form cursor-pointer ml-1", onClick: () => {
|
|
1617
1626
|
this.imagesBase64List = this.imagesBase64List.filter((_, i) => i !== idx);
|
|
1618
1627
|
if (this.imageUploaderRef && typeof this.imageUploaderRef.removeImageAtIndex === "function") {
|
|
1619
1628
|
this.imageUploaderRef.removeImageAtIndex(idx);
|
|
1620
1629
|
}
|
|
1621
|
-
} }, "\u00D7"))))))), this.showErrorMessage && (index.h("div", { key: '
|
|
1630
|
+
} }, "\u00D7"))))))), this.showErrorMessage && (index.h("div", { key: 'a5ce72356cc4b4f4ffa3a7e753d6cc07143ebd46', class: "flex" }, " ", index.h("p", { key: '40640b98780fe7bc5b2e32c1e5f4a61ae8094bbc', class: "error-msg", innerHTML: this.errorMessage }))), this.emptyMessageError && (index.h("div", { key: '09840c296e46ab20ad4f2863cc089f5e597da9b5', class: "flex" }, index.h("p", { key: 'ad516e2b0b3da9e88055c4828719fd973d4ba971', id: `message-error-${this.instanceId}`, class: "error-msg", role: "alert" }, "Message cannot be empty. Please enter a message to send."))), this.chatLength === 0 && (index.h("div", { key: '32e488697d98f2af9d9ef9644c416e84823b3fe4', class: "enter-tip", role: "tooltip" }, "Tip: Press Enter to send, Shift+Enter for new line", " ", index.h("button", { key: 'a75ede4a71ba3dabb9b6707308c1b56207428085', onClick: () => (this.showShortcutsDialog = true), class: "keyboard-shortcuts-btn", "aria-label": "Show keyboard shortcuts", title: "Keyboard shortcuts (?)", tabindex: "0" }, index.h("svg", { key: 'bfe8d8b5d91b51ecd381cf74d198832e5156d083', width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("circle", { key: '8de67ac0fe02ddd576060c1a565db44b186292b9', cx: "12", cy: "12", r: "10" }), index.h("path", { key: 'dd220b97f809b0786bfa608539ad6b9ccad97eb1', d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }), index.h("line", { key: '020e811e75544f5ab872b296160923cc6141403d', x1: "12", y1: "17", x2: "12.01", y2: "17" })))))), this.showShortcutsDialog && (index.h("keyboard-shortcuts-dialog", { key: '339cb22eba5f5256eabd3c59761a7da96fb03a9b', show: this.showShortcutsDialog, shortcuts: this.shortcuts, onCloseDialog: () => (this.showShortcutsDialog = false) }))));
|
|
1622
1631
|
}
|
|
1623
1632
|
get el() { return index.getElement(this); }
|
|
1624
1633
|
};
|