@hivegpt/hiveai-angular 0.0.397 → 0.0.400
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/bundles/hivegpt-hiveai-angular.umd.js +200 -150
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +58 -16
- package/esm2015/lib/components/chatbot/chatbot.component.js +3 -17
- package/esm2015/lib/components/voice-agent/components/voice-agent-modal/voice-agent-modal.component.js +24 -4
- package/esm2015/lib/components/voice-agent/voice-modal-tokens.js +4 -0
- package/esm2015/lib/hivegpt.module.js +3 -2
- package/esm2015/public-api.js +2 -1
- package/fesm2015/hivegpt-hiveai-angular.js +176 -127
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/hivegpt-hiveai-angular.metadata.json +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts +10 -13
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/lib/components/chatbot/chatbot.component.d.ts +0 -6
- package/lib/components/chatbot/chatbot.component.d.ts.map +1 -1
- package/lib/components/voice-agent/components/voice-agent-modal/voice-agent-modal.component.d.ts +5 -2
- package/lib/components/voice-agent/components/voice-agent-modal/voice-agent-modal.component.d.ts.map +1 -1
- package/lib/components/voice-agent/voice-modal-tokens.d.ts +13 -0
- package/lib/components/voice-agent/voice-modal-tokens.d.ts.map +1 -0
- package/lib/hivegpt.module.d.ts.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/public-api.d.ts.map +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common/http'), require('@angular/core'), require('@angular/platform-browser'), require('rxjs'), require('rxjs/operators'), require('ngx-socket-io'), require('@angular/forms'), require('microsoft-cognitiveservices-speech-sdk'), require('marked'), require('@pipecat-ai/client-js'), require('@pipecat-ai/websocket-transport'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/sidenav'), require('ngx-quill')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@hivegpt/hiveai-angular', ['exports', '@angular/common/http', '@angular/core', '@angular/platform-browser', 'rxjs', 'rxjs/operators', 'ngx-socket-io', '@angular/forms', 'microsoft-cognitiveservices-speech-sdk', 'marked', '@pipecat-ai/client-js', '@pipecat-ai/websocket-transport', '@angular/common', '@angular/material/icon', '@angular/material/sidenav', 'ngx-quill'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hivegpt = global.hivegpt || {}, global.hivegpt["hiveai-angular"] = {}), global.ng.common.http, global.ng.core, global.ng.platformBrowser, global.rxjs, global.rxjs.operators, global.ngxSocketIo, global.ng.forms, global.SpeechSDK, global.marked, global.clientJs, global.websocketTransport, global.ng.common, global.ng.material.icon, global.ng.material.sidenav, global.ngxQuill));
|
|
5
|
-
})(this, (function (exports, i1, i0, platformBrowser, rxjs, operators, ngxSocketIo, forms, SpeechSDK, marked, clientJs, websocketTransport, common, icon, sidenav, ngxQuill) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/common/http'), require('@angular/core'), require('@angular/platform-browser'), require('rxjs'), require('rxjs/operators'), require('ngx-socket-io'), require('@angular/forms'), require('microsoft-cognitiveservices-speech-sdk'), require('marked'), require('@pipecat-ai/client-js'), require('@pipecat-ai/websocket-transport'), require('@angular/common'), require('@angular/material/icon'), require('@angular/material/sidenav'), require('ngx-quill')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@hivegpt/hiveai-angular', ['exports', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/common/http', '@angular/core', '@angular/platform-browser', 'rxjs', 'rxjs/operators', 'ngx-socket-io', '@angular/forms', 'microsoft-cognitiveservices-speech-sdk', 'marked', '@pipecat-ai/client-js', '@pipecat-ai/websocket-transport', '@angular/common', '@angular/material/icon', '@angular/material/sidenav', 'ngx-quill'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.hivegpt = global.hivegpt || {}, global.hivegpt["hiveai-angular"] = {}), global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.common.http, global.ng.core, global.ng.platformBrowser, global.rxjs, global.rxjs.operators, global.ngxSocketIo, global.ng.forms, global.SpeechSDK, global.marked, global.clientJs, global.websocketTransport, global.ng.common, global.ng.material.icon, global.ng.material.sidenav, global.ngxQuill));
|
|
5
|
+
})(this, (function (exports, overlay, portal, i1, i0, platformBrowser, rxjs, operators, ngxSocketIo, forms, SpeechSDK, marked, clientJs, websocketTransport, common, icon, sidenav, ngxQuill) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -1388,9 +1388,148 @@
|
|
|
1388
1388
|
{ type: AudioAnalyzerService }
|
|
1389
1389
|
]; };
|
|
1390
1390
|
|
|
1391
|
+
var VOICE_MODAL_CONFIG = new i0.InjectionToken('VOICE_MODAL_CONFIG');
|
|
1392
|
+
var VOICE_MODAL_CLOSE_CALLBACK = new i0.InjectionToken('VOICE_MODAL_CLOSE_CALLBACK');
|
|
1393
|
+
|
|
1394
|
+
var VoiceAgentModalComponent = /** @class */ (function () {
|
|
1395
|
+
function VoiceAgentModalComponent(voiceAgentService, audioAnalyzer, injector) {
|
|
1396
|
+
this.voiceAgentService = voiceAgentService;
|
|
1397
|
+
this.audioAnalyzer = audioAnalyzer;
|
|
1398
|
+
this.injector = injector;
|
|
1399
|
+
this.close = new i0.EventEmitter();
|
|
1400
|
+
this.agentName = 'AI Assistant';
|
|
1401
|
+
this.agentRole = 'AI Agent Specialist';
|
|
1402
|
+
this.injectedConfig = null;
|
|
1403
|
+
this.onCloseCallback = null;
|
|
1404
|
+
this.callState = 'idle';
|
|
1405
|
+
this.statusText = '';
|
|
1406
|
+
this.duration = '00:00';
|
|
1407
|
+
this.isMicMuted = false;
|
|
1408
|
+
this.isUserSpeaking = false;
|
|
1409
|
+
this.audioLevels = [];
|
|
1410
|
+
this.isSpeaking = false;
|
|
1411
|
+
this.subscriptions = [];
|
|
1412
|
+
this.isConnecting = false;
|
|
1413
|
+
}
|
|
1414
|
+
VoiceAgentModalComponent.prototype.ngOnInit = function () {
|
|
1415
|
+
var _this = this;
|
|
1416
|
+
var _a, _b;
|
|
1417
|
+
// When opened via Overlay, config is provided by injection
|
|
1418
|
+
this.injectedConfig = this.injector.get(VOICE_MODAL_CONFIG, null);
|
|
1419
|
+
this.onCloseCallback = this.injector.get(VOICE_MODAL_CLOSE_CALLBACK, null);
|
|
1420
|
+
if (this.injectedConfig) {
|
|
1421
|
+
this.apiUrl = this.injectedConfig.apiUrl;
|
|
1422
|
+
this.token = this.injectedConfig.token;
|
|
1423
|
+
this.botId = this.injectedConfig.botId;
|
|
1424
|
+
this.conversationId = this.injectedConfig.conversationId;
|
|
1425
|
+
this.agentName = (_a = this.injectedConfig.agentName) !== null && _a !== void 0 ? _a : this.agentName;
|
|
1426
|
+
this.agentRole = (_b = this.injectedConfig.agentRole) !== null && _b !== void 0 ? _b : this.agentRole;
|
|
1427
|
+
this.agentAvatar = this.injectedConfig.agentAvatar;
|
|
1428
|
+
}
|
|
1429
|
+
// Subscribe to observables
|
|
1430
|
+
this.subscriptions.push(this.voiceAgentService.callState$.subscribe(function (state) {
|
|
1431
|
+
_this.callState = state;
|
|
1432
|
+
_this.isSpeaking = state === 'talking';
|
|
1433
|
+
}));
|
|
1434
|
+
this.subscriptions.push(this.voiceAgentService.statusText$.subscribe(function (text) {
|
|
1435
|
+
_this.statusText = text;
|
|
1436
|
+
}));
|
|
1437
|
+
this.subscriptions.push(this.voiceAgentService.duration$.subscribe(function (duration) {
|
|
1438
|
+
_this.duration = duration;
|
|
1439
|
+
}));
|
|
1440
|
+
this.subscriptions.push(this.voiceAgentService.isMicMuted$.subscribe(function (muted) {
|
|
1441
|
+
_this.isMicMuted = muted;
|
|
1442
|
+
}));
|
|
1443
|
+
this.subscriptions.push(this.voiceAgentService.isUserSpeaking$.subscribe(function (speaking) {
|
|
1444
|
+
_this.isUserSpeaking = speaking;
|
|
1445
|
+
}));
|
|
1446
|
+
this.subscriptions.push(this.voiceAgentService.audioLevels$.subscribe(function (levels) {
|
|
1447
|
+
_this.audioLevels = levels;
|
|
1448
|
+
}));
|
|
1449
|
+
// Modal opens in idle state; user clicks "Start Call" to connect (no auto-connect).
|
|
1450
|
+
this.voiceAgentService.resetToIdle();
|
|
1451
|
+
};
|
|
1452
|
+
VoiceAgentModalComponent.prototype.ngOnDestroy = function () {
|
|
1453
|
+
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
1454
|
+
this.disconnect();
|
|
1455
|
+
};
|
|
1456
|
+
VoiceAgentModalComponent.prototype.startCall = function () {
|
|
1457
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1458
|
+
var error_1;
|
|
1459
|
+
return __generator(this, function (_c) {
|
|
1460
|
+
switch (_c.label) {
|
|
1461
|
+
case 0:
|
|
1462
|
+
if (this.isConnecting || (this.callState !== 'idle' && this.callState !== 'ended'))
|
|
1463
|
+
return [2 /*return*/];
|
|
1464
|
+
this.isConnecting = true;
|
|
1465
|
+
_c.label = 1;
|
|
1466
|
+
case 1:
|
|
1467
|
+
_c.trys.push([1, 3, 4, 5]);
|
|
1468
|
+
return [4 /*yield*/, this.voiceAgentService.connect(this.apiUrl, this.token, this.botId, this.conversationId)];
|
|
1469
|
+
case 2:
|
|
1470
|
+
_c.sent();
|
|
1471
|
+
return [3 /*break*/, 5];
|
|
1472
|
+
case 3:
|
|
1473
|
+
error_1 = _c.sent();
|
|
1474
|
+
console.error('Failed to connect voice agent:', error_1);
|
|
1475
|
+
return [3 /*break*/, 5];
|
|
1476
|
+
case 4:
|
|
1477
|
+
this.isConnecting = false;
|
|
1478
|
+
return [7 /*endfinally*/];
|
|
1479
|
+
case 5: return [2 /*return*/];
|
|
1480
|
+
}
|
|
1481
|
+
});
|
|
1482
|
+
});
|
|
1483
|
+
};
|
|
1484
|
+
VoiceAgentModalComponent.prototype.disconnect = function () {
|
|
1485
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1486
|
+
return __generator(this, function (_c) {
|
|
1487
|
+
switch (_c.label) {
|
|
1488
|
+
case 0: return [4 /*yield*/, this.voiceAgentService.disconnect()];
|
|
1489
|
+
case 1:
|
|
1490
|
+
_c.sent();
|
|
1491
|
+
return [2 /*return*/];
|
|
1492
|
+
}
|
|
1493
|
+
});
|
|
1494
|
+
});
|
|
1495
|
+
};
|
|
1496
|
+
VoiceAgentModalComponent.prototype.toggleMic = function () {
|
|
1497
|
+
this.voiceAgentService.toggleMic();
|
|
1498
|
+
};
|
|
1499
|
+
VoiceAgentModalComponent.prototype.endCall = function () {
|
|
1500
|
+
var _a;
|
|
1501
|
+
this.disconnect();
|
|
1502
|
+
(_a = this.onCloseCallback) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1503
|
+
this.close.emit();
|
|
1504
|
+
};
|
|
1505
|
+
return VoiceAgentModalComponent;
|
|
1506
|
+
}());
|
|
1507
|
+
VoiceAgentModalComponent.decorators = [
|
|
1508
|
+
{ type: i0.Component, args: [{
|
|
1509
|
+
selector: 'hivegpt-voice-agent-modal',
|
|
1510
|
+
template: "<div class=\"voice-agent-modal-overlay\" (click)=\"endCall()\">\n <div class=\"voice-agent-modal\" (click)=\"$event.stopPropagation()\">\n <!-- Header -->\n <div class=\"modal-header\">\n <div class=\"header-left\">\n <div class=\"voice-icon\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 1C8.13 1 5 4.13 5 8V14C5 17.87 8.13 21 12 21C15.87 21 19 17.87 19 14V8C19 4.13 15.87 1 12 1Z\" fill=\"currentColor\"/>\n <path d=\"M12 23C10.34 23 9 21.66 9 20H15C15 21.66 13.66 23 12 23Z\" fill=\"currentColor\"/>\n </svg>\n </div>\n <span class=\"voice-label\">Voice</span>\n </div>\n <button class=\"close-button\" (click)=\"endCall()\" type=\"button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 6L6 18M6 6L18 18\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n </svg>\n </button>\n </div>\n\n <!-- Agent Avatar -->\n <div class=\"agent-avatar-container\">\n <div class=\"agent-avatar\" [class.speaking]=\"isSpeaking\">\n <img *ngIf=\"agentAvatar\" [src]=\"agentAvatar\" [alt]=\"agentName\" />\n <div *ngIf=\"!agentAvatar\" class=\"avatar-placeholder\">\n {{ agentName.charAt(0) }}\n </div>\n </div>\n </div>\n\n <!-- Agent Info -->\n <div class=\"agent-info\">\n <div class=\"agent-name-row\">\n <h2 class=\"agent-name\">{{ agentName }}</h2>\n <span class=\"ai-badge\">AI</span>\n </div>\n <p class=\"agent-role\">{{ agentRole }}</p>\n </div>\n\n <!-- Start Call / Retry (when idle or ended) -->\n <div *ngIf=\"callState === 'idle' || callState === 'ended'\" class=\"start-call-section\">\n <p *ngIf=\"statusText === 'Connection failed'\" class=\"error-message\">{{ statusText }}</p>\n <button\n class=\"start-call-button\"\n type=\"button\"\n [disabled]=\"isConnecting\"\n (click)=\"startCall()\"\n >\n <span *ngIf=\"isConnecting\">Connecting...</span>\n <span *ngIf=\"!isConnecting && statusText === 'Connection failed'\">Retry</span>\n <span *ngIf=\"!isConnecting && statusText !== 'Connection failed'\">Start Call</span>\n </button>\n </div>\n\n <!-- Status (when connecting or connected) -->\n <div class=\"status-section\" *ngIf=\"callState !== 'idle' && callState !== 'ended'\">\n <div *ngIf=\"callState === 'connecting'\" class=\"connecting-spinner\">\n <svg class=\"spinner\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-dasharray=\"31.416\" stroke-dashoffset=\"31.416\">\n <animate attributeName=\"stroke-dasharray\" dur=\"2s\" values=\"0 31.416;15.708 15.708;0 31.416;0 31.416\" repeatCount=\"indefinite\"/>\n <animate attributeName=\"stroke-dashoffset\" dur=\"2s\" values=\"0;-15.708;-31.416;-31.416\" repeatCount=\"indefinite\"/>\n </circle>\n </svg>\n <span class=\"status-text\">{{ statusText }}</span>\n </div>\n <div *ngIf=\"callState !== 'connecting'\" class=\"status-connected\">\n <span class=\"status-text\">{{ statusText || 'Connected' }}</span>\n <span class=\"duration\">{{ duration }}</span>\n </div>\n </div>\n\n <!-- Waveform Visualization -->\n <div *ngIf=\"callState === 'connected' || callState === 'listening' || callState === 'talking'\" class=\"waveform-container\">\n <div class=\"waveform-bars\">\n <div\n *ngFor=\"let level of audioLevels; let i = index\"\n class=\"waveform-bar\"\n [style.height.%]=\"level || 10\"\n [style.animation-delay.ms]=\"i * 20\"\n ></div>\n </div>\n </div>\n\n <!-- Call Controls (only when connected) -->\n <div class=\"call-controls\" *ngIf=\"callState === 'connected' || callState === 'listening' || callState === 'talking'\">\n <button\n class=\"control-button mute-button\"\n [class.muted]=\"isMicMuted\"\n (click)=\"toggleMic()\"\n type=\"button\"\n [title]=\"isMicMuted ? 'Unmute' : 'Mute'\"\n >\n <svg *ngIf=\"!isMicMuted\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 1C8.13 1 5 4.13 5 8V14C5 17.87 8.13 21 12 21C15.87 21 19 17.87 19 14V8C19 4.13 15.87 1 12 1Z\" fill=\"currentColor\"/>\n <path d=\"M12 23C10.34 23 9 21.66 9 20H15C15 21.66 13.66 23 12 23Z\" fill=\"currentColor\"/>\n </svg>\n <svg *ngIf=\"isMicMuted\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 1C8.13 1 5 4.13 5 8V14C5 17.87 8.13 21 12 21C15.87 21 19 17.87 19 14V8C19 4.13 15.87 1 12 1Z\" fill=\"currentColor\"/>\n <path d=\"M12 23C10.34 23 9 21.66 9 20H15C15 21.66 13.66 23 12 23Z\" fill=\"currentColor\"/>\n <path d=\"M3 3L21 21M9 9L15 15\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n </svg>\n <span class=\"control-label\">Mute</span>\n </button>\n\n <button\n class=\"control-button end-call-button\"\n (click)=\"endCall()\"\n type=\"button\"\n title=\"End Call\"\n >\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 6L6 18M6 6L18 18\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n </svg>\n <span class=\"control-label\">End Call</span>\n </button>\n </div>\n </div>\n</div>\n",
|
|
1511
|
+
styles: [":host{display:block}.voice-agent-modal-overlay{align-items:flex-end;backdrop-filter:blur(4px);background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:flex-end;left:0;padding:24px;position:fixed;right:0;top:0;z-index:99999}.voice-agent-modal{animation:modalEnter .3s ease-out;background:#fff;border-radius:24px;box-shadow:0 20px 60px rgba(0,0,0,.3);max-height:calc(100vh - 48px);max-width:480px;overflow-y:auto;padding:32px;width:90%}@keyframes modalEnter{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.modal-header{justify-content:space-between;margin-bottom:24px}.header-left,.modal-header{align-items:center;display:flex}.header-left{gap:8px}.voice-icon{align-items:center;color:#17235b;display:flex;height:32px;justify-content:center;width:32px}.voice-label{color:#333;font-size:16px;font-weight:600}.close-button{align-items:center;background:none;border:none;color:#666;cursor:pointer;display:flex;justify-content:center;padding:8px;transition:color .2s}.close-button:hover{color:#000}.agent-avatar-container{display:flex;justify-content:center;margin-bottom:24px}.agent-avatar{border:3px solid #e0f2fe;border-radius:50%;height:120px;overflow:hidden;position:relative;transition:all .3s ease;width:120px}.agent-avatar.speaking{animation:speakingGlow 1.5s ease-in-out infinite;border-color:#0ea5e9;box-shadow:0 0 20px rgba(14,165,233,.4)}.agent-avatar img{-o-object-fit:cover;height:100%;object-fit:cover;width:100%}.avatar-placeholder{align-items:center;background:linear-gradient(135deg,#0ea5e9,#06b6d4);color:#fff;display:flex;font-size:48px;font-weight:600;height:100%;justify-content:center;width:100%}@keyframes speakingGlow{0%,to{box-shadow:0 0 20px rgba(14,165,233,.4)}50%{box-shadow:0 0 30px rgba(14,165,233,.6)}}.agent-info{margin-bottom:24px;text-align:center}.agent-name-row{align-items:center;display:flex;gap:12px;justify-content:center;margin-bottom:8px}.agent-name{color:#1f2937;font-size:28px;font-weight:700;margin:0}.ai-badge{background:#0ea5e9;border-radius:12px;color:#fff;font-size:12px;font-weight:600;padding:4px 12px}.agent-role{color:#6b7280;font-size:14px;margin:0}.start-call-section{align-items:center;display:flex;flex-direction:column;gap:16px;margin-bottom:24px}.error-message{color:#dc2626;font-size:14px;margin:0}.start-call-button{background:#0ea5e9;border:none;border-radius:12px;color:#fff;cursor:pointer;font-size:16px;font-weight:600;padding:14px 32px;transition:background .2s}.start-call-button:hover:not(:disabled){background:#0284c7}.start-call-button:disabled{cursor:not-allowed;opacity:.7}.status-section{flex-direction:column;margin-bottom:24px}.connecting-spinner,.status-section{align-items:center;display:flex;gap:12px}.spinner{animation:spin 1s linear infinite;color:#0ea5e9}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.status-connected{align-items:center;display:flex;flex-direction:column;gap:8px}.status-text{color:#4b5563;font-size:16px;font-weight:500}.duration{color:#9ca3af;font-family:monospace;font-size:14px}.waveform-container{margin-bottom:32px;width:100%}.waveform-bars{align-items:center;display:flex;gap:4px;height:60px;justify-content:center}.waveform-bar{animation:waveformPulse 1s ease-in-out infinite;background:linear-gradient(0deg,#0ea5e9,#06b6d4);border-radius:2px;min-height:10%;transition:height .1s ease;width:4px}@keyframes waveformPulse{0%,to{opacity:.6}50%{opacity:1}}.call-controls{gap:24px}.call-controls,.control-button{display:flex;justify-content:center}.control-button{align-items:center;border:none;border-radius:50%;cursor:pointer;flex-direction:column;gap:8px;height:80px;padding:16px;transition:all .2s;width:80px}.mute-button{background:#f3f4f6;color:#4b5563}.mute-button:hover{background:#e5e7eb}.mute-button.muted{background:#fee2e2;color:#dc2626}.end-call-button{background:#ef4444;color:#fff}.end-call-button:hover{background:#dc2626}.control-label{font-size:12px;font-weight:500;margin-top:4px}"]
|
|
1512
|
+
},] }
|
|
1513
|
+
];
|
|
1514
|
+
VoiceAgentModalComponent.ctorParameters = function () { return [
|
|
1515
|
+
{ type: VoiceAgentService },
|
|
1516
|
+
{ type: AudioAnalyzerService },
|
|
1517
|
+
{ type: i0.Injector }
|
|
1518
|
+
]; };
|
|
1519
|
+
VoiceAgentModalComponent.propDecorators = {
|
|
1520
|
+
close: [{ type: i0.Output }],
|
|
1521
|
+
apiUrl: [{ type: i0.Input }],
|
|
1522
|
+
token: [{ type: i0.Input }],
|
|
1523
|
+
botId: [{ type: i0.Input }],
|
|
1524
|
+
conversationId: [{ type: i0.Input }],
|
|
1525
|
+
agentName: [{ type: i0.Input }],
|
|
1526
|
+
agentRole: [{ type: i0.Input }],
|
|
1527
|
+
agentAvatar: [{ type: i0.Input }]
|
|
1528
|
+
};
|
|
1529
|
+
|
|
1391
1530
|
var ChatDrawerComponent = /** @class */ (function () {
|
|
1392
1531
|
function ChatDrawerComponent(fb, botService, cdr, http, sanitizer, elementRef, renderer, socketService, conversationService, // private platform: Platform
|
|
1393
|
-
translationService, voiceAgentService) {
|
|
1532
|
+
translationService, voiceAgentService, overlay, viewContainerRef, injector) {
|
|
1394
1533
|
var _this = this;
|
|
1395
1534
|
this.fb = fb;
|
|
1396
1535
|
this.botService = botService;
|
|
@@ -1403,6 +1542,9 @@
|
|
|
1403
1542
|
this.conversationService = conversationService;
|
|
1404
1543
|
this.translationService = translationService;
|
|
1405
1544
|
this.voiceAgentService = voiceAgentService;
|
|
1545
|
+
this.overlay = overlay;
|
|
1546
|
+
this.viewContainerRef = viewContainerRef;
|
|
1547
|
+
this.injector = injector;
|
|
1406
1548
|
this.bodyOverflowClass = 'body-overflow-hidden';
|
|
1407
1549
|
this.isCollapsedTrue = false;
|
|
1408
1550
|
this.copilotName = 'HiveXGPT';
|
|
@@ -1415,8 +1557,6 @@
|
|
|
1415
1557
|
this.scheduleMeeting = new i0.EventEmitter();
|
|
1416
1558
|
this.refreshToken = new i0.EventEmitter();
|
|
1417
1559
|
this.openSupport = new i0.EventEmitter();
|
|
1418
|
-
/** Emitted when the user clicks the voice agent button; parent should show the voice modal with this config. */
|
|
1419
|
-
this.requestOpenVoiceModal = new i0.EventEmitter();
|
|
1420
1560
|
this.autogenKey = 'Autogen_eDJTtEU-NB0RtIpzq1w';
|
|
1421
1561
|
this.addToMyAgendaAction = 'add_to_my_agenda';
|
|
1422
1562
|
this.myUpcomingSessionAction = 'my_upcomming_session';
|
|
@@ -1446,6 +1586,7 @@
|
|
|
1446
1586
|
this.authorizationToken = '';
|
|
1447
1587
|
this.region = 'westeurope'; // Set your Azure region here
|
|
1448
1588
|
this.isVoiceModalOpen = false;
|
|
1589
|
+
this.voiceModalOverlayRef = null;
|
|
1449
1590
|
this.voiceTranscriptSubscriptions = [];
|
|
1450
1591
|
this.domainAuthorityValue = 'prod-lite';
|
|
1451
1592
|
this.isChatingWithAi = false;
|
|
@@ -1507,6 +1648,8 @@
|
|
|
1507
1648
|
this.currentSourcesList = [];
|
|
1508
1649
|
this.isShowEditorButton = true;
|
|
1509
1650
|
this.isDrawerOpen = true;
|
|
1651
|
+
/** Used by the voice modal when opened from this drawer. */
|
|
1652
|
+
this.voiceModalConversationId = '';
|
|
1510
1653
|
this.chatMain = new i0.ElementRef(null);
|
|
1511
1654
|
// if (this.platform.IOS) {
|
|
1512
1655
|
// this.isIOSDevice = true;
|
|
@@ -3111,21 +3254,54 @@
|
|
|
3111
3254
|
}); // returns current time in 'shortTime' format
|
|
3112
3255
|
};
|
|
3113
3256
|
ChatDrawerComponent.prototype.openVoiceModal = function () {
|
|
3114
|
-
var
|
|
3115
|
-
var
|
|
3116
|
-
this.
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3257
|
+
var _this = this;
|
|
3258
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3259
|
+
var conversationId = (_b = (_a = this.conversationKey) !== null && _a !== void 0 ? _a : this.conversationService.getKey(this.botId, false)) !== null && _b !== void 0 ? _b : '';
|
|
3260
|
+
this.voiceModalConversationId = conversationId;
|
|
3261
|
+
this.setupVoiceTranscripts();
|
|
3262
|
+
// Close existing overlay if any
|
|
3263
|
+
if (this.voiceModalOverlayRef) {
|
|
3264
|
+
this.voiceModalOverlayRef.detach();
|
|
3265
|
+
this.voiceModalOverlayRef.dispose();
|
|
3266
|
+
this.voiceModalOverlayRef = null;
|
|
3267
|
+
}
|
|
3268
|
+
var config = {
|
|
3269
|
+
apiUrl: (_d = (_c = this.environment) === null || _c === void 0 ? void 0 : _c.BASE_URL) !== null && _d !== void 0 ? _d : '',
|
|
3270
|
+
token: (_e = this.s27Token) !== null && _e !== void 0 ? _e : '',
|
|
3271
|
+
botId: (_f = this.botId) !== null && _f !== void 0 ? _f : '',
|
|
3272
|
+
conversationId: conversationId,
|
|
3121
3273
|
agentName: this.botName || 'AI Assistant',
|
|
3122
3274
|
agentRole: this.botSkills || 'AI Agent Specialist',
|
|
3123
3275
|
agentAvatar: this.botIcon,
|
|
3276
|
+
};
|
|
3277
|
+
var closeCallback = function () {
|
|
3278
|
+
if (_this.voiceModalOverlayRef) {
|
|
3279
|
+
_this.voiceModalOverlayRef.detach();
|
|
3280
|
+
_this.voiceModalOverlayRef.dispose();
|
|
3281
|
+
_this.voiceModalOverlayRef = null;
|
|
3282
|
+
}
|
|
3283
|
+
_this.closeVoiceModal();
|
|
3284
|
+
};
|
|
3285
|
+
var injector = i0.Injector.create([
|
|
3286
|
+
{ provide: VOICE_MODAL_CONFIG, useValue: config },
|
|
3287
|
+
{ provide: VOICE_MODAL_CLOSE_CALLBACK, useValue: closeCallback },
|
|
3288
|
+
], this.injector);
|
|
3289
|
+
var overlayRef = this.overlay.create({
|
|
3290
|
+
hasBackdrop: false,
|
|
3291
|
+
scrollStrategy: this.overlay.scrollStrategies.block(),
|
|
3292
|
+
positionStrategy: this.overlay.position().global().bottom('0').right('0').left('0').top('0'),
|
|
3124
3293
|
});
|
|
3125
|
-
this.
|
|
3294
|
+
var portal$1 = new portal.ComponentPortal(VoiceAgentModalComponent, this.viewContainerRef, injector);
|
|
3295
|
+
overlayRef.attach(portal$1);
|
|
3296
|
+
this.voiceModalOverlayRef = overlayRef;
|
|
3126
3297
|
this.cdr.markForCheck();
|
|
3127
3298
|
};
|
|
3128
3299
|
ChatDrawerComponent.prototype.closeVoiceModal = function () {
|
|
3300
|
+
if (this.voiceModalOverlayRef) {
|
|
3301
|
+
this.voiceModalOverlayRef.detach();
|
|
3302
|
+
this.voiceModalOverlayRef.dispose();
|
|
3303
|
+
this.voiceModalOverlayRef = null;
|
|
3304
|
+
}
|
|
3129
3305
|
this.isVoiceModalOpen = false;
|
|
3130
3306
|
this.voiceAgentService.disconnect();
|
|
3131
3307
|
this.cdr.markForCheck();
|
|
@@ -3195,7 +3371,10 @@
|
|
|
3195
3371
|
{ type: SocketService },
|
|
3196
3372
|
{ type: ConversationService },
|
|
3197
3373
|
{ type: TranslationService },
|
|
3198
|
-
{ type: VoiceAgentService }
|
|
3374
|
+
{ type: VoiceAgentService },
|
|
3375
|
+
{ type: overlay.Overlay },
|
|
3376
|
+
{ type: i0.ViewContainerRef },
|
|
3377
|
+
{ type: i0.Injector }
|
|
3199
3378
|
]; };
|
|
3200
3379
|
ChatDrawerComponent.propDecorators = {
|
|
3201
3380
|
chatMain: [{ type: i0.ViewChild, args: ['chatMain',] }],
|
|
@@ -3255,40 +3434,26 @@
|
|
|
3255
3434
|
connectWithUser: [{ type: i0.Output }],
|
|
3256
3435
|
scheduleMeeting: [{ type: i0.Output }],
|
|
3257
3436
|
refreshToken: [{ type: i0.Output }],
|
|
3258
|
-
openSupport: [{ type: i0.Output }]
|
|
3259
|
-
requestOpenVoiceModal: [{ type: i0.Output }]
|
|
3437
|
+
openSupport: [{ type: i0.Output }]
|
|
3260
3438
|
};
|
|
3261
3439
|
|
|
3262
3440
|
var ChatBotComponent = /** @class */ (function () {
|
|
3263
3441
|
function ChatBotComponent() {
|
|
3264
3442
|
this.visible = false;
|
|
3265
|
-
this.isVoiceModalOpen = false;
|
|
3266
|
-
this.voiceModalConfig = null;
|
|
3267
3443
|
}
|
|
3268
3444
|
ChatBotComponent.prototype.toggle = function () {
|
|
3269
3445
|
this.visible = !this.visible;
|
|
3270
3446
|
};
|
|
3271
|
-
ChatBotComponent.prototype.onOpenVoiceModal = function (config) {
|
|
3272
|
-
this.voiceModalConfig = config;
|
|
3273
|
-
this.isVoiceModalOpen = true;
|
|
3274
|
-
};
|
|
3275
|
-
ChatBotComponent.prototype.onVoiceModalClose = function () {
|
|
3276
|
-
var _a;
|
|
3277
|
-
this.isVoiceModalOpen = false;
|
|
3278
|
-
this.voiceModalConfig = null;
|
|
3279
|
-
(_a = this.chatDrawerRef) === null || _a === void 0 ? void 0 : _a.closeVoiceModal();
|
|
3280
|
-
};
|
|
3281
3447
|
return ChatBotComponent;
|
|
3282
3448
|
}());
|
|
3283
3449
|
ChatBotComponent.decorators = [
|
|
3284
3450
|
{ type: i0.Component, args: [{
|
|
3285
3451
|
selector: 'hivegpt-chatbot',
|
|
3286
|
-
template: "<button mat-icon-button class=\"chat-button\" color=\"primary\" (click)=\"toggle()\">\n <mat-icon>chat</mat-icon>\n</button>\n\n
|
|
3452
|
+
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-package\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 [s27Token]=\"s27Token\"\n [workspaceToken]=\"workspaceToken\"\n [isDev]=\"isDev\"\n >\n </hivegpt-chat-drawer-package>\n</ng-container>\n",
|
|
3287
3453
|
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}"]
|
|
3288
3454
|
},] }
|
|
3289
3455
|
];
|
|
3290
3456
|
ChatBotComponent.propDecorators = {
|
|
3291
|
-
chatDrawerRef: [{ type: i0.ViewChild, args: [ChatDrawerComponent,] }],
|
|
3292
3457
|
userId: [{ type: i0.Input }],
|
|
3293
3458
|
apiKey: [{ type: i0.Input }],
|
|
3294
3459
|
botName: [{ type: i0.Input }],
|
|
@@ -3325,123 +3490,6 @@
|
|
|
3325
3490
|
isDev: [{ type: i0.Input }]
|
|
3326
3491
|
};
|
|
3327
3492
|
|
|
3328
|
-
var VoiceAgentModalComponent = /** @class */ (function () {
|
|
3329
|
-
function VoiceAgentModalComponent(voiceAgentService, audioAnalyzer) {
|
|
3330
|
-
this.voiceAgentService = voiceAgentService;
|
|
3331
|
-
this.audioAnalyzer = audioAnalyzer;
|
|
3332
|
-
this.close = new i0.EventEmitter();
|
|
3333
|
-
this.agentName = 'AI Assistant';
|
|
3334
|
-
this.agentRole = 'AI Agent Specialist';
|
|
3335
|
-
this.callState = 'idle';
|
|
3336
|
-
this.statusText = '';
|
|
3337
|
-
this.duration = '00:00';
|
|
3338
|
-
this.isMicMuted = false;
|
|
3339
|
-
this.isUserSpeaking = false;
|
|
3340
|
-
this.audioLevels = [];
|
|
3341
|
-
this.isSpeaking = false;
|
|
3342
|
-
this.subscriptions = [];
|
|
3343
|
-
this.isConnecting = false;
|
|
3344
|
-
}
|
|
3345
|
-
VoiceAgentModalComponent.prototype.ngOnInit = function () {
|
|
3346
|
-
var _this = this;
|
|
3347
|
-
// Subscribe to observables
|
|
3348
|
-
this.subscriptions.push(this.voiceAgentService.callState$.subscribe(function (state) {
|
|
3349
|
-
_this.callState = state;
|
|
3350
|
-
_this.isSpeaking = state === 'talking';
|
|
3351
|
-
}));
|
|
3352
|
-
this.subscriptions.push(this.voiceAgentService.statusText$.subscribe(function (text) {
|
|
3353
|
-
_this.statusText = text;
|
|
3354
|
-
}));
|
|
3355
|
-
this.subscriptions.push(this.voiceAgentService.duration$.subscribe(function (duration) {
|
|
3356
|
-
_this.duration = duration;
|
|
3357
|
-
}));
|
|
3358
|
-
this.subscriptions.push(this.voiceAgentService.isMicMuted$.subscribe(function (muted) {
|
|
3359
|
-
_this.isMicMuted = muted;
|
|
3360
|
-
}));
|
|
3361
|
-
this.subscriptions.push(this.voiceAgentService.isUserSpeaking$.subscribe(function (speaking) {
|
|
3362
|
-
_this.isUserSpeaking = speaking;
|
|
3363
|
-
}));
|
|
3364
|
-
this.subscriptions.push(this.voiceAgentService.audioLevels$.subscribe(function (levels) {
|
|
3365
|
-
_this.audioLevels = levels;
|
|
3366
|
-
}));
|
|
3367
|
-
// Modal opens in idle state; user clicks "Start Call" to connect (no auto-connect).
|
|
3368
|
-
this.voiceAgentService.resetToIdle();
|
|
3369
|
-
};
|
|
3370
|
-
VoiceAgentModalComponent.prototype.ngOnDestroy = function () {
|
|
3371
|
-
this.subscriptions.forEach(function (sub) { return sub.unsubscribe(); });
|
|
3372
|
-
this.disconnect();
|
|
3373
|
-
};
|
|
3374
|
-
VoiceAgentModalComponent.prototype.startCall = function () {
|
|
3375
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3376
|
-
var error_1;
|
|
3377
|
-
return __generator(this, function (_a) {
|
|
3378
|
-
switch (_a.label) {
|
|
3379
|
-
case 0:
|
|
3380
|
-
if (this.isConnecting || (this.callState !== 'idle' && this.callState !== 'ended'))
|
|
3381
|
-
return [2 /*return*/];
|
|
3382
|
-
this.isConnecting = true;
|
|
3383
|
-
_a.label = 1;
|
|
3384
|
-
case 1:
|
|
3385
|
-
_a.trys.push([1, 3, 4, 5]);
|
|
3386
|
-
return [4 /*yield*/, this.voiceAgentService.connect(this.apiUrl, this.token, this.botId, this.conversationId)];
|
|
3387
|
-
case 2:
|
|
3388
|
-
_a.sent();
|
|
3389
|
-
return [3 /*break*/, 5];
|
|
3390
|
-
case 3:
|
|
3391
|
-
error_1 = _a.sent();
|
|
3392
|
-
console.error('Failed to connect voice agent:', error_1);
|
|
3393
|
-
return [3 /*break*/, 5];
|
|
3394
|
-
case 4:
|
|
3395
|
-
this.isConnecting = false;
|
|
3396
|
-
return [7 /*endfinally*/];
|
|
3397
|
-
case 5: return [2 /*return*/];
|
|
3398
|
-
}
|
|
3399
|
-
});
|
|
3400
|
-
});
|
|
3401
|
-
};
|
|
3402
|
-
VoiceAgentModalComponent.prototype.disconnect = function () {
|
|
3403
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
3404
|
-
return __generator(this, function (_a) {
|
|
3405
|
-
switch (_a.label) {
|
|
3406
|
-
case 0: return [4 /*yield*/, this.voiceAgentService.disconnect()];
|
|
3407
|
-
case 1:
|
|
3408
|
-
_a.sent();
|
|
3409
|
-
return [2 /*return*/];
|
|
3410
|
-
}
|
|
3411
|
-
});
|
|
3412
|
-
});
|
|
3413
|
-
};
|
|
3414
|
-
VoiceAgentModalComponent.prototype.toggleMic = function () {
|
|
3415
|
-
this.voiceAgentService.toggleMic();
|
|
3416
|
-
};
|
|
3417
|
-
VoiceAgentModalComponent.prototype.endCall = function () {
|
|
3418
|
-
this.disconnect();
|
|
3419
|
-
this.close.emit();
|
|
3420
|
-
};
|
|
3421
|
-
return VoiceAgentModalComponent;
|
|
3422
|
-
}());
|
|
3423
|
-
VoiceAgentModalComponent.decorators = [
|
|
3424
|
-
{ type: i0.Component, args: [{
|
|
3425
|
-
selector: 'hivegpt-voice-agent-modal',
|
|
3426
|
-
template: "<div class=\"voice-agent-modal-overlay\" (click)=\"endCall()\">\n <div class=\"voice-agent-modal\" (click)=\"$event.stopPropagation()\">\n <!-- Header -->\n <div class=\"modal-header\">\n <div class=\"header-left\">\n <div class=\"voice-icon\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 1C8.13 1 5 4.13 5 8V14C5 17.87 8.13 21 12 21C15.87 21 19 17.87 19 14V8C19 4.13 15.87 1 12 1Z\" fill=\"currentColor\"/>\n <path d=\"M12 23C10.34 23 9 21.66 9 20H15C15 21.66 13.66 23 12 23Z\" fill=\"currentColor\"/>\n </svg>\n </div>\n <span class=\"voice-label\">Voice</span>\n </div>\n <button class=\"close-button\" (click)=\"endCall()\" type=\"button\">\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 6L6 18M6 6L18 18\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n </svg>\n </button>\n </div>\n\n <!-- Agent Avatar -->\n <div class=\"agent-avatar-container\">\n <div class=\"agent-avatar\" [class.speaking]=\"isSpeaking\">\n <img *ngIf=\"agentAvatar\" [src]=\"agentAvatar\" [alt]=\"agentName\" />\n <div *ngIf=\"!agentAvatar\" class=\"avatar-placeholder\">\n {{ agentName.charAt(0) }}\n </div>\n </div>\n </div>\n\n <!-- Agent Info -->\n <div class=\"agent-info\">\n <div class=\"agent-name-row\">\n <h2 class=\"agent-name\">{{ agentName }}</h2>\n <span class=\"ai-badge\">AI</span>\n </div>\n <p class=\"agent-role\">{{ agentRole }}</p>\n </div>\n\n <!-- Start Call / Retry (when idle or ended) -->\n <div *ngIf=\"callState === 'idle' || callState === 'ended'\" class=\"start-call-section\">\n <p *ngIf=\"statusText === 'Connection failed'\" class=\"error-message\">{{ statusText }}</p>\n <button\n class=\"start-call-button\"\n type=\"button\"\n [disabled]=\"isConnecting\"\n (click)=\"startCall()\"\n >\n <span *ngIf=\"isConnecting\">Connecting...</span>\n <span *ngIf=\"!isConnecting && statusText === 'Connection failed'\">Retry</span>\n <span *ngIf=\"!isConnecting && statusText !== 'Connection failed'\">Start Call</span>\n </button>\n </div>\n\n <!-- Status (when connecting or connected) -->\n <div class=\"status-section\" *ngIf=\"callState !== 'idle' && callState !== 'ended'\">\n <div *ngIf=\"callState === 'connecting'\" class=\"connecting-spinner\">\n <svg class=\"spinner\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-dasharray=\"31.416\" stroke-dashoffset=\"31.416\">\n <animate attributeName=\"stroke-dasharray\" dur=\"2s\" values=\"0 31.416;15.708 15.708;0 31.416;0 31.416\" repeatCount=\"indefinite\"/>\n <animate attributeName=\"stroke-dashoffset\" dur=\"2s\" values=\"0;-15.708;-31.416;-31.416\" repeatCount=\"indefinite\"/>\n </circle>\n </svg>\n <span class=\"status-text\">{{ statusText }}</span>\n </div>\n <div *ngIf=\"callState !== 'connecting'\" class=\"status-connected\">\n <span class=\"status-text\">{{ statusText || 'Connected' }}</span>\n <span class=\"duration\">{{ duration }}</span>\n </div>\n </div>\n\n <!-- Waveform Visualization -->\n <div *ngIf=\"callState === 'connected' || callState === 'listening' || callState === 'talking'\" class=\"waveform-container\">\n <div class=\"waveform-bars\">\n <div\n *ngFor=\"let level of audioLevels; let i = index\"\n class=\"waveform-bar\"\n [style.height.%]=\"level || 10\"\n [style.animation-delay.ms]=\"i * 20\"\n ></div>\n </div>\n </div>\n\n <!-- Call Controls (only when connected) -->\n <div class=\"call-controls\" *ngIf=\"callState === 'connected' || callState === 'listening' || callState === 'talking'\">\n <button\n class=\"control-button mute-button\"\n [class.muted]=\"isMicMuted\"\n (click)=\"toggleMic()\"\n type=\"button\"\n [title]=\"isMicMuted ? 'Unmute' : 'Mute'\"\n >\n <svg *ngIf=\"!isMicMuted\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 1C8.13 1 5 4.13 5 8V14C5 17.87 8.13 21 12 21C15.87 21 19 17.87 19 14V8C19 4.13 15.87 1 12 1Z\" fill=\"currentColor\"/>\n <path d=\"M12 23C10.34 23 9 21.66 9 20H15C15 21.66 13.66 23 12 23Z\" fill=\"currentColor\"/>\n </svg>\n <svg *ngIf=\"isMicMuted\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 1C8.13 1 5 4.13 5 8V14C5 17.87 8.13 21 12 21C15.87 21 19 17.87 19 14V8C19 4.13 15.87 1 12 1Z\" fill=\"currentColor\"/>\n <path d=\"M12 23C10.34 23 9 21.66 9 20H15C15 21.66 13.66 23 12 23Z\" fill=\"currentColor\"/>\n <path d=\"M3 3L21 21M9 9L15 15\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n </svg>\n <span class=\"control-label\">Mute</span>\n </button>\n\n <button\n class=\"control-button end-call-button\"\n (click)=\"endCall()\"\n type=\"button\"\n title=\"End Call\"\n >\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M18 6L6 18M6 6L18 18\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/>\n </svg>\n <span class=\"control-label\">End Call</span>\n </button>\n </div>\n </div>\n</div>\n",
|
|
3427
|
-
styles: [":host{display:block}.voice-agent-modal-overlay{align-items:flex-end;backdrop-filter:blur(4px);background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:flex-end;left:0;padding:24px;position:fixed;right:0;top:0;z-index:99999}.voice-agent-modal{animation:modalEnter .3s ease-out;background:#fff;border-radius:24px;box-shadow:0 20px 60px rgba(0,0,0,.3);max-height:calc(100vh - 48px);max-width:480px;overflow-y:auto;padding:32px;width:90%}@keyframes modalEnter{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.modal-header{justify-content:space-between;margin-bottom:24px}.header-left,.modal-header{align-items:center;display:flex}.header-left{gap:8px}.voice-icon{align-items:center;color:#17235b;display:flex;height:32px;justify-content:center;width:32px}.voice-label{color:#333;font-size:16px;font-weight:600}.close-button{align-items:center;background:none;border:none;color:#666;cursor:pointer;display:flex;justify-content:center;padding:8px;transition:color .2s}.close-button:hover{color:#000}.agent-avatar-container{display:flex;justify-content:center;margin-bottom:24px}.agent-avatar{border:3px solid #e0f2fe;border-radius:50%;height:120px;overflow:hidden;position:relative;transition:all .3s ease;width:120px}.agent-avatar.speaking{animation:speakingGlow 1.5s ease-in-out infinite;border-color:#0ea5e9;box-shadow:0 0 20px rgba(14,165,233,.4)}.agent-avatar img{-o-object-fit:cover;height:100%;object-fit:cover;width:100%}.avatar-placeholder{align-items:center;background:linear-gradient(135deg,#0ea5e9,#06b6d4);color:#fff;display:flex;font-size:48px;font-weight:600;height:100%;justify-content:center;width:100%}@keyframes speakingGlow{0%,to{box-shadow:0 0 20px rgba(14,165,233,.4)}50%{box-shadow:0 0 30px rgba(14,165,233,.6)}}.agent-info{margin-bottom:24px;text-align:center}.agent-name-row{align-items:center;display:flex;gap:12px;justify-content:center;margin-bottom:8px}.agent-name{color:#1f2937;font-size:28px;font-weight:700;margin:0}.ai-badge{background:#0ea5e9;border-radius:12px;color:#fff;font-size:12px;font-weight:600;padding:4px 12px}.agent-role{color:#6b7280;font-size:14px;margin:0}.start-call-section{align-items:center;display:flex;flex-direction:column;gap:16px;margin-bottom:24px}.error-message{color:#dc2626;font-size:14px;margin:0}.start-call-button{background:#0ea5e9;border:none;border-radius:12px;color:#fff;cursor:pointer;font-size:16px;font-weight:600;padding:14px 32px;transition:background .2s}.start-call-button:hover:not(:disabled){background:#0284c7}.start-call-button:disabled{cursor:not-allowed;opacity:.7}.status-section{flex-direction:column;margin-bottom:24px}.connecting-spinner,.status-section{align-items:center;display:flex;gap:12px}.spinner{animation:spin 1s linear infinite;color:#0ea5e9}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.status-connected{align-items:center;display:flex;flex-direction:column;gap:8px}.status-text{color:#4b5563;font-size:16px;font-weight:500}.duration{color:#9ca3af;font-family:monospace;font-size:14px}.waveform-container{margin-bottom:32px;width:100%}.waveform-bars{align-items:center;display:flex;gap:4px;height:60px;justify-content:center}.waveform-bar{animation:waveformPulse 1s ease-in-out infinite;background:linear-gradient(0deg,#0ea5e9,#06b6d4);border-radius:2px;min-height:10%;transition:height .1s ease;width:4px}@keyframes waveformPulse{0%,to{opacity:.6}50%{opacity:1}}.call-controls{gap:24px}.call-controls,.control-button{display:flex;justify-content:center}.control-button{align-items:center;border:none;border-radius:50%;cursor:pointer;flex-direction:column;gap:8px;height:80px;padding:16px;transition:all .2s;width:80px}.mute-button{background:#f3f4f6;color:#4b5563}.mute-button:hover{background:#e5e7eb}.mute-button.muted{background:#fee2e2;color:#dc2626}.end-call-button{background:#ef4444;color:#fff}.end-call-button:hover{background:#dc2626}.control-label{font-size:12px;font-weight:500;margin-top:4px}"]
|
|
3428
|
-
},] }
|
|
3429
|
-
];
|
|
3430
|
-
VoiceAgentModalComponent.ctorParameters = function () { return [
|
|
3431
|
-
{ type: VoiceAgentService },
|
|
3432
|
-
{ type: AudioAnalyzerService }
|
|
3433
|
-
]; };
|
|
3434
|
-
VoiceAgentModalComponent.propDecorators = {
|
|
3435
|
-
close: [{ type: i0.Output }],
|
|
3436
|
-
apiUrl: [{ type: i0.Input }],
|
|
3437
|
-
token: [{ type: i0.Input }],
|
|
3438
|
-
botId: [{ type: i0.Input }],
|
|
3439
|
-
conversationId: [{ type: i0.Input }],
|
|
3440
|
-
agentName: [{ type: i0.Input }],
|
|
3441
|
-
agentRole: [{ type: i0.Input }],
|
|
3442
|
-
agentAvatar: [{ type: i0.Input }]
|
|
3443
|
-
};
|
|
3444
|
-
|
|
3445
3493
|
var VoiceAgentModule = /** @class */ (function () {
|
|
3446
3494
|
function VoiceAgentModule() {
|
|
3447
3495
|
}
|
|
@@ -3728,7 +3776,7 @@
|
|
|
3728
3776
|
HiveGptModule.decorators = [
|
|
3729
3777
|
{ type: i0.NgModule, args: [{
|
|
3730
3778
|
declarations: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent, SafeHtmlPipe, BotHtmlEditorComponent],
|
|
3731
|
-
imports: [common.CommonModule, icon.MatIconModule, sidenav.MatSidenavModule, forms.FormsModule, forms.ReactiveFormsModule, ngxQuill.QuillModule, VoiceAgentModule],
|
|
3779
|
+
imports: [common.CommonModule, overlay.OverlayModule, icon.MatIconModule, sidenav.MatSidenavModule, forms.FormsModule, forms.ReactiveFormsModule, ngxQuill.QuillModule, VoiceAgentModule],
|
|
3732
3780
|
exports: [ChatBotComponent, ChatDrawerComponent, VideoPlayerComponent]
|
|
3733
3781
|
},] }
|
|
3734
3782
|
];
|
|
@@ -3745,6 +3793,8 @@
|
|
|
3745
3793
|
exports.ChatBotComponent = ChatBotComponent;
|
|
3746
3794
|
exports.ChatDrawerComponent = ChatDrawerComponent;
|
|
3747
3795
|
exports.HiveGptModule = HiveGptModule;
|
|
3796
|
+
exports.VOICE_MODAL_CLOSE_CALLBACK = VOICE_MODAL_CLOSE_CALLBACK;
|
|
3797
|
+
exports.VOICE_MODAL_CONFIG = VOICE_MODAL_CONFIG;
|
|
3748
3798
|
exports.VoiceAgentModalComponent = VoiceAgentModalComponent;
|
|
3749
3799
|
exports.VoiceAgentModule = VoiceAgentModule;
|
|
3750
3800
|
exports.VoiceAgentService = VoiceAgentService;
|