@hivegpt/hiveai-angular 0.0.380 → 0.0.382

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.
Files changed (88) hide show
  1. package/README.md +23 -23
  2. package/bundles/hivegpt-hiveai-angular.umd.js +3145 -0
  3. package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -0
  4. package/bundles/hivegpt-hiveai-angular.umd.min.js +2 -0
  5. package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -0
  6. package/environments/environment.d.ts +15 -0
  7. package/environments/environment.d.ts.map +1 -0
  8. package/esm2015/environments/environment.js +15 -0
  9. package/esm2015/hivegpt-hiveai-angular.js +13 -0
  10. package/esm2015/lib/components/NotificationSocket.js +39 -0
  11. package/esm2015/lib/components/bot-html-editor/bot-html-editor.component.js +112 -0
  12. package/esm2015/lib/components/bot.service.js +50 -0
  13. package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +1743 -0
  14. package/esm2015/lib/components/chatbot/chatbot.component.js +50 -0
  15. package/esm2015/lib/components/conversation.service.js +49 -0
  16. package/esm2015/lib/components/socket-service.service.js +72 -0
  17. package/esm2015/lib/components/translations/translation.service.js +244 -0
  18. package/esm2015/lib/components/video-player/video-player.component.js +123 -0
  19. package/esm2015/lib/hivegpt.module.js +21 -0
  20. package/esm2015/lib/models/video.js +2 -0
  21. package/esm2015/lib/pipes/safe-html.pipe.js +19 -0
  22. package/esm2015/lib/utils/utils.js +36 -0
  23. package/esm2015/public-api.js +7 -0
  24. package/fesm2015/hivegpt-hiveai-angular.js +2541 -0
  25. package/fesm2015/hivegpt-hiveai-angular.js.map +1 -0
  26. package/hivegpt-hiveai-angular.d.ts +13 -0
  27. package/hivegpt-hiveai-angular.d.ts.map +1 -0
  28. package/hivegpt-hiveai-angular.metadata.json +1 -0
  29. package/lib/components/NotificationSocket.d.ts +5 -0
  30. package/lib/components/NotificationSocket.d.ts.map +1 -0
  31. package/lib/components/bot-html-editor/bot-html-editor.component.d.ts +36 -0
  32. package/lib/components/bot-html-editor/bot-html-editor.component.d.ts.map +1 -0
  33. package/lib/components/bot.service.d.ts +12 -0
  34. package/lib/components/bot.service.d.ts.map +1 -0
  35. package/lib/components/chat-drawer/chat-drawer.component.d.ts +255 -0
  36. package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -0
  37. package/lib/components/chatbot/chatbot.component.d.ts +36 -0
  38. package/lib/components/chatbot/chatbot.component.d.ts.map +1 -0
  39. package/lib/components/conversation.service.d.ts +13 -0
  40. package/lib/components/conversation.service.d.ts.map +1 -0
  41. package/lib/components/socket-service.service.d.ts +20 -0
  42. package/lib/components/socket-service.service.d.ts.map +1 -0
  43. package/lib/components/translations/translation.service.d.ts +8 -0
  44. package/lib/components/translations/translation.service.d.ts.map +1 -0
  45. package/lib/components/video-player/video-player.component.d.ts +36 -0
  46. package/lib/components/video-player/video-player.component.d.ts.map +1 -0
  47. package/lib/hivegpt.module.d.ts +3 -0
  48. package/lib/hivegpt.module.d.ts.map +1 -0
  49. package/lib/models/video.d.ts +35 -0
  50. package/lib/models/video.d.ts.map +1 -0
  51. package/lib/pipes/safe-html.pipe.d.ts +8 -0
  52. package/lib/pipes/safe-html.pipe.d.ts.map +1 -0
  53. package/lib/utils/utils.d.ts +3 -0
  54. package/lib/utils/utils.d.ts.map +1 -0
  55. package/package.json +20 -20
  56. package/{src/public-api.ts → public-api.d.ts} +4 -7
  57. package/public-api.d.ts.map +1 -0
  58. package/karma.conf.js +0 -32
  59. package/ng-package.json +0 -7
  60. package/src/environments/environment.ts +0 -19
  61. package/src/lib/components/NotificationSocket.ts +0 -38
  62. package/src/lib/components/bot-html-editor/bot-html-editor.component.css +0 -10
  63. package/src/lib/components/bot-html-editor/bot-html-editor.component.html +0 -11
  64. package/src/lib/components/bot-html-editor/bot-html-editor.component.spec.ts +0 -25
  65. package/src/lib/components/bot-html-editor/bot-html-editor.component.ts +0 -152
  66. package/src/lib/components/bot.service.ts +0 -52
  67. package/src/lib/components/chat-drawer/chat-drawer.component.html +0 -1586
  68. package/src/lib/components/chat-drawer/chat-drawer.component.scss +0 -2907
  69. package/src/lib/components/chat-drawer/chat-drawer.component.ts +0 -2143
  70. package/src/lib/components/chatbot/chatbot.component.html +0 -37
  71. package/src/lib/components/chatbot/chatbot.component.scss +0 -97
  72. package/src/lib/components/chatbot/chatbot.component.ts +0 -44
  73. package/src/lib/components/conversation.service.spec.ts +0 -16
  74. package/src/lib/components/conversation.service.ts +0 -54
  75. package/src/lib/components/socket-service.service.spec.ts +0 -16
  76. package/src/lib/components/socket-service.service.ts +0 -77
  77. package/src/lib/components/translations/translation.service.ts +0 -221
  78. package/src/lib/components/video-player/video-player.component.html +0 -51
  79. package/src/lib/components/video-player/video-player.component.scss +0 -262
  80. package/src/lib/components/video-player/video-player.component.ts +0 -148
  81. package/src/lib/hivegpt.module.ts +0 -18
  82. package/src/lib/models/video.ts +0 -36
  83. package/src/lib/pipes/safe-html.pipe.ts +0 -16
  84. package/src/lib/utils/utils.ts +0 -37
  85. package/tsconfig.lib.json +0 -25
  86. package/tsconfig.lib.prod.json +0 -10
  87. package/tsconfig.spec.json +0 -17
  88. package/tslint.json +0 -17
