PageSourceSearch

https://sociallab.sa/chunk-heMPSEPv.js

js sociallab.sa collected 2026-10-01 23:58:07 UTC 71,936 bytes, 1 lines download raw bytes

1import {R}from'./chunk-BGOHF1M9.js';import {c as ce}from'./chunk-BRsHFk4j.js';import'./chunk-C0DmzTpz.js';import {c3 as Xr,E,D,cN as Ft,V,h0 as h,v as vr,e as f,aE as ut,bI as Gt,bK as P,O,X as Xb,j as Xv,R as RM,h as ea$1,i as ai,N as Ng,bu as Ts,bv as Og,bN as Gc,a1 as ny,T as Tt,z as zg,w as w0,H as H0,Z as Zx,k as dn$1,b2 as da,cp as xr,bL as Sh,l as zw,bA as Nw,s as sk,d6 as Hp,d7 as ed,n as nd,r as rC,m as wC,cV as fu,o as mv,p as GC,t as tD,q as vD,aO as cD,aP as hD,aX as mD,u as al,x as tM,y as dM,L as Lb,A as r1,P as P1,B as xS,C as Vs,F as zs,I as Fi$1,J as GS,K as iI,M as RI,Q as us,S as ms,Y as UI,bT as GI,_ as tE,$ as Dn$1,a0 as ME,a2 as go,a3 as Kd,av as on$1,a4 as XE,a5 as LT,a6 as mA,d_ as tA,d$ as nA,e0 as sA,e1 as aA,e2 as iA,e3 as lA,e4 as rA,e5 as oA,e6 as dA,e7 as cA,f3 as zM,cx as WM,a7 as mt,a8 as fy,a9 as ZT,aa as Js,ac as H_,ad as gd,ae as pS,ab as Ey,bV as zy,bW as W_,bD as db,ai as dy,bn as nS,ag as SC,ah as YT,aj as jy,al as gS,ak as Ed,bX as $y,bE as pb,b8 as an$1,b9 as Wm,cX as Yv,cY as OM,df as Wc,cS as ey,cT as iy,cU as ty,da as wr,b3 as id,b1 as ei,aB as ey$1,af as XT,am as JT,cA as se,bZ as M,c4 as ED,cB as vt,a as G,an as x,aT as d_,aR as i_,aS as Vp,aU as Hp$1,b5 as ly,aD as By,ba as xy,c8 as Vy,cE as vd,cF as Ea,bb as QT,bg as mS}from'./main-4WA6AAHG.js';import'./chunk-CkU8oUfw.js';var z=(function(n){return n[n.None=0]="None",n[n.SocialLab=1]="SocialLab",n[n.Client=2]="Client",n[n.Commercial=3]="Commercial",n})(z||{}),F=(function(n){return n[n.AnswerFirst=0]="AnswerFirst",n[n.MissedCallsOnly=1]="MissedCallsOnly",n})(F||{});var zt=()=>({standalone:true}),Bi=(n,m)=>m.value;function Ni(n,m){if(n&1&&(Js(0,"mat-option",11),H_(1),gd()),n&2){let e=m.$implicit;dy("value",e.id),SC(),jy(e.name);}}function Di(n,m){if(n&1&&(Js(0,"mat-option",11),H_(1),pS(2,"uppercase"),gd()),n&2){let e=m.$implicit;dy("value",e),SC(),jy(gS(2,2,e));}}function Ai(n,m){n&1&&(Js(0,"div",32),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),Ed(" ",gS(2,1,"Give the username and password below to the customer. Their phone system connects to us using them, so nothing has to be opened on their firewall and no fixed public address is needed.")," "));}function Vi(n,m){if(n&1){let e=i_();Js(0,"div",33)(1,"mat-form-field",5)(2,"mat-label"),H_(3),pS(4,"translate"),gd(),Js(5,"input",34),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.sipUsername,a)||(p.model.sipUsername=a),Hp$1(a)}),gd(),db(),gd(),Js(6,"mat-form-field",5)(7,"mat-label"),H_(8),pS(9,"translate"),gd(),Js(10,"input",35),pS(11,"translate"),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.sipPassword,a)||(p.model.sipPassword=a),Hp$1(a)}),gd(),db(),gd()();}if(n&2){let e=d_();SC(3),jy(gS(4,5,"SIP Username")),SC(2),$y("ngModel",e.model.sipUsername),pb(),SC(3),jy(gS(9,7,"SIP Password")),SC(2),$y("ngModel",e.model.sipPassword),dy("placeholder",e.isEdit?gS(11,9,"Leave blank to keep"):""),pb();}}function Wi(n,m){n&1&&(Js(0,"div",32),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),Ed(" ",gS(2,1,"With IP authentication there are no credentials. Enter the operator signalling addresses under Advanced, or inbound calls will be rejected as unknown.")," "));}function Fi(n,m){if(n&1&&(Js(0,"mat-option",11),H_(1),pS(2,"translate"),gd()),n&2){let e=m.$implicit;dy("value",e.value),SC(),jy(gS(2,2,e.label));}}function Li(n,m){if(n&1&&(Js(0,"mat-option",11),H_(1),gd()),n&2){let e=m.$implicit;dy("value",e),SC(),jy(e);}}function Ri(n,m){if(n&1&&(Js(0,"mat-option",11),H_(1),gd()),n&2){let e=m.$implicit;dy("value",e),SC(),jy(e);}}function zi(n,m){if(n&1&&(Js(0,"mat-option",11),H_(1),gd()),n&2){let e=m.$implicit;dy("value",e),SC(),jy(e);}}function Hi(n,m){if(n&1){let e=i_();Js(0,"div",4)(1,"mat-slide-toggle",17),zy("ngModelChange",function(a){Vp(e);let p=d_(2);return W_(p.model.mediaEncryptionOptimistic,a)||(p.model.mediaEncryptionOptimistic=a),Hp$1(a)}),H_(2),pS(3,"translate"),gd(),db(),Js(4,"div",37),H_(5),pS(6,"translate"),gd()();}if(n&2){let e=d_(2);SC(),$y("ngModel",e.model.mediaEncryptionOptimistic),pb(),SC(),Ed(" ",gS(3,3,"Accept unencrypted media too (optimistic)")," "),SC(3),Ed(" ",gS(6,5,"Some carriers deliver the same call over two transports, one offering encrypted media and the other plain. Without this, whichever one does not match is rejected with 488 \u2014 so the setting only chooses which half breaks.")," ");}}function Ui(n,m){if(n&1){let e=i_();Js(0,"div",36)(1,"div",37),H_(2),pS(3,"translate"),gd(),Js(4,"div",13),H_(5),pS(6,"translate"),gd(),Js(7,"mat-form-field",38)(8,"mat-label"),H_(9),pS(10,"translate"),gd(),Js(11,"input",39),zy("ngModelChange",function(a){Vp(e);let p=d_();
1return W_(p.model.trunkKey,a)||(p.model.trunkKey=a),Hp$1(a)}),gd(),db(),Js(12,"mat-hint"),H_(13),pS(14,"translate"),gd()(),Js(15,"div",13),H_(16),pS(17,"translate"),gd(),Js(18,"mat-form-field",38)(19,"mat-label"),H_(20),pS(21,"translate"),gd(),Js(22,"input",40),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.sipMatchHosts,a)||(p.model.sipMatchHosts=a),Hp$1(a)}),gd(),db(),Js(23,"mat-hint"),H_(24),pS(25,"translate"),gd()(),Js(26,"mat-slide-toggle",17),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.identifyByIpOnly,a)||(p.model.identifyByIpOnly=a),Hp$1(a)}),H_(27),pS(28,"translate"),gd(),db(),Js(29,"div",13),H_(30),pS(31,"translate"),gd(),Js(32,"div",4)(33,"mat-form-field",5)(34,"mat-label"),H_(35),pS(36,"translate"),gd(),Js(37,"input",41),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.sipFromDomain,a)||(p.model.sipFromDomain=a),Hp$1(a)}),gd(),db(),gd(),Js(38,"mat-form-field",5)(39,"mat-label"),H_(40),pS(41,"translate"),gd(),Js(42,"input",41),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.requestUriDomain,a)||(p.model.requestUriDomain=a),Hp$1(a)}),gd(),db(),gd()(),Js(43,"mat-form-field",38)(44,"mat-label"),H_(45),pS(46,"translate"),gd(),Js(47,"input",42),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.sipOutboundProxy,a)||(p.model.sipOutboundProxy=a),Hp$1(a)}),gd(),db(),Js(48,"mat-hint"),H_(49),pS(50,"translate"),gd()(),Js(51,"div",4)(52,"mat-form-field",5)(53,"mat-label"),H_(54),pS(55,"translate"),gd(),Js(56,"input",43),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.fromUserOverride,a)||(p.model.fromUserOverride=a),Hp$1(a)}),gd(),db(),gd(),Js(57,"mat-form-field",5)(58,"mat-label"),H_(59),pS(60,"translate"),gd(),Js(61,"input",34),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.contactUser,a)||(p.model.contactUser=a),Hp$1(a)}),gd(),db(),Js(62,"mat-hint"),H_(63),pS(64,"translate"),gd()()(),Js(65,"mat-slide-toggle",17),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.userEqPhone,a)||(p.model.userEqPhone=a),Hp$1(a)}),H_(66),pS(67,"translate"),gd(),db(),Js(68,"mat-slide-toggle",17),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.callerIdPlusPrefix,a)||(p.model.callerIdPlusPrefix=a),Hp$1(a)}),H_(69),pS(70,"translate"),gd(),db(),Js(71,"div",13),H_(72),pS(73,"translate"),gd(),Js(74,"div",4)(75,"mat-form-field",5)(76,"mat-label"),H_(77),pS(78,"translate"),gd(),Js(79,"mat-select",17),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.dtmfMode,a)||(p.model.dtmfMode=a),Hp$1(a)}),Js(80,"mat-option",11),H_(81),pS(82,"translate"),gd(),ey$1(83,Li,2,2,"mat-option",12),gd(),db(),Js(84,"mat-hint"),H_(85),pS(86,"translate"),gd()(),Js(87,"mat-form-field",5)(88,"mat-label"),H_(89),pS(90,"translate"),gd(),Js(91,"mat-select",17),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.sessionTimers,a)||(p.model.sessionTimers=a),Hp$1(a)}),Js(92,"mat-option",11),H_(93),pS(94,"translate"),gd(),ey$1(95,Ri,2,2,"mat-option",12),gd(),db(),Js(96,"mat-hint"),H_(97),pS(98,"translate"),gd()(),Js(99,"mat-form-field",5)(100,"mat-label"),H_(101),pS(102,"translate"),gd(),Js(103,"mat-select",17),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.mediaEncryption,a)||(p.model.mediaEncryption=a),Hp$1(a)}),Ey("ngModelChange",function(){Vp(e);let a=d_();return Hp$1(a.onMediaEncryptionChange())}),Js(104,"mat-option",11),H_(105),pS(106,"translate"),gd(),ey$1(107,zi,2,2,"mat-option",12),gd(),db(),gd()(),ey$1(108,Hi,7,7,"div",44),Js(109,"div",13),H_(110),pS(111,"translate"),gd(),Js(112,"div",4)(113,"mat-form-field",5)(114,"mat-label"),H_(115),pS(116,"translate"),gd(),Js(117,"input",45),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.qualifyFrequency,a)||(p.model.qualifyFrequency=a),Hp$1(a)}),gd(),db(),Js(118,"mat-hint"),H_(119),pS(120,"translate"),gd()(),Js(121,"mat-form-field",5)(122,"mat-label"),H_(123),pS(124,"translate"),gd(),Js(125,"input",46),zy("ngModelChange",function(a){Vp(e);let p=d_();return W_(p.model.qualifyTimeout,a)||(p.model.qualifyTimeout=a),Hp$1(a)}),gd(),db(),gd()()();}if(n&2){let e=d_();SC(2),Ed(" ",gS(3,53,"Only needed for operators that are not a plain internet SIP trunk \u2014 for example one that authenticates by IP address, delivers a range of numbers over a single trunk, or requires its own SIP domain in the message headers. Leave everything blank otherwise.")," "),SC(3),jy(gS(6,55,"Numbers sharing one trunk")),SC(4),jy(gS(10,57,"Trunk group key")),SC(2),$y("ngModel",e.model.trunkKey),pb(),SC(2),jy(gS(14,59,"Give every number delivered over the SAME trunk the same key. They then share one connection, and each number still rings its own client.")),SC(3),jy(gS(17,61,"How the operator reaches us")),SC(4),jy(gS(21,63,"Operator signalling addresses")),SC(2),$y("ngModel",e.model.sipMatchHosts),pb(),SC(2),jy(gS(25,65,"The addresses calls ARRIVE from \u2014 often different from the SIP host we send to. Separate several with commas. Required for IP authentication.")),SC(2),$y("ngModel",e.model.identifyByIpOnly),pb(),SC(),jy(gS(28,67,"Identify this operator by IP address only")),SC(3),jy(gS(31,69,"SIP identity")),SC(5),jy(gS(36,71,"SIP domain (From header)")),SC(2),$y("ngModel",e.model.sipFromDomain),pb(),SC(3),jy(gS(41,73,"Request-URI domain")),SC(2),$y("ngModel",e.model.requestUriDomain),pb(),SC(3),jy(gS(46,75,"Outbound proxy")),SC(2),$y("ngModel",e.model.sipOutboundProxy),pb(),SC(2),jy(gS(50,77,"Where the packets actually go, when that differs from the domain written in the SIP address. Write URI parameters as ;lr \u2014 the backslash is required.")),SC(5),jy(gS(55,79,"From user override")),SC(2),$y("ngModel",e.model.fromUserOverride),pb(),SC(3),jy(gS(60,81,"Registration contact user")),SC(2),$y("ngModel",e.model.contactUser),pb(),SC(2),jy(gS(64,83,"Needed to route inbound calls by number when several numbers share one registration. Changing it re-registers the trunk \u2014 confirm with the operator first.")),SC(2),$y("ngModel",e.model.userEqPhone),pb(),SC(),jy(gS(67,85,"Append ;user=phone to SIP addresses")),SC(2),$y("ngModel",e.model.callerIdPlusPrefix),pb(),SC(),jy(gS(70,87,"Present the caller ID with a leading + (E.164)")),SC(3),jy(gS(73,89,"Media and signalling")),SC(5),jy(gS(78,91,"DTMF mode")),SC(2),$y("ngModel",e.model.dtmfMode),pb(),SC(),dy("value",null),SC(),jy(gS(82,93,"Default (rfc4733)")),SC(2),dy("ngForOf",e.dtmfModes
1),SC(2),jy(gS(86,95,'An operator sheet saying "RFC2833" means rfc4733 \u2014 the same mechanism under its current name.')),SC(4),jy(gS(90,97,"Session timers")),SC(2),$y("ngModel",e.model.sessionTimers),pb(),SC(),dy("value",null),SC(),jy(gS(94,99,"Default")),SC(2),dy("ngForOf",e.sessionTimerModes),SC(2),jy(gS(98,101,'Set to "no" if the operator asks you to stop re-INVITE.')),SC(4),jy(gS(102,103,"Media encryption")),SC(2),$y("ngModel",e.model.mediaEncryption),pb(),SC(),dy("value",null),SC(),jy(gS(106,105,"Default (none)")),SC(2),dy("ngForOf",e.mediaEncryptions),SC(),dy("ngIf",e.model.mediaEncryption),SC(2),jy(gS(111,107,"Liveness check")),SC(5),jy(gS(116,109,"Keepalive interval (seconds)")),SC(2),$y("ngModel",e.model.qualifyFrequency),pb(),SC(2),jy(gS(120,111,"0 sends nothing. Leave it at 0 unless the operator has confirmed they answer \u2014 some forbid it, and a keepalive they ignore takes the trunk out of service.")),SC(4),jy(gS(124,113,"Keepalive timeout (seconds)")),SC(2),$y("ngModel",e.model.qualifyTimeout),pb();}}var Ut=(()=>{class n{constructor(e,c){this.dialogRef=e,this.transports=["tls","udp","tcp"],this.dtmfModes=["rfc4733","inband","info","auto","auto_info","none"],this.sessionTimerModes=["yes","no","required","always"],this.outboundFormats=[{value:"e164",label:"International with + (+966\u2026) \u2014 most carriers"},{value:"e164plus",label:"Always add the + , even if the agent omits it"},{value:"digits",label:"Digits only, no + (966\u2026)"},{value:"00",label:"International prefix 00 (00966\u2026)"},{value:"national",label:"National inside the country (0\u2026), 00 abroad"}],this.mediaEncryptions=["no","sdes","dtls"],this.showAdvanced=false,this.clientSearch="",this.filteredClients=[],this.clients=c.clients??[],this.filteredClients=this.clients;let a=c.number;this.isEdit=!!a,this.model={id:a?.id,clientId:a?.clientId??null,did:a?.did??"",label:a?.label??null,provider:a?.provider??null,sipHost:a?.sipHost??null,sipPort:a?.sipPort??null,transport:a?.transport??"tls",sipUsername:a?.sipUsername??null,sipPassword:null,codecs:a?.codecs??"alaw,ulaw",outboundFormat:a?.outboundFormat??"e164",registerTrunk:a?.registerTrunk??true,trunkMode:a?.trunkMode??null,isDefaultOutbound:a?.isDefaultOutbound??false,enabled:a?.enabled??true,advancedProvided:!a||a.qualifyFrequency!==void 0,trunkKey:a?.trunkKey??null,sipMatchHosts:a?.sipMatchHosts??null,sipFromDomain:a?.sipFromDomain??null,requestUriDomain:a?.requestUriDomain??null,sipOutboundProxy:a?.sipOutboundProxy??null,fromUserOverride:a?.fromUserOverride??null,contactUser:a?.contactUser??null,userEqPhone:a?.userEqPhone??false,identifyByIpOnly:a?.identifyByIpOnly??false,callerIdPlusPrefix:a?.callerIdPlusPrefix??false,dtmfMode:a?.dtmfMode??null,sessionTimers:a?.sessionTimers??null,rewriteContact:a?.rewriteContact??null,mediaEncryption:a?.mediaEncryption??null,mediaEncryptionOptimistic:a?.mediaEncryptionOptimistic??false,qualifyFrequency:a?.qualifyFrequency??0,qualifyTimeout:a?.qualifyTimeout??null,rtpKeepalive:a?.rtpKeepalive??0,rtpTimeout:a?.rtpTimeout??0,sendRpid:a?.sendRpid??false,trustIdOutbound:a?.trustIdOutbound??false,trustIdInbound:a?.trustIdInbound??false},this.showAdvanced=this.hasAdvanced;}get hasAdvanced(){let e=this.model;return !!(e.trunkKey||e.sipMatchHosts||e.sipFromDomain||e.requestUriDomain||e.sipOutboundProxy||e.fromUserOverride||e.contactUser||e.dtmfMode||e.sessionTimers||e.mediaEncryption||e.mediaEncryptionOptimistic||e.userEqPhone||e.identifyByIpOnly||e.callerIdPlusPrefix||e.sendRpid||e.trustIdOutbound||e.trustIdInbound||e.qualifyFrequency>0||e.rtpKeepalive>0||e.rtpTimeout>0||e.rewriteContact!==null)}get authMode(){return this.model.trunkMode==="inbound"?"inbound":this.model.registerTrunk?"register":"ip"}set authMode(e){this.model.trunkMode=e==="register"?null:e,this.model.registerTrunk=e==="register";}get isCustomerPbx(){return this.authMode==="inbound"}get usesCredentials(){return this.model.registerTrunk||this.isCustomerPbx}onAuthModeChange(){}onMediaEncryptionChange(){this.model.mediaEncryption||(this.model.mediaEncryptionOptimistic=false);}get canSave(){return !!this.model.did?.trim()}filterClients(){let e=this.clientSearch.trim().toLowerCase();this.filteredClients=e?this.clients.filter(c=>(c.name||"").toLowerCase().includes(e)):this.clients;}onDropdownOpened(e){e&&(this.clientSearch="",this.filteredClients=this.clients);}save(){if(!this.canSave)return;let e=E(D({},this.model),{did:this.model.did.trim(),label:this.model.label?.trim()||null,provider:this.model.provider?.trim()||null,sipHost:this.model.sipHost?.trim()||null,sipUsername:this.model.sipUsername?.trim()||null,sipPassword:this.model.sipPassword?.trim()||null,codecs:this.model.codecs?.trim()||null,outboundFormat:this.model.outboundFormat?.trim()||null,trunkKey:this.model.trunkKey?.trim()||null,sipMatchHosts:this.model.sipMatchHosts?.trim()||null,sipFromDomain:this.model.sipFromDomain?.trim()||null,requestUriDomain:this.model.requestUriDomain?.trim()||null,sipOutboundProxy:this.model.sipOutboundProxy?.trim()||null,fromUserOverride:this.model.fromUserOverride?.trim()||null,contactUser:this.model.contactUser?.trim()||null,dtmfMode:this.model.dtmfMode?.trim()||null,sessionTimers:this.model.sessionTimers?.trim()||null,mediaEncryption:this.model.mediaEncryption?.trim()||null,mediaEncryptionOptimistic:this.model.mediaEncryptionOptimistic,qualifyFrequency:this.model.qualifyFrequency??0,rtpKeepalive:this.model.rtpKeepalive??0,rtpTimeout:this.model.rtpTimeout??0});this.dialogRef.close(e);}cancel(){this.dialogRef.close(null);}static{this.\u0275fac=function(c){return new(c||n)(V(an$1),V(Wm))};}static{this.\u0275cmp=Xb({type:n,selectors:[["app-number-dialog"]],decls:104,vars:94,consts:[["mat-dialog-title",""],[1,"d-flex","flex-column","gap-2","p-t-8"],["appearance","outline",1,"w-100"],["matInput","","placeholder","966115030512",3,"ngModelChange","ngModel"],[1,"d-flex","gap-2","flex-wrap"],["appearance","outline",1,"flex-1"],["matInput","",3,"ngModelChange","ngModel"],["matInput","","placeholder","InnoCalls",3,"ngModelChange","ngModel"],[3,"ngModelChange","openedChange","ngModel"],[1,"select-search"],["type","text",3,"ngModelChange","keydown","ngModel","ngModelOptions","placeholder"],[3,"value"],[3,"value",4,"ngFor","ngForOf"],[1,"section-label"],["appearance","outline",1,"flex-2"],["matInput","","placeholder","cu610.sip.innocalls.net",3,"ngModelChange","ngModel"],["matInput","","type","number","placeholder","5061",3,"ngModelChange","ngModel"],[3,"ngModelChange","ngModel"],[1,"d-flex","flex-column","gap-1",3,"ngModelChange","ngModel","ngModelOptions"],["value","register"],["value","ip"],["value","inbound"],["class","hint-box m-t-8",4,"ngIf"],["class","d-flex gap-2 flex-wrap m-t-8",4,"ngIf"],["matInput","","placeholder","alaw,ulaw",3,"ngModelChange","ngModel"],[1,"d-flex","flex-column","gap-1","m-t-8"],[1,"m-t-8"],["mat-button","","type","button",3,"click"],["class","d-flex flex-column gap-1",4,"ngIf"],["align","end"],["mat-button","",3,"click"],["mat-flat-button","","color","primary",3,"click","disabled"],[1,"hint-box","m-t-8"],[1,"d-flex","gap-2","flex-wrap","m-t-8"],["matInput","","placeholder","610201",3,"ngModelChange","ngModel"],["matInput","","type","password",3,"ngModelChange","ngModel","placeholder"],[1,"d-flex","flex-column","gap-1"],[1,"hint-box"],["appearance","outline"],["matInput","","placeholder","stc-jeddah",3,"ngModelChange","ngModel"],["matInput","","placeholder","10.208.9.69, 10.170.29.201",3,"ngModelChange","ngModel"],["matInput","","placeholder","fmc.stc.com.sa",3,"ngModelChange","ngModel"],["matInput","","placeholder","sip:10.208.9.69:5060\\;lr",3,"ngModelChange","ngModel"],["matInput","","placeholder","+966126619880",3,"ngModelChange","ngModel"],["class","d-flex gap-2 flex-wrap",4,"ngIf"],["matInput","","type","number","placeholder","0",3,"ngModelChange","ngModel"],["matInput","","type","number",3,"ngModelChange","ngModel"]],template:function(c,a){c&1&&(Js(0,"h2",0),H_(1),pS(2,"translate"),gd(),Js(3,"mat-dialog-content")(4,"div",1)(5,"mat-form-field",2)(6,"mat-label"),H_(7),pS(8,"translate"),gd(),Js(9,"input",3),zy("ngModelChange",function(u){return W_(a.model.did,u)||(a.model.did=u),u}),gd(),db(),gd(),Js(10,"div",4)(11,"mat-form-field",5)(12,"mat-label"),H_(13),pS(14,"translate"),gd(),Js(15,"input",6),zy("ngModelChange",function(u){return W_(a.model.label,u)||(a.model.label=u),u}),gd(),db(),gd(),Js(16,"mat-form-field",5)(17,"mat-label"),H_(18),pS(19,"translate"),gd(),Js(20,"input",7),zy("ngModelChange",function(u){return W_(a.model.provider,u)||(a.model.provider=u),u}),gd(),db(),gd()(),Js(21,"mat-form-field",2)(22,"mat-label"),H_(23),pS(24,"translate"),gd(),Js(25,"mat-select",8),zy("ngModelChange",function(u){return W_(a.model.clientId,u)||(a.model.clientId=u),u}),Ey("openedChange",function(u){return a.onDropdownOpened(u)}),Js(26,"div",9)(27,"input",10),pS(28,"translate"),zy("ngModelChange",function(u){return W_(a.clientSearch,u)||(a.clientSearch=u),u}),Ey("ngModelChange",function(){return a.filterClients()})("keydown",function(u){return u.stopPropagation()}),gd(),db(),gd(),Js(29,"mat-option",11),H_(30),pS(31,"translate"),gd(),ey$1(32,Ni,2,2,"mat-option",12),gd(),db(),gd(),Js(33,"div",13),H_(34),pS(35,"translate"),gd(),Js(36,"div",4)(37,"mat-form-field",14)(38,"mat-label"),H_(39),pS(40,"translate"),gd(),Js(41,"input",15),zy("ngModelChange",function(u){return W_(a.model.sipHost,u)||(a.model.sipHost=u),u}),gd(),db(),gd(),Js(42,"mat-form-field",5)(43,"mat-label"),H_(44),pS(45,"translate"),gd(),Js(46,"input",16),zy("ngModelChange",function(u){return W_(a.model.sipPort,u)||(a.model.sipPort=u),u}),gd(),db(),gd(),Js(47,"mat-form-field",5)(48,"mat-label"),H_(49),pS(50,"translate"),gd(),Js(51,"mat-select",17),zy("ngModelChange",function(u){return W_(a.model.transport,u)||(a.model.transport=u),u}),ey$1(52,Di,3,4,"mat-option",12),gd(),db(),gd()(),Js(53,"div",13),H_(54),pS(55,"translate"),gd(),Js(56,"mat-radio-group",18),zy("ngModelChange",function(u){return W_(a.authMode,u)||(a.authMode=u),u}),Ey("ngModelChange",function(){return a.onAuthModeChange()}),Js(57,"mat-radio-button",19),H_(58),pS(59,"translate"),gd(),Js(60,"mat-radio-button",20),H_(61),pS(62,"translate"),gd(),Js(63,"mat-radio-button",21),H_(64),pS(65,"translate"),gd()(),db(),ey$1(66,Ai,3,3,"div",22)(67,Vi,12,11,"div",23)(68,Wi,3,3,"div",22),Js(69,"div",4)(70,"mat-form-field",5)(71,"mat-label"),H_(72),pS(73,"translate"),gd(),Js(74,"input",24),zy("ngModelChange",function(u){return W_(a.model.codecs,u)||(a.model.codecs=u),u}),gd(),db(),gd(),Js(75,"mat-form-field",5)(76,"mat-label"),H_(77),pS(78,"translate"),gd(),Js(79,"mat-select",17),zy("ngModelChange",function(u){return W_(a.model.outboundFormat,u)||(a.model.outboundFormat=u),u}),XT(80,Fi,3,4,"mat-option",11,Bi),gd(),db(),Js(82,"mat-hint"),H_(83),pS(84,"translate"),gd()()(),Js(85,"div",25)(86,"mat-slide-toggle",17),zy("ngModelChange",function(u){return W_(a.model.isDefaultOutbound,u)||(a.model.isDefaultOutbound=u),u}),H_(87),pS(88,"translate"),gd(),db(),Js(89,"mat-slide-toggle",17),zy("ngModelChange",function(u){return W_(a.model.enabled,u)||(a.model.enabled=u),u}),H_(90),pS(91,"translate"),gd(),db(),gd(),Js(92,"div",26)(93,"button",27),Ey("click",function(){return a.showAdvanced=!a.showAdvanced}),H_(94),pS(95,"translate"),gd()(),ey$1(96,Ui,126,115,"div",28),gd()(),Js(97,"mat-dialog-actions",29)(98,"button",30),Ey("click",function(){return a.cancel()}),H_(99),pS(100,"translate"),gd(),Js(101,"button",31),Ey("click",function(){return a.save()}),H_(102),pS(103,"translate"),gd()()),c&2&&(SC(),jy(gS(2,46,a.isEdit?"Edit Number":"Add Number")),SC(6),jy(gS(8,48,"Phone Number (DID)")),SC(2),$y("ngModel",a.model.did),pb(),SC(4),jy(gS(14,50,"Label")),SC(2),$y("ngModel",a.model.label),pb(),SC(3),jy(gS(19,52,"Provider")),SC(2),$y("ngModel",a.model.provider),pb(),SC(3),jy(gS(24,54,"Assign to Client")),SC(2),$y("ngModel",a.model.clientId),pb(),SC(2),$y("ngModel",a.clientSearch),dy("ngModelOptions",nS(92,zt))("placeholder",gS(28,56,"Search")),pb(),SC(2),dy("value",null),SC(),jy(gS(31,58,"Unassigned")),SC(2),dy("ngForOf",a.filteredClients),SC(2),jy(gS(35,60,"SIP Trunk")),SC(5),jy(gS(40,62,"SIP Host")),SC(2),$y("ngModel",a.model.sipHost),pb(),SC(3),jy(gS(45,64,"Port")),SC(2),$y("ngModel",a.model.sipPort),pb(),SC(3),jy(gS(50,66,"Transport")),SC(2),$y("ngModel",a.model.transport),pb(),SC(),dy("ngForOf",a.transports),SC(2),jy(gS(55,68,"Authentication")),SC(2),$y("ngModel",a.authMode),dy("ngModelOptions",nS(93,zt)),pb(),SC(2),jy(gS(59,70,"Registration (username and password)")),SC(3),jy(gS(62,72,"IP authentication (the operator recognises our server by address)")),SC(3),jy(gS(65,74,"The customer's own phone system connects to us")),SC(2),dy("ngIf",a.isCustomerPbx),SC(),dy("ngIf",a.usesCredentials),SC(),dy("ngIf",!a.usesCredentials),SC(4),jy(gS(73,76,"Codecs")),SC(2),$y("ngModel",a.model.codecs),pb(),SC(3),jy(gS(78,78,"Outbound Format")),SC(2),$y("ngModel",a.model.outboundFormat),pb(),SC(),JT(a.outboundFormats),SC(3),jy(gS(84,80,"How the carrier wants the dialled number. Wrong here means every outgoing call is rejected while everything else looks fine.")),SC(3),$y("ngModel",a.model.isDefaultOutbound),pb(),SC(),jy(gS(88,82,"Default outbound number for this client")),SC(2),$y("ngModel",a.model.enabled),pb(),SC(),jy(gS(91,84,"Enabled")),SC(4),Ed(" ",gS(95,86,a.showAdvanced?"Hide advanced (operator-specific)":"Show advanced (operator-specific)")," "),SC(2),dy("ngIf",a.showAdvanced),SC(3),jy(gS(100,88,"Cancel")),SC(2),dy("disabled",!a.canSave),SC(),jy(gS(103,90,"Save")));},dependencies:[Xv,Yv,OM,Ng,Ts,Wc,Og,Gc,ny,ey,iy,ty,nd,da,xr,wr,id,ei,wC,fu,sk,Hp,ed,Tt,zg,w0,H0,Zx,dn$1,zw,Nw,rC,mv,GC,tD,vD,al,tM,dM,Lb,r1,P1,xS,Vs,zs,GS,iI,RI,us,UI,tE,Dn$1,ME,go,Kd,XE,LT,mA,zM,mt],styles:['@charset "UTF-8";.flex-1[_ngcontent-%COMP%]{flex:1 1 0;min-width:140px}.flex-2[_ngcontent-%COMP%]{flex:2 1 0;
1min-width:200px}.section-label[_ngcontent-%COMP%]{font-weight:600;font-size:13px;opacity:.7;margin:6px 0 2px}.select-search[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1;background:var(--mat-sys-surface, #fff);padding:8px 12px;border-bottom:1px solid rgba(0,0,0,.12)}.select-search[_ngcontent-%COMP%]   input[_ngcontent-%COMP%]{width:100%;border:none;outline:none;background:transparent;font-size:14px;color:inherit}.hint-box[_ngcontent-%COMP%]{font-size:12.5px;line-height:1.6;opacity:.8;padding:8px 12px;border-radius:6px;background:#0000000a;border-inline-start:3px solid var(--mat-sys-primary, #4caf50)}  .mat-mdc-form-field-subscript-wrapper{height:auto}  .mat-mdc-form-field-hint-wrapper{position:static;padding-bottom:4px}  .mat-mdc-form-field-bottom-align:before{content:none}.d-flex[_ngcontent-%COMP%] > .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:4px}'],changeDetection:1});}}return n})();var qt=(()=>{class n extends se{constructor(e,c,a){super(e,c,a,"CCNumberAdmin/");}getNumbers(e,c){return this.get("GetNumbers",{clientId:e,search:c})}getAssignableClients(e){return this.get("GetAssignableClients",{search:e})}createNumber(e){return this.post("CreateNumber",e)}updateNumber(e){return this.post("UpdateNumber",e)}deleteNumber(e){return this.post("DeleteNumber",{id:e})}getClientVoiceAi(e){return this.get("GetClientVoiceAiSetting",{clientId:e})}setClientVoiceAi(e,c){return this.post("SetClientVoiceAiSetting",{clientId:e,voiceAiEnabled:c})}setClientVoiceRoutingMode(e,c){return this.post("SetClientVoiceRoutingMode",{clientId:e,voiceRoutingMode:c})}static{this.\u0275fac=function(c){return new(c||n)(M(ED),M(vt),M(G))};}static{this.\u0275prov=x({token:n,factory:n.\u0275fac,providedIn:"root"});}}return n})();var ji=()=>["Check telephony health first \u2014 disk, trunks, agents online and config sync.","Add a number and assign it to a client; one number per client is the default outbound.","Open Details on a number for its live calls and history."],Kt=(n,m)=>m.id,Gi=(n,m)=>m.reason;function Yi(n,m){n&1&&(Js(0,"span",27),pS(1,"translate"),Js(2,"mat-icon"),H_(3,"phone_missed"),gd(),H_(4),pS(5,"translate"),Js(6,"b",24),H_(7),pS(8,"translate"),gd()()),n&2&&(dy("matTooltip",gS(1,3,"The phone server is receiving calls and has nowhere to send them, so they are being dropped. Outbound calls and the connection status stay normal while this happens.")),SC(4),Ed("",gS(5,5,"Incoming path"),":\xA0 "),SC(3),jy(gS(8,7,"broken")));}function Ji(n,m){n&1&&(Js(0,"span",27),pS(1,"translate"),Js(2,"mat-icon"),H_(3,"call_split"),gd(),H_(4),pS(5,"translate"),Js(6,"b",24),H_(7),pS(8,"translate"),gd()()),n&2&&(dy("matTooltip",gS(1,3,"Two trunks are configured with the same carrier address. Asterisk picks one of them without warning, so incoming calls can be delivered to the wrong subscriber.")),SC(4),Ed("",gS(5,5,"Routing"),":\xA0 "),SC(3),jy(gS(8,7,"conflict")));}function Qi(n,m){if(n&1&&(Js(0,"span",26)(1,"mat-icon"),H_(2,"storage"),gd(),H_(3),pS(4,"translate"),Js(5,"b"),H_(6),gd()(),Js(7,"span",26)(8,"mat-icon"),H_(9,"lan"),gd(),H_(10),pS(11,"translate"),Js(12,"b"),H_(13),gd()(),Js(14,"span",26)(15,"mat-icon"),H_(16,"headset_mic"),gd(),H_(17),pS(18,"translate"),Js(19,"b"),H_(20),gd()(),Js(21,"span",27),pS(22,"translate"),Js(23,"mat-icon"),H_(24,"sync"),gd(),H_(25),pS(26,"translate"),Js(27,"b"),H_(28),gd()(),ZT(29,Yi,9,9,"span",27),ZT(30,Ji,9,9,"span",27),Js(31,"span",28),H_(32),pS(33,"translate"),pS(34,"translate"),gd()),n&2){let e=d_(2);SC(3),Ed("",gS(4,21,"Disk"),":\xA0"),SC(2),xy("h-bad",!e.health.diskHealthy),SC(),Ed("",e.health.diskPercent,"%"),SC(4),Ed("",gS(11,23,"Trunks"),":\xA0"),SC(2),xy("h-bad",!e.health.trunksHealthy),SC(),By("",e.health.trunksRegistered,"/",e.health.trunksTotal),SC(4),Ed("",gS(18,25,"Agents online"),":\xA0"),SC(3),jy(e.health.agentsOnline),SC(),dy("matTooltip",gS(22,27,"How long since the phone server last picked up its settings from SocialLab. If this is not OK, the server is running an old configuration and call-centre changes are not taking effect.")),SC(4),Ed("",gS(26,29,"Config sync"),":\xA0 "),SC(2),xy("h-bad",!e.health.configHealthy),SC(),jy(e.configSyncText()),SC(),YT(e.health.inboundPathHealthy===false?29:-1),SC(),YT(e.health.routingHealthy===false?30:-1),SC(2),Vy("",gS(33,31,"updated")," ",e.agoText(e.health.reportedOnUtc)," ",gS(34,33,"ago"));}}function Xi(n,m){n&1&&(Js(0,"span",24),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Box not reporting")));}function Zi(n,m){if(n&1&&(Js(0,"div",25),H_(1),gd()),n&2){let e=d_(2);SC(),jy(e.healthReason);}}function $i(n,m){if(n&1&&(Js(0,"mat-card",1)(1,"mat-card-content")(2,"div",21)(3,"span",22),fy(4,"span",23),H_(5),pS(6,"translate"),gd(),ZT(7,Qi,35,35)(8,Xi,3,3,"span",24),gd(),ZT(9,Zi,2,1,"div",25),gd()()),n&2){let e=d_();dy("ngClass","h-"+e.healthStatus),SC(5),jy(gS(6,4,"Telephony health")),SC(2),YT(e.health&&!e.healthStale?7:8),SC(2),YT(e.healthReason?9:-1);}}function en(n,m){if(n&1&&(Js(0,"li")(1,"b"),H_(2),gd(),H_(3),gd()),n&2){let e=m.$implicit;SC(2),jy(e.did),SC(),By("",e.label?" \u2014 "+e.label:"",": ",e.renderBlockReason);}}function tn(n,m){if(n&1&&(Js(0,"mat-card",2)(1,"mat-card-content")(2,"div",29)(3,"mat-icon"),H_(4,"error"),gd(),Js(5,"b"),H_(6),pS(7,"translate"),gd()(),Js(8,"ul",30),XT(9,en,4,3,"li",null,Kt),gd(),Js(11,"div",31),H_(12),pS(13,"translate"),gd()()()),n&2){let e=d_();SC(6),jy(gS(7,2,"These numbers are switched on but cannot make or receive calls")),SC(3),JT(e.blockedNumbers),SC(3),jy(gS(13,4,"Fix the value shown, then save the number. The phone server picks the change up within a minute."));}}function nn(n,m){if(n&1){let e=i_();Js(0,"button",32),Ey("click",function(){Vp(e);let a=d_();return Hp$1(a.clearSearch())}),Js(1,"mat-icon"),H_(2,"close"),gd()();}}function an(n,m){n&1&&(Js(0,"div",20),fy(1,"mat-spinner",33),gd());}function on(n,m){n&1&&fy(0,"app-empty-state",34);}function ln(n,m){n&1&&(Js(0,"th",50),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Number")));}function rn(n,m){n&1&&(Js(0,"mat-icon",53),pS(1,"translate"),H_(2,"star"),gd()),n&2&&dy("title",gS(1,1,"Default outbound"));}function dn(n,m){if(n&1){let e=i_();Js(0,"td",51)(1,"button",52),Ey("click",function(){let a=Vp(e).$implicit,p=d_(3);return Hp$1(p.openDetails(a))}),H_(2),gd(),ZT(3,rn,3,3,"mat-icon",53),gd();}if(n&2){let e=m.$implicit;SC(2),jy(e.did),SC(),YT(e.isDefaultOutbound?3:-1);}}function sn(n,m){n&1&&(Js(0,"th",50),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Label")));}function cn(n,m){if(n&1&&(Js(0,"td",51),H_(1),gd()),n&2){let e=m.$implicit;SC(),jy(e.label||"\u2014");}}function pn(n,m){n&1&&(Js(0,"th",50),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Provider")));}function mn(n,m){if(n&1&&(Js(0,"td",51),H_(1),gd()),n&2){let e=m.$implicit;SC(),jy(e.provider||"\u2014");}}function un(n,m){n&1&&(Js(0,"th",50),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Client")));}function _n(n,m){if(n&1&&H_(0),n&2){let e=d_().$implicit;Ed(" ",e.clientName," ");}}function hn(n,m){n&1&&(Js(0,"span",54),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Unassigned")));}function gn(n,m){n&1&&(Js(0,"span",55),pS(1,"translate"),Js(2,"mat-icon"),H_(3,"record_voice_over"),gd(),H_(4),pS(5,"translate"),gd()),n&2&&(dy("matTooltip",gS(1,2,"The AI assistant answers this client's calls.")),SC(4),Ed("",gS(5,4,"Voice AI")," "));}function fn(n,m){if(n&1&&(Js(0,"td",51),ZT(1,_n,1,1)(2,hn,3,3,"span",54),ZT(3,gn,6,6,"span",55),gd()),n&2){let e=m.$implicit;SC(),YT(e.clientName?1:2),SC(2),YT(e.voiceAiEnabled?3:-1);}}function Cn(n,m){n&1&&(Js(0,"th",50),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Transport")));}function xn(n,m){if(n&1&&(Js(0,"td",51),H_(1),pS(2,"uppercase"),gd()),n&2){let e=m.$implicit;SC(),jy(e.transport?gS(2,1,e.transport):"\u2014");}}function vn(n,m){n&1&&(Js(0,"th",50),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Status")));}function bn(n,m){if(n&1&&(Js(0,"span",56)(1,"mat-icon"),H_(2,"error"),gd(),H_(3),pS(4,"translate"),gd()),n&2){let e=d_().$implicit;dy("matTooltip",e.renderBlockReason),SC(3),Ed(" ",gS(4,2,"Not working")," ");}}function Mn(n,m){n&1&&(Js(0,"span",56),pS(1,"translate"),Js(2,"mat-icon"),H_(3,"link_off"),gd(),H_(4),pS(5,"translate"),gd()),n&2&&(dy("matTooltip",gS(1,2,"The number is enabled, but its trunk is not registered on the telep
1hony server, so no call can reach it.")),SC(4),Ed(" ",gS(5,4,"Not registered")," "));}function yn(n,m){n&1&&(Js(0,"span",57),pS(1,"translate"),Js(2,"mat-icon",59),H_(3,"help"),gd(),H_(4),pS(5,"translate"),gd()),n&2&&(dy("matTooltip",gS(1,2,"Enabled. The telephony server has not reported yet, so the live state is unknown.")),SC(4),Ed(" ",gS(5,4,"Enabled")," "));}function wn(n,m){n&1&&(Js(0,"span",58),pS(1,"translate"),Js(2,"mat-icon",59),H_(3,"check_circle"),gd(),H_(4),pS(5,"translate"),gd()),n&2&&(dy("matTooltip",gS(1,2,"Enabled, and the trunk is registered on the telephony server.")),SC(4),Ed(" ",gS(5,4,"Connected")," "));}function Sn(n,m){n&1&&(Js(0,"span",54)(1,"mat-icon",59),H_(2,"block"),gd(),H_(3),pS(4,"translate"),gd()),n&2&&(SC(3),Ed(" ",gS(4,1,"Disabled")));}function En(n,m){if(n&1&&(Js(0,"td",51),ZT(1,bn,5,4,"span",56)(2,Mn,6,6,"span",56)(3,yn,6,6,"span",57)(4,wn,6,6,"span",58)(5,Sn,5,3,"span",54),gd()),n&2){let e=m.$implicit;SC(),YT(e.renderBlockReason?1:e.enabled&&e.trunkRegistered===false?2:e.enabled&&e.trunkRegistered===null?3:e.enabled?4:5);}}function In(n,m){n&1&&(Js(0,"th",60),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Actions")));}function Pn(n,m){if(n&1){let e=i_();Js(0,"td",61)(1,"button",62),pS(2,"translate"),Ey("click",function(){let a=Vp(e).$implicit,p=d_(3);return Hp$1(p.openDetails(a))}),Js(3,"mat-icon"),H_(4,"visibility"),gd()(),Js(5,"button",62),pS(6,"translate"),Ey("click",function(){let a=Vp(e).$implicit,p=d_(3);return Hp$1(p.openEdit(a))}),Js(7,"mat-icon"),H_(8,"edit"),gd()(),Js(9,"button",63),pS(10,"translate"),Ey("click",function(){let a=Vp(e).$implicit,p=d_(3);return Hp$1(p.confirmDelete(a))}),Js(11,"mat-icon"),H_(12,"delete"),gd()()();}n&2&&(SC(),dy("matTooltip",gS(2,3,"Details")),SC(4),dy("matTooltip",gS(6,5,"Edit")),SC(4),dy("matTooltip",gS(10,7,"Delete")));}function kn(n,m){n&1&&fy(0,"tr",64);}function On(n,m){n&1&&fy(0,"tr",65);}function Tn(n,m){if(n&1&&(Js(0,"div",35)(1,"table",36),vd(2,37),ey$1(3,ln,3,3,"th",38)(4,dn,4,2,"td",39),Ea(),vd(5,40),ey$1(6,sn,3,3,"th",38)(7,cn,2,1,"td",39),Ea(),vd(8,41),ey$1(9,pn,3,3,"th",38)(10,mn,2,1,"td",39),Ea(),vd(11,42),ey$1(12,un,3,3,"th",38)(13,fn,4,2,"td",39),Ea(),vd(14,43),ey$1(15,Cn,3,3,"th",38)(16,xn,3,3,"td",39),Ea(),vd(17,44),ey$1(18,vn,3,3,"th",38)(19,En,6,1,"td",39),Ea(),vd(20,45),ey$1(21,In,3,3,"th",46)(22,Pn,13,9,"td",47),Ea(),ey$1(23,kn,1,0,"tr",48)(24,On,1,0,"tr",49),gd()()),n&2){let e=d_(2);SC(),dy("dataSource",e.numbers),SC(22),dy("matHeaderRowDef",e.displayedColumns),SC(),dy("matRowDefColumns",e.displayedColumns);}}function Bn(n,m){if(n&1&&ZT(0,on,1,0,"app-empty-state",34)(1,Tn,25,3,"div",35),n&2){let e=d_();YT(e.numbers.length===0?0:1);}}function Nn(n,m){n&1&&(Js(0,"div",80),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"Assign this number to a client before switching voice answering on.")));}function Dn(n,m){n&1&&(Js(0,"div",81),fy(1,"mat-spinner",84),gd());}function An(n,m){n&1&&(Js(0,"div",87)(1,"mat-icon"),H_(2,"check_circle"),gd(),H_(3),pS(4,"translate"),gd()),n&2&&(SC(3),Ed("",gS(4,1,"Answering calls")," "));}function Vn(n,m){if(n&1&&(Js(0,"span",94),H_(1),pS(2,"translate"),gd()),n&2){let e=d_().$implicit;dy("ngClass","owner-"+e.owner),SC(),jy(gS(2,2,m));}}function Wn(n,m){if(n&1&&(Js(0,"li"),ZT(1,Vn,3,4,"span",94),H_(2),pS(3,"translate"),gd()),n&2){let e,c=m.$implicit,a=d_(4);SC(),YT((e=a.voiceBlockerOwnerKey(c.owner))?1:-1,e),SC(),Ed(" ",gS(3,2,a.voiceBlockerReasonKey(c.reason))," ");}}function Fn(n,m){if(n&1&&(Js(0,"div",92)(1,"mat-icon"),H_(2,"phone_disabled"),gd(),H_(3),pS(4,"translate"),gd(),Js(5,"ul",93),XT(6,Wn,4,4,"li",null,Gi),gd()),n&2){let e=d_(3);SC(3),Ed("",gS(4,1,"Not answering, because:")," "),SC(3),JT(e.voiceAiBlockers);}}function Ln(n,m){n&1&&(Js(0,"div",97)(1,"mat-icon",98),H_(2,"warning"),gd(),Js(3,"span"),H_(4),pS(5,"translate"),gd()()),n&2&&(SC(4),jy(gS(5,1,"This client's voice agent has transfer switched on, so its instructions still speak of the team, even though transfers are switched off for these calls. Creating the agent with transfer off keeps its answers consistent.")));}function Rn(n,m){if(n&1){let e=i_();Js(0,"div",88)(1,"div",89),H_(2),pS(3,"translate"),gd(),Js(4,"mat-radio-group",95),pS(5,"translate"),Ey("change",function(a){Vp(e);let p=d_(3);return Hp$1(p.setVoiceRoutingMode(a.value))}),Js(6,"mat-radio-button",96),H_(7),pS(8,"translate"),gd(),Js(9,"mat-radio-button",96),H_(10),pS(11,"translate"),gd()(),ZT(12,Ln,6,3,"div",97),gd();}if(n&2){let e=d_(3);SC(2),jy(gS(3,9,"When the assistant answers")),SC(2),dy("value",e.voiceRoutingMode)("disabled",e.voiceModeSaving),ly("aria-label",gS(5,11,"When the assistant answers")),SC(2),dy("value",e.VoiceRoutingMode.AnswerFirst),SC(),jy(gS(8,13,"First, before the team")),SC(2),dy("value",e.VoiceRoutingMode.MissedCallsOnly),SC(),jy(gS(11,15,"Only calls the team misses")),SC(2),YT(e.voiceModeOffersMissedTeam?12:-1);}}function zn(n,m){n&1&&(Js(0,"div",90)(1,"mat-icon"),H_(2,"warning"),gd(),Js(3,"span"),H_(4),pS(5,"translate"),gd()()),n&2&&(SC(4),jy(gS(5,1,"This client is still on the old pricing model. The voice assistant is sold only on the points plans, so their calls will keep going to their agents even with this switched on.")));}function Hn(n,m){n&1&&(Js(0,"div",90)(1,"mat-icon"),H_(2,"warning"),gd(),Js(3,"span"),H_(4),pS(5,"translate"),gd()()),n&2&&(SC(4),jy(gS(5,1,"This client has no AI agent set to answer calls yet, so calls still go to their agents. They switch the voice channel on from their own agent settings.")));}function Un(n,m){if(n&1&&(Js(0,"div",91)(1,"mat-icon"),H_(2,"check_circle"),gd(),Js(3,"span"),H_(4),pS(5,"translate"),Js(6,"b"),H_(7),gd()()()),n&2){let e=d_(3);SC(4),Ed("",gS(5,2,"Answering agent"),": "),SC(3),jy(e.voiceAi.voiceAssistantName);}}function qn(n,m){n&1&&(Js(0,"div",90)(1,"mat-icon"),H_(2,"warning"),gd(),Js(3,"span"),H_(4),pS(5,"translate"),gd()()),n&2&&(SC(4),jy(gS(5,1,"Call recording is on but saving nothing: this client has not uploaded the recorded-call announcement, and calls may not be recorded until callers are told. Anything answered meanwhile is lost for good. They upload it from their own call-centre settings.")));}function Kn(n,m){if(n&1){let e=i_();Js(0,"div",85)(1,"mat-slide-toggle",86),Ey("change",function(a){Vp(e);let p=d_(2);return Hp$1(p.setVoiceAi(a.checked))}),H_(2),pS(3,"translate"),gd(),ZT(4,An,5,3,"div",87)(5,Fn,8,3),gd(),ZT(6,Rn,13,17,"div",88),Js(7,"div",89),H_(8),pS(9,"translate"),gd(),ZT(10,zn,6,3,"div",90)(11,Hn,6,3,"div",90)(12,Un,8,4,"div",91),ZT(13,qn,6,3,"div",90);}if(n&2){let e=d_(2);SC(),dy("checked",e.voiceAi.voiceAiEnabled)("disabled",e.voiceAiSaving),SC(),Ed(" ",gS(3,8,"Let the AI assistant answer this client's calls")," "),SC(2),YT(e.voiceAi.canAnswer?4:5),SC(2),YT(e.voiceAi.voiceAiEnabled?6:-1),SC(2),Ed(" ",gS(9,10,"Applies to every number this client owns, and takes effect on their next call. While it is off, every call goes to their human agents.")," "),SC(2),YT(e.voiceAi.isPointsBasedBilling?e.voiceAi.voiceAiEnabled&&!e.voiceAi.hasVoiceAssistant?11:e.voiceAi.hasVoiceAssistant?12:-1:10),SC(3),YT(e.voiceAi.recordingSilentlyOff?13:-1);}}function jn(n,m){n&1&&(Js(0,"div",80),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"No calls in progress")));}function Gn(n,m){if(n&1&&(Js(0,"div",99)(1,"div",100)(2,"span",101)(3,"mat-icon"),H_(4,"headset_mic"),gd(),Js(5,"span",102),H_(6),gd()(),Js(7,"mat-icon",103),H_(8),gd(),Js(9,"span",104)(10,"mat-icon"),H_(11,"person"),gd(),Js(12,"span",102),H_(13),gd()()(),Js(14,"div",105)(15,"span",106),H_(16),pS(17,"translate"),gd(),Js(18,"span",107),H_(19),gd()()()),n&2){let e=m.$implicit,c=d_(3);dy("ngClass","st-"+e.status),SC(6),jy(e.agentName),SC(2),jy(e.direction==="in"?"call_received":"call_made"),SC(5),jy(e.customerName||c.display(e.number)),SC(2),dy("ngClass","chip-"+e.status),SC(),jy(gS(17,7,c.statusKey(e.status))),SC(3),jy(c.liveDuration(e));}}function Yn(n,m){if(n&1&&XT(0,Gn,20,9,"div",99,QT),n&2){let e=d_(2);JT(e.detailActive);}}function Jn(n,m){n&1&&(Js(0,"div",81),fy(1,"mat-spinner",84),gd());}function Qn(n,m){n&1&&(Js(0,"div",80),H_(1),pS(2,"translate"),gd()),n&2&&(SC(),jy(gS(2,1,"No calls found")));}function Xn(n,m){if(n&1&&(Js(0,"span"),H_(1," \xB7 "),Js(2,"mat-icon",114),H_(3,"headset_mic"),gd(),H_(4),gd()),n&2){let e=d_().$implicit;SC(4),jy(e.agentName);}}function Zn(n,m){if(n&1&&(Js(0,"div",108)(1,"mat-icon",109),H_(2),gd(),Js(3,"div",110)(4,"div",111),H_(5),gd(),Js(6,"div",112),H_(7),pS(8,"date"),ZT(9,Xn,5,1,"span"),gd()(),Js(10,"span",113),H_(11),pS(12,"translate"),gd()()),n&2){let e=m.$implicit,c=d_(3);SC(2),jy(c.directionIcon(e.direction)),SC(3),jy(c.contactLabel(e)),SC(2),By(" ",mS(8,6,e.startedOnUtc,"short")," \xB7 ",c.formatDuration(e.durationSeconds)),SC(2),YT(e.agentName?9:-1),SC(2),jy(gS(12,9,e.status));}}function $n(n,m){if(n&1&&XT(0,Zn,13,11,"div",108,Kt),n&2){let e=d_(2);JT(e.detailCalls);}}function ea(n,m){if(n&1){let e=i_();Js(0,"div",66),Ey("click",function(){Vp(e);let a=d_();return Hp$1(a.closeDetails())}),gd(),Js(1,"aside",67)(2,"div",68)(3,"div")(4,"div",69),H_(5),gd(),Js(6,"div",70),H_(7),pS(8,"translate"),gd()(),Js(9,"button",71),pS(10,"translate"),Ey("click",function(){Vp(e);let a=d_();return Hp$1(a.closeDetails())}),Js(11,"mat-icon"),H_(12,"close"),gd()()(),Js(13,"div",72)(14,"div",73)(15,"div",74)(16,"mat-icon"),H_(17,"settings"),gd(),H_(18),pS(19,"translate"),gd(),Js(20,"div",75)(21,"div",76)(22,"span",77),H_(23),pS(24,"translate"),gd(),Js(25,"span",78),H_(26),pS(27,"translate"),gd()(),Js(28,"div",76)(29,"span",77),H_(30),pS(31,"translate"),gd(),Js(32,"span",78),H_(33),gd()(),Js(34,"div",76)(35,"span",77),H_(36),pS(37,"translate"),gd(),Js(38,"span",78),H_(39),pS(40,"uppercase"),gd()(),Js(41,"div",76)(42,"span",77),H_(43),pS(44,"translate"),gd(),Js(45,"span",78),H_(46),gd()(),Js(47,"div",76)(48,"span",77),H_(49),pS(50,"translate"),gd(),Js(51,"span",78),H_(52),pS(53,"translate"),gd()(),Js(54,"div",76)(55,"span",77),H_(56),pS(57,"translate"),gd(),Js(58,"span",78),H_(59),pS(60,"translate"),gd()()(),Js(61,"button",79),Ey("click",function(){let a=Vp(e),p=d_();return Hp$1(p.openEdit(a))}),Js(62,"mat-icon",13),H_(63,"edit"),gd(),H_(64),pS(65,"translate"),gd()(),Js(66,"div",73)(67,"div",74)(68,"mat-icon"),H_(69,"record_voice_over"),gd(),H_(70),pS(71,"translate"),gd(),ZT(72,Nn,3,3,"div",80)(73,Dn,2,0,"div",81)(74,Kn,14,12),gd(),Js(75,"div",73)(76,"div",74),fy(77,"span",82),H_(78),pS(79,"translate"),Js(80,"span",83),H_(81),pS(82,"translate"),gd()(),ZT(83,jn,3,3,"div",80)(84,Yn,2,0),gd(),Js(85,"div",73)(86,"div",74)(87,"mat-icon"),H_(88,"history"),gd(),H_(89),pS(90,"translate"),gd(),ZT(91,Jn,2,0,"div",81)(92,Qn,3,3,"div",80)(93,$n,2,0),gd()()();}if(n&2){let e=m,c=d_();SC(5),jy(e.did),SC(2),jy(e.label||gS(8,25,"Call Center Number")),SC(2),ly("aria-label",gS(10,27,"Close")),SC(9),jy(gS(19,29,"Settings")),SC(5),jy(gS(24,31,"Client")),SC(3),jy(e.clientName||gS(27,33,"Unassigned")),SC(4),jy(gS(31,35,"Provider")),SC(3),jy(e.provider||"\u2014"),SC(3),jy(gS(37,37,"Transport")),SC(3),jy(e.transport?gS(40,39,e.transport):"\u2014"),SC(4),jy(gS(44,41,"Host")),SC(3),By("",e.sipHost||"\u2014","",e.sipPort?":"+e.sipPort:""),SC(3),jy(gS(50,43,"Default outbound")),SC(3),jy(gS(53,45,e.isDefaultOutbound?"Yes":"No")),SC(4),jy(gS(57,47,"Status")),SC(3),jy(gS(60,49,e.enabled?"Enabled":"Disabled")),SC(5),Ed("",gS(65,51,"Edit")," "),SC(6),jy(gS(71,53,"Voice AI answering")),SC(2),YT(e.clientId?c.voiceAiLoading?73:c.voiceAi?74:-1:72),SC(6),Ed("",gS(79,55,"Live calls")," "),SC(3),Ed("(",gS(82,57,"this client"),")"),SC(2),YT(c.detailActive.length===0?83:84),SC(6),jy(gS(90,59,"Call History")),SC(2),YT(c.detailCallsLoading?91:c.detailCalls.length===0?92:93);}}var ta={"voice-not-available":"VoiceBlockerReason_NotInPilot","voice-ai-disabled":"VoiceBlockerReason_StaffSwitchOff","voice-service-killed":"VoiceBlockerReason_PlatformKill","voice-in-arrears":"VoiceBlockerReason_InArrears","voice-service-disabled":"VoiceBlockerReason_ServiceDisabled","legacy-billing-model":"VoiceBlockerReason_LegacyBilling","no-ai-call-agent-entitlement":"VoiceBlockerReason_NoEntitlement","no-voice-assistant":"VoiceBlockerReason_NoAssistant","outside-active-hours":"VoiceBlockerReason_OutsideActiveHours","insufficient-credit":"VoiceBlockerReason_InsufficientCredit","insufficient-wallet-credit":"VoiceBlockerReason_InsufficientWalletCredit"},Aa=(()=>{class n{constructor(e,c,a,p,u,H,jt,Gt){this.service=e,this.callService=c,this.dialog=a,this.dialogConfig=p,this.toast=u,this.errorService=H,this.loadingService=jt,this.translate=Gt,this.displayedColumns=["did","label","provider","client","transport","enabled","actions"],this.numbers=[],this.clients=[],this.loading=false,this.search="",this.selectedNumber=null,this.detailOpen=false,this.detailCalls=[],this.detailCallsLoading=false,this.detailActive=[],this.nowMs=Date.now(),this.detailFetchedAtMs=Date.now(),this.detailPoll=null,this.detailClock=null,this.health=null,this.healthLoaded=false,this.nowMsHealth=Date.now(),this.healthTimer=null,this.voiceAi=null,this.voiceAiLoading=false,this.voiceAiSaving=false,this.voiceModeSaving=false,this.VoiceRoutingMode=F;}ngOnInit(){this.load(),this.loadClients(),this.loadHealth(),this.healthTimer=setInterval(()=>{this.nowMsHealth=Date.now(),this.loadHealth();},6e4);}ngOnDestroy(){this.stopDetailTimers(),this.healthTimer&&clearInterval(this.healthTimer);}loadHealth(){this.callService.getHealth().subscribe({next:e=>{this.healthLoaded=true,this.health=e.succeeded?e.data:null;},error:()=>{this.healthLoaded=true;}});}get healthStale(){return this.health?.reportedOnUtc?Date.now()-Date.parse(this.health.reportedOnUtc)>360*1e3:true}get healthStatus(){return this.healthLoaded?!this.health||this.healthStale||this.health.inboundPathHealthy===false||this.health.trunksConfigured>0&&this.health.trunksPresent===0?"down":!this.health.diskHealthy||!this.health.trunksHealthy||!this.health.configHealthy||this.health.routingHealthy===false||this.health.voiceGatewayHealthy===false?"warn":"ok":"ok"}get healthReason(){let e=this.health;return this.healthLoaded?!e||this.healthStale?this.translate.instant("The phone server has stopped reporting. It may be down."):e.inboundPathHealthy===false?this.translate.instant("Incoming calls are being discarded before they reach anyone, even though the trunk looks connected."):e.trunksConfigured>0&&e.trunksPresent===0?this.translate.instant("The phone server has loaded no trunks at all. No call can be made or received."):e.routingHealthy===false?this.translate.instant("Two trunks claim the same carrier address. Incoming calls may reach the wrong subscriber."):!e.trunksHealthy&&e.trunksConfigured>(e.trunksPresent??e.trunksConfigured)?this.translate.instant("A configured trunk is missing from the phone server. Check the number for an invali
1d value."):e.trunksHealthy?e.configHealthy?e.diskHealthy?e.voiceGatewayHealthy===false?this.translate.instant("The voice assistant is not running. Calls it would answer are going to your team instead."):null:this.translate.instant("Disk space on the phone server is running low."):this.translate.instant("The phone server is running an old configuration."):this.translate.instant("A trunk is not answering."):null}get blockedNumbers(){return this.numbers.filter(e=>!!e.renderBlockReason)}configSyncText(){let e=this.health?.configPollAgeSeconds;return e==null||e<0?this.translate.instant("never"):e<120?this.translate.instant("OK"):e<3600?`${Math.floor(e/60)}m`:`${Math.floor(e/3600)}h`}agoText(e){let c=Math.max(0,Math.floor((Date.now()-Date.parse(e))/1e3));return c<60?`${c}s`:`${Math.floor(c/60)}m`}load(){this.loading=true,this.loadingService.beginSuppress(),this.service.getNumbers(null,this.search?.trim()||null).pipe(Xr(()=>{this.loading=false,this.loadingService.endSuppress();})).subscribe({next:e=>{e.succeeded?this.numbers=e.data||[]:this.errorService.setError(e,"Error while getting the data");},error:e=>this.errorService.setError(e,"Error while getting the data")});}loadClients(){this.service.getAssignableClients().subscribe({next:e=>{e.succeeded&&(this.clients=e.data||[]);},error:()=>{}});}applySearch(){this.load();}clearSearch(){this.search&&(this.search="",this.load());}openAdd(){this.openDialog(null);}openEdit(e){this.openDialog(e);}openDialog(e){this.dialog.open(Ut,E(D({},this.dialogConfig.getDefaultDialogConfig()),{data:{number:e,clients:this.clients}})).afterClosed().subscribe(a=>{a&&this.saveNumber(a);});}saveNumber(e){let c=!!e.id;(c?this.service.updateNumber(e):this.service.createNumber(e)).subscribe({next:p=>{p.succeeded?(this.toast.success(c?"Number updated successfully":"Number added successfully"),this.load()):this.errorService.setError(p,c?"Failed to Update":"Failed to Add");},error:p=>this.errorService.setError(p,c?"Failed to Update":"Failed to Add")});}confirmDelete(e){this.dialog.open(Ft,{data:{title:this.translate.instant("Delete Number"),message:this.translate.instant("Are you sure you want to delete?"),confirmText:this.translate.instant("Delete"),cancelText:this.translate.instant("Cancel"),confirmColor:"warn",showDefaultMessage:false},width:"400px"}).afterClosed().subscribe(a=>{a&&this.deleteNumber(e.id);});}deleteNumber(e){this.service.deleteNumber(e).subscribe({next:c=>{c.succeeded?(this.toast.success("Number deleted successfully"),this.load()):this.errorService.setError(c,"Fail to delete!");},error:c=>this.errorService.setError(c,"Fail to delete!")});}openDetails(e){this.selectedNumber=e,this.detailOpen=true,this.loadDetailCalls(e),this.loadDetailActive(e),this.loadVoiceAi(e),this.stopDetailTimers(),this.detailPoll=setInterval(()=>this.loadDetailActive(e),4e3),this.detailClock=setInterval(()=>{this.nowMs=Date.now();},1e3);}closeDetails(){this.detailOpen=false,this.selectedNumber=null,this.detailCalls=[],this.detailActive=[],this.voiceAi=null,this.stopDetailTimers();}stopDetailTimers(){this.detailPoll&&(clearInterval(this.detailPoll),this.detailPoll=null),this.detailClock&&(clearInterval(this.detailClock),this.detailClock=null);}loadDetailCalls(e){this.detailCallsLoading=true,this.callService.getCalls({clientId:e.clientId,search:e.did,pageNumber:1,pageSize:25}).pipe(Xr(()=>this.detailCallsLoading=false)).subscribe({next:c=>{c.succeeded&&c.data&&(this.detailCalls=c.data.items??[]);},error:()=>{}});}get voiceRoutingMode(){return this.voiceAi?.voiceRoutingMode??F.AnswerFirst}get voiceModeOffersMissedTeam(){return this.voiceRoutingMode===F.MissedCallsOnly&&this.voiceAi?.assistantOffersTransfer===true}loadVoiceAi(e,c={}){c.silent||(this.voiceAi=null),e.clientId&&(c.silent||(this.voiceAiLoading=true),this.service.getClientVoiceAi(e.clientId).pipe(Xr(()=>{c.silent||(this.voiceAiLoading=false);})).subscribe({next:a=>{a.succeeded&&(this.voiceAi=a.data);},error:a=>this.errorService.setError(a,"Error while getting the data")}));}setVoiceAi(e){let c=this.selectedNumber?.clientId;!c||this.voiceAiSaving||(this.voiceAiSaving=true,this.service.setClientVoiceAi(c,e).pipe(Xr(()=>this.voiceAiSaving=false)).subscribe({next:a=>{if(!a.succeeded){this.errorService.setError(a,"Failed to Update"),this.revertVoiceAi();return}this.numbers=this.numbers.map(p=>p.clientId===c?E(D({},p),{voiceAiEnabled:e}):p),this.selectedNumber&&(this.selectedNumber=E(D({},this.selectedNumber),{voiceAiEnabled:e})),this.selectedNumber&&this.loadVoiceAi(this.selectedNumber,{silent:true}),this.toast.success(e?"Voice answering switched on for this client":"Voice answering switched off for this client");},error:a=>{this.errorService.setError(a,"Failed to Update"),this.revertVoiceAi();}}));}revertVoiceAi(){this.selectedNumber&&this.loadVoiceAi(this.selectedNumber);}setVoiceRoutingMode(e){let c=this.selectedNumber?.clientId;!c||this.voiceModeSaving||(this.voiceModeSaving=true,this.service.setClientVoiceRoutingMode(c,e).pipe(Xr(()=>this.voiceModeSaving=false)).subscribe({next:a=>{if(!a.succeeded){this.errorService.setError(a,"Failed to Update"),this.revertVoiceAi();return}this.selectedNumber&&this.loadVoiceAi(this.selectedNumber,{silent:true}),this.toast.success(e===F.MissedCallsOnly?"The assistant now answers only the calls the team misses":"The assistant now answers first, before the team");},error:a=>{this.errorService.setError(a,"Failed to Update"),this.revertVoiceAi();}}));}get voiceAiBlockers(){return this.voiceAi?.blockers??[]}voiceBlockerReasonKey(e){return ta[e]??e}voiceBlockerOwnerKey(e){switch(e){case z.SocialLab:return "VoiceBlockerOwner_SocialLab";case z.Client:return "VoiceBlockerOwner_Client";case z.Commercial:return "VoiceBlockerOwner_Commercial";default:return null}}loadDetailActive(e){this.callService.getActiveCalls().subscribe({next:c=>{let a=(c.succeeded?c.data:[])||[];this.detailActive=e.clientId?a.filter(p=>p.clientId===e.clientId):[],this.detailFetchedAtMs=Date.now();},error:()=>{}});}display(e){return (e||"").replace(/^\+/,"")}liveDuration(e){let c=Math.max(0,Math.floor((this.nowMs-this.detailFetchedAtMs)/1e3)),a=Math.max(0,e.durationSeconds??0)+c,p=Math.floor(a/3600),u=
1Math.floor(a%3600/60),H=(a%60).toString().padStart(2,"0");return p>0?`${p}:${u.toString().padStart(2,"0")}:${H}`:`${u}:${H}`}statusKey(e){switch((e||"").toLowerCase()){case "ringing":return "Incoming";case "calling":return "Calling";case "held":return "On hold";case "active":return "In call";default:return e}}directionIcon(e){switch((e||"").toLowerCase()){case "inbound":return "call_received";case "outbound":return "call_made";default:return "call"}}contactLabel(e){if(e.customerName)return e.customerName;let c=(e.direction||"").toLowerCase()==="outbound";return this.display(c?e.toNumber:e.fromNumber)}formatDuration(e){return !e||e<0?"0:00":`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`}static{this.\u0275fac=function(c){return new(c||n)(V(qt),V(h),V(vr),V(f),V(ut),V(Gt),V(P),V(O))};}static{this.\u0275cmp=Xb({type:n,selectors:[["app-call-numbers"]],decls:41,vars:27,consts:[["helpKey","admin-call-numbers","intro","Phone numbers provisioned for the call centre, who they belong to, and the health of the telephony box behind them.","warning","If config sync is failing, the box is still running its previous dialplan. Number changes made here will not be live, and nothing on this page will look wrong.",3,"steps"],[1,"cardWithShadow","m-b-16","cc-health",3,"ngClass"],[1,"cardWithShadow","m-b-16","cc-blocked-card"],[1,"cardWithShadow"],[1,"d-flex","align-items-center","justify-content-between","flex-wrap","gap-2","m-b-16"],[1,"d-flex","align-items-center"],[1,"bg-light-primary","rounded-circle","d-flex","align-items-center","justify-content-center",2,"width","40px","height","40px"],[1,"text-primary",2,"font-size","20px","width","20px","height","20px"],[1,"m-l-16"],[1,"m-b-0"],[1,"mat-body-2","text-muted"],[1,"d-flex","align-items-center","gap-2"],["mat-stroked-button","","color","primary","routerLink","/admin/call-scoring"],[1,"m-r-4"],["mat-flat-button","","color","primary",3,"click"],[1,"d-flex","align-items-center","gap-2","m-b-16",2,"max-width","420px"],["appearance","outline",1,"w-100",2,"margin-bottom","-1.25em"],["matInput","",3,"ngModelChange","keyup.enter","ngModel"],["matSuffix","","mat-icon-button","","aria-label","clear"],["mat-flat-button","","color","primary",3,"click","disabled"],[1,"text-center","p-y-32"],[1,"d-flex","align-items-center","flex-wrap","gap-3"],[1,"h-badge"],[1,"h-dot"],[1,"h-bad"],[1,"h-reason"],[1,"h-metric"],[1,"h-metric",3,"matTooltip"],[1,"h-metric","text-muted"],[1,"cc-blocked-head"],[1,"cc-blocked-list"],[1,"cc-blocked-foot"],["matSuffix","","mat-icon-button","","aria-label","clear",3,"click"],["diameter","36",2,"display","inline-block"],["icon","dialpad","title","No numbers configured yet","message","Numbers you add will appear here"],[1,"table-responsive"],["mat-table","",1,"w-100",3,"dataSource"],["matColumnDef","did"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","label"],["matColumnDef","provider"],["matColumnDef","client"],["matColumnDef","transport"],["matColumnDef","enabled"],["matColumnDef","actions"],["mat-header-cell","","class","text-end",4,"matHeaderCellDef"],["mat-cell","","class","text-end",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["type","button",1,"did-link",3,"click"],[1,"text-primary","m-l-4",2,"font-size","16px","width","16px","height","16px","vertical-align","middle",3,"title"],[1,"text-muted"],[1,"cc-voice-chip",3,"matTooltip"],[1,"cc-blocked",3,"matTooltip"],[1,"text-muted",3,"matTooltip"],[1,"text-success",3,"matTooltip"],[2,"font-size","16px","width","16px","height","16px","vertical-align","middle"],["mat-header-cell","",1,"text-end"],["mat-cell","",1,"text-end"],["mat-icon-button","","color","primary",3,"click","matTooltip"],["mat-icon-button","","color","warn",3,"click","matTooltip"],["mat-header-row",""],["mat-row",""],[1,"cc-detail-backdrop",3,"click"],[1,"cc-detail-drawer"],[1,"dd-head"],[1,"dd-title"],[1,"dd-sub","text-muted"],["mat-icon-button","",3,"click"],[1,"dd-body"],[1,"dd-section"],[1,"dd-section-title"],[1,"dd-grid"],[1,"dd-item"],[1,"k"],[1,"v"],["mat-stroked-button","","color","primary",1,"m-t-8",3,"click"],[1,"text-muted","p-y-8"],[1,"text-center","p-y-16"],[1,"live-dot"],[1,"dd-hint","text-muted"],["diameter","28",2,"display","inline-block"],[1,"dd-voice-row"],["color","primary",3,"change","checked","disabled"],[1,"dd-voice-answer","dd-voice-answer-ok"],[1,"dd-voice-row","dd-voice-mode"],[1,"dd-voice-note","text-muted"],[1,"dd-voice-warn"],[1,"dd-voice-ok"],[1,"dd-voice-answer","dd-voice-answer-blocked"],[1,"dd-voice-blocker-list"],[1,"dd-voice-blocker-owner",3,"ngClass"],[3,"change","value","disabled"],[3,"value"],[1,"dd-voice-warn","dd-voice-mode-warn"],["aria-hidden","true"],[1,"live-item",3,"ngClass"],[1,"live-row"],[1,"party","agent"],[1,"p-name"],[1,"swap"],[1,"party","cust"],[1,"live-meta"],[1,"chip",3,"ngClass"],[1,"timer"],[1,"dd-call"],[1,"text-primary","dir"],[1,"dd-call-main"],[1,"nm"],[1,"mt","text-muted"],[1,"st","text-muted"],[1,"dd-agent-ico"]],template:function(c,a){if(c&1&&(fy(0,"app-page-help",0),ZT(1,$i,10,6,"mat-card",1),ZT(2,tn,14,6,"mat-card",2),Js(3,"mat-card",3)(4,"mat-card-content")(5,"div",4)(6,"div",5)(7,"div",6)(8,"mat-icon",7),H_(9,"dialpad"),gd()(),Js(10,"div",8)(11,"mat-card-title",9),H_(12),pS(13,"translate"),gd(),Js(14,"span",10),H_(15),pS(16,"translate"),gd()()(),Js(17,"div",11)(18,"button",12)(19,"mat-icon",13),H_(20,"insights"),gd(),H_(21),pS(22,"translate"),gd(),Js(23,"button",14),Ey("click",function(){return a.openAdd()}),Js(24,"mat-icon",13),H_(25,"add"),gd(),H_(26),pS(27,"translate"),gd()()(),Js(28,"div",15)(29,"mat-form-field",16)(30,"mat-label"),H_(31),pS(32,"translate"),gd(),Js(33,"input",17),zy("ngModelChange",function(u){return W_(a.search,u)||(a.search=u),u}),Ey("keyup.enter",function(){return a.applySearch()}),gd(),db(),ZT(34,nn,3,0,"button",18),gd(),Js(35,"button",19),Ey("click",function(){return a.applySearch()}),H_(36),pS(37,"translate"),gd()(),ZT(38,an,2,0,"div",20)(39,Bn,2,1),gd()(),ZT(40,ea,94,61)),c&2){let p;dy("steps",nS(26,ji)),SC(),YT(a.healthLoaded?1:-1),SC(),YT(a.blockedNumbers.length?2:-1),SC(10),jy(gS(13,14,"Call Center Numbers")),SC(3),jy(gS(16,16,"Provision numbers and assign them to clients")),SC(6),Ed("",gS(22,18,"Call scoring \u2014 all clients")," "),SC(5),Ed("",gS(27,20,"Add Number")," "),SC(5),jy(gS(32,22,"Search")),SC(2),$y("ngModel",a.search),pb(),SC(),YT(a.search?34:-1),SC(),dy("disabled",a.loading),SC(),Ed(" ",gS(37,24,"Search")," "),SC(2),YT(a.loading?38:39),SC(2),YT((p=a.detailOpen&&a.selectedNumber)?40:-1,p);}},dependencies:[ce,R,Xv,RM,ea$1,ai,Ng,Ts,Og,Gc,ny,Tt,zg,w0,H0,Zx,dn$1,da,xr,Sh,zw,Nw,sk,Hp,ed,nd,rC,wC,fu,mv,GC,tD,vD,cD,hD,mD,al,tM,dM,Lb,r1,P1,xS,Vs,zs,Fi$1,GS,iI,RI,us,ms,UI,GI,tE,Dn$1,ME,go,Kd,on$1,XE,LT,mA,tA,nA,sA,aA,iA,lA,rA,oA,dA,cA,zM,WM,mt],styles:[".flex-1[_ngcontent-%COMP%]{flex:1 1 0;min-width:140px}.flex-2[_ngcontent-%COMP%]{flex:2 1 0;
1min-width:200px}.section-label[_ngcontent-%COMP%]{font-weight:600;font-size:var(--font-size-sm);opacity:.7;margin:6px 0 2px}.cc-health[_ngcontent-%COMP%]{border-inline-start:4px solid var(--color-text-muted)}.cc-health[_ngcontent-%COMP%]   .h-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;font-weight:700;font-size:var(--font-size-sm);text-transform:uppercase;letter-spacing:.3px}.cc-health[_ngcontent-%COMP%]   .h-dot[_ngcontent-%COMP%]{width:9px;height:9px;border-radius:50%;background:var(--color-text-muted);display:inline-block}.cc-health[_ngcontent-%COMP%]   .h-metric[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;font-size:13px}.cc-health[_ngcontent-%COMP%]   .h-metric[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:17px;width:17px;height:17px;color:var(--color-text-muted)}.cc-health[_ngcontent-%COMP%]   .h-bad[_ngcontent-%COMP%]{color:var(--color-error-text);font-weight:700}.cc-health[_ngcontent-%COMP%]   .h-reason[_ngcontent-%COMP%]{margin-top:8px;font-size:13px;line-height:1.6;color:var(--color-text-muted)}.cc-health.h-ok[_ngcontent-%COMP%]{border-inline-start-color:var(--color-primary)}.cc-health.h-ok[_ngcontent-%COMP%]   .h-dot[_ngcontent-%COMP%]{background:var(--color-primary)}.cc-health.h-warn[_ngcontent-%COMP%]{border-inline-start-color:#f9a825}.cc-health.h-warn[_ngcontent-%COMP%]   .h-dot[_ngcontent-%COMP%]{background:#f9a825;animation:_ngcontent-%COMP%_h-blink 1.3s infinite}.cc-health.h-down[_ngcontent-%COMP%]{border-inline-start-color:var(--color-error)}.cc-health.h-down[_ngcontent-%COMP%]   .h-dot[_ngcontent-%COMP%]{background:var(--color-error);animation:_ngcontent-%COMP%_h-blink 1s infinite}@keyframes _ngcontent-%COMP%_h-blink{0%,to{opacity:1}50%{opacity:.3}}.cc-blocked-card[_ngcontent-%COMP%]{border-inline-start:4px solid var(--color-error)}.cc-blocked-card[_ngcontent-%COMP%]   .cc-blocked-head[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;color:var(--color-error-text)}.cc-blocked-card[_ngcontent-%COMP%]   .cc-blocked-head[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px}.cc-blocked-card[_ngcontent-%COMP%]   .cc-blocked-list[_ngcontent-%COMP%]{margin:8px 0 0;padding-inline-start:1.4rem;font-size:13px;line-height:1.8}.cc-blocked-card[_ngcontent-%COMP%]   .cc-blocked-list[_ngcontent-%COMP%]   b[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.cc-blocked-card[_ngcontent-%COMP%]   .cc-blocked-foot[_ngcontent-%COMP%]{margin-top:8px;font-size:12.5px;color:var(--color-text-muted)}.cc-blocked[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:4px;color:var(--color-error-text);font-weight:700}.cc-blocked[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px}.cc-voice-chip[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:3px;margin-inline-start:6px;padding:1px 7px;border-radius:var(--radius-full);background:#2e7d3224;color:var(--color-primary);font-size:var(--font-size-2xs);font-weight:700;white-space:nowrap}.cc-voice-chip[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:13px;width:13px;height:13px}.dd-voice-row[_ngcontent-%COMP%]{padding:4px 0 2px}.dd-voice-mode[_ngcontent-%COMP%]   mat-radio-group[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.dd-voice-note[_ngcontent-%COMP%]{font-size:var(--font-size-xs);line-height:1.7}.dd-voice-warn[_ngcontent-%COMP%], .dd-voice-ok[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:6px;margin-top:8px;font-size:var(--font-size-xs);line-height:1.7}.dd-voice-warn[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%], .dd-voice-ok[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex:0 0 auto;margin-top:2px}.dd-voice-warn[_ngcontent-%COMP%]{color:var(--color-warning-text)}.dd-voice-ok[_ngcontent-%COMP%]{color:var(--color-primary)}.dd-voice-answer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:var(--font-size-xs);font-weight:700;line-height:1.7}.dd-voice-answer[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:16px;width:16px;height:16px;flex:0 0 auto}.dd-voice-answer-ok[_ngcontent-%COMP%]{color:var(--color-primary)}.dd-voice-answer-blocked[_ngcontent-%COMP%]{color:var(--color-error-text)}.dd-voice-blocker-list[_ngcontent-%COMP%]{margin:2px 0 0;padding-inline-start:1.3rem;font-size:var(--font-size-xs);line-height:1.9}.dd-voice-blocker-owner[_ngcontent-%COMP%]{display:inline-block;margin-inline-end:6px;padding:0 7px;border-radius:var(--radius-full);font-size:var(--font-size-2xs);font-weight:700;background:#00000014;color:var(--color-text-muted)}.dd-voice-blocker-owner.owner-1[_ngcontent-%COMP%]{background:#1e88e524;color:#1565c0}.dd-voice-blocker-owner.owner-2[_ngcontent-%COMP%]{background:#fb8c0029;color:#e65100}.dd-voice-blocker-owner.owner-3[_ngcontent-%COMP%]{background:#8e24aa24;color:#6a1b9a}.did-link[_ngcontent-%COMP%]{border:none;background:none;padding:0;cursor:pointer;font:inherit;font-weight:700;color:var(--mat-sys-primary, var(--color-primary));text-decoration:none}.did-link[_ngcontent-%COMP%]:hover{text-decoration:underline}.cc-detail-backdrop[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:1500;background:#00000052;animation:_ngcontent-%COMP%_dd-fade .15s ease}@keyframes _ngcontent-%COMP%_dd-fade{0%{opacity:0}
1to{opacity:1}}.cc-detail-drawer[_ngcontent-%COMP%]{position:fixed;top:0;bottom:0;inset-inline-end:0;z-index:1501;width:420px;max-width:96vw;background:var(--mat-sys-surface, #fff);box-shadow:var(--shadow-float);display:flex;flex-direction:column;animation:_ngcontent-%COMP%_dd-slide .2s ease}@keyframes _ngcontent-%COMP%_dd-slide{0%{transform:translate(30px);opacity:.6}to{transform:translate(0);opacity:1}}[dir=rtl][_nghost-%COMP%]   .cc-detail-drawer[_ngcontent-%COMP%], [dir=rtl]   [_nghost-%COMP%]   .cc-detail-drawer[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_dd-slide-rtl .2s ease}@keyframes _ngcontent-%COMP%_dd-slide-rtl{0%{transform:translate(-30px);opacity:.6}to{transform:translate(0);opacity:1}}.dd-head[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:14px 12px 14px 18px;background:var(--mat-sys-primary, var(--color-primary));color:#fff}.dd-head[_ngcontent-%COMP%]   .dd-title[_ngcontent-%COMP%]{font-weight:700;font-size:var(--font-size-xl)}.dd-head[_ngcontent-%COMP%]   .dd-sub[_ngcontent-%COMP%]{color:#ffffffd9;font-size:var(--font-size-xs)}.dd-head[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{color:#fff}.dd-body[_ngcontent-%COMP%]{flex:1 1 auto;overflow:auto;padding:16px 18px}.dd-section[_ngcontent-%COMP%]{margin-bottom:22px}.dd-section-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;font-weight:700;font-size:14px;margin-bottom:10px}.dd-section-title[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;color:var(--color-primary)}.dd-section-title[_ngcontent-%COMP%]   .dd-hint[_ngcontent-%COMP%]{font-weight:400;font-size:var(--font-size-xs)}.dd-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px}.dd-item[_ngcontent-%COMP%]{display:flex;flex-direction:column}.dd-item[_ngcontent-%COMP%]   .k[_ngcontent-%COMP%]{font-size:var(--font-size-xs);color:var(--color-text-muted);text-transform:uppercase;letter-spacing:.3px}.dd-item[_ngcontent-%COMP%]   .v[_ngcontent-%COMP%]{font-weight:600;font-size:var(--font-size-sm);word-break:break-word}.dd-call[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid rgba(0,0,0,.06)}.dd-call[_ngcontent-%COMP%]   .dir[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;flex:0 0 auto}.dd-call[_ngcontent-%COMP%]   .dd-call-main[_ngcontent-%COMP%]{min-width:0;flex:1 1 auto}.dd-call[_ngcontent-%COMP%]   .dd-call-main[_ngcontent-%COMP%]   .nm[_ngcontent-%COMP%]{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dd-call[_ngcontent-%COMP%]   .dd-call-main[_ngcontent-%COMP%]   .mt[_ngcontent-%COMP%]{font-size:var(--font-size-xs)}.dd-call[_ngcontent-%COMP%]   .dd-call-main[_ngcontent-%COMP%]   .dd-agent-ico[_ngcontent-%COMP%]{font-size:13px;width:13px;height:13px;vertical-align:middle}.dd-call[_ngcontent-%COMP%]   .st[_ngcontent-%COMP%]{font-size:var(--font-size-xs);flex:0 0 auto}.live-dot[_ngcontent-%COMP%]{width:9px;height:9px;border-radius:50%;background:var(--color-error);display:inline-block;animation:_ngcontent-%COMP%_live-blink 1.2s infinite}@keyframes _ngcontent-%COMP%_live-blink{0%,to{opacity:1}50%{opacity:.3}}.live-item[_ngcontent-%COMP%]{border:1px solid rgba(0,0,0,.08);border-radius:var(--radius-lg);padding:10px 12px;margin-bottom:8px;background:#00000005}.live-item.st-active[_ngcontent-%COMP%]{border-color:#2e7d3266;background:#2e7d320f}.live-item.st-held[_ngcontent-%COMP%]{opacity:.8}.live-item.st-ringing[_ngcontent-%COMP%]{border-color:#1e88e580;background:#1e88e512}.live-item.st-calling[_ngcontent-%COMP%]{border-color:#fb8c0066;background:#fb8c000f}.live-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}.live-row[_ngcontent-%COMP%]   .party[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:6px;min-width:0;flex:1 1 0}.live-row[_ngcontent-%COMP%]   .party[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:18px;width:18px;height:18px;flex:0 0 auto}.live-row[_ngcontent-%COMP%]   .party[_ngcontent-%COMP%]   .p-name[_ngcontent-%COMP%]{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.live-row[_ngcontent-%COMP%]   .party.agent[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:var(--color-primary-dark)}.live-row[_ngcontent-%COMP%]   .party.cust[_ngcontent-%COMP%]{justify-content:flex-end;text-align:end}.live-row[_ngcontent-%COMP%]   .party.cust[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{color:#1565c0}.live-row[_ngcontent-%COMP%]   .swap[_ngcontent-%COMP%]{color:var(--color-text-muted);font-size:20px;width:20px;height:20px;flex:0 0 auto}.live-meta[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:var(--font-size-xs)}.live-meta[_ngcontent-%COMP%]   .timer[_ngcontent-%COMP%]{margin-inline-start:auto;font-variant-numeric:tabular-nums;font-weight:600;color:var(--color-primary)}.chip[_ngcontent-%COMP%]{font-size:var(--font-size-2xs);font-weight:700;letter-spacing:.2px;padding:1px 8px;border-radius:var(--radius-full);text-transform:uppercase}.chip.chip-active[_ngcontent-%COMP%]{background:#2e7d3229;color:var(--color-primary)}.chip.chip-held[_ngcontent-%COMP%]{background:#0000001a;color:var(--color-text-muted)}.chip.chip-ringing[_ngcontent-%COMP%]{background:#1e88e529;
1color:#1565c0}.chip.chip-calling[_ngcontent-%COMP%]{background:#fb8c0029;color:#e65100}"],changeDetection:1});}}return n})();export{Aa as CallNumbersComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.