@seniorsistemas/angular-components 17.26.9-bugfix-sds-309-85a29221 → 17.26.9-bugfix-sds-305-32cf1ca4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/bundles/seniorsistemas-angular-components.umd.js +86 -123
  2. package/bundles/seniorsistemas-angular-components.umd.js.map +1 -1
  3. package/bundles/seniorsistemas-angular-components.umd.min.js +1 -1
  4. package/bundles/seniorsistemas-angular-components.umd.min.js.map +1 -1
  5. package/components/speech-recognition/speech-recognition/speech-recognition.component.d.ts +2 -5
  6. package/components/speech-recognition/speech-recognition.service.d.ts +2 -3
  7. package/components/text-area/text-area/text-area.component.d.ts +3 -1
  8. package/esm2015/components/bignumber-input/bignumber-input.directive.js +6 -5
  9. package/esm2015/components/locale/locale.service.js +8 -2
  10. package/esm2015/components/speech-recognition/speech-recognition/speech-recognition.component.js +20 -38
  11. package/esm2015/components/speech-recognition/speech-recognition.service.js +22 -41
  12. package/esm2015/components/speech-recognition/text-to-speech.service.js +1 -1
  13. package/esm2015/components/text-area/text-area/text-area.component.js +14 -3
  14. package/esm5/components/bignumber-input/bignumber-input.directive.js +6 -5
  15. package/esm5/components/locale/locale.service.js +8 -2
  16. package/esm5/components/speech-recognition/speech-recognition/speech-recognition.component.js +19 -43
  17. package/esm5/components/speech-recognition/speech-recognition.service.js +46 -78
  18. package/esm5/components/speech-recognition/text-to-speech.service.js +1 -1
  19. package/esm5/components/text-area/text-area/text-area.component.js +18 -3
  20. package/fesm2015/seniorsistemas-angular-components.js +61 -83
  21. package/fesm2015/seniorsistemas-angular-components.js.map +1 -1
  22. package/fesm5/seniorsistemas-angular-components.js +88 -125
  23. package/fesm5/seniorsistemas-angular-components.js.map +1 -1
  24. package/package.json +1 -1
  25. package/seniorsistemas-angular-components.metadata.json +1 -1
@@ -1420,8 +1420,11 @@
1420
1420
  { type: http.HttpClient },
1421
1421
  { type: ngxCookieService.CookieService }
1422
1422
  ]; };
1423
+ LocaleService.ɵprov = core["ɵɵdefineInjectable"]({ factory: function LocaleService_Factory() { return new LocaleService(core["ɵɵinject"](http.HttpClient), core["ɵɵinject"](ngxCookieService.CookieService)); }, token: LocaleService, providedIn: "root" });
1423
1424
  LocaleService = __decorate([
1424
- core.Injectable()
1425
+ core.Injectable({
1426
+ providedIn: "root"
1427
+ })
1425
1428
  ], LocaleService);
1426
1429
  return LocaleService;
1427
1430
  }());
@@ -2085,7 +2088,7 @@
2085
2088
  var BignumberInputDirective_1;
2086
2089
  BignumberInputDirective.ctorParameters = function () { return [
2087
2090
  { type: core.Injector },
2088
- { type: LocaleService }
2091
+ { type: LocaleService, decorators: [{ type: core.Inject, args: [LocaleService,] }] }
2089
2092
  ]; };
2090
2093
  __decorate([
2091
2094
  core.Input()
@@ -2131,7 +2134,8 @@
2131
2134
  multi: true,
2132
2135
  },
2133
2136
  ],
2134
- })
2137
+ }),
2138
+ __param(1, core.Inject(LocaleService))
2135
2139
  ], BignumberInputDirective);
2136
2140
  return BignumberInputDirective;
2137
2141
  }(ng2CurrencyMask.CurrencyMaskDirective));
@@ -11504,8 +11508,9 @@
11504
11508
  this.translateService = translateService;
11505
11509
  this.hasSupportSpeechRecognition = false;
11506
11510
  this.isListening = false;
11507
- this.microphoneStatus$ = new rxjs.Subject();
11511
+ this.hasMicrophoneAccess = false;
11508
11512
  this.TIMEOUT_NO_MESSAGE = 3000;
11513
+ this.verifyMicrophoneState();
11509
11514
  this.setRecognition();