@@ -0,0 +1,2541 @@
1
+ import * as i1 from '@angular/common/http';
2
+ import { HttpHeaders, HttpClient } from '@angular/common/http';
3
+ import * as i0 from '@angular/core';
4
+ import { Injectable, EventEmitter, ElementRef, Component, ChangeDetectionStrategy, ChangeDetectorRef, Renderer2, ViewChild, ViewChildren, Input, Output, Pipe, Inject, NgModule } from '@angular/core';
5
+ import { DomSanitizer } from '@angular/platform-browser';
6
+ import { Subject, of } from 'rxjs';
7
+ import { map, switchMap, catchError } from 'rxjs/operators';
8
+ import { Socket } from 'ngx-socket-io';
9
+ import { Validators, FormBuilder, FormsModule } from '@angular/forms';
10
+ import * as SpeechSDK from 'microsoft-cognitiveservices-speech-sdk';
11
+ import * as marked from 'marked';
12
+ import { DOCUMENT, CommonModule } from '@angular/common';
13
+ import { MatIconModule } from '@angular/material/icon';
14
+ import { MatSidenavModule } from '@angular/material/sidenav';
15
+ import { QuillModule } from 'ngx-quill';
16
+
17
+ class TranslationService {
18
+ constructor() {
19
+ this.eventId = null;
20
+ this.translationsData = [
21
+ {
22
+ Key: "Copy",
23
+ DefaultValue: "Copy",
24
+ Translations: {
25
+ en: "Copy",
26
+ fr: "Copier",
27
+ it: "Copia",
28
+ es: "Copiar",
29
+ de: "Kopieren",
30
+ "pt-br": "Copiar",
31
+ ar: "نسخ",
32
+ zh: "复制",
33
+ ru: "Копировать"
34
+ }
35
+ },
36
+ {
37
+ Key: "May I assist you with anything else",
38
+ DefaultValue: "Great. May I assist you with anything else?",
39
+ Translations: {
40
+ en: "Great. May I assist you with anything else?",
41
+ fr: "Parfait. Puis-je vous aider avec autre chose ?",
42
+ it: "Perfetto. Posso aiutarti con qualcos'altro?",
43
+ es: "Genial. ¿Puedo ayudarte con algo más?",
44
+ de: "Super. Kann ich Ihnen noch bei etwas anderem helfen?",
45
+ "pt-br": "Ótimo. Posso ajudar com mais alguma coisa?",
46
+ ar: "رائع. هل يمكنني مساعدتك في أي شيء آخر؟",
47
+ zh: "太好了。还有什么我可以帮您的吗?",
48
+ ru: "Отлично. Могу ли я помочь вам с чем-то ещё?"
49
+ }
50
+ },
51
+ {
52
+ Key: "We are sorry we've not been able to answer your question",
53
+ DefaultValue: "We are sorry we've not been able to answer your question. However, our dedicated support team is happy to help. Please <a href=\"mailto:support@social27.com\">click here</a> and a human agent will assist you as soon as possible.",
54
+ Translations: {
55
+ en: "We are sorry we've not been able to answer your question. However, our dedicated support team is happy to help. Please <a href=\"mailto:support@social27.com\">click here</a> and a human agent will assist you as soon as possible.",
56
+ fr: "Nous sommes désolés de ne pas avoir pu répondre à votre question. Cependant, notre équipe d'assistance se fera un plaisir de vous aider. Veuillez <a href=\"mailto:support@social27.com\">cliquer ici</a> et un agent humain vous assistera dès que possible.",
57
+ it: "Ci dispiace di non essere riusciti a rispondere alla tua domanda. Tuttavia, il nostro team di supporto dedicato sarà lieto di aiutarti. Ti preghiamo di <a href=\"mailto:support@social27.com\">fare clic qui</a> e un operatore umano ti assisterà al più presto.",
58
+ es: "Lamentamos no haber podido responder a tu pregunta. Sin embargo, nuestro equipo de soporte estará encantado de ayudarte. Por favor, <a href=\"mailto:support@social27.com\">haz clic aquí</a> y un agente humano te asistirá lo antes posible.",
59
+ de: "Es tut uns leid, dass wir Ihre Frage nicht beantworten konnten. Unser engagiertes Support-Team hilft Ihnen jedoch gerne weiter. Bitte <a href=\"mailto:support@social27.com\">klicken Sie hier</a>, und ein menschlicher Mitarbeiter wird Ihnen so bald wie möglich helfen.",
60
+ "pt-br": "Lamentamos não ter conseguido responder à sua pergunta. No entanto, nossa equipe de suporte dedicada ficará feliz em ajudar. Por favor, <a href=\"mailto:support@social27.com\">clique aqui</a> e um agente humano o ajudará o mais rápido possível.",
61
+ ar: "نأسف لعدم تمكننا من الإجابة على سؤالك. ومع ذلك، يسعد فريق الدعم المخصص لدينا بمساعدتك. يرجى <a href=\"mailto:support@social27.com\">النقر هنا</a> وسيساعدك أحد الوكلاء البشريين في أقرب وقت ممكن.",
62
+ zh: "很抱歉我们未能回答您的问题。不过,我们的专属支持团队很乐意为您提供帮助。请<a href=\"mailto:support@social27.com\">点击这里</a>,人工客服将尽快为您提供协助。",
63
+ ru: "К сожалению, мы не смогли ответить на ваш вопрос. Однако наша служба поддержки с радостью вам поможет. Пожалуйста, <a href=\"mailto:support@social27.com\">нажмите здесь</a>, и наш оператор свяжется с вами как можно скорее."
64
+ }
65
+ },
66
+ {
67
+ Key: 'Ask anything',
68
+ DefaultValue: 'Ask anything',
69
+ Translations: {
70
+ en: 'Ask anything',
71
+ fr: 'Demandez ce que vous voulez',
72
+ it: 'Chiedi qualsiasi cosa',
73
+ es: 'Pregunta lo que quieras',
74
+ de: 'Frag alles',
75
+ 'pt-br': 'Pergunte qualquer coisa',
76
+ ar: 'اسأل أي شيء',
77
+ zh: '随便问',
78
+ ru: 'Спросите что угодно',
79
+ },
80
+ },
81
+ {
82
+ Key: 'Assistant',
83
+ DefaultValue: 'Assistant',
84
+ Translations: {
85
+ en: 'Assistant',
86
+ fr: 'Assistant',
87
+ it: 'Assistente',
88
+ es: 'Asistente',
89
+ de: 'Assistent',
90
+ 'pt-br': 'Assistente',
91
+ ar: 'مساعد',
92
+ zh: '助手',
93
+ ru: 'Ассистент',
94
+ },
95
+ },
96
+ {
97
+ Key: 'Your personal or company information is kept private and secure within this chat.',
98
+ DefaultValue: 'Your personal or company information is kept private and secure within this chat.',
99
+ Translations: {
100
+ en: 'Your personal or company information is kept private and secure within this chat.',
101
+ fr: 'Vos informations personnelles ou celles de votre entreprise sont conservées privées et sécurisées dans cette conversation.',
102
+ it: "Le tue informazioni personali o aziendali sono mantenute private e sicure all'interno di questa chat.",
103
+ es: 'Tu información personal o de la empresa se mantiene privada y segura dentro de este chat.',
104
+ de: 'Ihre persönlichen oder geschäftlichen Informationen bleiben in diesem Chat privat und sicher.',
105
+ 'pt-br': 'Suas informações pessoais ou da empresa são mantidas privadas e seguras dentro deste chat.',
106
+ ar: 'تظل معلوماتك الشخصية أو معلومات شركتك خاصة وآمنة داخل هذه المحادثة.',
107
+ zh: '您的个人或公司信息在此聊天中保持私密和安全。',
108
+ ru: 'Ваша личная или корпоративная информация остается конфиденциальной и защищенной в этом чате.',
109
+ },
110
+ },
111
+ {
112
+ Key: 'Send message',
113
+ DefaultValue: 'Send message',
114
+ Translations: {
115
+ en: 'Send message',
116
+ fr: 'Envoyer un message',
117
+ it: 'Invia messaggio',
118
+ es: 'Enviar mensaje',
119
+ de: 'Nachricht senden',
120
+ 'pt-br': 'Enviar mensagem',
121
+ ar: 'إرسال رسالة',
122
+ zh: '发送消息',
123
+ ru: 'Отправить сообщение',
124
+ },
125
+ },
126
+ {
127
+ Key: 'Platform GPT',
128
+ DefaultValue: 'Platform GPT',
129
+ Translations: {
130
+ en: 'Platform GPT',
131
+ fr: 'Plateforme GPT',
132
+ it: 'Piattaforma GPT',
133
+ es: 'Plataforma GPT',
134
+ de: 'Plattform GPT',
135
+ 'pt-br': 'Plataforma GPT',
136
+ ar: 'منصة GPT',
137
+ zh: '平台 GPT',
138
+ ru: 'Платформа GPT',
139
+ },
140
+ },
141
+ {
142
+ Key: 'New Chat',
143
+ DefaultValue: 'New Chat',
144
+ Translations: {
145
+ en: 'New Chat',
146
+ fr: 'Nouvelle conversation',
147
+ it: 'Nuova chat',
148
+ es: 'Nuevo chat',
149
+ de: 'Neuer Chat',
150
+ 'pt-br': 'Novo chat',
151
+ ar: 'محادثة جديدة',
152
+ zh: '新聊天',
153
+ ru: 'Новый чат',
154
+ },
155
+ },
156
+ {
157
+ Key: 'You',
158
+ DefaultValue: 'You',
159
+ Translations: {
160
+ en: 'You',
161
+ fr: 'Vous',
162
+ it: 'Tu',
163
+ es: 'Tú',
164
+ de: 'Du',
165
+ 'pt-br': 'Você',
166
+ ar: 'أنت',
167
+ zh: '您',
168
+ ru: 'Вы',
169
+ },
170
+ },
171
+ {
172
+ Key: 'Write your message',
173
+ DefaultValue: 'Write your message',
174
+ Translations: {
175
+ en: 'Write your message',
176
+ fr: 'Écrivez votre message',
177
+ it: 'Scrivi il tuo messaggio',
178
+ es: 'Escribe tu mensaje',
179
+ de: 'Schreiben Sie Ihre Nachricht',
180
+ 'pt-br': 'Escreva sua mensagem',
181
+ ar: 'اكتب رسالتك',
182
+ zh: '写下您的消息',
183
+ ru: 'Напишите ваше сообщение',
184
+ },
185
+ },
186
+ {
187
+ Key: 'Send',
188
+ DefaultValue: 'Send',
189
+ Translations: {
190
+ en: 'Send',
191
+ fr: 'Envoyer',
192
+ it: 'Invia',
193
+ es: 'Enviar',
194
+ de: 'Senden',
195
+ 'pt-br': 'Enviar',
196
+ ar: 'إرسال',
197
+ zh: '发送',
198
+ ru: 'Отправить',
199
+ },
200
+ },
201
+ {
202
+ Key: 'Call Interface',
203
+ DefaultValue: 'Call Interface',
204
+ Translations: {
205
+ en: 'Call Interface',
206
+ fr: "Interface d'appel",
207
+ it: 'Interfaccia chiamata',
208
+ es: 'Interfaz de llamada',
209
+ de: 'Anrufoberfläche',
210
+ 'pt-br': 'Interface de chamada',
211
+ ar: 'واجهة الاتصال',
212
+ zh: '呼叫界面',
213
+ ru: 'Интерфейс звонка',
214
+ },
215
+ },
216
+ {
217
+ Key: 'Close',
218
+ DefaultValue: 'Close',
219
+ Translations: {
220
+ en: 'Close',
221
+ fr: 'Fermer',
222
+ it: 'Chiudi',
223
+ es: 'Cerrar',
224
+ de: 'Schließen',
225
+ 'pt-br': 'Fechar',
226
+ ar: 'إغلاق',
227
+ zh: '关闭',
228
+ ru: 'Закрыть',
229
+ },
230
+ },
231
+ ];
232
+ }
233
+ setEventId(id) {
234
+ this.eventId = id;
235
+ }
236
+ getTranslation(key) {
237
+ console.log('eventId', this.eventId);
238
+ // let lang = String(this.getLang(this.eventId)).replace(/^"|"$/g, '');
239
+ const lang = (localStorage.getItem('defaultLanguage-' + this.eventId) || 'en').replace(/^"|"$/g, '');
240
+ const entry = this.translationsData.find((item) => item.Key === key);
241
+ if (!entry) {
242
+ return key; // fallback
243
+ }
244
+ return entry.Translations[lang] || entry.DefaultValue || key;
245
+ }
246
+ getLang(eventId) {
247
+ const suffix = eventId ? `-${eventId}` : '';
248
+ const storageKey = `defaultLanguage${suffix}`;
249
+ return localStorage.getItem(storageKey) || 'en';
250
+ }
251
+ }
252
+ TranslationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TranslationService_Factory() { return new TranslationService(); }, token: TranslationService, providedIn: "root" });
253
+ TranslationService.decorators = [
254
+ { type: Injectable, args: [{
255
+ providedIn: 'root',
256
+ },] }
257
+ ];
258
+
259
+ const formatHoursAndMinutes = (date) => {
260
+ let hours = date.getHours() % 12;
261
+ const minutes = date.getMinutes();
262
+ const amPm = date.getHours() < 12 ? 'AM' : 'PM';
263
+ if (hours === 0)
264
+ hours = 12;
265
+ const formattedHours = hours < 10 ? `0${hours}` : hours;
266
+ const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes;
267
+ return `${formattedHours}:${formattedMinutes} ${amPm}`;
268
+ };
269
+ const ɵ0 = formatHoursAndMinutes;
270
+ const formatNow = (timezone) => {
271
+ const now = new Date();
272
+ if (timezone) {
273
+ const options = {
274
+ hour12: true,
275
+ hour: 'numeric',
276
+ minute: 'numeric',
277
+ timeZone: timezone,
278
+ };
279
+ return now.toLocaleString('en-US', options);
280
+ }
281
+ return formatHoursAndMinutes(now);
282
+ };
283
+ const formatTimeStamps = (timezone, timestamps) => {
284
+ const date = new Date(timestamps + 'Z');
285
+ const options = {
286
+ hour12: true,
287
+ hour: 'numeric',
288
+ minute: 'numeric',
289
+ timeZone: timezone,
290
+ };
291
+ return date.toLocaleString('en-US', options);
292
+ };
293
+
294
+ const prod_environment = {
295
+ USERS_API: 'https://es-user.social27.com/api',
296
+ BASE_URL: 'https://agent-api.hivegpt.ai',
297
+ AGENTS_API: 'https://hive-ai.social27.com/api',
298
+ API_KEY: '82595783-dc9c-4513-8204-709818d51be3',
299
+ SocketUrl: 'https://notif-v2-ws.social27.com/'
300
+ };
301
+ const dev_environment = {
302
+ USERS_API: 'https://pre-user.social27.com/api',
303
+ BASE_URL: 'https://pre-agent-api.hivegpt.ai',
304
+ AGENTS_API: 'https://hive-pre-ai.social27.com/api',
305
+ API_KEY: '66d59244c50b8fb597a101t1',
306
+ SocketUrl: 'https://notif-ws-staging.social27.com/',
307
+ };
308
+
309
+ class ConversationService {
310
+ constructor() {
311
+ this.conversationStorageKeyPrefix = 'conversationKey_';
312
+ this.sessionStorageKeyPrefix = 'sessionKey_';
313
+ this.userSpecificNotification = new Subject();
314
+ }
315
+ generateKey() {
316
+ const timestamp = Math.floor(new Date().getTime() / 1000).toString(16);
317
+ const randomHex = 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, () => {
318
+ return Math.floor(Math.random() * 16).toString(16);
319
+ });
320
+ return timestamp + randomHex;
321
+ }
322
+ getKey(botId, resetKey = false) {
323
+ const storageKey = `${this.conversationStorageKeyPrefix}${botId}`;
324
+ let value = localStorage.getItem(storageKey);
325
+ if (!value || resetKey) {
326
+ value = this.generateKey();
327
+ localStorage.setItem(storageKey, value);
328
+ }
329
+ return value;
330
+ }
331
+ getSessionKey(sessionId, resetKey = false) {
332
+ const storageKey = `${this.sessionStorageKeyPrefix}${sessionId}`;
333
+ let value = localStorage.getItem(storageKey);
334
+ if (!value || resetKey) {
335
+ value = this.generateKey();
336
+ localStorage.setItem(storageKey, value);
337
+ }
338
+ return value;
339
+ }
340
+ sendValidatedUserData(message) {
341
+ this.userSpecificNotification.next(message);
342
+ }
343
+ getUserSpecificNotification() {
344
+ return this.userSpecificNotification.asObservable();
345
+ }
346
+ }
347
+ ConversationService.ɵprov = i0.ɵɵdefineInjectable({ factory: function ConversationService_Factory() { return new ConversationService(); }, token: ConversationService, providedIn: "root" });
348
+ ConversationService.decorators = [
349
+ { type: Injectable, args: [{
350
+ providedIn: 'root',
351
+ },] }
352
+ ];
353
+ ConversationService.ctorParameters = () => [];
354
+
355
+ class NotificationSocket extends Socket {
356
+ constructor() {
357
+ super(socketConfig);
358
+ // Log connection status
359
+ this.on('connect', () => {
360
+ console.log('Socket connected');
361
+ });
362
+ this.on('disconnect', () => {
363
+ console.warn('Socket disconnected');
364
+ });
365
+ this.on('connect_error', (err) => {
366
+ console.error('Socket connection error:', err);
367
+ });
368
+ }
369
+ }
370
+ NotificationSocket.ɵprov = i0.ɵɵdefineInjectable({ factory: function NotificationSocket_Factory() { return new NotificationSocket(); }, token: NotificationSocket, providedIn: "root" });
371
+ NotificationSocket.decorators = [
372
+ { type: Injectable, args: [{
373
+ providedIn: 'root' // This ensures the service is available across the application
374
+ },] }
375
+ ];
376
+ NotificationSocket.ctorParameters = () => [];
377
+ const socketConfig = {
378
+ url: prod_environment.SocketUrl,
379
+ options: {
380
+ transports: ['websocket', 'polling'],
381
+ reconnection: true,
382
+ autoConnect: true,
383
+ upgrade: true,
384
+ reconnectionDelay: 1000,
385
+ reconnectionDelayMax: 5000,
386
+ reconnectionAttempts: Infinity
387
+ }
388
+ };
389
+
390
+ class SocketService {
391
+ constructor(conversationService, notificationSocket) {
392
+ this.conversationService = conversationService;
393
+ this.notificationSocket = notificationSocket;
394
+ this.isCommonSocketInitialized = false;
395
+ this.isUserSpecificSocketInitialized = false;
396
+ this.isUserSpecificEventReleased = true;
397
+ this.messageQueue = [];
398
+ this.releaseInterval = 1000;
399
+ this.intervalSetup = false;
400
+ this.startReleasingMessages();
401
+ }
402
+ isSocketInitialized(isCommon) {
403
+ return isCommon
404
+ ? this.isCommonSocketInitialized
405
+ : this.isUserSpecificSocketInitialized &&
406
+ !this.isUserSpecificEventReleased;
407
+ }
408
+ disconnectSocketConnection() {
409
+ this.notificationSocket.disconnect();
410
+ }
411
+ connectSocketConnection() {
412
+ this.notificationSocket.connect();
413
+ }
414
+ registerUserSpecificHiveSocket(botId, conversation_id, org_id) {
415
+ const commonNotification = 'commonNotification';
416
+ const groupId = `Hive_AI_Notifs_${botId}_${conversation_id}`;
417
+ const groupId_org = `Hive_AI_Notifs_${org_id}`;
418
+ // Remove any pre-existing listeners for commonNotification
419
+ // this.notificationSocket.removeAllListeners(commonNotification);
420
+ // Join the group again with updated botId and conversation_id
421
+ this.notificationSocket.emit('joinData', { groupId });
422
+ this.notificationSocket.emit('joinData', { groupId: groupId_org });
423
+ // Re-register for common notifications
424
+ this.notificationSocket.fromEvent(commonNotification).subscribe((res) => {
425
+ console.log('Received commonNotification:', res);
426
+ this.conversationService.sendValidatedUserData(res);
427
+ }, (error) => {
428
+ console.error('Error receiving commonNotification:', error);
429
+ });
430
+ }
431
+ startReleasingMessages() {
432
+ if (!this.intervalSetup) {
433
+ setInterval(() => {
434
+ if (this.messageQueue.length > 0) {
435
+ const message = this.messageQueue.shift(); // Remove the first message from the queue
436
+ // Handle the message here, e.g., send it to the server or process it
437
+ console.log('Releasing message from queue:', message);
438
+ // this.campaignService.sendValidatedUserData(message);
439
+ }
440
+ }, this.releaseInterval);
441
+ this.intervalSetup = true; // Prevents multiple intervals
442
+ }
443
+ }
444
+ }
445
+ SocketService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SocketService_Factory() { return new SocketService(i0.ɵɵinject(ConversationService), i0.ɵɵinject(NotificationSocket)); }, token: SocketService, providedIn: "root" });
446
+ SocketService.decorators = [
447
+ { type: Injectable, args: [{
448
+ providedIn: 'root',
449
+ },] }
450
+ ];
451
+ SocketService.ctorParameters = () => [
452
+ { type: ConversationService },
453
+ { type: NotificationSocket }
454
+ ];
455
+
456
+ class BotsService {
457
+ constructor(http) {
458
+ this.http = http;
459
+ this.eventDescription = new Subject();
460
+ this.bot_api = 'https://agent-api.hivegpt.ai/';
461
+ }
462
+ fetchSpeechAuthorizationToken(botId, apiKey, domain) {
463
+ const headers = new HttpHeaders({
464
+ 'Content-Type': 'application/json',
465
+ 'x-api-key': apiKey,
466
+ 'hive-bot-id': botId,
467
+ 'domain-authority': domain
468
+ });
469
+ const apiUrl = `${this.bot_api}speech/issue_token`;
470
+ const url = `${apiUrl}`;
471
+ return this.http.get(url, { headers }).pipe(map((resp) => {
472
+ return resp.token;
473
+ }));
474
+ }
475
+ getWorkflowsByOrgId(orgId) {
476
+ const apiUrl = `${this.bot_api}workflows`;
477
+ const url = `${apiUrl}?org_id=${orgId}`;
478
+ return this.http.get(url).pipe(map((resp) => {
479
+ return resp;
480
+ }));
481
+ }
482
+ getWorkflowExecutionById(executionId) {
483
+ const apiUrl = `${this.bot_api}workflows/execution/${executionId}`;
484
+ return this.http.get(apiUrl).pipe(map((resp) => {
485
+ return resp;
486
+ }));
487
+ }
488
+ }
489
+ BotsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function BotsService_Factory() { return new BotsService(i0.ɵɵinject(i1.HttpClient)); }, token: BotsService, providedIn: "root" });
490
+ BotsService.decorators = [
491
+ { type: Injectable, args: [{
492
+ providedIn: 'root',
493
+ },] }
494
+ ];
495
+ BotsService.ctorParameters = () => [
496
+ { type: HttpClient }
497
+ ];
498
+
499
+ // import { Platform } from '@angular/cdk/platform';
500
+ class ChatDrawerComponent {
501
+ constructor(fb, botService, cdr, http, sanitizer, elementRef, renderer, socketService, conversationService, // private platform: Platform
502
+ translationService) {
503
+ this.fb = fb;
504
+ this.botService = botService;
505
+ this.cdr = cdr;
506
+ this.http = http;
507
+ this.sanitizer = sanitizer;
508
+ this.elementRef = elementRef;
509
+ this.renderer = renderer;
510
+ this.socketService = socketService;
511
+ this.conversationService = conversationService;
512
+ this.translationService = translationService;
513
+ this.bodyOverflowClass = 'body-overflow-hidden';
514
+ this.isCollapsedTrue = false;
515
+ this.copilotName = 'HiveXGPT';
516
+ this.feedbackEvent = new EventEmitter();
517
+ this.onCloseEvent = new EventEmitter();
518
+ this.openPage = new EventEmitter();
519
+ this.sessionActions = new EventEmitter();
520
+ this.closeBot = new EventEmitter();
521
+ this.connectWithUser = new EventEmitter();
522
+ this.scheduleMeeting = new EventEmitter();
523
+ this.refreshToken = new EventEmitter();
524
+ this.openSupport = new EventEmitter();
525
+ this.autogenKey = 'Autogen_eDJTtEU-NB0RtIpzq1w';
526
+ this.addToMyAgendaAction = 'add_to_my_agenda';
527
+ this.myUpcomingSessionAction = 'my_upcomming_session';
528
+ this.connectOrFollowAction = 'connect_or_follow';
529
+ this.aiResponse = '';
530
+ this.chatLog = [];
531
+ this.decoder = new TextDecoder();
532
+ this.feedbackDone = false;
533
+ this.greetingMsg = '';
534
+ this.hasBackdropValue = false;
535
+ this.input = '';
536
+ this.listenerAdded = false;
537
+ this.loading = false;
538
+ this.mode = 'over';
539
+ this.quickPrompts = [];
540
+ this.thumbsDownMsgIndex = 0;
541
+ this.userName = '';
542
+ this.showStartAgain = false;
543
+ this.isIOSDevice = false;
544
+ this.showFeedBackIconsIndex = null;
545
+ this.temperature = 1;
546
+ this.speakers = [];
547
+ this.conSessionKey = '';
548
+ this.currentWorkflowActionProgress = 0;
549
+ this.currentWorkflowAction = '';
550
+ this.recognizedText = '';
551
+ this.authorizationToken = '';
552
+ this.region = 'westeurope'; // Set your Azure region here
553
+ this.domainAuthorityValue = "prod-lite";
554
+ this.isChatingWithAi = false;
555
+ this.readAllChunks = (stream) => {
556
+ const reader = stream.getReader();
557
+ const allSuggestions = [];
558
+ reader.closed.catch((err) => {
559
+ if (err) {
560
+ console.error('Error reading stream: ', err);
561
+ }
562
+ this.isChatingWithAi = false;
563
+ this.scrollToBottom();
564
+ return;
565
+ });
566
+ return new ReadableStream({
567
+ start: (controller) => {
568
+ return this.pump(controller, reader, allSuggestions);
569
+ },
570
+ });
571
+ };
572
+ this.currentMessageForEditor = '';
573
+ this.currentIndexForEditor = -1;
574
+ this.isDropdownOpen = false;
575
+ this.selectedAgents = [];
576
+ this.allSelected = false;
577
+ this.isDocInEditMode = false;
578
+ this.isContentLoaded = false;
579
+ this.isCollapsed = false;
580
+ this.isCollapsedForGraph = false;
581
+ this.isCollapsedForFGraph = false;
582
+ // [
583
+ // {
584
+ // "title": "AI News January 2024: In-Depth and Concise - The AI Track",
585
+ // "desc": "Each month, we compile significant news, trends, and happenings in AI, providing detailed summaries with key points in bullet form for concise yet complete understanding.",
586
+ // "link": "https://theaitrack.com/ai-news-january-2024/"
587
+ // },
588
+ // {
589
+ // "title": "Top AI News, January 2024 - Everypixel Journal",
590
+ // "desc": "In this monthly roundup, we spotlight the top AI news stories from January, including the OpenAI vs. The New York Times Lawsuit.",
591
+ // "link": "https://journal.everypixel.com/top-ai-news-january-2024"
592
+ // },
593
+ // {
594
+ // "title": "AI News July 2024: In-Depth and Concise - The AI Track",
595
+ // "desc": "This page features AI News for July 2024, highlighting significant events such as Canva acquiring Leonardo AI.",
596
+ // "link": "https://theaitrack.com/ai-news-july-2024-in-depth-and-concise/"
597
+ // },
598
+ // {
599
+ // "title": "January news roundup: What's new in the world of AI? - Pluralsight",
600
+ // "desc": "OpenAI’s new GPT store, business-ready ChatGPT plans, and a predicted rise in AI-powered cybercrime.",
601
+ // "link": "https://www.pluralsight.com/resources/blog/data/ai-this-month-january-2024"
602
+ // },
603
+ // {
604
+ // "title": "AI News August 2024: In-Depth and Concise - The AI Track",
605
+ // "desc": "This page features AI News for August 2024, with highlights such as Nvidia delaying the “Blackwell” B200 AI chips delivery.",
606
+ // "link": "https://theaitrack.com/ai-news-august-2024-in-depth-and-concise-duplicate/"
607
+ // }
608
+ // ]
609
+ this.dateTime = { now: new Date().toISOString() };
610
+ this.currentSourcesList = [];
611
+ this.isShowEditorButton = true;
612
+ this.isDrawerOpen = true;
613
+ this.chatMain = new ElementRef(null);
614
+ // if (this.platform.IOS) {
615
+ // this.isIOSDevice = true;
616
+ // }
617
+ }
618
+ getTranslation(key) {
619
+ return this.translationService.getTranslation(key);
620
+ }
621
+ ngOnChanges(changes) {
622
+ // Handle eventId changes to update translation service
623
+ if (changes.eventId && changes.eventId.currentValue) {
624
+ this.translationService.setEventId(changes.eventId.currentValue);
625
+ }
626
+ if (changes.s27Token) {
627
+ if (changes.s27Token.currentValue != changes.s27Token.previousValue) {
628
+ this.s27Token = changes.s27Token.currentValue;
629
+ console.log('isFetchDataFor: ', this.isFetchDataFor);
630
+ console.log('msg: ', this.msg);
631
+ console.log('chat: ', this.chat);
632
+ if (this.is401) {
633
+ if (this.isFetchDataFor) {
634
+ this.fetchDataFor(this.msg, this.chat);
635
+ }
636
+ else {
637
+ this.fetchData(this.msg);
638
+ }
639
+ }
640
+ }
641
+ }
642
+ if (changes.orgId) {
643
+ if (changes.orgId.currentValue != changes.orgId.previousValue &&
644
+ changes.orgId.currentValue) {
645
+ this.initializeSocket();
646
+ }
647
+ }
648
+ }
649
+ ngOnInit() {
650
+ // Set the eventId in translation service to get the correct language from localStorage
651
+ if (this.eventId) {
652
+ this.translationService.setEventId(this.eventId);
653
+ }
654
+ this.environment = this.isDev ? dev_environment : prod_environment;
655
+ const domain = window.location.hostname;
656
+ // Determine the header value based on the domain
657
+ if (domain.includes('pre-app.social27.com')) {
658
+ this.domainAuthorityValue = 'pre-prod-lite';
659
+ }
660
+ else if (domain.includes('app.social27.com')) {
661
+ this.domainAuthorityValue = 'prod-lite';
662
+ }
663
+ else if (domain.includes('hivegpt.io')) {
664
+ this.domainAuthorityValue = 'hivegpt';
665
+ }
666
+ // this.fetchMyConnections().subscribe();
667
+ // this.fetchPendingRequests().subscribe();
668
+ this.changeTemperature(this.temperature);
669
+ this.fetchBotConfig().subscribe((res) => {
670
+ this.cdr.markForCheck();
671
+ this.fetchChatHistory().subscribe((response) => {
672
+ this.loading = false;
673
+ this.mapChatHistory(response);
674
+ this.cdr.markForCheck();
675
+ }, (err) => {
676
+ console.error('Error fetching chat history:', err);
677
+ });
678
+ }, (err) => {
679
+ console.error('Error fetching chat history:', err);
680
+ });
681
+ // this.fetchAgents();
682
+ // this.fetchEditorContent();
683
+ this.cdr.markForCheck();
684
+ // this.initializeSocket();
685
+ this.botService.fetchSpeechAuthorizationToken(this.botId, this.apiKey, this.domainAuthorityValue).subscribe((token) => {
686
+ this.authorizationToken = token;
687
+ this.initializeSpeechRecognizer(token);
688
+ });
689
+ }
690
+ initializeSocket() {
691
+ try {
692
+ this.socketService.disconnectSocketConnection();
693
+ }
694
+ catch (error) { }
695
+ setTimeout(() => {
696
+ this.socketService.connectSocketConnection();
697
+ setTimeout(() => {
698
+ console.log('YES INIT');
699
+ const conversation_id = this.conversationService.getKey(this.botId);
700
+ this.socketService.registerUserSpecificHiveSocket(this.botId, conversation_id, this.orgId);
701
+ setTimeout(() => {
702
+ this.listenSockets();
703
+ }, 300);
704
+ }, 200);
705
+ }, 300);
706
+ }
707
+ listenSockets() {
708
+ if (this.eventSubscription) {
709
+ this.eventSubscription.unsubscribe();
710
+ }
711
+ console.log('Listen Socket');
712
+ this.eventSubscription = this.conversationService
713
+ .getUserSpecificNotification()
714
+ .subscribe((res) => {
715
+ var _a, _b, _c, _d, _e, _f;
716
+ console.log('Listen Socket response');
717
+ console.log(res);
718
+ // Check if OtherFields exists in the response
719
+ if ((_b = (_a = res === null || res === void 0 ? void 0 : res.m) === null || _a === void 0 ? void 0 : _a.OtherFields) === null || _b === void 0 ? void 0 : _b.workflow_id) {
720
+ const { percentage, output, action_name, current_action_name, workflow_execution_id, time_stamp, } = (_c = res === null || res === void 0 ? void 0 : res.m) === null || _c === void 0 ? void 0 : _c.OtherFields;
721
+ this.currentWorkflowActionProgress = percentage;
722
+ this.currentWorkflowAction = action_name;
723
+ const actionIndex = this.workflowExecutionDetails.Actions.findIndex((a) => a.Name == current_action_name);
724
+ if (actionIndex !== -1) {
725
+ this.workflowExecutionDetails.Actions[actionIndex]['Output'] = output;
726
+ this.workflowExecutionDetails.Actions[actionIndex]['InsertTimeStamp'] = formatTimeStamps(this.timezone, time_stamp);
727
+ }
728
+ else {
729
+ console.error(`Action with name ${action_name} not found`);
730
+ }
731
+ this.currentWorkflowExecutionDetails = this.workflowExecutionDetails;
732
+ if (this.currentWorkflowActionProgress == 100) {
733
+ this.chatLog[this.chatLog.length - 1]['WorkflowExecutionId'] = workflow_execution_id;
734
+ this.isChatingWithAi = false;
735
+ this.executingWorkflow = false;
736
+ }
737
+ this.cdr.detectChanges();
738
+ }
739
+ else if ((_d = res === null || res === void 0 ? void 0 : res.m) === null || _d === void 0 ? void 0 : _d.OtherFields) {
740
+ const { conversation_id, bot_id, message_id, answer, web_results, search_results, graphs, execution_graphs, suggestions, } = (_e = res === null || res === void 0 ? void 0 : res.m) === null || _e === void 0 ? void 0 : _e.OtherFields;
741
+ console.log('message_id1');
742
+ console.log((_f = res === null || res === void 0 ? void 0 : res.m) === null || _f === void 0 ? void 0 : _f.OtherFields);
743
+ var currentChatMessage = this.chatLog.find((p) => p._id == message_id);
744
+ console.log(this.chatLog);
745
+ if (!currentChatMessage) {
746
+ console.log('message_id2');
747
+ console.log(message_id);
748
+ currentChatMessage = {
749
+ _id: message_id,
750
+ type: 'ai',
751
+ time: formatNow(this.timezone),
752
+ };
753
+ this.chatLog.push(currentChatMessage);
754
+ this.showFeedBackIconsIndex = this.chatLog.length - 1;
755
+ console.log('message_id3');
756
+ console.log(message_id);
757
+ this.cdr.detectChanges();
758
+ }
759
+ // Handle the fields based on their presence
760
+ if (search_results && Array.isArray(search_results)) {
761
+ console.log('Online Search Terms:', search_results);
762
+ currentChatMessage.searchTerms = search_results;
763
+ this.cdr.detectChanges();
764
+ }
765
+ if (web_results && Array.isArray(web_results)) {
766
+ console.log('Web Results:', web_results);
767
+ currentChatMessage.sourcesList = web_results;
768
+ currentChatMessage.displayedSources = web_results === null || web_results === void 0 ? void 0 : web_results.slice(0, 3); // First 3 cards
769
+ currentChatMessage.remainingSources = web_results === null || web_results === void 0 ? void 0 : web_results.slice(3); // Remaining items
770
+ this.cdr.detectChanges();
771
+ }
772
+ if (answer) {
773
+ this.isChatingWithAi = false;
774
+ console.log('Answer:', answer);
775
+ currentChatMessage.message = this.processMessageForDisplay(answer);
776
+ this.cdr.detectChanges();
777
+ this.scrollToBottom();
778
+ }
779
+ if (graphs && Array.isArray(graphs)) {
780
+ console.log('Graphs:', graphs);
781
+ currentChatMessage.graphs = graphs;
782
+ this.cdr.detectChanges();
783
+ }
784
+ if (execution_graphs && Array.isArray(execution_graphs)) {
785
+ console.log('Execution Graphs:', execution_graphs);
786
+ currentChatMessage.executionGraphs = execution_graphs;
787
+ this.cdr.detectChanges();
788
+ }
789
+ if (suggestions && Array.isArray(suggestions)) {
790
+ console.log('suggestions:', suggestions);
791
+ currentChatMessage.relatedListItems = suggestions;
792
+ this.cdr.detectChanges();
793
+ // Process online search terms as needed
794
+ }
795
+ // Add any other fields and their processing here
796
+ }
797
+ else {
798
+ console.warn('OtherFields is missing in the response');
799
+ }
800
+ }, (err) => {
801
+ this.eventSubscription.unsubscribe();
802
+ console.error('Error in fetching data from socket', err);
803
+ });
804
+ }
805
+ initializeSocketAndListen() { }
806
+ handleEvent(data, type) {
807
+ switch (type) {
808
+ case 'webresult':
809
+ break;
810
+ case 'answer':
811
+ break;
812
+ case 'graph':
813
+ break;
814
+ default:
815
+ break;
816
+ }
817
+ }
818
+ ngOnDestroy() {
819
+ if (this.eventSubscription) {
820
+ this.eventSubscription.unsubscribe();
821
+ }
822
+ this.socketService.disconnectSocketConnection();
823
+ //this.socketService.close();
824
+ }
825
+ changeTemperature(newTemperature) {
826
+ if (this.loading)
827
+ return;
828
+ this.temperature = newTemperature;
829
+ const wrapper = document.querySelector('.hivegpt-chat-wrapper');
830
+ // Remove existing theme classes from body
831
+ wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.remove('creative', 'balanced', 'precise');
832
+ switch (newTemperature) {
833
+ case 0:
834
+ wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.add('creative');
835
+ break;
836
+ case 1:
837
+ wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.add('balanced');
838
+ break;
839
+ case 2:
840
+ wrapper === null || wrapper === void 0 ? void 0 : wrapper.classList.add('precise');
841
+ break;
842
+ default:
843
+ break;
844
+ }
845
+ }
846
+ onStartAgain() {
847
+ if (this.loading)
848
+ return;
849
+ this.showStartAgain = false;
850
+ this.chatLog = [];
851
+ this.chatLog.push({
852
+ type: 'ai',
853
+ message: this.greetingMsg,
854
+ time: formatNow(this.timezone),
855
+ });
856
+ this.archieveMessages().subscribe();
857
+ }
858
+ archieveMessages() {
859
+ const headers = new HttpHeaders({
860
+ 'Content-Type': 'application/json',
861
+ 'x-api-key': this.apiKey,
862
+ 'hive-bot-id': this.botId,
863
+ 'domain-authority': this.domainAuthorityValue
864
+ });
865
+ const url = `${this.environment.BASE_URL}/bot/clear-history/${this.botId}/${this.userId}`;
866
+ return this.http.post(url, { headers }).pipe(switchMap((res) => {
867
+ return of(res);
868
+ }), catchError((error) => {
869
+ return of(null);
870
+ }));
871
+ }
872
+ triggerSupport() {
873
+ this.openSupport.emit();
874
+ }
875
+ fetchBotConfig() {
876
+ this.loading = true;
877
+ const headers = new HttpHeaders({
878
+ 'x-api-key': this.apiKey,
879
+ 'hive-bot-id': this.botId,
880
+ 'domain-authority': this.domainAuthorityValue
881
+ });
882
+ const url = `${this.environment.BASE_URL}/bots?bot_id=${this.botId}`;
883
+ return this.http.get(url, { headers }).pipe(switchMap((res) => {
884
+ var _a;
885
+ this.botName = this.getTranslation(res.Name);
886
+ this.botIcon = res.Icon;
887
+ this.botSkills = res === null || res === void 0 ? void 0 : res.Skills;
888
+ this.greetingMsg = res.Greeting;
889
+ this.thumbsDownMessages = ((_a = res === null || res === void 0 ? void 0 : res.NegativeResponses) === null || _a === void 0 ? void 0 : _a.length)
890
+ ? res.NegativeResponses
891
+ : [
892
+ this.getTranslation(`We are sorry we've not been able to answer your question`),
893
+ ];
894
+ this.quickPrompts = res.QuickPrompts;
895
+ this.cdr.markForCheck();
896
+ this.loading = false;
897
+ return of(res);
898
+ }), catchError((error) => {
899
+ console.error('Error fetching chatbot config: ', error);
900
+ this.loading = false;
901
+ return of(null);
902
+ }));
903
+ }
904
+ fetchChatHistory() {
905
+ this.loading = true;
906
+ this.conversationKey = this.conversationService.getKey(this.botId, false);
907
+ this.conSessionKey = this.conversationService.getSessionKey(this.botId, false);
908
+ const url = `${this.environment.BASE_URL}/conversations/${this.conversationKey}?session_id=${this.conSessionKey}`;
909
+ const headers = new HttpHeaders({
910
+ accept: 'application/json',
911
+ 'x-api-key': this.apiKey,
912
+ 'hive-bot-id': this.botId,
913
+ 'domain-authority': this.domainAuthorityValue
914
+ });
915
+ return this.http
916
+ .get(url, { headers })
917
+ .pipe(catchError(this.handleError('fetchConversation')));
918
+ }
919
+ handleError(operation = 'operation', result) {
920
+ return (error) => {
921
+ console.error(`${operation} failed: ${error.message}`);
922
+ return of(result);
923
+ };
924
+ }
925
+ // fetchChatHistory() {
926
+ // this.loading = true;
927
+ // const headers = new HttpHeaders({
928
+ // 'Content-Type': 'application/json',
929
+ // 'x-api-key': this.apiKey,
930
+ // });
931
+ // return this.http
932
+ // .get(`${this.environment.BASE_URL}/conversations/${this.conversationKey}`, { headers })
933
+ // .pipe(
934
+ // switchMap((res: any) => {
935
+ // this.loading = false;
936
+ // return of(res);
937
+ // }),
938
+ // catchError((error: any) => {
939
+ // console.error('Error fetching chat history: ', error);
940
+ // this.loading = false;
941
+ // return of(null);
942
+ // })
943
+ // );
944
+ // }
945
+ mapChatHistory(chats) {
946
+ var _a;
947
+ this.chatLog.push({
948
+ type: 'ai',
949
+ message: this.greetingMsg,
950
+ time: formatNow(this.timezone),
951
+ });
952
+ if (chats && ((_a = chats === null || chats === void 0 ? void 0 : chats.Messages) === null || _a === void 0 ? void 0 : _a.length)) {
953
+ chats === null || chats === void 0 ? void 0 : chats.Messages.forEach((chat) => {
954
+ if (chat.Type == 'user') {
955
+ this.chatLog.push({
956
+ type: 'user',
957
+ message: this.processMessageForDisplay(chat.Text),
958
+ time: formatTimeStamps(this.timezone, chat.InsertTimestamp),
959
+ copied: false,
960
+ isCollapsedTrue: false,
961
+ WorkflowExecutionId: chat.WorkflowExecutionId,
962
+ _id: chat._id
963
+ });
964
+ }
965
+ if (chat.Type == 'ai') {
966
+ var sourcesList = chat.WebLinks || [];
967
+ var displayedSources = chat.WebLinks.slice(0, 3); // First 3 cards
968
+ var remainingSources = chat.WebLinks.slice(3); // Remaining items
969
+ this.chatLog.push({
970
+ type: 'ai',
971
+ message: this.processMessageForDisplay(chat.Text),
972
+ executionGraphs: chat.ExecutionGraphs,
973
+ graphs: chat.Graphs,
974
+ searchTerms: chat.SearchTerms,
975
+ sourcesList: sourcesList,
976
+ displayedSources: displayedSources,
977
+ remainingSources: remainingSources,
978
+ time: formatTimeStamps(this.timezone, chat.InsertTimestamp),
979
+ copied: false,
980
+ isCollapsedTrue: false,
981
+ _id: chat._id
982
+ });
983
+ this.showFeedBackIconsIndex = this.chatLog.length - 1;
984
+ }
985
+ });
986
+ this.showStartAgain = true;
987
+ }
988
+ this.scrollToBottom();
989
+ this.cdr.markForCheck();
990
+ }
991
+ processMessage(message) {
992
+ if (!message || !((message === null || message === void 0 ? void 0 : message.length) > 0)) {
993
+ return '';
994
+ }
995
+ // console.log('here is my message')
996
+ // console.log(message);
997
+ message = message.trim();
998
+ const markdownLinkRegex = /\[([^[]+)]\(([^)]+)\)/g;
999
+ const urlRegex = /(?<!href=")\bhttps?:\/\/\S+(?<![.,])/gi;
1000
+ if (markdownLinkRegex.test(message)) {
1001
+ const html = message.replace(markdownLinkRegex, '<a href="$2" target="_blank">$1</a>');
1002
+ //console.log('Sanitized message: ', message);
1003
+ return this.sanitizeHtml(html);
1004
+ }
1005
+ if (urlRegex.test(message)) {
1006
+ const html = message.replace(urlRegex, '<a href="$&" target="_blank">$&</a>');
1007
+ // console.log('Sanitized message: ', message);
1008
+ return this.sanitizeHtml(html);
1009
+ }
1010
+ message = message.replace(/(?:\r\n|\r|\n)/g, '<br>');
1011
+ message = message.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
1012
+ // Convert Markdown headers to HTML headers
1013
+ message = message.replace(/^(#{1,6})\s+(.*)$/gm, (match, hashes, text) => {
1014
+ const level = hashes.length;
1015
+ return `<h${level}>${text}</h${level}>`;
1016
+ });
1017
+ this.cdr.markForCheck();
1018
+ const sanitizedMessage = this.sanitizeHtml(message);
1019
+ return sanitizedMessage;
1020
+ }
1021
+ ngAfterViewChecked() {
1022
+ const feedbackLinks = this.elementRef.nativeElement.querySelectorAll('.feedback-link');
1023
+ feedbackLinks.forEach((link) => {
1024
+ link.addEventListener('click', this.onFeedbackClick.bind(this, 'zendesk'));
1025
+ });
1026
+ // if (this.elementRef.nativeElement.querySelector('.feedback-link')) {
1027
+ // this.elementRef.nativeElement
1028
+ // .querySelector('.feedback-link')
1029
+ // .addEventListener('click', this.onFeedbackClick.bind(this, 'zendesk'));
1030
+ // }
1031
+ }
1032
+ sanitizeHtml(html) {
1033
+ return this.sanitizer.bypassSecurityTrustHtml(html);
1034
+ }
1035
+ onFeedbackClick(value) {
1036
+ this.feedbackEvent.emit(value);
1037
+ }
1038
+ onClose() {
1039
+ this.renderer.removeClass(document.body, this.bodyOverflowClass);
1040
+ this.onCloseEvent.emit();
1041
+ }
1042
+ sendMessageWithTile(prompt) {
1043
+ this.input = prompt;
1044
+ this.fetchData();
1045
+ this.scrollToBottom();
1046
+ }
1047
+ fetchData(msg = null) {
1048
+ var _a;
1049
+ this.input = msg || ((_a = this.input) === null || _a === void 0 ? void 0 : _a.trim());
1050
+ this.msg = this.input;
1051
+ if (!this.input || this.loading) {
1052
+ return;
1053
+ }
1054
+ this.chatLog.push({
1055
+ type: 'user',
1056
+ message: this.processMessageForDisplay(this.input),
1057
+ time: formatNow(this.timezone),
1058
+ copied: false,
1059
+ isCollapsedTrue: false,
1060
+ });
1061
+ try {
1062
+ const textarea = this.myInput.nativeElement;
1063
+ textarea.style.height = 'hidden'; // Reset the height
1064
+ textarea.style.height = `62px`;
1065
+ }
1066
+ catch (error) { }
1067
+ this.cdr.markForCheck();
1068
+ this.aiResponse = '';
1069
+ this.isChatingWithAi = true;
1070
+ this.makeAskRequest(this.input, this.agents, this.conversationKey);
1071
+ }
1072
+ fetchDataFor(msg, chat) {
1073
+ const inputMsg = msg === null || msg === void 0 ? void 0 : msg.trim();
1074
+ if (!inputMsg || this.loading) {
1075
+ return;
1076
+ }
1077
+ try {
1078
+ chat.relatedListItems = [];
1079
+ this.cdr.detectChanges();
1080
+ }
1081
+ catch (error) { }
1082
+ this.scrollToBottom();
1083
+ this.chatLog.push({
1084
+ type: 'user',
1085
+ message: this.processMessageForDisplay(inputMsg),
1086
+ time: formatNow(this.timezone),
1087
+ copied: false,
1088
+ isCollapsedTrue: false,
1089
+ });
1090
+ this.cdr.markForCheck();
1091
+ this.aiResponse = '';
1092
+ this.isChatingWithAi = true;
1093
+ this.makeAskRequest(inputMsg, this.agents, this.conversationKey, msg, chat);
1094
+ }
1095
+ fetchSmallTalk() {
1096
+ this.loading = true;
1097
+ this.cdr.markForCheck();
1098
+ const url = `${this.environment.BASE_URL}/bot/small-talk/${this.botId}/${this.userId}`;
1099
+ this.http
1100
+ .get(url, {
1101
+ headers: {
1102
+ 'x-api-key': this.apiKey,
1103
+ 'hive-bot-id': this.botId,
1104
+ 'domain-authority': this.domainAuthorityValue
1105
+ },
1106
+ })
1107
+ .pipe(catchError((error) => {
1108
+ console.error('Error while fetching small talk:', error);
1109
+ return of(null);
1110
+ }))
1111
+ .subscribe((response) => {
1112
+ this.loading = false;
1113
+ this.cdr.markForCheck();
1114
+ if (!response) {
1115
+ return;
1116
+ }
1117
+ if (response && response.smallTalk) {
1118
+ this.chatLog.push({
1119
+ type: 'ai',
1120
+ message: this.processMessage(response.smallTalk),
1121
+ time: formatNow(this.timezone),
1122
+ isFeedbackMsg: true,
1123
+ });
1124
+ this.showFeedBackIconsIndex = this.chatLog.length - 2;
1125
+ // this.scrollToBottom();
1126
+ this.cdr.markForCheck();
1127
+ }
1128
+ });
1129
+ }
1130
+ pump(controller, reader, allSuggestions) {
1131
+ reader.read().then(({ done, value }) => {
1132
+ var _a, _b, _c, _d;
1133
+ const lastItem = this.chatLog[this.chatLog.length - 1];
1134
+ if (done) {
1135
+ lastItem.message = this.processMessageForDisplay(lastItem.message);
1136
+ this.chatLog.pop();
1137
+ this.chatLog.push(lastItem);
1138
+ if (allSuggestions === null || allSuggestions === void 0 ? void 0 : allSuggestions.length) {
1139
+ this.chatLog.push({
1140
+ type: 'suggestions',
1141
+ suggestions: allSuggestions,
1142
+ });
1143
+ }
1144
+ controller.close();
1145
+ this.isChatingWithAi = false;
1146
+ // this.scrollToBottom();
1147
+ this.cdr.markForCheck();
1148
+ this.showStartAgain = true;
1149
+ // setTimeout(() => {
1150
+ // this.fetchSmallTalk();
1151
+ // },1000)
1152
+ return;
1153
+ }
1154
+ let decodedChunk = this.decoder.decode(value, { stream: true });
1155
+ this.aiResponse += decodedChunk;
1156
+ if (lastItem.type === 'ai') {
1157
+ const suggestionsMatch = this.aiResponse.match(/<sug>(.*?)<\/sug>/g);
1158
+ if (suggestionsMatch) {
1159
+ suggestionsMatch.forEach((match) => {
1160
+ this.aiResponse = this.aiResponse.replace(match, '');
1161
+ allSuggestions.push(match === null || match === void 0 ? void 0 : match.replace(/<\/?sug>/g, ''));
1162
+ });
1163
+ }
1164
+ lastItem.message = this.aiResponse;
1165
+ this.cdr.markForCheck();
1166
+ }
1167
+ else {
1168
+ this.isChatingWithAi = false;
1169
+ let aiFormattedData;
1170
+ try {
1171
+ console.log('parsing json ');
1172
+ aiFormattedData = JSON.parse(JSON.parse(this.aiResponse));
1173
+ }
1174
+ catch (e) {
1175
+ try {
1176
+ console.log('parsing json 2');
1177
+ aiFormattedData = JSON.parse(this.aiResponse);
1178
+ }
1179
+ catch (e) { }
1180
+ }
1181
+ console.log('parsing json done');
1182
+ if (aiFormattedData && ((_a = aiFormattedData === null || aiFormattedData === void 0 ? void 0 : aiFormattedData.section_id) === null || _a === void 0 ? void 0 : _a.length) > 0) {
1183
+ if (aiFormattedData.section_id == 'company_search' ||
1184
+ aiFormattedData.section_id == 'user_search' ||
1185
+ aiFormattedData.section_id == 'industry_company_search') {
1186
+ this.fetchMyConnections().subscribe();
1187
+ this.fetchPendingRequests().subscribe();
1188
+ }
1189
+ if (aiFormattedData.section_id == this.myUpcomingSessionAction) {
1190
+ var speakerIds = [];
1191
+ (_b = aiFormattedData.content) === null || _b === void 0 ? void 0 : _b.forEach((session) => {
1192
+ speakerIds = [...speakerIds, ...session.speakers];
1193
+ });
1194
+ if ((speakerIds === null || speakerIds === void 0 ? void 0 : speakerIds.length) > 0)
1195
+ this.getSpeakersByStaffIds(speakerIds);
1196
+ }
1197
+ if (aiFormattedData.section_id == this.addToMyAgendaAction &&
1198
+ ((_c = aiFormattedData.content) === null || _c === void 0 ? void 0 : _c.length) > 0) {
1199
+ this.openPage.next({
1200
+ sectionId: aiFormattedData.section_id,
1201
+ sessionIds: aiFormattedData.content,
1202
+ });
1203
+ }
1204
+ if (aiFormattedData.section_id == this.connectOrFollowAction) {
1205
+ let usersLen = (_d = aiFormattedData.content) === null || _d === void 0 ? void 0 : _d.length;
1206
+ if (usersLen > 1) {
1207
+ this.openPage.next({
1208
+ sectionId: 'open_networking_drawer',
1209
+ search: aiFormattedData.content,
1210
+ });
1211
+ }
1212
+ else if (usersLen == 1) {
1213
+ this.openPage.next({
1214
+ sectionId: aiFormattedData.section_id,
1215
+ connetUserIds: [aiFormattedData.content[0].userId],
1216
+ });
1217
+ }
1218
+ }
1219
+ if (aiFormattedData.is_open_page == 'true') {
1220
+ this.openPage.next({
1221
+ sectionId: aiFormattedData.section_id,
1222
+ search: aiFormattedData.content,
1223
+ });
1224
+ if (this.isMobileBrowser()) {
1225
+ aiFormattedData.message +=
1226
+ '\n\n' + '<a id="closeBotNow">Click Here</a> to see results.';
1227
+ }
1228
+ }
1229
+ this.chatLog.push({
1230
+ type: 'ai',
1231
+ message: aiFormattedData.message,
1232
+ action: aiFormattedData,
1233
+ time: formatNow(this.timezone),
1234
+ });
1235
+ if (this.isMobileBrowser()) {
1236
+ setTimeout(() => {
1237
+ this.addCloseBotClickEvent();
1238
+ }, 500);
1239
+ }
1240
+ this.aiResponse = '';
1241
+ }
1242
+ else {
1243
+ this.chatLog.push({
1244
+ type: 'ai',
1245
+ message: this.aiResponse,
1246
+ time: formatNow(this.timezone),
1247
+ });
1248
+ }
1249
+ this.showFeedBackIconsIndex = this.chatLog.length - 1;
1250
+ this.cdr.markForCheck();
1251
+ }
1252
+ this.scrollToBottom();
1253
+ // Enqueue the next data chunk into our target stream
1254
+ controller.enqueue(value);
1255
+ this.pump(controller, reader, allSuggestions);
1256
+ });
1257
+ }
1258
+ submitFeedback(flag, message) {
1259
+ console.log(message);
1260
+ this.feedbackDone = true;
1261
+ this.showFeedBackIconsIndex = null;
1262
+ const conversation_id = this.conversationService.getKey(this.botId);
1263
+ const url = `${this.environment.AGENTS_API}/Conversation/coPilot/${this.botId}/conversation/${conversation_id}/helpful-response`;
1264
+ fetch(url, {
1265
+ method: 'POST',
1266
+ headers: {
1267
+ 'Content-Type': 'application/json',
1268
+ 'apiKey': 'Conversation_WIz/qAm+EEmfOkFaUA/weA==',
1269
+ 'hive-bot-id': this.botId,
1270
+ 'domain-authority': this.domainAuthorityValue
1271
+ },
1272
+ body: JSON.stringify({ messageId: message._id, isHelpful: flag }),
1273
+ }).then(() => {
1274
+ if (flag) {
1275
+ this.chatLog.push({
1276
+ type: 'ai',
1277
+ message: this.thumbsUpMessage ||
1278
+ this.getTranslation('May I assist you with anything else'),
1279
+ time: formatNow(this.timezone),
1280
+ isFeedbackMsg: true,
1281
+ });
1282
+ this.scrollToBottom();
1283
+ this.cdr.markForCheck();
1284
+ this.feedbackDone = false;
1285
+ this.showFeedBackIconsIndex = null;
1286
+ return;
1287
+ }
1288
+ this.chatLog.push({
1289
+ type: 'ai',
1290
+ message: this.processMessage(this.thumbsDownMessages[this.thumbsDownMsgIndex]),
1291
+ time: formatNow(this.timezone),
1292
+ isFeedbackMsg: true,
1293
+ });
1294
+ this.thumbsDownMsgIndex =
1295
+ (this.thumbsDownMsgIndex + 1) % this.thumbsDownMessages.length;
1296
+ this.scrollToBottom();
1297
+ this.cdr.markForCheck();
1298
+ setTimeout(() => {
1299
+ const supportLink = document.getElementById('supportLink88');
1300
+ if (supportLink) {
1301
+ supportLink.addEventListener('click', this.triggerSupport.bind(this));
1302
+ }
1303
+ }, 200);
1304
+ this.feedbackDone = false;
1305
+ this.showFeedBackIconsIndex = null;
1306
+ });
1307
+ }
1308
+ handleKeydown(event) {
1309
+ if (event.key === 'Enter' && !event.shiftKey) {
1310
+ // Prevent default behavior (new line)
1311
+ event.preventDefault();
1312
+ // Call your submit function
1313
+ this.handleSubmit(event);
1314
+ }
1315
+ }
1316
+ handleSubmit(event) {
1317
+ this.fetchData();
1318
+ this.scrollToBottom();
1319
+ }
1320
+ handleUpClick(idx) {
1321
+ if (this.feedbackDone) {
1322
+ return;
1323
+ }
1324
+ this.submitFeedback(true, this.chatLog[idx]);
1325
+ this.chatLog[idx].liked = !this.chatLog[idx].liked;
1326
+ if (this.chatLog[idx].unliked) {
1327
+ this.chatLog[idx].unliked = !this.chatLog[idx].unliked;
1328
+ }
1329
+ this.cdr.markForCheck();
1330
+ }
1331
+ handleDownClick(idx) {
1332
+ if (this.feedbackDone)
1333
+ return;
1334
+ this.submitFeedback(false, this.chatLog[idx]);
1335
+ this.chatLog[idx].unliked = !this.chatLog[idx].unliked;
1336
+ if (this.chatLog[idx].liked)
1337
+ this.chatLog[idx].liked = !this.chatLog[idx].liked;
1338
+ }
1339
+ // handleCopyClick(index: any) {
1340
+ // // Copy the message to the clipboard
1341
+ // const contentToCopy = this.chatLog[index].message;
1342
+ // console.log('contentToCopy');
1343
+ // console.log(contentToCopy);
1344
+ // navigator.clipboard.writeText(contentToCopy).then(() => {
1345
+ // // Indicate that the message was copied
1346
+ // this.chatLog[index].copied = true;
1347
+ // this.cdr.detectChanges();
1348
+ // // Reset the copied state after a delay
1349
+ // setTimeout(() => {
1350
+ // this.chatLog[index].copied = false;
1351
+ // this.cdr.detectChanges();
1352
+ // }, 2000); // Reset after 2 seconds
1353
+ // });
1354
+ // }
1355
+ copyText(id, index) {
1356
+ // Get the text element
1357
+ var textElement = document.getElementById(id);
1358
+ // Create a temporary textarea element to copy the text
1359
+ var tempTextArea = document.createElement('textarea');
1360
+ tempTextArea.value = textElement.innerText;
1361
+ // Append the textarea to the body (necessary for the execCommand to work)
1362
+ document.body.appendChild(tempTextArea);
1363
+ // Select the text inside the textarea
1364
+ tempTextArea.select();
1365
+ // Copy the text to the clipboard
1366
+ document.execCommand('copy');
1367
+ // Remove the temporary textarea
1368
+ document.body.removeChild(tempTextArea);
1369
+ // Optionally, you can alert the user or change the button text to indicate the copy was successful
1370
+ // alert('Text copied to clipboard!');
1371
+ this.chatLog[index].copied = true;
1372
+ this.cdr.detectChanges();
1373
+ // Reset the copied state after a delay
1374
+ setTimeout(() => {
1375
+ this.chatLog[index].copied = false;
1376
+ this.cdr.detectChanges();
1377
+ }, 2000); // Reset after 2 seconds
1378
+ }
1379
+ handleCopyClick(index) {
1380
+ // Copy the message to the clipboard
1381
+ const contentToCopy = this.chatLog[index].message;
1382
+ const resutlt = this.copyText('messageText_' + index, index);
1383
+ }
1384
+ sanitizeHTML(html) {
1385
+ const doc = new DOMParser().parseFromString(html, 'text/html');
1386
+ // Create a new document fragment to hold the simplified content
1387
+ const fragment = document.createDocumentFragment();
1388
+ // Append the children of the body of the parsed document to the fragment
1389
+ Array.from(doc.body.childNodes).forEach((node) => {
1390
+ fragment.appendChild(node.cloneNode(true));
1391
+ });
1392
+ // Create a new div element to hold the simplified HTML
1393
+ const simplifiedDiv = document.createElement('div');
1394
+ simplifiedDiv.appendChild(fragment);
1395
+ // Remove complex tags or attributes as needed
1396
+ // Example: remove scripts
1397
+ simplifiedDiv
1398
+ .querySelectorAll('script')
1399
+ .forEach((script) => script.remove());
1400
+ // Return the simplified HTML as a string
1401
+ return simplifiedDiv.innerHTML;
1402
+ }
1403
+ handleEditorClick(index) {
1404
+ if (this.currentIndexForEditor == -1) {
1405
+ this.currentIndexForEditor = index;
1406
+ this.currentMessageForEditor = this.sanitizeHTML(this.chatLog[index].message);
1407
+ this.currentMessageForEditor = this.currentMessageForEditor.replace('SafeValue must use [property]=binding:', '');
1408
+ this.cdr.detectChanges();
1409
+ }
1410
+ else {
1411
+ if (this.currentIndexForEditor == index) {
1412
+ this.currentMessageForEditor += this.sanitizeHTML(this.chatLog[index].message);
1413
+ this.currentMessageForEditor = this.currentMessageForEditor.replace('SafeValue must use [property]=binding:', '');
1414
+ this.cdr.detectChanges();
1415
+ }
1416
+ else {
1417
+ this.currentIndexForEditor = index;
1418
+ this.currentMessageForEditor = this.sanitizeHTML(this.chatLog[index].message);
1419
+ this.currentMessageForEditor = this.currentMessageForEditor.replace('SafeValue must use [property]=binding:', '');
1420
+ this.cdr.detectChanges();
1421
+ }
1422
+ }
1423
+ this.chatLog[index].isEditor = true;
1424
+ this.cdr.detectChanges();
1425
+ // Reset the copied state after a delay
1426
+ setTimeout(() => {
1427
+ this.chatLog[index].isEditor = false;
1428
+ this.cdr.detectChanges();
1429
+ }, 2000); // Reset after 2 seconds
1430
+ this.editorsDrawer.open();
1431
+ const button = document.getElementById('botcloseplaygroundbutton');
1432
+ if (button) {
1433
+ button.style.display = 'none';
1434
+ }
1435
+ this.cdr.detectChanges();
1436
+ }
1437
+ scrollToBottom() {
1438
+ let counter = 0;
1439
+ const interval = setInterval(() => {
1440
+ this.chatMain.nativeElement.scrollTop = this.chatMain.nativeElement.scrollHeight;
1441
+ if (counter++ > 5)
1442
+ clearInterval(interval);
1443
+ }, 5);
1444
+ }
1445
+ handleAction(action) {
1446
+ console.info('incoming action from the chatbot AI');
1447
+ console.info(action);
1448
+ if (action === null || action === void 0 ? void 0 : action.content) {
1449
+ }
1450
+ }
1451
+ ngAfterViewInit() {
1452
+ // Check if the drawer is initially open and apply overflow hidden to body if so
1453
+ if (this.drawer.opened) {
1454
+ this.setBodyOverflow();
1455
+ }
1456
+ // Listen to changes in the drawer being opened or closed
1457
+ this.drawer.openedChange.subscribe((opened) => {
1458
+ if (opened) {
1459
+ this.setBodyOverflow();
1460
+ }
1461
+ else {
1462
+ this.removeBodyOverflow();
1463
+ }
1464
+ });
1465
+ this.drawer.openedChange.subscribe((opened) => {
1466
+ if (opened) {
1467
+ setTimeout(() => {
1468
+ if (this.myTextarea && this.myTextarea.nativeElement) {
1469
+ this.myTextarea.nativeElement.focus(); // Focus on the textarea
1470
+ }
1471
+ });
1472
+ }
1473
+ });
1474
+ }
1475
+ setBodyOverflow() {
1476
+ this.renderer.addClass(document.body, this.bodyOverflowClass);
1477
+ }
1478
+ removeBodyOverflow() {
1479
+ this.renderer.removeClass(document.body, this.bodyOverflowClass);
1480
+ }
1481
+ getSpeakersByStaffIds(ids) {
1482
+ const url = `${this.environment.USERS_API}/events/${this.eventId}/users/get-by-staff-ids`;
1483
+ fetch(url, {
1484
+ method: 'POST',
1485
+ headers: {
1486
+ 'Content-Type': 'application/json',
1487
+ Authorization: 'Bearer ' + 'your_token_here',
1488
+ },
1489
+ body: JSON.stringify(ids),
1490
+ })
1491
+ .then((response) => {
1492
+ if (response.ok) {
1493
+ return response.json(); // Parse the JSON body of the response
1494
+ }
1495
+ else {
1496
+ throw new Error('Network response was not ok.');
1497
+ }
1498
+ })
1499
+ .then((data) => {
1500
+ if ((data === null || data === void 0 ? void 0 : data.length) > 0) {
1501
+ data.forEach((speaker) => {
1502
+ this.speakers[speaker.id] = speaker;
1503
+ });
1504
+ this.cdr.markForCheck();
1505
+ }
1506
+ })
1507
+ .catch((err) => {
1508
+ console.error('Error fetching data:', err);
1509
+ this.loading = false;
1510
+ });
1511
+ }
1512
+ performSessionAction(sessionId, action) {
1513
+ this.sessionActions.next({
1514
+ sessionId,
1515
+ action,
1516
+ });
1517
+ }
1518
+ addCloseBotClickEvent() {
1519
+ const element = this.elementRef.nativeElement.querySelector('#closeBotNow');
1520
+ if (element) {
1521
+ this.renderer.listen(element, 'click', () => {
1522
+ this.closeBot.next();
1523
+ });
1524
+ }
1525
+ }
1526
+ isMobileBrowser() {
1527
+ return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
1528
+ }
1529
+ connectToUser(userId) {
1530
+ this.connectWithUser.emit({
1531
+ connect: !this.canDisconnect(userId),
1532
+ userId,
1533
+ });
1534
+ setTimeout(() => {
1535
+ this.fetchMyConnections().subscribe((res) => {
1536
+ this.cdr.markForCheck();
1537
+ });
1538
+ this.fetchPendingRequests().subscribe((res) => {
1539
+ this.cdr.markForCheck();
1540
+ });
1541
+ }, 500);
1542
+ }
1543
+ scheduleMeetingWithUser(user) {
1544
+ this.scheduleMeeting.emit(user);
1545
+ }
1546
+ canConnect(userId) {
1547
+ return !(this.canDisconnect(userId) ||
1548
+ this.pendingRequests.find((a) => a == userId));
1549
+ }
1550
+ canDisconnect(userId) {
1551
+ return this.myConnections.find((conn) => conn.userId == userId);
1552
+ }
1553
+ fetchPendingRequests() {
1554
+ const headers = new HttpHeaders({
1555
+ 'Content-Type': 'application/json',
1556
+ apiKey: this.autogenKey,
1557
+ });
1558
+ return this.http
1559
+ .get(`${this.environment.USERS_API}/events/${this.eventId}/connection-requests/autogen/pending-sent-requests?userId=${this.userId}`, { headers })
1560
+ .pipe(switchMap((res) => {
1561
+ this.pendingRequests = res;
1562
+ this.cdr.markForCheck();
1563
+ return of(res);
1564
+ }), catchError((error) => {
1565
+ console.error('Error fetching pending requests: ', error);
1566
+ return of(null);
1567
+ }));
1568
+ }
1569
+ fetchMyConnections() {
1570
+ const headers = new HttpHeaders({
1571
+ 'Content-Type': 'application/json',
1572
+ apiKey: this.autogenKey,
1573
+ });
1574
+ return this.http
1575
+ .get(`${this.environment.USERS_API}/events/${this.eventId}/users-connections/autogen?userId=${this.userId}`, { headers })
1576
+ .pipe(switchMap((res) => {
1577
+ this.myConnections = res;
1578
+ this.cdr.markForCheck();
1579
+ return of(res);
1580
+ }), catchError((error) => {
1581
+ console.error('Error fetching pending requests: ', error);
1582
+ return of(null);
1583
+ }));
1584
+ }
1585
+ // Toggle the dropdown visibility
1586
+ toggleDropdown() {
1587
+ if (!this.agents)
1588
+ this.fetchAgents();
1589
+ this.isDropdownOpen = !this.isDropdownOpen;
1590
+ this.cdr.detectChanges();
1591
+ }
1592
+ onSelectAll(event) {
1593
+ var _a;
1594
+ (_a = this.agents) === null || _a === void 0 ? void 0 : _a.forEach((agent) => (agent.selected = false));
1595
+ this.cdr.detectChanges();
1596
+ }
1597
+ onAgentChange(agent) {
1598
+ //agent.selected = !agent.selected;
1599
+ //console.log(agent);
1600
+ let agentFound = this.agents.filter((p) => p.id == agent.id);
1601
+ if (agentFound && agentFound.length > 0) {
1602
+ agentFound[0].selected = !agentFound[0].selected;
1603
+ this.cdr.detectChanges();
1604
+ }
1605
+ this.cdr.detectChanges();
1606
+ }
1607
+ areAllSelected() {
1608
+ var _a;
1609
+ return (_a = this.agents) === null || _a === void 0 ? void 0 : _a.every((agent) => !agent.selected);
1610
+ }
1611
+ getDropdownHeaderText() {
1612
+ var _a;
1613
+ const selectedAgents = (_a = this.agents) === null || _a === void 0 ? void 0 : _a.filter((agent) => agent.selected);
1614
+ if (!selectedAgents) {
1615
+ return 'All Agents';
1616
+ }
1617
+ else {
1618
+ if (selectedAgents && (selectedAgents === null || selectedAgents === void 0 ? void 0 : selectedAgents.length) === 0) {
1619
+ return 'All Agents';
1620
+ }
1621
+ else {
1622
+ return (selectedAgents === null || selectedAgents === void 0 ? void 0 : selectedAgents.length) > 1
1623
+ ? `${selectedAgents === null || selectedAgents === void 0 ? void 0 : selectedAgents.length} Agents Selected`
1624
+ : `${selectedAgents === null || selectedAgents === void 0 ? void 0 : selectedAgents.length} Agent Selected`;
1625
+ }
1626
+ }
1627
+ }
1628
+ fetchAgents_http() {
1629
+ this.loading = true;
1630
+ const url = `${this.environment.AGENTS_API}/CoPilot/${this.botId}/active-agents`;
1631
+ const headers = new HttpHeaders({
1632
+ 'Content-Type': 'application/json',
1633
+ });
1634
+ return this.http.post(url, {}, { headers }).pipe(switchMap((res) => {
1635
+ if (res) {
1636
+ this.agents = res.map((agent) => (Object.assign(Object.assign({}, agent), { selected: false })));
1637
+ }
1638
+ this.cdr.markForCheck();
1639
+ return of(res);
1640
+ }), catchError((error) => {
1641
+ console.error('Error fetching chatbot config: ', error);
1642
+ return of(null);
1643
+ }));
1644
+ }
1645
+ fetchContent_http() {
1646
+ this.isDocInEditMode = false;
1647
+ this.isContentLoaded = false;
1648
+ console.log('API call function');
1649
+ this.loading = true;
1650
+ const conversation_id = this.conversationService.getKey(this.botId);
1651
+ this.conversationId = conversation_id;
1652
+ const url = `${this.environment.AGENTS_API}/ConversationDocuments?conversationId=${conversation_id}&botId=${this.botId}`;
1653
+ const headers = new HttpHeaders({
1654
+ 'Content-Type': 'application/json',
1655
+ apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',
1656
+ 'domain-authority': this.domainAuthorityValue
1657
+ });
1658
+ return this.http.get(url, { headers }).pipe(switchMap((res) => {
1659
+ if (res) {
1660
+ this.isDocInEditMode = true;
1661
+ this.documentContent = res;
1662
+ console.log('Get API callled success');
1663
+ this.isContentLoaded = true;
1664
+ console.log(res);
1665
+ }
1666
+ this.cdr.markForCheck();
1667
+ return of(res);
1668
+ }), catchError((error) => {
1669
+ console.error('Error fetching chatbot config DJ: ', error);
1670
+ this.isDocInEditMode = false;
1671
+ this.isContentLoaded = true;
1672
+ if ((error === null || error === void 0 ? void 0 : error.status) == 404) {
1673
+ console.log('dash');
1674
+ this.isDocInEditMode = false;
1675
+ this.isContentLoaded = true;
1676
+ }
1677
+ return of(null);
1678
+ }));
1679
+ }
1680
+ fetchAgents() {
1681
+ this.fetchAgents_http().subscribe();
1682
+ }
1683
+ fetchEditorContent() {
1684
+ this.fetchContent_http().subscribe();
1685
+ }
1686
+ // events/${eventId}/users-connections
1687
+ processMessageForDisplay(markdown) {
1688
+ try {
1689
+ // Create a custom renderer to modify <a> tags
1690
+ const renderer = new marked.Renderer();
1691
+ // Customize anchor tags to include target="_blank"
1692
+ renderer.link = (href, title, text) => {
1693
+ return `<a href="${href}" title="${title || ''}" target="_blank">${text}</a>`;
1694
+ };
1695
+ // Parse the markdown content to HTML using marked with the custom renderer
1696
+ const markdownContent = marked.parse(markdown, { renderer: renderer });
1697
+ // Sanitize the parsed HTML using Angular's DomSanitizer
1698
+ const sanitizedHtml = this.sanitizer.bypassSecurityTrustHtml(markdownContent);
1699
+ // Return the safe HTML content for display
1700
+ return sanitizedHtml;
1701
+ }
1702
+ catch (error) {
1703
+ console.error('Error processing markdown:', error);
1704
+ return ''; // Return an empty string or handle the error appropriately
1705
+ }
1706
+ }
1707
+ prepareHtml(markdown) {
1708
+ if (!markdown || !(markdown.length > 0)) {
1709
+ console.error('Input Markdown is null or empty');
1710
+ return '';
1711
+ }
1712
+ // Convert Markdown headers (### or ##) to <strong> for bold headings
1713
+ let html = markdown.replace(/^(#{1,6})\s+(.*)$/gm, (match, hashes, text) => {
1714
+ const level = hashes.length;
1715
+ if (level === 3) {
1716
+ return `<h3><strong>${text}</strong></h3>`;
1717
+ }
1718
+ else if (level === 4) {
1719
+ return `<h4><strong>${text}</strong></h4>`;
1720
+ }
1721
+ return `<strong>${text}</strong>`;
1722
+ });
1723
+ // Convert Markdown code blocks with language to preformatted HTML
1724
+ html = html.replace(/```(\w+)?\n([\s\S]*?)```/g, (match, lang, code) => {
1725
+ const escapedCode = this.escapeHtml(code);
1726
+ const language = lang || 'plaintext';
1727
+ // Create a copy button for the code block
1728
+ return `
1729
+ <div class="code-container">
1730
+ <button id="copy-button" class="copy-button" (click)="copyToClipboard('\`${escapedCode}\`')">${this.getTranslation('Copy')}</button>
1731
+ <pre class="code_block diff"><code class="language-${language}">${escapedCode}</code></pre>
1732
+ </div>`;
1733
+ });
1734
+ // Convert inline code (wrapped in `backticks`) to inline <code> tags
1735
+ html = html.replace(/`([^`]+)`/g, '<code>$1</code>');
1736
+ // Convert Markdown bold to HTML <strong>
1737
+ html = html.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
1738
+ // Convert numbered lists
1739
+ html = html.replace(/^\d+\.\s+(.*)$/gm, '<li>$1</li>');
1740
+ // Convert bullet point lists
1741
+ html = html.replace(/^\-\s+(.*)$/gm, '<li>$1</li>');
1742
+ // Convert Markdown links to HTML links
1743
+ html = html.replace(/\[([^\]]+)]\(([^)]+)\)/g, '<a href="$2" target="_blank">$1</a>');
1744
+ // Convert new lines to <br> tags for paragraphs
1745
+ html = html.replace(/(?:\r\n|\r|\n)/g, '<br>');
1746
+ return html;
1747
+ }
1748
+ // Helper function to escape HTML characters for code blocks
1749
+ escapeHtml(code) {
1750
+ return code
1751
+ .replace(/&/g, '&amp;')
1752
+ .replace(/</g, '&lt;')
1753
+ .replace(/>/g, '&gt;')
1754
+ .replace(/"/g, '&quot;')
1755
+ .replace(/'/g, '&#039;');
1756
+ }
1757
+ // Function to copy text to clipboard
1758
+ copyToClipboard(text) {
1759
+ navigator.clipboard.writeText(text).then(() => {
1760
+ alert('Code copied to clipboard!');
1761
+ }, (err) => {
1762
+ console.error('Could not copy text: ', err);
1763
+ });
1764
+ }
1765
+ toggleCollapse() {
1766
+ this.isCollapsed = !this.isCollapsed;
1767
+ this.cdr.detectChanges();
1768
+ }
1769
+ toggleCollapseGraph() {
1770
+ this.isCollapsedForGraph = !this.isCollapsedForGraph;
1771
+ this.cdr.detectChanges();
1772
+ }
1773
+ toggleCollapseFGraph() {
1774
+ this.isCollapsedForFGraph = !this.isCollapsedForFGraph;
1775
+ this.cdr.detectChanges();
1776
+ }
1777
+ // Extracts the domain from a URL
1778
+ getDomainName(url) {
1779
+ try {
1780
+ const { hostname } = new URL(url);
1781
+ return hostname.replace(/^www\./, ''); // Remove 'www.' if present
1782
+ }
1783
+ catch (_a) {
1784
+ return 'unknown';
1785
+ }
1786
+ }
1787
+ // Generates the favicon URL
1788
+ getFaviconUrl(url) {
1789
+ const domain = this.getDomainName(url);
1790
+ return `https://www.google.com/s2/favicons?sz=128&domain=${domain}`;
1791
+ }
1792
+ onCardClick(sources) {
1793
+ this.currentSourcesList = sources;
1794
+ this.cdr.detectChanges();
1795
+ this.sourcesDrawer.open();
1796
+ const button = document.getElementById('botcloseplaygroundbutton');
1797
+ if (button) {
1798
+ button.style.display = 'none';
1799
+ }
1800
+ }
1801
+ openOuterEditor() {
1802
+ this.fetchEditorContent();
1803
+ this.editorsDrawer.open();
1804
+ this.isDrawerOpen = true;
1805
+ this.isShowEditorButton = false;
1806
+ this.cdr.detectChanges();
1807
+ const button = document.getElementById('botcloseplaygroundbutton');
1808
+ if (button) {
1809
+ button.style.display = 'none';
1810
+ }
1811
+ }
1812
+ onCloseEditor() {
1813
+ this.editorsDrawer.close();
1814
+ this.isDrawerOpen = false;
1815
+ this.isShowEditorButton = true;
1816
+ this.cdr.detectChanges(); // Trigger change detection if needed
1817
+ this.onDrawerClosed();
1818
+ }
1819
+ onCloseSource() {
1820
+ this.sourcesDrawer.close();
1821
+ this.isDrawerOpen = false;
1822
+ this.cdr.detectChanges(); // Trigger change detection if needed
1823
+ this.onDrawerClosed();
1824
+ }
1825
+ onDrawerClosed() {
1826
+ setTimeout(() => {
1827
+ this.isDrawerOpen = true;
1828
+ this.cdr.detectChanges(); // Trigger change detection if needed
1829
+ // Use ngClass to dynamically apply the class
1830
+ const button = document.getElementById('botcloseplaygroundbutton');
1831
+ if (button) {
1832
+ button.style.display = 'block';
1833
+ }
1834
+ }, 800);
1835
+ }
1836
+ toggleDrawer(todo) {
1837
+ this.isDrawerOpen = todo;
1838
+ this.cdr.detectChanges();
1839
+ this.updateButtonVisibility();
1840
+ }
1841
+ updateButtonVisibility() {
1842
+ const button = document.getElementById('botcloseplaygroundbutton');
1843
+ if (button) {
1844
+ button.style.display = this.isDrawerOpen ? 'block' : 'none';
1845
+ }
1846
+ }
1847
+ openLinkInNewTab(link) {
1848
+ window.open(link, '_blank');
1849
+ }
1850
+ adjustTextareaHeight(event) {
1851
+ try {
1852
+ if (event.key === 'Enter' && !event.shiftKey) {
1853
+ // Prevents a new line from being added
1854
+ event.preventDefault();
1855
+ }
1856
+ }
1857
+ catch (error) {
1858
+ }
1859
+ const textarea = event.target;
1860
+ textarea.style.height = 'auto'; // Reset the height
1861
+ textarea.style.height = `${textarea.scrollHeight}px`; // Adjust height to match content
1862
+ // Ensure the height doesn't exceed the max-height set in CSS
1863
+ if (textarea.scrollHeight > 150) {
1864
+ textarea.style.height = `150px`; // Adjust height to match content
1865
+ textarea.style.overflowY = 'auto'; // Enable scrolling if content exceeds 400px
1866
+ }
1867
+ else {
1868
+ textarea.style.overflowY = 'hidden'; // Hide scrollbar if content is within limits
1869
+ }
1870
+ }
1871
+ toggleWorkflows(value = null) {
1872
+ if (!this.checkForCop29BotId()) {
1873
+ this.botService.getWorkflowsByOrgId(this.orgId).subscribe((res) => {
1874
+ this.orgWorkflows = res;
1875
+ this.isWorkflowOpen = value == null ? !this.isWorkflowOpen : value;
1876
+ if (!this.isWorkflowOpen) {
1877
+ this.selectedWorkflow = null;
1878
+ this.openWorkflowInput = false;
1879
+ }
1880
+ this.cdr.detectChanges();
1881
+ });
1882
+ }
1883
+ }
1884
+ initializeForm() {
1885
+ var _a, _b;
1886
+ // Create form controls dynamically based on selectedWorkflow.Trigger.InputSchema
1887
+ const formControls = {};
1888
+ if ((_b = (_a = this.selectedWorkflow) === null || _a === void 0 ? void 0 : _a.Trigger) === null || _b === void 0 ? void 0 : _b.InputSchema) {
1889
+ this.selectedWorkflow.Trigger.InputSchema.forEach((input) => {
1890
+ formControls[input.InputId] = [
1891
+ input.Value || '',
1892
+ input.Required ? Validators.required : null,
1893
+ ];
1894
+ });
1895
+ }
1896
+ // Initialize the form
1897
+ this.workflowForm = this.fb.group(formControls);
1898
+ }
1899
+ onWorkflowSelected(workflow) {
1900
+ this.selectedWorkflow = workflow;
1901
+ this.initializeForm();
1902
+ this.isWorkflowOpen = false;
1903
+ this.openWorkflowInput = true;
1904
+ }
1905
+ onWorkflowSubmit() {
1906
+ const container = document.getElementById('allChats');
1907
+ if (this.workflowForm.valid) {
1908
+ console.log(this.workflowForm.value);
1909
+ var input = this.prepareHtml(this.generateMarkdown(this.selectedWorkflow.Name, this.workflowForm.value));
1910
+ // update last two chatLog entries, set showWorkflowExecutionLoader = false
1911
+ try {
1912
+ this.chatLog[this.chatLog.length - 1]['showWorkflowExecutionLoader'] = false;
1913
+ this.chatLog[this.chatLog.length - 2]['showWorkflowExecutionLoader'] = false;
1914
+ }
1915
+ catch (error) { }
1916
+ this.chatLog.push({
1917
+ type: 'user',
1918
+ message: input,
1919
+ time: formatNow(this.timezone),
1920
+ copied: false,
1921
+ isCollapsedTrue: false,
1922
+ showWorkflowExecutionLoader: true,
1923
+ });
1924
+ console.log(input);
1925
+ this.currentWorkflowActionProgress = 0;
1926
+ this.currentWorkflowAction =
1927
+ 'Executing ' + this.selectedWorkflow.Actions[0].Name;
1928
+ this.isChatingWithAi = true;
1929
+ this.executingWorkflow = true;
1930
+ this.workflowExecutionDetails = {
1931
+ Actions: this.selectedWorkflow.Actions,
1932
+ Inputs: this.workflowForm.value,
1933
+ workflowInputs: this.workflowForm.value,
1934
+ WorkflowName: this.selectedWorkflow.Name,
1935
+ };
1936
+ this.currentWorkflowExecutionDetails = this.workflowExecutionDetails;
1937
+ this.scrollToBottom();
1938
+ this.cdr.detectChanges();
1939
+ // execute the ask endpoint with workflow input
1940
+ this.makeAskRequest(input, this.agents, this.conversationKey, '', null, this.selectedWorkflow['_id'], this.workflowForm.value);
1941
+ }
1942
+ }
1943
+ makeAskRequest(inputMsg, agents, conversationId, msg, chat, workflowId, workflow_inputs) {
1944
+ var _a;
1945
+ var url = `${this.environment.BASE_URL}/ai/ask`;
1946
+ var body = {
1947
+ user_question: inputMsg,
1948
+ user_id: this.userId,
1949
+ bot_id: this.botId,
1950
+ message_id: this.conversationService.generateKey(),
1951
+ session_id: this.conSessionKey,
1952
+ agents: (_a = agents === null || agents === void 0 ? void 0 : agents.filter((p) => p.selected).map((p) => p.id)) !== null && _a !== void 0 ? _a : [],
1953
+ conversation_id: conversationId,
1954
+ first_name: this.firstName,
1955
+ last_name: this.lastName
1956
+ };
1957
+ if (workflowId) {
1958
+ body['workflow_id'] = workflowId;
1959
+ body['workflow_inputs'] = workflow_inputs;
1960
+ }
1961
+ fetch(url, {
1962
+ method: 'POST',
1963
+ headers: {
1964
+ 'Content-Type': 'application/json',
1965
+ Authorization: 'Bearer ' + this.s27Token,
1966
+ 'x-api-key': this.apiKey,
1967
+ 'hive-bot-id': this.botId,
1968
+ 'domain-authority': this.domainAuthorityValue
1969
+ },
1970
+ body: JSON.stringify(body),
1971
+ })
1972
+ .then((response) => {
1973
+ if (response.status === 401 || response.status === 403) {
1974
+ this.is401 = true;
1975
+ this.refreshToken.emit();
1976
+ // If `msg` and `chat` exist, handle them
1977
+ if (msg && chat) {
1978
+ this.msg = msg;
1979
+ this.chat = chat;
1980
+ this.isFetchDataFor = true;
1981
+ }
1982
+ }
1983
+ else {
1984
+ this.is401 = false;
1985
+ }
1986
+ return response.json();
1987
+ })
1988
+ .then((data) => {
1989
+ console.log(data);
1990
+ // Additional response handling if needed
1991
+ })
1992
+ .catch((err) => {
1993
+ console.error('Error: ', err);
1994
+ this.isChatingWithAi = false;
1995
+ });
1996
+ this.input = '';
1997
+ this.selectedWorkflow = null;
1998
+ this.openWorkflowInput = false;
1999
+ this.isWorkflowOpen = false;
2000
+ this.scrollToBottom();
2001
+ this.cdr.markForCheck();
2002
+ }
2003
+ makeAskRequestold(inputMsg, agents, conversationId, msg, chat, workflowId, workflow_inputs) {
2004
+ var _a;
2005
+ const url = `${this.environment.BASE_URL}/ai/ask`;
2006
+ const body = {
2007
+ user_question: inputMsg,
2008
+ user_id: this.userId,
2009
+ bot_id: this.botId,
2010
+ message_id: this.conversationService.generateKey(),
2011
+ agents: (_a = agents === null || agents === void 0 ? void 0 : agents.filter((p) => p.selected).map((p) => p.id)) !== null && _a !== void 0 ? _a : [],
2012
+ conversation_id: conversationId,
2013
+ first_name: this.firstName,
2014
+ last_name: this.lastName,
2015
+ };
2016
+ if (workflowId) {
2017
+ body['workflow_id'] = workflowId;
2018
+ body['workflow_inputs'] = workflow_inputs;
2019
+ }
2020
+ const headers = new HttpHeaders({
2021
+ 'Content-Type': 'application/json',
2022
+ 'x-api-key': this.apiKey,
2023
+ 'hive-bot-id': this.botId,
2024
+ 'domain-authority': this.domainAuthorityValue,
2025
+ });
2026
+ this.http.post(url, body, { headers })
2027
+ .subscribe({
2028
+ next: (data) => {
2029
+ console.log(data);
2030
+ // Additional response handling if needed
2031
+ },
2032
+ error: (err) => {
2033
+ console.error('Error: ', err);
2034
+ this.isChatingWithAi = false;
2035
+ },
2036
+ });
2037
+ this.input = '';
2038
+ this.selectedWorkflow = null;
2039
+ this.openWorkflowInput = false;
2040
+ this.isWorkflowOpen = false;
2041
+ this.scrollToBottom();
2042
+ this.cdr.markForCheck();
2043
+ }
2044
+ generateMarkdown(title, obj) {
2045
+ var _a;
2046
+ // Initialize markdown with the title
2047
+ let markdown = `## ${title}\n`;
2048
+ // Loop through the object and append the field names and values
2049
+ for (const [key, value] of Object.entries(obj)) {
2050
+ var key_label = ((_a = this.selectedWorkflow.Trigger.InputSchema.find((input) => input.InputId === key)) === null || _a === void 0 ? void 0 : _a.Label) || key;
2051
+ markdown += `- **${key_label}**: ${value}\n`;
2052
+ }
2053
+ return markdown;
2054
+ }
2055
+ showWorkflowHistoryDetails(workflow_id) {
2056
+ if (!workflow_id) {
2057
+ this.workflowExecutionDetails = this.currentWorkflowExecutionDetails;
2058
+ this.showWorkflowExecutionDetails = true;
2059
+ this.cdr.detectChanges();
2060
+ return;
2061
+ }
2062
+ this.botService.getWorkflowExecutionById(workflow_id).subscribe((res) => {
2063
+ if (res && res.Actions && Array.isArray(res.Actions)) {
2064
+ res.Actions = res.Actions.map((action) => {
2065
+ if (action.InsertTimeStamp) {
2066
+ action.InsertTimeStamp = formatTimeStamps(this.timezone, action.InsertTimeStamp);
2067
+ }
2068
+ return action;
2069
+ });
2070
+ }
2071
+ res.InsertTimeStamp = formatTimeStamps(this.timezone, res.InsertTimeStamp);
2072
+ this.workflowExecutionDetails = res;
2073
+ this.showWorkflowExecutionDetails = true;
2074
+ this.cdr.detectChanges();
2075
+ });
2076
+ }
2077
+ closeModal() {
2078
+ this.showWorkflowExecutionDetails = false;
2079
+ }
2080
+ objectToArray(obj) {
2081
+ return Object.keys(obj).map((key) => ({ key, value: obj[key] }));
2082
+ }
2083
+ startNewConversation() {
2084
+ this.conversationKey = this.conversationService.getKey(this.botId, true);
2085
+ this.chatLog = [this.chatLog[0]];
2086
+ this.isChatingWithAi = false;
2087
+ setTimeout(() => {
2088
+ this.initializeSocket();
2089
+ }, 200);
2090
+ this.scrollToBottom();
2091
+ this.cdr.detectChanges();
2092
+ }
2093
+ initializeSpeechRecognizer(token) {
2094
+ this.speechConfig = SpeechSDK.SpeechConfig.fromAuthorizationToken(token, this.region);
2095
+ const audioConfig = SpeechSDK.AudioConfig.fromDefaultMicrophoneInput();
2096
+ this.recognizer = new SpeechSDK.SpeechRecognizer(this.speechConfig, audioConfig);
2097
+ this.recognizer.recognizing = (s, e) => {
2098
+ if (e.result.reason === SpeechSDK.ResultReason.RecognizingSpeech) {
2099
+ this.input = e.result.text;
2100
+ console.log(`Recognizing: ${e.result.text}`);
2101
+ this.cdr.markForCheck();
2102
+ }
2103
+ };
2104
+ this.recognizer.recognized = (s, e) => {
2105
+ if (e.result.reason === SpeechSDK.ResultReason.RecognizedSpeech) {
2106
+ this.input = e.result.text;
2107
+ console.log(`Recognized: ${e.result.text}`);
2108
+ this.toggleRecording();
2109
+ this.cdr.markForCheck();
2110
+ }
2111
+ };
2112
+ this.recognizer.canceled = (s, e) => {
2113
+ console.error('Canceled: ', e.errorDetails);
2114
+ };
2115
+ this.recognizer.sessionStopped = (s, e) => {
2116
+ console.log('Session stopped.');
2117
+ this.recognizer.stopContinuousRecognitionAsync();
2118
+ this.fetchData();
2119
+ };
2120
+ }
2121
+ toggleRecording() {
2122
+ this.isRecording = !this.isRecording;
2123
+ if (this.isRecording) {
2124
+ this.startRecognition();
2125
+ }
2126
+ else {
2127
+ this.stopRecognition();
2128
+ }
2129
+ }
2130
+ startRecognition() {
2131
+ this.recognizer.startContinuousRecognitionAsync();
2132
+ }
2133
+ stopRecognition() {
2134
+ this.recognizer.stopContinuousRecognitionAsync();
2135
+ }
2136
+ checkForCop29BotId() {
2137
+ return this.botId == '66fa3f276c5d71e2717bfea8' || this.botId == '671633545652dd78efec848d';
2138
+ }
2139
+ getLatestTime(time) {
2140
+ if (time) {
2141
+ return time;
2142
+ }
2143
+ return new Date().toLocaleTimeString([], {
2144
+ hour: '2-digit',
2145
+ minute: '2-digit',
2146
+ }); // returns current time in 'shortTime' format
2147
+ }
2148
+ }
2149
+ ChatDrawerComponent.decorators = [
2150
+ { type: Component, args: [{
2151
+ selector: 'hivegpt-chat-drawer-package',
2152
+ template: "<button\n *ngIf=\"isShowEditorButton && !checkForCop29BotId()\"\n (click)=\"openOuterEditor()\"\n class=\"fixed-btn\"\n>\n <span style=\"font-size: 12px\" class=\"material-icons notranslate\">\n create\n </span>\n Editor\n</button>\n\n<button\n *ngIf=\"!isShowEditorButton\"\n (click)=\"onCloseEditor()\"\n class=\"fixed-btn-close\"\n>\n <span style=\"font-size: 12px\" class=\"material-icons notranslate\">\n close\n </span>\n {{ getTranslation(\"Close\") }}\n</button>\n\n<mat-drawer-container\n class=\"hivegpt-chat-wrapper\"\n [ngClass]=\"{ 'mat-drawer-container-has-open': isDrawerOpen }\"\n [class.ios-device]=\"isIOSDevice\"\n [hasBackdrop]=\"hasBackdropValue\"\n>\n <mat-drawer\n class=\"drawer\"\n #drawer\n [position]=\"'start'\"\n [mode]=\"'over'\"\n opened=\"true\"\n [class.full-width-drawer]=\"fullView\"\n [style.background]=\"\n 'linear-gradient(' + (bgGradient ? bgGradient.join(', ') : '') + ')'\n \"\n >\n <mat-drawer-content>\n <div class=\"chat-main\">\n <!-- <div class=\"chat-header\">\n <h2> -->\n <!-- {{eventName}} -->\n <!-- </h2> -->\n <!-- <button class=\"closeIcon\" (click)=\"onClose()\">\n <span class=\"material-symbols-outlined\">\n close\n </span>\n </button> -->\n <!-- </div> -->\n\n <div class=\"innerChat\" #chatMain>\n <div (click)=\"startNewConversation()\" class=\"new-conversationbutton\">\n {{ getTranslation(\"New Chat\") }}\n <span\n ><svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"14.061\"\n height=\"14.261\"\n viewBox=\"0 0 14.061 14.261\"\n >\n <path\n id=\"Path_164\"\n data-name=\"Path 164\"\n d=\"M10.146,5.075H4.531A1.544,1.544,0,0,0,3,6.631v7.262A1.544,1.544,0,0,0,4.531,15.45h7.146a1.544,1.544,0,0,0,1.531-1.556V8.187m-7.146,4.15L15.25,3m0,0H11.677M15.25,3V6.631\"\n transform=\"translate(-2.25 -1.939)\"\n fill=\"none\"\n stroke=\"#06f\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.5\"\n />\n </svg>\n </span>\n </div>\n <div class=\"sticky-header-chat\">\n <div class=\"title_chat\">\n <h2>\n <span>\n {{ getTranslation(botName) }}\n <svg\n *ngIf=\"!checkForCop29BotId()\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"31.499\"\n height=\"31.501\"\n viewBox=\"0 0 31.499 31.501\"\n >\n <path\n id=\"Icon_ion-shield-checkmark\"\n data-name=\"Icon ion-shield-checkmark\"\n d=\"M33.685,7.83a1.125,1.125,0,0,0-.925-1.036,49.227,49.227,0,0,1-14.3-4.444,1.125,1.125,0,0,0-.927,0A49.226,49.226,0,0,1,3.24,6.794,1.125,1.125,0,0,0,2.315,7.83a27.621,27.621,0,0,0,1.718,11.9A24.572,24.572,0,0,0,9.07,27.641a25.712,25.712,0,0,0,8.513,6.028,1.125,1.125,0,0,0,.844,0,25.712,25.712,0,0,0,8.513-6.028,24.572,24.572,0,0,0,5.027-7.911,27.621,27.621,0,0,0,1.718-11.9Zm-9.211,5.281-7.791,9a1.125,1.125,0,0,1-.8.389h-.046a1.125,1.125,0,0,1-.788-.322L11.587,18.79a1.125,1.125,0,1,1,1.575-1.607l2.6,2.552,7.01-8.1a1.125,1.125,0,0,1,1.7,1.472Z\"\n transform=\"translate(-2.25 -2.25)\"\n fill=\"#06f\"\n />\n </svg>\n </span>\n <span *ngIf=\"!checkForCop29BotId()\">\n <p class=\"small-title\">\n {{ getTranslation(\"AI-powered\")\n }}<span>{{ getTranslation(\"copilot\") }}</span>\n </p>\n </span>\n </h2>\n </div>\n <div class=\"chatType\" style=\"display: none\">\n <h4 class=\"labelChat\">Choose a conversation style</h4>\n <ul>\n <li (click)=\"changeTemperature(0)\">\n <button [ngClass]=\"{ active: temperature === 0 }\">\n <span class=\"top-section-title\"> More Creative </span>\n </button>\n </li>\n <li (click)=\"changeTemperature(1)\" class=\"fdssfd\">\n <button [ngClass]=\"{ active: temperature === 1 }\">\n <span class=\"top-section-title\"> More Balanced </span>\n </button>\n </li>\n <li (click)=\"changeTemperature(2)\">\n <button [ngClass]=\"{ active: temperature === 2 }\">\n <span class=\"top-section-title\"> More Precise </span>\n </button>\n </li>\n </ul>\n </div>\n </div>\n <!-- chattype -->\n <div\n id=\"allChats\"\n class=\"chat bot\"\n *ngFor=\"let chat of chatLog; let i = index\"\n >\n <div class=\"chat-box\">\n <div class=\"message\">\n <div\n class=\"time-cta\"\n [ngClass]=\"{\n 'time-cta din': showFeedBackIconsIndex === i,\n 'time-cta': showFeedBackIconsIndex != i\n }\"\n >\n <div class=\"Icon_TimeSTamp\" *ngIf=\"chat?.type === 'ai'\">\n <!-- <img [src]=\"botIcon\" [alt]=\"botName || 'Assistant'\" /> -->\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"44\"\n height=\"44\"\n viewBox=\"0 0 44 44\"\n >\n <g\n id=\"Group_121\"\n data-name=\"Group 121\"\n transform=\"translate(4843 -371)\"\n >\n <g\n id=\"Ellipse_18\"\n data-name=\"Ellipse 18\"\n transform=\"translate(-4843 371)\"\n fill=\"#fcfcfc\"\n stroke=\"#dfdfdf\"\n stroke-width=\"1\"\n >\n <circle cx=\"22\" cy=\"22\" r=\"22\" stroke=\"none\" />\n <circle cx=\"22\" cy=\"22\" r=\"21.5\" fill=\"none\" />\n </g>\n <g\n id=\"Group_120\"\n data-name=\"Group 120\"\n transform=\"translate(-4835.141 378.855)\"\n >\n <g\n id=\"Group_1\"\n data-name=\"Group 1\"\n transform=\"translate(7.29 0)\"\n >\n <path\n id=\"Path_1\"\n data-name=\"Path 1\"\n d=\"M93.774,41.324,98.757,44.2v5.753l-4.983,2.877-4.983-2.877V44.2l4.983-2.877m0-2.034L87.03,43.183V50.97l6.744,3.893,6.744-3.893V43.183L93.774,39.29Z\"\n transform=\"translate(-87.03 -39.29)\"\n fill=\"gray\"\n />\n </g>\n <g\n id=\"Group_2\"\n data-name=\"Group 2\"\n transform=\"translate(0 12.717)\"\n >\n <path\n id=\"Path_2\"\n data-name=\"Path 2\"\n d=\"M52.374,113.544l4.983,2.877v5.753l-4.983,2.877-4.983-2.877v-5.753l4.983-2.877m0-2.034L45.63,115.4v7.787l6.744,3.893,6.744-3.893V115.4l-6.744-3.893Z\"\n transform=\"translate(-45.63 -111.51)\"\n fill=\"gray\"\n />\n </g>\n <g\n id=\"Group_3\"\n data-name=\"Group 3\"\n transform=\"translate(14.793 12.717)\"\n >\n <path\n id=\"Path_3\"\n data-name=\"Path 3\"\n d=\"M136.384,113.544l4.983,2.877v5.753l-4.983,2.877-4.983-2.877v-5.753l4.983-2.877m0-2.034L129.64,115.4v7.787l6.744,3.893,6.744-3.893V115.4l-6.744-3.893Z\"\n transform=\"translate(-129.64 -111.51)\"\n fill=\"gray\"\n />\n </g>\n </g>\n </g>\n </svg>\n\n <div\n class=\"dateTime\"\n [style.color]=\"dateTimeColor ? '' : ''\"\n >\n <span>{{ getTranslation(\"Assistant\") }}</span>\n {{ chat?.time }}\n </div>\n </div>\n\n <div class=\"Icon_TimeSTamp\" *ngIf=\"chat?.type === 'user'\">\n <div class=\"user-Box\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"44\"\n height=\"44\"\n viewBox=\"0 0 44 44\"\n >\n <g\n id=\"Ellipse_17\"\n data-name=\"Ellipse 17\"\n fill=\"#fcfcfc\"\n stroke=\"#dfdfdf\"\n stroke-width=\"1\"\n >\n <circle cx=\"22\" cy=\"22\" r=\"22\" stroke=\"none\" />\n <circle cx=\"22\" cy=\"22\" r=\"21.5\" fill=\"none\" />\n </g>\n <path\n id=\"Icon_grommet-user-expert\"\n data-name=\"Icon grommet-user-expert\"\n d=\"M14.24,20.443a9.472,9.472,0,1,0-9.472-9.472,9.472,9.472,0,0,0,9.472,9.472Zm10.329,5.225c-1.957-3.347-6.516-5.225-10.329-5.225-3.145,0-8.046.805-10.761,5.225\"\n transform=\"translate(7.976 8.416)\"\n fill=\"none\"\n stroke=\"gray\"\n stroke-width=\"1.5\"\n />\n </svg>\n\n <div class=\"dateTime\">\n <span>{{ getTranslation(\"You\") }}</span>\n {{ chat?.time }}\n </div>\n </div>\n <div class=\"bards\">\n <div\n class=\"bars\"\n *ngIf=\"\n chat?.WorkflowExecutionId ||\n chat?.showWorkflowExecutionLoader\n \"\n >\n <button\n class=\"icon-button\"\n (click)=\"\n showWorkflowHistoryDetails(chat.WorkflowExecutionId)\n \"\n >\n <i class=\"fas fa-bars\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n <div class=\"researchingCard\">\n <div\n *ngIf=\"\n (chat?.searchTerms && chat?.searchTerms.length > 0) ||\n (chat?.sourcesList && chat?.sourcesList.length > 0)\n \"\n class=\"card-header d-flex align-items-center\"\n (click)=\"toggleCollapse()\"\n >\n <span class=\"icon\"\n ><i class=\"bx bx-plus-circle bx-sm\"></i\n ></span>\n <span class=\"ml-2\"\n >Researching\n <i\n id=\"toggleIcon\"\n class=\"toggle-icon ml-2 fa\"\n [ngClass]=\"{\n 'fa-chevron-down': isCollapsed,\n 'fa-chevron-up': !isCollapsed\n }\"\n ></i\n ></span>\n </div>\n <div\n *ngIf=\"chat?.searchTerms && chat?.searchTerms.length > 0\"\n [ngClass]=\"{ collapse: isCollapsed }\"\n >\n <ul class=\"list-group list-group-flush uptList\">\n <li\n *ngFor=\"let term of chat?.searchTerms\"\n class=\"list-group-item\"\n >\n Searching for\n <strong>{{ term }}</strong>\n </li>\n </ul>\n\n <h5\n class=\"mt-2\"\n *ngIf=\"chat?.sourcesList && chat?.sourcesList.length > 0\"\n >\n <i class=\"bx bx-unite\"></i> Sources\n </h5>\n <div\n class=\"sources-container\"\n *ngIf=\"chat?.sourcesList && chat?.sourcesList.length > 0\"\n >\n <div\n class=\"source-card\"\n *ngFor=\"\n let source of chat?.displayedSources;\n let i = index\n \"\n >\n <div>\n <div class=\"source-title\">{{ source.title }}</div>\n <div class=\"source-url\">\n <img\n class=\"relative block\"\n [src]=\"getFaviconUrl(source.link)\"\n [alt]=\"getDomainName(source.link) + ' favicon'\"\n />\n {{ getDomainName(source.link) }}\n </div>\n <div class=\"popup\">\n <div\n class=\"source-url\"\n (click)=\"openLinkInNewTab(source.link)\"\n >\n <img\n class=\"relative block\"\n [src]=\"getFaviconUrl(source.link)\"\n [alt]=\"getDomainName(source.link) + ' favicon'\"\n />\n {{ getDomainName(source.link) }}\n </div>\n <h5 (click)=\"openLinkInNewTab(source.link)\">\n {{ source.title }}\n </h5>\n <p (click)=\"openLinkInNewTab(source.link)\">\n {{ source.desc }}\n </p>\n </div>\n </div>\n </div>\n <ng-container\n *ngIf=\"\n chat?.remainingSources &&\n chat?.remainingSources.length > 0\n \"\n >\n <div\n class=\"source-card\"\n (click)=\"onCardClick(chat?.sourcesList)\"\n >\n <div>\n <div class=\"source-title\">\n <img\n *ngFor=\"\n let source of chat?.remainingSources;\n let i = index\n \"\n class=\"relative block\"\n [src]=\"getFaviconUrl(source.link)\"\n [alt]=\"getDomainName(source.link) + ' favicon'\"\n />\n </div>\n <div class=\"source-url\">\n View {{ chat?.remainingSources.length }} more\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n\n <div\n *ngIf=\"chat?.type === 'ai' || chat?.type === 'user'\"\n [ngStyle]=\"{\n background:\n chat?.type === 'ai' && bgBubbleAi\n ? ''\n : chat?.type === 'user' && bgBubbleUser\n ? ''\n : ''\n }\"\n >\n <div id=\"messageText_{{ i }}\">\n <p\n *ngIf=\"chat?.type === 'ai' || chat?.type === 'user'\"\n [ngClass]=\"{\n 'SearchTitle ai': chat?.type === 'ai',\n 'SearchTitle user': chat?.type === 'user'\n }\"\n [ngStyle]=\"{\n background:\n chat?.type === 'ai' && messageTextColorAi\n ? messageTextColorAi\n : chat?.type === 'user' && messageTextColorUser\n ? messageTextColorUser\n : 'defaultBackground',\n color:\n chat?.type === 'ai' && messageTextColorAi\n ? messageTextColorAi\n : chat?.type === 'user' && messageTextColorUser\n ? messageTextColorUser\n : 'defaultColor'\n }\"\n [innerHTML]=\"chat?.message\"\n ></p>\n </div>\n </div>\n\n <div\n class=\"progress-container\"\n *ngIf=\"chat?.showWorkflowExecutionLoader\"\n >\n <div class=\"circular-loader\">\n <div\n class=\"loader-spinner\"\n *ngIf=\"currentWorkflowActionProgress < 100\"\n [ngStyle]=\"{\n transform: 'rotate(' + percentage * 3.6 + 'deg)'\n }\"\n ></div>\n <div\n class=\"checkmark\"\n *ngIf=\"currentWorkflowActionProgress == 100\"\n >\n <svg viewBox=\"0 0 52 52\">\n <circle\n class=\"checkmark-circle\"\n cx=\"26\"\n cy=\"26\"\n r=\"25\"\n fill=\"none\"\n />\n <path\n class=\"checkmark-check\"\n fill=\"none\"\n d=\"M14 27l7 7 16-16\"\n />\n </svg>\n </div>\n\n <div\n class=\"loader-text\"\n *ngIf=\"currentWorkflowActionProgress < 100\"\n >\n {{ currentWorkflowActionProgress }}%\n </div>\n </div>\n <div class=\"loader-label\">{{ currentWorkflowAction }}...</div>\n </div>\n\n <div\n class=\"exicution mt-2\"\n *ngIf=\"\n chat?.type === 'ai' &&\n chat?.graphs &&\n chat?.graphs.length > 0\n \"\n >\n <h5 *ngIf=\"chat?.type === 'ai'\">\n <i class=\"bx bx-network-chart\"></i> Graphs\n <i\n (click)=\"toggleCollapseFGraph()\"\n class=\"toggle-icon ml-2 fa\"\n [ngClass]=\"{\n 'fas fa-chevron-down': isCollapsedForFGraph,\n 'fas fa-chevron-up': !isCollapsedForFGraph\n }\"\n ></i>\n </h5>\n <img\n *ngFor=\"let image of chat?.graphs\"\n class=\"graph-img\"\n [ngClass]=\"{ collapse: isCollapsedForFGraph }\"\n [src]=\"image\"\n alt=\"\"\n />\n </div>\n <ng-container *ngIf=\"!checkForCop29BotId()\">\n <div\n class=\"exicution mt-2\"\n *ngIf=\"\n chat?.type === 'ai' &&\n chat?.executionGraphs &&\n chat?.executionGraphs?.length > 0\n \"\n >\n <h5 *ngIf=\"chat?.type === 'ai'\">\n <i class=\"bx bx-network-chart\"></i> Execution Path Diagram\n For Data Visualization Workflow\n <i\n (click)=\"toggleCollapseGraph()\"\n class=\"toggle-icon ml-2 fa\"\n [ngClass]=\"{\n 'fas fa-chevron-down': isCollapsedForGraph,\n 'fas fa-chevron-up': !isCollapsedForGraph\n }\"\n ></i>\n </h5>\n <img\n *ngFor=\"let image of chat?.executionGraphs\"\n class=\"graph-img\"\n [ngClass]=\"{ collapse: isCollapsedForGraph }\"\n [src]=\"image\"\n alt=\"\"\n />\n </div>\n </ng-container>\n <div class=\"cta\" *ngIf=\"chat?.type === 'ai' && i > 0\">\n <div\n class=\"copyBox\"\n title=\"Copy\"\n [ngClass]=\"\n showFeedBackIconsIndex == i ? 'show-always' : 'show-hover'\n \"\n >\n <button\n title=\"{{ chat?.copied ? 'Copied!' : 'Copy' }}\"\n class=\"copy\"\n [class.active]=\"chat?.copied\"\n (click)=\"handleCopyClick(i)\"\n >\n <i *ngIf=\"chat?.copied\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9 16.17L4.83 12L3.41 13.41L9 19L21 7L19.59 5.59L9 16.17Z\"\n fill=\"#566563\"\n />\n </svg>\n </i>\n\n <i *ngIf=\"!chat?.copied\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M19.24 2H8.84C8.14 2 7.58 2.56 7.58 3.26V16.84C7.58 17.54 8.14 18.1 8.84 18.1H19.24C19.94 18.1 20.5 17.54 20.5 16.84V3.26C20.5 2.56 19.94 2 19.24 2ZM19.24 16.84H8.84V3.26H19.24V16.84ZM4.74 6.52C4.04 6.52 3.48 7.08 3.48 7.78V20.36C3.48 21.06 4.04 21.62 4.74 21.62H15.14C15.84 21.62 16.4 21.06 16.4 20.36V18.88H14.96V20.36H4.74V7.78H6.18V6.52H4.74Z\"\n fill=\"#566563\"\n />\n </svg>\n </i>\n </button>\n\n <button\n *ngIf=\"!checkForCop29BotId()\"\n class=\"up copy\"\n title=\"{{ chat?.isEditor ? 'Added!' : 'Add to editor' }}\"\n (click)=\"handleEditorClick(i)\"\n >\n <svg\n *ngIf=\"!chat?.isEditor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20.152\"\n height=\"20.152\"\n viewBox=\"0 0 20.152 20.152\"\n >\n <g\n id=\"Icon_feather-edit\"\n data-name=\"Icon feather-edit\"\n transform=\"translate(-2.5 -2.166)\"\n >\n <path\n id=\"Path_166\"\n data-name=\"Path 166\"\n d=\"M11.5,6H4.889A1.889,1.889,0,0,0,3,7.889v13.22A1.889,1.889,0,0,0,4.889,23h13.22A1.889,1.889,0,0,0,20,21.108V14.5\"\n transform=\"translate(0 -1.179)\"\n fill=\"none\"\n stroke=\"#393939\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1\"\n />\n <path\n id=\"Path_167\"\n data-name=\"Path 167\"\n d=\"M21.915,3.4a2,2,0,0,1,2.833,2.833l-8.971,8.971L12,16.152l.944-3.777Z\"\n transform=\"translate(-3.334 0)\"\n fill=\"none\"\n stroke=\"#393939\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1\"\n />\n </g>\n </svg>\n\n <i *ngIf=\"chat?.isEditor\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M9 16.17L4.83 12L3.41 13.41L9 19L21 7L19.59 5.59L9 16.17Z\"\n fill=\"#566563\"\n />\n </svg>\n </i>\n </button>\n\n <button\n class=\"up copy\"\n title=\"Like\"\n [class.active]=\"chat?.liked\"\n (click)=\"handleUpClick(i)\"\n >\n <i *ngIf=\"chat?.liked\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M8.38989 18.4902V8.33022C8.38989 7.93022 8.50989 7.54022 8.72989 7.21022L11.4599 3.15022C11.8899 2.50022 12.9599 2.04022 13.8699 2.38022C14.8499 2.71022 15.4999 3.81022 15.2899 4.79022L14.7699 8.06022C14.7299 8.36022 14.8099 8.63022 14.9799 8.84022C15.1499 9.03022 15.3999 9.15022 15.6699 9.15022H19.7799C20.5699 9.15022 21.2499 9.47022 21.6499 10.0302C22.0299 10.5702 22.0999 11.2702 21.8499 11.9802L19.3899 19.4702C19.0799 20.7102 17.7299 21.7202 16.3899 21.7202H12.4899C11.8199 21.7202 10.8799 21.4902 10.4499 21.0602L9.16989 20.0702C8.67989 19.7002 8.38989 19.1102 8.38989 18.4902Z\"\n fill=\"#17235B\"\n />\n <path\n d=\"M5.21 6.37988H4.18C2.63 6.37988 2 6.97988 2 8.45988V18.5199C2 19.9999 2.63 20.5999 4.18 20.5999H5.21C6.76 20.5999 7.39 19.9999 7.39 18.5199V8.45988C7.39 6.97988 6.76 6.37988 5.21 6.37988Z\"\n fill=\"#17235B\"\n />\n </svg>\n </i>\n <i *ngIf=\"!chat?.liked\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10.4037 20.9264L10.381 20.9038L10.3557 20.8843L7.72165 18.85L8.02965 18.4516L10.7161 20.5315C10.9228 20.7195 11.2181 20.8517 11.4962 20.9377C11.7978 21.0309 12.1451 21.09 12.4801 21.09H16.2801C16.8572 21.09 17.4266 20.8625 17.8751 20.5306C18.3159 20.2044 18.6912 19.7385 18.8305 19.1997L21.2428 11.8732C21.4379 11.3309 21.4287 10.749 21.0965 10.2887C20.7583 9.81377 20.1844 9.58999 19.5801 9.58999H15.5801C15.2031 9.58999 14.8615 9.43143 14.6276 9.16215L14.627 9.16142C14.3873 8.88649 14.2756 8.51549 14.3345 8.11501L14.8322 4.9195C14.9978 4.1052 14.4664 3.24596 13.7053 2.98804C13.3277 2.85165 12.9297 2.89129 12.61 2.99839C12.2949 3.10396 11.9772 3.30172 11.7881 3.57673L11.7881 3.57671L11.7851 3.58107L7.96352 9.26689L7.55454 8.99314L11.3751 3.30891L11.3755 3.30836C11.8763 2.56103 13.0109 2.19028 13.8726 2.51744L13.8834 2.52151L13.8943 2.52509C14.9044 2.8564 15.556 3.98765 15.3317 5.01314L15.3284 5.02805L15.326 5.04314L14.836 8.19314L14.836 8.19313L14.8351 8.19928C14.8184 8.31642 14.7981 8.60268 15.0138 8.84924L15.0248 8.86177L15.0366 8.87354C15.1833 9.02026 15.3817 9.09999 15.5901 9.09999H19.5901C20.4308 9.09999 21.1176 9.44886 21.5113 10.0079L21.5124 10.0095C21.8964 10.5502 21.9908 11.2849 21.7202 12.0291L21.7175 12.0365L21.7151 12.044L19.3251 19.324L19.3198 19.34L19.3156 19.3564C19.0058 20.5707 17.6766 21.6 16.2801 21.6H12.4801C12.2411 21.6 11.8403 21.5625 11.4297 21.4512C11.0123 21.338 10.6406 21.1633 10.4037 20.9264Z\"\n fill=\"#566563\"\n stroke=\"#566563\"\n />\n <path\n d=\"M5.37988 20.4999H4.37988C3.52442 20.4999 2.98559 20.2982 2.65822 19.9825C2.33437 19.6702 2.12988 19.1614 2.12988 18.3499V8.5499C2.12988 7.73843 2.33437 7.22962 2.65822 6.91731C2.98559 6.6016 3.52442 6.3999 4.37988 6.3999H5.37988C6.23534 6.3999 6.77418 6.6016 7.10155 6.91731C7.4254 7.22962 7.62988 7.73843 7.62988 8.5499V18.3499C7.62988 19.1614 7.4254 19.6702 7.10155 19.9825C6.77418 20.2982 6.23534 20.4999 5.37988 20.4999ZM4.37988 6.8999C4.0934 6.8999 3.83578 6.9164 3.61382 6.96689C3.38745 7.01838 3.16822 7.11196 2.99258 7.2876C2.81559 7.46459 2.72807 7.67966 2.68301 7.89002C2.63948 8.09318 2.62988 8.31967 2.62988 8.5499V18.3499C2.62988 18.5801 2.63948 18.8066 2.68301 19.0098C2.72807 19.2201 2.81559 19.4352 2.99258 19.6122C3.16822 19.7878 3.38745 19.8814 3.61382 19.9329C3.83578 19.9834 4.0934 19.9999 4.37988 19.9999H5.37988C5.66637 19.9999 5.92398 19.9834 6.14595 19.9329C6.37232 19.8814 6.59155 19.7878 6.76719 19.6122C6.94418 19.4352 7.0317 19.2201 7.07676 19.0098C7.12028 18.8066 7.12988 18.5801 7.12988 18.3499V8.5499C7.12988 8.31967 7.12028 8.09318 7.07676 7.89002C7.0317 7.67966 6.94418 7.46459 6.76719 7.2876C6.59155 7.11196 6.37232 7.01838 6.14595 6.96689C5.92398 6.9164 5.66637 6.8999 5.37988 6.8999H4.37988Z\"\n fill=\"#566563\"\n stroke=\"#566563\"\n />\n </svg>\n </i>\n </button>\n <button\n class=\"down copy\"\n title=\"Dislike\"\n [class.active]=\"chat?.unliked\"\n (click)=\"handleDownClick(i)\"\n >\n <i *ngIf=\"chat?.unliked\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M15.61 5.50002V15.66C15.61 16.06 15.49 16.45 15.27 16.78L12.54 20.84C12.11 21.49 11.04 21.95 10.13 21.61C9.15002 21.28 8.50002 20.18 8.71002 19.2L9.23002 15.93C9.27002 15.63 9.19002 15.36 9.02002 15.15C8.85002 14.96 8.60002 14.84 8.33002 14.84H4.22002C3.43002 14.84 2.75002 14.52 2.35002 13.96C1.97002 13.42 1.90002 12.72 2.15002 12.01L4.61002 4.52002C4.92002 3.28002 6.27002 2.27002 7.61002 2.27002H11.51C12.18 2.27002 13.12 2.50002 13.55 2.93002L14.83 3.92002C15.32 4.30002 15.61 4.88002 15.61 5.50002Z\"\n fill=\"#17235B\"\n />\n\n <path\n d=\"M18.7901 17.6099H19.8201C21.3701 17.6099 22.0001 17.0099 22.0001 15.5299V5.4799C22.0001 3.9999 21.3701 3.3999 19.8201 3.3999H18.7901C17.2401 3.3999 16.6101 3.9999 16.6101 5.4799V15.5399C16.6101 17.0099 17.2401 17.6099 18.7901 17.6099Z\"\n fill=\"#17235B\"\n />\n </svg>\n </i>\n\n <i *ngIf=\"!chat?.unliked\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M10.1237 21.481L10.1148 21.4778L10.1059 21.4748C9.09577 21.1435 8.44416 20.0122 8.66849 18.9867L8.67175 18.9718L8.6741 18.9568L9.1641 15.8068L9.16413 15.8068L9.16501 15.8006C9.18175 15.6835 9.20207 15.3972 8.98633 15.1507L8.97536 15.1381L8.96359 15.1263C8.81687 14.9796 8.61841 14.8999 8.41004 14.8999H4.41004C3.56937 14.8999 2.88252 14.551 2.48884 13.992L2.4877 13.9904C2.10371 13.4497 2.00931 12.715 2.27994 11.9708L2.28263 11.9634L2.28509 11.9559L4.67509 4.67586L4.68035 4.65985L4.68451 4.64353C4.99418 3.42996 6.33271 2.3999 7.72004 2.3999H11.52C11.7591 2.3999 12.1599 2.43736 12.5704 2.54872C12.9878 2.66194 13.3596 2.83655 13.5965 3.07346L13.6191 3.09608L13.6444 3.11563L16.2785 5.14986L15.9705 5.54825L13.2875 3.47111C13.0799 3.2763 12.7837 3.1413 12.5061 3.05412C12.2031 2.95897 11.8551 2.8999 11.52 2.8999H7.72004C7.1429 2.8999 6.57353 3.12735 6.12508 3.45926C5.68428 3.78551 5.30892 4.25142 5.16963 4.79019L2.75738 12.1167C2.56223 12.659 2.57147 13.2409 2.90366 13.7012C3.24183 14.1761 3.81578 14.3999 4.42004 14.3999H8.42004C8.79702 14.3999 9.13867 14.5585 9.37252 14.8277L9.37315 14.8285C9.61286 15.1034 9.72457 15.4745 9.66568 15.875C9.6656 15.8755 9.66552 15.8761 9.66544 15.8766L9.16795 19.0704C9.00242 19.8841 9.53299 20.7428 10.2933 21.0013C10.6685 21.1391 11.0675 21.0978 11.3857 20.9917C11.7001 20.8869 12.0218 20.6898 12.2121 20.4132L12.2121 20.4132L12.215 20.4088L16.0351 14.7253L16.4472 15.0045L12.6251 20.691L12.6249 20.6912C12.259 21.2361 11.5347 21.5999 10.8 21.5999C10.5668 21.5999 10.3358 21.5596 10.1237 21.481Z\"\n fill=\"#566563\"\n stroke=\"#566563\"\n />\n <path\n d=\"M19.6201 17.6H18.6201C17.7647 17.6 17.2258 17.3983 16.8985 17.0826C16.5746 16.7703 16.3701 16.2615 16.3701 15.45V5.65C16.3701 4.83853 16.5746 4.32972 16.8985 4.0174C17.2258 3.7017 17.7647 3.5 18.6201 3.5H19.6201C20.4756 3.5 21.0144 3.7017 21.3418 4.0174C21.6656 4.32972 21.8701 4.83853 21.8701 5.65V15.45C21.8701 16.2615 21.6656 16.7703 21.3418 17.0826C21.0144 17.3983 20.4756 17.6 19.6201 17.6ZM18.6201 4C18.3336 4 18.076 4.01649 17.8541 4.06699C17.6277 4.11848 17.4085 4.21206 17.2328 4.3877C17.0558 4.56469 16.9683 4.77976 16.9232 4.99011C16.8797 5.19328 16.8701 5.41977 16.8701 5.65V15.45C16.8701 15.6802 16.8797 15.9067 16.9232 16.1099C16.9683 16.3202 17.0558 16.5353 17.2328 16.7123C17.4085 16.8879 17.6277 16.9815 17.8541 17.033C18.076 17.0835 18.3336 17.1 18.6201 17.1H19.6201C19.9066 17.1 20.1642 17.0835 20.3862 17.033C20.6126 16.9815 20.8318 16.8879 21.0074 16.7123C21.1844 16.5353 21.2719 16.3202 21.317 16.1099C21.3605 15.9067 21.3701 15.6802 21.3701 15.45V5.65C21.3701 5.41977 21.3605 5.19328 21.317 4.99011C21.2719 4.77976 21.1844 4.56469 21.0074 4.3877C20.8318 4.21206 20.6126 4.11848 20.3862 4.06699C20.1642 4.01649 19.9066 4 19.6201 4H18.6201Z\"\n fill=\"#566563\"\n stroke=\"#566563\"\n />\n </svg>\n </i>\n </button>\n </div>\n </div>\n <div\n class=\"Related mt-2\"\n *ngIf=\"\n showFeedBackIconsIndex === i &&\n !isChatingWithAi &&\n chat?.relatedListItems &&\n chat?.relatedListItems.length > 0\n \"\n >\n <h5 *ngIf=\"chat?.type === 'ai'\">\n <i class=\"bx bx-list-check\"></i> Related\n </h5>\n <div class=\"card-container\" *ngIf=\"chat?.type === 'ai'\">\n <ul class=\"list-container\">\n <ng-container *ngFor=\"let item of chat?.relatedListItems\">\n <li (click)=\"fetchDataFor(item, chat)\">{{ item }}</li>\n </ng-container>\n </ul>\n </div>\n </div>\n </div>\n </div>\n\n <div\n class=\"cta-faqs quick-prompts-extended\"\n *ngIf=\"i == 0 && quickPrompts?.length\"\n >\n <!-- <div *ngFor=\"let tile of quickPrompts\" class=\"cta\"\n (click)=\"sendMessageWithTile(tile.prompt)\">\n Q: {{ tile.text }}\n </div> -->\n <div class=\"cta_suggestions\">\n <button\n *ngFor=\"let tile of quickPrompts\"\n (click)=\"sendMessageWithTile(tile.prompt)\"\n >\n <ng-container *ngIf=\"tile\">{{ tile.text }}</ng-container>\n </button>\n </div>\n </div>\n <div class=\"chat bot\" *ngIf=\"i == 0 && botSkills\">\n <div class=\"chat-box\">\n <div class=\"message\">\n <p [innerHTML]=\"processMessageForDisplay(botSkills)\"></p>\n &nbsp;\n </div>\n </div>\n </div>\n <div *ngIf=\"chat?.suggestions?.length\">\n <h4 class=\"labelChat\">\n Here are some things EventsGPT Copilot can help you do:\n </h4>\n <div class=\"cta_suggestions\">\n <button\n *ngFor=\"let suggestion of chat?.suggestions\"\n (click)=\"sendMessageWithTile(suggestion)\"\n >\n <ng-container *ngIf=\"suggestion\">{{\n suggestion\n }}</ng-container>\n </button>\n </div>\n </div>\n <div\n *ngIf=\"\n chat?.action?.section_id == 'company_search' ||\n chat?.action?.section_id == 'user_search' ||\n chat?.action?.section_id == 'industry_company_search'\n \"\n >\n <div class=\"box\">\n <div class=\"tiktokwrapper\">\n <div\n class=\"tiktokshell\"\n *ngFor=\"let user of chat?.action.users\"\n >\n <div class=\"videoPhotobox\">\n <ng-conatiner\n *ngIf=\"user?.photoPath && !user.userVideosModel\"\n >\n <img [src]=\"user?.photoPath\" />\n </ng-conatiner>\n <ng-conatiner *ngIf=\"user.userVideosModel\">\n <app-video-player\n *ngIf=\"user?.userVideosModel\"\n [isDev]=\"isDev\"\n [currentUserId]=\"userId\"\n [videoObj]=\"user?.userVideosModel\"\n [user]=\"user\"\n [eventId]=\"eventId\"\n type=\"1\"\n >\n </app-video-player>\n </ng-conatiner>\n </div>\n\n <div\n class=\"noPhoto\"\n *ngIf=\"!user?.photoPath && !user.userVideosModel\"\n >\n <h3>\n {{ user.firstName | slice : 0 : 1\n }}{{ user.lastName | slice : 0 : 1 }}\n </h3>\n </div>\n <div class=\"overlymask\" *ngIf=\"!user.userVideosModel\"></div>\n <div class=\"onshell-content\">\n <div class=\"title-shell\">\n <h3>{{ user.firstName }} {{ user.lastName }}</h3>\n <h3 class=\"companyName\">{{ user.company }}</h3>\n </div>\n <div class=\"button-shell\">\n <button\n class=\"Connectbtn\"\n (click)=\"connectToUser(user.userId)\"\n >\n {{\n canConnect(user.userId)\n ? \"Connect\"\n : canDisconnect(user.userId)\n ? \"Disconnect\"\n : \"Request\n Sent\"\n }}\n </button>\n <button\n class=\"schedulebtn\"\n (click)=\"scheduleMeetingWithUser(user)\"\n >\n Schedule\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div *ngIf=\"chat?.action?.section_id == myUpcomingSessionAction\">\n <div class=\"agenda-items-wrapper\" class=\"agenda-items-wrapper\">\n <div class=\"list-view\">\n <div\n class=\"session-detail-wrapper card-background-session\"\n *ngFor=\"let upcomingSession of chat?.action.content\"\n >\n <div class=\"thumbnail\">\n <img\n alt=\"Introduction to the Imaging Radar Academy\"\n src=\"https://s27media.azureedge.net/8008/profile_pic/453cea2c-feba-11ed-8c0b-00155d025b0a.png\"\n class=\"\"\n />\n <!---->\n <!---->\n <!----><button\n class=\"play-btn color-primary\"\n title=\"Play Session: Introduction to the Imaging Radar Academy\"\n >\n <span class=\"material-icons notranslate\">\n play_circle_outline\n </span>\n <!---->\n </button>\n <!---->\n <!---->\n </div>\n <!---->\n <!---->\n <div class=\"content p-3\">\n <div\n class=\"d-flex justify-content-between align-items-center\"\n >\n <div class=\"d-flex flex-column\">\n <p class=\"fs-xs mb-0 body-text-color\">\n {{\n upcomingSession.dateTimeRange.start\n | date\n : \"MM-dd-yyyy\n HH:mm\"\n : \"UTC\"\n }}\n -\n {{\n upcomingSession.dateTimeRange.end\n | date : \"MM-dd-yyyy HH:mm\" : \"UTC\"\n }}\n {{ upcomingSession.timeZone.id }}\n </p>\n <!---->\n <!---->\n <!-- <p class=\"fs-xs mb-2 color-secondary\" title=\"Session Type: Generative AI\">Generative AI </p> -->\n <!---->\n </div>\n <div class=\"d-flex align-items-center actions px-2\">\n <!---->\n <button\n (click)=\"\n performSessionAction(\n upcomingSession.id,\n 'view-session'\n )\n \"\n class=\"s27-btn-icon body-text-color\"\n title=\"View Session Information: Introduction to the Imaging Radar Academy\"\n >\n <span class=\"material-icons notranslate\">\n remove_red_eye\n </span>\n </button>\n\n <button\n (click)=\"\n performSessionAction(\n upcomingSession.id,\n 'add-to-agenda'\n )\n \"\n class=\"s27-btn-icon body-text-color\"\n >\n <span\n class=\"material-icons notranslate\"\n title=\"Add Session: Introduction to the Imaging Radar Academy to My agendaa\"\n >\n event_available\n </span>\n </button>\n <!---->\n <!---->\n <!---->\n <!---->\n\n <button\n (click)=\"\n performSessionAction(upcomingSession.id, 'play')\n \"\n class=\"s27-btn-icon body-text-color\"\n title=\"Copy session link to share\"\n >\n <span class=\"material-icons notranslate\">\n play_circle_outline\n </span>\n </button>\n <!---->\n </div>\n </div>\n <h2 class=\"body-text-color\">\n {{ upcomingSession.title }}\n </h2>\n <div\n class=\"session-description color-secondary\"\n [innerHTML]=\"sanitizeHtml(upcomingSession.description)\"\n ></div>\n <ul\n class=\"speakers grid-2-cols\"\n *ngFor=\"let speakerId of upcomingSession.speakers\"\n >\n <li class=\"\">\n <div class=\"image\" title=\"Blair Wunderlich\">\n <img\n alt=\"Blair Wunderlich\"\n [src]=\"speakers[speakerId]?.photoPath\"\n class=\"\"\n />\n <!---->\n <!---->\n <!---->\n </div>\n <!---->\n <div\n class=\"content pl-3\"\n style=\"text-transform: none\"\n >\n <div class=\"mb-0 body-text-color fs-xs fw-500\">\n {{ speakers[speakerId]?.firstName }}\n {{ speakers[speakerId]?.lastName }}\n </div>\n <div class=\"color-secondary fs-xxs\">\n {{ speakers[speakerId]?.jobTitle }}\n </div>\n <div class=\"color-secondary fs-xxs\">\n {{ speakers[speakerId]?.company }}\n </div>\n </div>\n <!---->\n </li>\n </ul>\n <!---->\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"chat bot\" *ngIf=\"isChatingWithAi && !executingWorkflow\">\n <div class=\"chat-box\">\n <div class=\"message\">\n <div class=\"time-cta\">\n <div class=\"Icon_TimeSTamp\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"44\"\n height=\"44\"\n viewBox=\"0 0 44 44\"\n >\n <g\n id=\"Group_121\"\n data-name=\"Group 121\"\n transform=\"translate(4843 -371)\"\n >\n <g\n id=\"Ellipse_18\"\n data-name=\"Ellipse 18\"\n transform=\"translate(-4843 371)\"\n fill=\"#fcfcfc\"\n stroke=\"#dfdfdf\"\n stroke-width=\"1\"\n >\n <circle cx=\"22\" cy=\"22\" r=\"22\" stroke=\"none\" />\n <circle cx=\"22\" cy=\"22\" r=\"21.5\" fill=\"none\" />\n </g>\n <g\n id=\"Group_120\"\n data-name=\"Group 120\"\n transform=\"translate(-4835.141 378.855)\"\n >\n <g\n id=\"Group_1\"\n data-name=\"Group 1\"\n transform=\"translate(7.29 0)\"\n >\n <path\n id=\"Path_1\"\n data-name=\"Path 1\"\n d=\"M93.774,41.324,98.757,44.2v5.753l-4.983,2.877-4.983-2.877V44.2l4.983-2.877m0-2.034L87.03,43.183V50.97l6.744,3.893,6.744-3.893V43.183L93.774,39.29Z\"\n transform=\"translate(-87.03 -39.29)\"\n fill=\"gray\"\n />\n </g>\n <g\n id=\"Group_2\"\n data-name=\"Group 2\"\n transform=\"translate(0 12.717)\"\n >\n <path\n id=\"Path_2\"\n data-name=\"Path 2\"\n d=\"M52.374,113.544l4.983,2.877v5.753l-4.983,2.877-4.983-2.877v-5.753l4.983-2.877m0-2.034L45.63,115.4v7.787l6.744,3.893,6.744-3.893V115.4l-6.744-3.893Z\"\n transform=\"translate(-45.63 -111.51)\"\n fill=\"gray\"\n />\n </g>\n <g\n id=\"Group_3\"\n data-name=\"Group 3\"\n transform=\"translate(14.793 12.717)\"\n >\n <path\n id=\"Path_3\"\n data-name=\"Path 3\"\n d=\"M136.384,113.544l4.983,2.877v5.753l-4.983,2.877-4.983-2.877v-5.753l4.983-2.877m0-2.034L129.64,115.4v7.787l6.744,3.893,6.744-3.893V115.4l-6.744-3.893Z\"\n transform=\"translate(-129.64 -111.51)\"\n fill=\"gray\"\n />\n </g>\n </g>\n </g>\n </svg>\n <div\n class=\"dateTime\"\n [style.color]=\"dateTimeColor ? '' : ''\"\n >\n <span> {{ getTranslation(\"Assistant\") }}</span>\n {{ this.getLatestTime(chat?.time) }}\n </div>\n </div>\n </div>\n <div class=\"loaderbox\">\n <div class=\"loader-pkg\">\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"chat bot\" *ngIf=\"loading\">\n <div class=\"chat-box\">\n <div class=\"message\">\n <div class=\"time-cta\">\n <div class=\"Icon_TimeSTamp\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"44\"\n height=\"44\"\n viewBox=\"0 0 44 44\"\n >\n <g\n id=\"Group_121\"\n data-name=\"Group 121\"\n transform=\"translate(4843 -371)\"\n >\n <g\n id=\"Ellipse_18\"\n data-name=\"Ellipse 18\"\n transform=\"translate(-4843 371)\"\n fill=\"#fcfcfc\"\n stroke=\"#dfdfdf\"\n stroke-width=\"1\"\n >\n <circle cx=\"22\" cy=\"22\" r=\"22\" stroke=\"none\" />\n <circle cx=\"22\" cy=\"22\" r=\"21.5\" fill=\"none\" />\n </g>\n <g\n id=\"Group_120\"\n data-name=\"Group 120\"\n transform=\"translate(-4835.141 378.855)\"\n >\n <g\n id=\"Group_1\"\n data-name=\"Group 1\"\n transform=\"translate(7.29 0)\"\n >\n <path\n id=\"Path_1\"\n data-name=\"Path 1\"\n d=\"M93.774,41.324,98.757,44.2v5.753l-4.983,2.877-4.983-2.877V44.2l4.983-2.877m0-2.034L87.03,43.183V50.97l6.744,3.893,6.744-3.893V43.183L93.774,39.29Z\"\n transform=\"translate(-87.03 -39.29)\"\n fill=\"gray\"\n />\n </g>\n <g\n id=\"Group_2\"\n data-name=\"Group 2\"\n transform=\"translate(0 12.717)\"\n >\n <path\n id=\"Path_2\"\n data-name=\"Path 2\"\n d=\"M52.374,113.544l4.983,2.877v5.753l-4.983,2.877-4.983-2.877v-5.753l4.983-2.877m0-2.034L45.63,115.4v7.787l6.744,3.893,6.744-3.893V115.4l-6.744-3.893Z\"\n transform=\"translate(-45.63 -111.51)\"\n fill=\"gray\"\n />\n </g>\n <g\n id=\"Group_3\"\n data-name=\"Group 3\"\n transform=\"translate(14.793 12.717)\"\n >\n <path\n id=\"Path_3\"\n data-name=\"Path 3\"\n d=\"M136.384,113.544l4.983,2.877v5.753l-4.983,2.877-4.983-2.877v-5.753l4.983-2.877m0-2.034L129.64,115.4v7.787l6.744,3.893,6.744-3.893V115.4l-6.744-3.893Z\"\n transform=\"translate(-129.64 -111.51)\"\n fill=\"gray\"\n />\n </g>\n </g>\n </g>\n </svg>\n <div\n class=\"dateTime\"\n [style.color]=\"dateTimeColor ? '' : ''\"\n >\n <span>{{ \"Loading ...\" }}</span>\n </div>\n </div>\n </div>\n <div class=\"loaderbox\">\n <div class=\"loader-pkg\">\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n <div class=\"loader--dot\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <!-- <div #chatMain></div> -->\n <div\n *ngIf=\"openWorkflowInput && selectedWorkflow && !executingWorkflow\"\n class=\"chatFooterWrapper\"\n >\n <!-- new UI for Chat Message Section by Amit -->\n <div class=\"chat-footer-upt\">\n <div class=\"topinfo-containerbox\">\n <div class=\"agents_note_wrapper\">\n <div>\n <h6>{{ selectedWorkflow?.Name }}</h6>\n {{ selectedWorkflow?.Description }}\n </div>\n </div>\n\n <div class=\"agents_note_wrapper\">\n <button\n mat-icon-button\n class=\"closeButtonSource\"\n (click)=\"toggleWorkflows(false)\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"bottombox-wrapper\">\n <!-- here i need to loop through all the input fields selectedWorkflow.Trigger.InputSchema and render the input fields -->\n <!-- Form for Workflow Inputs -->\n <form\n [formGroup]=\"workflowForm\"\n (ngSubmit)=\"onWorkflowSubmit()\"\n class=\"form-container\"\n >\n <div\n *ngFor=\"let input of selectedWorkflow?.Trigger?.InputSchema\"\n class=\"form-group\"\n >\n <label>{{ input.Label }}</label>\n\n <!-- Handle Text Input or Text Area based on requirement -->\n <textarea\n *ngIf=\"input.Type === 'string'\"\n formControlName=\"{{ input.InputId }}\"\n [placeholder]=\"input.Placeholder\"\n [rows]=\"2\"\n [required]=\"input.Required\"\n class=\"form-control\"\n ></textarea>\n\n <!-- Dropdown for Select Options -->\n <select\n *ngIf=\"input.Type === 'select'\"\n formControlName=\"{{ input.InputId }}\"\n class=\"form-control\"\n >\n <option\n *ngFor=\"let option of input.Options\"\n [value]=\"option.Value\"\n >\n {{ option.Label }}\n </option>\n </select>\n </div>\n\n <!-- Submit button aligned to the right -->\n <div class=\"form-group\">\n <button type=\"submit\" class=\"btn btn-primary submit-button\">\n Submit\n </button>\n </div>\n </form>\n </div>\n </div>\n\n <!-- new UI for Chat Message Section by Amit -->\n </div>\n <div *ngIf=\"!openWorkflowInput\" class=\"chatFooterWrapper\">\n <!-- new UI for Chat Message Section by Amit -->\n <div class=\"chat-footer-upt\">\n <div class=\"topinfo-containerbox\" *ngIf=\"!checkForCop29BotId()\">\n <div class=\"agents_note_wrapper\">\n <div class=\"agents-dropdown-wrapper\">\n <div class=\"dropdown-wrapper\" (click)=\"toggleDropdown()\">\n <div class=\"dropdown-header\">\n <span>{{ getDropdownHeaderText() }}</span>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n viewBox=\"0 0 24 24\"\n >\n <path d=\"M19 9l-7 7-7-7\" />\n </svg>\n </div>\n <div class=\"dropdown-menu\" *ngIf=\"isDropdownOpen\">\n <label (click)=\"onSelectAll()\">\n <input type=\"checkbox\" [checked]=\"areAllSelected()\" />\n All\n </label>\n <label\n *ngFor=\"let agent of agents\"\n (click)=\"onAgentChange(agent)\"\n >\n <input type=\"checkbox\" [(ngModel)]=\"agent.selected\" />\n {{ agent.agentName }}\n </label>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"agents_note_wrapper\">\n <div class=\"agents-dropdown-wrapper\">\n <div class=\"dropdown-wrapper\" (click)=\"toggleWorkflows()\">\n <div class=\"dropdown-header\">\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n stroke-width=\"0\"\n viewBox=\"0 0 256 256\"\n class=\"h-5 w-5\"\n height=\"1.3em\"\n width=\"1.3em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M245.66,74.34l-32-32a8,8,0,0,0-11.32,11.32L220.69,72H192a74.49,74.49,0,0,0-28.35,6.73c-13.62,6.29-30.83,19.71-35.54,48-5.32,31.94-29.1,39.22-41,40.86a40,40,0,1,0,.18,16.06A71.65,71.65,0,0,0,108.13,178C121.75,172,139,158.6,143.89,129.31,150.65,88.77,190.34,88,192,88h28.69l-18.35,18.34a8,8,0,0,0,11.32,11.32l32-32A8,8,0,0,0,245.66,74.34ZM48,200a24,24,0,1,1,24-24A24,24,0,0,1,48,200Z\"\n ></path></svg\n >&nbsp; Workflows\n </div>\n <div class=\"dropdown-menu\" *ngIf=\"isWorkflowOpen\">\n <label\n *ngFor=\"let orgWorkflow of orgWorkflows\"\n (click)=\"onWorkflowSelected(orgWorkflow)\"\n >\n {{ orgWorkflow.Name }}\n </label>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bottombox-wrapper\">\n <!-- <input [disabled]=\"isChatingWithAi\" type=\"text\" class=\"form-control-1 s27-scroll\"\n \n placeholder=\"Ask anything...\" [style.background]=\"formFieldBgColor ? formFieldBgColor : ''\"\n [style.color]=\"formFieldTextColor ? formFieldTextColor : ''\" [(ngModel)]=\"input\"\n (keyup.enter)=\"handleSubmit()\" #myInput /> -->\n <textarea\n [disabled]=\"isChatingWithAi\"\n class=\"form-control-1 s27-scroll chat-textarea\"\n placeholder=\"{{ getTranslation('Ask anything') }}\"\n [(ngModel)]=\"input\"\n (keydown)=\"handleKeydown($event)\"\n (input)=\"adjustTextareaHeight($event)\"\n #myInput\n ></textarea>\n\n <button\n (click)=\"toggleRecording()\"\n [disabled]=\"isChatingWithAi\"\n title=\"{{ isRecording ? 'Stop Recording' : 'Start Recording' }}\"\n class=\"btn cta-chat mr-1 vj-test\"\n >\n <svg\n *ngIf=\"!isRecording\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n stroke-width=\"0\"\n viewBox=\"0 0 512 512\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <!-- Mic Icon -->\n <path\n d=\"M256 320c53 0 96-43 96-96V96c0-53-43-96-96-96s-96 43-96 96v128c0 53 43 96 96 96zm144-96h-16c0 66.27-52.73 120-120 120s-120-53.73-120-120h-16c-17.67 0-32 14.33-32 32v32c0 53.87 38.13 100.64 91.21 112.27C210.13 457.77 231.58 464 256 464s45.87-6.23 65.79-17.73C374.87 388.64 416 341.87 416 288v-32c0-17.67-14.33-32-32-32z\"\n ></path>\n </svg>\n <svg\n *ngIf=\"isRecording\"\n stroke=\"currentColor\"\n fill=\"currentColor\"\n stroke-width=\"0\"\n viewBox=\"0 0 24 24\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <!-- Square Stop Icon -->\n <path d=\"M5 5h14v14H5z\"></path>\n </svg>\n </button>\n\n <button\n class=\"btn cta-chat rotate\"\n (click)=\"handleSubmit()\"\n [style.background]=\"sendButtonColor ? sendButtonColor : ''\"\n [style.color]=\"sendButtonTextColor ? sendButtonTextColor : ''\"\n title=\"{{ getTranslation('Send Message') }}\"\n >\n <svg\n stroke=\"currentColor\"\n fill=\"currentColor\"\n stroke-width=\"0\"\n viewBox=\"0 0 512 512\"\n height=\"1em\"\n width=\"1em\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z\"\n ></path>\n </svg>\n <!-- SEND -->\n </button>\n </div>\n </div>\n\n <!-- new UI for Chat Message Section by Amit -->\n </div>\n\n <div class=\"NoteTxt\">\n <div class=\"note\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"12.882\"\n height=\"12.883\"\n viewBox=\"0 0 12.882 12.883\"\n >\n <path\n id=\"Icon_ion-shield-checkmark\"\n data-name=\"Icon ion-shield-checkmark\"\n d=\"M15.106,4.532a.46.46,0,0,0-.378-.424A20.132,20.132,0,0,1,8.881,2.291a.46.46,0,0,0-.379,0A20.132,20.132,0,0,1,2.655,4.108a.46.46,0,0,0-.378.424A11.3,11.3,0,0,0,2.98,9.4a10.049,10.049,0,0,0,2.06,3.235A10.516,10.516,0,0,0,8.521,15.1a.46.46,0,0,0,.345,0,10.516,10.516,0,0,0,3.481-2.465A10.049,10.049,0,0,0,14.4,9.4,11.3,11.3,0,0,0,15.106,4.532Zm-3.767,2.16L8.153,10.373a.46.46,0,0,1-.328.159H7.806a.46.46,0,0,1-.322-.131L6.069,9.014a.46.46,0,1,1,.644-.657L7.777,9.4,10.644,6.09a.46.46,0,0,1,.7.6Z\"\n transform=\"translate(-2.25 -2.25)\"\n fill=\"#06f\"\n />\n </svg>\n\n <span class=\"text\">{{\n getTranslation(\n \"Your personal or company information is kept private and secure\n within this chat.\"\n )\n }}</span>\n </div>\n </div>\n </mat-drawer-content>\n </mat-drawer>\n <mat-drawer\n class=\"drawer edit-boxDrawer\"\n style=\"width: 45%\"\n #sourcesDrawer\n [position]=\"'end'\"\n [mode]=\"'over'\"\n [style.background]=\"\n 'linear-gradient(' + (bgGradient ? bgGradient.join(', ') : '') + ')'\n \"\n >\n <mat-drawer-content>\n <div class=\"sourceDraweContainer\">\n <div class=\"container-fluid\">\n <button\n mat-icon-button\n class=\"closeButtonSource\"\n (click)=\"onCloseSource()\"\n >\n <mat-icon>close</mat-icon>\n </button>\n <h1>{{ currentSourcesList?.length }} Sources</h1>\n <!-- <p>Tell me about latest news from Mistral about AI agents announcement done this month</p> -->\n <hr />\n <ul class=\"sources-list\">\n <li *ngFor=\"let item of currentSourcesList; let si = index\">\n <!-- <input type=\"checkbox\" id=\"source1\"> -->\n <div class=\"source-content\" (click)=\"openLinkInNewTab(item.link)\">\n <label for=\"source1\">\n <span class=\"source-title\"\n ><span class=\"ml-1\">{{ si + 1 }}.</span\n >{{ item.title }}</span\n >\n <span class=\"image-container\">\n <img\n class=\"relative block\"\n [src]=\"getFaviconUrl(item.link)\"\n [alt]=\"getDomainName(item.link) + ' favicon'\"\n />\n <span> {{ getDomainName(item.link) }}</span>\n </span>\n <span class=\"source-description\">{{ item.desc }}</span>\n </label>\n </div>\n </li>\n </ul>\n </div>\n </div>\n </mat-drawer-content>\n </mat-drawer>\n <mat-drawer\n class=\"drawer edit-boxDrawer\"\n style=\"width: 45%\"\n #editorsDrawer\n [position]=\"'end'\"\n [mode]=\"'push'\"\n [style.background]=\"\n 'linear-gradient(' + (bgGradient ? bgGradient.join(', ') : '') + ')'\n \"\n >\n <mat-drawer-content>\n <lib-bot-html-editor\n *ngIf=\"isContentLoaded\"\n [editorContent]=\"currentMessageForEditor\"\n [isDocInEditMode]=\"isDocInEditMode\"\n [documentContent]=\"documentContent\"\n [conversationId]=\"conversationId\"\n [botId]=\"botId\"\n ></lib-bot-html-editor>\n </mat-drawer-content>\n </mat-drawer>\n</mat-drawer-container>\n\n<div *ngIf=\"showWorkflowExecutionDetails\" class=\"modal\">\n <div class=\"modal-content\">\n <div class=\"close-wrapper\">\n <span class=\"close_pop\" (click)=\"closeModal()\">&times;</span>\n </div>\n <div class=\"titleSection\">\n <!-- Workflow Title -->\n <h2>{{ workflowExecutionDetails.WorkflowName }}</h2>\n <!-- Workflow Title -->\n </div>\n <!-- Inputs Section -->\n <div class=\"inputs-section\">\n <h3>Inputs</h3>\n <ul>\n <li\n *ngFor=\"let input of objectToArray(workflowExecutionDetails.Inputs)\"\n >\n {{ input.key }}: {{ input.value }}\n </li>\n </ul>\n </div>\n\n <!-- Actions Section (Displayed as Timeline) -->\n <div class=\"actions-section\">\n <h3>Agent Actions</h3>\n <div class=\"timeline\">\n <div\n *ngFor=\"let action of workflowExecutionDetails.Actions\"\n class=\"timeline-item\"\n >\n <div class=\"timestamp-section\">\n <h4>{{ action.ActionName || action.Name }}</h4>\n <p><strong></strong> {{ action.InsertTimeStamp }}</p>\n </div>\n <p [innerHTML]=\"processMessageForDisplay(action.Output)\"></p>\n <!-- <pre>{{ action.Output }}</pre> -->\n </div>\n </div>\n </div>\n\n <!-- Insert Timestamp -->\n <div class=\"timestamp-section\">\n <p>\n <strong>Inserted At:</strong>\n {{ workflowExecutionDetails.InsertTimeStamp }}\n </p>\n </div>\n </div>\n</div>\n",
2153
+ changeDetection: ChangeDetectionStrategy.OnPush,
2154
+ styles: ["@import url(\"https://e1cdn.social27.com/digitalevents/liteversion/fonts/segoe-ui/stylesheet.css\");.sticky-header-chat{background:#fff;border-bottom:1px solid #ddd;padding:0 0 10px;position:sticky;top:-21px;transition:all 1s;z-index:100}@media (max-width:768px){.sticky-header-chat{top:0}}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:#f1f1f1}::-webkit-scrollbar-thumb,::-webkit-scrollbar-thumb:hover{background:#e5ccbc}body{overflow:hidden}.ios-device .drawer .chat-footer .form-control{font-size:16px}.hivegpt-chat-wrapper{background:transparent!important;height:100%;inset:0;opacity:0;position:fixed;visibility:hidden;z-index:999999}.hivegpt-chat-wrapper.mat-drawer-container-has-open{background:transparent!important;opacity:1;transition:all .3s;visibility:visible;z-index:999999}.hivegpt-chat-wrapper .mat-drawer:not(.mat-drawer-side){box-shadow:none}.hivegpt-chat-wrapper mat-drawer{background-color:#fff!important;background-image:none!important;width:100%}.hivegpt-chat-wrapper mat-drawer.full-width-drawer{max-width:100%}.hivegpt-chat-wrapper .mat-drawer-content{display:flex;flex-direction:column}.hivegpt-chat-wrapper .chat-header{padding:16px 40px;width:100%}.hivegpt-chat-wrapper .chat-header h2{font-family:Segoe UI,sans-serif;font-size:36px;font-weight:500;letter-spacing:-.72px;line-height:108%;margin:0;text-transform:uppercase}.hivegpt-chat-wrapper .chat-header .closeIcon{align-items:center;background:transparent;border:none;border-radius:50%;display:inline-flex;font-size:18px;height:35px;justify-content:center;outline:none;padding:0;position:absolute;right:12px;top:16px;width:35px}.hivegpt-chat-wrapper .chat-main{display:flex;flex:1;flex-direction:column;justify-content:space-between;overflow-y:auto;width:100%}.hivegpt-chat-wrapper .chat-main .innerChat{overflow-y:auto;padding:20px 40px 10px;width:100%}.hivegpt-chat-wrapper .chat-main .ai h3{font-size:1.3rem!important}.hivegpt-chat-wrapper .chat-main .chat-box{max-width:96%;width:100%}.hivegpt-chat-wrapper .chat-main .chat-box .message{margin-left:50px;margin-top:10px;min-height:40px;padding:0 20px 0 0;position:relative}@media (max-width:768px){.hivegpt-chat-wrapper .chat-main .chat-box .message{margin-left:0}}.hivegpt-chat-wrapper .chat-main .chat-box .message p{color:#000;color:#525252;font-family:Segoe UI,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:160%;margin:0;text-align:left}.hivegpt-chat-wrapper .chat-main .chat-box .message p a{color:#17235b!important;cursor:pointer!important;font-weight:700;text-decoration:underline}.hivegpt-chat-wrapper .chat-main .chat-box .message .cta{align-items:end;bottom:-7px;display:flow-root;gap:10px;grid-gap:10px;position:relative;right:-10px;z-index:5}.hivegpt-chat-wrapper .chat-main .chat-box .message .cta button{background:transparent;border:none;color:#566563;cursor:pointer;padding:0;transition:all .3s}.hivegpt-chat-wrapper .chat-main .chat-box .message .cta button i{display:inline-block}.hivegpt-chat-wrapper .chat-main .chat-box .message .cta button:hover{color:#17235b}.hivegpt-chat-wrapper .chat-main .chat-box .message .cta button.up:hover i{animation:thumbsUpAnimation .5s ease-in-out;animation-fill-mode:forwards}.hivegpt-chat-wrapper .chat-main .chat-box .message .cta button.down:hover i{animation:thumbsDownAnimation .5s ease-in-out;animation-fill-mode:forwards}.hivegpt-chat-wrapper .chat-main .chat{margin-bottom:20px}.hivegpt-chat-wrapper .chat-main .chat.user{text-align:right}.hivegpt-chat-wrapper .chat-main .chat.user .chat-box{margin-left:auto}.hivegpt-chat-wrapper .chat-main .chat.user .chat-box .message{background:linear-gradient(96deg,#8b4ead -10.61%,#761c79 84.59%);border-radius:20px 20px 0 20px;color:#fff}.hivegpt-chat-wrapper .chat-main .chat.user .chat-box .message p{color:#fff;text-align:left}.hivegpt-chat-wrapper .chat-main .chat.user .dateTime{text-align:right}.hivegpt-chat-wrapper .chat-main .chat.user .time-cta{justify-content:flex-end}.hivegpt-chat-wrapper .chat-main .chat .Icon_TimeSTamp{align-content:center;align-items:center;display:flex;justify-content:left;margin:0 -60px;width:auto}@media (max-width:768px){.hivegpt-chat-wrapper .chat-main .chat .Icon_TimeSTamp{margin:0}}.hivegpt-chat-wrapper .chat-main .chat .dateTime{color:#333232;font-size:15px;font-style:normal;font-weight:300;line-height:140%}.hivegpt-chat-wrapper .chat-main .chat .dateTime span{color:#06f;font-size:15px;font-style:normal;font-weight:500;line-height:140%;margin-left:15px;margin-right:5px}.hivegpt-chat-wrapper .chat-main .chat:last-of-type{margin-bottom:0}.hivegpt-chat-wrapper .chatFooterWrapper{background:#fff;border:2px solid hsla(0,0%,85.5%,.5882352941176471);border-radius:10px;box-shadow:2px 0 5px #e1e1e1;margin:0 auto 15px;margin-top:10px!important;transition:all .5s;width:75%}.hivegpt-chat-wrapper .chatFooterWrapper:hover{border:2px solid hsla(0,0%,72.2%,.5882352941176471);box-shadow:2px 0 4px #ddd}.hivegpt-chat-wrapper .chatFooterWrapper .chat-footer-upt{padding:4px}.hivegpt-chat-wrapper .chatFooterWrapper .note{align-items:center;background:rgba(27,117,187,.050980392156862744);border-radius:15px;color:#000;display:inline-flex;font-size:12px;gap:8px;line-height:1;margin:0 auto 4px;padding:10px 25px}.hivegpt-chat-wrapper .chatFooterWrapper .note a{text-transform:capitalize}.hivegpt-chat-wrapper .chatFooterWrapper .note i{font-size:18px}.hivegpt-chat-wrapper .chatFooterWrapper .note i svg{height:18px;width:18px}.hivegpt-chat-wrapper .chatFooterWrapper .note span{flex:1;gap:4px;line-height:1.3}.hivegpt-chat-wrapper .chat-footer{align-items:center;display:flex;gap:8px;justify-content:space-between;padding:0;position:relative}.hivegpt-chat-wrapper .chat-footer .form-control{background:#fff!important;border:0;line-height:21px;outline:0;padding:10px;position:relative;width:100%}.hivegpt-chat-wrapper .chat-footer .form-control::-moz-placeholder{color:#6c7a78}.hivegpt-chat-wrapper .chat-footer .form-control::placeholder{color:#6c7a78}.hivegpt-chat-wrapper .chat-footer .form-control:focus{border-color:#e5ccbc}.hivegpt-chat-wrapper .chat-footer .cta-footer{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:10px;position:absolute;right:15px;text-align:right}.hivegpt-chat-wrapper .chat-footer .cta-footer .btn{color:#000;font-weight:500;gap:8px;max-width:150px;padding:0}.hivegpt-chat-wrapper .chat-footer .cta-footer .cta-chat{align-items:center;background:transparent!important;border:none;border-radius:0;box-shadow:0 1px 2px 0 rgba(16,24,40,.05);display:inline-flex;font-size:20px;height:auto;justify-content:center;width:auto}.hivegpt-chat-wrapper .chat-footer .cta-footer .cta-chat:hover{opacity:.8}.hivegpt-chat-wrapper .chat-footer .cta-footer .cta-again{background:#17235b;border:1px solid #17235b;color:#fff}.hivegpt-chat-wrapper .cta-faqs{align-items:flex-end;display:flex;flex-direction:column;flex-wrap:wrap;gap:8px;margin-left:auto;max-width:80%;padding:10px 0 0}.hivegpt-chat-wrapper .cta-faqs .cta{background:transparent;border:1px solid #c9a893;border-radius:20px 20px 0 20px;color:#333;cursor:pointer;font-family:Segoe UI,sans-serif;font-size:14px;font-style:normal;font-weight:500;line-height:160%;margin:0;min-height:44px;padding:12px 20px;text-align:left;text-decoration:none;transition:all .3s;white-space:pre-line}.spinner{align-items:center;display:flex;gap:2px;justify-content:center}.spinner>div{animation:bouncedelay 1.4s ease-in-out infinite;animation-fill-mode:both;background-color:#173330;border-radius:100%;display:inline-block;height:5px;width:5px}.spinner .bounce1{animation-delay:-.32s}.spinner .bounce2{animation-delay:-.16s}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.time-cta{align-items:center;display:flex;gap:8px;justify-content:start;margin-top:5px}@keyframes thumbsUpAnimation{0%,to{transform:translateY(0)}50%{transform:translateY(-8px)}}@keyframes thumbsDownAnimation{0%,to{transform:translateY(0)}50%{transform:translateY(3px)}}@media (max-width:767px){.hivegpt-chat-wrapper .chat-main .innerChat{padding:0 24px 10px}.hivegpt-chat-wrapper .chat-footer{padding:10px 24px}.hivegpt-chat-wrapper .chat-footer .cta-footer .cta-chat{max-width:100%}.hivegpt-chat-wrapper .chat-footer .form-control{height:80px}.hivegpt-chat-wrapper .chat-header .closeIcon{height:28px;right:8px;top:8px;width:28px}.hivegpt-chat-wrapper .chat-header .closeIcon span{font-size:14px}.hivegpt-chat-wrapper .chat-header{padding:10px 24px}.hivegpt-chat-wrapper .chat-header h2{font-size:20px}.cta-faqs{padding:10px 0 0}}.body-overflow-hidden{overflow:hidden}.chat-button{align-items:center;background:#17235b;border:#17235b;border-radius:50%;color:#fff;display:inline-flex;font-size:24px;height:50px;justify-content:center;width:50px}textarea{caret-color:#000}.labelChat{font-size:14px;font-weight:400;margin:0 0 10px}.chatType h4{color:#566563;text-align:center}.chatType ul{align-items:center;background:#fff;border-radius:10px;box-shadow:0 .3px .9px rgba(0,0,0,.12),0 1.6px 3.6px rgba(0,0,0,.16);display:flex;justify-content:center;list-style:none;margin:0 0 20px;padding:4px}.chatType ul li{flex:1}.chatType ul li button{align-items:center;background:#fff;border:none;border-radius:10px;font-weight:600;min-height:48px;padding:.375rem;text-align:center;text-shadow:1px 0 rgba(0,0,0,.2);width:100%}.chatType ul li button.active{background:linear-gradient(96deg,#761c79 -10.61%,#761c79 84.59%);box-shadow:0 1px 2px 0 rgba(16,24,40,.05);color:#fff}.cta_suggestions{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;margin-bottom:20px}.cta_suggestions button{background:#fff;border:1px solid #174ae4;border-radius:10px;box-shadow:0 1.6px 3.6px 0 rgba(0,0,0,.13),0 .3px .9px 0 rgba(0,0,0,.1);color:#1543cd;font-size:14px;font-weight:600;line-height:1.2;padding:8px 12px;position:relative;text-align:left;transition:all .3s}.cta_suggestions button:hover{background:#eff3ff}.balanced .chat-footer .cta-footer .cta-chat,.balanced .chat-main .chat.user .chat-box .message,.balanced .chatType ul li button.active{color:#000}.balanced .chat-main .innerChat .title p span{color:#06f}.balanced mat-drawer{background-image:linear-gradient(180deg,rgba(88,190,251,.05) 60%,rgba(0,102,255,.2) 96.27%)}.balanced .cta_suggestions button:hover{border:1px solid #06f}.precise .chat-footer .cta-footer .cta-chat,.precise .chat-main .chat.user .chat-box .message{background:linear-gradient(96deg,#69ca6d -10.61%,#4caf50 84.59%)}.precise .chatType ul li button.active{background:linear-gradient(96deg,#4caf50 -10.61%,#4caf50 84.59%);color:#fff}.precise .chat-main .innerChat .title p span{color:#4caf50}.precise mat-drawer{background-image:linear-gradient(180deg,rgba(76,175,80,.05) 60%,rgba(76,175,80,.3) 96.27%)}.precise .cta_suggestions button:hover{border:1px solid #4caf50}.title{margin-bottom:20px}.title h2{font-size:22px;margin:0}.title h2 span{align-items:center;color:#000;display:inline-flex;gap:10px}.title h2 i{color:#06f;font-size:30px;line-height:1}.title h2 i svg{height:30px;width:30px}.title p{font-weight:600;margin:0}.title p span{color:#06f}.agenda-items-wrapper{padding-bottom:15px;padding-top:15px}@media (max-width:576px){.list-view .session-detail-wrapper{border:none;flex-direction:column}}.card-background-session{background:#fff;border-radius:8px}.card-background-session .body-text-color{color:#111!important}.card-background-session h2{-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box;font-size:20px;margin-bottom:8px;overflow:hidden}.card-background-session .session-description{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#111!important;display:-webkit-box;font-size:14px;overflow:hidden}.card-background-session .color-secondary{color:#111!important}.card-background-session p{font-size:14px}.list-view .session-detail-wrapper .s27-btn-icon{background:transparent;border:transparent}.list-view .session-detail-wrapper{border-left:3px solid transparent;display:flex;margin-bottom:16px}.thumbnail{align-items:center;display:flex;height:160px;justify-content:center;min-width:160px;position:relative;width:160px}.thumbnail img{-o-object-fit:cover;height:100%;object-fit:cover;width:100%}@media (max-width:576px){.thumbnail{height:160px;min-height:unset;width:100%}}.thumbnail .play-btn{align-items:center;background-color:transparent;border:0;bottom:0;display:flex;font-size:60px;justify-content:center;left:0;position:absolute;right:0;top:0;width:100%}.thumbnail .play-btn span{font-size:80px;text-shadow:0 0 14px rgba(74,74,74,.45)}.content{flex-grow:1}.actions{background-color:transparent!important}.speakers{margin-bottom:0;margin-top:10px;padding:0}.speakers li{align-items:unset;display:flex}.speakers li .content{font-size:12px!important}.speakers .image{border-radius:100%;height:40px;min-width:40px;overflow:hidden;width:40px}.speakers img{-o-object-fit:cover;height:100%;object-fit:cover;width:100%}.grid-2-cols{display:grid;grid-gap:15px;grid-template-columns:calc(55% - 10px) calc(50% - 10px);padding-right:20px}@media (max-width:768px){.grid-2-cols{grid-template-columns:calc(50% - 10px) calc(50% - 10px)}}@media (max-width:575px){.grid-3-cols{grid-template-columns:100%}}.quick-prompts-extended{align-items:flex-start!important;margin-left:0!important}.border-shape .s27-scroll::-webkit-scrollbar{border-radius:30px;width:3px}.border-shape .s27-scroll::-webkit-scrollbar-track{background:#f1f1f1;border-radius:30px}.border-shape .s27-scroll::-webkit-scrollbar-thumb{background:#888;border-radius:30px}.box{display:table;height:275px;margin:10px 0;width:100%}.tiktokwrapper{display:grid;gap:10px;grid-template-columns:repeat(2,1fr);height:100%}.tiktokwrapper .tiktokshell{background:#3d2b8f;border:2px solid #fff;border-radius:5px;box-shadow:0 0 6px #494949;height:100%;min-height:275px;min-width:160px;position:relative;width:100%}.tiktokwrapper .overlymask{background-image:url(https://e1cdn.social27.com/digitalevents/HiveGpt/screen-overlay.png);background-position:0 0;bottom:0;height:100%;left:0;position:absolute;width:100%;z-index:6}.tiktokwrapper .videoPhotobox{bottom:0;height:272px;left:0;overflow:hidden;position:absolute;width:auto;z-index:6}.tiktokwrapper .videoPhotobox video{-o-object-fit:cover;border-radius:0;cursor:pointer;height:270px;object-fit:cover;outline:0;transition:.3s ease-in-out;width:100%}.tiktokwrapper .videoPhotobox img{-o-object-fit:cover;height:100%;object-fit:cover;width:100%}.tiktokwrapper .playBtn{align-items:center;border:none;cursor:pointer;display:flex;height:40px;justify-content:center;left:0;margin:0 auto;position:absolute;right:0;top:105px;transition:all 1s;width:40px;z-index:10}.tiktokwrapper .playBtn:hover{transform:scale(1.2)}.tiktokwrapper .noPhoto{align-items:center;border:none;cursor:pointer;display:flex;height:40px;justify-content:center;left:0;margin:0 auto;position:absolute;right:0;top:105px;transition:all 1s;z-index:6}.tiktokwrapper .noPhoto h3{color:#fff;font-size:46px}.tiktokwrapper .onshell-content{bottom:10px;left:5px;position:absolute;z-index:10}.tiktokwrapper .onshell-content .title-shell{margin:0 10px}.tiktokwrapper .onshell-content h3{color:#fff;font-size:13px;font-weight:500}.tiktokwrapper .onshell-content .companyName{color:#eaeaea;font-size:12px;font-weight:400}.tiktokwrapper .onshell-content .button-shell button{background:#4e4e4e;border:none;border-radius:2px;color:#fff;font-size:11px;margin:0 1px;padding:4px 7px;text-transform:capitalize}.tiktokwrapper .onshell-content .Connectbtn{background:linear-gradient(149deg,#06f,#06f)!important}.skeleton-box{background-color:#dddbdd;display:inline-block;height:1em;overflow:hidden;position:relative}.skeleton-box:after{animation:shimmer 2s infinite;background-image:linear-gradient(90deg,hsla(0,0%,100%,0),hsla(0,0%,100%,.2) 20%,hsla(0,0%,100%,.5) 60%,hsla(0,0%,100%,0));bottom:0;content:\"\";left:0;position:absolute;right:0;top:0;transform:translateX(-100%);z-index:0}@keyframes shimmer{to{transform:translateX(100%)}}.blog-post__headline{font-size:1.25em;font-weight:700}.blog-post__meta{color:#6b6b6b;font-size:.85em}.o-media{display:flex}.o-media__body{flex-grow:1;margin-left:1em}.o-vertical-spacing>*+*{margin-top:.75em}.o-vertical-spacing--l>*+*{margin-top:2em}.copy{background:none;border:none;cursor:pointer;padding:5px;transition:transform .2s ease}.copy.active{transform:scale(1.1)}.copy svg{fill:#566563;height:18px;width:18px}.copyBox{background:#f7f7f7;border-radius:13px;color:#566563;display:flex;float:right;gap:12px;padding:5px 10px;position:relative;width:135px}.copyBox button{background:transparent;border:none;color:#566563;cursor:pointer;padding:0;transition:all .3s}.copyBox button i{display:inline-block}.copyBox button:hover{color:#17235b}.copyBox button.up:hover i{animation:thumbsUpAnimation .5s ease-in-out;animation-fill-mode:forwards}.copyBox button.down:hover i{animation:thumbsDownAnimation .5s ease-in-out;animation-fill-mode:forwards}.din{display:inline-flex}.chatFooterWrapper{align-items:center;background-color:#f5f5f5;border-top:1px solid #ccc;flex-direction:column;justify-content:center}.chat-footer{background:#fff;flex-direction:column;margin-bottom:10px}.chat-footer,.topinfo-containerbox{align-items:center;display:flex;width:100%}.topinfo-containerbox{background:#f9f9f9;border-bottom:1px solid #efefef;justify-content:space-between;margin:0;padding:5px 10px 8px}@media (max-width:768px){.topinfo-containerbox{flex-direction:column}}.agents_note_wrapper{display:flex;justify-content:space-around}.bottombox-wrapper{display:flex;padding:10px;width:100%}.dropdown-wrapper{margin-right:10px;position:relative}.dropdown-header{align-items:center;background:#fff;border:1px solid #ddd;border-radius:48px;color:#414141!important;cursor:pointer;display:flex;font-size:14px;margin-bottom:0;padding:.5rem 1.5rem;white-space:nowrap}.dropdown-header span{margin-right:8px}.dropdown-menu{background-color:#fff;border:1px solid #ededed;border-radius:5px;bottom:100%!important;box-shadow:0 2px 4px rgba(0,0,0,.1);display:block;left:0;margin-bottom:10px;max-height:200px;overflow-y:auto;padding:0;position:absolute;top:auto;width:230px;z-index:1000}.dropdown-menu label{cursor:pointer;display:block;font-size:16px;padding:5px 15px}.dropdown-menu label input{height:16px;width:16px}.dropdown-menu label:hover{background-color:#f0f0f0}.border-shape{flex-grow:1}.form-control-1{border:1px solid #ddd;border-radius:5px;padding:10px;width:100%}.cta-footer,.text-left .note-section{align-items:center;display:flex}.text-left .note-section{background:#fff;border-radius:5px;box-shadow:0 2px 4px rgba(0,0,0,.1);margin-top:10px;max-width:800px;padding:10px;width:100%}.text-left .note{align-items:center;color:#555;display:flex}.text-left .note i{margin-right:8px}.text-left .note .text{font-size:14px}.card-container{display:flex;gap:15px}.custom-card{background:#fffefe;border:1px solid #ddd;border-radius:.25rem;box-shadow:0 4px 8px rgba(0,0,0,.1);margin-bottom:10px;overflow:hidden;width:18rem}.custom-card .card-body{padding:10px}.custom-card .card-title{font-size:1.25rem;font-weight:700}.custom-card .card-text{font-size:1rem;text-align:left}.custom-card .btn-primary{background-color:#007bff;border:none;border-radius:.25rem}.custom-card .card-footer{background-color:#f8f9fa;color:#6c757d;padding:10px;text-align:center}.list-container{list-style:none;padding:0}.list-container li{background:#f5f5f5;border-radius:8px;font-size:13px;margin-bottom:5px;padding:6px 12px}.list-container li:hover{color:#06f;cursor:pointer}.collapsible-container{margin-bottom:5px;overflow:hidden;width:100%}.collapsible-header{cursor:pointer;display:flex;padding:15px}.collapsible-header .header-icon{font-size:20px;margin-right:10px}.collapsible-header .header-title{flex:1;font-size:18px}.collapsible-header .toggle-icon{font-size:18px;margin-left:18px}.collapsible-content{background-color:#f8f9fa;color:#333;padding:15px;width:100%}.collapsible-content.show{display:block}.researchingCard{margin:5px auto}.card-header{background:#eee;border-bottom:0;border-radius:8px 8px 0 0;display:flex!important;padding:8px 15px;width:auto}.icon{font-size:20px;line-height:5px}.rotate{transform:rotate(180deg)}.collapse{display:none}.uptList{background:rgba(245,222,179,.1411764705882353);border-radius:0 0 10px 10px;margin-bottom:20px!important}.list-group-item{color:#0f0f0f;font-size:15px;margin:1px 0;padding:0 18px}.sources-container{align-items:flex-start;display:flex;gap:15px}.source-card{background-color:#f0f3f5;border-radius:10px;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;justify-content:space-between;padding:15px;position:relative;transition:box-shadow .3s ease;width:100%}.popup{background-color:#fff;border-radius:5px;box-shadow:0 4px 8px rgba(0,0,0,.2);left:50%;opacity:0;padding:10px;position:absolute;top:100%;transform:translateX(-50%) translateY(-10px);transition:opacity .3s ease,transform .3s ease;visibility:hidden;white-space:normal;width:100%;z-index:10}.popup h5{font-size:14px;font-weight:600;line-height:1.2;margin:5px 0 10px}.popup p{font-size:12px;line-height:1.4;margin:0}.popup h5:hover{color:#007bff;cursor:pointer}.popup .source-url{color:#000;text-decoration:none}.popup .source-url:hover{color:#007bff;cursor:pointer;text-decoration:underline}.source-card:hover .popup{opacity:1;transform:translateX(-50%) translateY(-15px);visibility:visible}.source-card:hover{box-shadow:0 4px 8px rgba(0,0,0,.1);transform:scale(1.05)}.source-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;font-size:14px;font-weight:500;height:55px;line-height:1.5;overflow:hidden;text-align:left;text-overflow:ellipsis}.source-title img{margin-left:10px;width:20px}.source-url{align-items:center;color:#6c757d;display:flex;font-size:12px;text-align:left}.source-url img{border-radius:50%;height:16px;margin-right:5px;width:16px}.sourceDraweContainer .container{background-color:#fff;padding:20px}.sourceDraweContainer .sources-list{list-style:none;padding:0}.sourceDraweContainer .sources-list li{align-items:flex-start;display:flex;margin-bottom:15px}.sourceDraweContainer .sources-list input[type=checkbox]{flex-shrink:0;margin-right:15px;margin-top:8px}.sourceDraweContainer .source-content{background-color:#f5f2f2;border:1px solid #ddd;border-radius:8px;box-shadow:0 2px 4px rgba(0,0,0,.1);cursor:pointer;flex:1;padding:12px}.sourceDraweContainer .source-content:hover{background:#ccc}.sourceDraweContainer .source-title{display:block;font-size:1rem;font-weight:500;height:auto!important;margin-bottom:4px}.sourceDraweContainer .source-description{display:block;font-size:.875rem}.sourceDraweContainer .image-container{align-items:center;display:flex;margin:10px 0}.sourceDraweContainer .image-container img{-o-object-fit:cover;border:1px solid #ddd;border-radius:50%;height:16px;margin-right:5px;object-fit:cover;width:16px}.sourceDraweContainer .image-container span{color:#555;font-size:13px}.closeButtonEditor{border:0;border-radius:100%;height:32px;padding:3px 0 0;position:absolute;right:10px;top:5px;width:32px}.closeButtonSource{background:none!important;border-color:transparent!important;box-shadow:none!important;color:inherit;cursor:pointer;float:right;margin-top:20px;transition:color .2s ease-in-out}.closeButtonSource.closeplaygroundbutton{display:none!important}.graph-img{background:hsla(0,0%,99.6%,.23137254901960785);border-radius:15px;padding:15px;width:90%}.chat-textarea{background-color:#fff;border:none;box-sizing:border-box;font-size:15px;height:30px;line-height:1.5;overflow-y:hidden;padding:10px;resize:none;transition:all 1s;width:100%}.chat-textarea:focus,.chat-textarea:hover{height:60px}.chat-textarea:focus{outline:none}.fixed-btn{background-color:#000;border:none;border-radius:8px 8px 0 0;color:#fff;cursor:pointer;font-size:16px;padding:5px 12px;position:fixed;right:-22px;top:46%;transform:translateY(-50%) rotate(270deg);transform-origin:center;transition:all .5s;z-index:1000000}.fixed-btn:hover{background-color:#5b5b5b}.fixed-btn-close{background-color:#000;border:none;border-radius:8px 8px 0 0;color:#fff;cursor:pointer;font-size:16px;padding:5px 16px;position:fixed;right:549px;top:46%;transform:translateY(-50%) rotate(270deg);transform-origin:center;transition:all .5s;z-index:1000000}.fixed-btn-close:hover{background-color:#5b5b5b}.btn.rotate{transform:rotate(-15deg)}.btn.rotate:hover{transform:rotate(0deg)}.btn.cta-chat{align-items:center;background:#f3f3f3;border:none;border-radius:50%;color:#666;cursor:pointer;display:flex;height:40px;justify-content:center;margin:0 auto;padding:5px;text-align:center;transition:all .5s;width:40px}.btn.cta-chat:hover{background:#d7d7d7;color:#666}.btn.cta-chat svg{vertical-align:middle}.chat-footer-upt{padding:4px}.workflowbox{align-items:center;border:1px solid transparent;border-radius:48px;color:#414141!important;cursor:pointer;display:flex;font-size:14px;margin-bottom:0;padding:.5rem 1.5rem;transition:all .5s;white-space:nowrap}.workflowbox:hover{background:#fff;border:1px solid #ddd}.workflowbox svg{margin:0 10px}.edit-boxDrawer{border-left:1px solid #ddd;box-shadow:1px 1px 15px hsla(0,0%,86.7%,.7686274509803922)!important}.edit-boxDrawer mat-drawer-content,ng-deep .edit-boxDrawer mat-drawer-content{margin-left:0!important;margin-right:0!important}.SearchTitle{font-size:16px!important;text-transform:capitalize}.exicution{background:#f9f9f9;margin:30px 0!important;padding:15px 20px}.new-conversationbutton{align-items:center;background:#f5f5f5;border:1px solid #e3e3e3;border-radius:10px;cursor:pointer;display:flex;font-size:14px;justify-content:space-around;padding:6px;position:absolute;right:88px;top:10px;transition:all .5s;width:120px;z-index:1000}.new-conversationbutton:hover{background:#eee}@media (max-width:768px){.new-conversationbutton{align-items:center;font-size:11px!important;padding:0!important;position:fixed!important;right:18px!important;top:56px!important;width:90px!important}}.NoteTxt{margin:0 auto}.NoteTxt .text{margin:0 5px}.form-container{width:100%}.progress-container{align-items:center;display:flex}.circular-loader{border:4px solid rgba(0,0,0,.1);border-radius:50%;box-sizing:border-box;height:50px;position:relative;width:50px}.loader-spinner{animation:rotate-loader 1s linear infinite;border:2px solid #2196f3;border-radius:50%;border-top-color:transparent;box-sizing:border-box;height:100%;left:0;position:absolute;top:0;width:100%}.loader-text{color:#333;font-size:12px;font-weight:700;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.loader-label{color:#333;font-size:16px;margin-left:20px}.checkmark{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.checkmark-circle{animation:stroke .6s ease-in-out forwards;stroke:#4caf50;stroke-dasharray:166;stroke-dashoffset:166;stroke-width:4}.checkmark-check{animation:stroke-check .4s ease-in-out .4s forwards;stroke:#4caf50;stroke-dasharray:48;stroke-dashoffset:48;stroke-linecap:round;stroke-linejoin:round;stroke-width:4}@keyframes stroke{to{stroke-dashoffset:0}}@keyframes stroke-check{to{stroke-dashoffset:0}}@keyframes rotate-loader{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes checkmark-animation{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.circular-loader.completed .loader-spinner{animation:none;transform:rotate(1turn)}.icon-button{background-color:transparent;border:none;color:#333;cursor:pointer;font-size:24px}.icon-button:focus{outline:none}.icon-button:hover{color:#007bff}.modal{background-color:rgba(0,0,0,.4);display:block;height:100%;left:0;padding-top:0;position:fixed;top:0;width:100%;z-index:1000001}.modal-content{background-color:#fff;border-radius:8px;box-shadow:0 4px 8px rgba(0,0,0,.1);height:600px;margin:5% auto;padding:20px;position:relative;width:82%}.close{color:#aaa;float:right;font-size:28px;font-weight:700}.close:focus,.close:hover{color:#000;cursor:pointer;text-decoration:none}.SearchTitle.user{font-size:30px!important;text-transform:none!important}.SearchTitle.user h2,.SearchTitle.user p{font-size:1.7rem!important}.title_chat{display:flex;margin:0;padding:0}.title_chat h2{align-items:center;display:flex;font-size:20px;gap:10px;margin:10px 0}@media (max-width:768px){.title_chat h2{align-items:start;flex-direction:column;font-size:16px}}.small-title{font-size:12px;margin:2px 0}.titleSection{margin:0}.titleSection h2{color:#000;font-size:20px;margin:0}.inputs-section{background-color:#f7f7f7;border-radius:5px;margin:0 0 10px;padding:10px 15px 0}.inputs-section h3{font-size:16px}.actions-section{background-color:#f9f9f9;border-radius:5px;height:500px;margin-bottom:20px;overflow-y:auto;padding:15px}.timeline{margin-bottom:20px;padding-left:40px;position:relative}.timeline:before{border-right:2px dashed #cecece;content:\"\";height:100%;left:19px;position:absolute}.timeline-item{margin-bottom:20px;position:relative}.timeline-item:before{background-color:#007bff;border-radius:50%;content:\"\";height:20px;left:-30px;position:absolute;top:0;width:20px;z-index:1}.timeline-item h4{color:#000;font-size:16px;font-weight:700;margin:0}.timeline-item pre{background-color:#fff;border:1px solid #ddd;border-radius:5px;padding:10px;white-space:pre-wrap}.timestamp-section{color:#666;font-style:normal;justify-content:space-between}.mic-btn{background-color:#ff4d4d;border:none;border-radius:50%;color:#fff;cursor:pointer;font-size:1.5em;padding:10px}.mic-btn:active{background-color:#f66}.actions-section h3{font-size:16px}.close-wrapper{display:flex;justify-content:right;position:absolute;right:22px;top:0;width:100%}.close_pop{color:#aaa;cursor:pointer;font-size:30px;font-weight:400;justify-content:center}.close_pop,.user-Box{align-items:center;display:flex}.bards{position:absolute;right:0;top:20px}::ng-deep .code-container{margin:20px 0;position:relative}::ng-deep .copy-button{background-color:#007bff;border:none;border-radius:4px;color:#fff;cursor:pointer;padding:5px 10px;position:absolute;right:10px;top:10px}::ng-deep .copy-button:hover{background-color:#0056b3}::ng-deep .code_block.diff{background-color:#f8f8f8;border-left:4px solid #ccc;overflow:auto;padding:10px}::ng-deep .heading003{color:#06f;font-size:20px;font-weight:700}::ng-deep .listing{list-style:decimal;margin:0 25px;padding:0}.line{background-color:#e8e8e8;border-radius:15px;display:inline-block;height:15px;width:15px}.load-2 .line:last-child{animation:loadingB 1.5s 1s infinite;margin:5px 0}.load-2 .line:nth-last-child(2){animation:loadingB 1.5s .5s infinite;margin:5px 0}.load-2 .line:nth-last-child(3){animation:loadingB 1.5s 0s infinite;margin:5px 0}.load-1 .line:last-child{animation:loadingA 1.5s 1.2s infinite;margin:5px 0}.load-1 .line:nth-last-child(2){animation:loadingA 1.5s .8s infinite;margin:5px 0}.load-1 .line:nth-last-child(3){animation:loadingA 1.5s .2s infinite;margin:5px 0}@keyframes loadingB{0%{width:65px}50%{width:235px}to{width:65px}}@keyframes loadingA{0%{width:45px}50%{width:205px}to{width:45px}}.loaderbox{height:60px;margin:10px 0;position:relative}.loader-pkg{bottom:0;left:0;margin:0;top:0;width:250px}.loader--dot,.loader-pkg{height:20px;position:absolute}.loader--dot{animation-duration:3s;animation-iteration-count:infinite;animation-name:loader;animation-timing-function:ease-in-out;background-color:#1a6774;border-radius:100%;width:20px}.loader--dot:first-child{animation-delay:.5s;background-color:#618e93}.loader--dot:nth-child(5){animation-delay:.4s;background-color:#3fb0c3}.loader--dot:nth-child(4){animation-delay:.3s;background-color:#40b8cd}.loader--dot:nth-child(3){animation-delay:.2s;background-color:#ec8828}.loader--dot:nth-child(2){animation-delay:.1s;background-color:#fdc25d}.loader--dot:first-child{animation-delay:0s;background-color:#f4e3be}.loader--text{left:0;margin:0;position:absolute;top:200%;width:4rem}.loader--text:after{animation-duration:3s;animation-iteration-count:infinite;animation-name:loading-text;content:\"Loading\";font-weight:700}@keyframes loader{15%{transform:translateX(230px)}45%{transform:translateX(0)}65%{transform:translateX(230px)}95%{transform:translateX(0)}}@keyframes loading-text{0%{content:\"Loading\"}25%{content:\"Loading.\"}50%{content:\"Loading..\"}75%{content:\"Loading...\"}}::ng-deep .loaderbox{height:60px;margin:10px 0;position:relative}::ng-deep .loader-pkg{bottom:0;height:20px;left:0;margin:0;position:absolute;top:0;width:250px}::ng-deep .loader--dot{animation-duration:3s;animation-iteration-count:infinite;animation-name:loader;animation-timing-function:ease-in-out;background-color:#1a6774;border-radius:100%;height:20px;position:absolute;width:20px}::ng-deep .loader--dot:first-child{animation-delay:.5s;background-color:#618e93}::ng-deep .loader--dot:nth-child(5){animation-delay:.4s;background-color:#3fb0c3}::ng-deep .loader--dot:nth-child(4){animation-delay:.3s;background-color:#40b8cd}::ng-deep .loader--dot:nth-child(3){animation-delay:.2s;background-color:#ec8828}::ng-deep .loader--dot:nth-child(2){animation-delay:.1s;background-color:#fdc25d}::ng-deep .loader--dot:first-child{animation-delay:0s;background-color:#f4e3be}::ng-deep .loader--text{left:0;margin:0;position:absolute;top:200%;width:4rem}::ng-deep .loader--text:after{animation-duration:3s;animation-iteration-count:infinite;animation-name:loading-text;content:\"Loading\";font-weight:700}.agents-popwindowbox{background:#fff;padding:10px;width:100%}.agents-popwindowbox h3{color:#000;font-size:15px}.dropdown-menu-agents{background-color:#fff;border:1px solid #ededed;border-radius:5px;bottom:100%!important;box-shadow:0 2px 4px rgba(0,0,0,.1);display:block;left:0;margin-bottom:10px;padding:0;position:absolute;top:auto;width:270px;z-index:1000}.dropdown-menu-agents .scrollerbox{display:flex;flex:fit-content;flex-direction:column;height:215px;overflow-y:auto}.dropdown-menu-agents label{align-items:center;background:#f9f9f9;border-radius:2px;cursor:pointer;display:flex;font-size:13px;justify-content:start;line-height:16px;margin:2px 0;padding:7px}.dropdown-menu-agents label:hover{background:#ebebeb}.dropdown-menu-agents label input{opacity:0;position:absolute}.dropdown-menu-agents .input-check{border:2px solid #ccc;border-radius:4px;display:inline-block;height:23px;margin-right:5px;position:relative;top:0;transition:.5s;width:25px}.dropdown-menu-agents label input:checked~.input-check{animation:animate .7s ease;background:#06f;border-color:#06f}@keyframes animate{0%{transform:scale(1)}40%{transform:scale(1.3,.7)}55%{transform:scale(1)}70%{transform:scale(1.2,.8)}80%{transform:scale(1)}90%{transform:scale(1.1,.9)}to{transform:scale(1)}}.dropdown-menu-agents .input-check:before{border-bottom:3px solid #fff;border-left:3px solid #fff;content:\"\";height:6px;left:4px;position:absolute;top:6px;transform:scale(0) rotate(-45deg);transition:.5s;width:15px}.dropdown-menu-agents label input:checked~.input-check:before{transform:scale(1) rotate(-45deg)}::ng-deep .h1,::ng-deep h1{font-size:1.165rem}::ng-deep .h2,::ng-deep .h3,::ng-deep h2,::ng-deep h3{font-size:1.125rem}::ng-deep b,::ng-deep strong{font-weight:600}@media (max-width:768px){.note{line-height:15px;margin:0 auto;padding:3px 0 10px;width:90%}}.show-hover{display:none}.chat.bot:hover .show-hover{display:flex!important}"]
2155
+ },] }
2156
+ ];
2157
+ ChatDrawerComponent.ctorParameters = () => [
2158
+ { type: FormBuilder },
2159
+ { type: BotsService },
2160
+ { type: ChangeDetectorRef },
2161
+ { type: HttpClient },
2162
+ { type: DomSanitizer },
2163
+ { type: ElementRef },
2164
+ { type: Renderer2 },
2165
+ { type: SocketService },
2166
+ { type: ConversationService },
2167
+ { type: TranslationService }
2168
+ ];
2169
+ ChatDrawerComponent.propDecorators = {
2170
+ chatMain: [{ type: ViewChild, args: ['chatMain',] }],
2171
+ myInput: [{ type: ViewChild, args: ['myInput',] }],
2172
+ closePlaygroundButtons: [{ type: ViewChildren, args: ['closeplaygroundbutton',] }],
2173
+ drawer: [{ type: ViewChild, args: ['drawer',] }],
2174
+ sourcesDrawer: [{ type: ViewChild, args: ['sourcesDrawer',] }],
2175
+ editorsDrawer: [{ type: ViewChild, args: ['editorsDrawer',] }],
2176
+ myTextarea: [{ type: ViewChild, args: ['myTextarea', { static: false },] }],
2177
+ copilotName: [{ type: Input }],
2178
+ firstName: [{ type: Input }],
2179
+ lastName: [{ type: Input }],
2180
+ apiKey: [{ type: Input }],
2181
+ bgBubbleAi: [{ type: Input }],
2182
+ bgBubbleUser: [{ type: Input }],
2183
+ bgGradient: [{ type: Input }],
2184
+ botName: [{ type: Input }],
2185
+ botSkills: [{ type: Input }],
2186
+ botId: [{ type: Input }],
2187
+ orgId: [{ type: Input }],
2188
+ closeButtonColor: [{ type: Input }],
2189
+ closeButtonbgColor: [{ type: Input }],
2190
+ credentials: [{ type: Input }],
2191
+ dateTimeColor: [{ type: Input }],
2192
+ dateTextColor: [{ type: Input }],
2193
+ eventId: [{ type: Input }],
2194
+ s27Token: [{ type: Input }],
2195
+ eventName: [{ type: Input }],
2196
+ botIcon: [{ type: Input }],
2197
+ formFieldBgColor: [{ type: Input }],
2198
+ formFieldTextColor: [{ type: Input }],
2199
+ fullView: [{ type: Input }],
2200
+ gradientColors: [{ type: Input }],
2201
+ greeting: [{ type: Input }],
2202
+ messageTextColorAi: [{ type: Input }],
2203
+ messageTextColorUser: [{ type: Input }],
2204
+ rules: [{ type: Input }],
2205
+ sendButtonColor: [{ type: Input }],
2206
+ sendButtonTextColor: [{ type: Input }],
2207
+ showClose: [{ type: Input }],
2208
+ thumbsDownMessages: [{ type: Input }],
2209
+ thumbsUpMessage: [{ type: Input }],
2210
+ timezone: [{ type: Input }],
2211
+ unknownResponses: [{ type: Input }],
2212
+ useOpenAi: [{ type: Input }],
2213
+ userId: [{ type: Input }],
2214
+ isDev: [{ type: Input }],
2215
+ againButtonColor: [{ type: Input }],
2216
+ againButtonTextColor: [{ type: Input }],
2217
+ feedbackEvent: [{ type: Output }],
2218
+ onCloseEvent: [{ type: Output }],
2219
+ openPage: [{ type: Output }],
2220
+ sessionActions: [{ type: Output }],
2221
+ closeBot: [{ type: Output }],
2222
+ connectWithUser: [{ type: Output }],
2223
+ scheduleMeeting: [{ type: Output }],
2224
+ refreshToken: [{ type: Output }],
2225
+ openSupport: [{ type: Output }]
2226
+ };
2227
+
2228
+ class ChatBotComponent {
2229
+ constructor() {
2230
+ this.visible = false;
2231
+ }
2232
+ toggle() {
2233
+ this.visible = !this.visible;
2234
+ }
2235
+ }
2236
+ ChatBotComponent.decorators = [
2237
+ { type: Component, args: [{
2238
+ selector: 'hivegpt-chatbot',
2239
+ template: "<button mat-icon-button class=\"chat-button\" color=\"primary\" (click)=\"toggle()\">\n <mat-icon>chat</mat-icon>\n</button>\n\n<ng-container *ngIf=\"visible\">\n <hivegpt-chat-drawer\n [apiKey]=\"apiKey\"\n [bgBubbleAi]=\"bgBubbleAi\"\n [bgBubbleUser]=\"bgBubbleUser\"\n [bgGradient]=\"bgGradient\"\n [botName]=\"botName\"\n [closeButtonbgColor]=\"closeButtonbgColor\"\n [closeButtonColor]=\"closeButtonColor\"\n [credentials]=\"credentials\"\n [dateTextColor]=\"dateTextColor\"\n [dateTimeColor]=\"dateTimeColor\"\n [eventId]=\"eventId\"\n [eventName]=\"eventName\"\n [formFieldBgColor]=\"formFieldBgColor\"\n [formFieldTextColor]=\"formFieldTextColor\"\n [fullView]=\"fullView\"\n [greeting]=\"greeting\"\n [gradientColors]=\"gradientColors\"\n [messageTextColorAi]=\"messageTextColorAi\"\n [messageTextColorUser]=\"messageTextColorUser\"\n [sendButtonColor]=\"sendButtonColor\"\n [sendButtonTextColor]=\"sendButtonTextColor\"\n [showClose]=\"showClose\"\n [thumbsDownMessages]=\"thumbsDownMessages\"\n [thumbsUpMessage]=\"thumbsUpMessage\"\n [unknownResponses]=\"unknownResponses\"\n [useOpenAi]=\"useOpenAi\"\n [userId]=\"userId\"\n [botId]=\"botId\"\n >\n </hivegpt-chat-drawer>\n</ng-container>\n",
2240
+ styles: ["::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:#f1f1f1}::-webkit-scrollbar-thumb,::-webkit-scrollbar-thumb:hover{background:#e5ccbc}.spinner{align-items:center;display:flex;gap:2px;justify-content:center}.spinner>div{animation:bouncedelay 1.4s ease-in-out infinite;animation-fill-mode:both;background-color:#173330;border-radius:100%;display:inline-block;height:5px;width:5px}.spinner .bounce1{animation-delay:-.32s}.spinner .bounce2{animation-delay:-.16s}@keyframes bouncedelay{0%,80%,to{-webkit-transform:scale(0);transform:scale(0)}40%{-webkit-transform:scale(1);transform:scale(1)}}.chat-button{align-items:center;background:#17235b;border:#17235b;border-radius:50%;bottom:20px;color:#fff;display:inline-flex;font-size:24px;height:50px;justify-content:center;position:fixed;right:20px;width:50px}"]
2241
+ },] }
2242
+ ];
2243
+ ChatBotComponent.propDecorators = {
2244
+ userId: [{ type: Input }],
2245
+ apiKey: [{ type: Input }],
2246
+ botName: [{ type: Input }],
2247
+ botSkills: [{ type: Input }],
2248
+ botId: [{ type: Input }],
2249
+ closeButtonColor: [{ type: Input }],
2250
+ gradientColors: [{ type: Input }],
2251
+ greeting: [{ type: Input }],
2252
+ sendButtonColor: [{ type: Input }],
2253
+ useOpenAi: [{ type: Input }],
2254
+ showClose: [{ type: Input }],
2255
+ bgGradient: [{ type: Input }],
2256
+ sendButtonTextColor: [{ type: Input }],
2257
+ fullView: [{ type: Input }],
2258
+ bgBubbleAi: [{ type: Input }],
2259
+ bgBubbleUser: [{ type: Input }],
2260
+ closeButtonbgColor: [{ type: Input }],
2261
+ messageTextColorAi: [{ type: Input }],
2262
+ messageTextColorUser: [{ type: Input }],
2263
+ dateTimeColor: [{ type: Input }],
2264
+ dateTextColor: [{ type: Input }],
2265
+ formFieldBgColor: [{ type: Input }],
2266
+ formFieldTextColor: [{ type: Input }],
2267
+ thumbsUpMessage: [{ type: Input }],
2268
+ thumbsDownMessages: [{ type: Input }],
2269
+ timezone: [{ type: Input }],
2270
+ eventName: [{ type: Input }],
2271
+ credentials: [{ type: Input }],
2272
+ unknownResponses: [{ type: Input }],
2273
+ rules: [{ type: Input }],
2274
+ eventId: [{ type: Input }]
2275
+ };
2276
+
2277
+ class SafeHtmlPipe {
2278
+ constructor(sanitizer) {
2279
+ this.sanitizer = sanitizer;
2280
+ }
2281
+ transform(html) {
2282
+ return html ? this.sanitizer.bypassSecurityTrustHtml(html) : '';
2283
+ }
2284
+ }
2285
+ SafeHtmlPipe.decorators = [
2286
+ { type: Pipe, args: [{
2287
+ name: 'safeHtml',
2288
+ },] }
2289
+ ];
2290
+ SafeHtmlPipe.ctorParameters = () => [
2291
+ { type: DomSanitizer }
2292
+ ];
2293
+
2294
+ class VideoPlayerComponent {
2295
+ constructor(doc, el, cdr) {
2296
+ this.doc = doc;
2297
+ this.el = el;
2298
+ this.cdr = cdr;
2299
+ this.isMuted = true;
2300
+ this.isFullscreen = false;
2301
+ this.isFullscreenvideoPlaying = false;
2302
+ this.connectWithUser = new EventEmitter();
2303
+ this.scheduleMeeting = new EventEmitter();
2304
+ }
2305
+ ngOnInit() {
2306
+ }
2307
+ toggleSound(isMuted = null) {
2308
+ this.isMuted = isMuted != null ? isMuted : !this.isMuted;
2309
+ setTimeout(() => {
2310
+ const video = this.doc
2311
+ .getElementById(this.video.id.toString());
2312
+ if (video) {
2313
+ video.muted = this.isMuted;
2314
+ this.video.isMuted = this.isMuted;
2315
+ }
2316
+ this.cdr.markForCheck();
2317
+ //this.muteToggle.emit(this.isMuted);
2318
+ });
2319
+ }
2320
+ togglePlay(playState, videoEl) {
2321
+ this.videoObj.isPlaying = !this.videoObj.isPlaying;
2322
+ setTimeout(() => {
2323
+ if (playState) {
2324
+ this.videoObj.isPlaying = true;
2325
+ videoEl.play();
2326
+ var pauseBtn = document.getElementById('pause-btn');
2327
+ pauseBtn.classList.add('hide-pause-btn');
2328
+ this.toggleSound(false);
2329
+ }
2330
+ else {
2331
+ this.videoObj.isPlaying = false;
2332
+ videoEl.pause();
2333
+ }
2334
+ this.cdr.markForCheck();
2335
+ });
2336
+ }
2337
+ ngAfterViewInit() {
2338
+ if (window.innerWidth <= 576) {
2339
+ this.observer = new IntersectionObserver((entries) => {
2340
+ if (entries[0].isIntersecting === true) {
2341
+ this.video.nativeElement.play();
2342
+ }
2343
+ else {
2344
+ this.video.nativeElement.pause();
2345
+ }
2346
+ }, {
2347
+ threshold: 0.75,
2348
+ });
2349
+ this.observer.observe(this.el.nativeElement);
2350
+ }
2351
+ }
2352
+ toggleFullscreen() {
2353
+ this.isFullscreen = !this.isFullscreen;
2354
+ if (!this.isFullscreen) {
2355
+ this.fullscreenvideo.nativeElement.pause();
2356
+ }
2357
+ }
2358
+ toggleFullscreenPlay() {
2359
+ this.isFullscreenvideoPlaying = !this.isFullscreenvideoPlaying;
2360
+ if (this.isFullscreenvideoPlaying) {
2361
+ this.fullscreenvideo.nativeElement.play();
2362
+ }
2363
+ else {
2364
+ this.fullscreenvideo.nativeElement.pause();
2365
+ }
2366
+ }
2367
+ followUser(userId) {
2368
+ this.connectWithUser.emit(userId);
2369
+ }
2370
+ checkPendingSentRequest(userId) {
2371
+ var _a;
2372
+ return (_a = this.myPendingSentRequests) === null || _a === void 0 ? void 0 : _a.find(a => a == userId);
2373
+ }
2374
+ canUnfollowUser() {
2375
+ return false;
2376
+ }
2377
+ canFollowUser() {
2378
+ return true;
2379
+ }
2380
+ getIniNames(firstName, lastName) {
2381
+ if (!firstName && !lastName) {
2382
+ return '';
2383
+ }
2384
+ if (firstName && lastName)
2385
+ return (firstName.charAt(0).toUpperCase() + lastName.charAt(0).toUpperCase());
2386
+ else
2387
+ return firstName.charAt(0).toUpperCase();
2388
+ }
2389
+ }
2390
+ VideoPlayerComponent.decorators = [
2391
+ { type: Component, args: [{
2392
+ selector: 'app-video-player',
2393
+ template: "<div class=\"video-wrapper\" >\n <div class=\"overlymask-video\"></div>\n <video (click)=\"toggleFullscreen()\" #video [loop]=\"true\" [muted]=\"isMuted\" [src]=\"videoObj.processedUrls || videoObj.url\" playsinline\n [controls]=\"false\"></video>\n <div class=\"main-controls\" [class.no-opacity]=\"video.isPlaying\">\n <button mat-icon-button *ngIf=\"!videoObj.isPlaying\"\n attr.aria-label=\"Play Video\"\n title=\"Play Video\" class=\"play-pause-btn\"\n (click)=\"togglePlay(true, video)\">\n <!-- <mat-icon alt=\"Play\">play_arrow</mat-icon> -->\n <span class=\"material-icons notranslate \" aria-hidden=\"true\">play_circle_outline</span>\n </button>\n\n <button mat-icon-button id=\"pause-btn\" [hidden]=\"!videoObj.isPlaying\" class=\"pause_btn play-pause-btn playing\"\n title=\"Pause Video\"\n [class.half-opacity]=\"video.isPlaying\" (click)=\"togglePlay(false, video)\">\n <!-- <mat-icon alt=\"Pause\">pause</mat-icon> -->\n <span class=\"material-icons notranslate \" aria-hidden=\"true\">pause_circle_outline</span>\n </button>\n </div>\n <div class=\"video-actions\">\n <button class=\"button-trasparent action\" (click)=\"toggleSound()\" title=\"Mute\" *ngIf=\"isMuted\">\n <span class=\"material-icons notranslate \" aria-hidden=\"true\">volume_off</span>\n </button>\n <button class=\"button-trasparent action\" (click)=\"toggleSound()\" title=\"Unmute\" *ngIf=\"!isMuted\">\n <span class=\"material-icons notranslate \" aria-hidden=\"true\">volume_up</span>\n </button>\n\n </div>\n</div>\n\n<div class=\"full-screen\" *ngIf=\"isFullscreen\" [ngClass]=\"{'show': isFullscreen}\">\n <div class=\"video-wrapper\">\n <video #fullscreenvideo (click)=\"toggleFullscreenPlay()\" [loop]=\"true\" [muted]=\"isMuted\" [src]=\"videoObj.processedUrls || videoObj.url\"\n playsinline [controls]=\"false\"></video>\n <div (click)=\"toggleFullscreen()\" class=\"close-btn\">\n <span class=\"material-icons notranslate \">clear</span>\n </div>\n <div class=\"video-actions\">\n <button *ngIf=\"!video.isPlaying\" title=\"Play\"\n class=\"material-icons notranslate body-text-color fs-h2 play position-absolute transparent-btn\" (click)=\"togglePlay(true, video)\">\n play_circle_outline\n </button>\n <button id=\"pause-btn\" [hidden]=\"!videoObj.isPlaying\" title=\"Pause\"\n class=\"pause_btn material-icons body-text-color fs-h2 play position-absolute transparent-btn\"\n [class.half-opacity]=\"video.isPlaying\" (click)=\"togglePlay(false, video)\">\n pause_circle_outline\n </button>\n </div>\n </div>\n</div>\n",
2394
+ styles: [".video-wrapper{position:relative}.video-wrapper video{-o-object-fit:cover;border-radius:5px;cursor:pointer;height:330px;object-fit:cover;outline:0;transition:.3s ease-in-out;width:100%}.video-wrapper .video-actions{display:flex;flex-direction:column;position:absolute;right:10px;top:10px}.video-wrapper .video-actions .action{color:#fff;cursor:pointer;margin-bottom:5px}.video-wrapper .author-details{bottom:18px;display:flex;flex-direction:column;justify-content:flex-start;left:12px;position:absolute;right:12px;transition:.3s ease-in-out}.video-wrapper .author-details .author-image{border-radius:50%;height:34px;margin-right:6px;overflow:hidden;width:34px}.video-wrapper .author-details .author-image img{-o-object-fit:cover;height:100%;object-fit:cover;width:100%}.video-wrapper .author-details .author-name,.video-wrapper .author-details .video-title{color:#fff;display:block;font-size:14px;mix-blend-mode:hard-light}.video-wrapper .connect-btn{bottom:20px;opacity:0;outline:0;position:absolute;text-align:center;transition:.3s ease-in-out;width:100%}@media only screen and (max-width:576px){.video-wrapper .connect-btn{opacity:1;right:20px;width:unset}}.video-wrapper .connect-btn button{margin:auto}.video-wrapper:hover .author-details{opacity:0}@media only screen and (max-width:576px){.video-wrapper:hover .author-details{opacity:1}}.video-wrapper:hover .connect-btn{opacity:1}.video-wrapper .half-opacity{opacity:.2}.video-wrapper .no-opacity{background-color:transparent}.like-btn{margin-bottom:20px;text-align:center;transition:.2s ease-in-out}.like-btn .count{font-size:16px;margin-left:3px}.like-btn span{cursor:pointer;font-size:30px}.like-btn:hover{transform:scale(1.1)}.like-btn.like{color:#025be7}.like-btn.dislike{color:#8d8d8d}.like-btn.info{color:#aeae3f}.full-screen.show{align-items:center;background:rgba(27,26,26,.9607843137254902);display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:9999}.full-screen.show .video-wrapper video{height:270px;transform:none!important;transition:none;width:300px}.full-screen .close-btn{cursor:pointer;left:10px;position:absolute;top:10px}.full-screen .close-btn span{color:#fff}.main-controls{background-color:rgba(0,0,0,.3);bottom:0;left:0;right:0;top:0}.main-controls,.main-controls .play-pause-btn{align-items:center;display:flex;justify-content:center;position:absolute}.main-controls .play-pause-btn{background:none;border:none;color:#fff;line-height:0;top:34%}.main-controls .play-pause-btn.playing{cursor:pointer;left:50%;position:absolute;top:40%;transform:translate(-50%,-50%)}.main-controls .play-pause-btn.playing span{color:#fff;text-shadow:0 0 6px rgba(47,47,47,.36)}.main-controls .play-pause-btn:focus{outline:none}.main-controls .play-pause-btn .material-icons{font-size:40px}.main-controls .play-pause-btn .mat-icon{height:auto;width:auto}.main-controls .half-opacity{opacity:.2}.main-controls .no-opacity{background-color:transparent}button.transparent-btn{background:transparent;border:0!important}.pause_btn{height:100%;opacity:.02!important;width:100%}.pause_btn:hover{background-color:rgba(0,0,0,.7411764705882353);opacity:1!important}.hide-pause-btn{opacity:0!important}.no-photo{align-items:center;display:flex;font-size:14px;height:35px;justify-content:center;width:35px}.overlymask-video{background-image:linear-gradient(hsla(0,0%,100%,.058823529411764705),rgba(0,0,0,.1803921568627451));background-position:0 bottom;height:275px;position:absolute;width:100%;z-index:0}"]
2395
+ },] }
2396
+ ];
2397
+ VideoPlayerComponent.ctorParameters = () => [
2398
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
2399
+ { type: ElementRef },
2400
+ { type: ChangeDetectorRef }
2401
+ ];
2402
+ VideoPlayerComponent.propDecorators = {
2403
+ currentUserId: [{ type: Input }],
2404
+ user: [{ type: Input }],
2405
+ eventId: [{ type: Input }],
2406
+ videoObj: [{ type: Input }],
2407
+ isDev: [{ type: Input }],
2408
+ type: [{ type: Input }],
2409
+ video: [{ type: ViewChild, args: ['video',] }],
2410
+ fullscreenvideo: [{ type: ViewChild, args: ['fullscreenvideo',] }],
2411
+ connectWithUser: [{ type: Output }],
2412
+ scheduleMeeting: [{ type: Output }]
2413
+ };
2414
+
2415
+ class BotHtmlEditorComponent {
2416
+ constructor(cdr, http) {
2417
+ this.cdr = cdr;
2418
+ this.http = http;
2419
+ this.documentName = 'doc name';
2420
+ this.quillConfig = {
2421
+ toolbar: [
2422
+ [{ header: '1' }, { header: '2' }, { font: [] }],
2423
+ [{ list: 'ordered' }, { list: 'bullet' }],
2424
+ ['bold', 'italic', 'underline'],
2425
+ ['link'],
2426
+ ['clean'],
2427
+ ],
2428
+ };
2429
+ }
2430
+ ngOnInit() {
2431
+ this.environment = prod_environment;
2432
+ setTimeout(() => {
2433
+ if (this.isDocInEditMode) {
2434
+ console.log('In Edit mode');
2435
+ this.filldataInForm();
2436
+ }
2437
+ else {
2438
+ console.log('In save mode');
2439
+ }
2440
+ }, 2500);
2441
+ }
2442
+ filldataInForm() {
2443
+ var _a, _b;
2444
+ if (this.documentContent) {
2445
+ this.documentName = (_a = this.documentContent) === null || _a === void 0 ? void 0 : _a.name;
2446
+ this.editorContent = (_b = this.documentContent) === null || _b === void 0 ? void 0 : _b.content;
2447
+ this.cdr.detectChanges();
2448
+ }
2449
+ }
2450
+ saveContent() {
2451
+ if (!this.isDocInEditMode) {
2452
+ this.saveContent_http().subscribe();
2453
+ }
2454
+ else {
2455
+ this.saveContent_http().subscribe();
2456
+ }
2457
+ }
2458
+ saveContent_http() {
2459
+ console.log('API call function');
2460
+ const url = `${this.environment.AGENTS_API}/ConversationDocuments?conversationId=${this.conversationId}&botId=${this.botId}`;
2461
+ const headers = new HttpHeaders({
2462
+ 'Content-Type': 'application/json',
2463
+ apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',
2464
+ });
2465
+ let data = {
2466
+ name: this.documentName,
2467
+ content: this.editorContent,
2468
+ };
2469
+ return this.http.post(url, data, { headers }).pipe(switchMap((res) => {
2470
+ if (res) {
2471
+ // alert('Saved Successfully');
2472
+ }
2473
+ this.cdr.markForCheck();
2474
+ return of(res);
2475
+ }), catchError((error) => {
2476
+ console.error('Error fetching chatbot config: ', error);
2477
+ return of(null);
2478
+ }));
2479
+ }
2480
+ updateContent_http() {
2481
+ console.log('API call function');
2482
+ const url = `${this.environment.AGENTS_API}/ConversationDocuments/rename?conversationId=${this.conversationId}&botId=${this.botId}`;
2483
+ const headers = new HttpHeaders({
2484
+ 'Content-Type': 'application/json',
2485
+ apiKey: 'WIz/qAm+EEmfOkFaUA/weA==',
2486
+ });
2487
+ let data = {
2488
+ name: this.documentName,
2489
+ content: this.editorContent,
2490
+ };
2491
+ return this.http.put(url, data, { headers }).pipe(switchMap((res) => {
2492
+ if (res) {
2493
+ // alert('Updated Successfully');
2494
+ }
2495
+ this.cdr.markForCheck();
2496
+ return of(res);
2497
+ }), catchError((error) => {
2498
+ console.error('Error fetching chatbot config: ', error);
2499
+ return of(null);
2500
+ }));
2501
+ }
2502
+ }
2503
+ BotHtmlEditorComponent.decorators = [
2504
+ { type: Component, args: [{
2505
+ selector: 'lib-bot-html-editor',
2506
+ template: "<div style=\"padding: 12px\">\n <div style=\"margin-top: 42px\" class=\"form-group\">\n <input [(ngModel)]=\"documentName\" class=\"form-control\" type=\"text\" />\n <button (click)=\"saveContent()\" class=\"save-btn\">Save</button>\n </div>\n\n <quill-editor\n [(ngModel)]=\"editorContent\"\n [modules]=\"quillConfig\"\n ></quill-editor>\n</div>\n",
2507
+ styles: [".save-btn{background-color:#f0f0f0;border:none;color:#333;margin-top:22px;position:absolute;right:16px;width:56px}"]
2508
+ },] }
2509
+ ];
2510
+ BotHtmlEditorComponent.ctorParameters = () => [
2511
+ { type: ChangeDetectorRef },
2512
+ { type: HttpClient }
2513
+ ];
2514
+ BotHtmlEditorComponent.propDecorators = {
2515
+ editorContent: [{ type: Input }],
2516
+ isDocInEditMode: [{ type: Input }],
2517
+ documentContent: [{ type: Input }],
2518
+ conversationId: [{ type: Input }],
2519
+ botId: [{ type: Input }]
2520
+ };
2521
+
2522
+ class HiveGptModule {
2523
+ }
2524
+ HiveGptModule.decorators = [
2525
+ { type: NgModule, args: [{
2526
+ declarations: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent, SafeHtmlPipe, BotHtmlEditorComponent],
2527
+ imports: [CommonModule, MatIconModule, MatSidenavModule, FormsModule, QuillModule],
2528
+ exports: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent]
2529
+ },] }
2530
+ ];
2531
+
2532
+ /*
2533
+ * Public API Surface of hive-gpt
2534
+ */
2535
+
2536
+ /**
2537
+ * Generated bundle index. Do not edit.
2538
+ */
2539
+
2540
+ export { ChatBotComponent, ChatDrawerComponent, HiveGptModule, BotsService as ɵa, SocketService as ɵb, ConversationService as ɵc, NotificationSocket as ɵd, TranslationService as ɵe, VideoPlayerComponent as ɵf, SafeHtmlPipe as ɵg, BotHtmlEditorComponent as ɵh };
2541
+ //# sourceMappingURL=hivegpt-hiveai-angular.js.map