@dataclouder/ngx-agent-cards 0.1.81 → 0.1.85
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.
|
@@ -3331,6 +3331,7 @@ const BACKGROUND_SERVICE_TOKEN = new InjectionToken('BACKGROUND_SERVICE_TOKEN');
|
|
|
3331
3331
|
class VideoPlayerService {
|
|
3332
3332
|
constructor() {
|
|
3333
3333
|
this.conversationFlowStateService = inject(ConversationFlowStateService);
|
|
3334
|
+
this.useNativePlayer = false;
|
|
3334
3335
|
this.isRewinding = false;
|
|
3335
3336
|
this.videoQueue = [];
|
|
3336
3337
|
this.defaultVideoUrl = null;
|
|
@@ -3338,9 +3339,7 @@ class VideoPlayerService {
|
|
|
3338
3339
|
this.playAndRewinded$ = this.playAndRewindedSource.asObservable();
|
|
3339
3340
|
this.agentCard = signal(undefined, ...(ngDevMode ? [{ debugName: "agentCard" }] : []));
|
|
3340
3341
|
console.log(' CONSTRUCTOR FOR VIDEO PLAYER...');
|
|
3341
|
-
this.playAndRewindedSubscription = this.playAndRewinded$.subscribe(() => {
|
|
3342
|
-
this.playNextInQueue();
|
|
3343
|
-
});
|
|
3342
|
+
this.playAndRewindedSubscription = this.playAndRewinded$.subscribe(() => { });
|
|
3344
3343
|
this.moodSubscription = this.conversationFlowStateService.moodUpdated$.subscribe((mood) => {
|
|
3345
3344
|
console.log('CHANGING MOOD.. ', mood);
|
|
3346
3345
|
const card = this.agentCard();
|
|
@@ -3359,20 +3358,29 @@ class VideoPlayerService {
|
|
|
3359
3358
|
this.setVideoSource(card.assets.motion.url);
|
|
3360
3359
|
}
|
|
3361
3360
|
}
|
|
3362
|
-
initializePlayer(videoPlayer) {
|
|
3363
|
-
|
|
3364
|
-
|
|
3361
|
+
initializePlayer(videoPlayer, useNativePlayer = false) {
|
|
3362
|
+
this.useNativePlayer = useNativePlayer;
|
|
3363
|
+
if (this.useNativePlayer) {
|
|
3364
|
+
this.videoElement = videoPlayer.nativeElement;
|
|
3365
|
+
}
|
|
3366
|
+
else {
|
|
3367
|
+
if (this.player) {
|
|
3368
|
+
this.player.destroy();
|
|
3369
|
+
}
|
|
3370
|
+
this.player = new Plyr.default(videoPlayer.nativeElement, {
|
|
3371
|
+
controls: [],
|
|
3372
|
+
});
|
|
3373
|
+
this.player.on('ready', (event) => {
|
|
3374
|
+
const instance = event.detail.plyr;
|
|
3375
|
+
console.log('El video esta redyinstance', instance);
|
|
3376
|
+
});
|
|
3365
3377
|
}
|
|
3366
|
-
this.player = new Plyr.default(videoPlayer.nativeElement, {
|
|
3367
|
-
controls: [],
|
|
3368
|
-
});
|
|
3369
|
-
this.player.on('ready', (event) => {
|
|
3370
|
-
const instance = event.detail.plyr;
|
|
3371
|
-
console.log('El video esta redyinstance', instance);
|
|
3372
|
-
});
|
|
3373
3378
|
}
|
|
3374
3379
|
setVideoSource(videoUrl) {
|
|
3375
|
-
if (this.
|
|
3380
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3381
|
+
this.videoElement.src = videoUrl;
|
|
3382
|
+
}
|
|
3383
|
+
else if (this.player) {
|
|
3376
3384
|
this.player.source = {
|
|
3377
3385
|
type: 'video',
|
|
3378
3386
|
sources: [
|
|
@@ -3385,7 +3393,6 @@ class VideoPlayerService {
|
|
|
3385
3393
|
}
|
|
3386
3394
|
}
|
|
3387
3395
|
startConversation(defaultVideo) {
|
|
3388
|
-
debugger;
|
|
3389
3396
|
if (defaultVideo) {
|
|
3390
3397
|
this.defaultVideoUrl = defaultVideo;
|
|
3391
3398
|
}
|
|
@@ -3399,12 +3406,19 @@ class VideoPlayerService {
|
|
|
3399
3406
|
}
|
|
3400
3407
|
}
|
|
3401
3408
|
playVideo() {
|
|
3402
|
-
if (this.
|
|
3409
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3410
|
+
this.videoElement.play();
|
|
3411
|
+
}
|
|
3412
|
+
else if (this.player) {
|
|
3403
3413
|
this.player.play();
|
|
3404
3414
|
}
|
|
3405
3415
|
}
|
|
3406
3416
|
rewindVideo() {
|
|
3407
|
-
if (this.
|
|
3417
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3418
|
+
this.videoElement.currentTime = 0;
|
|
3419
|
+
this.videoElement.play();
|
|
3420
|
+
}
|
|
3421
|
+
else if (this.player) {
|
|
3408
3422
|
if (this.isRewinding) {
|
|
3409
3423
|
this.isRewinding = false;
|
|
3410
3424
|
clearInterval(this.rewindInterval);
|
|
@@ -3415,10 +3429,10 @@ class VideoPlayerService {
|
|
|
3415
3429
|
this.isRewinding = true;
|
|
3416
3430
|
this.player.pause();
|
|
3417
3431
|
this.rewindInterval = setInterval(() => {
|
|
3418
|
-
if (this.player.currentTime > 0) {
|
|
3432
|
+
if (this.player && this.player.currentTime > 0) {
|
|
3419
3433
|
this.player.rewind(0.1);
|
|
3420
3434
|
}
|
|
3421
|
-
else {
|
|
3435
|
+
else if (this.player) {
|
|
3422
3436
|
this.player.currentTime = 0;
|
|
3423
3437
|
this.isRewinding = false;
|
|
3424
3438
|
clearInterval(this.rewindInterval);
|
|
@@ -3430,22 +3444,28 @@ class VideoPlayerService {
|
|
|
3430
3444
|
}
|
|
3431
3445
|
}
|
|
3432
3446
|
changeVideoSource(videoUrl) {
|
|
3433
|
-
|
|
3434
|
-
this.setVideoSource(videoUrl);
|
|
3435
|
-
}
|
|
3447
|
+
this.setVideoSource(videoUrl);
|
|
3436
3448
|
}
|
|
3437
3449
|
addVideosToQueue(videoUrls) {
|
|
3438
3450
|
console.log('ADING VIDEOS TO QUEUE, ', videoUrls);
|
|
3439
3451
|
this.videoQueue.push(...videoUrls);
|
|
3440
3452
|
}
|
|
3441
3453
|
destroyPlayer() {
|
|
3442
|
-
if (this.
|
|
3454
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3455
|
+
this.videoElement.pause();
|
|
3456
|
+
this.videoElement = undefined;
|
|
3457
|
+
}
|
|
3458
|
+
else if (this.player) {
|
|
3443
3459
|
this.player.destroy();
|
|
3460
|
+
this.player = undefined;
|
|
3444
3461
|
}
|
|
3445
3462
|
}
|
|
3446
3463
|
playAndRewind() {
|
|
3447
|
-
if (this.
|
|
3448
|
-
this.
|
|
3464
|
+
if (this.useNativePlayer && this.videoElement && this.videoElement.paused) {
|
|
3465
|
+
this.playNextInQueueNative();
|
|
3466
|
+
}
|
|
3467
|
+
else if (this.player && !this.player.playing) {
|
|
3468
|
+
this.playNextInQueuePlayr();
|
|
3449
3469
|
}
|
|
3450
3470
|
}
|
|
3451
3471
|
cleanUp() {
|
|
@@ -3466,23 +3486,78 @@ class VideoPlayerService {
|
|
|
3466
3486
|
this.moodSubscription.unsubscribe();
|
|
3467
3487
|
}
|
|
3468
3488
|
}
|
|
3469
|
-
|
|
3489
|
+
playNextInQueueNative() {
|
|
3470
3490
|
if (this.videoQueue.length > 0) {
|
|
3471
3491
|
const videoUrl = this.videoQueue.shift();
|
|
3472
3492
|
if (videoUrl) {
|
|
3473
3493
|
this.changeVideoSource(videoUrl);
|
|
3474
|
-
this.
|
|
3475
|
-
|
|
3494
|
+
this.playVideo();
|
|
3495
|
+
const onEnded = () => {
|
|
3476
3496
|
this.rewindVideo();
|
|
3477
|
-
|
|
3497
|
+
if (this.videoElement) {
|
|
3498
|
+
this.videoElement.removeEventListener('ended', onEnded);
|
|
3499
|
+
}
|
|
3500
|
+
};
|
|
3501
|
+
if (this.videoElement) {
|
|
3502
|
+
this.videoElement.addEventListener('ended', onEnded);
|
|
3503
|
+
}
|
|
3478
3504
|
}
|
|
3479
3505
|
}
|
|
3480
3506
|
else if (this.defaultVideoUrl) {
|
|
3481
3507
|
this.changeVideoSource(this.defaultVideoUrl);
|
|
3482
|
-
this.
|
|
3483
|
-
|
|
3484
|
-
this.
|
|
3485
|
-
|
|
3508
|
+
this.playVideo();
|
|
3509
|
+
const onEnded = () => {
|
|
3510
|
+
this.playDefaultVideoForever();
|
|
3511
|
+
if (this.videoElement) {
|
|
3512
|
+
this.videoElement.removeEventListener('ended', onEnded);
|
|
3513
|
+
}
|
|
3514
|
+
};
|
|
3515
|
+
if (this.videoElement) {
|
|
3516
|
+
this.videoElement.addEventListener('ended', onEnded);
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
playNextInQueuePlayr() {
|
|
3521
|
+
if (this.videoQueue.length > 0) {
|
|
3522
|
+
const videoUrl = this.videoQueue.shift();
|
|
3523
|
+
if (videoUrl) {
|
|
3524
|
+
this.changeVideoSource(videoUrl);
|
|
3525
|
+
this.playVideo();
|
|
3526
|
+
const onEnded = () => {
|
|
3527
|
+
this.rewindVideo();
|
|
3528
|
+
};
|
|
3529
|
+
if (this.player) {
|
|
3530
|
+
this.player.once('ended', onEnded);
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
else if (this.defaultVideoUrl) {
|
|
3535
|
+
this.changeVideoSource(this.defaultVideoUrl);
|
|
3536
|
+
this.playVideo();
|
|
3537
|
+
const onEnded = () => {
|
|
3538
|
+
this.playDefaultVideoForever();
|
|
3539
|
+
};
|
|
3540
|
+
if (this.player) {
|
|
3541
|
+
this.player.once('ended', onEnded);
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
playDefaultVideoForever() {
|
|
3546
|
+
if (this.defaultVideoUrl) {
|
|
3547
|
+
this.changeVideoSource(this.defaultVideoUrl);
|
|
3548
|
+
this.playVideo();
|
|
3549
|
+
const onEnded = () => {
|
|
3550
|
+
this.playDefaultVideoForever(); // Recursive call to loop
|
|
3551
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3552
|
+
this.videoElement.removeEventListener('ended', onEnded);
|
|
3553
|
+
}
|
|
3554
|
+
};
|
|
3555
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3556
|
+
this.videoElement.addEventListener('ended', onEnded);
|
|
3557
|
+
}
|
|
3558
|
+
else if (this.player) {
|
|
3559
|
+
this.player.once('ended', onEnded);
|
|
3560
|
+
}
|
|
3486
3561
|
}
|
|
3487
3562
|
}
|
|
3488
3563
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -3495,6 +3570,106 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3495
3570
|
}]
|
|
3496
3571
|
}], ctorParameters: () => [] });
|
|
3497
3572
|
|
|
3573
|
+
class VideoPlayerNativeService {
|
|
3574
|
+
constructor() {
|
|
3575
|
+
this.conversationFlowStateService = inject(ConversationFlowStateService);
|
|
3576
|
+
this.videoQueue = [];
|
|
3577
|
+
this.defaultVideoUrl = null;
|
|
3578
|
+
this.agentCard = signal(undefined, ...(ngDevMode ? [{ debugName: "agentCard" }] : []));
|
|
3579
|
+
this.moodSubscription = this.conversationFlowStateService.moodUpdated$.subscribe((mood) => {
|
|
3580
|
+
const card = this.agentCard();
|
|
3581
|
+
if (mood && card?.assets?.motions) {
|
|
3582
|
+
const motionUrl = card.assets.motions.find((m) => m.metadata?.moodState === mood)?.url;
|
|
3583
|
+
if (motionUrl) {
|
|
3584
|
+
this.addVideosToQueue([motionUrl]);
|
|
3585
|
+
this.playAndRewind();
|
|
3586
|
+
}
|
|
3587
|
+
}
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
setAgentCard(card) {
|
|
3591
|
+
this.agentCard.set(card);
|
|
3592
|
+
if (card.assets?.motion?.url) {
|
|
3593
|
+
this.setVideoSource(card.assets.motion.url);
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
initializePlayer(videoPlayer) {
|
|
3597
|
+
this.videoElement = videoPlayer.nativeElement;
|
|
3598
|
+
this.videoElement.addEventListener('ended', this.onVideoEnded.bind(this));
|
|
3599
|
+
}
|
|
3600
|
+
setVideoSource(videoUrl) {
|
|
3601
|
+
if (this.videoElement) {
|
|
3602
|
+
this.videoElement.src = videoUrl;
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
startConversation(defaultVideo) {
|
|
3606
|
+
if (defaultVideo) {
|
|
3607
|
+
this.defaultVideoUrl = defaultVideo;
|
|
3608
|
+
}
|
|
3609
|
+
else {
|
|
3610
|
+
this.defaultVideoUrl = this.agentCard()?.assets?.motion?.url || null;
|
|
3611
|
+
}
|
|
3612
|
+
const introMotion = this.agentCard()?.assets?.motions?.find((m) => m.metadata?.event === 'intro');
|
|
3613
|
+
if (introMotion?.url) {
|
|
3614
|
+
this.addVideosToQueue([introMotion.url]);
|
|
3615
|
+
this.playAndRewind();
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
playVideo() {
|
|
3619
|
+
this.videoElement?.play();
|
|
3620
|
+
}
|
|
3621
|
+
addVideosToQueue(videoUrls) {
|
|
3622
|
+
this.videoQueue.push(...videoUrls);
|
|
3623
|
+
}
|
|
3624
|
+
destroyPlayer() {
|
|
3625
|
+
if (this.videoElement) {
|
|
3626
|
+
this.videoElement.removeEventListener('ended', this.onVideoEnded.bind(this));
|
|
3627
|
+
this.videoElement.pause();
|
|
3628
|
+
this.videoElement = undefined;
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
playAndRewind() {
|
|
3632
|
+
if (this.videoElement && this.videoElement.paused) {
|
|
3633
|
+
this.playNextInQueue();
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
cleanUp() {
|
|
3637
|
+
this.destroyPlayer();
|
|
3638
|
+
this.videoQueue = [];
|
|
3639
|
+
this.defaultVideoUrl = null;
|
|
3640
|
+
this.agentCard.set(undefined);
|
|
3641
|
+
}
|
|
3642
|
+
ngOnDestroy() {
|
|
3643
|
+
this.moodSubscription?.unsubscribe();
|
|
3644
|
+
this.destroyPlayer();
|
|
3645
|
+
}
|
|
3646
|
+
onVideoEnded() {
|
|
3647
|
+
this.playNextInQueue();
|
|
3648
|
+
}
|
|
3649
|
+
playNextInQueue() {
|
|
3650
|
+
if (this.videoQueue.length > 0) {
|
|
3651
|
+
const videoUrl = this.videoQueue.shift();
|
|
3652
|
+
if (videoUrl && this.videoElement) {
|
|
3653
|
+
this.videoElement.src = videoUrl;
|
|
3654
|
+
this.videoElement.play();
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
else if (this.defaultVideoUrl && this.videoElement) {
|
|
3658
|
+
this.videoElement.src = this.defaultVideoUrl;
|
|
3659
|
+
// this.videoElement.loop = true;
|
|
3660
|
+
this.videoElement.play();
|
|
3661
|
+
}
|
|
3662
|
+
}
|
|
3663
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3664
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, providedIn: 'root' }); }
|
|
3665
|
+
}
|
|
3666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, decorators: [{
|
|
3667
|
+
type: Injectable,
|
|
3668
|
+
args: [{
|
|
3669
|
+
providedIn: 'root',
|
|
3670
|
+
}]
|
|
3671
|
+
}], ctorParameters: () => [] });
|
|
3672
|
+
|
|
3498
3673
|
const Endpoints = 'conversationRule';
|
|
3499
3674
|
class ConversationRuleService extends EntityCommunicationService {
|
|
3500
3675
|
constructor() {
|
|
@@ -7222,8 +7397,9 @@ class DcAgentCardDetailsComponent {
|
|
|
7222
7397
|
this.chatMonitorService = inject(ChatMonitorService);
|
|
7223
7398
|
this.conversationFlowStateService = inject(ConversationFlowStateService);
|
|
7224
7399
|
this.userService = inject(UserService);
|
|
7225
|
-
this.videoPlayerService = inject(
|
|
7400
|
+
this.videoPlayerService = inject(VideoPlayerNativeService);
|
|
7226
7401
|
this.agentCardId = '';
|
|
7402
|
+
this.useNativePlayer = true;
|
|
7227
7403
|
this.onStartConversation = output();
|
|
7228
7404
|
this.agentCard = signal(undefined, ...(ngDevMode ? [{ debugName: "agentCard" }] : []));
|
|
7229
7405
|
this.showInfoLayer = signal(false, ...(ngDevMode ? [{ debugName: "showInfoLayer" }] : []));
|
|
@@ -7240,6 +7416,7 @@ class DcAgentCardDetailsComponent {
|
|
|
7240
7416
|
}
|
|
7241
7417
|
ngAfterViewInit() {
|
|
7242
7418
|
if (this.videoPlayer) {
|
|
7419
|
+
// this.videoPlayerService.initializePlayer(this.videoPlayer, this.useNativePlayer);
|
|
7243
7420
|
this.videoPlayerService.initializePlayer(this.videoPlayer);
|
|
7244
7421
|
}
|
|
7245
7422
|
}
|
|
@@ -7267,25 +7444,30 @@ class DcAgentCardDetailsComponent {
|
|
|
7267
7444
|
}
|
|
7268
7445
|
}
|
|
7269
7446
|
transformToLanguage(agentCard, targetLang) {
|
|
7270
|
-
const
|
|
7271
|
-
const
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7447
|
+
const cardTranslated = JSON.parse(JSON.stringify(agentCard));
|
|
7448
|
+
const translation = cardTranslated.characterCard?.data?.langTranslation?.[targetLang];
|
|
7449
|
+
if (cardTranslated.characterCard?.data) {
|
|
7450
|
+
cardTranslated.characterCard.data.greetings = translation?.greetings;
|
|
7451
|
+
if (cardTranslated.characterCard.data.persona && translation?.communication) {
|
|
7452
|
+
cardTranslated.characterCard.data.persona.communication = translation.communication;
|
|
7453
|
+
}
|
|
7276
7454
|
}
|
|
7277
7455
|
cardTranslated.lang = targetLang;
|
|
7278
7456
|
console.log('cambiando idioma', agentCard.lang);
|
|
7279
|
-
const locale = LANGUAGES[targetLang]
|
|
7457
|
+
const locale = LANGUAGES[targetLang]?.defaultLocale;
|
|
7280
7458
|
if (!locale)
|
|
7281
7459
|
return cardTranslated;
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7460
|
+
if (cardTranslated.conversationSettings?.mainVoice) {
|
|
7461
|
+
const transformedMainVoice = this._transformVoice(cardTranslated.conversationSettings.mainVoice.voice, locale);
|
|
7462
|
+
if (transformedMainVoice) {
|
|
7463
|
+
cardTranslated.conversationSettings.mainVoice.voice = transformedMainVoice;
|
|
7464
|
+
}
|
|
7285
7465
|
}
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7466
|
+
if (cardTranslated.conversationSettings?.secondaryVoice) {
|
|
7467
|
+
const transformedSecondaryVoice = this._transformVoice(cardTranslated.conversationSettings.secondaryVoice.voice, locale);
|
|
7468
|
+
if (transformedSecondaryVoice) {
|
|
7469
|
+
cardTranslated.conversationSettings.secondaryVoice.voice = transformedSecondaryVoice;
|
|
7470
|
+
}
|
|
7289
7471
|
}
|
|
7290
7472
|
return cardTranslated;
|
|
7291
7473
|
}
|
|
@@ -7299,29 +7481,34 @@ class DcAgentCardDetailsComponent {
|
|
|
7299
7481
|
startConversation() {
|
|
7300
7482
|
this.videoPlayerService.startConversation();
|
|
7301
7483
|
const targetLang = this.userService.getTargetLanguage();
|
|
7302
|
-
const
|
|
7303
|
-
if (
|
|
7304
|
-
|
|
7484
|
+
const agentCard = this.agentCard();
|
|
7485
|
+
if (!agentCard)
|
|
7486
|
+
return;
|
|
7487
|
+
const translation = agentCard.characterCard?.data?.langTranslation?.[targetLang];
|
|
7488
|
+
if (agentCard.lang === targetLang) {
|
|
7489
|
+
this.onStartConversation.emit(agentCard);
|
|
7305
7490
|
}
|
|
7306
7491
|
else if (translation) {
|
|
7307
|
-
const transformedCard = this.transformToLanguage(
|
|
7492
|
+
const transformedCard = this.transformToLanguage(agentCard, targetLang);
|
|
7308
7493
|
this.onStartConversation.emit(transformedCard);
|
|
7309
7494
|
}
|
|
7310
7495
|
else {
|
|
7311
|
-
this.onStartConversation.emit(
|
|
7496
|
+
this.onStartConversation.emit(agentCard);
|
|
7312
7497
|
}
|
|
7313
7498
|
}
|
|
7314
7499
|
toggleInfoLayer() {
|
|
7315
7500
|
this.showInfoLayer.update((value) => !value);
|
|
7316
7501
|
}
|
|
7317
7502
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcAgentCardDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7318
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: DcAgentCardDetailsComponent, isStandalone: true, selector: "dc-agent-card-details", inputs: { agentCardId: "agentCardId" }, outputs: { onStartConversation: "onStartConversation" }, viewQueries: [{ propertyName: "videoPlayer", first: true, predicate: ["videoPlayer"], descendants: true }], ngImport: i0, template: "<div style=\"display: flex; justify-content: center; align-items: center\">\n <p-card>\n <div class=\"card-container\">\n <img class=\"card-image\" [src]=\"agentCard()?.assets?.image?.url\" alt=\"\" />\n <!-- This video is affected by Plyr i set by default background transparent -->\n <video #videoPlayer class=\"card-image\"></video>\n\n <div class=\"info-button\" (click)=\"toggleInfoLayer()\">\n <p-button icon=\"pi pi-arrow-down-left\" [rounded]=\"true\" [raised]=\"true\" severity=\"primary\" [outlined]=\"true\" />\n </div>\n\n @if(!chatMonitorService.isConversationActive()) {\n <div style=\"position: absolute; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 3\">\n <p-button\n size=\"large\"\n [label]=\"'dataclouder.agentCards.dcAgentCardDetails.startConversation' | translate\"\n [rounded]=\"true\"\n (click)=\"startConversation()\" />\n </div>\n }\n\n <div class=\"info-layer\" [class.active]=\"showInfoLayer()\">\n <div class=\"info-content\">\n <h1\n ><strong>{{ agentCard()?.name }}</strong></h1\n >\n <p>{{ agentCard()?.characterCard?.data?.name }}</p>\n\n @if (agentCard()?.characterCard?.data?.scenario) {\n <div class=\"scenario\">\n <h4>{{ 'dataclouder.agentCards.dcAgentCardDetails.scenario' | translate }}</h4>\n <p>{{ agentCard()?.characterCard?.data?.scenario | parseCard : agentCard() }}</p>\n </div>\n }\n </div>\n </div>\n </div>\n </p-card>\n</div>\n", styles: ["::ng-deep .p-card{width:420px;height:700px}::ng-deep .p-card .p-card-body{width:100%;height:100%}.card-image{height:100%;width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}::ng-deep .plyr--full-ui{width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}.info-button{position:absolute;top:15px;right:15px;z-index:3}.info-button:hover{transform:scale(1.1)}.info-layer{height:100%;width:100%;position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;z-index:2;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:#ed122833;color:#fff;opacity:1;clip-path:circle(0% at top right);transition:clip-path .5s cubic-bezier(.25,1,.5,1);pointer-events:none}.info-layer.active{clip-path:circle(150% at top right);pointer-events:auto}.info-content{padding:15px;text-align:center;max-width:90%}.info-content h1{margin-top:0;font-size:18px;margin-bottom:10px}.info-content p{font-size:12px;margin:0}::ng-deep .info-button .p-button{background-color:#ffffff47}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i2$8.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: ParseCardPipe, name: "parseCard" }, { kind: "pipe", type: i3$6.TranslatePipe, name: "translate" }] }); }
|
|
7503
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: DcAgentCardDetailsComponent, isStandalone: true, selector: "dc-agent-card-details", inputs: { agentCardId: "agentCardId", useNativePlayer: "useNativePlayer" }, outputs: { onStartConversation: "onStartConversation" }, viewQueries: [{ propertyName: "videoPlayer", first: true, predicate: ["videoPlayer"], descendants: true }], ngImport: i0, template: "<div style=\"display: flex; justify-content: center; align-items: center\">\n <p-card>\n <div class=\"card-container\">\n <img class=\"card-image\" [src]=\"agentCard()?.assets?.image?.url\" alt=\"\" />\n <!-- This video is affected by Plyr i set by default background transparent -->\n <video #videoPlayer class=\"card-image\"></video>\n\n <div class=\"info-button\" (click)=\"toggleInfoLayer()\">\n <p-button icon=\"pi pi-arrow-down-left\" [rounded]=\"true\" [raised]=\"true\" severity=\"primary\" [outlined]=\"true\" />\n </div>\n\n @if(!chatMonitorService.isConversationActive()) {\n <div style=\"position: absolute; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 3\">\n <p-button\n size=\"large\"\n [label]=\"'dataclouder.agentCards.dcAgentCardDetails.startConversation' | translate\"\n [rounded]=\"true\"\n (click)=\"startConversation()\" />\n </div>\n }\n\n <div class=\"info-layer\" [class.active]=\"showInfoLayer()\">\n <div class=\"info-content\">\n <h1\n ><strong>{{ agentCard()?.name }}</strong></h1\n >\n <p>{{ agentCard()?.characterCard?.data?.name }}</p>\n\n @if (agentCard()?.characterCard?.data?.scenario) {\n <div class=\"scenario\">\n <h4>{{ 'dataclouder.agentCards.dcAgentCardDetails.scenario' | translate }}</h4>\n <p>{{ agentCard()?.characterCard?.data?.scenario | parseCard : agentCard() }}</p>\n </div>\n }\n </div>\n </div>\n </div>\n </p-card>\n</div>\n", styles: ["::ng-deep .p-card{width:420px;height:700px}::ng-deep .p-card .p-card-body{width:100%;height:100%}.card-image{height:100%;width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}::ng-deep .plyr--full-ui{width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}.info-button{position:absolute;top:15px;right:15px;z-index:3}.info-button:hover{transform:scale(1.1)}.info-layer{height:100%;width:100%;position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;z-index:2;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:#ed122833;color:#fff;opacity:1;clip-path:circle(0% at top right);transition:clip-path .5s cubic-bezier(.25,1,.5,1);pointer-events:none}.info-layer.active{clip-path:circle(150% at top right);pointer-events:auto}.info-content{padding:15px;text-align:center;max-width:90%}.info-content h1{margin-top:0;font-size:18px;margin-bottom:10px}.info-content p{font-size:12px;margin:0}::ng-deep .info-button .p-button{background-color:#ffffff47}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i2$8.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: ParseCardPipe, name: "parseCard" }, { kind: "pipe", type: i3$6.TranslatePipe, name: "translate" }] }); }
|
|
7319
7504
|
}
|
|
7320
7505
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcAgentCardDetailsComponent, decorators: [{
|
|
7321
7506
|
type: Component,
|
|
7322
7507
|
args: [{ selector: 'dc-agent-card-details', standalone: true, imports: [ButtonModule, CardModule, ParseCardPipe, TranslateModule], template: "<div style=\"display: flex; justify-content: center; align-items: center\">\n <p-card>\n <div class=\"card-container\">\n <img class=\"card-image\" [src]=\"agentCard()?.assets?.image?.url\" alt=\"\" />\n <!-- This video is affected by Plyr i set by default background transparent -->\n <video #videoPlayer class=\"card-image\"></video>\n\n <div class=\"info-button\" (click)=\"toggleInfoLayer()\">\n <p-button icon=\"pi pi-arrow-down-left\" [rounded]=\"true\" [raised]=\"true\" severity=\"primary\" [outlined]=\"true\" />\n </div>\n\n @if(!chatMonitorService.isConversationActive()) {\n <div style=\"position: absolute; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 3\">\n <p-button\n size=\"large\"\n [label]=\"'dataclouder.agentCards.dcAgentCardDetails.startConversation' | translate\"\n [rounded]=\"true\"\n (click)=\"startConversation()\" />\n </div>\n }\n\n <div class=\"info-layer\" [class.active]=\"showInfoLayer()\">\n <div class=\"info-content\">\n <h1\n ><strong>{{ agentCard()?.name }}</strong></h1\n >\n <p>{{ agentCard()?.characterCard?.data?.name }}</p>\n\n @if (agentCard()?.characterCard?.data?.scenario) {\n <div class=\"scenario\">\n <h4>{{ 'dataclouder.agentCards.dcAgentCardDetails.scenario' | translate }}</h4>\n <p>{{ agentCard()?.characterCard?.data?.scenario | parseCard : agentCard() }}</p>\n </div>\n }\n </div>\n </div>\n </div>\n </p-card>\n</div>\n", styles: ["::ng-deep .p-card{width:420px;height:700px}::ng-deep .p-card .p-card-body{width:100%;height:100%}.card-image{height:100%;width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}::ng-deep .plyr--full-ui{width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}.info-button{position:absolute;top:15px;right:15px;z-index:3}.info-button:hover{transform:scale(1.1)}.info-layer{height:100%;width:100%;position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;z-index:2;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:#ed122833;color:#fff;opacity:1;clip-path:circle(0% at top right);transition:clip-path .5s cubic-bezier(.25,1,.5,1);pointer-events:none}.info-layer.active{clip-path:circle(150% at top right);pointer-events:auto}.info-content{padding:15px;text-align:center;max-width:90%}.info-content h1{margin-top:0;font-size:18px;margin-bottom:10px}.info-content p{font-size:12px;margin:0}::ng-deep .info-button .p-button{background-color:#ffffff47}\n"] }]
|
|
7323
7508
|
}], ctorParameters: () => [], propDecorators: { agentCardId: [{
|
|
7324
7509
|
type: Input
|
|
7510
|
+
}], useNativePlayer: [{
|
|
7511
|
+
type: Input
|
|
7325
7512
|
}], videoPlayer: [{
|
|
7326
7513
|
type: ViewChild,
|
|
7327
7514
|
args: ['videoPlayer']
|
|
@@ -7687,5 +7874,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
7687
7874
|
* Generated bundle index. Do not edit.
|
|
7688
7875
|
*/
|
|
7689
7876
|
|
|
7690
|
-
export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationFlowStateService, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
|
|
7877
|
+
export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationFlowStateService, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerNativeService, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
|
|
7691
7878
|
//# sourceMappingURL=dataclouder-ngx-agent-cards.mjs.map
|