@hivegpt/hiveai-angular 0.0.372 → 0.0.373
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +16 -0
- package/README.md +13 -9
- package/angular.json +51 -0
- package/package.json +51 -14
- package/projects/hivegpt/eventsgpt-angular/README.md +23 -0
- package/projects/hivegpt/eventsgpt-angular/karma.conf.js +32 -0
- package/projects/hivegpt/eventsgpt-angular/ng-package.json +7 -0
- package/projects/hivegpt/eventsgpt-angular/package.json +20 -0
- package/projects/hivegpt/eventsgpt-angular/src/environments/environment.ts +19 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/NotificationSocket.ts +38 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/bot-html-editor/bot-html-editor.component.css +10 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/bot-html-editor/bot-html-editor.component.html +11 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/bot-html-editor/bot-html-editor.component.spec.ts +25 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/bot-html-editor/bot-html-editor.component.ts +152 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/bot.service.ts +52 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/chat-drawer/chat-drawer.component.html +1586 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/chat-drawer/chat-drawer.component.scss +2907 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/chat-drawer/chat-drawer.component.ts +2143 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/chatbot/chatbot.component.html +37 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/chatbot/chatbot.component.scss +97 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/chatbot/chatbot.component.ts +44 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/conversation.service.spec.ts +16 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/conversation.service.ts +54 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/socket-service.service.spec.ts +16 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/socket-service.service.ts +77 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/translations/translation.service.ts +268 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/video-player/video-player.component.html +51 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/video-player/video-player.component.scss +262 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/components/video-player/video-player.component.ts +148 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/hivegpt.module.ts +18 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/models/video.ts +36 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/pipes/safe-html.pipe.ts +16 -0
- package/projects/hivegpt/eventsgpt-angular/src/lib/utils/utils.ts +37 -0
- package/{public-api.d.ts → projects/hivegpt/eventsgpt-angular/src/public-api.ts} +4 -1
- package/projects/hivegpt/eventsgpt-angular/tsconfig.lib.json +25 -0
- package/projects/hivegpt/eventsgpt-angular/tsconfig.lib.prod.json +10 -0
- package/projects/hivegpt/eventsgpt-angular/tsconfig.spec.json +17 -0
- package/projects/hivegpt/eventsgpt-angular/tslint.json +17 -0
- package/tsconfig.json +28 -0
- package/tslint.json +140 -0
- package/wew +0 -0
- package/bundles/hivegpt-hiveai-angular.umd.js +0 -3116
- package/bundles/hivegpt-hiveai-angular.umd.js.map +0 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +0 -2
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +0 -1
- package/environments/environment.d.ts +0 -15
- package/environments/environment.d.ts.map +0 -1
- package/esm2015/environments/environment.js +0 -15
- package/esm2015/hivegpt-hiveai-angular.js +0 -13
- package/esm2015/lib/components/NotificationSocket.js +0 -39
- package/esm2015/lib/components/bot-html-editor/bot-html-editor.component.js +0 -112
- package/esm2015/lib/components/bot.service.js +0 -50
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +0 -1743
- package/esm2015/lib/components/chatbot/chatbot.component.js +0 -50
- package/esm2015/lib/components/conversation.service.js +0 -49
- package/esm2015/lib/components/socket-service.service.js +0 -72
- package/esm2015/lib/components/translations/translation.service.js +0 -215
- package/esm2015/lib/components/video-player/video-player.component.js +0 -123
- package/esm2015/lib/hivegpt.module.js +0 -21
- package/esm2015/lib/models/video.js +0 -2
- package/esm2015/lib/pipes/safe-html.pipe.js +0 -19
- package/esm2015/lib/utils/utils.js +0 -36
- package/esm2015/public-api.js +0 -7
- package/fesm2015/hivegpt-hiveai-angular.js +0 -2512
- package/fesm2015/hivegpt-hiveai-angular.js.map +0 -1
- package/hivegpt-hiveai-angular.d.ts +0 -13
- package/hivegpt-hiveai-angular.d.ts.map +0 -1
- package/hivegpt-hiveai-angular.metadata.json +0 -1
- package/lib/components/NotificationSocket.d.ts +0 -5
- package/lib/components/NotificationSocket.d.ts.map +0 -1
- package/lib/components/bot-html-editor/bot-html-editor.component.d.ts +0 -36
- package/lib/components/bot-html-editor/bot-html-editor.component.d.ts.map +0 -1
- package/lib/components/bot.service.d.ts +0 -12
- package/lib/components/bot.service.d.ts.map +0 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts +0 -255
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +0 -1
- package/lib/components/chatbot/chatbot.component.d.ts +0 -36
- package/lib/components/chatbot/chatbot.component.d.ts.map +0 -1
- package/lib/components/conversation.service.d.ts +0 -13
- package/lib/components/conversation.service.d.ts.map +0 -1
- package/lib/components/socket-service.service.d.ts +0 -20
- package/lib/components/socket-service.service.d.ts.map +0 -1
- package/lib/components/translations/translation.service.d.ts +0 -8
- package/lib/components/translations/translation.service.d.ts.map +0 -1
- package/lib/components/video-player/video-player.component.d.ts +0 -36
- package/lib/components/video-player/video-player.component.d.ts.map +0 -1
- package/lib/hivegpt.module.d.ts +0 -3
- package/lib/hivegpt.module.d.ts.map +0 -1
- package/lib/models/video.d.ts +0 -35
- package/lib/models/video.d.ts.map +0 -1
- package/lib/pipes/safe-html.pipe.d.ts +0 -8
- package/lib/pipes/safe-html.pipe.d.ts.map +0 -1
- package/lib/utils/utils.d.ts +0 -3
- package/lib/utils/utils.d.ts.map +0 -1
- package/public-api.d.ts.map +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<button mat-icon-button class="chat-button" color="primary" (click)="toggle()">
|
|
2
|
+
<mat-icon>chat</mat-icon>
|
|
3
|
+
</button>
|
|
4
|
+
|
|
5
|
+
<ng-container *ngIf="visible">
|
|
6
|
+
<hivegpt-chat-drawer
|
|
7
|
+
[apiKey]="apiKey"
|
|
8
|
+
[bgBubbleAi]="bgBubbleAi"
|
|
9
|
+
[bgBubbleUser]="bgBubbleUser"
|
|
10
|
+
[bgGradient]="bgGradient"
|
|
11
|
+
[botName]="botName"
|
|
12
|
+
[closeButtonbgColor]="closeButtonbgColor"
|
|
13
|
+
[closeButtonColor]="closeButtonColor"
|
|
14
|
+
[credentials]="credentials"
|
|
15
|
+
[dateTextColor]="dateTextColor"
|
|
16
|
+
[dateTimeColor]="dateTimeColor"
|
|
17
|
+
[eventId]="eventId"
|
|
18
|
+
[eventName]="eventName"
|
|
19
|
+
[formFieldBgColor]="formFieldBgColor"
|
|
20
|
+
[formFieldTextColor]="formFieldTextColor"
|
|
21
|
+
[fullView]="fullView"
|
|
22
|
+
[greeting]="greeting"
|
|
23
|
+
[gradientColors]="gradientColors"
|
|
24
|
+
[messageTextColorAi]="messageTextColorAi"
|
|
25
|
+
[messageTextColorUser]="messageTextColorUser"
|
|
26
|
+
[sendButtonColor]="sendButtonColor"
|
|
27
|
+
[sendButtonTextColor]="sendButtonTextColor"
|
|
28
|
+
[showClose]="showClose"
|
|
29
|
+
[thumbsDownMessages]="thumbsDownMessages"
|
|
30
|
+
[thumbsUpMessage]="thumbsUpMessage"
|
|
31
|
+
[unknownResponses]="unknownResponses"
|
|
32
|
+
[useOpenAi]="useOpenAi"
|
|
33
|
+
[userId]="userId"
|
|
34
|
+
[botId]="botId"
|
|
35
|
+
>
|
|
36
|
+
</hivegpt-chat-drawer>
|
|
37
|
+
</ng-container>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* width */
|
|
2
|
+
::-webkit-scrollbar {
|
|
3
|
+
width: 5px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* Track */
|
|
7
|
+
::-webkit-scrollbar-track {
|
|
8
|
+
background: #f1f1f1;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Handle */
|
|
12
|
+
::-webkit-scrollbar-thumb {
|
|
13
|
+
background: #e5ccbc;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Handle on hover */
|
|
17
|
+
::-webkit-scrollbar-thumb:hover {
|
|
18
|
+
background: #e5ccbc;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
.spinner {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
gap: 2px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.spinner>div {
|
|
30
|
+
width: 5px;
|
|
31
|
+
height: 5px;
|
|
32
|
+
background-color: #173330;
|
|
33
|
+
border-radius: 100%;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
-webkit-animation: bouncedelay 1.4s infinite ease-in-out;
|
|
36
|
+
animation: bouncedelay 1400ms ease-in-out infinite;
|
|
37
|
+
/* Prevent first frame from flickering when animation starts */
|
|
38
|
+
-webkit-animation-fill-mode: both;
|
|
39
|
+
animation-fill-mode: both;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.spinner .bounce1 {
|
|
43
|
+
-webkit-animation-delay: -0.32s;
|
|
44
|
+
animation-delay: -0.32s;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.spinner .bounce2 {
|
|
48
|
+
-webkit-animation-delay: -0.16s;
|
|
49
|
+
animation-delay: -0.16s;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@-webkit-keyframes bouncedelay {
|
|
53
|
+
|
|
54
|
+
0%,
|
|
55
|
+
80%,
|
|
56
|
+
100% {
|
|
57
|
+
transform: scale(0);
|
|
58
|
+
-webkit-transform: scale(0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
40% {
|
|
62
|
+
transform: scale(1);
|
|
63
|
+
-webkit-transform: scale(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@keyframes bouncedelay {
|
|
68
|
+
|
|
69
|
+
0%,
|
|
70
|
+
80%,
|
|
71
|
+
100% {
|
|
72
|
+
transform: scale(0);
|
|
73
|
+
-webkit-transform: scale(0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
40% {
|
|
77
|
+
transform: scale(1);
|
|
78
|
+
-webkit-transform: scale(1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
.chat-button {
|
|
84
|
+
position: fixed;
|
|
85
|
+
bottom: 20px;
|
|
86
|
+
right: 20px;
|
|
87
|
+
background: #17235B;
|
|
88
|
+
border: #17235B;
|
|
89
|
+
border-radius: 50%;
|
|
90
|
+
width: 50px;
|
|
91
|
+
height: 50px;
|
|
92
|
+
font-size: 24px;
|
|
93
|
+
color: #fff;
|
|
94
|
+
display: inline-flex;
|
|
95
|
+
align-items: center;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
@Component({
|
|
3
|
+
selector: 'hivegpt-chatbot',
|
|
4
|
+
templateUrl: './chatbot.component.html',
|
|
5
|
+
styleUrls: ['./chatbot.component.scss'],
|
|
6
|
+
})
|
|
7
|
+
export class ChatBotComponent {
|
|
8
|
+
@Input() userId!: string;
|
|
9
|
+
@Input() apiKey!: string;
|
|
10
|
+
@Input() botName!: string;
|
|
11
|
+
@Input() botSkills!: string;
|
|
12
|
+
@Input() botId!: string;
|
|
13
|
+
@Input() closeButtonColor!: string;
|
|
14
|
+
@Input() gradientColors!: string[];
|
|
15
|
+
@Input() greeting!: string;
|
|
16
|
+
@Input() sendButtonColor!: string;
|
|
17
|
+
@Input() useOpenAi!: boolean;
|
|
18
|
+
@Input() showClose!: boolean;
|
|
19
|
+
@Input() bgGradient!: string[];
|
|
20
|
+
@Input() sendButtonTextColor!: string;
|
|
21
|
+
@Input() fullView!: boolean;
|
|
22
|
+
@Input() bgBubbleAi!: string;
|
|
23
|
+
@Input() bgBubbleUser!: string;
|
|
24
|
+
@Input() closeButtonbgColor!: string;
|
|
25
|
+
@Input() messageTextColorAi!: string;
|
|
26
|
+
@Input() messageTextColorUser!: string;
|
|
27
|
+
@Input() dateTimeColor!: string;
|
|
28
|
+
@Input() dateTextColor!: string;
|
|
29
|
+
@Input() formFieldBgColor!: string;
|
|
30
|
+
@Input() formFieldTextColor!: string;
|
|
31
|
+
@Input() thumbsUpMessage!: string;
|
|
32
|
+
@Input() thumbsDownMessages!: string[];
|
|
33
|
+
@Input() timezone!: string;
|
|
34
|
+
@Input() eventName!: string;
|
|
35
|
+
@Input() credentials!: [];
|
|
36
|
+
@Input() unknownResponses!: [];
|
|
37
|
+
@Input() rules!: string;
|
|
38
|
+
@Input() eventId!: string;
|
|
39
|
+
visible = false;
|
|
40
|
+
|
|
41
|
+
toggle() {
|
|
42
|
+
this.visible = !this.visible;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ConversationService } from './conversation.service';
|
|
4
|
+
|
|
5
|
+
describe('ConversationService', () => {
|
|
6
|
+
let service: ConversationService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(ConversationService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { Observable, Subject } from 'rxjs';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root',
|
|
6
|
+
})
|
|
7
|
+
export class ConversationService {
|
|
8
|
+
private conversationStorageKeyPrefix = 'conversationKey_';
|
|
9
|
+
private sessionStorageKeyPrefix = 'sessionKey_';
|
|
10
|
+
|
|
11
|
+
private userSpecificNotification: Subject<any> = new Subject<any>();
|
|
12
|
+
|
|
13
|
+
constructor() { }
|
|
14
|
+
|
|
15
|
+
generateKey(): string {
|
|
16
|
+
const timestamp = Math.floor(new Date().getTime() / 1000).toString(16);
|
|
17
|
+
const randomHex = 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, () => {
|
|
18
|
+
return Math.floor(Math.random() * 16).toString(16);
|
|
19
|
+
});
|
|
20
|
+
return timestamp + randomHex;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getKey(botId: string, resetKey: boolean = false): string {
|
|
24
|
+
const storageKey = `${this.conversationStorageKeyPrefix}${botId}`;
|
|
25
|
+
let value = localStorage.getItem(storageKey);
|
|
26
|
+
|
|
27
|
+
if (!value || resetKey) {
|
|
28
|
+
value = this.generateKey();
|
|
29
|
+
localStorage.setItem(storageKey, value);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getSessionKey(sessionId: string, resetKey: boolean = false): string {
|
|
36
|
+
const storageKey = `${this.sessionStorageKeyPrefix}${sessionId}`;
|
|
37
|
+
let value = localStorage.getItem(storageKey);
|
|
38
|
+
|
|
39
|
+
if (!value || resetKey) {
|
|
40
|
+
value = this.generateKey();
|
|
41
|
+
localStorage.setItem(storageKey, value);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
sendValidatedUserData(message: any) {
|
|
48
|
+
this.userSpecificNotification.next(message);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
getUserSpecificNotification(): Observable<any> {
|
|
52
|
+
return this.userSpecificNotification.asObservable();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { SocketServiceService } from './socket-service.service';
|
|
4
|
+
|
|
5
|
+
describe('SocketServiceService', () => {
|
|
6
|
+
let service: SocketServiceService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(SocketServiceService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { Observable, Subject } from 'rxjs';
|
|
4
|
+
import { webSocket, WebSocketSubject } from 'rxjs/webSocket';
|
|
5
|
+
import { ConversationService } from './conversation.service';
|
|
6
|
+
import { NotificationSocket } from './NotificationSocket';
|
|
7
|
+
|
|
8
|
+
@Injectable({
|
|
9
|
+
providedIn: 'root',
|
|
10
|
+
})
|
|
11
|
+
export class SocketService {
|
|
12
|
+
public testMessage: string;
|
|
13
|
+
private isCommonSocketInitialized = false;
|
|
14
|
+
private isUserSpecificSocketInitialized = false;
|
|
15
|
+
private isUserSpecificEventReleased = true;
|
|
16
|
+
private messageQueue: any[] = [];
|
|
17
|
+
private releaseInterval = 1000;
|
|
18
|
+
private intervalSetup: boolean = false;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
private conversationService: ConversationService,
|
|
22
|
+
private notificationSocket: NotificationSocket
|
|
23
|
+
) {
|
|
24
|
+
this.startReleasingMessages();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
isSocketInitialized(isCommon: boolean) {
|
|
28
|
+
return isCommon
|
|
29
|
+
? this.isCommonSocketInitialized
|
|
30
|
+
: this.isUserSpecificSocketInitialized &&
|
|
31
|
+
!this.isUserSpecificEventReleased;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
disconnectSocketConnection() {
|
|
35
|
+
this.notificationSocket.disconnect();
|
|
36
|
+
}
|
|
37
|
+
connectSocketConnection() {
|
|
38
|
+
this.notificationSocket.connect();
|
|
39
|
+
}
|
|
40
|
+
registerUserSpecificHiveSocket(botId: string, conversation_id: string, org_id: string) {
|
|
41
|
+
const commonNotification = 'commonNotification';
|
|
42
|
+
const groupId = `Hive_AI_Notifs_${botId}_${conversation_id}`;
|
|
43
|
+
const groupId_org = `Hive_AI_Notifs_${org_id}`;
|
|
44
|
+
|
|
45
|
+
// Remove any pre-existing listeners for commonNotification
|
|
46
|
+
// this.notificationSocket.removeAllListeners(commonNotification);
|
|
47
|
+
|
|
48
|
+
// Join the group again with updated botId and conversation_id
|
|
49
|
+
this.notificationSocket.emit('joinData', { groupId });
|
|
50
|
+
this.notificationSocket.emit('joinData', { groupId: groupId_org });
|
|
51
|
+
|
|
52
|
+
// Re-register for common notifications
|
|
53
|
+
this.notificationSocket.fromEvent(commonNotification).subscribe(
|
|
54
|
+
(res) => {
|
|
55
|
+
console.log('Received commonNotification:', res);
|
|
56
|
+
this.conversationService.sendValidatedUserData(res);
|
|
57
|
+
},
|
|
58
|
+
(error) => {
|
|
59
|
+
console.error('Error receiving commonNotification:', error);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
private startReleasingMessages() {
|
|
65
|
+
if (!this.intervalSetup) {
|
|
66
|
+
setInterval(() => {
|
|
67
|
+
if (this.messageQueue.length > 0) {
|
|
68
|
+
const message = this.messageQueue.shift(); // Remove the first message from the queue
|
|
69
|
+
// Handle the message here, e.g., send it to the server or process it
|
|
70
|
+
console.log('Releasing message from queue:', message);
|
|
71
|
+
// this.campaignService.sendValidatedUserData(message);
|
|
72
|
+
}
|
|
73
|
+
}, this.releaseInterval);
|
|
74
|
+
this.intervalSetup = true; // Prevents multiple intervals
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
package/projects/hivegpt/eventsgpt-angular/src/lib/components/translations/translation.service.ts
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
|
|
2
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
3
|
+
|
|
4
|
+
@Injectable({
|
|
5
|
+
providedIn: 'root',
|
|
6
|
+
})
|
|
7
|
+
export class TranslationService {
|
|
8
|
+
private eventId: string | null = null;
|
|
9
|
+
|
|
10
|
+
setEventId(id: string) {
|
|
11
|
+
this.eventId = id;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
getTranslation(key: string): string {
|
|
15
|
+
console.log('eventId', this.eventId);
|
|
16
|
+
// let lang = String(this.getLang(this.eventId)).replace(/^"|"$/g, '');
|
|
17
|
+
const lang = (
|
|
18
|
+
localStorage.getItem('defaultLanguage-' + this.eventId) || 'en'
|
|
19
|
+
).replace(/^"|"$/g, '');
|
|
20
|
+
|
|
21
|
+
const entry = this.translationsData.find((item) => item.Key === key);
|
|
22
|
+
|
|
23
|
+
if (!entry) {
|
|
24
|
+
return key; // fallback
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return entry.Translations[lang] || entry.DefaultValue || key;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
private getLang(eventId?: string | null): string {
|
|
31
|
+
const suffix = eventId ? `-${eventId}` : '';
|
|
32
|
+
const storageKey = `defaultLanguage${suffix}`;
|
|
33
|
+
|
|
34
|
+
return localStorage.getItem(storageKey) || 'en';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private translationsData: any[] = [
|
|
38
|
+
{
|
|
39
|
+
Key: "Copy",
|
|
40
|
+
DefaultValue: "Copy",
|
|
41
|
+
Translations: {
|
|
42
|
+
en: "Copy",
|
|
43
|
+
fr: "Copier",
|
|
44
|
+
it: "Copia",
|
|
45
|
+
es: "Copiar",
|
|
46
|
+
de: "Kopieren",
|
|
47
|
+
"pt-br": "Copiar",
|
|
48
|
+
ar: "نسخ",
|
|
49
|
+
zh: "复制",
|
|
50
|
+
ru: "Копировать"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
,
|
|
54
|
+
{
|
|
55
|
+
|
|
56
|
+
Key: "May I assist you with anything else",
|
|
57
|
+
DefaultValue: "Great. May I assist you with anything else?",
|
|
58
|
+
Translations: {
|
|
59
|
+
en: "Great. May I assist you with anything else?",
|
|
60
|
+
fr: "Parfait. Puis-je vous aider avec autre chose ?",
|
|
61
|
+
it: "Perfetto. Posso aiutarti con qualcos'altro?",
|
|
62
|
+
es: "Genial. ¿Puedo ayudarte con algo más?",
|
|
63
|
+
de: "Super. Kann ich Ihnen noch bei etwas anderem helfen?",
|
|
64
|
+
"pt-br": "Ótimo. Posso ajudar com mais alguma coisa?",
|
|
65
|
+
ar: "رائع. هل يمكنني مساعدتك في أي شيء آخر؟",
|
|
66
|
+
zh: "太好了。还有什么我可以帮您的吗?",
|
|
67
|
+
ru: "Отлично. Могу ли я помочь вам с чем-то ещё?"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
Key: "We are sorry we've not been able to answer your question",
|
|
72
|
+
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.",
|
|
73
|
+
Translations: {
|
|
74
|
+
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.",
|
|
75
|
+
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.",
|
|
76
|
+
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.",
|
|
77
|
+
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.",
|
|
78
|
+
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.",
|
|
79
|
+
"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.",
|
|
80
|
+
ar: "نأسف لعدم تمكننا من الإجابة على سؤالك. ومع ذلك، يسعد فريق الدعم المخصص لدينا بمساعدتك. يرجى <a href=\"mailto:support@social27.com\">النقر هنا</a> وسيساعدك أحد الوكلاء البشريين في أقرب وقت ممكن.",
|
|
81
|
+
zh: "很抱歉我们未能回答您的问题。不过,我们的专属支持团队很乐意为您提供帮助。请<a href=\"mailto:support@social27.com\">点击这里</a>,人工客服将尽快为您提供协助。",
|
|
82
|
+
ru: "К сожалению, мы не смогли ответить на ваш вопрос. Однако наша служба поддержки с радостью вам поможет. Пожалуйста, <a href=\"mailto:support@social27.com\">нажмите здесь</a>, и наш оператор свяжется с вами как можно скорее."
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
Key: 'Ask anything',
|
|
87
|
+
DefaultValue: 'Ask anything',
|
|
88
|
+
Translations: {
|
|
89
|
+
en: 'Ask anything',
|
|
90
|
+
fr: 'Demandez ce que vous voulez',
|
|
91
|
+
it: 'Chiedi qualsiasi cosa',
|
|
92
|
+
es: 'Pregunta lo que quieras',
|
|
93
|
+
de: 'Frag alles',
|
|
94
|
+
'pt-br': 'Pergunte qualquer coisa',
|
|
95
|
+
ar: 'اسأل أي شيء',
|
|
96
|
+
zh: '随便问',
|
|
97
|
+
ru: 'Спросите что угодно',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
Key: 'Assistant',
|
|
102
|
+
DefaultValue: 'Assistant',
|
|
103
|
+
Translations: {
|
|
104
|
+
en: 'Assistant',
|
|
105
|
+
fr: 'Assistant',
|
|
106
|
+
it: 'Assistente',
|
|
107
|
+
es: 'Asistente',
|
|
108
|
+
de: 'Assistent',
|
|
109
|
+
'pt-br': 'Assistente',
|
|
110
|
+
ar: 'مساعد',
|
|
111
|
+
zh: '助手',
|
|
112
|
+
ru: 'Ассистент',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
Key: 'Your personal or company information is kept private and secure within this chat.',
|
|
117
|
+
DefaultValue:
|
|
118
|
+
'Your personal or company information is kept private and secure within this chat.',
|
|
119
|
+
Translations: {
|
|
120
|
+
en: 'Your personal or company information is kept private and secure within this chat.',
|
|
121
|
+
fr: 'Vos informations personnelles ou celles de votre entreprise sont conservées privées et sécurisées dans cette conversation.',
|
|
122
|
+
it: "Le tue informazioni personali o aziendali sono mantenute private e sicure all'interno di questa chat.",
|
|
123
|
+
es: 'Tu información personal o de la empresa se mantiene privada y segura dentro de este chat.',
|
|
124
|
+
de: 'Ihre persönlichen oder geschäftlichen Informationen bleiben in diesem Chat privat und sicher.',
|
|
125
|
+
'pt-br':
|
|
126
|
+
'Suas informações pessoais ou da empresa são mantidas privadas e seguras dentro deste chat.',
|
|
127
|
+
ar: 'تظل معلوماتك الشخصية أو معلومات شركتك خاصة وآمنة داخل هذه المحادثة.',
|
|
128
|
+
zh: '您的个人或公司信息在此聊天中保持私密和安全。',
|
|
129
|
+
ru: 'Ваша личная или корпоративная информация остается конфиденциальной и защищенной в этом чате.',
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
Key: 'Send message',
|
|
134
|
+
DefaultValue: 'Send message',
|
|
135
|
+
Translations: {
|
|
136
|
+
en: 'Send message',
|
|
137
|
+
fr: 'Envoyer un message',
|
|
138
|
+
it: 'Invia messaggio',
|
|
139
|
+
es: 'Enviar mensaje',
|
|
140
|
+
de: 'Nachricht senden',
|
|
141
|
+
'pt-br': 'Enviar mensagem',
|
|
142
|
+
ar: 'إرسال رسالة',
|
|
143
|
+
zh: '发送消息',
|
|
144
|
+
ru: 'Отправить сообщение',
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
Key: 'Platform GPT',
|
|
149
|
+
DefaultValue: 'Platform GPT',
|
|
150
|
+
Translations: {
|
|
151
|
+
en: 'Platform GPT',
|
|
152
|
+
fr: 'Plateforme GPT',
|
|
153
|
+
it: 'Piattaforma GPT',
|
|
154
|
+
es: 'Plataforma GPT',
|
|
155
|
+
de: 'Plattform GPT',
|
|
156
|
+
'pt-br': 'Plataforma GPT',
|
|
157
|
+
ar: 'منصة GPT',
|
|
158
|
+
zh: '平台 GPT',
|
|
159
|
+
ru: 'Платформа GPT',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
Key: 'New Chat',
|
|
164
|
+
DefaultValue: 'New Chat',
|
|
165
|
+
Translations: {
|
|
166
|
+
en: 'New Chat',
|
|
167
|
+
fr: 'Nouvelle conversation',
|
|
168
|
+
it: 'Nuova chat',
|
|
169
|
+
es: 'Nuevo chat',
|
|
170
|
+
de: 'Neuer Chat',
|
|
171
|
+
'pt-br': 'Novo chat',
|
|
172
|
+
ar: 'محادثة جديدة',
|
|
173
|
+
zh: '新聊天',
|
|
174
|
+
ru: 'Новый чат',
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
Key: 'You',
|
|
179
|
+
DefaultValue: 'You',
|
|
180
|
+
Translations: {
|
|
181
|
+
en: 'You',
|
|
182
|
+
fr: 'Vous',
|
|
183
|
+
it: 'Tu',
|
|
184
|
+
es: 'Tú',
|
|
185
|
+
de: 'Du',
|
|
186
|
+
'pt-br': 'Você',
|
|
187
|
+
ar: 'أنت',
|
|
188
|
+
zh: '您',
|
|
189
|
+
ru: 'Вы',
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
Key: 'Write your message',
|
|
194
|
+
DefaultValue: 'Write your message',
|
|
195
|
+
Translations: {
|
|
196
|
+
en: 'Write your message',
|
|
197
|
+
fr: 'Écrivez votre message',
|
|
198
|
+
it: 'Scrivi il tuo messaggio',
|
|
199
|
+
es: 'Escribe tu mensaje',
|
|
200
|
+
de: 'Schreiben Sie Ihre Nachricht',
|
|
201
|
+
'pt-br': 'Escreva sua mensagem',
|
|
202
|
+
ar: 'اكتب رسالتك',
|
|
203
|
+
zh: '写下您的消息',
|
|
204
|
+
ru: 'Напишите ваше сообщение',
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
Key: 'Send',
|
|
209
|
+
DefaultValue: 'Send',
|
|
210
|
+
Translations: {
|
|
211
|
+
en: 'Send',
|
|
212
|
+
fr: 'Envoyer',
|
|
213
|
+
it: 'Invia',
|
|
214
|
+
es: 'Enviar',
|
|
215
|
+
de: 'Senden',
|
|
216
|
+
'pt-br': 'Enviar',
|
|
217
|
+
ar: 'إرسال',
|
|
218
|
+
zh: '发送',
|
|
219
|
+
ru: 'Отправить',
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
Key: 'Call Interface',
|
|
224
|
+
DefaultValue: 'Call Interface',
|
|
225
|
+
Translations: {
|
|
226
|
+
en: 'Call Interface',
|
|
227
|
+
fr: "Interface d'appel",
|
|
228
|
+
it: 'Interfaccia chiamata',
|
|
229
|
+
es: 'Interfaz de llamada',
|
|
230
|
+
de: 'Anrufoberfläche',
|
|
231
|
+
'pt-br': 'Interface de chamada',
|
|
232
|
+
ar: 'واجهة الاتصال',
|
|
233
|
+
zh: '呼叫界面',
|
|
234
|
+
ru: 'Интерфейс звонка',
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
Key: 'Call Interface',
|
|
239
|
+
DefaultValue: 'Call Interface',
|
|
240
|
+
Translations: {
|
|
241
|
+
en: 'Call Interface',
|
|
242
|
+
fr: "Interface d'appel",
|
|
243
|
+
it: 'Interfaccia chiamata',
|
|
244
|
+
es: 'Interfaz de llamada',
|
|
245
|
+
de: 'Anrufoberfläche',
|
|
246
|
+
'pt-br': 'Interface de chamada',
|
|
247
|
+
ar: 'واجهة الاتصال',
|
|
248
|
+
zh: '呼叫界面',
|
|
249
|
+
ru: 'Интерфейс звонка',
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
Key: 'Close',
|
|
254
|
+
DefaultValue: 'Close',
|
|
255
|
+
Translations: {
|
|
256
|
+
en: 'Close',
|
|
257
|
+
fr: 'Fermer',
|
|
258
|
+
it: 'Chiudi',
|
|
259
|
+
es: 'Cerrar',
|
|
260
|
+
de: 'Schließen',
|
|
261
|
+
'pt-br': 'Fechar',
|
|
262
|
+
ar: 'إغلاق',
|
|
263
|
+
zh: '关闭',
|
|
264
|
+
ru: 'Закрыть',
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
];
|
|
268
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<div class="video-wrapper" >
|
|
2
|
+
<div class="overlymask-video"></div>
|
|
3
|
+
<video (click)="toggleFullscreen()" #video [loop]="true" [muted]="isMuted" [src]="videoObj.processedUrls || videoObj.url" playsinline
|
|
4
|
+
[controls]="false"></video>
|
|
5
|
+
<div class="main-controls" [class.no-opacity]="video.isPlaying">
|
|
6
|
+
<button mat-icon-button *ngIf="!videoObj.isPlaying"
|
|
7
|
+
attr.aria-label="Play Video"
|
|
8
|
+
title="Play Video" class="play-pause-btn"
|
|
9
|
+
(click)="togglePlay(true, video)">
|
|
10
|
+
<!-- <mat-icon alt="Play">play_arrow</mat-icon> -->
|
|
11
|
+
<span class="material-icons notranslate " aria-hidden="true">play_circle_outline</span>
|
|
12
|
+
</button>
|
|
13
|
+
|
|
14
|
+
<button mat-icon-button id="pause-btn" [hidden]="!videoObj.isPlaying" class="pause_btn play-pause-btn playing"
|
|
15
|
+
title="Pause Video"
|
|
16
|
+
[class.half-opacity]="video.isPlaying" (click)="togglePlay(false, video)">
|
|
17
|
+
<!-- <mat-icon alt="Pause">pause</mat-icon> -->
|
|
18
|
+
<span class="material-icons notranslate " aria-hidden="true">pause_circle_outline</span>
|
|
19
|
+
</button>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="video-actions">
|
|
22
|
+
<button class="button-trasparent action" (click)="toggleSound()" title="Mute" *ngIf="isMuted">
|
|
23
|
+
<span class="material-icons notranslate " aria-hidden="true">volume_off</span>
|
|
24
|
+
</button>
|
|
25
|
+
<button class="button-trasparent action" (click)="toggleSound()" title="Unmute" *ngIf="!isMuted">
|
|
26
|
+
<span class="material-icons notranslate " aria-hidden="true">volume_up</span>
|
|
27
|
+
</button>
|
|
28
|
+
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="full-screen" *ngIf="isFullscreen" [ngClass]="{'show': isFullscreen}">
|
|
33
|
+
<div class="video-wrapper">
|
|
34
|
+
<video #fullscreenvideo (click)="toggleFullscreenPlay()" [loop]="true" [muted]="isMuted" [src]="videoObj.processedUrls || videoObj.url"
|
|
35
|
+
playsinline [controls]="false"></video>
|
|
36
|
+
<div (click)="toggleFullscreen()" class="close-btn">
|
|
37
|
+
<span class="material-icons notranslate ">clear</span>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="video-actions">
|
|
40
|
+
<button *ngIf="!video.isPlaying" title="Play"
|
|
41
|
+
class="material-icons notranslate body-text-color fs-h2 play position-absolute transparent-btn" (click)="togglePlay(true, video)">
|
|
42
|
+
play_circle_outline
|
|
43
|
+
</button>
|
|
44
|
+
<button id="pause-btn" [hidden]="!videoObj.isPlaying" title="Pause"
|
|
45
|
+
class="pause_btn material-icons body-text-color fs-h2 play position-absolute transparent-btn"
|
|
46
|
+
[class.half-opacity]="video.isPlaying" (click)="togglePlay(false, video)">
|
|
47
|
+
pause_circle_outline
|
|
48
|
+
</button>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|