@vgroup/dialbox 0.0.7 → 0.0.9

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.
@@ -1,19 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
3
3
  import { AsYouType } from 'libphonenumber-js';
4
- import { BehaviorSubject, throwError, Subscription, interval } from 'rxjs';
4
+ import { BehaviorSubject, throwError, interval, Subscription } from 'rxjs';
5
5
  import * as i1 from '@angular/common/http';
6
6
  import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
7
7
  import { catchError, switchMap, map } from 'rxjs/operators';
8
8
  import * as i4 from '@angular/router';
9
9
  import { RouterLink } from '@angular/router';
10
- import * as i5 from '@angular/common';
10
+ import * as i3 from '@angular/common';
11
11
  import { CommonModule } from '@angular/common';
12
- import * as i6 from '@angular/forms';
12
+ import * as i3$1 from '@angular/forms';
13
13
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
14
14
  import { Device } from '@twilio/voice-sdk';
15
15
  import swal from 'sweetalert2';
16
- import * as i3 from '@angular/material/dialog';
16
+ import * as i3$2 from '@angular/material/dialog';
17
17
  import { MAT_DIALOG_DATA } from '@angular/material/dialog';
18
18
 
19
19
  const keypad = [
@@ -1417,1579 +1417,1579 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1417
1417
  }]
1418
1418
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: IpAddressService }]; } });
1419
1419
 