11510
11515
  }
11511
11516
  SpeechRecognitionService.prototype.listen = function () {
@@ -11514,73 +11519,82 @@
11514
11519
  if (this.isListening) {
11515
11520
  speechSubject.error('Already listening');
11516
11521
  }
11517
- this.hasMicrophoneAccess.then(function (hasAccess) {
11518
- if (!hasAccess) {
11519
- _this.toastService.show({ severity: 'error', text: _this.translateService.instant('platform.angular_components.no_microphone_permission') });
11520
- speechSubject.error('Microphone access is disabled');
11521
- return;
11522
- }
11523
- _this.microphoneStatus$.next('active');
11524
- _this.isListening = true;
11525
- _this.recognition.continuous = true;
11526
- _this.recognition.interimResults = true;
11527
- _this.recognition.maxAlternatives = 1;
11528
- var silenceTimer;
11529
- var restartSilenceTimer = function () {
11530
- if (silenceTimer !== undefined) {
11531
- clearTimeout(silenceTimer);
11522
+ else if (!this.hasMicrophoneAccess) {
11523
+ this.isListening = false;
11524
+ this.toastService.show({ severity: 'error', text: this.translateService.instant('platform.angular_components.no_microphone_permission') });
11525
+ speechSubject.error('Microphone access is disabled');
11526
+ }
11527
+ else {
11528
+ this.isListening = true;
11529
+ this.recognition.continuous = true;
11530
+ this.recognition.interimResults = true;
11531
+ this.recognition.maxAlternatives = 1;
11532
+ var silenceTimer_1;
11533
+ var restartSilenceTimer_1 = function () {
11534
+ if (silenceTimer_1 !== undefined) {
11535
+ clearTimeout(silenceTimer_1);
11532
11536
  }
11533
- silenceTimer = setTimeout(function () {
11537
+ silenceTimer_1 = setTimeout(function () {
11534
11538
  _this.recognition.stop();
11535
11539
  }, _this.TIMEOUT_NO_MESSAGE);
11536
11540
  };
11537
- var fullTranscript = '';
11538
- var interimTranscript = '';
11539
- _this.recognition.onresult = function (event) {
11541
+ var fullTranscript_1 = '';
11542
+ var interimTranscript_1 = '';
11543
+ this.recognition.onresult = function (event) {
11540
11544
  _this.ngZone.run(function () {
11541
- restartSilenceTimer();
11545
+ restartSilenceTimer_1();
11542
11546
  var interimTranscript = '';
11543
11547
  for (var i = event.resultIndex; i < event.results.length; ++i) {
11544
11548
  var transcript = event.results[i][0].transcript;
11545
11549
  if (event.results[i].isFinal) {
11546
- fullTranscript += transcript + '\n';
11550
+ fullTranscript_1 += transcript + '\n';
11547
11551
  }
11548
11552
  else {
11549
11553
  interimTranscript += transcript;
11550
11554
  }
11551
11555
  }
11552
11556
  interimTranscript = interimTranscript;
11553
- speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: false });
11557
+ speechSubject.next({ text: fullTranscript_1 + interimTranscript, isFinal: false });
11554
11558
  });
11555
11559
  };
11556
- _this.recognition.onerror = function () {
11560
+ this.recognition.onerror = function () {
11557
11561
  _this.ngZone.run(function () {
11558
- if (silenceTimer !== undefined) {
11559
- clearTimeout(silenceTimer);
11562
+ if (silenceTimer_1 !== undefined) {
11563
+ clearTimeout(silenceTimer_1);
11560
11564
  }
11561
11565
  _this.isListening = false;
11562
11566
  speechSubject.error('Speech recognition error');
11563
- _this.microphoneStatus$.next('inactive');
11564
11567
  });
11565
11568
  };
11566
- _this.recognition.onend = function () {
11569
+ this.recognition.onend = function () {
11567
11570
  _this.ngZone.run(function () {
11568
- if (silenceTimer !== undefined) {
11569
- clearTimeout(silenceTimer);
11571
+ if (silenceTimer_1 !== undefined) {
11572
+ clearTimeout(silenceTimer_1);
11570
11573
  }
11571
- speechSubject.next({ text: fullTranscript + interimTranscript, isFinal: true });
11574
+ speechSubject.next({ text: fullTranscript_1 + interimTranscript_1, isFinal: true });
11572
11575
  _this.isListening = false;
11573
11576
  speechSubject.complete();
11574
- _this.microphoneStatus$.next('inactive');
11575
11577
  });
11576
11578
  };
11577
- _this.recognition.start();
11578
- });
11579
+ this.recognition.start();
11580
+ }
11579
11581
  return speechSubject;
11580
11582
  };
11581
11583
  SpeechRecognitionService.prototype.stop = function () {
11582
11584
  this.recognition.stop();
11583
11585
  };
11586
+ SpeechRecognitionService.prototype.verifyMicrophoneState = function () {
11587
+ var _this = this;
11588
+ navigator.permissions.query({ name: 'microphone' }).then(function (result) {
11589
+ var microphoneResultState = result.state;
11590
+ _this.hasMicrophoneAccess = microphoneResultState === 'granted';
11591
+ result.onchange = function () {
11592
+ _this.ngZone.run(function () {
11593
+ _this.hasMicrophoneAccess = result.state === 'granted';
11594
+ });
11595
+ };
11596
+ });
11597
+ };
11584
11598
  SpeechRecognitionService.prototype.setRecognition = function () {
11585
11599
  var _this = this;
11586
11600
  var _a;
@@ -11596,48 +11610,6 @@
11596
11610
  this.recognition.maxAlternatives = 1;
11597
11611
  this.localeService.getLocale().subscribe(function (locale) { return _this.recognition.lang = locale; });
11598
11612
  };
11599
- Object.defineProperty(SpeechRecognitionService.prototype, "hasMicrophoneAccess", {
11600
- get: function () {
11601
- var _this = this;
11602
- return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
11603
- var permission;
11604
- var _this = this;
11605
- return __generator(this, function (_a) {
11606
- switch (_a.label) {
11607
- case 0: return [4 /*yield*/, navigator.permissions.query({ name: 'microphone' })];
11608
- case 1:
11609
- permission = _a.sent();
11610
- if (permission.state === 'denied') {
11611
- resolve(false);
11612
- }
11613
- else if (permission.state === 'granted') {
11614
- resolve(true);
11615
- }
11616
- else if (permission.state === 'prompt') {
11617
- try {
11618
- navigator.mediaDevices.getUserMedia({ audio: true }).then(function (stream) {
11619
- stream.getTracks().forEach(function (t) { return t.stop(); });
11620
- }).catch(function () {
11621
- resolve(false);
11622
- });
11623
- permission.onchange = function () {
11624
- _this.ngZone.run(function () {
11625
- resolve(permission.state === 'granted' ? true : false);
11626
- });
11627
- };
11628
- }
11629
- catch (error) {
11630
- resolve(false);
11631
- }
11632
- }
11633
- return [2 /*return*/];
11634
- }
11635
- });
11636
- }); });
11637
- },
11638
- enumerable: true,
11639
- configurable: true
11640
- });
11641
11613
  SpeechRecognitionService.ctorParameters = function () { return [
11642
11614
  { type: LocaleService },
11643
11615
  { type: core.NgZone },
@@ -13655,6 +13627,21 @@
13655
13627
  enumerable: true,
13656
13628
  configurable: true
13657
13629
  });
13630
+ Object.defineProperty(TextAreaComponent.prototype, "placeholder", {
13631
+ get: function () {
13632
+ return this._placeholder;
13633
+ },
13634
+ set: function (value) {
13635
+ if (value) {
13636
+ this._placeholder = value;
13637
+ }
13638
+ else {
13639
+ this._placeholder = '';
13640
+ }
13641
+ },
13642
+ enumerable: true,
13643
+ configurable: true
13644
+ });
13658
13645
  Object.defineProperty(TextAreaComponent.prototype, "inputStyle", {
13659
13646
  get: function () {
13660
13647
  return this._inputStyle;
@@ -13719,7 +13706,7 @@
13719
13706
  ], TextAreaComponent.prototype, "maxLength", void 0);
13720
13707
  __decorate([
13721
13708
  core.Input()
13722
- ], TextAreaComponent.prototype, "placeholder", void 0);
13709
+ ], TextAreaComponent.prototype, "placeholder", null);
13723
13710
  __decorate([
13724
13711
  core.Input()
13725
13712
  ], TextAreaComponent.prototype, "inputStyle", null);
@@ -13729,7 +13716,7 @@
13729
13716
  TextAreaComponent = TextAreaComponent_1 = __decorate([
13730
13717
  core.Component({
13731
13718
  selector: 's-textarea',
13732
- template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder ? placeholder : ''\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<textarea\n *ngIf=\"!keyFilter\"\n #textArea\n class=\"textarea\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder ? placeholder : ''\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<s-speech-recognition\n *ngIf=\"speechRecognition && renderTextArea\"\n [textAreaElement]=\"textAreaElement.nativeElement\"\n [keepContext]=\"keepContext\"\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\n (recognizedText)=\"handleRecognizedText($event)\">\n</s-speech-recognition>\n",
13719
+ template: "<textarea\n *ngIf=\"keyFilter\"\n #textArea\n class=\"textarea\"\n [pKeyFilter]=\"keyFilter\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<textarea\n *ngIf=\"!keyFilter\"\n #textArea\n class=\"textarea\"\n [id]=\"inputId\"\n [rows]=\"rows\"\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [ngStyle]=\"inputStyle\"\n [readOnly]=\"readOnly\"\n [placeholder]=\"placeholder\"\n [maxlength]=\"maxLength\"\n (ngModelChange)=\"setValue($event)\">\n</textarea>\n\n<s-speech-recognition\n *ngIf=\"speechRecognition && renderTextArea\"\n [textAreaElement]=\"textAreaElement.nativeElement\"\n [keepContext]=\"keepContext\"\n [speechRecognitionPlaceholder]=\"speechRecognitionPlaceholder\"\n (recognizedText)=\"handleRecognizedText($event)\">\n</s-speech-recognition>\n",
13733
13720
  providers: [
13734
13721
  {
13735
13722
  provide: forms.NG_VALUE_ACCESSOR,
@@ -13839,7 +13826,7 @@
13839
13826
  this.speechRecognitionPlaceholder = '';
13840
13827
  this._recognizedText = '';
13841
13828
  this.originalTextAreaElementText = '';
13842
- this.isDoneTextToSpeech = false;
13829
+ this.isDoneSpeaking = false;
13843
13830
  this.onDestroy$ = new rxjs.Subject();
13844
13831
  this.VOICE_SPEEDS = [0.5, 1, 1.5, 2];
13845
13832
  this.keydownEventListener = function (event) {
@@ -13848,7 +13835,7 @@
13848
13835
  }
13849
13836
  };
13850
13837
  this.disabled = false;
13851
- this.isListeningUserVoice = false;
13838
+ this.isSpeaking = false;
13852
13839
  this.voiceSpeed = 1;
13853
13840
  this.isDisabledMicrophone = false;
13854
13841
  this.canRenderMicrophone = true;
@@ -13860,9 +13847,7 @@
13860
13847
  this.isPlayingTextToSpeech = false;
13861
13848
  this.recognizedText = new core.EventEmitter();
13862
13849
  }
13863
- SpeechRecognitionComponent_1 = SpeechRecognitionComponent;
13864
13850
  SpeechRecognitionComponent.prototype.ngOnInit = function () {
13865
- var _this = this;
13866
13851
  if (!this.hasSpeechRecognitionBrowserApi) {
13867
13852
  return;
13868
13853
  }
@@ -13871,26 +13856,18 @@
13871
13856
  }
13872
13857
  this.textAreaElement.placeholder = this.speechRecognitionPlaceholder ? this.speechRecognitionPlaceholder : this.translateService.instant("platform.angular_components.text_area_speech_recognition_placeholder");
13873
13858
  this.textAreaElement.addEventListener('keydown', this.keydownEventListener);
13874
- this.speechRecognitionService.microphoneStatus$.pipe(operators.takeUntil(this.onDestroy$)).subscribe(function (status) {
13875
- if (status === 'active') {
13876
- _this.onCloseToolbar();
13877
- }
13878
- });
13879
13859
  };
13880
13860
  SpeechRecognitionComponent.prototype.onListen = function () {
13881
13861
  var _this = this;
13882
13862
  if (this.isDisabledMicrophone || this.isListening) {
13883
13863
  return;
13884
13864
  }
13885
- // if (this.isPlayingTextToSpeech) {
13886
- // this.onCloseToolbar();
13887
- // }
13888
13865
  this.disabled = true;
13889
13866
  this.canRenderMicrophone = false;
13890
13867
  this.canRenderListeningText = true;
13891
13868
  this.originalTextAreaElementText = this.textAreaElement.value;
13892
13869
  this.textAreaElement.value = '';
13893
- this.isListeningUserVoice = true;
13870
+ this.isSpeaking = true;
13894
13871
  this.speechRecognitionService.listen()
13895
13872
  .pipe(operators.takeUntil(this.onDestroy$))
13896
13873
  .subscribe(function (_a) {
@@ -13902,10 +13879,10 @@
13902
13879
  _this.canRenderAprove = true;
13903
13880
  _this.canRenderDiscard = true;
13904
13881
  _this.canRenderListeningText = false;
13905
- _this.isListeningUserVoice = false;
13882
+ _this.isSpeaking = false;
13906
13883
  }
13907
13884
  }, function () {
13908
- _this.isListeningUserVoice = false;
13885
+ _this.isSpeaking = false;
13909
13886
  _this.canRenderMicrophone = true;
13910
13887
  _this.isDisabledMicrophone = false;
13911
13888
  _this.canRenderListeningText = false;
@@ -13924,15 +13901,15 @@
13924
13901
  }
13925
13902
  this.canRenderTextToSpeechToolbar = true;
13926
13903
  this.canRenderTextToSpeech = false;
13927
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = true;
13904
+ this.isPlayingTextToSpeech = true;
13928
13905
  this.speak();
13929
13906
  };
13930
13907
  SpeechRecognitionComponent.prototype.onCloseToolbar = function () {
13931
13908
  this.canRenderTextToSpeechToolbar = false;
13932
13909
  this.canRenderTextToSpeech = true;
13933
- this.stopTextToSpeech();
13910
+ this.isPlayingTextToSpeech = false;
13911
+ this.textToSpeechService.cancel();
13934
13912
  this.voiceSpeed = 1;
13935
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
13936
13913
  };
13937
13914
  SpeechRecognitionComponent.prototype.onDiscard = function () {
13938
13915
  this.canRenderAprove = false;
@@ -13943,8 +13920,7 @@
13943
13920
  this._recognizedText = '';
13944
13921
  this.setTextAreaValue(this.originalTextAreaElementText);
13945
13922
  this.disabled = false;
13946
- this.stopTextToSpeech();
13947
- SpeechRecognitionComponent_1.TOOLBAR_ACTIVE = false;
13923
+ this.textToSpeechService.cancel();
13948
13924
  };
13949
13925
  SpeechRecognitionComponent.prototype.onAprove = function () {
13950
13926
  this.canRenderAprove = false;
@@ -13974,7 +13950,7 @@
13974
13950
  this.textToSpeechService.pause();
13975
13951
  }
13976
13952
  else {
13977
- if (this.isDoneTextToSpeech) {
13953
+ if (this.isDoneSpeaking) {
13978
13954
  this.speak();
13979
13955
  }
13980
13956
  else {
@@ -13984,6 +13960,7 @@
13984
13960
  this.isPlayingTextToSpeech = !this.isPlayingTextToSpeech;
13985
13961
  };
13986
13962
  SpeechRecognitionComponent.prototype.restartTextToSpeech = function () {
13963
+ this.isPlayingTextToSpeech = true;
13987
13964
  this.textToSpeechService.cancel();
13988
13965
  this.speak();
13989
13966
  };
@@ -14014,7 +13991,7 @@
14014
13991
  Object.defineProperty(SpeechRecognitionComponent.prototype, "isDisabledTextToSpeech", {
14015
13992
  get: function () {
14016
13993
  var hasTextToSpeechVoice = this.textToSpeechService.hasVoice;
14017
- return !this.textToSpeech || !hasTextToSpeechVoice || this.isListening || SpeechRecognitionComponent_1.TOOLBAR_ACTIVE;
13994
+ return !this._recognizedText || !hasTextToSpeechVoice || this.isListening;
14018
13995
  },
14019
13996
  enumerable: true,
14020
13997
  configurable: true
@@ -14022,28 +13999,14 @@
14022
13999
  SpeechRecognitionComponent.prototype.setTextAreaValue = function (value) {
14023
14000
  this.textAreaElement.value = value;
14024
14001
  };
14025
- SpeechRecognitionComponent.prototype.stopTextToSpeech = function () {
14026
- this.isPlayingTextToSpeech = false;
14027
- this.textToSpeechService.cancel();
14028
- };
14029
14002
  SpeechRecognitionComponent.prototype.speak = function () {
14030
14003
  var _this = this;
14031
- this.isDoneTextToSpeech = false;
14032
- this.isPlayingTextToSpeech = true;
14033
- this.textToSpeechService.speak(this.textToSpeech, this.voiceSpeed).then(function () {
14004
+ this.isDoneSpeaking = false;
14005
+ this.textToSpeechService.speak(this._recognizedText, this.voiceSpeed).then(function () {
14034
14006
  _this.isPlayingTextToSpeech = false;
14035
- _this.isDoneTextToSpeech = true;
14007
+ _this.isDoneSpeaking = true;
14036
14008
  });
14037
14009
  };
14038
- Object.defineProperty(SpeechRecognitionComponent.prototype, "textToSpeech", {
14039
- get: function () {
14040
- return this.textAreaElement.value;
14041
- },
14042
- enumerable: true,
14043
- configurable: true
14044
- });
14045
- var SpeechRecognitionComponent_1;
14046
- SpeechRecognitionComponent.TOOLBAR_ACTIVE = false;
14047
14010
  SpeechRecognitionComponent.ctorParameters = function () { return [
14048
14011
  { type: SpeechRecognitionService },
14049
14012
  { type: TextToSpeechService },
@@ -14061,11 +14024,11 @@
14061
14024
  __decorate([
14062
14025
  core.Output()
14063
14026
  ], SpeechRecognitionComponent.prototype, "recognizedText", void 0);
14064
- SpeechRecognitionComponent = SpeechRecognitionComponent_1 = __decorate([
14027
+ SpeechRecognitionComponent = __decorate([
14065
14028
  core.Component({
14066
14029
  selector: 's-speech-recognition',
14067
- template: "<section class=\"speech-recognition\" *ngIf=\"hasSpeechRecognitionBrowserApi\">\n <div class=\"speech-recognition-text\">\n <ng-container *ngIf=\"canRenderMicrophone\">\n {{ 'platform.angular_components.text_area_before_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"isListeningUserVoice\">\n {{ 'platform.angular_components.text_area_while_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"canRenderAprove && canRenderDiscard\">\n {{ 'platform.angular_components.text_area_end_speech' | translate }}\n </ng-container>\n </div>\n <div class=\"speech-recognition-buttons\">\n <span\n *ngIf=\"canRenderListeningText\"\n (click)=\"stopListening()\"\n class=\"speech-recognition-item speech-recognition-item-regular\">\n <i class=\"far fa-ellipsis-h\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderMicrophone\"\n (click)=\"onListen()\"\n class=\"speech-recognition-item speech-recognition-item-microphone\"\n [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n <i class=\"fas fa-microphone\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderAprove\"\n (click)=\"onAprove()\"\n class=\"speech-recognition-item speech-recognition-item-aprove\">\n <i class=\"fas fa-check\"></i>\n </span>\n\n <span *ngIf=\"canRenderDiscard\"\n (click)=\"onDiscard()\"\n class=\"speech-recognition-item speech-recognition-item-discard\">\n <i class=\"fas fa-times\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeech\"\n (click)=\"onOpenToolbar()\"\n class=\"speech-recognition-item speech-recognition-item-regular\"\n [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n <i class=\"fas fa-volume-down\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeechToolbar\"\n class=\"speech-recognition-item-toolbar\">\n <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n (click)=\"toggleTextToSpeech()\"></i>\n <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n <span (click)=\"updateVoiceSpeed()\">\n {{ voiceSpeed }}x\n </span>\n <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n </span>\n </div>\n</section>\n",
14068
- styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between;width:100%}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff;height:25px}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
14030
+ template: "<section class=\"speech-recognition\" *ngIf=\"hasSpeechRecognitionBrowserApi\">\n <div class=\"speech-recognition-text\">\n <ng-container *ngIf=\"canRenderMicrophone\">\n {{ 'platform.angular_components.text_area_before_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"isSpeaking\">\n {{ 'platform.angular_components.text_area_while_speech' | translate }}\n </ng-container>\n\n <ng-container *ngIf=\"canRenderAprove && canRenderDiscard\">\n {{ 'platform.angular_components.text_area_end_speech' | translate }}\n </ng-container>\n </div>\n <div class=\"speech-recognition-buttons\">\n <span\n *ngIf=\"canRenderListeningText\"\n (click)=\"stopListening()\"\n class=\"speech-recognition-item speech-recognition-item-regular\">\n <i class=\"far fa-ellipsis-h\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderMicrophone\"\n (click)=\"onListen()\"\n class=\"speech-recognition-item speech-recognition-item-microphone\"\n [class.speech-recognition-item-disabled]=\"isDisabledMicrophone || isListening || disabled\">\n <i class=\"fas fa-microphone\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderAprove\"\n (click)=\"onAprove()\"\n class=\"speech-recognition-item speech-recognition-item-aprove\">\n <i class=\"fas fa-check\"></i>\n </span>\n\n <span *ngIf=\"canRenderDiscard\"\n (click)=\"onDiscard()\"\n class=\"speech-recognition-item speech-recognition-item-discard\">\n <i class=\"fas fa-times\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeech\"\n (click)=\"onOpenToolbar()\"\n class=\"speech-recognition-item speech-recognition-item-regular\"\n [class.speech-recognition-item-disabled]=\"isDisabledTextToSpeech\">\n <i class=\"fas fa-volume-down\"></i>\n </span>\n\n <span\n *ngIf=\"canRenderTextToSpeechToolbar\"\n class=\"speech-recognition-item-toolbar\">\n <i class=\"fas\" [class.fa-pause]=\"isPlayingTextToSpeech\" [class.fa-play]=\"!isPlayingTextToSpeech\"\n (click)=\"toggleTextToSpeech()\"></i>\n <i class=\"fas fa-backward\" (click)=\"restartTextToSpeech()\"></i>\n <span (click)=\"updateVoiceSpeed()\">\n {{ voiceSpeed }}x\n </span>\n <i class=\"fas fa-times\" (click)=\"onCloseToolbar()\"></i>\n </span>\n </div>\n</section>\n",
14031
+ styles: [".speech-recognition{display:-ms-flexbox;display:flex;gap:10px;-ms-flex-pack:justify;justify-content:space-between;width:100%}.speech-recognition-buttons{display:-ms-flexbox;display:flex;gap:10px;position:relative;bottom:15px;margin-right:16px}.speech-recognition-item{display:-ms-inline-flexbox;display:inline-flex;height:25px;padding:4px 12px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;gap:8px;border-radius:15px;cursor:pointer;transition:background .1s ease-in}.speech-recognition-item i,.speech-recognition-item span{color:#fff}.speech-recognition-item-disabled{cursor:default!important}.speech-recognition-item-disabled *{opacity:.5}.speech-recognition-item-microphone{background:#428bca}.speech-recognition-item-microphone:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-regular{background:#7892a1}.speech-recognition-item-regular:not(.speech-recognition-item-disabled):hover{background:#697882}.speech-recognition-item-aprove{background:#0c9348}.speech-recognition-item-aprove:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-discard{background:#c13018}.speech-recognition-item-discard:not(.speech-recognition-item-disabled):hover{background:#063951}.speech-recognition-item-toolbar{background:#7892a1;display:-ms-flexbox;display:flex;border-radius:15px;-ms-flex-align:center;align-items:center;color:#fff}.speech-recognition-item-toolbar i,.speech-recognition-item-toolbar span{cursor:pointer}.speech-recognition-item-toolbar i:not(:first-child),.speech-recognition-item-toolbar i:not(:last-child){padding:6px}.speech-recognition-item-toolbar i:first-child{padding-left:10px}.speech-recognition-item-toolbar i:last-child{padding-right:10px}.speech-recognition-item-toolbar span{height:25px}.speech-recognition-text{color:#212533;font-size:12px;font-style:normal;font-weight:400;word-break:break-word}"]
14069
14032
  })
14070
14033
  ], SpeechRecognitionComponent);
14071
14034
  return SpeechRecognitionComponent;