1420
- class DialboxComponent {
1421
- constructor(twilioService, extService,
1422
- // private dialog: MatDialog,
1423
- ipService, extensionService, router) {
1424
- this.twilioService = twilioService;
1425
- this.extService = extService;
1426
- this.ipService = ipService;
1420
+ const GlobalConstant = {
1421
+ ErrorMsg500: "Unable to process request. Please try again later.",
1422
+ isSMSVisible: true,
1423
+ dedicatedNumText: 'C2C Number'
1424
+ };
1425
+
1426
+ class IncomingCallComponent {
1427
+ constructor(extensionService, twilioService) {
1427
1428
  this.extensionService = extensionService;
1428
- this.router = router;
1429
- this.isDialpadHidden = false;
1430
- this.closeDialpadEvent = new EventEmitter();
1431
- this.callInitiated = new EventEmitter();
1432
- this.endCallEvent = new EventEmitter();
1433
- this.minimiseEvent = new EventEmitter();
1434
- this.incomingCallsNewInfoEvent = new EventEmitter();
1435
- this.incomingCallInitiated = new EventEmitter();
1436
- this.numberDialed = new EventEmitter();
1437
- this.isCallInProgress = false;
1438
- this.keypadVal = keypad;
1439
- this.showInputClearBtn = false;
1440
- this.dialedNumber = '';
1441
- this.contactList = [];
1442
- this.filteredContactList = [];
1443
- this.callerIdList = [];
1444
- this.isCallerIdHidden = true;
1445
- this.isTrialPeriodOver = false;
1446
- this.isPaymentDue = false;
1447
- this.terminateCall = false;
1448
- this.toastTimeout = 7000;
1449
- this.callNumberToast = {
1450
- show: false,
1451
- type: 'alert-success',
1452
- number: '',
1453
- displayNum: ''
1454
- };
1455
- this.callData = {
1456
- phone: '',
1457
- displayNum: '',
1458
- dial: false,
1459
- name: '',
1460
- img: 'assets/images/user.jpg',
1461
- isIncomingCall: false,
1462
- extNum: ''
1463
- };
1464
- this.lastDialed = null;
1465
- this.dialAlert = {
1466
- msg: '',
1467
- show: false
1468
- };
1469
- this.showDedicatedPopup = false;
1470
- this.newIncomingCalls = [];
1471
- this.incomingCallsList = [];
1472
- this.subscriptions = new Subscription();
1473
- this.shakeDedicatedBtn = false;
1474
- this.isSmartDialCall = false;
1475
- this.isMinimised = false;
1429
+ this.twilioService = twilioService;
1430
+ this.showRingAnimation = true;
1431
+ this.selectedIncomingCall = {};
1432
+ this.twilioAuthId = '';
1433
+ this.dedicatedNum = '';
1434
+ this.recordCall = false;
1435
+ this.shouldRecordCall = false;
1436
+ this.isClickExpand = false;
1437
+ this.disbaleEndCallBtn = true;
1438
+ this.closeIncomingCallDiv = new EventEmitter();
1439
+ this.incomingCallsNewList = new EventEmitter();
1440
+ this.selectedIncomingCallInfo = new EventEmitter();
1441
+ this.isMute = false;
1476
1442
  }
1477
1443
  ngOnInit() {
1478
1444
  try {
1479
- this.token = localStorage.getItem('ext_token');
1480
- //this.isCallInProgress = true;
1481
- this.getContactList();
1482
- // this.getUserCallSetting();
1483
- const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
1484
- if (contact.number) {
1485
- this.isSmartDialCall = false;
1486
- if (contact.isDialFromHistory) {
1487
- //handle dialing from history page
1488
- if (contact.callerId == 'smartDialing') {
1489
- this.selectedCallerId = { number: contact.from };
1490
- this.isSmartDialCall = true;
1491
- setTimeout(() => {
1492
- this.isDialpadHidden = false;
1493
- }, 2000);
1494
- this.callData.phone = contact.number;
1495
- this.callData.name = contact.name;
1496
- this.callData.img = contact.img;
1497
- this.callData.from = contact.from;
1498
- this.sanitizedNum = contact.number;
1499
- // this.getUserInformation(contact);
1500
- // this.incomingCallsList.push(contact)
1501
- this.initiateCall();
1502
- }
1503
- else {
1504
- // this.getUserCallSetting();
1505
- setTimeout(() => {
1506
- this.isDialpadHidden = false;
1507
- }, 1000);
1508
- // this.getUserInformation(contact);
1509
- // this.incomingCallsList.push(contact)
1510
- this.dialedNumber = contact.number;
1511
- this.sanitizedNum = contact.number;
1512
- }
1513
- }
1514
- else {
1515
- if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
1516
- // this.getUserCallSetting();
1517
- setTimeout(() => {
1518
- this.isDialpadHidden = false;
1519
- }, 1000);
1520
- this.dialedNumber = contact.number;
1521
- this.sanitizedNum = contact.number;
1522
- }
1523
- else {
1524
- setTimeout(() => {
1525
- this.isDialpadHidden = false;
1526
- }, 2000);
1527
- this.callData.phone = contact.number;
1528
- this.callData.name = contact.name;
1529
- this.callData.img = contact.img;
1530
- this.sanitizedNum = contact.number;
1531
- this.initiateCall();
1532
- }
1533
- }
1534
- }
1535
- });
1536
- // handle incoming call
1537
- const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
1538
- // if (incomingCallData) {
1539
- // this.isCallInProgress = true;
1540
- // this.isDialpadHidden = false;
1541
- // this.callData.phone = incomingCallData.parameters.From;
1542
- // this.callData.name = incomingCallData.customParameters.get('name');
1543
- // this.callData.img = incomingCallData.customParameters.get('image');
1544
- // this.callData.isIncomingCall = true;
1545
- // }
1546
- if (incomingCallData) {
1547
- if (this.isCallInProgress) {
1548
- this.newIncomingCalls.push(incomingCallData);
1549
- // this.getUserInformation(incomingCallData);
1550
- }
1551
- else {
1552
- this.isCallInProgress = true;
1553
- this.isDialpadHidden = false;
1554
- this.callData.phone = incomingCallData.parameters['From'];
1555
- // this.getUserInformation(incomingCallData);
1556
- this.callData.name = incomingCallData.customParameters.get('name');
1557
- this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
1558
- this.callData.isIncomingCall = true;
1445
+ this.twilioService.currentCall.subscribe(call => {
1446
+ if (call) {
1447
+ this.twilioCallData = call;
1448
+ this.twilioAuthId = call.customParameters.get('twilioAuthId') || '';
1449
+ if (!call.parameters) {
1450
+ call.parameters = {};
1559
1451
  }
1560
- incomingCallData.on('cancel', () => {
1561
- // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
1562
- if (this.incomingCallsList.length == 0) {
1563
- this.isCallInProgress = false;
1452
+ this.sendIPforIncomingCall(this.twilioAuthId, '');
1453
+ call.on('cancel', () => {
1454
+ if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
1455
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
1564
1456
  }
1457
+ this.rejectCallFromList(call);
1565
1458
  });
1566
- incomingCallData.on('disconnect', () => {
1567
- // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
1568
- if (this.incomingCallsList.length == 0) {
1569
- this.isCallInProgress = false;
1459
+ call.on('disconnect', () => {
1460
+ if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
1461
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
1570
1462
  }
1463
+ this.rejectCallFromList(call);
1571
1464
  });
1572
1465
  }
1573
1466
  });
1574
- this.subscriptions.add(sub1);
1575
- this.subscriptions.add(sub2);
1576
1467
  }
1577
1468
  catch (e) {
1578
1469
  console.log(e);
1579
1470
  }
1580
1471
  }
1581
- // getUserInformation(incomingCallData: any) {
1582
- // let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
1583
- // this.extensionService.getUserInformation(data.twilioAuthId).subscribe(
1584
- // response => {
1585
- // incomingCallData['userInfo']=response
1586
- // this.incomingCallsList.push(incomingCallData);
1587
- // }, error => {
1588
- // console.error('Error starting recording', error);
1589
- // });
1590
- // }
1591
- fromEntries(entries) {
1592
- return entries.reduce((acc, [key, value]) => {
1593
- acc[key] = value;
1594
- return acc;
1595
- }, {});
1596
- }
1597
- ngAfterViewInit() {
1598
- this.registerDragElement();
1472
+ acceptCallFromList(data) {
1473
+ console.log(data, 'checking dii');
1474
+ data.accept();
1475
+ // data.parameters['isCallConnected'] = true;
1476
+ data.isCallConnected = true;
1477
+ this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
1478
+ if (this.shouldRecordCall) { // default recording
1479
+ this.extensionService.setCallSid(this.CallSid, this.recordCall);
1480
+ this.closeIncomingCallWrapper(1);
1481
+ }
1482
+ else { // manual recording
1483
+ this.extensionService.setCallSid(this.CallSid, this.recordCall);
1484
+ this.closeIncomingCallWrapper(1);
1485
+ }
1486
+ });
1599
1487
  }
1600
- ngOnChanges(changes) {
1601
- if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
1602
- this.getContactList();
1603
- // this.getUserCallSetting();
1604
- setTimeout(() => {
1605
- this.dialInputElement.nativeElement.focus();
1606
- }, 0);
1488
+ rejectCallFromList(data) {
1489
+ if (!data)
1490
+ return;
1491
+ if (data.reject)
1492
+ data.reject();
1493
+ if (data.disconnect)
1494
+ data.disconnect();
1495
+ if (data.parameters) {
1496
+ data.parameters['isCallConnected'] = false; // Should be false when rejecting
1497
+ }
1498
+ if (data.customParameters) {
1499
+ this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered');
1500
+ }
1501
+ if (this.newIncomingCallsList && data && data.parameters && data.parameters.CallSid) {
1502
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== data.parameters.CallSid);
1503
+ this.incomingCallsNewList.emit(this.newIncomingCallsList);
1504
+ if (this.newIncomingCallsList.length == 0) {
1505
+ this.closeIncomingCallDiv.emit({ show: 0, call: data });
1506
+ }
1607
1507
  }
1608
1508
  }
1609
- registerDragElement() {
1610
- try {
1611
- const elmnt = document.getElementById('dragparent1');
1612
- let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
1613
- const dragMouseDown = (e) => {
1614
- // If the target is an input, return and don't initiate dragging
1615
- if (e.target.tagName.toLowerCase() === 'input') {
1616
- return;
1617
- }
1618
- e = e || window.event;
1619
- // get the mouse cursor position at startup:
1620
- pos3 = e.clientX;
1621
- pos4 = e.clientY;
1622
- document.onmouseup = closeDragElement;
1623
- // call a function whenever the cursor moves:
1624
- document.onmousemove = elementDrag;
1625
- };
1626
- const elementDrag = (e) => {
1627
- e = e || window.event;
1628
- // calculate the new cursor position:
1629
- pos1 = pos3 - e.clientX;
1630
- pos2 = pos4 - e.clientY;
1631
- pos3 = e.clientX;
1632
- pos4 = e.clientY;
1633
- // set the element's new position:
1634
- // elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
1635
- // elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
1636
- };
1637
- const closeDragElement = () => {
1638
- /* stop moving when mouse button is released:*/
1639
- document.onmouseup = null;
1640
- document.onmousemove = null;
1641
- };
1642
- // if (document.getElementById(elmnt.id + 'header')) {
1643
- // /* if present, the header is where you move the DIV from:*/
1644
- // document.getElementById(elmnt.id + 'header').onmousedown = dragMouseDown;
1645
- // } else {
1646
- // /* otherwise, move the DIV from anywhere inside the DIV:*/
1647
- // elmnt.onmousedown = dragMouseDown;
1648
- // }
1649
- }
1650
- catch (e) {
1651
- console.log(e);
1652
- }
1509
+ closeIncomingCallWrapper(val) {
1510
+ this.closeIncomingCallDiv.emit({ show: val, call: this.twilioCallData });
1653
1511
  }
1654
- addNumber(num) {
1655
- if (num == '#' || num == '*' || num == '+' || Number.isInteger(num)) {
1656
- if (num == '#') {
1657
- new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
1658
- }
1659
- else if (num == '*') {
1660
- new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
1661
- }
1662
- else {
1663
- new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
1664
- }
1665
- this.dialedNumber += num;
1666
- this.showInputClearBtn = true;
1667
- this.numberDialed.emit(this.dialedNumber);
1668
- this.onDialInputChange(this.dialedNumber);
1669
- // this.dialInputRef.nativeElement.focus();
1670
- }
1671
- else if (num === 'voicemail') {
1672
- // this.showDedicatedPopup = true;
1673
- this.router.navigate(['extension/voicemail/' + this.token]);
1674
- }
1512
+ toggleMute(data) {
1513
+ this.isMute = !this.isMute;
1514
+ data.mute(this.isMute);
1675
1515
  }
1676
- hideDialpad() {
1677
- this.isDialpadHidden = true;
1678
- this.closeDialpadEvent.emit();
1679
- this.clearAllDialed();
1680
- this.filteredContactList = [];
1516
+ sendIPforIncomingCall(recordId, callstatus) {
1517
+ return new Promise((resolve, reject) => {
1518
+ this.extensionService.getIPDetailsForCall(recordId, callstatus).subscribe((res) => {
1519
+ const resp = res;
1520
+ if (res.status == 200) {
1521
+ if (resp.callAuth) {
1522
+ this.CallSid = resp.callAuth.callSid;
1523
+ this.recordCall = resp.callAuth.recordCall;
1524
+ // Handle the recordCall flag
1525
+ if (resp.callAuth.recordCall) {
1526
+ this.shouldRecordCall = true;
1527
+ }
1528
+ else {
1529
+ this.shouldRecordCall = false;
1530
+ }
1531
+ }
1532
+ else {
1533
+ // swal("Error", "Missing call authentication details.", "error");
1534
+ }
1535
+ resolve();
1536
+ }
1537
+ else {
1538
+ swal("Error", resp.message.join("<br/>"), "error");
1539
+ resolve();
1540
+ }
1541
+ }, (error) => {
1542
+ swal("Error", GlobalConstant.ErrorMsg500, "error");
1543
+ resolve();
1544
+ });
1545
+ });
1681
1546
  }
1682
- onDialInputChange(inputVal) {
1683
- try {
1684
- // Updated regex to include x, X, ext., Ext., and ,
1685
- const isNumericInput = /^[\d\s+\-]+$/.test(inputVal);
1686
- let mainNumber = inputVal;
1687
- // Check for extension indicators and split the input
1688
- const extMatch = inputVal.match(/(x|X|ext\.|Ext\.|,)(.*)/);
1689
- if (extMatch) {
1690
- mainNumber = inputVal.substring(0, extMatch.index).trim();
1691
- this.callData.extNum = extMatch[2].trim();
1692
- }
1693
- this.sanitizedNum = isNumericInput ? mainNumber.replace(/[\s\-]+/g, '') : mainNumber;
1694
- this.callData.phone = isNumericInput ? this.sanitizedNum : '';
1695
- this.showInputClearBtn = inputVal.length > 0;
1696
- if (isNumericInput) {
1697
- this.dialedNumber = new AsYouType().input(this.sanitizedNum);
1698
- }
1699
- // emit current number whenever input changes
1700
- this.numberDialed.emit(this.dialedNumber);
1701
- if (inputVal.length > 2) {
1702
- this.filteredContactList = this.contactList.filter(contact => {
1703
- const fullName = `${contact.firstName} ${contact.middleName} ${contact.lastName}`.toLowerCase();
1704
- // return fullName.includes(this.sanitizedNum.toLowerCase()) || contact.numbersList.some(num => num.number.includes(this.sanitizedNum));
1705
- }).slice(0, 2);
1547
+ onUserInfoByCallSid() {
1548
+ if (this.selectedIncomingCall && this.selectedIncomingCall.userInfo) {
1549
+ }
1550
+ return this.selectedIncomingCall ? Object.keys(this.selectedIncomingCall).length ? true : false : false;
1551
+ }
1552
+ onClickExpand(data) {
1553
+ if (this.selectedIncomingCall === data && this.isClickExpand) {
1554
+ this.isClickExpand = false;
1555
+ this.selectedIncomingCall = null;
1556
+ this.selectedIncomingCallInfo.emit({});
1557
+ return;
1558
+ }
1559
+ this.isClickExpand = true;
1560
+ this.selectedIncomingCall = data;
1561
+ if (this.selectedIncomingCall) {
1562
+ this.selectedIncomingCall['isClickExpand'] = true;
1563
+ if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
1564
+ this.newIncomingCallsList.forEach((call) => {
1565
+ if (call !== this.selectedIncomingCall) {
1566
+ call['isClickExpand'] = false;
1567
+ }
1568
+ });
1706
1569
  }
1707
- else {
1708
- this.filteredContactList = [];
1570
+ this.selectedIncomingCallInfo.emit(this.selectedIncomingCall);
1571
+ if (!this.selectedIncomingCall.userInfo || this.selectedIncomingCall.userInfo.status == 201) {
1572
+ this.getUserInformation(this.selectedIncomingCall);
1709
1573
  }
1710
1574
  }
1711
- catch (e) {
1712
- console.log(e);
1713
- }
1714
1575
  }
1715
- getFirstLetter(name) {
1716
- return name ? name.charAt(0).toUpperCase() : '';
1576
+ getUserInformation(incomingCallData) {
1577
+ let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
1578
+ this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
1579
+ setTimeout(() => {
1580
+ incomingCallData['userInfo'] = response;
1581
+ }, 5000);
1582
+ }, error => {
1583
+ console.error('Error starting recording', error);
1584
+ });
1717
1585
  }
1718
- clearInput() {
1719
- if (this.dialedNumber.length > 0) {
1720
- this.dialedNumber = this.dialedNumber.slice(0, -1);
1721
- this.showInputClearBtn = this.dialedNumber.length !== 0;
1722
- this.onDialInputChange(this.dialedNumber);
1723
- }
1586
+ fromEntries(entries) {
1587
+ return entries.reduce((acc, [key, value]) => {
1588
+ acc[key] = value;
1589
+ return acc;
1590
+ }, {});
1724
1591
  }
1725
- clearAllDialed() {
1726
- this.dialedNumber = '';
1727
- this.sanitizedNum = '';
1728
- this.showInputClearBtn = false;
1592
+ }
1593
+ IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }], target: i0.ɵɵFactoryTarget.Component });
1594
+ IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1595
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
1596
+ type: Component,
1597
+ args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"] }]
1598
+ }], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }]; }, propDecorators: { incomingCallData: [{
1599
+ type: Input
1600
+ }], newIncomingCallsList: [{
1601
+ type: Input
1602
+ }], closeIncomingCallDiv: [{
1603
+ type: Output
1604
+ }], incomingCallsNewList: [{
1605
+ type: Output
1606
+ }], selectedIncomingCallInfo: [{
1607
+ type: Output
1608
+ }] } });
1609
+
1610
+ class CallProgressComponent {
1611
+ constructor(extensionService, cdr) {
1612
+ this.extensionService = extensionService;
1613
+ this.cdr = cdr;
1614
+ this.endCallEvent = new EventEmitter();
1615
+ this.incomingCallsNewInfo = new EventEmitter();
1616
+ this.minimiseEvent = new EventEmitter();
1617
+ this.showRingAnimation = false;
1618
+ this.timer = '00:00';
1619
+ this.showKeypad = false;
1620
+ this.keypadVal = keypad;
1621
+ this.callInput = '';
1622
+ this.isMute = false;
1623
+ this.disbaleEndCallBtn = true;
1624
+ this.showClearBtn = false;
1625
+ this.isCollops = false;
1626
+ // Incoming call variables
1627
+ this.incomingCallDiv = false;
1628
+ this.showCallProgressEvent = new EventEmitter();
1629
+ this.incomingCallInitiated = new EventEmitter();
1630
+ this.isRecording = false;
1631
+ this.isPaused = false;
1632
+ this.timeElapsed = 0; // in seconds
1633
+ this.recordCall = false;
1634
+ this.callStatus = 'ringing';
1635
+ this.isMinimised = false;
1729
1636
  }
1730
- getCallerIdList() {
1731
- this.extService.displayID(this.token || '').subscribe((res) => {
1732
- //this.callerIdList = res.callerIdList.filter(item => item.type === "C2C Softphone Number");
1733
- this.callerIdList = res.callerIdList.filter((item) => item.voiceFeature === true);
1734
- // this.callerIdList = res.callerIdList;
1735
- if (this.callerIdList.length == 1) {
1736
- this.selectedCallerId = this.callerIdList[0];
1637
+ ngOnInit() {
1638
+ console.log('Call Progress Component');
1639
+ }
1640
+ ngOnChanges(changes) {
1641
+ console.log('Call Progress Component ngOnChanges');
1642
+ if (changes['callData']) {
1643
+ console.log('Call Progress Component ngOnChanges callData', changes['callData']);
1644
+ if (changes['callData'].currentValue.isIncomingCall) {
1645
+ this.incomingCallDiv = true;
1737
1646
  }
1738
1647
  else {
1739
- if (this.callPreference === 'alwaysAsk' || this.callPreference === 'smartDialing') {
1740
- this.selectedCallerId = null;
1741
- }
1742
- else {
1743
- this.selectedCallerId = this.callerIdList.find(item => (item.number == this.callPreference));
1648
+ //for outgoing call
1649
+ this.startCall(changes['callData'].currentValue);
1650
+ }
1651
+ }
1652
+ if (changes['newIncomingCallData']) {
1653
+ try {
1654
+ if (changes['newIncomingCallData'].currentValue) {
1655
+ if (this.call && (this.call.status() == 'open')) {
1656
+ this.call.disconnect();
1657
+ this.call = changes['newIncomingCallData'].currentValue;
1658
+ this.call?.accept();
1659
+ this.callData.phone = this.call?.parameters['From'];
1660
+ this.callData.name = this.call?.customParameters.get('name');
1661
+ this.callData.img = this.call?.customParameters.get('image') || 'assets/images/user.jpg';
1662
+ this.incomingCallInitiated.emit();
1663
+ this.startTimer();
1664
+ }
1744
1665
  }
1745
1666
  }
1746
- });
1667
+ catch (e) {
1668
+ console.log(e);
1669
+ }
1670
+ }
1747
1671
  }
1748
- getContactList() {
1749
- this.twilioService.getContactList().subscribe((resp) => {
1750
- if (resp.response == 'Success') {
1751
- this.contactList = resp.phoneBook;
1672
+ ngAfterViewInit() { }
1673
+ async startCall(callData) {
1674
+ try {
1675
+ this.showRingAnimation = true;
1676
+ const payload = {
1677
+ channelId: environment.channelId,
1678
+ userId: localStorage.getItem('userId'),
1679
+ to: callData.phone,
1680
+ scope: 'local',
1681
+ fromNumber: callData.from
1682
+ };
1683
+ const response = await this.initiateCall(payload);
1684
+ if (response.status == 200) {
1685
+ const { id: callAuthId, recordCall } = await this.getCallAuthId(response);
1686
+ this.getUserInformation(callAuthId);
1687
+ this.recordCall = recordCall; // Store the recordCall value
1688
+ const tokenData = await this.getOutgoingCallToken(callAuthId);
1689
+ await this.connectToDevice(tokenData.token, callData);
1690
+ // Poll the status for 30-45 seconds
1691
+ this.pollCallStatus(callAuthId);
1752
1692
  }
1753
- }, err => {
1693
+ else if (response.status == 201) {
1694
+ swal("Error", response.message.join("<br/>"), "error");
1695
+ this.endCall();
1696
+ }
1697
+ }
1698
+ catch (error) {
1699
+ this.showRingAnimation = false;
1700
+ this.handleError(error);
1701
+ this.endCall();
1702
+ }
1703
+ }
1704
+ async initiateCall(payload) {
1705
+ return await this.extensionService.initiateCall(payload).toPromise();
1706
+ }
1707
+ async getCallAuthId(response) {
1708
+ return {
1709
+ id: response.callauth.id,
1710
+ recordCall: response.callauth.recordCall
1711
+ };
1712
+ }
1713
+ async getOutgoingCallToken(callAuthId) {
1714
+ return await this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
1715
+ }
1716
+ async connectToDevice(token, callData) {
1717
+ const options = {
1718
+ codecPreferences: ['opus', 'pcmu'],
1719
+ closeProtection: true,
1720
+ };
1721
+ this.device = new Device(token.value, options);
1722
+ this.call = await this.device.connect({
1723
+ params: {
1724
+ From: callData.from,
1725
+ To: callData.phone,
1726
+ Env: environment.abb,
1727
+ Token: token.id,
1728
+ Ext: callData.extNum
1729
+ },
1730
+ rtcConstraints: { audio: { deviceId: 'default' } },
1731
+ });
1732
+ this.setupEventListeners();
1733
+ }
1734
+ setupEventListeners() {
1735
+ this.startTimer();
1736
+ this.device?.on('error', (err) => {
1754
1737
  console.log(err);
1738
+ this.showRingAnimation = false;
1739
+ this.stopTimer();
1740
+ });
1741
+ this.call?.on('error', (error) => {
1742
+ this.showRingAnimation = false;
1743
+ this.stopTimer();
1744
+ });
1745
+ this.call?.on('disconnect', () => {
1746
+ this.endCall();
1747
+ });
1748
+ this.call?.on('ringing', () => {
1749
+ });
1750
+ this.call?.on('reject', () => {
1751
+ this.endCall();
1752
+ });
1753
+ this.call?.on('accept', () => {
1754
+ this.showRingAnimation = false;
1755
+ this.disbaleEndCallBtn = false;
1756
+ // Start recording if recordCall is true and call is accepted for 30 seconds
1757
+ // if (this.recordCall) {
1758
+ // setTimeout(() => {
1759
+ // if (this.isRecording) return; // If already recording, skip
1760
+ // this.startRecording();
1761
+ // }, 30000);
1762
+ // } else {
1763
+ // this.stopRecording();
1764
+ // }
1765
+ });
1766
+ this.call?.on('messageReceived', (message) => {
1755
1767
  });
1756
1768
  }
1757
- getFullName(contact) {
1758
- let fullName = contact.firstName || '';
1759
- if (contact.middleName) {
1760
- fullName += ` ${contact.middleName}`;
1761
- }
1762
- if (contact.lastName) {
1763
- fullName += ` ${contact.lastName}`;
1764
- }
1765
- return fullName.trim();
1769
+ startTimer() {
1770
+ let seconds = 0;
1771
+ this.intervalId = setInterval(() => {
1772
+ seconds++;
1773
+ this.timer = this.formatTime(seconds);
1774
+ }, 1000);
1766
1775
  }
1767
- toggleCallerIdDiv() {
1768
- this.isCallerIdHidden = !this.isCallerIdHidden;
1776
+ stopTimer() {
1777
+ clearInterval(this.intervalId);
1778
+ this.timer = '00:00';
1769
1779
  }
1770
- onContactSelect(contact) {
1771
- this.dialedNumber = contact.numbersList[0].number;
1772
- this.callData.name = this.getFullName(contact);
1773
- this.callData.img = contact.image || 'assets/images/user.jpg';
1774
- this.onDialInputChange(this.dialedNumber);
1775
- this.filteredContactList = [];
1780
+ formatTime(totalSeconds) {
1781
+ const minutes = Math.floor(totalSeconds / 60);
1782
+ const seconds = totalSeconds % 60;
1783
+ return `${this.pad(minutes)}:${this.pad(seconds)}`;
1784
+ }
1785
+ pad(value) {
1786
+ return value < 10 ? `0${value}` : `${value}`;
1787
+ }
1788
+ handleError(error) {
1789
+ swal("Error", error, "error");
1776
1790
  }
1777
1791
  endCall() {
1792
+ this.endCallEvent.emit();
1793
+ if (this.call) {
1794
+ this.call.disconnect();
1795
+ }
1796
+ this.showRingAnimation = false;
1797
+ this.stopTimer();
1798
+ this.maximiseDialpad();
1799
+ }
1800
+ toggleMute() {
1801
+ this.isMute = !this.isMute;
1802
+ this.call?.mute(this.isMute);
1803
+ }
1804
+ toggleKeypad() {
1805
+ this.showKeypad = !this.showKeypad;
1806
+ this.callInput = '';
1807
+ }
1808
+ onCallInputs(num) {
1778
1809
  try {
1779
- console.log('Ending call');
1780
- this.isCallInProgress = false;
1781
- this.filteredContactList = [];
1782
- // Reset call data
1783
- this.callData = {
1784
- phone: '',
1785
- name: '',
1786
- img: 'assets/images/user.jpg',
1787
- isIncomingCall: false,
1788
- dial: false,
1789
- displayNum: '',
1790
- extNum: ''
1791
- };
1792
- // Reset dialed number
1793
- this.dialedNumber = '';
1794
- this.sanitizedNum = '';
1795
- // Emit end call event
1796
- this.endCallEvent.emit();
1797
- console.log('Call ended successfully');
1810
+ if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
1811
+ if (num == '#') {
1812
+ new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
1813
+ }
1814
+ else if (num == '*') {
1815
+ new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
1816
+ }
1817
+ else {
1818
+ new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
1819
+ }
1820
+ this.callInput = this.callInput + String(num);
1821
+ this.showClearBtn = true;
1822
+ }
1823
+ let str = String(num);
1824
+ this.call?.sendDigits(str);
1798
1825
  }
1799
- catch (error) {
1800
- console.error('Error in endCall:', error);
1801
- // Even if there's an error, try to reset the state
1802
- this.isCallInProgress = false;
1803
- this.callData = {
1804
- phone: '',
1805
- name: '',
1806
- img: 'assets/images/user.jpg',
1807
- isIncomingCall: false,
1808
- dial: false,
1809
- displayNum: '',
1810
- extNum: ''
1811
- };
1826
+ catch (e) {
1827
+ console.log(e);
1828
+ }
1829
+ }
1830
+ onCallInputEnter(ev) {
1831
+ try {
1832
+ this.call?.sendDigits(String(ev.key));
1833
+ }
1834
+ catch (e) {
1835
+ console.log(e);
1836
+ }
1837
+ }
1838
+ closeIncomingCall(data) {
1839
+ // this.incomingCallDiv = false;
1840
+ if (data.show) {
1841
+ //this.showCallProgressEvent.emit()
1842
+ // handle incoming call accepted
1843
+ this.startTimer();
1844
+ this.disbaleEndCallBtn = false;
1845
+ this.call = data.call;
1846
+ const incomingDetail = this.extensionService.getCallSid();
1847
+ this.incomingRecordCall = incomingDetail.recordCall;
1848
+ // Start recording if the call is answered and recording is enabled
1849
+ if (this.incomingRecordCall) {
1850
+ this.startRecording();
1851
+ }
1852
+ else {
1853
+ this.isRecording = false;
1854
+ }
1855
+ this.cdr.detectChanges();
1856
+ }
1857
+ else {
1858
+ // incoming call rejected
1812
1859
  this.endCallEvent.emit();
1813
1860
  }
1814
1861
  }
1815
- // async initiateCall() {
1816
- // try {
1817
- // console.log('Initiating call with number:', this.dialedNumber);
1818
- // if (!this.dialedNumber && this.lastDialed) {
1819
- // console.log('Using last dialed number:', this.lastDialed.number);
1820
- // this.sanitizedNum = this.lastDialed.number;
1821
- // }
1822
- // const isInvalid = await this.isInvalidNumber();
1823
- // if (isInvalid) {
1824
- // console.error('Invalid number format');
1825
- // return false;
1826
- // }
1827
- // this.saveLastDialed();
1828
- // this.isSavedContactDialled();
1829
- // // Check payment status
1830
- // this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
1831
- // if (this.isPaymentDue) {
1832
- // console.warn('Payment is due');
1833
- // swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
1834
- // return false;
1835
- // }
1836
- // // Check if dialing own number
1837
- // if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
1838
- // console.error('Attempted to dial own number');
1839
- // swal('Error', 'You cannot dial your own number');
1840
- // return false;
1841
- // }
1842
- // // Check microphone permissions
1843
- // const hasPermission = await this.checkMicrophonePermission();
1844
- // if (!hasPermission) {
1845
- // console.warn('Microphone permission not granted');
1846
- // await this.askForMicrophonePermission();
1847
- // return false;
1848
- // }
1849
- // if (!this.selectedCallerId) {
1850
- // console.error('No caller ID selected');
1851
- // this.shakeDedicatedBtn = true;
1852
- // this.showDialAlert('Please select a C2C number to call from');
1853
- // setTimeout(() => {
1854
- // this.shakeDedicatedBtn = false;
1855
- // }, 3000);
1856
- // return false;
1857
- // }
1858
- // console.log('Getting number with country code...');
1859
- // this.callData.displayNum = '';
1860
- // try {
1861
- // await this.getToNumber(this.sanitizedNum);
1862
- // } catch (error) {
1863
- // console.error('Error getting number with country code:', error);
1864
- // this.showDialAlert('Error processing number. Please try again.');
1865
- // return false;
1866
- // }
1867
- // if (this.terminateCall) {
1868
- // console.log('Call terminated by user');
1869
- // this.terminateCall = false;
1870
- // return false;
1871
- // }
1872
- // // Prepare call data
1873
- // this.callData = {
1874
- // ...this.callData,
1875
- // phone: this.sanitizedNum,
1876
- // isIncomingCall: false,
1877
- // dial: true,
1878
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
1879
- // timestamp: new Date().toISOString()
1880
- // };
1881
- // console.log('Initiating call with data:', this.callData);
1882
- // this.isCallInProgress = true;
1883
- // this.callInitiated.emit({ ...this.callData });
1884
- // return true;
1885
- // } catch (error) {
1886
- // console.error('Error in initiateCall:', error);
1887
- // this.showDialAlert('Failed to initiate call. Please try again.');
1888
- // this.isCallInProgress = false;
1889
- // return false;
1890
- // }
1891
- // //this.clearAllDialed();
1892
- // // } else {
1893
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
1894
- // // }
1895
- // }
1896
- // async initiateCall() {
1897
- // if (!this.dialedNumber && this.lastDialed) {
1898
- // this.sanitizedNum = this.lastDialed.number;
1899
- // }
1900
- // const isInvalid = await this.isInvalidNumber();
1901
- // if (isInvalid) {
1902
- // return false;
1903
- // }
1904
- // this.saveLastDialed();
1905
- // this.isSavedContactDialled();
1906
- // //let isCallerIdSet = await this.isCallerIdSet();
1907
- // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
1908
- // if (this.isPaymentDue) {
1909
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
1910
- // return;
1911
- // }
1912
- // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
1913
- // // if (!this.isTrialPeriodOver) {
1914
- // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
1915
- // swal('Error', 'You can not dial this number');
1916
- // return;
1917
- // }
1918
- // const hasPermission = await this.checkMicrophonePermission();
1919
- // if (hasPermission) {
1920
- // if (this.selectedCallerId) {
1921
- // //clear displayNum if value is binded from previous call
1922
- // this.callData.displayNum = '';
1923
- // // get number to be dialled from backend
1924
- // await this.getToNumber(this.sanitizedNum);
1925
- // if (this.terminateCall) {
1926
- // this.terminateCall = false;
1927
- // return;
1928
- // }
1929
- // this.callData.phone = this.sanitizedNum;
1930
- // this.callData.isIncomingCall = false;
1931
- // this.callData.dial = true;
1932
- // if (!this.isSmartDialCall) {
1933
- // this.callData.from = this.selectedCallerId.number;
1934
- // }
1935
- // this.isCallInProgress = true;
1936
- // this.callData = {
1937
- // ...this.callData,
1938
- // phone: this.sanitizedNum,
1939
- // isIncomingCall: false,
1940
- // dial: true,
1941
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
1942
- // timestamp: new Date().toISOString()
1943
- // };
1944
- // console.log('Initiating call with data:', this.callData);
1945
- // this.isCallInProgress = true;
1946
- // this.callInitiated.emit({ ...this.callData });
1947
- // return true;
1948
- // } else {
1949
- // this.shakeDedicatedBtn = true;
1950
- // this.showDialAlert('Select a C2C number to call');
1951
- // setTimeout(() => {
1952
- // this.shakeDedicatedBtn = false;
1953
- // }, 3000);
1954
- // return false;
1955
- // }
1956
- // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
1957
- // } else {
1958
- // await this.askForMicrophonePermission();
1959
- // }
1960
- // //this.clearAllDialed();
1961
- // // } else {
1962
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
1963
- // // }
1964
- // }
1965
- // async initiateCall() {
1966
- // try{
1967
- // if (!this.dialedNumber && this.lastDialed) {
1968
- // this.sanitizedNum = this.lastDialed.number;
1969
- // }
1970
- // const isInvalid = await this.isInvalidNumber();
1971
- // if (isInvalid) {
1972
- // return false;
1973
- // }
1974
- // this.saveLastDialed();
1975
- // this.isSavedContactDialled();
1976
- // //let isCallerIdSet = await this.isCallerIdSet();
1977
- // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
1978
- // if (this.isPaymentDue) {
1979
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
1980
- // return false;
1981
- // }
1982
- // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
1983
- // // if (!this.isTrialPeriodOver) {
1984
- // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
1985
- // swal('Error', 'You can not dial this number');
1986
- // return false;
1987
- // }
1988
- // const hasPermission = await this.checkMicrophonePermission();
1989
- // if (hasPermission) {
1990
- // if (this.selectedCallerId) {
1991
- // //clear displayNum if value is binded from previous call
1992
- // this.callData.displayNum = '';
1993
- // // get number to be dialled from backend
1994
- // await this.getToNumber(this.sanitizedNum);
1995
- // if (this.terminateCall) {
1996
- // this.terminateCall = false;
1997
- // return;
1998
- // }
1999
- // this.callData.phone = this.sanitizedNum;
2000
- // this.callData.isIncomingCall = false;
2001
- // this.callData.dial = true;
2002
- // if (!this.isSmartDialCall) {
2003
- // this.callData.from = this.selectedCallerId.number;
2004
- // }
2005
- // this.isCallInProgress = true;
2006
- // this.callData = {
2007
- // ...this.callData,
2008
- // phone: this.sanitizedNum,
2009
- // isIncomingCall: false,
2010
- // dial: true,
2011
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2012
- // timestamp: new Date().toISOString()
2013
- // };
2014
- // console.log('Initiating call with data:', this.callData);
2015
- // this.isCallInProgress = true;
2016
- // this.callInitiated.emit({ ...this.callData });
2017
- // return true;
2018
- // } else {
2019
- // this.shakeDedicatedBtn = true;
2020
- // this.showDialAlert('Select a C2C number to call');
2021
- // setTimeout(() => {
2022
- // this.shakeDedicatedBtn = false;
2023
- // }, 3000);
2024
- // return false;
2025
- // }
2026
- // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2027
- // } else {
2028
- // await this.askForMicrophonePermission();
2029
- // }
2030
- // //this.clearAllDialed();
2031
- // // } else {
2032
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2033
- // // }
2034
- // }catch(e){
2035
- // console.error('Error in initiateCall:', e);
2036
- // this.showDialAlert('Failed to initiate call. Please try again.');
2037
- // this.isCallInProgress = false;
2038
- // return false;
2039
- // }
2040
- // }
2041
- async initiateCall() {
2042
- try {
2043
- if (!this.dialedNumber && this.lastDialed) {
2044
- this.sanitizedNum = this.lastDialed.number;
2045
- }
2046
- const isInvalid = await this.isInvalidNumber();
2047
- if (isInvalid) {
2048
- return false;
2049
- }
2050
- // this.saveLastDialed();
2051
- this.isSavedContactDialled();
2052
- this.isPaymentDue = localStorage.getItem('paymentDue') === 'false' ? false : true;
2053
- if (this.isPaymentDue) {
2054
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2055
- return false;
2056
- }
2057
- this.isTrialPeriodOver = localStorage.getItem('trialOver') === 'false' ? false : true;
2058
- if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2059
- // swal('Error', 'You can not dial this number');
2060
- return false;
2061
- }
2062
- // const hasPermission = await this.checkMicrophonePermission();
2063
- // if (!hasPermission) {
2064
- // await this.askForMicrophonePermission();
2065
- // return false;
2066
- // }
2067
- if (!this.selectedCallerId) {
2068
- this.shakeDedicatedBtn = true;
2069
- this.showDialAlert('Select a C2C number to call');
2070
- setTimeout(() => {
2071
- this.shakeDedicatedBtn = false;
2072
- }, 3000);
2073
- return false;
2074
- }
2075
- // Clear displayNum if value is bound from previous call
2076
- this.callData.displayNum = '';
2077
- // Get number to be dialed from backend
2078
- // await this.getToNumber(this.sanitizedNum);
2079
- if (this.terminateCall) {
2080
- this.terminateCall = false;
2081
- return;
2082
- }
2083
- // Update call data in a single operation
2084
- this.callData = {
2085
- ...this.callData,
2086
- phone: this.sanitizedNum,
2087
- isIncomingCall: false,
2088
- dial: true,
2089
- from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2090
- timestamp: new Date().toISOString()
2091
- };
2092
- console.log('Initiating call with data:', this.callData);
2093
- this.isCallInProgress = true;
2094
- this.callInitiated.emit({ ...this.callData });
2095
- return true;
1862
+ clearInputs() {
1863
+ this.callInput = this.callInput.slice(0, -1);
1864
+ }
1865
+ minimiseDialpad() {
1866
+ this.minimiseEvent.emit(true);
1867
+ this.isMinimised = true;
1868
+ }
1869
+ maximiseDialpad() {
1870
+ this.minimiseEvent.emit(false);
1871
+ this.isMinimised = false;
1872
+ }
1873
+ toggleRecording() {
1874
+ if (this.isRecording) {
1875
+ this.stopRecording();
2096
1876
  }
2097
- catch (e) {
2098
- console.error('Error in initiateCall:', e);
2099
- this.showDialAlert('Failed to initiate call. Please try again.');
2100
- this.isCallInProgress = false;
2101
- return false;
1877
+ else {
1878
+ this.startRecording();
2102
1879
  }
2103
1880
  }
2104
- async isInvalidNumber() {
2105
- try {
2106
- if (this.sanitizedNum == '') {
2107
- this.showDialAlert('Invalid Number');
2108
- return true;
2109
- }
2110
- const validNumberPattern = /^[+\d\s()-]*$/; // Regular expression to match valid characters
2111
- const phoneNumber = this.sanitizedNum;
2112
- if (!validNumberPattern.test(phoneNumber)) {
2113
- this.showDialAlert('Invalid Number');
2114
- return true;
2115
- }
2116
- return false;
1881
+ startRecording() {
1882
+ let sid;
1883
+ const details = this.extensionService.getCallSid();
1884
+ this.incomingCallSid = details.callSid;
1885
+ this.incomingRecordCall = details.recordCall;
1886
+ sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1887
+ // if (!this.incomingRecordCall && !this.recordCall) {
1888
+ // return;
1889
+ // }
1890
+ this.extensionService.getCallRecording(sid).subscribe(response => {
1891
+ this.isRecording = true;
1892
+ this.isPaused = false;
1893
+ this.timeElapsed = 0;
1894
+ this.startTimer1();
1895
+ }, error => {
1896
+ console.error('Error starting recording', error);
1897
+ });
1898
+ }
1899
+ stopRecording() {
1900
+ // if (!this.incomingRecordCall && !this.recordCall) {
1901
+ // return;
1902
+ // }
1903
+ this.isRecording = false;
1904
+ this.isPaused = false;
1905
+ if (this.timerSubscription) {
1906
+ this.timerSubscription.unsubscribe();
2117
1907
  }
2118
- catch (error) {
2119
- this.showDialAlert('Invalid Number');
2120
- return true; // Return true if an error occurred, meaning the number is invalid
1908
+ }
1909
+ pauseRecording() {
1910
+ const details = this.extensionService.getCallSid();
1911
+ this.incomingCallSid = details.callSid;
1912
+ this.incomingRecordCall = details.recordCall;
1913
+ const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1914
+ // if (!this.incomingRecordCall && !this.recordCall) {
1915
+ // return;
1916
+ // }
1917
+ this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
1918
+ this.stopRecordingTimer();
1919
+ this.isPaused = true;
1920
+ }, error => {
1921
+ console.error('Error pausing recording:', error);
1922
+ // Consider updating the UI to show the error state
1923
+ });
1924
+ }
1925
+ resumeRecording() {
1926
+ let sid;
1927
+ const details = this.extensionService.getCallSid();
1928
+ this.incomingCallSid = details.callSid;
1929
+ this.incomingRecordCall = details.recordCall;
1930
+ sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1931
+ // if (!this.incomingRecordCall && !this.recordCall) {
1932
+ // return; // Skip if recording is not enabled
1933
+ // }
1934
+ this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
1935
+ this.isPaused = false;
1936
+ this.startTimer1();
1937
+ }, error => {
1938
+ console.error('Error resuming recording', error);
1939
+ });
1940
+ }
1941
+ startTimer1() {
1942
+ this.timerSubscription = interval(1000).subscribe(() => {
1943
+ this.timeElapsed++;
1944
+ });
1945
+ }
1946
+ stopRecordingTimer() {
1947
+ if (this.timerSubscription) {
1948
+ this.timerSubscription.unsubscribe(); // Pause the timer
1949
+ this.timerSubscription = undefined; // Optionally reset the subscription
2121
1950
  }
2122
1951
  }
2123
- // saveLastDialed() {
2124
- // const contact = this.filteredContactList.find(c => c.numbersList.some(n => n.number === this.dialedNumber));
2125
- // if (contact) {
2126
- // this.lastDialed = {
2127
- // name: contact.name,
2128
- // image: contact.image,
2129
- // number: this.dialedNumber
2130
- // };
2131
- // } else {
2132
- // if(this.dialedNumber){
2133
- // this.lastDialed = { number: this.dialedNumber };
2134
- // }
2135
- // }
2136
- // }
2137
- isSavedContactDialled() {
2138
- let phoneNum = this.sanitizedNum.replace(/\s+/g, '');
2139
- let contact = this.contactList.filter(contact => {
2140
- // return contact.numbersList.some(num => num.number === phoneNum)
1952
+ getFormattedTime() {
1953
+ const minutes = Math.floor(this.timeElapsed / 60);
1954
+ const seconds = this.timeElapsed % 60;
1955
+ return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
1956
+ }
1957
+ pollCallStatus(callAuthId) {
1958
+ const maxTime = 30000; // Poll for up to 30 seconds
1959
+ const pollInterval = 3000; // Poll every 3 seconds
1960
+ let elapsedTime = 0;
1961
+ const intervalId = setInterval(async () => {
1962
+ elapsedTime += pollInterval;
1963
+ try {
1964
+ const statusResponse = await this.extensionService.getCallStatus(callAuthId).toPromise();
1965
+ if (statusResponse && statusResponse.callDetails) {
1966
+ this.callStatus = statusResponse.callDetails.callStatus;
1967
+ if (this.callStatus === 'in-progress') {
1968
+ this.callSid = statusResponse.callDetails.callSid;
1969
+ if (this.recordCall && !this.isRecording) {
1970
+ this.startRecording();
1971
+ }
1972
+ clearInterval(intervalId);
1973
+ }
1974
+ else if (this.callStatus === 'completed') {
1975
+ clearInterval(intervalId);
1976
+ this.endCall();
1977
+ this.stopRecording();
1978
+ }
1979
+ else if (this.callStatus === 'ringing') {
1980
+ // Continue polling; do not clear the interval yet
1981
+ }
1982
+ }
1983
+ }
1984
+ catch (error) {
1985
+ clearInterval(intervalId);
1986
+ }
1987
+ if (elapsedTime >= maxTime) {
1988
+ // console.log('Max polling time reached. Stopping poll.');
1989
+ clearInterval(intervalId);
1990
+ }
1991
+ }, pollInterval);
1992
+ }
1993
+ getUserInformation(id) {
1994
+ this.extensionService.getUserInformation(id).subscribe(response => {
1995
+ console.log(response);
1996
+ }, error => {
1997
+ console.error('Error starting recording', error);
2141
1998
  });
2142
- if (contact.length) {
2143
- this.callData.name = `${contact[0].firstName} ${contact[0].middleName} ${contact[0].lastName}`.toLowerCase();
2144
- this.callData.img = contact[0].image || 'assets/images/user.jpg';
2145
- this.callData.phone = this.sanitizedNum;
2146
- return true;
1999
+ }
2000
+ incomingCallsNewList(data) {
2001
+ this.newIncomingCallsList = data;
2002
+ this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2003
+ }
2004
+ selectedIncomingCallInfo(data) {
2005
+ this.selectedIncomingCall = data;
2006
+ }
2007
+ ngOnDestroy() {
2008
+ this.callData.dial = false;
2009
+ if (this.timerSubscription) {
2010
+ this.timerSubscription.unsubscribe();
2147
2011
  }
2148
- return false;
2149
2012
  }
2150
- showDialAlert(message) {
2013
+ }
2014
+ CallProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, deps: [{ token: ExtensionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2015
+ CallProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallProgressComponent, selector: "lib-call-progress", inputs: { callData: "callData", newIncomingCallData: "newIncomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", showCallProgressEvent: "showCallProgressEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand}\">\n <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div>\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button>\n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : '&nbsp;'}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: ["incomingCallData", "newIncomingCallsList"], outputs: ["closeIncomingCallDiv", "incomingCallsNewList", "selectedIncomingCallInfo"] }] });
2016
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
2017
+ type: Component,
2018
+ args: [{ selector: 'lib-call-progress', template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand}\">\n <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div>\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button>\n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : '&nbsp;'}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
2019
+ }], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
2020
+ type: Input
2021
+ }], newIncomingCallData: [{
2022
+ type: Input
2023
+ }], newIncomingCallsList: [{
2024
+ type: Input
2025
+ }], endCallEvent: [{
2026
+ type: Output
2027
+ }], incomingCallsNewInfo: [{
2028
+ type: Output
2029
+ }], minimiseEvent: [{
2030
+ type: Output
2031
+ }], showCallProgressEvent: [{
2032
+ type: Output
2033
+ }], incomingCallInitiated: [{
2034
+ type: Output
2035
+ }] } });
2036
+
2037
+ class DialboxComponent {
2038
+ constructor(twilioService, extService,
2039
+ // private dialog: MatDialog,
2040
+ ipService, extensionService, router) {
2041
+ this.twilioService = twilioService;
2042
+ this.extService = extService;
2043
+ this.ipService = ipService;
2044
+ this.extensionService = extensionService;
2045
+ this.router = router;
2046
+ this.isDialpadHidden = false;
2047
+ this.closeDialpadEvent = new EventEmitter();
2048
+ this.callInitiated = new EventEmitter();
2049
+ this.endCallEvent = new EventEmitter();
2050
+ this.minimiseEvent = new EventEmitter();
2051
+ this.incomingCallsNewInfoEvent = new EventEmitter();
2052
+ this.incomingCallInitiated = new EventEmitter();
2053
+ this.numberDialed = new EventEmitter();
2054
+ this.isCallInProgress = false;
2055
+ this.keypadVal = keypad;
2056
+ this.showInputClearBtn = false;
2057
+ this.dialedNumber = '';
2058
+ this.contactList = [];
2059
+ this.filteredContactList = [];
2060
+ this.callerIdList = [];
2061
+ this.isCallerIdHidden = true;
2062
+ this.isTrialPeriodOver = false;
2063
+ this.isPaymentDue = false;
2064
+ this.terminateCall = false;
2065
+ this.toastTimeout = 7000;
2066
+ this.callNumberToast = {
2067
+ show: false,
2068
+ type: 'alert-success',
2069
+ number: '',
2070
+ displayNum: ''
2071
+ };
2072
+ this.callData = {
2073
+ phone: '',
2074
+ displayNum: '',
2075
+ dial: false,
2076
+ name: '',
2077
+ img: 'assets/images/user.jpg',
2078
+ isIncomingCall: false,
2079
+ extNum: ''
2080
+ };
2081
+ this.lastDialed = null;
2151
2082
  this.dialAlert = {
2152
- msg: message,
2153
- show: true
2083
+ msg: '',
2084
+ show: false
2154
2085
  };
2155
- setTimeout(() => {
2156
- this.dialAlert.show = false;
2157
- }, 3000);
2086
+ this.showDedicatedPopup = false;
2087
+ this.newIncomingCalls = [];
2088
+ this.incomingCallsList = [];
2089
+ this.subscriptions = new Subscription();
2090
+ this.shakeDedicatedBtn = false;
2091
+ this.isSmartDialCall = false;
2092
+ this.isMinimised = false;
2158
2093
  }
2159
- async isCallerIdSet() {
2094
+ ngOnInit() {
2160
2095
  try {
2161
- const tkn = localStorage.getItem('ext_token');
2162
- const res = await this.extService.fetchCallerId(tkn || '').toPromise();
2163
- if (res.status == 200) {
2164
- localStorage.setItem('trialOver', res.trialOver);
2165
- this.twilioService.isTrialOver.next(res.trialOver);
2166
- localStorage.setItem('paymentDue', res.paymentDue);
2167
- this.twilioService.isPaymentDue.next(res.paymentDue);
2168
- }
2169
- if (res.callerid) {
2170
- localStorage.setItem('callerID', res.callerid);
2171
- this.extService.changeMessage(res.callerid);
2172
- }
2173
- else {
2174
- localStorage.setItem('callerID', 'Not set');
2175
- this.extService.changeMessage('Not set');
2176
- }
2177
- return (localStorage.getItem('callerID') !== 'Not set');
2096
+ this.token = localStorage.getItem('ext_token');
2097
+ //this.isCallInProgress = true;
2098
+ this.getContactList();
2099
+ // this.getUserCallSetting();
2100
+ const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
2101
+ if (contact.number) {
2102
+ this.isSmartDialCall = false;
2103
+ if (contact.isDialFromHistory) {
2104
+ //handle dialing from history page
2105
+ if (contact.callerId == 'smartDialing') {
2106
+ this.selectedCallerId = { number: contact.from };
2107
+ this.isSmartDialCall = true;
2108
+ setTimeout(() => {
2109
+ this.isDialpadHidden = false;
2110
+ }, 2000);
2111
+ this.callData.phone = contact.number;
2112
+ this.callData.name = contact.name;
2113
+ this.callData.img = contact.img;
2114
+ this.callData.from = contact.from;
2115
+ this.sanitizedNum = contact.number;
2116
+ // this.getUserInformation(contact);
2117
+ // this.incomingCallsList.push(contact)
2118
+ this.initiateCall();
2119
+ }
2120
+ else {
2121
+ // this.getUserCallSetting();
2122
+ setTimeout(() => {
2123
+ this.isDialpadHidden = false;
2124
+ }, 1000);
2125
+ // this.getUserInformation(contact);
2126
+ // this.incomingCallsList.push(contact)
2127
+ this.dialedNumber = contact.number;
2128
+ this.sanitizedNum = contact.number;
2129
+ }
2130
+ }
2131
+ else {
2132
+ if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
2133
+ // this.getUserCallSetting();
2134
+ setTimeout(() => {
2135
+ this.isDialpadHidden = false;
2136
+ }, 1000);
2137
+ this.dialedNumber = contact.number;
2138
+ this.sanitizedNum = contact.number;
2139
+ }
2140
+ else {
2141
+ setTimeout(() => {
2142
+ this.isDialpadHidden = false;
2143
+ }, 2000);
2144
+ this.callData.phone = contact.number;
2145
+ this.callData.name = contact.name;
2146
+ this.callData.img = contact.img;
2147
+ this.sanitizedNum = contact.number;
2148
+ this.initiateCall();
2149
+ }
2150
+ }
2151
+ }
2152
+ });
2153
+ // handle incoming call
2154
+ const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
2155
+ // if (incomingCallData) {
2156
+ // this.isCallInProgress = true;
2157
+ // this.isDialpadHidden = false;
2158
+ // this.callData.phone = incomingCallData.parameters.From;
2159
+ // this.callData.name = incomingCallData.customParameters.get('name');
2160
+ // this.callData.img = incomingCallData.customParameters.get('image');
2161
+ // this.callData.isIncomingCall = true;
2162
+ // }
2163
+ if (incomingCallData) {
2164
+ if (this.isCallInProgress) {
2165
+ this.newIncomingCalls.push(incomingCallData);
2166
+ // this.getUserInformation(incomingCallData);
2167
+ }
2168
+ else {
2169
+ this.isCallInProgress = true;
2170
+ this.isDialpadHidden = false;
2171
+ this.callData.phone = incomingCallData.parameters['From'];
2172
+ // this.getUserInformation(incomingCallData);
2173
+ this.callData.name = incomingCallData.customParameters.get('name');
2174
+ this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
2175
+ this.callData.isIncomingCall = true;
2176
+ }
2177
+ incomingCallData.on('cancel', () => {
2178
+ // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
2179
+ if (this.incomingCallsList.length == 0) {
2180
+ this.isCallInProgress = false;
2181
+ }
2182
+ });
2183
+ incomingCallData.on('disconnect', () => {
2184
+ // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
2185
+ if (this.incomingCallsList.length == 0) {
2186
+ this.isCallInProgress = false;
2187
+ }
2188
+ });
2189
+ }
2190
+ });
2191
+ this.subscriptions.add(sub1);
2192
+ this.subscriptions.add(sub2);
2178
2193
  }
2179
2194
  catch (e) {
2180
2195
  console.log(e);
2181
- return false;
2182
- }
2183
- }
2184
- async checkMicrophonePermission() {
2185
- try {
2186
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2187
- stream.getTracks().forEach(track => track.stop());
2188
- return true;
2189
- }
2190
- catch (error) {
2191
- if (error instanceof DOMException && error.name === 'NotAllowedError') {
2192
- return false;
2193
- }
2194
- else {
2195
- return false;
2196
- }
2197
- }
2198
- }
2199
- async askForMicrophonePermission() {
2200
- try {
2201
- const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2202
- stream.getTracks().forEach(track => track.stop());
2203
- }
2204
- catch (error) {
2205
- console.error('User denied microphone permission:', error);
2206
2196
  }
2207
2197
  }
2208
- // below function is to get the country code with number from server
2209
- async getToNumber(dialedNumber) {
2210
- if (dialedNumber[0] !== '+') {
2211
- // this is case when user geolocation dial code is on
2212
- let ipAddress = await this.ipService.getIpAddressInfo().toPromise();
2213
- const res = await this.twilioService.getToNumber(dialedNumber, ipAddress.address.countryCode).toPromise();
2214
- if (res.status == 200) {
2215
- this.toastTimeout = res.timeInterval * 1000;
2216
- await this.showNumberToast(res);
2217
- }
2218
- }
2198
+ // getUserInformation(incomingCallData: any) {
2199
+ // let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
2200
+ // this.extensionService.getUserInformation(data.twilioAuthId).subscribe(
2201
+ // response => {
2202
+ // incomingCallData['userInfo']=response
2203
+ // this.incomingCallsList.push(incomingCallData);
2204
+ // }, error => {
2205
+ // console.error('Error starting recording', error);
2206
+ // });
2207
+ // }
2208
+ fromEntries(entries) {
2209
+ return entries.reduce((acc, [key, value]) => {
2210
+ acc[key] = value;
2211
+ return acc;
2212
+ }, {});
2219
2213
  }
2220
- isAlertEnable() {
2221
- return localStorage.getItem('isAlertEnable');
2214
+ ngAfterViewInit() {
2215
+ this.registerDragElement();
2222
2216
  }
2223
- async showNumberToast(data) {
2224
- const isAlertOn = (localStorage.getItem('isCountryCodeToastOn'));
2225
- if (isAlertOn == 'true') {
2226
- this.callNumberToast.show = true;
2227
- this.callNumberToast.number = data.toNumber;
2228
- this.callNumberToast.displayNum = data.displayNumber;
2217
+ ngOnChanges(changes) {
2218
+ if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
2219
+ this.getContactList();
2220
+ // this.getUserCallSetting();
2221
+ setTimeout(() => {
2222
+ this.dialInputElement.nativeElement.focus();
2223
+ }, 0);
2229
2224
  }
2230
- this.callData.displayNum = data.displayNumber;
2231
- //this.callData.phone = data.toNumber;
2232
- await this.delay(this.toastTimeout);
2233
- this.dialedNumber = data.toNumber;
2234
- this.sanitizedNum = data.toNumber;
2235
- this.callNumberToast.show = false;
2236
- this.callNumberToast.number = '';
2237
- this.callNumberToast.displayNum = '';
2238
- }
2239
- delay(ms) {
2240
- return new Promise(resolve => setTimeout(resolve, ms));
2241
- }
2242
- onMinimise(isMinimised) {
2243
- this.isMinimised = isMinimised;
2244
- this.minimiseEvent.emit(isMinimised);
2245
2225
  }
2246
- handleNumberPaste(event) {
2247
- event.preventDefault();
2248
- const clipboardData = event.clipboardData || window.clipboardData;
2249
- const pastedData = clipboardData.getData('text');
2250
- // Log the pasted content to the console
2251
- if (pastedData) {
2252
- this.dialedNumber = pastedData;
2253
- this.sanitizedNum = pastedData;
2226
+ registerDragElement() {
2227
+ try {
2228
+ const elmnt = document.getElementById('dragparent1');
2229
+ let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
2230
+ const dragMouseDown = (e) => {
2231
+ // If the target is an input, return and don't initiate dragging
2232
+ if (e.target.tagName.toLowerCase() === 'input') {
2233
+ return;
2234
+ }
2235
+ e = e || window.event;
2236
+ // get the mouse cursor position at startup:
2237
+ pos3 = e.clientX;
2238
+ pos4 = e.clientY;
2239
+ document.onmouseup = closeDragElement;
2240
+ // call a function whenever the cursor moves:
2241
+ document.onmousemove = elementDrag;
2242
+ };
2243
+ const elementDrag = (e) => {
2244
+ e = e || window.event;
2245
+ // calculate the new cursor position:
2246
+ pos1 = pos3 - e.clientX;
2247
+ pos2 = pos4 - e.clientY;
2248
+ pos3 = e.clientX;
2249
+ pos4 = e.clientY;
2250
+ // set the element's new position:
2251
+ // elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
2252
+ // elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
2253
+ };
2254
+ const closeDragElement = () => {
2255
+ /* stop moving when mouse button is released:*/
2256
+ document.onmouseup = null;
2257
+ document.onmousemove = null;
2258
+ };
2259
+ // if (document.getElementById(elmnt.id + 'header')) {
2260
+ // /* if present, the header is where you move the DIV from:*/
2261
+ // document.getElementById(elmnt.id + 'header').onmousedown = dragMouseDown;
2262
+ // } else {
2263
+ // /* otherwise, move the DIV from anywhere inside the DIV:*/
2264
+ // elmnt.onmousedown = dragMouseDown;
2265
+ // }
2266
+ }
2267
+ catch (e) {
2268
+ console.log(e);
2254
2269
  }
2255
2270
  }
2256
- onEnter(num) {
2257
- console.log(num, 'number fn');
2258
- this.dialedNumber = this.dialedNumber + num;
2259
- this.sanitizedNum = this.dialedNumber;
2260
- this.showInputClearBtn = true;
2261
- this.numberDialed.emit(this.dialedNumber);
2262
- }
2263
- getUserCallSetting() {
2264
- const tkn = localStorage.getItem('ext_token');
2265
- this.extService.fetchCallerId(tkn || '').subscribe((resp) => {
2266
- if (resp.status == 200) {
2267
- //this.callPrefernce = resp.userSetting;
2268
- this.callPreference = resp.callerid;
2269
- this.getCallerIdList();
2271
+ addNumber(num) {
2272
+ if (num == '#' || num == '*' || num == '+' || Number.isInteger(num)) {
2273
+ if (num == '#') {
2274
+ new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
2270
2275
  }
2271
- });
2272
- }
2273
- onDedicatedNumSelect(id) {
2274
- this.selectedCallerId = id;
2275
- this.isCallerIdHidden = true;
2276
- this.extService.setCallerId(id);
2277
- }
2278
- cancelDialNumber() {
2279
- this.terminateCall = true;
2280
- this.callNumberToast.show = false;
2281
- }
2282
- handleDivKeydown(ev) {
2283
- if (this.dialedNumber.length == 0) {
2284
- this.dialInputElement.nativeElement.focus();
2285
- }
2286
- if (ev.key === 'Enter') {
2287
- // Check if the dialpad is open
2288
- if (!this.isDialpadHidden) {
2289
- if (this.dialedNumber.length > 2 && this.selectedCallerId) {
2290
- this.initiateCall();
2291
- }
2292
- if (!this.selectedCallerId) {
2293
- this.shakeDedicatedBtn = true;
2294
- setTimeout(() => {
2295
- this.shakeDedicatedBtn = false;
2296
- }, 10000);
2297
- }
2276
+ else if (num == '*') {
2277
+ new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
2278
+ }
2279
+ else {
2280
+ new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
2298
2281
  }
2282
+ this.dialedNumber += num;
2283
+ this.showInputClearBtn = true;
2284
+ this.numberDialed.emit(this.dialedNumber);
2285
+ this.onDialInputChange(this.dialedNumber);
2286
+ // this.dialInputRef.nativeElement.focus();
2299
2287
  }
2300
- }
2301
- onCallBtnMouseEnter(ev) {
2302
- if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2303
- this.shakeDedicatedBtn = true;
2288
+ else if (num === 'voicemail') {
2289
+ // this.showDedicatedPopup = true;
2290
+ this.router.navigate(['extension/voicemail/' + this.token]);
2304
2291
  }
2305
2292
  }
2306
- onCallBtnMouseLeave(ev) {
2307
- if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2308
- this.shakeDedicatedBtn = false;
2309
- }
2293
+ hideDialpad() {
2294
+ this.isDialpadHidden = true;
2295
+ this.closeDialpadEvent.emit();
2296
+ this.clearAllDialed();
2297
+ this.filteredContactList = [];
2310
2298
  }
2311
- acceptNewIncomingCall(call) {
2312
- //first cut the current call
2313
- //this.callData = call;
2314
- this.newIncomingCallData = call;
2299
+ onDialInputChange(inputVal) {
2300
+ try {
2301
+ // Updated regex to include x, X, ext., Ext., and ,
2302
+ const isNumericInput = /^[\d\s+\-]+$/.test(inputVal);
2303
+ let mainNumber = inputVal;
2304
+ // Check for extension indicators and split the input
2305
+ const extMatch = inputVal.match(/(x|X|ext\.|Ext\.|,)(.*)/);
2306
+ if (extMatch) {
2307
+ mainNumber = inputVal.substring(0, extMatch.index).trim();
2308
+ this.callData.extNum = extMatch[2].trim();
2309
+ }
2310
+ this.sanitizedNum = isNumericInput ? mainNumber.replace(/[\s\-]+/g, '') : mainNumber;
2311
+ this.callData.phone = isNumericInput ? this.sanitizedNum : '';
2312
+ this.showInputClearBtn = inputVal.length > 0;
2313
+ if (isNumericInput) {
2314
+ this.dialedNumber = new AsYouType().input(this.sanitizedNum);
2315
+ }
2316
+ // emit current number whenever input changes
2317
+ this.numberDialed.emit(this.dialedNumber);
2318
+ if (inputVal.length > 2) {
2319
+ this.filteredContactList = this.contactList.filter(contact => {
2320
+ const fullName = `${contact.firstName} ${contact.middleName} ${contact.lastName}`.toLowerCase();
2321
+ // return fullName.includes(this.sanitizedNum.toLowerCase()) || contact.numbersList.some(num => num.number.includes(this.sanitizedNum));
2322
+ }).slice(0, 2);
2323
+ }
2324
+ else {
2325
+ this.filteredContactList = [];
2326
+ }
2327
+ }
2328
+ catch (e) {
2329
+ console.log(e);
2330
+ }
2315
2331
  }
2316
- rejectNewIncomingCall(call) {
2317
- call.reject();
2318
- this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2319
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2332
+ getFirstLetter(name) {
2333
+ return name ? name.charAt(0).toUpperCase() : '';
2320
2334
  }
2321
- newIncomingCallInitiated() {
2322
- this.isCallInProgress = true;
2323
- this.newIncomingCalls = [];
2324
- this.incomingCallInitiated.emit();
2335
+ clearInput() {
2336
+ if (this.dialedNumber.length > 0) {
2337
+ this.dialedNumber = this.dialedNumber.slice(0, -1);
2338
+ this.showInputClearBtn = this.dialedNumber.length !== 0;
2339
+ this.onDialInputChange(this.dialedNumber);
2340
+ }
2325
2341
  }
2326
- incomingCallsNewInfo(data) {
2327
- this.incomingCallsList = data;
2328
- this.incomingCallsNewInfoEvent.emit(data);
2342
+ clearAllDialed() {
2343
+ this.dialedNumber = '';
2344
+ this.sanitizedNum = '';
2345
+ this.showInputClearBtn = false;
2329
2346
  }
2330
- ngOnDestroy() {
2331
- try {
2332
- console.log('Cleaning up C2cDialpadComponent');
2333
- // Unsubscribe from all subscriptions
2334
- if (this.subscriptions) {
2335
- this.subscriptions.unsubscribe();
2347
+ getCallerIdList() {
2348
+ this.extService.displayID(this.token || '').subscribe((res) => {
2349
+ //this.callerIdList = res.callerIdList.filter(item => item.type === "C2C Softphone Number");
2350
+ this.callerIdList = res.callerIdList.filter((item) => item.voiceFeature === true);
2351
+ // this.callerIdList = res.callerIdList;
2352
+ if (this.callerIdList.length == 1) {
2353
+ this.selectedCallerId = this.callerIdList[0];
2336
2354
  }
2337
- // End any active call
2338
- if (this.isCallInProgress) {
2339
- this.endCall();
2355
+ else {
2356
+ if (this.callPreference === 'alwaysAsk' || this.callPreference === 'smartDialing') {
2357
+ this.selectedCallerId = null;
2358
+ }
2359
+ else {
2360
+ this.selectedCallerId = this.callerIdList.find(item => (item.number == this.callPreference));
2361
+ }
2340
2362
  }
2341
- // Clear any timeouts or intervals if they exist
2342
- if (this.toastTimeout) {
2343
- clearTimeout(this.toastTimeout);
2363
+ });
2364
+ }
2365
+ getContactList() {
2366
+ this.twilioService.getContactList().subscribe((resp) => {
2367
+ if (resp.response == 'Success') {
2368
+ this.contactList = resp.phoneBook;
2344
2369
  }
2345
- console.log('C2cDialpadComponent cleanup complete');
2370
+ }, err => {
2371
+ console.log(err);
2372
+ });
2373
+ }
2374
+ getFullName(contact) {
2375
+ let fullName = contact.firstName || '';
2376
+ if (contact.middleName) {
2377
+ fullName += ` ${contact.middleName}`;
2346
2378
  }
2347
- catch (error) {
2348
- console.error('Error during component cleanup:', error);
2379
+ if (contact.lastName) {
2380
+ fullName += ` ${contact.lastName}`;
2349
2381
  }
2382
+ return fullName.trim();
2350
2383
  }
2351
- }
2352
- DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: IpAddressService }, { token: ExtensionService }, { token: i4.Router }], target: i0.ɵɵFactoryTarget.Component });
2353
- DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { isDialpadHidden: "isDialpadHidden" }, outputs: { closeDialpadEvent: "closeDialpadEvent", callInitiated: "callInitiated", endCallEvent: "endCallEvent", minimiseEvent: "minimiseEvent", incomingCallsNewInfoEvent: "incomingCallsNewInfoEvent", incomingCallInitiated: "incomingCallInitiated", numberDialed: "numberDialed" }, viewQueries: [{ propertyName: "dialInputElement", first: true, predicate: ["dialInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\r\n lib all called\r\n</div>\r\n<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <!-- <app-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent) = \"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\"></app-call-progress> -->\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
2354
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, decorators: [{
2355
- type: Component,
2356
- args: [{ selector: 'lib-dialbox', template: "<div>\r\n lib all called\r\n</div>\r\n<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <!-- <app-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent) = \"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\"></app-call-progress> -->\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"] }]
2357
- }], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: IpAddressService }, { type: ExtensionService }, { type: i4.Router }]; }, propDecorators: { isDialpadHidden: [{
2358
- type: Input
2359
- }], closeDialpadEvent: [{
2360
- type: Output
2361
- }], callInitiated: [{
2362
- type: Output
2363
- }], endCallEvent: [{
2364
- type: Output
2365
- }], minimiseEvent: [{
2366
- type: Output
2367
- }], incomingCallsNewInfoEvent: [{
2368
- type: Output
2369
- }], incomingCallInitiated: [{
2370
- type: Output
2371
- }], dialInputElement: [{
2372
- type: ViewChild,
2373
- args: ['dialInput']
2374
- }], numberDialed: [{
2375
- type: Output
2376
- }] } });
2377
-
2378
- const GlobalConstant = {
2379
- ErrorMsg500: "Unable to process request. Please try again later.",
2380
- isSMSVisible: true,
2381
- dedicatedNumText: 'C2C Number'
2382
- };
2383
-
2384
- class IncomingCallComponent {
2385
- constructor(extensionService, twilioService) {
2386
- this.extensionService = extensionService;
2387
- this.twilioService = twilioService;
2388
- this.showRingAnimation = true;
2389
- this.selectedIncomingCall = {};
2390
- this.twilioAuthId = '';
2391
- this.dedicatedNum = '';
2392
- this.recordCall = false;
2393
- this.shouldRecordCall = false;
2394
- this.isClickExpand = false;
2395
- this.disbaleEndCallBtn = true;
2396
- this.closeIncomingCallDiv = new EventEmitter();
2397
- this.incomingCallsNewList = new EventEmitter();
2398
- this.selectedIncomingCallInfo = new EventEmitter();
2399
- this.isMute = false;
2384
+ toggleCallerIdDiv() {
2385
+ this.isCallerIdHidden = !this.isCallerIdHidden;
2400
2386
  }
2401
- ngOnInit() {
2387
+ onContactSelect(contact) {
2388
+ this.dialedNumber = contact.numbersList[0].number;
2389
+ this.callData.name = this.getFullName(contact);
2390
+ this.callData.img = contact.image || 'assets/images/user.jpg';
2391
+ this.onDialInputChange(this.dialedNumber);
2392
+ this.filteredContactList = [];
2393
+ }
2394
+ endCall() {
2402
2395
  try {
2403
- this.twilioService.currentCall.subscribe(call => {
2404
- if (call) {
2405
- this.twilioCallData = call;
2406
- this.twilioAuthId = call.customParameters.get('twilioAuthId') || '';
2407
- if (!call.parameters) {
2408
- call.parameters = {};
2409
- }
2410
- this.sendIPforIncomingCall(this.twilioAuthId, '');
2411
- call.on('cancel', () => {
2412
- if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
2413
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
2414
- }
2415
- this.rejectCallFromList(call);
2416
- });
2417
- call.on('disconnect', () => {
2418
- if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
2419
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
2420
- }
2421
- this.rejectCallFromList(call);
2422
- });
2423
- }
2424
- });
2396
+ console.log('Ending call');
2397
+ this.isCallInProgress = false;
2398
+ this.filteredContactList = [];
2399
+ // Reset call data
2400
+ this.callData = {
2401
+ phone: '',
2402
+ name: '',
2403
+ img: 'assets/images/user.jpg',
2404
+ isIncomingCall: false,
2405
+ dial: false,
2406
+ displayNum: '',
2407
+ extNum: ''
2408
+ };
2409
+ // Reset dialed number
2410
+ this.dialedNumber = '';
2411
+ this.sanitizedNum = '';
2412
+ // Emit end call event
2413
+ this.endCallEvent.emit();
2414
+ console.log('Call ended successfully');
2425
2415
  }
2426
- catch (e) {
2427
- console.log(e);
2416
+ catch (error) {
2417
+ console.error('Error in endCall:', error);
2418
+ // Even if there's an error, try to reset the state
2419
+ this.isCallInProgress = false;
2420
+ this.callData = {
2421
+ phone: '',
2422
+ name: '',
2423
+ img: 'assets/images/user.jpg',
2424
+ isIncomingCall: false,
2425
+ dial: false,
2426
+ displayNum: '',
2427
+ extNum: ''
2428
+ };
2429
+ this.endCallEvent.emit();
2428
2430
  }
2429
2431
  }
2430
- acceptCallFromList(data) {
2431
- console.log(data, 'checking dii');
2432
- data.accept();
2433
- // data.parameters['isCallConnected'] = true;
2434
- data.isCallConnected = true;
2435
- this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
2436
- if (this.shouldRecordCall) { // default recording
2437
- this.extensionService.setCallSid(this.CallSid, this.recordCall);
2438
- this.closeIncomingCallWrapper(1);
2432
+ // async initiateCall() {
2433
+ // try {
2434
+ // console.log('Initiating call with number:', this.dialedNumber);
2435
+ // if (!this.dialedNumber && this.lastDialed) {
2436
+ // console.log('Using last dialed number:', this.lastDialed.number);
2437
+ // this.sanitizedNum = this.lastDialed.number;
2438
+ // }
2439
+ // const isInvalid = await this.isInvalidNumber();
2440
+ // if (isInvalid) {
2441
+ // console.error('Invalid number format');
2442
+ // return false;
2443
+ // }
2444
+ // this.saveLastDialed();
2445
+ // this.isSavedContactDialled();
2446
+ // // Check payment status
2447
+ // this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
2448
+ // if (this.isPaymentDue) {
2449
+ // console.warn('Payment is due');
2450
+ // swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
2451
+ // return false;
2452
+ // }
2453
+ // // Check if dialing own number
2454
+ // if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2455
+ // console.error('Attempted to dial own number');
2456
+ // swal('Error', 'You cannot dial your own number');
2457
+ // return false;
2458
+ // }
2459
+ // // Check microphone permissions
2460
+ // const hasPermission = await this.checkMicrophonePermission();
2461
+ // if (!hasPermission) {
2462
+ // console.warn('Microphone permission not granted');
2463
+ // await this.askForMicrophonePermission();
2464
+ // return false;
2465
+ // }
2466
+ // if (!this.selectedCallerId) {
2467
+ // console.error('No caller ID selected');
2468
+ // this.shakeDedicatedBtn = true;
2469
+ // this.showDialAlert('Please select a C2C number to call from');
2470
+ // setTimeout(() => {
2471
+ // this.shakeDedicatedBtn = false;
2472
+ // }, 3000);
2473
+ // return false;
2474
+ // }
2475
+ // console.log('Getting number with country code...');
2476
+ // this.callData.displayNum = '';
2477
+ // try {
2478
+ // await this.getToNumber(this.sanitizedNum);
2479
+ // } catch (error) {
2480
+ // console.error('Error getting number with country code:', error);
2481
+ // this.showDialAlert('Error processing number. Please try again.');
2482
+ // return false;
2483
+ // }
2484
+ // if (this.terminateCall) {
2485
+ // console.log('Call terminated by user');
2486
+ // this.terminateCall = false;
2487
+ // return false;
2488
+ // }
2489
+ // // Prepare call data
2490
+ // this.callData = {
2491
+ // ...this.callData,
2492
+ // phone: this.sanitizedNum,
2493
+ // isIncomingCall: false,
2494
+ // dial: true,
2495
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2496
+ // timestamp: new Date().toISOString()
2497
+ // };
2498
+ // console.log('Initiating call with data:', this.callData);
2499
+ // this.isCallInProgress = true;
2500
+ // this.callInitiated.emit({ ...this.callData });
2501
+ // return true;
2502
+ // } catch (error) {
2503
+ // console.error('Error in initiateCall:', error);
2504
+ // this.showDialAlert('Failed to initiate call. Please try again.');
2505
+ // this.isCallInProgress = false;
2506
+ // return false;
2507
+ // }
2508
+ // //this.clearAllDialed();
2509
+ // // } else {
2510
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2511
+ // // }
2512
+ // }
2513
+ // async initiateCall() {
2514
+ // if (!this.dialedNumber && this.lastDialed) {
2515
+ // this.sanitizedNum = this.lastDialed.number;
2516
+ // }
2517
+ // const isInvalid = await this.isInvalidNumber();
2518
+ // if (isInvalid) {
2519
+ // return false;
2520
+ // }
2521
+ // this.saveLastDialed();
2522
+ // this.isSavedContactDialled();
2523
+ // //let isCallerIdSet = await this.isCallerIdSet();
2524
+ // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
2525
+ // if (this.isPaymentDue) {
2526
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2527
+ // return;
2528
+ // }
2529
+ // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
2530
+ // // if (!this.isTrialPeriodOver) {
2531
+ // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
2532
+ // swal('Error', 'You can not dial this number');
2533
+ // return;
2534
+ // }
2535
+ // const hasPermission = await this.checkMicrophonePermission();
2536
+ // if (hasPermission) {
2537
+ // if (this.selectedCallerId) {
2538
+ // //clear displayNum if value is binded from previous call
2539
+ // this.callData.displayNum = '';
2540
+ // // get number to be dialled from backend
2541
+ // await this.getToNumber(this.sanitizedNum);
2542
+ // if (this.terminateCall) {
2543
+ // this.terminateCall = false;
2544
+ // return;
2545
+ // }
2546
+ // this.callData.phone = this.sanitizedNum;
2547
+ // this.callData.isIncomingCall = false;
2548
+ // this.callData.dial = true;
2549
+ // if (!this.isSmartDialCall) {
2550
+ // this.callData.from = this.selectedCallerId.number;
2551
+ // }
2552
+ // this.isCallInProgress = true;
2553
+ // this.callData = {
2554
+ // ...this.callData,
2555
+ // phone: this.sanitizedNum,
2556
+ // isIncomingCall: false,
2557
+ // dial: true,
2558
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2559
+ // timestamp: new Date().toISOString()
2560
+ // };
2561
+ // console.log('Initiating call with data:', this.callData);
2562
+ // this.isCallInProgress = true;
2563
+ // this.callInitiated.emit({ ...this.callData });
2564
+ // return true;
2565
+ // } else {
2566
+ // this.shakeDedicatedBtn = true;
2567
+ // this.showDialAlert('Select a C2C number to call');
2568
+ // setTimeout(() => {
2569
+ // this.shakeDedicatedBtn = false;
2570
+ // }, 3000);
2571
+ // return false;
2572
+ // }
2573
+ // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2574
+ // } else {
2575
+ // await this.askForMicrophonePermission();
2576
+ // }
2577
+ // //this.clearAllDialed();
2578
+ // // } else {
2579
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2580
+ // // }
2581
+ // }
2582
+ // async initiateCall() {
2583
+ // try{
2584
+ // if (!this.dialedNumber && this.lastDialed) {
2585
+ // this.sanitizedNum = this.lastDialed.number;
2586
+ // }
2587
+ // const isInvalid = await this.isInvalidNumber();
2588
+ // if (isInvalid) {
2589
+ // return false;
2590
+ // }
2591
+ // this.saveLastDialed();
2592
+ // this.isSavedContactDialled();
2593
+ // //let isCallerIdSet = await this.isCallerIdSet();
2594
+ // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
2595
+ // if (this.isPaymentDue) {
2596
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2597
+ // return false;
2598
+ // }
2599
+ // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
2600
+ // // if (!this.isTrialPeriodOver) {
2601
+ // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
2602
+ // swal('Error', 'You can not dial this number');
2603
+ // return false;
2604
+ // }
2605
+ // const hasPermission = await this.checkMicrophonePermission();
2606
+ // if (hasPermission) {
2607
+ // if (this.selectedCallerId) {
2608
+ // //clear displayNum if value is binded from previous call
2609
+ // this.callData.displayNum = '';
2610
+ // // get number to be dialled from backend
2611
+ // await this.getToNumber(this.sanitizedNum);
2612
+ // if (this.terminateCall) {
2613
+ // this.terminateCall = false;
2614
+ // return;
2615
+ // }
2616
+ // this.callData.phone = this.sanitizedNum;
2617
+ // this.callData.isIncomingCall = false;
2618
+ // this.callData.dial = true;
2619
+ // if (!this.isSmartDialCall) {
2620
+ // this.callData.from = this.selectedCallerId.number;
2621
+ // }
2622
+ // this.isCallInProgress = true;
2623
+ // this.callData = {
2624
+ // ...this.callData,
2625
+ // phone: this.sanitizedNum,
2626
+ // isIncomingCall: false,
2627
+ // dial: true,
2628
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2629
+ // timestamp: new Date().toISOString()
2630
+ // };
2631
+ // console.log('Initiating call with data:', this.callData);
2632
+ // this.isCallInProgress = true;
2633
+ // this.callInitiated.emit({ ...this.callData });
2634
+ // return true;
2635
+ // } else {
2636
+ // this.shakeDedicatedBtn = true;
2637
+ // this.showDialAlert('Select a C2C number to call');
2638
+ // setTimeout(() => {
2639
+ // this.shakeDedicatedBtn = false;
2640
+ // }, 3000);
2641
+ // return false;
2642
+ // }
2643
+ // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2644
+ // } else {
2645
+ // await this.askForMicrophonePermission();
2646
+ // }
2647
+ // //this.clearAllDialed();
2648
+ // // } else {
2649
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2650
+ // // }
2651
+ // }catch(e){
2652
+ // console.error('Error in initiateCall:', e);
2653
+ // this.showDialAlert('Failed to initiate call. Please try again.');
2654
+ // this.isCallInProgress = false;
2655
+ // return false;
2656
+ // }
2657
+ // }
2658
+ async initiateCall() {
2659
+ try {
2660
+ if (!this.dialedNumber && this.lastDialed) {
2661
+ this.sanitizedNum = this.lastDialed.number;
2439
2662
  }
2440
- else { // manual recording
2441
- this.extensionService.setCallSid(this.CallSid, this.recordCall);
2442
- this.closeIncomingCallWrapper(1);
2663
+ const isInvalid = await this.isInvalidNumber();
2664
+ if (isInvalid) {
2665
+ return false;
2443
2666
  }
2444
- });
2445
- }
2446
- rejectCallFromList(data) {
2447
- if (!data)
2448
- return;
2449
- if (data.reject)
2450
- data.reject();
2451
- if (data.disconnect)
2452
- data.disconnect();
2453
- if (data.parameters) {
2454
- data.parameters['isCallConnected'] = false; // Should be false when rejecting
2455
- }
2456
- if (data.customParameters) {
2457
- this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered');
2458
- }
2459
- if (this.newIncomingCallsList && data && data.parameters && data.parameters.CallSid) {
2460
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== data.parameters.CallSid);
2461
- this.incomingCallsNewList.emit(this.newIncomingCallsList);
2462
- if (this.newIncomingCallsList.length == 0) {
2463
- this.closeIncomingCallDiv.emit({ show: 0, call: data });
2667
+ // this.saveLastDialed();
2668
+ this.isSavedContactDialled();
2669
+ this.isPaymentDue = localStorage.getItem('paymentDue') === 'false' ? false : true;
2670
+ if (this.isPaymentDue) {
2671
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2672
+ return false;
2673
+ }
2674
+ this.isTrialPeriodOver = localStorage.getItem('trialOver') === 'false' ? false : true;
2675
+ if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2676
+ // swal('Error', 'You can not dial this number');
2677
+ return false;
2678
+ }
2679
+ // const hasPermission = await this.checkMicrophonePermission();
2680
+ // if (!hasPermission) {
2681
+ // await this.askForMicrophonePermission();
2682
+ // return false;
2683
+ // }
2684
+ if (!this.selectedCallerId) {
2685
+ this.shakeDedicatedBtn = true;
2686
+ this.showDialAlert('Select a C2C number to call');
2687
+ setTimeout(() => {
2688
+ this.shakeDedicatedBtn = false;
2689
+ }, 3000);
2690
+ return false;
2691
+ }
2692
+ // Clear displayNum if value is bound from previous call
2693
+ this.callData.displayNum = '';
2694
+ // Get number to be dialed from backend
2695
+ // await this.getToNumber(this.sanitizedNum);
2696
+ if (this.terminateCall) {
2697
+ this.terminateCall = false;
2698
+ return;
2464
2699
  }
2700
+ // Update call data in a single operation
2701
+ this.callData = {
2702
+ ...this.callData,
2703
+ phone: this.sanitizedNum,
2704
+ isIncomingCall: false,
2705
+ dial: true,
2706
+ from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2707
+ timestamp: new Date().toISOString()
2708
+ };
2709
+ console.log('Initiating call with data:', this.callData);
2710
+ this.isCallInProgress = true;
2711
+ this.callInitiated.emit({ ...this.callData });
2712
+ return true;
2465
2713
  }
2466
- }
2467
- closeIncomingCallWrapper(val) {
2468
- this.closeIncomingCallDiv.emit({ show: val, call: this.twilioCallData });
2469
- }
2470
- toggleMute(data) {
2471
- this.isMute = !this.isMute;
2472
- data.mute(this.isMute);
2473
- }
2474
- sendIPforIncomingCall(recordId, callstatus) {
2475
- return new Promise((resolve, reject) => {
2476
- this.extensionService.getIPDetailsForCall(recordId, callstatus).subscribe((res) => {
2477
- const resp = res;
2478
- if (res.status == 200) {
2479
- if (resp.callAuth) {
2480
- this.CallSid = resp.callAuth.callSid;
2481
- this.recordCall = resp.callAuth.recordCall;
2482
- // Handle the recordCall flag
2483
- if (resp.callAuth.recordCall) {
2484
- this.shouldRecordCall = true;
2485
- }
2486
- else {
2487
- this.shouldRecordCall = false;
2488
- }
2489
- }
2490
- else {
2491
- // swal("Error", "Missing call authentication details.", "error");
2492
- }
2493
- resolve();
2494
- }
2495
- else {
2496
- swal("Error", resp.message.join("<br/>"), "error");
2497
- resolve();
2498
- }
2499
- }, (error) => {
2500
- swal("Error", GlobalConstant.ErrorMsg500, "error");
2501
- resolve();
2502
- });
2503
- });
2504
- }
2505
- onUserInfoByCallSid() {
2506
- if (this.selectedIncomingCall && this.selectedIncomingCall.userInfo) {
2714
+ catch (e) {
2715
+ console.error('Error in initiateCall:', e);
2716
+ this.showDialAlert('Failed to initiate call. Please try again.');
2717
+ this.isCallInProgress = false;
2718
+ return false;
2507
2719
  }
2508
- return this.selectedIncomingCall ? Object.keys(this.selectedIncomingCall).length ? true : false : false;
2509
2720
  }
2510
- onClickExpand(data) {
2511
- if (this.selectedIncomingCall === data && this.isClickExpand) {
2512
- this.isClickExpand = false;
2513
- this.selectedIncomingCall = null;
2514
- this.selectedIncomingCallInfo.emit({});
2515
- return;
2516
- }
2517
- this.isClickExpand = true;
2518
- this.selectedIncomingCall = data;
2519
- if (this.selectedIncomingCall) {
2520
- this.selectedIncomingCall['isClickExpand'] = true;
2521
- if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
2522
- this.newIncomingCallsList.forEach((call) => {
2523
- if (call !== this.selectedIncomingCall) {
2524
- call['isClickExpand'] = false;
2525
- }
2526
- });
2721
+ async isInvalidNumber() {
2722
+ try {
2723
+ if (this.sanitizedNum == '') {
2724
+ this.showDialAlert('Invalid Number');
2725
+ return true;
2527
2726
  }
2528
- this.selectedIncomingCallInfo.emit(this.selectedIncomingCall);
2529
- if (!this.selectedIncomingCall.userInfo || this.selectedIncomingCall.userInfo.status == 201) {
2530
- this.getUserInformation(this.selectedIncomingCall);
2727
+ const validNumberPattern = /^[+\d\s()-]*$/; // Regular expression to match valid characters
2728
+ const phoneNumber = this.sanitizedNum;
2729
+ if (!validNumberPattern.test(phoneNumber)) {
2730
+ this.showDialAlert('Invalid Number');
2731
+ return true;
2531
2732
  }
2733
+ return false;
2734
+ }
2735
+ catch (error) {
2736
+ this.showDialAlert('Invalid Number');
2737
+ return true; // Return true if an error occurred, meaning the number is invalid
2532
2738
  }
2533
2739
  }
2534
- getUserInformation(incomingCallData) {
2535
- let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
2536
- this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
2537
- setTimeout(() => {
2538
- incomingCallData['userInfo'] = response;
2539
- }, 5000);
2540
- }, error => {
2541
- console.error('Error starting recording', error);
2740
+ // saveLastDialed() {
2741
+ // const contact = this.filteredContactList.find(c => c.numbersList.some(n => n.number === this.dialedNumber));
2742
+ // if (contact) {
2743
+ // this.lastDialed = {
2744
+ // name: contact.name,
2745
+ // image: contact.image,
2746
+ // number: this.dialedNumber
2747
+ // };
2748
+ // } else {
2749
+ // if(this.dialedNumber){
2750
+ // this.lastDialed = { number: this.dialedNumber };
2751
+ // }
2752
+ // }
2753
+ // }
2754
+ isSavedContactDialled() {
2755
+ let phoneNum = this.sanitizedNum.replace(/\s+/g, '');
2756
+ let contact = this.contactList.filter(contact => {
2757
+ // return contact.numbersList.some(num => num.number === phoneNum)
2542
2758
  });
2759
+ if (contact.length) {
2760
+ this.callData.name = `${contact[0].firstName} ${contact[0].middleName} ${contact[0].lastName}`.toLowerCase();
2761
+ this.callData.img = contact[0].image || 'assets/images/user.jpg';
2762
+ this.callData.phone = this.sanitizedNum;
2763
+ return true;
2764
+ }
2765
+ return false;
2543
2766
  }
2544
- fromEntries(entries) {
2545
- return entries.reduce((acc, [key, value]) => {
2546
- acc[key] = value;
2547
- return acc;
2548
- }, {});
2549
- }
2550
- }
2551
- IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }], target: i0.ɵɵFactoryTarget.Component });
2552
- IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
2553
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
2554
- type: Component,
2555
- args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"] }]
2556
- }], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }]; }, propDecorators: { incomingCallData: [{
2557
- type: Input
2558
- }], newIncomingCallsList: [{
2559
- type: Input
2560
- }], closeIncomingCallDiv: [{
2561
- type: Output
2562
- }], incomingCallsNewList: [{
2563
- type: Output
2564
- }], selectedIncomingCallInfo: [{
2565
- type: Output
2566
- }] } });
2567
-
2568
- class CallProgressComponent {
2569
- constructor(extensionService, cdr) {
2570
- this.extensionService = extensionService;
2571
- this.cdr = cdr;
2572
- this.endCallEvent = new EventEmitter();
2573
- this.incomingCallsNewInfo = new EventEmitter();
2574
- this.minimiseEvent = new EventEmitter();
2575
- this.showRingAnimation = false;
2576
- this.timer = '00:00';
2577
- this.showKeypad = false;
2578
- this.keypadVal = keypad;
2579
- this.callInput = '';
2580
- this.isMute = false;
2581
- this.disbaleEndCallBtn = true;
2582
- this.showClearBtn = false;
2583
- this.isCollops = false;
2584
- // Incoming call variables
2585
- this.incomingCallDiv = false;
2586
- this.showCallProgressEvent = new EventEmitter();
2587
- this.incomingCallInitiated = new EventEmitter();
2588
- this.isRecording = false;
2589
- this.isPaused = false;
2590
- this.timeElapsed = 0; // in seconds
2591
- this.recordCall = false;
2592
- this.callStatus = 'ringing';
2593
- this.isMinimised = false;
2594
- }
2595
- ngOnInit() {
2596
- console.log('Call Progress Component');
2767
+ showDialAlert(message) {
2768
+ this.dialAlert = {
2769
+ msg: message,
2770
+ show: true
2771
+ };
2772
+ setTimeout(() => {
2773
+ this.dialAlert.show = false;
2774
+ }, 3000);
2597
2775
  }
2598
- ngOnChanges(changes) {
2599
- console.log('Call Progress Component ngOnChanges');
2600
- if (changes['callData']) {
2601
- console.log('Call Progress Component ngOnChanges callData', changes['callData']);
2602
- if (changes['callData'].currentValue.isIncomingCall) {
2603
- this.incomingCallDiv = true;
2776
+ async isCallerIdSet() {
2777
+ try {
2778
+ const tkn = localStorage.getItem('ext_token');
2779
+ const res = await this.extService.fetchCallerId(tkn || '').toPromise();
2780
+ if (res.status == 200) {
2781
+ localStorage.setItem('trialOver', res.trialOver);
2782
+ this.twilioService.isTrialOver.next(res.trialOver);
2783
+ localStorage.setItem('paymentDue', res.paymentDue);
2784
+ this.twilioService.isPaymentDue.next(res.paymentDue);
2785
+ }
2786
+ if (res.callerid) {
2787
+ localStorage.setItem('callerID', res.callerid);
2788
+ this.extService.changeMessage(res.callerid);
2604
2789
  }
2605
2790
  else {
2606
- //for outgoing call
2607
- this.startCall(changes['callData'].currentValue);
2791
+ localStorage.setItem('callerID', 'Not set');
2792
+ this.extService.changeMessage('Not set');
2608
2793
  }
2794
+ return (localStorage.getItem('callerID') !== 'Not set');
2609
2795
  }
2610
- if (changes['newIncomingCallData']) {
2611
- try {
2612
- if (changes['newIncomingCallData'].currentValue) {
2613
- if (this.call && (this.call.status() == 'open')) {
2614
- this.call.disconnect();
2615
- this.call = changes['newIncomingCallData'].currentValue;
2616
- this.call?.accept();
2617
- this.callData.phone = this.call?.parameters['From'];
2618
- this.callData.name = this.call?.customParameters.get('name');
2619
- this.callData.img = this.call?.customParameters.get('image') || 'assets/images/user.jpg';
2620
- this.incomingCallInitiated.emit();
2621
- this.startTimer();
2622
- }
2623
- }
2624
- }
2625
- catch (e) {
2626
- console.log(e);
2627
- }
2796
+ catch (e) {
2797
+ console.log(e);
2798
+ return false;
2628
2799
  }
2629
2800
  }
2630
- ngAfterViewInit() { }
2631
- async startCall(callData) {
2801
+ async checkMicrophonePermission() {
2632
2802
  try {
2633
- this.showRingAnimation = true;
2634
- const payload = {
2635
- channelId: environment.channelId,
2636
- userId: localStorage.getItem('userId'),
2637
- to: callData.phone,
2638
- scope: 'local',
2639
- fromNumber: callData.from
2640
- };
2641
- const response = await this.initiateCall(payload);
2642
- if (response.status == 200) {
2643
- const { id: callAuthId, recordCall } = await this.getCallAuthId(response);
2644
- this.getUserInformation(callAuthId);
2645
- this.recordCall = recordCall; // Store the recordCall value
2646
- const tokenData = await this.getOutgoingCallToken(callAuthId);
2647
- await this.connectToDevice(tokenData.token, callData);
2648
- // Poll the status for 30-45 seconds
2649
- this.pollCallStatus(callAuthId);
2803
+ const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2804
+ stream.getTracks().forEach(track => track.stop());
2805
+ return true;
2806
+ }
2807
+ catch (error) {
2808
+ if (error instanceof DOMException && error.name === 'NotAllowedError') {
2809
+ return false;
2650
2810
  }
2651
- else if (response.status == 201) {
2652
- swal("Error", response.message.join("<br/>"), "error");
2653
- this.endCall();
2811
+ else {
2812
+ return false;
2654
2813
  }
2655
2814
  }
2815
+ }
2816
+ async askForMicrophonePermission() {
2817
+ try {
2818
+ const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
2819
+ stream.getTracks().forEach(track => track.stop());
2820
+ }
2656
2821
  catch (error) {
2657
- this.showRingAnimation = false;
2658
- this.handleError(error);
2659
- this.endCall();
2822
+ console.error('User denied microphone permission:', error);
2660
2823
  }
2661
2824
  }
2662
- async initiateCall(payload) {
2663
- return await this.extensionService.initiateCall(payload).toPromise();
2664
- }
2665
- async getCallAuthId(response) {
2666
- return {
2667
- id: response.callauth.id,
2668
- recordCall: response.callauth.recordCall
2669
- };
2670
- }
2671
- async getOutgoingCallToken(callAuthId) {
2672
- return await this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
2673
- }
2674
- async connectToDevice(token, callData) {
2675
- const options = {
2676
- codecPreferences: ['opus', 'pcmu'],
2677
- closeProtection: true,
2678
- };
2679
- this.device = new Device(token.value, options);
2680
- this.call = await this.device.connect({
2681
- params: {
2682
- From: callData.from,
2683
- To: callData.phone,
2684
- Env: environment.abb,
2685
- Token: token.id,
2686
- Ext: callData.extNum
2687
- },
2688
- rtcConstraints: { audio: { deviceId: 'default' } },
2689
- });
2690
- this.setupEventListeners();
2691
- }
2692
- setupEventListeners() {
2693
- this.startTimer();
2694
- this.device?.on('error', (err) => {
2695
- console.log(err);
2696
- this.showRingAnimation = false;
2697
- this.stopTimer();
2698
- });
2699
- this.call?.on('error', (error) => {
2700
- this.showRingAnimation = false;
2701
- this.stopTimer();
2702
- });
2703
- this.call?.on('disconnect', () => {
2704
- this.endCall();
2705
- });
2706
- this.call?.on('ringing', () => {
2707
- });
2708
- this.call?.on('reject', () => {
2709
- this.endCall();
2710
- });
2711
- this.call?.on('accept', () => {
2712
- this.showRingAnimation = false;
2713
- this.disbaleEndCallBtn = false;
2714
- // Start recording if recordCall is true and call is accepted for 30 seconds
2715
- // if (this.recordCall) {
2716
- // setTimeout(() => {
2717
- // if (this.isRecording) return; // If already recording, skip
2718
- // this.startRecording();
2719
- // }, 30000);
2720
- // } else {
2721
- // this.stopRecording();
2722
- // }
2723
- });
2724
- this.call?.on('messageReceived', (message) => {
2725
- });
2726
- }
2727
- startTimer() {
2728
- let seconds = 0;
2729
- this.intervalId = setInterval(() => {
2730
- seconds++;
2731
- this.timer = this.formatTime(seconds);
2732
- }, 1000);
2733
- }
2734
- stopTimer() {
2735
- clearInterval(this.intervalId);
2736
- this.timer = '00:00';
2737
- }
2738
- formatTime(totalSeconds) {
2739
- const minutes = Math.floor(totalSeconds / 60);
2740
- const seconds = totalSeconds % 60;
2741
- return `${this.pad(minutes)}:${this.pad(seconds)}`;
2742
- }
2743
- pad(value) {
2744
- return value < 10 ? `0${value}` : `${value}`;
2825
+ // below function is to get the country code with number from server
2826
+ async getToNumber(dialedNumber) {
2827
+ if (dialedNumber[0] !== '+') {
2828
+ // this is case when user geolocation dial code is on
2829
+ let ipAddress = await this.ipService.getIpAddressInfo().toPromise();
2830
+ const res = await this.twilioService.getToNumber(dialedNumber, ipAddress.address.countryCode).toPromise();
2831
+ if (res.status == 200) {
2832
+ this.toastTimeout = res.timeInterval * 1000;
2833
+ await this.showNumberToast(res);
2834
+ }
2835
+ }
2745
2836
  }
2746
- handleError(error) {
2747
- swal("Error", error, "error");
2837
+ isAlertEnable() {
2838
+ return localStorage.getItem('isAlertEnable');
2748
2839
  }
2749
- endCall() {
2750
- this.endCallEvent.emit();
2751
- if (this.call) {
2752
- this.call.disconnect();
2840
+ async showNumberToast(data) {
2841
+ const isAlertOn = (localStorage.getItem('isCountryCodeToastOn'));
2842
+ if (isAlertOn == 'true') {
2843
+ this.callNumberToast.show = true;
2844
+ this.callNumberToast.number = data.toNumber;
2845
+ this.callNumberToast.displayNum = data.displayNumber;
2753
2846
  }
2754
- this.showRingAnimation = false;
2755
- this.stopTimer();
2756
- this.maximiseDialpad();
2757
- }
2758
- toggleMute() {
2759
- this.isMute = !this.isMute;
2760
- this.call?.mute(this.isMute);
2847
+ this.callData.displayNum = data.displayNumber;
2848
+ //this.callData.phone = data.toNumber;
2849
+ await this.delay(this.toastTimeout);
2850
+ this.dialedNumber = data.toNumber;
2851
+ this.sanitizedNum = data.toNumber;
2852
+ this.callNumberToast.show = false;
2853
+ this.callNumberToast.number = '';
2854
+ this.callNumberToast.displayNum = '';
2761
2855
  }
2762
- toggleKeypad() {
2763
- this.showKeypad = !this.showKeypad;
2764
- this.callInput = '';
2856
+ delay(ms) {
2857
+ return new Promise(resolve => setTimeout(resolve, ms));
2765
2858
  }
2766
- onCallInputs(num) {
2767
- try {
2768
- if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
2769
- if (num == '#') {
2770
- new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
2771
- }
2772
- else if (num == '*') {
2773
- new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
2774
- }
2775
- else {
2776
- new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
2777
- }
2778
- this.callInput = this.callInput + String(num);
2779
- this.showClearBtn = true;
2780
- }
2781
- let str = String(num);
2782
- this.call?.sendDigits(str);
2783
- }
2784
- catch (e) {
2785
- console.log(e);
2786
- }
2859
+ onMinimise(isMinimised) {
2860
+ this.isMinimised = isMinimised;
2861
+ this.minimiseEvent.emit(isMinimised);
2787
2862
  }
2788
- onCallInputEnter(ev) {
2789
- try {
2790
- this.call?.sendDigits(String(ev.key));
2791
- }
2792
- catch (e) {
2793
- console.log(e);
2863
+ handleNumberPaste(event) {
2864
+ event.preventDefault();
2865
+ const clipboardData = event.clipboardData || window.clipboardData;
2866
+ const pastedData = clipboardData.getData('text');
2867
+ // Log the pasted content to the console
2868
+ if (pastedData) {
2869
+ this.dialedNumber = pastedData;
2870
+ this.sanitizedNum = pastedData;
2794
2871
  }
2795
2872
  }
2796
- closeIncomingCall(data) {
2797
- // this.incomingCallDiv = false;
2798
- if (data.show) {
2799
- //this.showCallProgressEvent.emit()
2800
- // handle incoming call accepted
2801
- this.startTimer();
2802
- this.disbaleEndCallBtn = false;
2803
- this.call = data.call;
2804
- const incomingDetail = this.extensionService.getCallSid();
2805
- this.incomingRecordCall = incomingDetail.recordCall;
2806
- // Start recording if the call is answered and recording is enabled
2807
- if (this.incomingRecordCall) {
2808
- this.startRecording();
2809
- }
2810
- else {
2811
- this.isRecording = false;
2812
- }
2813
- this.cdr.detectChanges();
2814
- }
2815
- else {
2816
- // incoming call rejected
2817
- this.endCallEvent.emit();
2818
- }
2873
+ onEnter(num) {
2874
+ console.log(num, 'number fn');
2875
+ this.dialedNumber = this.dialedNumber + num;
2876
+ this.sanitizedNum = this.dialedNumber;
2877
+ this.showInputClearBtn = true;
2878
+ this.numberDialed.emit(this.dialedNumber);
2819
2879
  }
2820
- clearInputs() {
2821
- this.callInput = this.callInput.slice(0, -1);
2880
+ getUserCallSetting() {
2881
+ const tkn = localStorage.getItem('ext_token');
2882
+ this.extService.fetchCallerId(tkn || '').subscribe((resp) => {
2883
+ if (resp.status == 200) {
2884
+ //this.callPrefernce = resp.userSetting;
2885
+ this.callPreference = resp.callerid;
2886
+ this.getCallerIdList();
2887
+ }
2888
+ });
2822
2889
  }
2823
- minimiseDialpad() {
2824
- this.minimiseEvent.emit(true);
2825
- this.isMinimised = true;
2890
+ onDedicatedNumSelect(id) {
2891
+ this.selectedCallerId = id;
2892
+ this.isCallerIdHidden = true;
2893
+ this.extService.setCallerId(id);
2826
2894
  }
2827
- maximiseDialpad() {
2828
- this.minimiseEvent.emit(false);
2829
- this.isMinimised = false;
2895
+ cancelDialNumber() {
2896
+ this.terminateCall = true;
2897
+ this.callNumberToast.show = false;
2830
2898
  }
2831
- toggleRecording() {
2832
- if (this.isRecording) {
2833
- this.stopRecording();
2899
+ handleDivKeydown(ev) {
2900
+ if (this.dialedNumber.length == 0) {
2901
+ this.dialInputElement.nativeElement.focus();
2834
2902
  }
2835
- else {
2836
- this.startRecording();
2903
+ if (ev.key === 'Enter') {
2904
+ // Check if the dialpad is open
2905
+ if (!this.isDialpadHidden) {
2906
+ if (this.dialedNumber.length > 2 && this.selectedCallerId) {
2907
+ this.initiateCall();
2908
+ }
2909
+ if (!this.selectedCallerId) {
2910
+ this.shakeDedicatedBtn = true;
2911
+ setTimeout(() => {
2912
+ this.shakeDedicatedBtn = false;
2913
+ }, 10000);
2914
+ }
2915
+ }
2837
2916
  }
2838
2917
  }
2839
- startRecording() {
2840
- let sid;
2841
- const details = this.extensionService.getCallSid();
2842
- this.incomingCallSid = details.callSid;
2843
- this.incomingRecordCall = details.recordCall;
2844
- sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2845
- // if (!this.incomingRecordCall && !this.recordCall) {
2846
- // return;
2847
- // }
2848
- this.extensionService.getCallRecording(sid).subscribe(response => {
2849
- this.isRecording = true;
2850
- this.isPaused = false;
2851
- this.timeElapsed = 0;
2852
- this.startTimer1();
2853
- }, error => {
2854
- console.error('Error starting recording', error);
2855
- });
2856
- }
2857
- stopRecording() {
2858
- // if (!this.incomingRecordCall && !this.recordCall) {
2859
- // return;
2860
- // }
2861
- this.isRecording = false;
2862
- this.isPaused = false;
2863
- if (this.timerSubscription) {
2864
- this.timerSubscription.unsubscribe();
2918
+ onCallBtnMouseEnter(ev) {
2919
+ if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2920
+ this.shakeDedicatedBtn = true;
2865
2921
  }
2866
2922
  }
2867
- pauseRecording() {
2868
- const details = this.extensionService.getCallSid();
2869
- this.incomingCallSid = details.callSid;
2870
- this.incomingRecordCall = details.recordCall;
2871
- const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2872
- // if (!this.incomingRecordCall && !this.recordCall) {
2873
- // return;
2874
- // }
2875
- this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
2876
- this.stopRecordingTimer();
2877
- this.isPaused = true;
2878
- }, error => {
2879
- console.error('Error pausing recording:', error);
2880
- // Consider updating the UI to show the error state
2881
- });
2923
+ onCallBtnMouseLeave(ev) {
2924
+ if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2925
+ this.shakeDedicatedBtn = false;
2926
+ }
2882
2927
  }
2883
- resumeRecording() {
2884
- let sid;
2885
- const details = this.extensionService.getCallSid();
2886
- this.incomingCallSid = details.callSid;
2887
- this.incomingRecordCall = details.recordCall;
2888
- sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2889
- // if (!this.incomingRecordCall && !this.recordCall) {
2890
- // return; // Skip if recording is not enabled
2891
- // }
2892
- this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
2893
- this.isPaused = false;
2894
- this.startTimer1();
2895
- }, error => {
2896
- console.error('Error resuming recording', error);
2897
- });
2928
+ acceptNewIncomingCall(call) {
2929
+ //first cut the current call
2930
+ //this.callData = call;
2931
+ this.newIncomingCallData = call;
2898
2932
  }
2899
- startTimer1() {
2900
- this.timerSubscription = interval(1000).subscribe(() => {
2901
- this.timeElapsed++;
2902
- });
2933
+ rejectNewIncomingCall(call) {
2934
+ call.reject();
2935
+ this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2936
+ this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2903
2937
  }
2904
- stopRecordingTimer() {
2905
- if (this.timerSubscription) {
2906
- this.timerSubscription.unsubscribe(); // Pause the timer
2907
- this.timerSubscription = undefined; // Optionally reset the subscription
2908
- }
2938
+ newIncomingCallInitiated() {
2939
+ this.isCallInProgress = true;
2940
+ this.newIncomingCalls = [];
2941
+ this.incomingCallInitiated.emit();
2909
2942
  }
2910
- getFormattedTime() {
2911
- const minutes = Math.floor(this.timeElapsed / 60);
2912
- const seconds = this.timeElapsed % 60;
2913
- return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
2943
+ incomingCallsNewInfo(data) {
2944
+ this.incomingCallsList = data;
2945
+ this.incomingCallsNewInfoEvent.emit(data);
2914
2946
  }
2915
- pollCallStatus(callAuthId) {
2916
- const maxTime = 30000; // Poll for up to 30 seconds
2917
- const pollInterval = 3000; // Poll every 3 seconds
2918
- let elapsedTime = 0;
2919
- const intervalId = setInterval(async () => {
2920
- elapsedTime += pollInterval;
2921
- try {
2922
- const statusResponse = await this.extensionService.getCallStatus(callAuthId).toPromise();
2923
- if (statusResponse && statusResponse.callDetails) {
2924
- this.callStatus = statusResponse.callDetails.callStatus;
2925
- if (this.callStatus === 'in-progress') {
2926
- this.callSid = statusResponse.callDetails.callSid;
2927
- if (this.recordCall && !this.isRecording) {
2928
- this.startRecording();
2929
- }
2930
- clearInterval(intervalId);
2931
- }
2932
- else if (this.callStatus === 'completed') {
2933
- clearInterval(intervalId);
2934
- this.endCall();
2935
- this.stopRecording();
2936
- }
2937
- else if (this.callStatus === 'ringing') {
2938
- // Continue polling; do not clear the interval yet
2939
- }
2940
- }
2947
+ ngOnDestroy() {
2948
+ try {
2949
+ console.log('Cleaning up C2cDialpadComponent');
2950
+ // Unsubscribe from all subscriptions
2951
+ if (this.subscriptions) {
2952
+ this.subscriptions.unsubscribe();
2941
2953
  }
2942
- catch (error) {
2943
- clearInterval(intervalId);
2954
+ // End any active call
2955
+ if (this.isCallInProgress) {
2956
+ this.endCall();
2944
2957
  }
2945
- if (elapsedTime >= maxTime) {
2946
- // console.log('Max polling time reached. Stopping poll.');
2947
- clearInterval(intervalId);
2958
+ // Clear any timeouts or intervals if they exist
2959
+ if (this.toastTimeout) {
2960
+ clearTimeout(this.toastTimeout);
2948
2961
  }
2949
- }, pollInterval);
2950
- }
2951
- getUserInformation(id) {
2952
- this.extensionService.getUserInformation(id).subscribe(response => {
2953
- console.log(response);
2954
- }, error => {
2955
- console.error('Error starting recording', error);
2956
- });
2957
- }
2958
- incomingCallsNewList(data) {
2959
- this.newIncomingCallsList = data;
2960
- this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2961
- }
2962
- selectedIncomingCallInfo(data) {
2963
- this.selectedIncomingCall = data;
2964
- }
2965
- ngOnDestroy() {
2966
- this.callData.dial = false;
2967
- if (this.timerSubscription) {
2968
- this.timerSubscription.unsubscribe();
2962
+ console.log('C2cDialpadComponent cleanup complete');
2963
+ }
2964
+ catch (error) {
2965
+ console.error('Error during component cleanup:', error);
2969
2966
  }
2970
2967
  }
2971
2968
  }
2972
- CallProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, deps: [{ token: ExtensionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2973
- CallProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallProgressComponent, selector: "lib-call-progress", inputs: { callData: "callData", newIncomingCallData: "newIncomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", showCallProgressEvent: "showCallProgressEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand}\">\n <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div>\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button>\n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : '&nbsp;'}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: ["incomingCallData", "newIncomingCallsList"], outputs: ["closeIncomingCallDiv", "incomingCallsNewList", "selectedIncomingCallInfo"] }] });
2974
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
2969
+ DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: IpAddressService }, { token: ExtensionService }, { token: i4.Router }], target: i0.ɵɵFactoryTarget.Component });
2970
+ DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { isDialpadHidden: "isDialpadHidden" }, outputs: { closeDialpadEvent: "closeDialpadEvent", callInitiated: "callInitiated", endCallEvent: "endCallEvent", minimiseEvent: "minimiseEvent", incomingCallsNewInfoEvent: "incomingCallsNewInfoEvent", incomingCallInitiated: "incomingCallInitiated", numberDialed: "numberDialed" }, viewQueries: [{ propertyName: "dialInputElement", first: true, predicate: ["dialInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\r\n msssmsm\r\n</div>\r\n<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <lib-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent)=\"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: CallProgressComponent, selector: "lib-call-progress", inputs: ["callData", "newIncomingCallData", "newIncomingCallsList"], outputs: ["endCallEvent", "incomingCallsNewInfo", "minimiseEvent", "showCallProgressEvent", "incomingCallInitiated"] }] });
2971
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, decorators: [{
2975
2972
  type: Component,
2976
- args: [{ selector: 'lib-call-progress', template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand}\">\n <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div>\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button>\n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : '&nbsp;'}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
2977
- }], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
2978
- type: Input
2979
- }], newIncomingCallData: [{
2980
- type: Input
2981
- }], newIncomingCallsList: [{
2973
+ args: [{ selector: 'lib-dialbox', template: "<div>\r\n msssmsm\r\n</div>\r\n<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <lib-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent)=\"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"] }]
2974
+ }], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: IpAddressService }, { type: ExtensionService }, { type: i4.Router }]; }, propDecorators: { isDialpadHidden: [{
2982
2975
  type: Input
2983
- }], endCallEvent: [{
2976
+ }], closeDialpadEvent: [{
2984
2977
  type: Output
2985
- }], incomingCallsNewInfo: [{
2978
+ }], callInitiated: [{
2979
+ type: Output
2980
+ }], endCallEvent: [{
2986
2981
  type: Output
2987
2982
  }], minimiseEvent: [{
2988
2983
  type: Output
2989
- }], showCallProgressEvent: [{
2984
+ }], incomingCallsNewInfoEvent: [{
2990
2985
  type: Output
2991
2986
  }], incomingCallInitiated: [{
2992
2987
  type: Output
2988
+ }], dialInputElement: [{
2989
+ type: ViewChild,
2990
+ args: ['dialInput']
2991
+ }], numberDialed: [{
2992
+ type: Output
2993
2993
  }] } });
2994
2994
 
2995
2995
  class CallerIdDialogComponent {
@@ -3031,12 +3031,12 @@ class CallerIdDialogComponent {
3031
3031
  console.log('doNotShowAgain');
3032
3032
  }
3033
3033
  }
3034
- CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i4.Router }, { token: TwilioService }, { token: i3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3035
- CallerIdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallerIdDialogComponent, selector: "lib-caller-id-dialog", ngImport: i0, template: "<div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i6.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
3034
+ CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i4.Router }, { token: TwilioService }, { token: i3$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3035
+ CallerIdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallerIdDialogComponent, selector: "lib-caller-id-dialog", ngImport: i0, template: "<div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
3036
3036
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, decorators: [{
3037
3037
  type: Component,
3038
3038
  args: [{ selector: 'lib-caller-id-dialog', template: "<div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div>" }]
3039
- }], ctorParameters: function () { return [{ type: i4.Router }, { type: TwilioService }, { type: i3.MatDialogRef }, { type: undefined, decorators: [{
3039
+ }], ctorParameters: function () { return [{ type: i4.Router }, { type: TwilioService }, { type: i3$2.MatDialogRef }, { type: undefined, decorators: [{
3040
3040
  type: Inject,
3041
3041
  args: [MAT_DIALOG_DATA]
3042
3042
  }] }]; } });
@@ -3066,20 +3066,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3066
3066
  DialboxComponent,
3067
3067
  CallProgressComponent,
3068
3068
  CallerIdDialogComponent,
3069
- IncomingCallComponent,
3069
+ IncomingCallComponent
3070
3070
  ],
3071
3071
  imports: [
3072
3072
  CommonModule,
3073
3073
  FormsModule,
3074
3074
  ReactiveFormsModule,
3075
3075
  HttpClientModule,
3076
- RouterLink,
3076
+ RouterLink
3077
3077
  ],
3078
3078
  exports: [
3079
3079
  DialboxComponent,
3080
3080
  CallProgressComponent,
3081
3081
  CallerIdDialogComponent,
3082
- IncomingCallComponent,
3082
+ IncomingCallComponent
3083
3083
  ]
3084
3084
  }]
3085
3085
  }] });