1import{a as It,b as Mt}from"./chunk-ALBYJHQ6.js";import{a as Q}from"./chunk-77FSLFGU.js";import{a as K}from"./chunk-KKNYJSLL.js";import{a as Me,b as lt}from"./chunk-DHHNRO3G.js";import{a as ke}from"./chunk-M3DSYCA2.js";import{a as Qe}from"./chunk-B2BJOXUP.js";import{b as Tt}from"./chunk-ZOU7JU4I.js";import{a as Et}from"./chunk-EMNRMHET.js";import{a as dt}from"./chunk-A5EUQQC7.js";import{$ as y,$a as gt,$d as We,Ab as be,Ad as Ct,Ba as n,Bb as R,Ca as i,Cd as ut,Ce as z,Da as d,Dd as J,Ec as xe,Ed as X,Fc as Pe,Ha as v,Hd as ze,He as Ee,Ia as f,Ie as kt,Ja as p,Jd as Y,Nd as te,Pd as St,Qa as N,Ra as q,Rd as U,S as Ke,Sa as j,Sd as xt,Se as ot,Ta as He,Td as it,Ua as c,Ud as Pt,Ue as $,Va as M,Ve as Z,W as A,Wa as x,Wd as De,We as se,X as et,Xa as tt,Xd as Ge,_ as _t,_a as vt,_b as D,_d as we,aa as h,ab as bt,ba as w,be as B,bf as At,cc as he,ce as ne,da as T,de as ie,fb as O,ge as ae,hb as b,he as at,ia as E,ib as de,jb as S,je as oe,kc as Ce,ma as a,mb as L,me as le,na as _,ne as _e,oc as Se,oe as fe,p as Xe,pb as G,pe as ve,qe as ge,rb as F,re as Dt,sb as H,se as wt,ta as u,tb as I,ua as ue,va as o,ve as re,wd as nt,xd as W,ya as ft,z as ht,za as Ae}from"./chunk-UKO5M5N4.js";function tn(t,l){if(t&1&&(n(0,"p"),c(1),b(2,"number"),n(3,"sup"),
1c(4,"3"),i(),c(5," for a six month bill "),i()),t&2){let e=p();a(),x(" This is how much we estimate you use each month based upon using ",S(2,1,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.estimatedBilledCons,"1.0-0"),"m")}}function nn(t,l){if(t&1&&(n(0,"p"),c(1),b(2,"number"),i()),t&2){let e=p();a(),x(" This is how much we estimate you use each month based upon using ",S(2,1,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.estimatedBilledCons,"1.0-0")," kWh for a six month bill ")}}function an(t,l){t&1&&(n(0,"small",10),c(1,"credit"),i())}function on(t,l){t&1&&(n(0,"p"),c(1," This amount will reduce your balance over the next six months "),i())}function ln(t,l){t&1&&(n(0,"p"),c(1," As you didn't owe us anything when your plan was calculated, all of your payment goes towards paying your monthly usage "),i())}function rn(t,l){t&1&&(n(0,"p"),c(1," As you started with a credit balance we reduce your payments to use this up "),i())}function sn(t,l){t&1&&(n(0,"p"),c(1," This is how much we think you should pay to cover your water use and any balance "),i())}function mn(t,l){t&1&&(n(0,"p"),c(1," This is how much we think you should pay to cover your use and any balance "),i())}var Bt=(()=>{let l=class l{constructor(m,r,s){this.customerService=m,this.pageScrollService=r,this.document=s,this.sector=D.sector}ngOnInit(){this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m}),this.customer=this.customerService.getCustomer(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#goBack",duration:300,scrollInView:!0})}};l.\u0275fac=function(r){return new(r||l)(_(Y),_(U),_(G))},l.\u0275cmp=A({type:l,selectors:[["app-breakdown-payg"]],decls:43,vars:22,consts:[[1,"card-deck","mb-3","text-center","breakdown"],[1,"card","mb-4"],[1,"card-header","bg-dark","text-white","p-2"],[1,"my-0","font-weight-normal"],[1,"card-body","bg-info"],[1,"card-title","pricing-card-title"],[1,"h5","mb-0"],[1,"h3","mb-0"],[4,"ngIf"],["class","text-muted h6",4,"ngIf"],[1,"text-muted","h6"]],template:function(r,s){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"h5",3),c(4,"Monthly usage"),i()(),n(5,"div",4)(6,"h1",5)(7,"span",6),c(8,"\xA3"),i(),n(9,"span",7),c(10),b(11,"number"),i()(),u(12,tn,6,4,"p",8)(13,nn,3,4,"p",8),i()(),n(14,"div",1)(15,"div",2)(16,"h5",3),c(17,"Towards balance"),i()(),n(18,"div",4)(19,"h1",5)(20,"span",6),c(21,"\xA3"),i(),n(22,"span",7),c(23),b(24,"absolute"),b(25,"number"),u(26,an,2,0,"small",9),i()(),u(27,on,2,0,"p",8)(28,ln,2,0,"p",8)(29,rn,2,0,"p",8),i()(),n(30,"div",1)(31,"div",2)(32,"h5",3),c(33,"Recommended payment"),i()(),n(34,"div",4)(35,"h1",5)(36,"span",6),c(37,"\xA3"),i(),n(38,"span",7),c(39),b(40,"number"),i()(),u(41,sn,2,0,"p",8)(42,mn,2,0,"p",8),i()()()),r&2&&(a(10),M(S(11,11,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.monthlyUsage,"1.2-2")),a(2),o("ngIf",s.sector!=="ENERGY"),a(),o("ngIf",s.sector==="ENERGY"),a(10),x("",S(25,16,de(24,14,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.towardsBalance),"1.2-2")," "),a(3),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.towardsBalance)<0),a(),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.towardsBalance)>0),a(),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.towardsBalance)==0),a(),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.towardsBalance)<0),a(10),M(S(40,19,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.recommendedAmount,"1.2-2")),a(2),o("ngIf",s.sector!=="ENERGY"),a(),o("ngIf",s.sector==="ENERGY"))},dependencies:[I,R,Ge],styles:["@media (max-width: 950px){.card-deck-wrapper[_ngcontent-%COMP%]{margin-right:0;margin-left:0}.card-deck[_ngcontent-%COMP%]{display:block;width:100%;margin-bottom:.75rem;table-layout:fixed;border-spacing:1.25rem 0}.card-deck[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{display:block;margin-bottom:.75rem}.card-deck[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]:not(:first-child){margin-left:0}}"]});let t=l;return t})();var un=["template"];function dn(t,l){t&1&&(n(0,"span"),c(1,"& setup a Direct Debit"),i())}function yn(t,l){if(t&1&&(n(0,"button",12),d(1,"i",13),c(2," Make payment "),i()),t&2){let e=p();o("pageScrollDuration",100)("disabled",(e.customer==null?null:e.customer.movedOutDate)&&(e.customer==null?null:e.customer.balance)<=0)}}function hn(t,l){t&1&&(n(0,"p",10),c(1," Make a card payment to top up the balance on your account "),i())}function _n(t,l){if(t&1&&(n(0,"div"),d(1,"i",22),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}
1function fn(t,l){t&1&&(n(0,"div")(1,"div",23),w(),n(2,"svg",24),d(3,"path",25),i(),n(4,"svg",26),d(5,"path",27),i()()())}function vn(t,l){t&1&&(n(0,"div")(1,"div",28),w(),n(2,"svg",24),d(3,"path",25),i(),n(4,"svg",29),d(5,"path",30),i()()())}function gn(t,l){if(t&1&&(n(0,"div"),u(1,fn,6,0,"div",5)(2,vn,6,0,"div",5),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function bn(t,l){if(t&1){let e=v();n(0,"button",20),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Cn(t,l){if(t&1){let e=v();n(0,"div",14),u(1,_n,2,1,"div",5)(2,gn,3,2,"div",5),i(),n(3,"div",15),d(4,"h4",16),i(),n(5,"div",17),d(6,"p",18),i(),n(7,"div",19)(8,"button",20),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,bn,2,0,"button",21),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}var Ot=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V){this.spinner=m,this.activatedRoute=r,this.spinnerSevice=s,this.paymentOptionsService=g,this.modalService=C,this.datepipe=P,this.decimalpipe=k,this.contactDetailsService=V,this.faSmileWink=Ce,this.faExclamationTriangle=xe,this.faQuestionCircle=Se,this.faCalendarDay=Pe,this.isCollapsed=!1,this.subscriptions=[],this.requestACallBack=!1,this.topUpPaymentTypes=D.topUp,this.url="https://payments.southeastwater.co.uk/sso",this.company=D.company,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.status=new T}ngOnInit(){}onShowUpdate(){this.status.emit("show update")}onShowBreakDown(){this.status.emit("show breakdown")}onMakePayment(){this.company==="SEW"&&window.open("https://payments.southeastwater.co.uk/","_blank")}onAcceptDefault(){let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName),this.customer.paymentPlan.paymentMethod=="Bank Direct Debit"?(this.success=null,this.spinnerSevice.setSpinnerDescription("updating bank details ..."),this.spinner.show(),this.paymentOptionsService.getPaygUpdateResponse(!1,"","","",null,this.customer.payAsYouGo.recommendedAmount,"",!0,m,r,s).subscribe(g=>{this.spinner.hide(),this.returnMessage=g.data.returnMessage;let C="";g.data.nextPaymentAmount&&g.data.nextPaymentDate&&(C="<br>Your next payment of <strong> £"+this.decimalpipe.transform(g.data.nextPaymentAmount,"1.2-2")+" is due on "+this.datepipe.transform(g.data.nextPaymentDate,"dd MMM yyyy")+"</strong>"),g.data.nextPaymentAmount&&g.data.nextPaymentDate&&g.data.recommendedAmount&&g.data.recommendedPaymentDate&&g.data.nextPaymentAmount!=g.data.recommendedAmount&&(C=C+"<br>Your regular monthly payment after that of <strong> £"+this.decimalpipe.transform(g.data.recommendedAmount,"1.2-2")+" will start from "+this.datepipe.transform(g.data.recommendedPaymentDate,"dd MMM yyyy")+"</strong>"),this.success=this.returnMessage==="GREEN",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date "+C:"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.success&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},g=>{this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})):this.status.emit("show ddform")}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success}))}onCallBack(){this.status.emit("callback"),this.closeModal()}getMessage(m){}closeModal(){if(this.modalRef)this.success;else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(J),_(W),_(X),_(K),_(z),_(be),_(R),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-buttons-payg"]],viewQuery:function(r,s){if(r&1&&N(un,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},inputs:{customer:"customer"},outputs:{status:"status"},decls:24,vars:11,consts:[["template",""],[1,"pt-xs-8","pt-sm-8","text-center"],[1,"row"],[1,"col-lg-4","mb-2"],["type","button",3,"click"],[4,"ngIf"],["class","btn btn-block btn-dark h-100","routerLink","../make-a-payment","href","#topnav","pageScroll","",3,"pageScrollDuration","disabled",4,"ngIf"],["type","button","href","#topnav","pageScroll","",1,"btn","btn-block","btn-dark","h-100",3,"click","pageScrollDuration"],[1,"row","pb-5"],[1,"col-lg-4","d-none","d-lg-block"],[1,"rounded","text-center","p-2","text-weight-bold","mt-2"],["class","rounded text-center p-2 text-weight-bold mt-2",4,"ngIf"],["routerLink","../make-a-payment","href","#topnav","pageScroll","",1,"btn","btn-block","btn-dark","h-100",3,"pageScrollDuration","disabled"],[1,"far","fa-credit-card"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[3,"ngClass"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2
162.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,s){if(r&1){let g=v();n(0,"h2",1),c(1,"What would you like to do?"),i(),n(2,"div",2)(3,"div",3)(4,"button",4),f("click",function(){return y(g),h(s.onAcceptDefault())}),c(5),b(6,"number"),u(7,dn,2,0,"span",5),i()(),n(8,"div",3),u(9,yn,3,2,"button",6),i(),n(10,"div",3)(11,"button",7),f("click",function(){return y(g),h(s.onShowUpdate())}),c(12," Pick my payment "),i()()(),n(13,"div",8)(14,"div",9)(15,"p",10),c(16," Click this button to accept our recommended payment. Where we can, we use your readings to calculate this. "),i()(),n(17,"div",9),u(18,hn,2,0,"p",11),i(),n(19,"div",9)(20,"p",10),c(21," You can choose a different payment amount using this button "),i()()(),u(22,Cn,11,5,"ng-template",null,0,L)}r&2&&(a(4),Ae("",s.company==="ICOSA"?"btn-active":"btn-success"," btn btn-lg py-5 btn-block font-weight-bolder h-100"),a(),x(" Accept \xA3",S(6,8,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.recommendedAmount,"1.2-2")," "),a(2),o("ngIf",(s.customer==null||s.customer.paymentPlan==null?null:s.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit"),a(2),o("ngIf",s.application!=="CRM"),a(2),o("pageScrollDuration",100),a(7),o("ngIf",s.application!=="CRM"))},dependencies:[Ct,F,I,it,R]});let t=l;return t})();function Pn(t,l){t&1&&(n(0,"div"),d(1,"i",17),i())}function Dn(t,l){t&1&&(n(0,"div")(1,"div",18),w(),n(2,"svg",19),d(3,"path",20),i(),n(4,"svg",21),d(5,"path",22),i()()())}function wn(t,l){t&1&&(n(0,"p",10),c(1," Calculated balance "),i())}function En(t,l){t&1&&(n(0,"p",10),c(1," Balance "),i())}function kn(t,l){t&1&&(n(0,"span"),c(1,"credit"),i())}function An(t,l){t&1&&(n(0,"span"),c(1,"credit"),i())}function Tn(t,l){if(t&1&&(n(0,"p"),c(1),b(2,"absolute"),b(3,"number"),u(4,kn,2,0,"span",6),c(5),b(6,"absolute"),b(7,"number"),u(8,An,2,0,"span",6),i()),t&2){let e=p();a(),x(" We've worked out how much it would be if we billed you up to date, \xA3",S(3,6,de(2,4,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.unbilledArrears),"1.2-2")," "),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.unbilledArrears)<0),a(),x(" & added this to your balance \xA3",S(7,11,de(6,9,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.startBalance),"1.2-2")," "),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.startBalance)<0)}}function In(t,l){t&1&&(n(0,"p"),c(1," This is the balance last time we billed you, this is different to your current balance "),i())}function Mn(t,l){t&1&&(n(0,"p"),c(1," This is your current balance on your account "),i())}function Bn(t,l){t&1&&(n(0,"div"),d(1,"i",23),i())}function On(t,l){t&1&&(n(0,"div")(1,"div",18),w(),n(2,"svg",19),d(3,"path",20),i(),n(4,"svg",24),d(5,"path",25),i()()())}function Vn(t,l){t&1&&(n(0,"div"),d(1,"i",26),i())}function Gn(t,l){t&1&&(n(0,"div")(1,"div",18),w(),n(2,"svg",19),d(3,"path",20),i(),n(4,"svg",27),d(5,"path",28),i()()())}function Fn(t,l){if(t&1&&(n(0,"p"),c(1," This is the amount we'll take on the "),d(2,"span",29),b(3,"ordinalDay"),c(4," of each month "),i()),t&2){let e=p();a(2),o("innerHTML",de(3,1,e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentDay),E)}}function Yn(t,l){if(t&1&&(n(0,"p"),c(1," This is the amount we'll take on the "),d(2,"span",29),b(3,"ordinalDay"),c(4," of each month "),i()),t&2){let e=p();a(2),o("innerHTML",de(3,1,e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentDay),E)}}function Un(t,l){if(t&1&&d(0,"i",32),t&2){let e=p(2);o("ngClass",!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.payingCorrectAmount?"bg-success":"bg-warning")}}function Rn(t,l){if(t&1&&d(0,"i",33),t&2){let e=p(2);o("ngClass",!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.payingCorrectAmount?"bg-success":"bg-warning")}}function Nn(t,l){if(t&1&&(n(0,"div"),u(1,Un,1,1,"i",30)(2,Rn,1,1,"i",31),i()),t&2){let e=p();a(),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.payingCorrectAmount),a(),o("ngIf",!(!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.payingCorrectAmount))}}function qn(t,l){if(t&1&&(n(0,"div",35),w(),n(1,"svg",19),d(2,"path",20),i(),n(3,"svg",36)(4,"defs")(5,"style"),c(6," .cls-1 { fill: #44b387; } "),i()(),d(7,"path",37)(8,"path",38)(9,"path",39)(10,"path",40),i()()),t&2){let e=p(2);o("ngClass",!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.payingCorrectAmount?"bg-active":"bg-warning")}}function jn(t,l){if(t&1&&(n(0,"div",35),w(),n(1,"svg",19),d(2,"path",20),i(),n(3,"svg",41),d(4,"path",42),i()()),t&2){let e=p(2);o("ngClass",!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.payingCorrectAmount?"bg-active":"bg-warning")}}function Ln(t,l){if(t&1&&(n(0,"div"),u(1,qn,11,1,"div",34)(2,jn,5,1,"div",34),i()),t&2){let e=p();a(),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.payingCorrectAmount),a(),o("ngIf",!(!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.payingCorrectAmount))}}function Hn(t,l){t&1&&(n(0,"p",10),c(1," Your monthly payment could do with changing "),i())}function zn(t,l){t&1&&(n(0,"span",8),c(1,"\xA3"),i())}function Wn(t,l){if(t&1&&(n(0,"span",11),c(1),b(2,"number"),i()),t&2){let e=p();a(),M(S(2,1,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount,"1.2-2"))}}function Qn(t,l){t&1&&(n(0,"p",43),c(1," Hit the Accept button below to change your plan "),i())}function Jn(t,l){if(t&1){let e=v();n(0,"button",44),f("click",function(){y(e);let r=p();return h(r.onShowBreakDown())}),n(1,"strong"),c(2,"> want more info?"),i()()}}var Vt=(()=>{let l=class l{constructor(){this.faSmileWink=Ce,this.faExclamationTriangle=xe,this.faQuestionCircle=Se,this.faCalendarDay=Pe,this.isCollapsed=!1,this.company=D.c
1ompany,this.status=new T}ngOnInit(){this.parentSubject.subscribe(m=>{(m="hidden breakdown")&&(this.showBreakDown=!1)})}onHideBreakdown(){this.showBreakDown=!1}onShowBreakDown(){this.showBreakDown=!0,this.status.emit("show breakdown")}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-change-payg"]],inputs:{customer:"customer",parentSubject:"parentSubject",showBreakDown:"showBreakDown"},outputs:{status:"status"},decls:58,vars:32,consts:[[1,"icon-cards","mt-2","mt-md-2"],[1,"row"],[1,"icon-card","mt-4","col-md-6"],[1,"icon-card-inner","d-flex","flex-column","justify-content-center","h-100","bg-info","text-center"],[1,"icon-card-body","h-100"],[1,"icon-circle"],[4,"ngIf"],["class","my-0 font-size-lg",4,"ngIf"],[1,"h3","mb-0"],[1,"h1","mb-2",3,"innerHTML"],[1,"my-0","font-size-lg"],[1,"h1","mb-2"],[1,"icon-card-inner","d-flex","flex-column","justify-content-center","h-100","text-center","bg-info"],["class","h3 mb-0",4,"ngIf"],["class","h1 mb-2",4,"ngIf"],["class","my-0",4,"ngIf"],["class","text-success h5 btn btn-lg btn-link p-0","style","position: absolute; right: 0px; bottom: -60px",3,"click",4,"ngIf"],[1,"fal","fas","fa-wallet","bg-primary"],[1,"icon-circle-inner","bg-secondary"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512","fill","white"],["d","M384 256c-17.67 0-32 14.33-32 32s14.33 32 32 32 32-14.33 32-32-14.33-32-32-32zm80-160h-16V80c0-26.51-21.49-48-48-48H96C42.98 32 0 74.98 0 128v256c0 53.02 42.98 96 96 96h352c35.35 0 64-28.65 64-64V144c0-26.51-21.49-48-48-48zm16 320c0 17.64-14.36 32-32 32H96c-35.29 0-64-28.71-64-64V128c0-35.29 28.71-64 64-64h304c8.82 0 16 7.18 16 16v16H112c-8.84 0-16 7.16-16 16s7.16 16 16 16h352c8.82 0 16 7.18 16 16v272z"],[1,"fal","fa-calendar-alt","bg-primary"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M400 64h-48V12c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v52H128V12c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM48 96h352c8.8 0 16 7.2 16 16v48H32v-48c0-8.8 7.2-16 16-16zm352 384H48c-8.8 0-16-7.2-16-16V192h384v272c0 8.8-7.2 16-16 16zM148 320h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-96 96h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm192 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12z"],[1,"fal","fa-money-bill-wave","bg-primary"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 640 512","fill","white"],["d","M320 144c-53.02 0-96 50.14-96 112 0 61.85 42.98 112 96 112 53 0 96-50.13 96-112 0-61.86-42.98-112-96-112zm0 192c-35.29 0-64-35.89-64-80s28.71-80 64-80 64 35.89 64 80-28.71 80-64 80zM621.16 54.46C582.37 38.19 543.55 32 504.75 32c-123.17-.01-246.33 62.34-369.5 62.34C70.34 94.34 46.9 79 32.25 79 15.04 79 0 92.32 0 110.81v317.26c0 12.63 7.23 24.6 18.84 29.46C57.63 473.81 96.45 480 135.25 480c123.17 0 246.33-62.35 369.5-62.35 64.91 0 88.34 15.35 103 15.35 17.21 0 32.25-13.32 32.25-31.81V83.93c0-12.64-7.23-24.6-18.84-29.47zm-588.21 56.8c20.22 6.42 41.03 10.53 62.67 12.89-1.97 33.41-29.23 60.04-62.89 60.43l.22-73.32zM32 428.07l.13-42.54c33.58.07 60.88 26.31 63.38 59.43-22.45-3.04-43.63-8.45-63.51-16.89zm575.05-27.33c-20.16-6.4-40.9-10.51-62.47-12.87 2.89-32.5 29.69-58.14 62.69-58.52l-.22 71.39zm.31-103.54c-50 .34-90.59 39.32-94.58 88.6-70.73-1.43-137.18 15.82-200.6 31.87-75.07 19-126.54 31.21-184.41 29.87-1.23-52.02-43.48-94.01-95.55-94.13l.41-136.67c50.65-.34 91.72-40.32 94.78-90.52 70.53 1.41 137.02-15.83 200.4-31.87C402.6 75.41 454.3 63.13 512.03 64.46c.18 52.93 43.01 95.94 95.74 96.07l-.41 136.67zm.51-168.8c-34.24-.07-62.04-27.34-63.58-61.38 22.53 3.03 43.78 8.45 63.71 16.91l-.13 44.47z"],[3,"innerHTML"],["class","far fa-smile-wink",3,"ngClass",4,"ngIf"],["class","far fa-exclamation-triangle",3,"ngClass",4,"ngIf"],[1,"far","fa-smile-wink",3,"ngClass"],[1,"far","fa-exclamation-triangle",3,"ngClass"],["class","icon-circle-inner",3,"ngClass",4,"ngIf"],[1,"icon-circle-inner",3,"ngClass"],["
1id","Layer_1","data-name","Layer 1","xmlns","http://www.w3.org/2000/svg","width","53.75","height","53.75","viewBox","0 0 53.75 53.75"],["d","M26.875,5.5A21.5,21.5,0,1,1,5.375,27a21.52435,21.52435,0,0,1,21.5-21.5m0-5.375A26.875,26.875,0,1,0,53.75,27,26.875,26.875,0,0,0,26.875.125Z","transform","translate(0 -0.125)",1,"cls-1"],["d","M19.759,14.75952a4.03126,4.03126,0,1,0,4.03125,4.03125A4.03125,4.03125,0,0,0,19.759,14.75952Z","transform","translate(0 -0.125)",1,"cls-1"],["d","M33.59375,14.90625A4.03125,4.03125,0,1,0,37.625,18.9375a4.03125,4.03125,0,0,0-4.03125-4.03125Z","transform","translate(0 -0.125)",1,"cls-1"],["d","M41.58842,28.34375H37.59933a10.807,10.807,0,0,1-21.44866,0H11.154a15.77732,15.77732,0,0,0,31.442,0Z","transform","translate(0 -0.125)",1,"cls-1"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 576 512","fill","white"],["d","M270.2 160h35.5c3.4 0 6.1 2.8 6 6.2l-7.5 196c-.1 3.2-2.8 5.8-6 5.8h-20.5c-3.2 0-5.9-2.5-6-5.8l-7.5-196c-.1-3.4 2.6-6.2 6-6.2zM288 388c-15.5 0-28 12.5-28 28s12.5 28 28 28 28-12.5 28-28-12.5-28-28-28zm281.5 52L329.6 24c-18.4-32-64.7-32-83.2 0L6.5 440c-18.4 31.9 4.6 72 41.6 72H528c36.8 0 60-40 41.5-72zM528 480H48c-12.3 0-20-13.3-13.9-24l240-416c6.1-10.6 21.6-10.7 27.7 0l240 416c6.2 10.6-1.5 24-13.8 24z"],[1,"my-0"],[1,"text-success","h5","btn","btn-lg","btn-link","p-0",2,"position","absolute","right","0px","bottom","-60px",3,"click"]],template:function(r,s){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),u(6,Pn,2,0,"div",6)(7,Dn,6,0,"div",6),i(),u(8,wn,2,0,"p",7)(9,En,2,0,"p",7),n(10,"span",8),c(11,"\xA3"),i(),d(12,"span",9),b(13,"moneyPipe"),u(14,Tn,9,14,"p",6)(15,In,2,0,"p",6)(16,Mn,2,0,"p",6),i()()(),n(17,"div",2)(18,"div",3)(19,"div",4)(20,"div",5),u(21,Bn,2,0,"div",6)(22,On,6,0,"div",6),i(),n(23,"p",10),c(24,"Monthly usage"),i(),n(25,"span",8),c(26,"\xA3"),i(),n(27,"span",11),c(28),b(29,"number"),i(),n(30,"p"),c(31,"This is how much we've calculated you use in an average month"),i()()()(),n(32,"div",2)(33,"div",3)(34,"div",4)(35,"div",5),u(36,Vn,2,0,"div",6)(37,Gn,6,0,"div",6),i(),n(38,"p",10),c(39,"Current payment"),i(),n(40,"span",8),c(41,"\xA3"),i(),n(42,"span",11),c(43),b(44,"number"),i(),u(45,Fn,5,3,"p",6)(46,Yn,5,3,"p",6),i()()(),n(47,"div",2)(48,"div",12)(49,"div",4)(50,"div",5),u(51,Nn,3,2,"div",6)(52,Ln,3,2,"div",6),i(),u(53,Hn,2,0,"p",7)(54,zn,2,0,"span",13)(55,Wn,3,4,"span",14)(56,Qn,2,0,"p",15)(57,Jn,3,0,"button",16),i()()()()()),r&2&&(a(6),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(),o("ngIf",s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.includesBillUpToDate),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.includesBillUpToDate)),a(3),o("innerHTML",S(13,23,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance,!0),E),a(2),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.includesBillUpToDate)&&(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)!=(s.customer==null?null:s.customer.balance)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.includesBillUpToDate)&&(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)!=(s.customer==null?null:s.customer.balance)),a(),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)==(s.customer==null?null:s.customer.balance)),a(5),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(6),M(S(29,26,s.customer==null?null:s.customer.payAsYouGo.monthlyUsage,"1.2-2")),a(8),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(6),M(S(44,29,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.currentPaymentAmount,"1.2-2")),a(2),o("ngIf",s.customer.paymentPlan.paymentMethod=="Bank Direct Debit"),a(),o("ngIf",s.customer.paymentPlan.paymentMethod!="Bank Direct Debit"),a(5),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.payingCorrectAmount)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.payingCorrectAmount)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.payingCorrectAmount)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.payingCorrectAmount)),a(),o("ngIf",!s.showBreakDown))},dependencies:[F,I,R,De,Ge,ot],styles:[".pricing-header[_ngcontent-%COMP%]{max-width:700px}.card-deck[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{min-width:240px}"]});let t=l;return t})();var Gt=(()=>
1{let l=class l{constructor(){this.company=D.company,this.displayName="South East Water"}ngOnInit(){this.company==="ESP"?this.displayName="ESP Water":this.company==="ICOSA"?this.displayName="Last Mile Water":this.company==="LMH"?this.displayName="Last Mile Heat":this.company==="MTX"?this.displayName="Matrix Water":this.company==="MUA"?this.displayName="mua Water":this.company==="LEF"&&(this.displayName="Leaf Water")}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-dd-guarantee"]],decls:12,vars:4,consts:[[1,"my-3"],[1,"small"]],template:function(r,s){r&1&&(n(0,"h4",0),c(1,"Direct Debit Guarantee"),i(),n(2,"p",1),c(3,` This Guarantee is offered by all banks and building societies that accept instructions to pay Direct Debits. 2`),i(),n(4,"p",1),c(5),i(),n(6,"p",1),c(7),i(),n(8,"p",1),c(9),i(),n(10,"p",1),c(11,` You can cancel a Direct Debit at any time by simply contacting your bank or building society. Written confirmation may be required. Please also notify us. 3`),i()),r&2&&(a(5),tt(" If there are any changes to the amount, date or frequency of your Direct Debit ",s.displayName," will notify you 10 working days in advance of your account being debited or as otherwise agreed. If you request ",s.displayName,` to collect a payment, confirmation of the amount and date will be given to you at the time of the request. 4`),a(2),x(" If an error is made in the payment of your Direct Debit, by ",s.displayName,` or your bank or building society, you are entitled to a full and immediate refund of the amount paid from your bank or building society. 5`),a(2),x(" If you receive a refund you are not entitled to, you must pay it back when ",s.displayName,` asks you to. 6`))}});let t=l;return t})();var Kn=["template"],Je=(t,l)=>({"is-invalid":t,"is-valid":l});function ei(t,l){if(t&1&&(n(0,"div",53)(1,"div",54)(2,"div",55)(3,"div",25)(4,"h4"),c(5,"Account holder"),i(),n(6,"span"),c(7),i()(),n(8,"div",25)(9,"h4"),c(10,"Account number"),i(),n(11,"span"),c(12),i()(),n(13,"div",25)(14,"h4"),c(15,"Sort code"),i(),n(16,"span"),c(17),i()()()()()),t&2){let e=p(2);a(7),M(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.mandateName),a(5),M(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.accountNumber),a(5),M(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.sortCode)}}function ti(t,l){if(t&1&&(n(0,"option",56),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e.day),a(),x(" ",e.description," ")}}function ni(t,l){if(t&1&&(n(0,"div",38)(1,"div",41),d(2,"input",57,6),n(4,"label",58),c(5," Override Direct Debit delay days "),i()()()),t&2){let e=p(2);a(2),o("ngClass",O(1,Je,e.submitted&&e.getElement("overrideDelayDays").errors,e.getElement("overrideDelayDays").touched&&e.getElement("overrideDelayDays").valid))}}function ii(t,l){t&1&&(n(0,"div")(1,"p"),c(2," Direct Debits can take between 4 to 10 days to set up. Until then, we will continue with your current payment method. "),i()())}function ai(t,l){t&1&&(n(0,"div")(1,"p"),c(2," Confirmation of your Direct Debit set up will be sent within three working days or no later than 10 working days before the first collection. This will be sent into your My Account Inbox unless you have opted to receive paper communication in which case it will be posted to you. Direct Debits can take between four and 10 days to set up. Until then, we will continue with your current payment method. "),i()())}function oi(t,l){t&1&&(n(0,"div",59),c(1," Please note that Last Mile Water shares a payment system with South East Water, therefore any Direct Debit payments will be displayed as South East Water Ltd on your bank statement. "),i())}function li(t,l){if(t&1){let e=v();n(0,"li")(1,"a",62),f("click",function(){y(e),p(2);let r=He(13),s=p();return h(s.focusOnError(r))}),c(2," Please enter the account holder name "),i()()}}function ri(t,l){if(t&1){let e=v();n(0,"li")(1,"a",62),f("click",function(){y(e),p(2);let r=He(22),s=p();return h(s.focusOnError(r))}),c(2," Please enter a valid account number "),i()()}}function si(t,l){if(t&1){let e=v();n(0,"li")(1,"a",62),f("click",function(){y(e),p(2);let r=He(31),s=p();return h(s.focusOnError(r))}),c(2," Please enter a valid sort code "),i()()}}function mi(t,l){if(t&1){let e=v();n(0,"li")(1,"a",62),f("click",function(){y(e),p(2);let r=He(43),s=p();return h(s.focusOnError(r))}),c(2," Please enter a valid paymentDay "),i()()}}function ci(t,l){if(t&1){let e=v();n(0,"li")(1,"a",62),f("click",function(){y(e),p(2);let r=He(54),s=p();return h(s.focusOnError(r))}),c(2," Please confirm you are the account holder "),i()()}}function pi(t,l){if(t&1&&(n(0,"div",60,7)(2,"h4"),c(3,"There is a problem, please correct the fields marked below."),i(),n(4,"ul",61),u(5,li,3,0,"li",45)(6,ri,3,0,"li",45)(7,si,3,0,"li",45)(8,mi,3,0,"li",45)(9,ci,3,0,"li",45),i()()),t&2){let e=p(2);a(5),o("ngIf",e.submitted&&e.getElement("accountName").errors),a(),o("ngIf",e.submitted&&e.getElement("accountNumber").errors),a(),o("ngIf",e.submitted&&e.getElement("sortCode").errors),a(),o("ngIf",e.submitted&&e.getElement("paymentDay").errors),a(),o("ngIf",e.submitted&&e.getElement("confirmation").errors)}}function ui(t,l){if(t&1&&(n(0,"span",69),c(1),b(2,"number"),i()),t&2){let e=p(2).$implicit;a(),x("",S(2,1,e==null?null:e.paymentAmount,"1.2-2")," ")}}function di(t,l){if(t&1&&(n(0,"small"),c(1),b(2,"date"),i()),t&2){let e=p(2).$implicit;a(),x(" on ",S(2,1,e==null?null:e.paymentDate,"dd MMM yy"),"")}}function yi(t,l){if(t&1&&(n(0,"div")(1,"span",67),c(2,"\xA3"),i(),u(3,ui,3,4,"span",68)(4,di,3,4,"small",45),c(5,"\xA0 "),i()),t&2){let e=p().$implicit;a(3),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0)}}function hi(t,l){if(t&1&&(n(0,"div"),u(1,yi,6,2,"div",45),i()),t&2){let e=l.index;a(),o("ngIf",e%2==0)}}function _i(t,l){if(t&1&&(n(0,"span",69),c(1),b(2,"number"),i()),t&2){let e=p(2).$implicit;a(),M(S(2,1,e==null?null:e.paymentAmount,"1.2-2"))}}function fi(t,l){if(t&1&&(n(0,"small"),c(1),b(2,"date"),i()),t&2){let e=p(2).$implicit;a(),x(" on ",S(2,1,e==null?null:e.paymentDate,"dd MMM yy"),"")}}function vi(t,l){if(t&1&&(n(0,"div")(1,"span",67),c(2,"\xA3"),i(),u(3,_i,3,4,"span",68)(4,fi,3,4,"small",45),c(5,"\xA0 "),i()),t&2){let e=p().$implicit;a(3),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0)}}function gi(t,l){if(t&1&&(n(0,"div"),u(1,vi,6,2,"div",45),i()),t&2){let e=l.index;a(),o("ngIf",e%2!=0)}}
6function bi(t,l){if(t&1&&(n(0,"div",55)(1,"div",63)(2,"h3",64),c(3," Your payments "),i()(),n(4,"div",65),u(5,hi,2,1,"div",66),i(),n(6,"div",65),u(7,gi,2,1,"div",66),i()()),t&2){let e=p(2);a(2),o("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary"),a(3),o("ngForOf",e.paymentsDue),a(2),o("ngForOf",e.paymentsDue)}}function Ci(t,l){if(t&1){let e=v();n(0,"div",11)(1,"form",12),f("ngSubmit",function(){y(e);let r=p();return h(r.onSubmit())}),n(2,"h2",13),c(3," Setup a Direct Debit "),i(),u(4,ei,18,3,"div",14),n(5,"div",15)(6,"div",16)(7,"label",17),c(8,"Name of account holder"),i(),d(9,"app-input-error-message",18),n(10,"div",19)(11,"div",20)(12,"input",21,1),f("change",function(r){y(e);let s=p();return h(s.onChange(r))}),i()()(),n(14,"small",22),c(15,"This is the account holder name for the bank account"),i(),n(16,"label",23),c(17,"Your bank account number"),i(),d(18,"app-input-error-message",24),n(19,"div",19)(20,"div",25)(21,"input",26,2),f("change",function(r){y(e);let s=p();return h(s.onChange(r))}),i()()(),n(23,"small",27),c(24,"This should be eight digits long"),i(),n(25,"label",23),c(26,"Your sort code"),i(),d(27,"app-input-error-message",28),n(28,"div",19)(29,"div",25)(30,"input",29,3),f("change",function(r){y(e);let s=p();return h(s.onChange(r))}),i()()(),n(32,"small",30),c(33,"This should be six digits long"),i(),n(34,"legend")(35,"h4")(36,"label",31),c(37,"Payment day"),i()()(),d(38,"app-input-error-message",32),n(39,"div",19)(40,"div",20)(41,"div",33)(42,"select",34,4),f("change",function(r){y(e);let s=p();return h(s.onChange(r))}),n(44,"option",35),c(45," Choose your payment day "),i(),u(46,ti,2,2,"option",36),i()()()(),n(47,"small",37),c(48,"We offer four different payment dates 1st, 7th, 15th or 23rd"),i(),n(49,"div",38)(50,"div",39),d(51,"app-input-error-message",40),n(52,"div",41)(53,"input",42,5),f("change",function(r){y(e);let s=p();return h(s.onChange(r))}),i(),n(55,"label",43),c(56," I confirm that I am the account holder and the only person required to authorise Direct Debits on this account. "),i()()()(),u(57,ni,6,4,"div",44),i()(),u(58,ii,3,0,"div",45)(59,ai,3,0,"div",45)(60,oi,2,0,"div",46)(61,pi,10,5,"div",47)(62,bi,8,3,"div",48),n(63,"div",19)(64,"div",49)(65,"div",50)(66,"button",51),f("click",function(){y(e);let r=p();return h(r.onCancel())}),c(67," Cancel "),i(),n(68,"button",52),c(69," Submit "),i()()()()(),d(70,"app-dd-guarantee"),i()}if(t&2){let e=p();a(),o("formGroup",e.directDebitForm),a(3),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.mandateName)||(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.accountNumber)||(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.sortCode)),a(5),o("displayErrorIf",e.submitted&&e.getElement("accountName").errors),a(3),o("ngClass",O(25,Je,e.submitted&&e.getElement("accountName").errors,e.getElement("accountName").touched&&e.getElement("accountName").valid)),a(6),o("displayErrorIf",e.submitted&&e.getElement("accountNumber").errors)("errorMsg",e.getElement("accountNumber").errors?e.getElement("accountNumber").errors.incorrect?"Bank account and / or sort code do not appear to be correct - please re-enter":"Please enter a valid account number":""),a(3),o("ngClass",O(28,Je,e.submitted&&e.getElement("accountNumber").errors,e.getElement("accountNumber").touched&&e.getElement("accountNumber").valid)),a(6),o("displayErrorIf",e.submitted&&e.getElement("sortCode").errors)("errorMsg",e.getElement("sortCode").errors?e.getElement("sortCode").errors.incorrect?"Bank account and / or sort code do not appear to be correct - please re-enter":"Please enter a valid sort code":""),a(3),o("ngClass",O(31,Je,e.submitted&&e.getElement("sortCode").errors,e.getElement("sortCode").touched&&e.getElement("sortCode").valid))("dropSpecialCharacters",!1),a(8),o("displayErrorIf",e.submitted&&e.getElement("paymentDay").errors),a(4),o("ngClass",O(34,Je,e.submitted&&e.getElement("paymentDay").errors,e.getElement("paymentDay").touched&&e.getElement("paymentDay").valid)),ue("aria-invalid",!e.getElement("paymentDay").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.paymentDays),a(5),o("displayErrorIf",e.submitted&&e.getElement("confirmation").errors),a(2),o("ngClass",O(37,Je,e.submitted&&e.getElement("confirmation").errors,e.getElement("confirmation").touched&&e.getElement("confirmation").valid)),a(4),o("ngIf",e.application==="CRM"),a(),o("ngIf",e.company!=="LMH"),a(),o("ngIf",e.company==="LMH"),a(),o("ngIf",e.company==="ICOSA"),a(),o("ngIf",e.submitted&&e.directDebitForm.invali
6d),a(),o("ngIf",e.paymentsDue&&e.paymentsDue.length>0),a(6),o("disabled",e.submittedForm)}}function Si(t,l){if(t&1&&(n(0,"div"),d(1,"i",64),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function xi(t,l){t&1&&(n(0,"div")(1,"div",78),w(),n(2,"svg",79),d(3,"path",80),i(),n(4,"svg",81),d(5,"path",82),i()()())}function Pi(t,l){t&1&&(n(0,"div")(1,"div",83),w(),n(2,"svg",79),d(3,"path",80),i(),n(4,"svg",84),d(5,"path",85),i()()())}function Di(t,l){if(t&1&&(n(0,"div"),u(1,xi,6,0,"div",45)(2,Pi,6,0,"div",45),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function wi(t,l){if(t&1){let e=v();n(0,"button",76),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Ei(t,l){if(t&1){let e=v();n(0,"div",70),u(1,Si,2,1,"div",45)(2,Di,3,2,"div",45),i(),n(3,"div",71),d(4,"h4",72),i(),n(5,"div",73),d(6,"p",74),i(),n(7,"div",75)(8,"button",76),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,wi,2,0,"button",77),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}function ki(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",86),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Other payment enquiry")}var Re=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe,ct,pt,Le){this.fb=m,this.pageScrollService=r,this.document=s,this.customerService=g,this.bankValidationService=C,this.spinner=P,this.spinnerSevice=k,this.paymentOptionsService=V,this.modalService=me,this.datepipe=ce,this.decimalpipe=pe,this.analyticsService=ct,this.activatedRoute=pt,this.contactDetailsService=Le,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=he,this.paymentDays=ke,this.subscriptions=[],this.requestACallBack=!1,this.company=D.company,this.inputJson=null,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.status=new T}ngOnInit(){this.paymentValues&&(this.inputJson=JSON.parse(this.paymentValues)),this.analyticsService.pageView("direct-debit-setup-form","./direct-debit-setup-name","update direct debit setup form"),this.directDebitForm=this.fb.group({accountName:[null,B.required,B.minLength(5),B.maxLength(18)],accountNumber:[null,[B.required,B.pattern("\\d{8}"),B.minLength(7),B.maxLength(8)]],sortCode:[null,B.required],confirmation:[!1,B.required],paymentDay:[null,B.required],paymentAmount:[this.payg],overrideDelayDays:[!0]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.customer?(this.customer?.paymentPlan?.paymentDay?.toString()=="1"||this.customer?.paymentPlan?.paymentDay?.toString()=="7"||this.customer?.paymentPlan?.paymentDay?.toString()=="15"||this.customer?.paymentPlan?.paymentDay?.toString()=="23"?this.directDebitForm.patchValue({paymentDay:this.inputJson&&this.inputJson?.paymentDay?this.inputJson?.paymentDay:this.customer?.paymentPlan?.paymentDay?.toString()}):this.directDebitForm.patchValue({paymentDay:this.inputJson&&this.inputJson?.paymentDay?this.inputJson?.paymentDay:null}),this.acceptIdeal?this.directDebitForm.patchValue({paymentAmount:this.customer.payAsYouGo.recommendedAmount}):this.inputJson?.paymentAmount&&this.directDebitForm.patchValue({paymentAmount:this.inputJson?.paymentAmount})):this.directDebitForm.patchValue({paymentDay:this.inputJson&&this.inputJson?.paymentDay?this.inputJson?.paymentDay:null})}),this.customer=this.customerService.getCustomer(),this.customer?(this.customer?.paymentPlan?.paymentDay?.toString()=="1"||this.customer?.paymentPlan?.paymentDay?.toString()=="7"||this.customer?.paymentPlan?.paymentDay?.toString()=="15"||this.customer?.paymentPlan?.paymentDay?.toString()=="23"?this.directDebitForm.patchValue({paymentDay:this.inputJson&&this.inputJson?.paymentDay?this.inputJson?.paymentDay:this.customer?.paymentPlan?.paymentDay?.toString()}):this.directDebitForm.patchValue({paymentDay:this.inputJson&&this.inputJson?.paymentDay?this.inputJson?.paymentDay:null}),this.acceptIdeal?this.directDebitForm.patchValue({paymentAmount:this.customer.payAsYouGo.recommendedAmount}):this.inputJson?.paymentAmount&&this.directDebitForm.patchValue({paymentAmount:this.inputJson?.paymentAmount})):this.directDebitForm.patchValue({paymentDay:this.inputJson&&this.inputJson?.paymentDay?this.inputJson?.paymentDay:""})}focusOnError(m){m.focus()}onChange(m){this.directDebitForm.valid&&this.unmeasuredPayments&&(this.spinnerSevice.setSpinnerDescription("checking bank details ..."),this.spinner.show(),this.bankValidationService.checkValid(this.directDebitForm.get("accountNumber").value,this.directDebitForm.get("sortCode").value).subscribe(r=>{r.Items.length==0||r.Items[0].Error||!r.Items[0].IsCorrect?(this.spinner.hide(),this.directDebitForm.controls.accountNumber.setErrors({incorrect:!0}),this.directDebitForm.controls.sortCode.setErrors({incorrect:!0})):(this.spinnerSevice.setSpinnerDescription("Getting payments ..."),this.paymentOptionsService.getUnmeasuredPaymentPlanCheckResponse(this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,this.getElement("paymentDay").value,this.unmeasuredPayments,!1,this.getElement("overrideDelayDays").value).subscribe(s=>{this.spinner.hide(),this.paymentsDue=s.data.paymentsDue},s=>{this.spinner.hide()}))},r=>{this.spinner.hide()}))}onSubmit(){let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName),this.submitted=!0;let g=document.querySelector(".ng-invalid[formControlName]");
6if(this.directDebitForm.invalid||this.getElement("confirmation").errors){this.focusOnError(g);return}else this.submittedForm=!0,this.bankValidationService.checkValid(this.directDebitForm.get("accountNumber").value,this.directDebitForm.get("sortCode").value).subscribe(C=>{C.Items.length==0||C.Items[0].Error||!C.Items[0].IsCorrect?(this.directDebitForm.controls.accountNumber.setErrors({incorrect:!0}),this.directDebitForm.controls.sortCode.setErrors({incorrect:!0}),this.submittedForm=!1):(this.success=null,this.spinnerSevice.setSpinnerDescription("updating bank details ..."),this.spinner.show(),this.inputJson&&this.inputJson.numberOfPayments?this.customer.movedOutDate&&this.inputJson.numberOfPayments>0?this.paymentOptionsService.getAdhocPaymentUpdateResponse(!0,"1",this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,"",this.getElement("paymentDay").value,null,this.inputJson.numberOfPayments,null,null,null,"COP",this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)},P=>{this.spinner.hide(),this.success=!1,this.submittedForm=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}):this.paymentOptionsService.getUnmeasuredPaymentPlanUpdateResponse(this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,this.getElement("paymentDay").value,this.inputJson.numberOfPayments,!1,this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)},P=>{this.spinner.hide(),this.success=!1,this.submittedForm=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}):this.inputJson?this.customer.movedOutDate||!this.customer.movedInDate?this.paymentOptionsService.getAdhocPaymentUpdateResponse(!0,"1",this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,"",this.getElement("paymentDay").value,this.getElement("paymentAmount").value,null,null,null,null,"COP",this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)},P=>{this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date,":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}):this.paymentOptionsService.getAffordabilityPlanUpdateResponse(!1,this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,this.getElement("paymentDay").value,this.getElement("paymentAmount").value,
6null,null,null,this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)},P=>{this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}):this.unmeasuredPayments?this.paymentOptionsService.getUnmeasuredPaymentPlanUpdateResponse(this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,this.getElement("paymentDay").value,this.unmeasuredPayments,!1,this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.submittedForm=!1,this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN",this.successModal(P)},P=>{this.submittedForm=!1,this.spinner.hide(),this.errorModal()}):this.ddOnBill&&this.customer.supplyType=="MEASURED"?this.paymentOptionsService.getDDOnBillUpdateResponse(this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,this.getElement("paymentDay").value,this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN",this.successModal(P)},P=>{this.submittedForm=!1,this.spinner.hide(),this.errorModal()}):this.directDebitForm.get("paymentAmount").value?this.paymentOptionsService.getPaygUpdateResponse(!1,this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,this.getElement("paymentDay").value,this.directDebitForm.get("paymentAmount").value,this.specialPlanType,this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.successModal(P)},P=>{this.submittedForm=!1,this.spinner.hide(),this.errorModal()}):this.paymentOptionsService.getBankDetailsUpdateResponse(this.getElement("accountName").value,this.getElement("accountNumber").value,this.getElement("sortCode").value,this.getElement("paymentDay").value,this.getElement("overrideDelayDays").value,m,r,s).subscribe(P=>{this.spinner.hide(),this.returnMessage=P.data.returnMessage,this.success=this.returnMessage==="GREEN",this.successModal(P)},P=>{this.submittedForm=!1,this.spinner.hide(),this.errorModal()}))})}successModal(m){this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem";let r="";m.data.nextPaymentAmount&&m.data.nextPaymentDate&&(r="<br>Your next payment of <strong> £"+this.decimalpipe.transform(m.data.nextPaymentAmount,"1.2-2")+" is due on "+this.datepipe.transform(m.data.nextPaymentDate,"dd MMM yyyy")+"</strong>"),m.data.nextPaymentAmount&&m.data.nextPaymentDate&&m.data.recommendedAmount&&m.data.recommendedPaymentDate&&m.data.nextPaymentAmount!=m.data.recommendedAmount&&(r=r+"<br>Your regular monthly payment after that of <strong> £"+this.decimalpipe.transform(m.data.recommendedAmount,"1.2-2")+" will start from "+this.datepipe.transform(m.data.recommendedPaymentDate,"dd MMM yyyy")+"</strong>"),this.success=this.returnMessage==="GREEN",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"Thanks that's all updated for you. "+r:"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.success&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)}errorModal(){this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}getElement(m){if(m)return this.directDebitForm.get(m)}onCancel(){this.status.emit("cancel"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}ngOnDestroy(){this.customerSubscription.unsubscribe()}ngOnChanges(m){}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.modalRef&&(this.modalRef.hide(),this.modalRef=null),this.requestACallBack=!0}getMessage(m){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&this.onCancel();else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(re),_(U),_(G),_(Y),_(lt),_(J),_(X),_(K),_(z),_(be),_(R),_(te),_(W),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-direct-debit-setup"]],viewQuery:function(r,s){if(r&1&&N(Kn,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},inputs:{payg:"payg",acceptIdeal:"acceptIdeal",ddOnBill:"ddOnBill",unmeasuredPayments:"unmeasuredPayments",unmeasuredAffordabilityPlanAmount:"unmeasuredAffordabilityPlanAmount",unmeasuredAffordabilityPlanDay:"unmeasuredAffordabilityPlanDay",paymentValues:"paymentValues",specialPlanType:"specialPlanType"},outputs:{status:"status"},features:[_t],decls:5,vars:2,consts:[["template",""],["accountNameErrorRef",""],["accountNumberErrorRef",""],["sortCodeErrorRef",""],["paymentDayErrorRef",""],["confirmationErrorRef",""],["overrideDelayDaysErrorRef",""],["errorSummaryRef",""],["class","form-wrap mt-8 pt-3",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"form-wrap","mt-8","pt-3"],["id","directDebitForm","name","directDebitForm",3,"ngSubmit","formGroup"],["id","ddformHeader","name","ddformHeader",1,"mt-6","mb-3"],["class","card bg-info mb-4",4,"ngIf"],[1,"form-group"],[1,"py-1"],["for","accountName",1,"label","required"],["errorMsg","Please enter the name of the account holder","id","name-error",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-6"],["formControlName","accountName","name","accountName","
6id","accountName","autofocus","","type","text","maxlength","18","aria-describedby","name-hint name-error","required","",1,"form-control","form-control-lg",3,"change","ngClass"],["id","name-hint",1,"hint"],[1,"pt-4","label","required"],["id","acc-number-error",3,"displayErrorIf","errorMsg"],[1,"col-md-4"],["formControlName","accountNumber","name","accountNumber","id","accountNumber","maxlength","8","type","text","aria-describedby","acc-number-hint acc-number-error","required","",1,"form-control","form-control-lg",3,"change","ngClass"],["id","acc-number-hint",1,"hint"],["id","sort-code-error",3,"displayErrorIf","errorMsg"],["formControlName","sortCode","name","sortCode","id","sortCode","mask","00-00-00","type","text","aria-describedby","sort-code-hint sort-code-error","required","",1,"form-control","form-control-lg",3,"change","ngClass","dropSpecialCharacters"],["id","sort-code-hint",1,"hint"],["for","paymentDay",1,"label","required"],["errorMsg","Please select a payment day","id","payment-day-error",3,"displayErrorIf"],[1,"select-wrap"],["aria-describedby","payment-day-hint payment-day-error","formControlName","paymentDay","name","paymentDay","id","paymentDay","required","",1,"custom-select","custom-select-lg",3,"change","ngClass"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["id","payment-day-hint",1,"hint"],[1,"form-row","pt-4"],[1,"col-auto"],["errorMsg","You must confirm you are the account holder to proceed","id","confirmation-error",3,"displayErrorIf"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","confirmation","name","confirmation","id","confirmation","aria-describedby","confirmation-error","required","",1,"custom-control-input",3,"change","ngClass"],["for","confirmation",1,"custom-control-label"],["class","form-row pt-4",4,"ngIf"],[4,"ngIf"],["class","alert alert-warning mb-3 mt-3",4,"ngIf"],["class","alert alert-danger mb-6 col-12",4,"ngIf"],["class","row",4,"ngIf"],[1,"col-12","mt-2"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"card","bg-info","mb-4"],[1,"card-body"],[1,"row"],[3,"ngValue"],["type","checkbox","formControlName","overrideDelayDays","name","overrideDelayDays","id","overrideDelayDays","aria-describedby","overrideDelayDays-error",1,"custom-control-input",3,"ngClass"],["for","overrideDelayDays",1,"custom-control-label"],[1,"alert","alert-warning","mb-3","mt-3"],[1,"alert","alert-danger","mb-6","col-12"],[1,"error-list"],[3,"click"],[1,"col-12"],[3,"ngClass"],[1,"col-6"],[4,"ngFor","ngForOf"],[1,"h5"],["class","h5 display-5",4,"ngIf"],[1,"h5","display-5"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2
662.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,s){r&1&&(u(0,Ci,71,40,"div",8)(1,Ei,11,5,"ng-template",null,0,L),n(3,"section",9),u(4,ki,1,1,"app-request-a-call-back",10),i()),r&2&&(o("ngIf",!s.requestACallBack),a(4),o("ngIf",s.requestACallBack))},dependencies:[F,H,I,se,Ee,ae,fe,ve,We,we,_e,ne,ie,ge,wt,Dt,oe,le,kt,Gt,R,be]});let t=l;return t})();function Ai(t,l){t&1&&(n(0,"div"),d(1,"i",14),i())}function Ti(t,l){t&1&&(n(0,"div")(1,"div",15),w(),n(2,"svg",16),d(3,"path",17),i(),n(4,"svg",18),d(5,"path",19),i()()())}function Ii(t,l){t&1&&(n(0,"p",10),c(1," Calculated balance "),i())}function Mi(t,l){t&1&&(n(0,"p",10),c(1," Balance "),i())}function Bi(t,l){t&1&&(n(0,"span"),c(1,"credit"),i())}function Oi(t,l){t&1&&(n(0,"span"),c(1,"credit"),i())}function Vi(t,l){if(t&1&&(n(0,"p"),c(1),b(2,"absolute"),b(3,"number"),u(4,Bi,2,0,"span",6),c(5),b(6,"absolute"),b(7,"number"),u(8,Oi,2,0,"span",6),i()),t&2){let e=p();a(),x(" We've worked out how much it would be if we billed you up to date, \xA3",S(3,6,de(2,4,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.unbilledArrears),"1.2-2")," "),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.unbilledArrears)<0),a(),x(" & added this to your balance \xA3",S(7,11,de(6,9,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.startBalance),"1.2-2")," "),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.startBalance)<0)}}function Gi(t,l){t&1&&(n(0,"p"),c(1," This is the balance last time we billed you, this is different to your current balance "),i())}function Fi(t,l){t&1&&(n(0,"p"),c(1," This is your current balance on your account "),i())}function Yi(t,l){t&1&&(n(0,"div"),d(1,"i",20),i())}function Ui(t,l){t&1&&(n(0,"div")(1,"div",15),w(),n(2,"svg",16),d(3,"path",17),i(),n(4,"svg",21),d(5,"path",22),i()()())}function Ri(t,l){t&1&&(n(0,"div"),d(1,"i",23),i())}function Ni(t,l){t&1&&(n(0,"div")(1,"div",15),w(),n(2,"svg",16),d(3,"path",17),i(),n(4,"svg",24),d(5,"path",25),i()()())}function qi(t,l){if(t&1&&(n(0,"p"),c(1," This is the amount we'll take on the "),d(2,"span",26),b(3,"ordinalDay"),c(4," of each month "),i()),t&2){let e=p();a(2),o("innerHTML",de(3,1,e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentDay),E)}}function ji(t,l){if(t&1&&(n(0,"p"),c(1," This is the amount we'll take on the "),d(2,"span",26),b(3,"ordinalDay"),c(4," of each month "),i()),t&2){let e=p();a(2),o("innerHTML",de(3,1,e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentDay),E)}}function Li(t,l){t&1&&(n(0,"div"),d(1,"i",27),i())}function Hi(t,l){t&1&&(n(0,"div")(1,"div",15),w(),n(2,"svg",16),d(3,"path",17),i(),n(4,"svg",24),d(5,"path",25),i()()())}function zi(t,l){t&1&&(n(0,"span"),c(1,"and balance"),i())}function Wi(t,l){if(t&1){let e=v();n(0,"button",30),f("click",function(){y(e);let r=p(2);return h(r.onShowBreakDown())}),n(1,"strong"),c(2,"> want more info?"),i()()}}function Qi(t,l){if(t&1&&(n(0,"p",28),c(1," We think you're paying about the right amount based on your monthly usage "),u(2,zi,2,0,"span",6)(3,Wi,3,0,"button",29),i()),t&2){let e=p();a(2),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance)>0),a(),o("ngIf",!e.showBreakDown)}}var Ft=(()=>{let l=class l{constructor(){this.faSmileWink=Ce,this.faExclamationTriangle=xe,this.faQuestionCircle=Se,this.faCalendarDay=Pe,this.isCollapsed=!1,this.company=D.company,this.status=new T}ngOnInit(){this.parentSubject.subscribe(m=>{(m="hidden breakdown")&&(this.showBreakDown=!1)})}onHideBreakdown(){this.showBreakDown=!1}onShowBreakDown(){this.showBreakDown=!0,this.status.emit("show breakdown")}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-good-payg"]],inputs:{customer:"customer",parentSubject:"parentSubject",showBreakDown:"showBreakDown"},outputs:{status:"status"},decls:54,vars:28,consts:[[1,"icon-cards","mt-2","mt-md-2"],[1,"row"],[1,"icon-card","mt-4","col-md-6"],[1,"icon-card-inner","d-flex","flex-column","justify-content-center","h-100","bg-info","text-center"],[1,"icon-card-body","h-100"],[1,"icon-circle"],[4,"ngIf"],["class","my-0 font-size-lg",4,"ngIf"],[1,"h3","mb-0"],[1,"h1","mb-2",3,"innerHTML"],[1,"my-0","font-size-lg"],[1,"h1","mb-2"],[1,"icon-card-inner","d-flex","flex-column","justify-content-center","h-100","text-center","bg-info"],["class","h3",4,"ngIf"],[1,"fal","fas","fa-wallet","bg-primary"],[1,"icon-circle-inner","bg-secondary"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512","fill","white"],["d","M384 256c-17.67 0-32 14.33-32 32s14.33 32 32 32 32-14.33 32-32-14.33-32-32-32zm80-160h-16V80c0-26.51-21.49-48-48-48H96C42.98 32 0 74.98 0 128v256c0 53.02 42.98 96 96 96h352c35.35 0 64-28.65 64-64V144c0-26.51-21.49-48-48-48zm16 320c0 17.64-14.36 32-32 32H96c-35.29 0-64-28.71-64-64V128c0-35.29 28.71-64 64-64h304c8.82 0 16 7.18 16 16v16H112c-8.84 0-16 7.16-16 16s7.16 16 16 16h352c8.82 0 16 7.18 16 16v272z"],[1,"fal","fa-calendar-alt","bg-primary"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M400 64h-48V12c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v52H128V12c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM48 96h352c8.8 0 16 7.2 16 16v48H32v-48c0-8.8 7.2-16 16-16zm352 384H48c-8.8 0-16-7.2-16-16V192h384v272c0 8.8-7.2 16-16 16zM148 320h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-96 96h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm192 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12z"],[1,"fal","fa-money-bill-wave","bg-primary"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 640 512","fill","white"],["d","M320 144c-53.02 0-96 50.14-96 112 0 61.85 42.98 112 96 112 53 0 96-50.13 96-112 0-61.86-42.98-112-96-112zm0 192c-35.29 0-64-35.89-64-80s28.71-80 64-80 64 35.89 64 80-28.71 80-64 80zM621.16 54.46C582.37 38.19 543.55 32 504.75 32c-123.17-.01-246.33 62.34-369.5 62.34C70.34 94.34 46.9 79 32.25 79 15.04 79 0 92.32 0 110.81v317.26c0 12.63 7.23 24.6 18.84 29.46C57.63 473.81 96.45 480 135.25 480c123.17 0 246.33-62.35 369.5-62.35 64.91 0 88.34 15.35 103 15.35 17.21 0 32.25-13.32 32.25-31.81V83.93c0-12.64-7.23-24.6-18.84-29.47zm-588.21 56.8c20.22 6.42 41.03 10.53 62.67 12.89-1.97 33.41-29.23 60.
604-62.89 60.43l.22-73.32zM32 428.07l.13-42.54c33.58.07 60.88 26.31 63.38 59.43-22.45-3.04-43.63-8.45-63.51-16.89zm575.05-27.33c-20.16-6.4-40.9-10.51-62.47-12.87 2.89-32.5 29.69-58.14 62.69-58.52l-.22 71.39zm.31-103.54c-50 .34-90.59 39.32-94.58 88.6-70.73-1.43-137.18 15.82-200.6 31.87-75.07 19-126.54 31.21-184.41 29.87-1.23-52.02-43.48-94.01-95.55-94.13l.41-136.67c50.65-.34 91.72-40.32 94.78-90.52 70.53 1.41 137.02-15.83 200.4-31.87C402.6 75.41 454.3 63.13 512.03 64.46c.18 52.93 43.01 95.94 95.74 96.07l-.41 136.67zm.51-168.8c-34.24-.07-62.04-27.34-63.58-61.38 22.53 3.03 43.78 8.45 63.71 16.91l-.13 44.47z"],[3,"innerHTML"],[1,"far","fa-smile-wink","bg-success"],[1,"h3"],["class","text-success h5 btn btn-lg btn-link p-0","style","position: absolute; right: 0px; bottom: -60px",3,"click",4,"ngIf"],[1,"text-success","h5","btn","btn-lg","btn-link","p-0",2,"position","absolute","right","0px","bottom","-60px",3,"click"]],template:function(r,s){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),u(6,Ai,2,0,"div",6)(7,Ti,6,0,"div",6),i(),u(8,Ii,2,0,"p",7)(9,Mi,2,0,"p",7),n(10,"span",8),c(11,"\xA3"),i(),d(12,"span",9),b(13,"moneyPipe"),u(14,Vi,9,14,"p",6)(15,Gi,2,0,"p",6)(16,Fi,2,0,"p",6),i()()(),n(17,"div",2)(18,"div",3)(19,"div",4)(20,"div",5),u(21,Yi,2,0,"div",6)(22,Ui,6,0,"div",6),i(),n(23,"p",10),c(24,"Monthly usage"),i(),n(25,"span",8),c(26,"\xA3"),i(),n(27,"span",11),c(28),b(29,"number"),i(),n(30,"p"),c(31,"This is how much we've calculated you use in an average month"),i()()()(),n(32,"div",2)(33,"div",3)(34,"div",4)(35,"div",5),u(36,Ri,2,0,"div",6)(37,Ni,6,0,"div",6),i(),n(38,"p",10),c(39,"Current payment"),i(),n(40,"span",8),c(41,"\xA3"),i(),n(42,"span",11),c(43),b(44,"number"),i(),u(45,qi,5,3,"p",6)(46,ji,5,3,"p",6),i()()(),n(47,"div",2)(48,"div",12)(49,"div",4)(50,"div",5),u(51,Li,2,0,"div",6)(52,Hi,6,0,"div",6),i(),u(53,Qi,4,2,"p",13),i()()()()()),r&2&&(a(6),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="LMH"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(),o("ngIf",s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.includesBillUpToDate),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.includesBillUpToDate)),a(3),o("innerHTML",S(13,19,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance,!0),E),a(2),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.includesBillUpToDate)&&(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)!=(s.customer==null?null:s.customer.balance)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.includesBillUpToDate)&&(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)!=(s.customer==null?null:s.customer.balance)),a(),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)==(s.customer==null?null:s.customer.balance)),a(5),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="LMH"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(6),M(S(29,22,s.customer==null?null:s.customer.payAsYouGo.monthlyUsage,"1.2-2")),a(8),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="LMH"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(6),M(S(44,25,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.currentPaymentAmount,"1.2-2")),a(2),o("ngIf",s.customer.paymentPlan.paymentMethod=="Bank Direct Debit"),a(),o("ngIf",s.customer.paymentPlan.paymentMethod!="Bank Direct Debit"),a(5),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="LMH"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(),o("ngIf",s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.payingCorrectAmount))},dependencies:[I,R,De,Ge,ot]});let t=l;return t})();function Xi(t,l){t&1&&(n(0,"div"),d(1,"i",17),i())}
6function $i(t,l){t&1&&(n(0,"div")(1,"div",18),w(),n(2,"svg",19),d(3,"path",20),i(),n(4,"svg",21),d(5,"path",22),i()()())}function Zi(t,l){t&1&&(n(0,"p",10),c(1," Calculated balance "),i())}function Ki(t,l){t&1&&(n(0,"p",10),c(1," Balance "),i())}function ea(t,l){t&1&&(n(0,"span"),c(1,"credit"),i())}function ta(t,l){t&1&&(n(0,"span"),c(1,"credit"),i())}function na(t,l){if(t&1&&(n(0,"p"),c(1),b(2,"absolute"),b(3,"number"),u(4,ea,2,0,"span",6),c(5),b(6,"absolute"),b(7,"number"),u(8,ta,2,0,"span",6),i()),t&2){let e=p();a(),x(" We've worked out how much it would be if we billed you up to date, \xA3",S(3,6,de(2,4,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.unbilledArrears),"1.2-2")," "),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.unbilledArrears)<0),a(),x(" & added this to your balance \xA3",S(7,11,de(6,9,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.startBalance),"1.2-2")," "),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.startBalance)<0)}}function ia(t,l){t&1&&(n(0,"p"),c(1," This is the balance last time we billed you, this is different to your current balance "),i())}function aa(t,l){t&1&&(n(0,"p"),c(1," This is your current balance on your account "),i())}function oa(t,l){t&1&&(n(0,"div"),d(1,"i",23),i())}function la(t,l){t&1&&(n(0,"div")(1,"div",18),w(),n(2,"svg",19),d(3,"path",20),i(),n(4,"svg",24),d(5,"path",25),i()()())}function ra(t,l){t&1&&(n(0,"div"),d(1,"i",26),i())}function sa(t,l){t&1&&(n(0,"div")(1,"div",18),w(),n(2,"svg",19),d(3,"path",20),i(),n(4,"svg",24),d(5,"path",27),i()()())}function ma(t,l){t&1&&(n(0,"span",8),c(1,"\xA3"),i())}function ca(t,l){if(t&1&&(n(0,"span",11),c(1),b(2,"number"),i()),t&2){let e=p();a(),M(S(2,1,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount,"1.2-2"))}}function pa(t,l){t&1&&(n(0,"p",28),c(1," Hit the Accept button below to change your plan "),i())}function ua(t,l){if(t&1){let e=v();n(0,"button",29),f("click",function(){y(e);let r=p();return h(r.onShowBreakDown())}),n(1,"strong"),c(2,"> want more info?"),i()()}}var Yt=(()=>{let l=class l{constructor(){this.faSmileWink=Ce,this.faExclamationTriangle=xe,this.faQuestionCircle=Se,this.faCalendarDay=Pe,this.isCollapsed=!1,this.company=D.company,this.status=new T}ngOnInit(){this.parentSubject.subscribe(m=>{(m="hidden breakdown")&&(this.showBreakDown=!1)})}onHideBreakdown(){this.showBreakDown=!1}onShowBreakDown(){this.showBreakDown=!0,this.status.emit("show breakdown")}};l.\u0275fac=function(r){return new(r||l)},l.\u0275cmp=A({type:l,selectors:[["app-new-payg"]],inputs:{customer:"customer",parentSubject:"parentSubject",showBreakDown:"showBreakDown"},outputs:{status:"status"},decls:44,vars:23,consts:[[1,"icon-cards","my-4"],[1,"row"],[1,"icon-card","mt-4","col-md-4"],[1,"icon-card-inner","d-flex","flex-column","justify-content-center","h-100","bg-info","text-center"],[1,"icon-card-body","h-100"],[1,"icon-circle"],[4,"ngIf"],["class","my-0 font-size-lg",4,"ngIf"],[1,"h3","mb-0"],[1,"h1","mb-2",3,"innerHTML"],[1,"my-0","font-size-lg"],[1,"h1","mb-2"],[1,"icon-card-inner","d-flex","flex-column","justify-content-center","h-100","text-center","bg-info"],["class","h3 mb-0",4,"ngIf"],["class","h1 mb-2",4,"ngIf"],["class","my-0",4,"ngIf"],["class","text-success h5 btn btn-lg btn-link p-0","style","position: absolute; right: 0px; bottom: -60px",3,"click",4,"ngIf"],[1,"fal","fas","fa-wallet","bg-primary"],[1,"icon-circle-inner","bg-secondary"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512","fill","white"],["d","M384 256c-17.67 0-32 14.33-32 32s14.33 32 32 32 32-14.33 32-32-14.33-32-32-32zm80-160h-16V80c0-26.51-21.49-48-48-48H96C42.98 32 0 74.98 0 128v256c0 53.02 42.98 96 96 96h352c35.35 0 64-28.65 64-64V144c0-26.51-21.49-48-48-48zm16 320c0 17.64-14.36 32-32 32H96c-35.29 0-64-28.71-64-64V128c0-35.29 28.71-64 64-64h304c8.82 0 16 7.18 16 16v16H112c-8.84 0-16 7.16-16 16s7.16 16 16 16h352c8.82 0 16 7.18 16 16v272z"],[1,"fal","fa-calendar-alt","bg-primary"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M400 64h-48V12c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v52H128V12c0-6.6-5.4-12-12-12h-8c-6.6 0-12 5.4-12 12v52H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM48 96h352c8.8 0 16 7.2 16 16v48H32v-48c0-8.8 7.2-16 16-16zm352 384H48c-8.8 0-16-7.2-16-16V192h384v272c0 8.8-7.2 16-16 16zM148 320h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-96 96h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm-96 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm192 0h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12z"],[1,"far","fa-check-circle","fa-success"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"my-0"],[1,"text-success","h5","btn","btn-lg","btn-link","p-0",2,"position","absolute","right","0px","bottom","-60px",3,"click"]],template:function(r,s){r&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),u(6,Xi,2,0,"div",6)(7,$i,6,0,"div",6),i(),u(8,Zi,2,0,"p",7)(9,Ki,2,0,"p",7),n(10,"span",8),c(11,"\xA3"),i(),d(12,"span",9),b(13,"moneyPipe"),u(14,na,9,14,"p",6)(15,ia,2,0,"p",6)(16,aa,2,0,"p",6),i()()(),n(17,"div",2)(18,"div",3)(19,"div",4)(20,"div",5),u(21,oa,2,0,"div",6)(22,la,6,0,"div",6),i(),n(23,"p",10),c(24,"Monthly usage"),i(),n(25,"span",8),c(26,"\xA3"),i(),n(27,"span",11),c(28),b(29,"number"),i(),n(30,"p"),c(31,"This is how much we've calculated y
6ou use in an average month"),i()()()(),n(32,"div",2)(33,"div",12)(34,"div",4)(35,"div",5),u(36,ra,2,0,"div",6)(37,sa,6,0,"div",6),i(),n(38,"p",10),c(39,"Monthly payment would be"),i(),u(40,ma,2,0,"span",13)(41,ca,3,4,"span",14)(42,pa,2,0,"p",15)(43,ua,3,0,"button",16),i()()()()()),r&2&&(a(6),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(),o("ngIf",s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.includesBillUpToDate),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.includesBillUpToDate)),a(3),o("innerHTML",S(13,17,s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance,!0),E),a(2),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.includesBillUpToDate)&&(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)!=(s.customer==null?null:s.customer.balance)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.includesBillUpToDate)&&(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)!=(s.customer==null?null:s.customer.balance)),a(),o("ngIf",(s.customer==null||s.customer.payAsYouGo==null?null:s.customer.payAsYouGo.balance)==(s.customer==null?null:s.customer.balance)),a(5),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(6),M(S(29,20,s.customer==null?null:s.customer.payAsYouGo.monthlyUsage,"1.2-2")),a(8),o("ngIf",s.company==="SEW"||s.company==="ESP"),a(),o("ngIf",s.company==="ICOSA"||s.company==="MTX"||s.company==="MUA"||s.company==="LEF"),a(3),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.payingCorrectAmount)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.payingCorrectAmount)),a(),o("ngIf",!(!(s.customer==null||s.customer.payAsYouGo==null)&&s.customer.payAsYouGo.payingCorrectAmount)),a(),o("ngIf",!s.showBreakDown))},dependencies:[I,R,De,Ge]});let t=l;return t})();var ya=["template"],Ut=(t,l)=>({"is-invalid":t,"is-valid":l});function ha(t,l){if(t&1&&(n(0,"option",26),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e.day),a(),x(" ",e.description," ")}}function _a(t,l){if(t&1&&(n(0,"div",10)(1,"fieldset",11)(2,"div",27),d(3,"input",28,2),n(5,"label",29),c(6," Override Direct Debit delay days "),i()()()()),t&2){let e=p(3);a(3),o("ngClass",O(1,Ut,e.submitted&&e.getElement("overrideDelayDays").errors,e.getElement("overrideDelayDays").touched&&e.getElement("overrideDelayDays").valid))}}function fa(t,l){if(t&1){let e=v();n(0,"form",8),f("ngSubmit",function(){y(e);let r=p(2);return h(r.onSubmit())}),n(1,"h2",9),c(2,"Pay by Direct Debit on bill"),i(),n(3,"div",10)(4,"fieldset",11)(5,"legend")(6,"h4")(7,"label",12),c(8,"Payment day"),i()()(),d(9,"app-input-error-message",13),n(10,"div",14)(11,"div",15)(12,"div",16)(13,"select",17,1)(15,"option",18),c(16," Choose your payment day "),i(),u(17,ha,2,2,"option",19),i()()()(),n(18,"small",20),c(19,"We offer four different payment dates 1st, 7th, 15th or 23rd"),i()()(),u(20,_a,7,4,"div",21),n(21,"div",14)(22,"div",22)(23,"div",23)(24,"button",24),f("click",function(){y(e);let r=p(2);return h(r.onCancel())}),c(25," Cancel "),i(),n(26,"button",25),c(27," Submit "),i()()()()()}if(t&2){let e=p(2);o("formGroup",e.payOnBillForm),a(9),o("displayErrorIf",e.submitted&&e.getElement("paymentDay").errors),a(4),o("ngClass",O(8,Ut,e.submitted&&e.getElement("paymentDay").errors,e.getElement("paymentDay").touched&&e.getElement("paymentDay").valid)),ue("aria-invalid",!e.getElement("paymentDay").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.paymentDays),a(3),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&e.application==="CRM"),a(6),o("disabled",e.formSubmitted)}}function va(t,l){if(t&1&&(n(0,"div",6),u(1,fa,28,11,"form",7),i()),t&2){let e=p();a(),o("ngIf",!e.requestACallBack)}}function ga(t,l){if(t&1&&(n(0,"div"),d(1,"i",39),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}
6function ba(t,l){t&1&&(n(0,"div")(1,"div",40),w(),n(2,"svg",41),d(3,"path",42),i(),n(4,"svg",43),d(5,"path",44),i()()())}function Ca(t,l){t&1&&(n(0,"div")(1,"div",45),w(),n(2,"svg",41),d(3,"path",42),i(),n(4,"svg",46),d(5,"path",47),i()()())}function Sa(t,l){if(t&1&&(n(0,"div"),u(1,ba,6,0,"div",31)(2,Ca,6,0,"div",31),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function xa(t,l){if(t&1){let e=v();n(0,"button",37),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Pa(t,l){if(t&1){let e=v();n(0,"div",30),u(1,ga,2,1,"div",31)(2,Sa,3,2,"div",31),i(),n(3,"div",32),d(4,"h4",33),i(),n(5,"div",34),d(6,"p",35),i(),n(7,"div",36)(8,"button",37),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,xa,2,0,"button",38),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}function Da(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",48),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Other payment enquiry")}var Rt=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe){this.fb=m,this.pageScrollService=r,this.document=s,this.customerService=g,this.paymentOptionsService=C,this.spinner=P,this.spinnerSevice=k,this.modalService=V,this.analyticsService=me,this.activatedRoute=ce,this.contactDetailsService=pe,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=he,this.paymentDays=ke,this.subscriptions=[],this.requestACallBack=!1,this.formSubmitted=!1,this.company=D.company,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.status=new T}ngOnInit(){this.analyticsService.pageView("pay-on-bill-form","./pay-on-bill-form","pay-on-bill form"),this.payOnBillForm=this.fb.group({paymentDay:[null,B.required],overrideDelayDays:[!0]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.customer?this.payOnBillForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()}):this.payOnBillForm.patchValue({paymentDay:""})}),this.customer=this.customerService.getCustomer(),this.customer?this.payOnBillForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()}):this.payOnBillForm.patchValue({paymentDay:""})}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}focusOnError(m){m.focus()}onSubmit(){this.submitted=!0;let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName);let g=document.querySelector(".ng-invalid[formControlName]");if(this.payOnBillForm.invalid){this.focusOnError(g);return}else this.formSubmitted=!0,this.success=null,this.spinnerSevice.setSpinnerDescription("updating payment info ..."),this.spinner.show(),this.submittedForm=!0,this.paymentOptionsService.getDDOnBillUpdateResponse(null,null,null,this.getElement("paymentDay").value,this.getElement("overrideDelayDays").value,m,r,s).subscribe(C=>{this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.returnMessage==="GREEN"&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},C=>{this.formSubmitted=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})}getElement(m){return this.payOnBillForm.get(m)}onCancel(){this.status.emit("cancel"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}ngOnDestroy(){this.customerSubscription.unsubscribe()}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.status.emit("callback")}getMessage(m){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(re),_(U),_(G),_(Y),_(K),_(J),_(X),_(z),_(te),_(W),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-pay-on-bill"]],viewQuery:function(r,s){if(r&1&&N(ya,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},outputs:{status:"status"},decls:5,vars:2,consts:[["template",""],["paymentDayErrorRef",""],["overrideDelayDaysErrorRef",""],["class","form-wrap mt-8",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"form-wrap","mt-8"],["id","payOnBillForm","name","payOnBillForm",3,"formGroup","ngSubmit",4,"ngIf"],["id","payOnBillForm","name","payOnBillForm",3,"ngSubmit","formGroup"],["id","formHeader",1,"py-3"],[1,"form-group"],[1,"py-1"],["for","paymentDay",1,"label","required"],["errorMsg","Please select a payment day","id","paymentDayError",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-6"],[1,"select-wrap"],["aria-describedby","paymentDayHint paymentDayError","formControlName","paymentDay","name","paymentDay","id","paymentDay","required","",1,"custom-select","custom-select-lg",3,"ngClass"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["id","paymentDayHint",1,"hint"],["class","form-group",4,"ngIf"],[1,"col-12","mt-2"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[3,"ngValue"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","overrideDelayDays","name","overrideDelayDays","id","overrideDelayDays","aria-describedby","overrideDelayDays-error",1,"custom-control-input",3,"ngClass"],["for","overrideDelayDays",1,"custom-control-label"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[3,"ngClass"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2
662.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,s){r&1&&(u(0,va,2,1,"div",3)(1,Pa,11,5,"ng-template",null,0,L),n(3,"section",4),u(4,Da,1,1,"app-request-a-call-back",5),i()),r&2&&(o("ngIf",!s.requestACallBack),a(4),o("ngIf",s.requestACallBack))},dependencies:[F,H,I,se,Ee,ae,fe,ve,we,_e,ne,ie,ge,oe,le]});let t=l;return t})();var ka=["template"],Nt=(t,l)=>({"is-invalid":t,"is-valid":l});function Aa(t,l){t&1&&(n(0,"alert",27),c(1," You have a credit balance which we used to lower your monthly payment amount. We recalculate your recommended amount when updating your payment day so it may change to be more like your monthly usage. "),i())}function Ta(t,l){t&1&&(n(0,"alert",28),c(1," We're already in the process of taking your next direct debit payment and unfortunately it's probably too late to change it. If you make any changes it will take effect once this payment has been made. "),i())}function Ia(t,l){if(t&1&&(n(0,"option",29),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e.day),a(),x(" ",e.description," ")}}function Ma(t,l){t&1&&(n(0,"small",30),c(1,"We offer four different payment dates 1st, 7th, 15th or 23rd"),i())}function Ba(t,l){if(t&1&&(n(0,"div",11)(1,"fieldset",12)(2,"div",31),d(3,"input",32,2),n(5,"label",33),
6c(6," Override Direct Debit delay days "),i()()()()),t&2){let e=p(2);a(3),o("ngClass",O(1,Nt,e.submitted&&e.getElement("overrideDelayDays").errors,e.getElement("overrideDelayDays").touched&&e.getElement("overrideDelayDays").valid))}}function Oa(t,l){if(t&1){let e=v();n(0,"div",6)(1,"form",7),f("ngSubmit",function(){y(e);let r=p();return h(r.onSubmit())}),n(2,"h2",8),c(3,"Update your payment day"),i(),u(4,Aa,2,0,"alert",9)(5,Ta,2,0,"alert",10),n(6,"div",11)(7,"fieldset",12)(8,"legend")(9,"h4")(10,"label",13),c(11,"Payment day"),i()()(),d(12,"app-input-error-message",14),n(13,"div",15)(14,"div",16)(15,"div",17)(16,"select",18,1)(18,"option",19),c(19," Choose your payment day "),i(),u(20,Ia,2,2,"option",20),i()()()(),u(21,Ma,2,0,"small",21),i()(),u(22,Ba,7,4,"div",22),n(23,"div",15)(24,"div",23)(25,"div",24)(26,"button",25),f("click",function(){y(e);let r=p();return h(r.onCancel())}),c(27," Cancel "),i(),n(28,"button",26),c(29," Submit "),i()()()()()()}if(t&2){let e=p();a(),o("formGroup",e.paymenDayForm),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance)<0&&((e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.onPAYG)&&(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.currentPaymentAmount)<(e.customer==null?null:e.customer.payAsYouGo.monthlyUsage)||!(!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.onPAYG)&&(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount)<(e.customer==null?null:e.customer.payAsYouGo.monthlyUsage))),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.workingDaysToNextPayment)>=0&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.workingDaysToNextPayment)<5&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(7),o("displayErrorIf",e.submitted&&e.getElement("paymentDay").errors),a(4),o("ngClass",O(11,Nt,e.submitted&&e.getElement("paymentDay").errors,e.getElement("paymentDay").touched&&e.getElement("paymentDay").valid)),ue("aria-invalid",!e.getElement("paymentDay").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.paymentDays),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&e.application==="CRM"),a(6),o("disabled",e.submittedForm)}}function Va(t,l){if(t&1&&(n(0,"div"),d(1,"i",43),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function Ga(t,l){t&1&&(n(0,"div")(1,"div",44),w(),n(2,"svg",45),d(3,"path",46),i(),n(4,"svg",47),d(5,"path",48),i()()())}function Fa(t,l){t&1&&(n(0,"div")(1,"div",49),w(),n(2,"svg",45),d(3,"path",46),i(),n(4,"svg",50),d(5,"path",51),i()()())}function Ya(t,l){if(t&1&&(n(0,"div"),u(1,Ga,6,0,"div",35)(2,Fa,6,0,"div",35),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function Ua(t,l){if(t&1){let e=v();n(0,"button",41),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Ra(t,l){if(t&1){let e=v();n(0,"div",34),u(1,Va,2,1,"div",35)(2,Ya,3,2,"div",35),i(),n(3,"div",36),d(4,"h4",37),i(),n(5,"div",38),d(6,"p",39),i(),n(7,"div",40)(8,"button",41),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,Ua,2,0,"button",42),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}function Na(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",52),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Other payment enquiry")}var qt=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe){this.fb=m,this.activatedRoute=r,this.pageScrollService=s,this.document=g,this.customerService=C,this.paymentOptionsService=P,this.spinner=k,this.spinnerSevice=V,this.modalService=me,this.analyticsService=ce,this.contactDetailsService=pe,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=he,this.paymentDays=ke,this.subscriptions=[],this.requestACallBack=!1,this.company=D.c
6ompany,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.status=new T}ngOnInit(){this.analyticsService.pageView("payment-day-form","./payment-day-form","payment day form"),this.paymenDayForm=this.fb.group({paymentDay:[null,B.required],overrideDelayDays:[!0]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.customer?(this.customer?.paymentPlan?.paymentMethod!="Bank Direct Debit"&&(this.paymentDays=Me),this.paymenDayForm.patchValue({paymentDay:this.customer?.paymentPlan.paymentDay.toString()})):this.paymenDayForm.patchValue({paymentDay:""})}),this.customer=this.customerService.getCustomer(),this.customer?(this.customer?.paymentPlan?.paymentMethod!="Bank Direct Debit"&&(this.paymentDays=Me),this.paymenDayForm.patchValue({paymentDay:this.customer?.paymentPlan.paymentDay.toString()})):this.paymenDayForm.patchValue({paymentDay:""})}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}focusOnError(m){m.focus()}onSubmit(){let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName),this.submitted=!0;let g=document.querySelector(".ng-invalid[formControlName]");if(this.paymenDayForm.invalid){this.focusOnError(g);return}else this.success=null,this.spinnerSevice.setSpinnerDescription("updating payment info ..."),this.spinner.show(),this.submittedForm=!0,this.paymentOptionsService.getpaymentDayUpdateResponse(this.getElement("paymentDay").value,this.getElement("overrideDelayDays").value,m,r,s).subscribe(C=>{this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.returnMessage==="GREEN"&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},C=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})}getElement(m){return this.paymenDayForm.get(m)}onCancel(){this.status.emit("cancel"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}ngOnDestroy(){this.customerSubscription.unsubscribe()}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.status.emit("callback")}getMessage(m){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(re),_(W),_(U),_(G),_(Y),_(K),_(J),_(X),_(z),_(te),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-payment-day-update"]],viewQuery:function(r,s){if(r&1&&N(ka,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},outputs:{status:"status"},decls:5,vars:2,consts:[["template",""],["paymentDayErrorRef",""],["overrideDelayDaysErrorRef",""],["class","form-wrap mt-8 pt-3",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"form-wrap","mt-8","pt-3"],["id","paymenDayForm","name","paymenDayForm",3,"ngSubmit","formGroup"],["id","formHeader",1,"py-3"],["type","success mb-0 mt-4",4,"ngIf"],["type","warning mb-0 my-4",4,"ngIf"],[1,"form-group"],[1,"py-1"],["for","paymentDay",1,"label","required"],["errorMsg","Please select a payment day","id","paymentDayError",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-6"],[1,"select-wrap"],["aria-describedby","paymentDayHint paymentDayError","formControlName","paymentDay","name","paymentDay","id","paymentDay","required","",1,"custom-select","custom-select-lg",3,"ngClass"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["id","paymentDayHint","class","hint",4,"ngIf"],["class","form-group",4,"ngIf"],[1,"col-12","mt-2"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","success mb-0 mt-4"],["type","warning mb-0 my-4"],[3,"ngValue"],["id","paymentDayHint",1,"hint"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","overrideDelayDays","name","overrideDelayDays","id","overrideDelayDays","aria-describedby","overrideDelayDays-error",1,"custom-control-input",3,"ngClass"],["for","overrideDelayDays",1,"custom-control-label"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[3,"ngClass"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2
662.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,s){r&1&&(u(0,Oa,30,14,"div",3)(1,Ra,11,5,"ng-template",null,0,L),n(3,"section",4),u(4,Na,1,1,"app-request-a-call-back",5),i()),r&2&&(o("ngIf",!s.requestACallBack),a(4),o("ngIf",s.requestACallBack))},dependencies:[F,H,I,se,Ee,ae,fe,ve,we,_e,ne,ie,ge,oe,le,nt]});let t=l;return t})();var ja=["template"],La=(t,l)=>({"is-invalid":t,"is-valid":l});function Ha(t,l){t&1&&(n(0,"p"),c(1," We've calculated what your payments would be below, click submit to accept these changes. "),i())}function za(t,l){t&1&&(n(0,"p"),c(1," Please select from the following options: "),i())}function Wa(t,l){if(t&1){let e=v();n(0,"button",19),f("click",function(){y(e);let r=p(3);return h(r.paymentsSelected=r.onePayment)}),c(1," One payment for "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()}if(t&2){let e=p(3);a(4),x("",S(5,1,e.onePayment,!0)," ")}}function Qa(t,l){if(t&1){let e=v();n(0,"button",19),f("click",function(){y(e);let r=p(3);return h(r.paymentsSelected=r.twoPayments)}),c(1," Two payments for "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()}if(t&2){let e=p(3);a(4),x("",S(5,1,e.twoPayments,!0)," ")}}function Ja(t,l){if(t&1){let e=v();n(0,"button",19),f("click",function(){y(e);let r=p(3);return h(r.paymentsSelected=r.fourPayments)}),c(1," Four payments for "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()}if(t&2){let e=p(3);a(4),x("",S(5,1,e.fourPayments,!0)," ")}}function Xa(t,l){if(t&1){let e=v();n(0,"button",19),f("click",function(){y(e);let r=p(3);return h(r.paymentsSelected=r.sixPayments)}),c(1," Six payments for "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()}if(t&2){let e=p(3);a(4),x("",S(5,1,e.sixPayments,!0)," ")}}function $a(t,l){if(t&1){let e=v();n(0,"button",19),f("click",function(){y(e);let r=p(3);return h(r.paymentsSelected=r.eightPayments)}),c(1," Eight payments for "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()}if(t&2){let e=p(3);a(4),x("",S(5,1,e.eightPayments,!0)," ")}}function Za(t,l){if(t&1){let e=v();n(0,"button",19),f("click",function(){y(e);let r=p(3);return h(r.paymentsSelected=r.tenPayments)}),c(1," Ten payments for "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()}if(t&2){let e=p(3);a(4),x("",S(5,1,e.tenPayments,!0)," ")}}function Ka(t,l){if(t&1){let e=v();n(0,"button",19),f("click",function(){y(e);let r=p(3);return h(r.paymentsSelected=r.twelvePayments)}),c(1," Twelve payments for "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()}if(t&2){let e=p(3);a(4),x("",S(5,1,e.twelvePayments,!0)," ")}}function eo(t,l){if(t&1&&(n(0,"div",16),u(1,Wa,6,4,"button",17)(2,Qa,6,4,"button",17)(3,Ja,6,4,"button",17)(4,Xa,6,4,"button",17)(5,$a,6,4,"button",17)(6,Za,6,4,"button",17)(7,Ka,6,4,"button",17),n(8,"p",18),c(9," If you are having trouble paying then please click Call back and we can give you a ring to discuss "),i()()),t&2){let e=p(2);a(),o("ngIf",e.onePayment),a(),o("ngIf",e.twoPayments),a(),o("ngIf",e.fourPayments),a(),o("ngIf",e.sixPayments),a(),o("ngIf",e.eightPayments),a(),o("ngIf",e.tenPayments),a(),o("ngIf",e.twelvePayments)}}function to(t,l){if(t&1&&(n(0,"span",26),c(1),b(2,"number"),i()),t&2){let e=p(2).$implicit;a(),x("",S(2,1,e==null?null:e.paymentAmount,"1.2-2")," ")}}function no(t,l){if(t&1&&(n(0,"small"),c(1),b(2,"date"),i()),t&2){let e=p(2).$implicit;a(),x(" on ",S(2,1,e==null?null:e.paymentDate,"dd MMM yy"),"")}}function io(t,l){t&1&&(n(0,"span",27),c(1,"Direct Debit"),i())}function ao(t,l){t&1&&(n(0,"span",27),c(1,"Cash/Card"),i())}function oo(t,l){if(t&1&&(n(0,"div")(1,"span",23),c(2,"\xA3"),i(),u(3,to,3,4,"span",24)(4,no,3,4,"small",5),c(5,"\xA0 "),u(6,io,2,0,"span",25)(7,ao,2,0,"span",25),c(8," \xA0 "),i()),t&2){let e=p().$implicit,m=p(3);a(3),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(2),o("ngIf",(e==null?null:e.paymentMethod)==="Bank Direct Debit"&&m.cashPlan===!0),a(),o("ngIf",(e==null?null:e.paymentMethod)!=="Bank Direct Debit"&&m.cashPlan===!1)}}function lo(t,l){if(t&1&&(n(0,"div"),u(1,oo,9,4,"div",5),i()),t&2){let e=l.index;a(),o("ngIf",e%2==0)}}function ro(t,l){if(t&1&&(n(0,"span",26),c(1),b(2,"number"),i()),t&2){let e=p(2).$implicit;a(),M(S(2,1,e==null?null:e.paymentAmount,"1.2-2"))}}function so(t,l){if(t&1&&(n(0,"small"),c(1),b(2,"date"),i()),t&2){let e=p(2).$implicit;a(),x(" on ",S(2,1,e==null?null:e.paymentDate,"dd MMM yy"),"")}}function mo(t,l){t&1&&(n(0,"span",27),c(1,"Direct Debit"),i())}function co(t,l){t&1&&(n(0,"span",27),c(1,"Cash/Card"),i())}function po(t,l){if(t&1&&(n(0,"div")(1,"span",23),c(2,"\xA3"),i(),u(3,ro,3,4,"span",24)(4,so,3,4,"small",5),c(5,"\xA0 "),u(6,mo,2,0,"span",25)(7,co,2,0,"span",25),c(8," \xA0 "),i()),t&2){let e=p().$implicit,m=p(3);a(3),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(2),o("ngIf",(e==null?null:e.paymentMethod)==="Bank Direct Debit"&&m.cashPlan===!0),a(),o("ngIf",(e==null?null:e.paymentMethod)!=="Bank Direct Debit"&&m.cashPlan===!1)}}function uo(t,l){if(t&1&&(n(0,"div"),u(1,po,9,4,"div",5),i()),t&2){let e=l.index;a(),o("ngIf",e%2!=0)}}function yo(t,l){if(t&1&&(n(0,"div",9)(1,"div",10)(2,"h3",20),c(3,"Your payments"),i()(),n(4,"div",21),u(5,lo,2,1,"div",22),i(),n(6,"div",21),u(7,uo,2,1,"div",22),i()()),t&2){let e=p(2);a(2),o("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary"),a(3),o("ngForOf",e.paymentsDue),a(2),o("ngForOf",e.paymentsDue)}}function ho(t,l){t&1&&(n(0,"p"),c(1," The payment(s) above cannot be changed yet, please use our card payment facility to pay any that are due / overdue. "),i())}function _o(t,l){if(t&1&&(n(0,"p"),c(1),i()),t&2){let e=p(2);a(),x(" Next time we bill you we will create up to ",e.unmeasuredPayments," payment(s) for your new bill ")}}function fo(t,l){if(t&1&&(n(0,"div",9)(1,"div",28),d(2,"input",29,1),n(4,"label",30),c(5," Override Direct Debit delay days "),i()()()),t&2){let e=p(2);a(2),o("ngClass",O(1,La,e.submitted&&e.getElement("overrideDelayDays").errors,e.getElement("overrideDelayDays").touched&&e.getElement("overrideDelayDays").valid))}}function vo(t,l){if(t&1){let e=v();n(0,"button",31),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function go(t,l){if(t&1){let e=v();n(0,"button",32),f("click",function(){y(e);let r=p(2);return h(r.setupDD())}),c(1," Set up Direct Debit "),i()}if(t&2){let e=p(2);o("disabled",e.submittedForm)}}function bo(t,l){if(t&1&&(n(0,"button",33),c(1," Submit "),i()),t&2){let e=p(2);o("disabled",e.submittedForm)}}function Co(t,l){if(t&1){let e=v();n(0,"div",3)(1,"form",4),f("ngSubmit",function(){y(e);let r=p();return h(r.onSubmit())}),u(2,Ha,2,0,"p",5)(3,za,2,0,"p",5)(4,eo,10,7,"div",6)(5,yo,8,3,"div",7),n(6,"div",8),u(7,ho,2,0,"p",5)(8,_o,2,1,"p",5),i(),u(9,fo,6,4,"div",7),n(10,"div",9)(11,"div",10)(12,"div",11),u(13,vo,2,0,"button",12),n(14,"button",13),f("click",function(){y(e);let r=p();return h(r.onCancel())}),c(15," Cancel "),i(),u(16,go,2,1,"button",14)(17,bo,2,1,"button",15),i()()()()()}if(t&2){let e=p();a(),o("formGroup",e.unmeasuredPlanForm),a(),o("ngIf",e.paymentsDue&&e.paymentsDue.length>0&&!e.customer.movedOutDate&&!e.endOfPaymentMap),a(),o("ngIf",e.customer.movedOutDate),a(),o("ngIf",e.customer.movedOutDate),a(),o("ngIf",e.paymentsDue&&e.paymentsDue.length>0&&!e.customer.movedOutDate),a(2),o("ngIf",e.endOfPaymentMap&&e.paymentsDue&&e.paymentsDue.length>0&&e.paymentsDue[0].paymentMethod!=="Bank Direct Debit"&&e.cashPlan===!1),a(),o("ngIf",!e.customer.movedOutDate),a(),o("ngIf",!e.cashPlan&&e.application==="CRM"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(4),o("ngIf",e.customer.movedOutDate&&e.application!=="C
6RM"),a(3),o("ngIf",!e.customer.movedOutDate&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit"&&!e.cashPlan),a(),o("ngIf",!e.customer.movedOutDate&&((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&!e.cashPlan||e.cashPlan))}}function So(t,l){if(t&1&&(n(0,"div"),d(1,"i",20),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function xo(t,l){t&1&&(n(0,"div")(1,"div",40),w(),n(2,"svg",41),d(3,"path",42),i(),n(4,"svg",43),d(5,"path",44),i()()())}function Po(t,l){t&1&&(n(0,"div")(1,"div",45),w(),n(2,"svg",41),d(3,"path",42),i(),n(4,"svg",46),d(5,"path",47),i()()())}function Do(t,l){if(t&1&&(n(0,"div"),u(1,xo,6,0,"div",5)(2,Po,6,0,"div",5),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function wo(t,l){if(t&1){let e=v();n(0,"button",31),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Eo(t,l){if(t&1){let e=v();n(0,"div",34),u(1,So,2,1,"div",5)(2,Do,3,2,"div",5),i(),n(3,"div",35),d(4,"h4",36),i(),n(5,"div",37),d(6,"p",38),i(),n(7,"div",39)(8,"button",31),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,wo,2,0,"button",12),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}var st=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe){this.fb=m,this.pageScrollService=r,this.document=s,this.customerService=g,this.bankValidationService=C,this.spinner=P,this.spinnerSevice=k,this.paymentOptionsService=V,this.modalService=me,this.activatedRoute=ce,this.contactDetailsService=pe,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=he,this.paymentDays=ke,this.subscriptions=[],this.requestACallBack=!1,this.company=D.company,this.paymentsSelected=0,this.endOfPaymentMap=!1,this.loaded=!1,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.status=new T,this.directDebitSetup=new T}ngOnInit(){this.unmeasuredPlanForm=this.fb.group({paymentDay:[null,B.required],overrideDelayDays:[!0]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,!this.loaded&&this.customer&&this.onLoad(),this.customer?this.customer.paymentPlan?.paymentDay&&this.customer.paymentPlan?.paymentDay?.toString()!="0"&&this.unmeasuredPlanForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()}):this.unmeasuredPlanForm.patchValue({paymentDay:"01"})}),this.customer=this.customerService.getCustomer(),this.customer?(this.loaded||this.onLoad(),this.customer.paymentPlan?.paymentDay&&this.customer.paymentPlan?.paymentDay?.toString()!="0"&&this.unmeasuredPlanForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()})):this.unmeasuredPlanForm.patchValue({paymentDay:"01"})}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}focusOnError(m){m.focus()}onLoad(){!this.customer.movedOutDate&&!this.loaded?(this.spinner.show(),this.spinnerSevice.setSpinnerDescription("Calculating your payments ..."),this.paymentOptionsService.getUnmeasuredPaymentPlanCheckResponse("","","",null,this.unmeasuredPayments,this.cashPlan,!0).subscribe(m=>{this.loaded=!0,this.spinner.hide(),this.paymentsDue=m.data.paymentsDue,m.data.errors&&m.data.errors.length>0&&m.data?.errors[0]?.errorMessage==="End of payment map"&&(this.endOfPaymentMap=!0)},m=>{this.spinner.hide()})):this.loaded||(this.twelvePayments=this.customer.balance/12,this.tenPayments=this.customer.balance/10,this.eightPayments=this.customer.balance/8,this.sixPayments=this.customer.balance/6,this.fourPayments=this.customer.balance/4,this.twoPayments=this.customer.balance/2,this.onePayment=this.customer.balance,this.twelvePayments=this.twelvePayments<5?null:this.twelvePayments,this.tenPayments=this.tenPayments<5?null:this.tenPayments,this.eightPayments=this.eightPayments<5?null:this.eightPayments,this.sixPayments=this.sixPayments<5?null:this.sixPayments,this.fourPayments=this.fourPayments<5?null:this.fourPayments,this.twoPayments=this.twoPayments<5?null:this.twoPayments)}onSubmit(){let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");if(!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName),!this.cashPlan&&this.customer.paymentPlan.paymentMethod!=="Bank Direct Debit")this.status.emit("dd");else{let g=document.querySelector(".ng-invalid[formControlName]");
6if(this.unmeasuredPlanForm.invalid&&!this.paymentsSelected){this.focusOnError(g);return}else this.submitted=!0,this.spinner.show(),this.submittedForm=!0,this.customer.movedOutDate&&this.paymentsSelected>0?this.paymentOptionsService.getAdhocPaymentUpdateResponse(!0,this.cashPlan?"0":"1",null,null,null,null,null,this.paymentsSelected,null,null,null,null,"NEW",this.getElement("overrideDelayDays").value,m,r,s).subscribe(C=>{this.status.emit("cancel"),this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)},C=>{this.spinner.hide(),this.success=!1,this.submittedForm=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}):this.paymentOptionsService.getUnmeasuredPaymentPlanUpdateResponse("","","",null,this.unmeasuredPayments,this.cashPlan,this.getElement("overrideDelayDays").value,m,r,s).subscribe(C=>{this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.returnMessage==="GREEN"&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},C=>{this.spinner.hide(),this.success=!1,this.submittedForm=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})}}getElement(m){return this.unmeasuredPlanForm.get(m)}onCancel(){this.status.emit("cancel"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:300})}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.requestACallBack=!0,this.status.emit("callback")}getMessage(m){this.onCancel(),this.requestACallBack=!1}setupDD(){this.onCancel(),this.requestACallBack=!1;let m={numberOfPayments:this.unmeasuredPayments.toString(),type:"unmeasured-plan"};this.directDebitSetup.emit(JSON.stringify(m))}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else{this.onCancel();return}this.modalRef.hide(),this.modalRef=null}ngOnDestroy(){this.customerSubscription.unsubscribe()}};l.\u0275fac=function(r){return new(r||l)(_(re),_(U),_(G),_(Y),_(lt),_(J),_(X),_(K),_(z),_(W),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-unmeasured-plan-change"]],viewQuery:function(r,s){if(r&1&&N(ja,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},inputs:{unmeasuredPayments:"unmeasuredPayments",cashPlan:"cashPlan"},outputs:{status:"status",directDebitSetup:"directDebitSetup"},decls:3,vars:1,consts:[["template",""],["overrideDelayDaysErrorRef",""],["class","form-wrap mt-8 pt-3",4,"ngIf"],[1,"form-wrap","mt-8","pt-3"],["id","unmeasuredPlanForm","name","unmeasuredPlanForm",3,"ngSubmit","formGroup"],[4,"ngIf"],["class","row d-flex justify-content-center",4,"ngIf"],["class","row",4,"ngIf"],[1,"pb-3"],[1,"row"],[1,"col-12"],[1,"btn-group","float-right"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["class","btn btn-primary",3,"disabled","click",4,"ngIf"],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],[1,"row","d-flex","justify-content-center"],["class","btn btn-primary mr-1 my-2",3,"click",4,"ngIf"],[1,"pb-2"],[1,"btn","btn-primary","mr-1","my-2",3,"click"],[3,"ngClass"],[1,"col-6"],[4,"ngFor","ngForOf"],[1,"h5"],["class","h5 dis
6play-5",4,"ngIf"],["class","badge badge-pill badge-primary h4",4,"ngIf"],[1,"h5","display-5"],[1,"badge","badge-pill","badge-primary","h4"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","overrideDelayDays","name","overrideDelayDays","id","overrideDelayDays","aria-describedby","overrideDelayDays-error",1,"custom-control-input",3,"ngClass"],["for","overrideDelayDays",1,"custom-control-label"],["type","button",1,"btn","btn-dark",3,"click"],[1,"btn","btn-primary",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,s){r&1&&u(0,Co,18,11,"div",2)(1,Eo,11,5,"ng-template",null,0,L),r&2&&o("ngIf",!s.requestACallBack)},dependencies:[F,H,I,ae,we,ne,ie,oe,le,R,be,De]});let t=l;return t})();var ko=["template"];function Ao(t,l){t&1&&(n(0,"h2"),c(1," Your payment options "),i())}function To(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function Io(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,To,2,0,"span",2),i()),t&2){let e=p(2);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Mo(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function Bo(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Mo,2,0,"span",2),i()),t&2){let e=p(2);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Oo(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function Vo(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Oo,2,0,"span",2),i()),t&2){let e=p(3);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Go(t,l){if(t&1){let e=v();n(0,"div",7),u(1,Vo,3,1,"div",8),n(2,"div",9)(3,"h1",10)(4,"span",11),c(5,"8 payments"),i()(),n(6,"p",12),c(7,"Pay May through to December"),i()(),n(8,"div",13)(9,"button",14),f("click",function(){y(e);let r=p(2);return h(r.onSelect(8))}),c(10," select "),i()()()}if(t&2){let e=p(2);o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==8&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==8&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(7),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==8&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan","bg-info"))}}function Fo(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function Yo(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Fo,2,0,"span",2),i()),t&2){let e=p(3);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Uo(t,l){if(t&1){let e=v();n(0,"div",7),u(1,Yo,3,1,"div",8),n(2,"div",9)(3,"h1",10)(4,"span",11),c(5,"10 payments"),i()(),n(6,"p",12),c(7,"Pay April through to January"),i()(),n(8,"div",13)(9,"button",14),f("click",function(){y(e);let r=p(2);return h(r.onSelect(10))}),c(10," select "),i()()()}if(t&2){let e=p(2);o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==10&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==10&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(7),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==10&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan","bg-info"))}}function Ro(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function No(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Ro,2,0,"span",2),i()),t&2){let e=p(2);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function qo(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function jo(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,qo,2,0,"span",2),i()),t&2){let e=p(3);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Lo(t,l){if(t&1){let e=v();n(0,"div",7),u(1,jo,3,1,"div",8),n(2,"div",9)(3,"h1",10)(4,"span",11),c(5,"Affordability"),i()(),n(6,"p",12),c(7,"You have a special payment plan"),i()(),n(8,"div",13)(9,"button",17),f("
6click",function(){y(e);let r=p(2);return h(r.onSelect(1))}),c(10," select "),i()()()}if(t&2){let e=p(2);o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==0&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Monthly (Budget)"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)<=1&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==0&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Monthly (Budget)"),a(7),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==0&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Monthly (Budget)","bg-info")),a(),o("disabled",!0)}}function Ho(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function zo(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Ho,2,0,"span",2),i()),t&2){let e=p(3);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Wo(t,l){if(t&1){let e=v();n(0,"div",7),u(1,zo,3,1,"div",8),n(2,"div",9)(3,"h1",10)(4,"span",11),c(5,"Affordability"),i()(),n(6,"p",12),c(7,"You have a special payment plan"),i()(),n(8,"div",13)(9,"button",17),f("click",function(){y(e);let r=p(2);return h(r.onSelect(1))}),c(10," select "),i()()()}if(t&2){let e=p(2);o("ngClass",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Special Plan"),a(7),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Special Plan","bg-info")),a(),o("disabled",!0)}}function Qo(t,l){if(t&1){let e=v();n(0,"div",6)(1,"div",7),u(2,Io,3,1,"div",8),n(3,"div",9)(4,"h1",10)(5,"span",11),c(6,"Annually"),i()(),n(7,"p",12),c(8,"Pay annually when you're billed"),i()(),n(9,"div",13)(10,"button",14),f("click",function(){y(e);let r=p();return h(r.onSelect(1))}),c(11," select "),i()()(),n(12,"div",7),u(13,Bo,3,1,"div",8),n(14,"div",9)(15,"h1",10)(16,"span",11),c(17,"2 payments"),i()(),n(18,"p",12),c(19,"Pay twice a year in April and October"),i()(),n(20,"div",13)(21,"button",14),f("click",function(){y(e);let r=p();return h(r.onSelect(2))}),c(22," select "),i()()(),u(23,Go,11,3,"div",15)(24,Uo,11,3,"div",15),n(25,"div",7),u(26,No,3,1,"div",8),n(27,"div",9)(28,"h1",10)(29,"span",11),c(30,"12 payments"),i()(),n(31,"p",12),c(32,"Pay April through to March"),i()(),n(33,"div",13)(34,"button",14),f("click",function(){y(e);let r=p();return h(r.onSelect(12))}),c(35," select "),i()()(),u(36,Lo,11,4,"div",15)(37,Wo,11,4,"div",15),i()}if(t&2){let e=p();a(),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)<=1&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Monthly (Budget)"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)<=1&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Monthly (Budget)"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(7),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)<=1&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Monthly (Budget)"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan","bg-info")),a(3),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==2&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==2&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(7),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==2&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan","bg-info")),a(3),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==8&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==10&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==12&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==12&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(7),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==12&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan","bg-info")),a(3),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Monthly (Budget)"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Special Plan")}}function Jo(t,l){t&1&&(n(0,"span",27),c(1,"\xA3"),i())}function Xo(t,l){if(t&1&&(n(0,"span",27),c(1),b(2,"number"),i()),t&2){let e=p().$implicit;a(),M(S(2,1,e==null?null:e.paymentAmount,"1.2-2"))}}function $o(t,l){if(t&1&&(n(0,"span",27),c(1),b(2,"date"),i()),t&2){let e=p().$implicit;a(),x(" on ",S(2,1,e==null?null:e.paymentDate,"dd MMM yy"),"")}}function Zo(t,l){if(t&1&&(n(0,"div",25),u(1,Jo,2,0,"span",26)(2,Xo,3,4,"span",26)(3,$o,3,4,"span",26),i()),t&2){let e=l.$implicit;a(),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0)}}function Ko(t,l){t&1&&(n(0,"p"),c(1," As you pay by direct debit your payments will be taken on or around the payment day you have chosen "),i())}function el(t,l){t&1&&(n(0,"p"),c(1," Please click on the Make payment button to make a card payment on or before the date of when your payment is due "),i())}function tl(t,l){if(t&1&&(n(0,"div",20)(1,"div",21)(2,"div",22),c(3,"Upcoming payments"),i(),n(4,"div",23),u(5,Zo,4,3,"div",24)(6,Ko,2,0,"p",2)(7,el,2,0,"p",2),i()()()),t&2){let e=p(2);a(5),o("ngForOf",e.paymentsDue),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit"&&e.application!=="C
6RM")}}function nl(t,l){if(t&1&&(n(0,"div",1)(1,"div",18),u(2,tl,8,3,"div",19),i()()),t&2){let e=p();a(2),o("ngIf",e.paymentsDue&&e.paymentsDue.length>0&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function il(t,l){if(t&1){let e=v();n(0,"app-direct-debit-setup",32),f("status",function(r){y(e);let s=p(2);return h(s.getMessage(r))}),i()}if(t&2){let e=p(2);o("ddOnBill",e.ddOnBill)("unmeasuredPayments",e.unmeasuredPayments)}}function al(t,l){if(t&1){let e=v();n(0,"app-unmeasured-plan-change",33),f("status",function(r){y(e);let s=p(2);return h(s.getMessage(r))})("directDebitSetup",function(r){y(e);let s=p(2);return h(s.ddChange(r))}),i()}if(t&2){let e=p(2);o("unmeasuredPayments",e.unmeasuredPayments)("cashPlan",e.cashPlan)}}function ol(t,l){if(t&1&&(n(0,"section",28)(1,"div",29),u(2,il,1,2,"app-direct-debit-setup",30)(3,al,1,2,"app-unmeasured-plan-change",31),i()()),t&2){let e=p();a(2),o("ngIf",e.directDebitSetup),a(),o("ngIf",e.unmeasuredPlanSetup)}}function ll(t,l){t&1&&(n(0,"div"),d(1,"i",39),i())}function rl(t,l){t&1&&(n(0,"div")(1,"div",40),w(),n(2,"svg",41),d(3,"path",42),i(),n(4,"svg",43),d(5,"path",44),i()()())}function sl(t,l){if(t&1){let e=v();n(0,"div",34),u(1,ll,2,0,"div",2)(2,rl,6,0,"div",2),i(),n(3,"div",35)(4,"h4",36),c(5,"Cash or direct debit?"),i()(),n(6,"div",37)(7,"button",38),f("click",function(){y(e);let r=p();return h(r.onContinueCash())}),c(8," Cash "),i(),n(9,"button",38),f("click",function(){y(e);let r=p();return h(r.onSetupDD())}),c(10," Direct Debit "),i()()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF")}}var zt=(()=>{let l=class l{constructor(m,r,s,g,C,P){this.paymentDueService=m,this.customerService=r,this.alertService=s,this.pageScrollService=g,this.document=C,this.modalService=P,this.status=new T,this.directDebitSetupObj=new T,this.subscriptions=[],this.directDebitSetup=!1,this.unmeasuredPlanSetup=!1,this.ddOnBill=null,this.cashSetup=!1,this.company=D.company,this.application=D.application,this.cashPlan=!1,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.paymentsDue=[],this.overduePaymentsDue=[]}ngOnInit(){this.paymentDueSubscription=this.paymentDueService.paymentsDueChange.subscribe(m=>{this.paymentsDue=m,this.splitOutOverdue()}),this.paymentsDue=this.paymentDueService.getPaymentsDue(),this.splitOutOverdue()}splitOutOverdue(){if(this.paymentsDue&&this.paymentsDue.length>0){let r;for(var m=this.paymentsDue.length;m>0;m--)r=this.paymentsDue[m-1],r.overduePayment!=0&&this.overduePaymentsDue.push(...this.paymentsDue.splice(m-1,1))}else this.overduePaymentsDue=[]}onSelect(m){this.unmeasuredPayments=m,this.application==="CRM"?this.openModal(this.templateRef):this.customer.paymentPlan.paymentMethod!="Bank Direct Debit"?(this.directDebitSetup=!0,this.cashPlan=!1,this.status.emit("hide top")):(this.unmeasuredPlanSetup=!0,this.cashPlan=!1,this.status.emit("hide top"))}onSetupDD(){this.customer.paymentPlan.paymentMethod!=="Bank Direct Debit"?(this.unmeasuredPlanSetup=!0,this.cashPlan=!1,this.closeModal(),this.status.emit("hide top")):(this.cashPlan=!1,this.unmeasuredPlanSetup=!0,this.closeModal(),this.status.emit("hide top"))}onContinueCash(){this.cashPlan=!0,this.unmeasuredPlanSetup=!0,this.closeModal(),this.status.emit("hide top")}onCallback(){this.status.emit("callback")}onCancel(){this.status.emit("cancel")}getMessage(m){m=="cancel"&&(this.directDebitSetup=!1,this.unmeasuredPlanSetup=!1,this.onCancel()),m=="dd"&&(this.directDebitSetup=!0,this.unmeasuredPlanSetup=!1),m=="callback"&&this.onCallback()}closeModal(){this.modalRef&&(this.modalRef.hide(),this.modalRef=null)}ddChange(m){m!==null&&this.directDebitSetupObj.emit(m)}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&this.onCancel()}))}};l.\u0275fac=function(r){return new(r||l)(_(Qe),_(Y),_(ze),_(U),_(G),_(z))},l.\u0275cmp=A({type:l,selectors:[["app-unmeasured-plans"]],viewQuery:function(r,s){if(r&1&&N(ko,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},inputs:{customer:"customer"},outputs:{status:"status",directDebitSetupObj:"directDebitSetupObj"},decls:7,vars:4,consts:[["template",""],[1,"container"],[4,"ngIf"],["class","card-deck mb-1 text-center breakdown",4,"ngIf"],["class","container",4,"ngIf"],["class","bg-info mt-5",4,"ngIf"],[1,"card-deck","mb-1","text-center","breakdown"],[1,"card","mb-4","bg-primary",3,"ngClass"],["class","current-label text-white bg-success p-2 badge",4,"ngIf"],[1,"card-body","py-1"],[1,"card-title","pricing-card-title"],[1,"h4","mb-0","font-bold"],[1,"mb-0"],[1,"card-footer","border-0","py-2",3,"ngClass"],[1,"btn","btn-block","p-3","btn-dark",3,"click"],["class","card mb-4 bg-primary",3,"ngClass",4,"ngIf"],[1,"current-label","text-white","bg-success","p-2","badge"],[1,"btn","btn-block","p-3","btn-dark",3,"click","disabled"],[1,"row"],["class","col-lg-12 mt-2",4,"ngIf"],[1,"col-lg-12","mt-2"],[1,"card","bg-info","mb-3","mb-4","text-center","text-danger","h-100"],[1,"card-header","h3"],[1,"card-body"],["class","h3 badge badge-light",4,"ngFor","ngForOf"],[1,"h3","badge","badge-light"],["class","h4",4,"ngIf"],[1,"h4"],[1,"bg-info","mt-5"],[1,"container","py-8"],[3,"ddOnBill","unmeasuredPayments","status",4,"ngIf"],[3,"unmeasuredPayments","cashPlan","status","directDebitSetup",4,"ngIf"],[3,"status","ddOnBill","unmeasuredPayments"],[3,"status","directDebitSetup","unmeasuredPayments","cashPlan"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"bg-secondary","fal","fa-check"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"]],template:function(r,s){r&1&&(n(0,"div",1),u(1,Ao,2,0,"h2",2)(2,Qo,38,13,"div",3),i(),u(3,nl,3,1,"div",4)(4,ol,4,2,"section",5)(5,sl,11,2,"ng-template",null,0,L)),r&2&&(a(),o("ngIf",!s.directDebitSetup&&!s.unmeasuredPlanSetup),a(),o("ngIf",!s.directDebitSetup&&!s.unmeasuredPlanSetup),a(),o("ngIf",!s.directDebitSetup&&!s.unmeasuredPlanSetup),a(),o("ngIf",s.directDebitSetup||s.unmeasuredPlanSetup))},dependencies:[F,H,I,Re,st,R,be],styles:[".card-deck[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{min-width:300px}.current-label[_ngcontent-%COMP%]{position:absolute;top:-13px;right:-10px;font-weight:500}"]});let t=l;return t})();var cl=["template"],Wt=(t,l)=>({"is-invalid":t,"is-valid":l});function pl(t,l){t&1&&(n(0,"span",40),c(1,"\xA3"),i())}function ul(t,l){if(t&1&&(d(0,"span",41),b(1,"moneyPipe")),t&2){let e=p(2);o("innerHTML",S(1,1,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance,!0),E)}}function dl(t,l){t&1&&(n(0,"span",40),c(1,"\xA3"),i())}function yl(t,l){if(t&1&&(n(0,"span",42),c(1),b(2,"number"),i()),t&2){let e=p(2);a(),M(S(2,1,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.monthlyUsage,"1.2-2"))}}function hl(t,l){t&1&&(n(0,"span",40),c(1,"\xA3"),i())}function _l(t,l){if(t&1&&(n(0,"div",43)(1,"div",44)(2,"div",45)(3,"h5",15),c(4,"Current"),i(),u(5,hl,2,0,"span",16),n(6,"span",42),c(7),b(8,"number"),i()()()()),t&2){let e=p(2);a(5),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.currentPaymentAmount),a(2),M(S(8,2,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.currentPaymentAmount,"1.2-2"))}}function fl(t,l){t&1&&(n(0,"span",40),c(1,"\xA3"),i())}function vl(t,l){if(t&1&&(n(0,"span",42),c(1),b(2,"number"),i()),t&2){let e=p(2);a(),M(S(2,1,e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount,"1.2-2"))}}
6function gl(t,l){t&1&&(n(0,"p",46),c(1," Based upon our calculations, you're covering your monthly usage. "),i())}function bl(t,l){if(t&1&&(n(0,"p",46),c(1),i()),t&2){let e=p(2);a(),tt(" Based upon our calculations, if your monthly payment was set at \xA3",e.getElement("paymentAmount").value," it would take around ",e.monthsToPay," months to chip away at your balance. ")}}function Cl(t,l){if(t&1&&(n(0,"p",47),c(1),i()),t&2){let e=p(2);a(),x(" Based upon our calculations, if your monthly payment was set at \xA3",e.getElement("paymentAmount").value," it would take over 12 months to chip away at your balance. ")}}function Sl(t,l){if(t&1&&(n(0,"p",47),c(1),i()),t&2){let e=p(2);a(),x(" Based upon our calculations, if your monthly payment was set at \xA3",e.getElement("paymentAmount").value," you're not paying enough to cover your monthly usage. ")}}function xl(t,l){if(t&1&&(n(0,"option",53),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e),a(),x(" ",e," ")}}function Pl(t,l){if(t&1&&(n(0,"div",10)(1,"label",48),c(2,"Plan type"),i(),n(3,"div",49)(4,"select",50,1)(6,"option",51),c(7,"Choose your payment method"),i(),u(8,xl,2,2,"option",52),i()()()),t&2){let e=p(2);a(4),o("ngClass",O(4,Wt,e.submitted&&e.getElement("planType").errors,e.getElement("planType").touched&&e.getElement("planType").valid)),ue("aria-invalid",!e.getElement("planType").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.planTypes)}}function Dl(t,l){if(t&1&&(n(0,"div",10)(1,"div",54),d(2,"input",55,2),n(4,"label",56),c(5," Override Direct Debit delay days "),i()()()),t&2){let e=p(2);a(2),o("ngClass",O(1,Wt,e.submitted&&e.getElement("overrideDelayDays").errors,e.getElement("overrideDelayDays").touched&&e.getElement("overrideDelayDays").valid))}}function wl(t,l){if(t&1){let e=v();n(0,"button",57),f("click",function(){y(e);let r=p(2);return h(r.onSubmit("submitcash"))}),c(1," Set up as cash "),i()}if(t&2){let e=p(2);o("disabled",e.submittedForm)}}function El(t,l){if(t&1){let e=v();n(0,"button",58),f("click",function(){y(e);let r=p(2);return h(r.onSubmit("submit"))}),c(1," Submit "),i()}if(t&2){let e=p(2);o("disabled",e.submittedForm)}}function kl(t,l){t&1&&(n(0,"span"),c(1,"Submit"),i())}function Al(t,l){if(t&1){let e=v();n(0,"button",58),f("click",function(){y(e);let r=p(2);return h(r.onSubmit("next"))}),u(1,kl,2,0,"span",39),n(2,"span"),c(3,"Next"),i()()}if(t&2){let e=p(2);o("disabled",e.submittedForm),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)=="Bank Direct Debit")}}function Tl(t,l){t&1&&(n(0,"h3",46),c(1," Great your account has been updated. Press the back button. "),i())}function Il(t,l){t&1&&(n(0,"h3",61),c(1," Sorry there was an error, Please try again. Press the back button. "),i())}function Ml(t,l){if(t&1){let e=v();n(0,"div"),u(1,Tl,2,0,"h3",31)(2,Il,2,0,"h3",59),n(3,"button",60),f("click",function(){y(e);let r=p(2);return h(r.onCancel())}),c(4," Back "),i()()}if(t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",e.success===!1)}}function Bl(t,l){if(t&1){let e=v();n(0,"div",7)(1,"form",8)(2,"h3",9),c(3,"Adjust your monthly payment"),i(),n(4,"div",10)(5,"div",11)(6,"div",12)(7,"div",13)(8,"div",9)(9,"div",14)(10,"h5",15),c(11,"Balance"),i(),u(12,pl,2,0,"span",16)(13,ul,2,4,"span",17),i()(),n(14,"div",9)(15,"div",14)(16,"h5",15),c(17,"Usage"),i(),u(18,dl,2,0,"span",16)(19,yl,3,4,"span",18),i()(),u(20,_l,9,5,"div",19),n(21,"div",9)(22,"div",20)(23,"h5",21),c(24," Recommended "),i(),u(25,fl,2,0,"span",16)(26,vl,3,4,"span",18),i()()()()(),n(27,"h3",9),c(28,"Pick your new monthly payment"),i(),n(29,"p"),c(30," Use the slider below to adjust your monthly payment. As a minimum you should pay at least what you're predicted to use each month. "),i(),n(31,"div",11)(32,"div",22)(33,"div",23)(34,"div",24)(35,"button",25),f("click",function(){y(e);let r=p();return h(r.changeValue(-1))}),c(36," - "),i()(),d(37,"input",26),n(38,"div",27)(39,"button",25),f("click",function(){y(e);let r=p();return h(r.changeValue(1))}),c(40," + "),i()()()(),n(41,"div",28)(42,"ngx-slider",29),bt("valueChange",function(r){y(e);let s=p();return gt(s.value,r)||(s.value=r),h(r)}),f("valueChange",function(){y(e);let r=p();return h(r.onValueChange())}),i()()(),n(43,"div",11)(44,"div",30),u(45,gl,2,0,"p",31)(46,bl,2,2,"p",31)(47,Cl,2,1,"p",32)(48,Sl,2,1,"p",32),i()()(),u(49,Pl,9,7,"div",33)(50,Dl,6,4,"div",33),n(51,"div",11)(52,"div",30)(53,"div",34)(54,"button",35),f("click",function(){y(e);let r=p();return h(r.onCancel())}),c(55," Cancel "),i(),u(56,wl,2,1,"button",36)(57,El,2,1,"button",37)(58,Al,4,2,"button",37),i(),n(59,"button",38),f("click",function(){y(e);let r=p();return h(r.onCallBack())}),c(60," Request a callback "),i()()()(),u(61,Ml,5,2,"div",39),i()}if(t&2){let e=p();a(),o("formGroup",e.updatePAYGForm),a(),o("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary"),a(6),o("ngClass",!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.currentPaymentAmount?"col-md-3":"col-md-4"),a(4),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance),a(),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance),a(),o("ngClass",!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.currentPaymentAmount?"col-md-3":"col-md-4"),a(4),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.monthlyUsage),a(),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount),a(),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.currentPaymentAmount),a(),o("ngClass",!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.currentPaymentAmount?"col-md-3":"col-md-4"),a(4),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount),a(),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount),a(),o("ngClass",e.company==="MUA"?"text-secondary-light":"text-primary"),a(15),vt("value",e.value),o("options",e.options)("manualRefresh",e.manualRefresh),a(3),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance)+(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.nextPaymentAdjustment)<1&&!e.payingTooLittle),a(),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance)+(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.nextPaymentAdjustment)>=1&&e.monthsToPay>0&&e.monthsToPay<=12&&!e.payingTooLittle),a(),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance)+(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.nextPaymentAdjustment)>=1&&e.monthsToPay>12&&!e.payingTooLittle),a(),o("ngIf",e.payingTooLittle),a(),o("ngIf",e.application==="CRM"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&e.application==="CRM"),a(6),o("ngIf",e.application==="CRM"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!="Bank Direct Debit"),a(3),o("ngIf",e.submittedForm&&!e.directDebitSetup)}}function Ol(t,l){if(t&1){let e=v();n(0,"app-direct-debit-setup",62),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}if(t&2){let e=p();o("specialPlanType",e.getElement("planType").value)("payg",e.getElement("paymentAmount").value)}}function Vl(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",63),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Payment Plans")}function Gl(t,l){if(t&1&&(n(0,"div"),d(1,"i",9),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}
6function Fl(t,l){t&1&&(n(0,"div")(1,"div",72),w(),n(2,"svg",73),d(3,"path",74),i(),n(4,"svg",75),d(5,"path",76),i()()())}function Yl(t,l){t&1&&(n(0,"div")(1,"div",77),w(),n(2,"svg",73),d(3,"path",74),i(),n(4,"svg",78),d(5,"path",79),i()()())}function Ul(t,l){if(t&1&&(n(0,"div"),u(1,Fl,6,0,"div",39)(2,Yl,6,0,"div",39),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function Rl(t,l){if(t&1){let e=v();n(0,"button",70),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Nl(t,l){if(t&1){let e=v();n(0,"div",64),u(1,Gl,2,1,"div",39)(2,Ul,3,2,"div",39),i(),n(3,"div",65),d(4,"h4",66),i(),n(5,"div",67),d(6,"p",68),i(),n(7,"div",69)(8,"button",70),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,Rl,2,0,"button",71),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}var Qt=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe,ct,pt){this.fb=m,this.customerService=r,this.pageScrollService=s,this.document=g,this.spinner=C,this.spinnerSevice=P,this.paymentOptionsService=k,this.modalService=V,this.datepipe=me,this.decimalpipe=ce,this.analyticsService=pe,this.activatedRoute=ct,this.contactDetailsService=pt,this.status=new T,this.manualRefresh=new Xe,this.faSmileWink=Ce,this.faExclamationTriangle=xe,this.faQuestionCircle=Se,this.faCalendarDay=Pe,this.submittedForm=!1,this.submitted=!0,this.monthlyUsage=0,this.minimumValue=0,this.recommendedPayment=0,this.directDebitSetup=!1,this.requestACallBack=!1,this.payingTooLittle=!1,this.monthsToPay=0,this.subscriptions=[],this.company=D.company,this.application=D.application,this.slideColor="#28a745",this.planTypes=["Standard","Fixed","Forever"],this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.value=54,this.options={floor:35,ceil:60,showTicks:!1,showSelectionBar:!0,tickStep:10,translate:Le=>"£"+Le,getPointerColor:Le=>this.payingTooLittle?"#dc3545":this.monthsToPay<=12?this.slideColor:"#ffc107",getTickColor:Le=>this.payingTooLittle?"#dc3545":this.monthsToPay<=12?this.slideColor:"#ffc107",getSelectionBarColor:Le=>this.payingTooLittle?"#dc3545":this.monthsToPay<=12?this.slideColor:"#ffc107"}}ngOnInit(){this.analyticsService.pageView("update-payg-form","./update-payg-form","update payg form"),this.updatePAYGForm=this.fb.group({paymentAmount:[null,B.required],planType:["Standard",B.required],overrideDelayDays:[!0]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.setSlider()}),this.customer=this.customerService.getCustomer(),this.setSlider(),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100}),D.company==="MTX"&&(this.slideColor="#96c11f")}onBillPDF(m){}getElement(m){return this.updatePAYGForm.get(m)}onValueChange(){this.updatePAYGForm.patchValue({paymentAmount:this.value}),this.customer.payAsYouGo.monthlyUsage>this.value&&this.value<this.customer.payAsYouGo.recommendedAmount?(this.payingTooLittle=!0,this.monthsToPay=0):this.customer.payAsYouGo.monthlyUsage>this.value&&this.value>=this.customer.payAsYouGo.recommendedAmount?(this.payingTooLittle=!1,this.monthsToPay=0):(this.payingTooLittle=!1,this.customer.payAsYouGo.recommendedAmount!=this.customer.payAsYouGo.nextPaymentAmount?this.monthsToPay=1+Math.ceil((this.customer.payAsYouGo.balance+this.customer.payAsYouGo.nextPaymentAdjustment)/(this.value-this.customer.payAsYouGo.monthlyUsage)):this.monthsToPay=Math.ceil((this.customer.payAsYouGo.balance+this.customer.payAsYouGo.nextPaymentAdjustment)/(this.value-this.customer.payAsYouGo.monthlyUsage)))}ngOnDestroy(){this.customerSubscription.unsubscribe()}setSlider(){let m=this.application==="CRM"?1:this.customer.payAsYouGo.minimumPayment;this.customer&&this.customer.payAsYouGo&&(this.options.floor=Math.round(Math.max(m,1)),this.options.ceil=Math.round(Math.max(this.customer.payAsYouGo.maximumPayment,this.customer.payAsYouGo.monthlyUsage)),this.value=Math.round(this.customer.payAsYouGo.recommendedAmount),this.updatePAYGForm.patchValue({paymentAmount:Math.round(this.customer.payAsYouGo.recommendedAmount)}),this.recommendedPayment=Math.round(this.customer.payAsYouGo.recommendedAmount),this.application!=="C
6RM"?this.minimumValue=Math.round(Math.min(this.customer.payAsYouGo.minimumPayment,this.customer.payAsYouGo.monthlyUsage)):this.minimumValue=1,this.monthlyUsage=Math.round(this.customer.payAsYouGo.monthlyUsage),this.manualRefresh.next(),this.onValueChange())}focusOnError(m){m.focus()}onSubmit(m){let r=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",s=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),g=this.activatedRoute.snapshot.queryParamMap.get("callerName");!r&&!s&&!g&&(r=this.contactDetailsService.contactMethod,s=this.contactDetailsService.eventTelephoneNumber,g=this.contactDetailsService.eventCallerName);let C=m==="next"?"next":"submit";this.submitted=!0;let P=document.querySelector(".ng-invalid[formControlName]");if(this.updatePAYGForm.invalid){this.focusOnError(P);return}else C=="next"?this.directDebitSetup=!0:(this.success=null,this.spinnerSevice.setSpinnerDescription("updating your account"),this.spinner.show(),this.submittedForm=!0,this.paymentOptionsService.getPaygUpdateResponse(m==="submitcash"||this.customer.paymentPlan.paymentMethod!=="Bank Direct Debit","","","",null,this.getElement("paymentAmount").value,this.getElement("planType").value,this.getElement("overrideDelayDays").value,r,s,g).subscribe(k=>{this.spinner.hide(),this.returnMessage=k.data.returnMessage;let V="";k.data.nextPaymentAmount&&k.data.nextPaymentDate&&(V="<br>Your next payment of <strong> £"+this.decimalpipe.transform(k.data.nextPaymentAmount,"1.2-2")+" is due on "+this.datepipe.transform(k.data.nextPaymentDate,"dd MMM yyyy")+"</strong>"),k.data.nextPaymentAmount&&k.data.nextPaymentDate&&k.data.recommendedAmount&&k.data.recommendedPaymentDate&&k.data.nextPaymentAmount!=k.data.recommendedAmount&&(V=V+"<br>Your regular monthly payment after that of <strong> £"+this.decimalpipe.transform(k.data.recommendedAmount,"1.2-2")+" will start from "+this.datepipe.transform(k.data.recommendedPaymentDate,"dd MMM yyyy")+"</strong>"),this.success=this.returnMessage==="GREEN",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date "+V:"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.success&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},k=>{this.submittedForm=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}))}onCancel(){this.status.emit("cancel")}changeValue(m){let r=0;m<0?this.getElement("paymentAmount").value<=this.options.floor?r=this.options.floor:r=this.getElement("paymentAmount").value-1:m>0&&(this.getElement("paymentAmount").value>=this.options.ceil?r=this.options.ceil:r=this.getElement("paymentAmount").value+1),this.value=r,this.updatePAYGForm.patchValue({paymentAmount:r})}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.status.emit("callback")}getMessage(m){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(re),_(Y),_(U),_(G),_(J),_(X),_(K),_(z),_(be),_(R),_(te),_(W),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-update-payg"]],viewQuery:function(r,s){if(r&1&&N(cl,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},outputs:{status:"status"},decls:6,vars:3,consts:[["template",""],["planTypeErrorRef",""],["overrideDelayDaysErrorRef",""],["class","form-wrap mt-8 pt-3",4,"ngIf"],[3,"specialPlanType","payg","status",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"form-wrap","mt-8","pt-3"],["id","updatePAYGForm","name","updatePAYGForm",3,"formGroup"],[3,"ngClass"],[1,"form-group"],[1,"row"],[1,"col-12"],[1,"row","text-center","bg-info"],[1,"p-3","border-lg-bottom-0","border-lg-right","border-secondary","h-100"],[1,"text-secondary"],["class","h5 mb-0",4,"ngIf"],["class","h3 mb-0",3,"innerHTML",4,"ngIf"],["class","h3 mb-0",4,"ngIf"],["class","col-md-3",4,"ngIf"],[1,"p-3","h-100"],[1,"text-secondary","overflow-hidden","text-truncate"],[1,"col-lg-3"],[1,"input-group","mb-3"],[1,"input-group-prepend"],["type","button","id","button-addon1",1,"btn","btn-sm","btn-outline-secondary",3,"click"],["type","number","formControlName","paymentAmount","name","paymentAmount","readonly","",1,"form-control","form-control-lg","text-center"],[1,"input-group-append"],[1,"col-lg-9","custom-slider"],[3,"valueChange","value","o
6ptions","manualRefresh"],[1,"col-lg-12"],["class","text-success",4,"ngIf"],["class","text-warning",4,"ngIf"],["class","form-group",4,"ngIf"],[1,"btn-group","float-right","mt-2","ml-2"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit","class","btn btn-warning mr-3",3,"disabled","click",4,"ngIf"],["type","submit","class","btn btn-primary",3,"disabled","click",4,"ngIf"],["type","button",1,"btn","sew-btn","btn-outline-success","float-right","mt-2",3,"click"],[4,"ngIf"],[1,"h5","mb-0"],[1,"h3","mb-0",3,"innerHTML"],[1,"h3","mb-0"],[1,"col-md-3"],[1,"border-lg-bottom-0","border-lg-right","border-secondary","h-100"],[1,"p-3"],[1,"text-success"],[1,"text-warning"],["for","planType"],[1,"select-wrap"],["aria-describedby","planTypeHint planTypeError","formControlName","planType","name","planType","id","planType","required","",1,"custom-select","custom-select-lg",3,"ngClass"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],[3,"ngValue"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","overrideDelayDays","name","overrideDelayDays","id","overrideDelayDays","aria-describedby","overrideDelayDays-error",1,"custom-control-input",3,"ngClass"],["for","overrideDelayDays",1,"custom-control-label"],["type","submit",1,"btn","btn-warning","mr-3",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"click","disabled"],["class","text-danger",4,"ngIf"],[1,"btn","sew-btn","btn-outline-success","float-right","mx-3",3,"click"],[1,"text-danger"],[3,"status","specialPlanType","payg"],[3,"status","defaultOption"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2 62.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"]],template:function(r,s){r&1&&(u(0,Bl,62,26,"div",3)(1,Ol,1,2,"app-direct-debit-setup",4),n(2,"section",5),u(3,Vl,1,1,"app-request-a-call-back",6),i(),u(4,Nl,11,5,"ng-template",null,0,L)),r&2&&(o("ngIf",!s.directDebitSetup&&!s.requestACallBack),a(),o("ngIf",s.directDebitSetup),a(2),o("ngIf",s.requestACallBack))},dependencies:[F,H,I,se,ae,fe,ve,We,at,we,_e,ne,ie,ge,oe,le,It,Re,R,De]});let t=l;return t})();var jl=["template"],Ll=(t,l)=>({"is-invalid":t,"is-valid":l});function Hl(t,l){if(t&1&&(n(0,"option",23),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e.day),a(),x(" ",e.description," ")}}function zl(t,l){if(t&1){let e=v();n(0,"form",7),f("ngSubmit",function(){y(e);let r=p(2);return h(r.onSubmit())}),n(1,"h2",8),c(2,"Pay by cash on bill"),i(),n(3,"div",9)(4,"fieldset",10)(5,"legend")(6,"h4")(7,"label",11),c(8,"Payment day"),i()()(),d(9,"app-input-error-message",12),n(10,"div",13)(11,"div",14)(12,"div",15)(13,"select",16,1)(15,"option",17),c(16," Choose your payment day "),i(),u(17,Hl,2,2,"option",18),i()()()()()(),n(18,"div",13)(19,"div",19)(20,"div",20)(21,"button",21),f("
6click",function(){y(e);let r=p(2);return h(r.onCancel())}),c(22," Cancel "),i(),n(23,"button",22),c(24," Submit "),i()()()()()}if(t&2){let e=p(2);o("formGroup",e.cashPayOnBillForm),a(9),o("displayErrorIf",e.submitted&&e.getElement("paymentDay").errors),a(4),o("ngClass",O(7,Ll,e.submitted&&e.getElement("paymentDay").errors,e.getElement("paymentDay").touched&&e.getElement("paymentDay").valid)),ue("aria-invalid",!e.getElement("paymentDay").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.paymentDays),a(6),o("disabled",e.formSubmitted)}}function Wl(t,l){if(t&1&&(n(0,"div",5),u(1,zl,25,10,"form",6),i()),t&2){let e=p();a(),o("ngIf",!e.requestACallBack)}}function Ql(t,l){if(t&1&&(n(0,"div"),d(1,"i",33),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function Jl(t,l){t&1&&(n(0,"div")(1,"div",34),w(),n(2,"svg",35),d(3,"path",36),i(),n(4,"svg",37),d(5,"path",38),i()()())}function Xl(t,l){t&1&&(n(0,"div")(1,"div",39),w(),n(2,"svg",35),d(3,"path",36),i(),n(4,"svg",40),d(5,"path",41),i()()())}function $l(t,l){if(t&1&&(n(0,"div"),u(1,Jl,6,0,"div",25)(2,Xl,6,0,"div",25),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function Zl(t,l){if(t&1){let e=v();n(0,"button",31),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Kl(t,l){if(t&1){let e=v();n(0,"div",24),u(1,Ql,2,1,"div",25)(2,$l,3,2,"div",25),i(),n(3,"div",26),d(4,"h4",27),i(),n(5,"div",28),d(6,"p",29),i(),n(7,"div",30)(8,"button",31),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,Zl,2,0,"button",32),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}function er(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",42),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Other payment enquiry")}var Jt=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe){this.fb=m,this.pageScrollService=r,this.document=s,this.customerService=g,this.paymentOptionsService=C,this.spinner=P,this.spinnerSevice=k,this.modalService=V,this.analyticsService=me,this.activatedRoute=ce,this.contactDetailsService=pe,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=he,this.paymentDays=Me,this.subscriptions=[],this.requestACallBack=!1,this.formSubmitted=!1,this.company=D.company,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.status=new T}ngOnInit(){this.analyticsService.pageView("pay-on-bill-form","./pay-on-bill-form","pay-on-bill form"),this.cashPayOnBillForm=this.fb.group({paymentDay:[null,B.required]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.customer?this.cashPayOnBillForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()}):this.cashPayOnBillForm.patchValue({paymentDay:""})}),this.customer=this.customerService.getCustomer(),this.customer?this.cashPayOnBillForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()}):this.cashPayOnBillForm.patchValue({paymentDay:""})}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}focusOnError(m){m.focus()}onSubmit(){let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName),this.submitted=!0;let g=document.querySelector(".ng-invalid[formControlName]");if(this.cashPayOnBillForm.invalid){this.focusOnError(g);return}else this.formSubmitted=!0,this.success=null,this.spinnerSevice.setSpinnerDescription("updating payment info ..."),this.spinner.show(),this.submittedForm=!0,this.paymentOptionsService.getCashOnBillUpdateResponse(this.getElement("paymentDay").value,m,r,s).subscribe(C=>{this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.returnMessage==="GREEN"&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},C=>{this.formSubmitted=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})}getElement(m){return this.cashPayOnBillForm.get(m)}onCancel(){this.status.emit("cancel"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}ngOnDestroy(){this.customerSubscription.unsubscribe()}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.status.emit("callback")}getMessage(m){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(re),_(U),_(G),_(Y),_(K),_(J),_(X),_(z),_(te),_(W),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-cash-on-bill"]],viewQuery:function(r,s){if(r&1&&N(jl,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},outputs:{status:"status"},decls:5,vars:2,consts:[["template",""],["paymentDayErrorRef",""],["class","form-wrap mt-8",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"form-wrap","mt-8"],["id","payOnBillForm","name","payOnBillForm",3,"formGroup","ngSubmit",4,"ngIf"],["id","payOnBillForm","name","payOnBillForm",3,"ngSubmit","formGroup"],["id","formHeader",1,"py-3"],[1,"form-group"],[1,"py-1"],["for","paymentDay",1,"label","required"],["errorMsg","Please select a payment day","id","paymentDayError",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-6"],[1,"select-wrap"],["aria-describedby","paymentDayHint paymentDayError","formControlName","paymentDay","name","paymentDay","id","paymentDay","required","",1,"custom-select","custom-select-lg",3,"ngClass"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],[1,"col-12","mt-2"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[3,"ngValue"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[3,"ngClass"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2
662.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,s){r&1&&(u(0,Wl,2,1,"div",2)(1,Kl,11,5,"ng-template",null,0,L),n(3,"section",3),u(4,er,1,1,"app-request-a-call-back",4),i()),r&2&&(o("ngIf",!s.requestACallBack),a(4),o("ngIf",s.requestACallBack))},dependencies:[F,H,I,se,Ee,ae,fe,ve,_e,ne,ie,ge,oe,le]});let t=l;return t})();var nr=["template"],ir=(t,l)=>({"is-invalid":t,"is-valid":l});function ar(t,l){if(t&1&&(n(0,"option",24),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e.day),a(),x(" ",e.description," ")}}function or(t,l){if(t&1){let e=v();n(0,"form",7),f("ngSubmit",function(){y(e);let r=p(2);return h(r.onSubmit())}),n(1,"h2",8),c(2,"Cancel Direct Debit"),i(),n(3,"div",9)(4,"fieldset",10)(5,"legend")(6,"h4")(7,"label",11),c(8,"Payment day"),i()()(),d(9,"app-input-error-message",12),n(10,"div",13)(11,"div",14)(12,"div",15)(13,"select",16,1)(15,"option",17),c(16," Choose your payment day "),i(),u(17,ar,2,2,"option",18),i()()()(),n(18,"small",19),c(19,"We offer four different payment dates 1st, 7th, 15th or 23rd"),i()()(),n(20,"div",13)(21,"div",20)(22,"div",21)(23,"button",22),f("click",function(){y(e);let r=p(2);return h(r.onCancel())}),c(24," Cancel "),i(),n(25,"button",23),c(26," Submit "),i()()()()()}if(t&2){let e=p(2);o("formGroup",e.cashPayOnBillForm),a(9),o("displayErrorIf",e.submitted&&e.getElement("paymentDay").errors),a(4),o("ngClass",O(7,ir,e.submitted&&e.getElement("paymentDay").errors,e.getElement("paymentDay").touched&&e.getElement("paymentDay").valid)),ue("aria-invalid",!e.getElement("paymentDay").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.paymentDays),a(8),o("disabled",e.formSubmitted)}}function lr(t,l){if(t&1&&(n(0,"div",5),u(1,or,27,10,"form",6),i()),t&2){let e=p();a(),o("ngIf",!e.requestACallBack)}}function rr(t,l){if(t&1&&(n(0,"div"),d(1,"i",34),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}function sr(t,l){t&1&&(n(0,"div")(1,"div",35),w(),n(2,"svg",36),d(3,"path",37),i(),n(4,"svg",38),d(5,"path",39),i()()())}function mr(t,l){t&1&&(n(0,"div")(1,"div",40),w(),n(2,"svg",36),d(3,"path",37),i(),n(4,"svg",41),d(5,"path",42),i()()())}function cr(t,l){if(t&1&&(n(0,"div"),u(1,sr,6,0,"div",26)(2,mr,6,0,"div",26),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function pr(t,l){if(t&1){let e=v();n(0,"button",32),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function ur(t,l){if(t&1){let e=v();n(0,"div",25),u(1,rr,2,1,"div",26)(2,cr,3,2,"div",26),i(),n(3,"div",27),d(4,"h4",28),i(),n(5,"div",29),d(6,"p",30),i(),n(7,"div",31)(8,"button",32),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,pr,2,0,"button",33),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}function dr(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",43),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Other payment enquiry")}var Xt=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe){this.fb=m,this.activatedRoute=r,this.pageScrollService=s,this.document=g,this.customerService=C,this.paymentOptionsService=P,this.spinner=k,this.spinnerSevice=V,this.modalService=me,this.analyticsService=ce,this.contactDetailsService=pe,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=he,this.paymentDays=Me,this.subscriptions=[],this.requestACallBack=!1,this.formSubmitted=!1,this.company=D.company,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.status=new T}ngOnInit(){this.analyticsService.pageView("pay-on-bill-form","./pay-on-bill-form","pay-on-bill form"),this.cashPayOnBillForm=this.fb.group({paymentDay:[null,B.required]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.customer?this.cashPayOnBillForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()}):this.cashPayOnBillForm.patchValue({paymentDay:""})}),this.customer=this.customerService.getCustomer(),this.customer?this.cashPayOnBillForm.patchValue({paymentDay:this.customer.paymentPlan.paymentDay.toString()}):this.cashPayOnBillForm.patchValue({paymentDay:""})}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}focusOnError(m){m.focus()}onSubmit(){let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName),this.submitted=!0;let g=document.querySelector(".ng-invalid[formControlName]");
6if(this.cashPayOnBillForm.invalid){this.focusOnError(g);return}else this.formSubmitted=!0,this.success=null,this.spinnerSevice.setSpinnerDescription("updating payment info ..."),this.spinner.show(),this.submittedForm=!0,this.paymentOptionsService.getDDOnBillUpdateResponse(null,null,null,this.getElement("paymentDay").value,!1,m,r,s).subscribe(C=>{this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.returnMessage==="GREEN"&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},C=>{this.formSubmitted=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})}getElement(m){return this.cashPayOnBillForm.get(m)}onCancel(){this.status.emit("cancel"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}ngOnDestroy(){this.customerSubscription.unsubscribe()}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.status.emit("callback")}getMessage(m){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(re),_(W),_(U),_(G),_(Y),_(K),_(J),_(X),_(z),_(te),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-cash-setup"]],viewQuery:function(r,s){if(r&1&&N(nr,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},inputs:{unmeasuredPayments:"unmeasuredPayments"},outputs:{status:"status"},decls:5,vars:2,consts:[["template",""],["paymentDayErrorRef",""],["class","form-wrap mt-8",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"form-wrap","mt-8"],["id","payOnBillForm","name","payOnBillForm",3,"formGroup","ngSubmit",4,"ngIf"],["id","payOnBillForm","name","payOnBillForm",3,"ngSubmit","formGroup"],["id","formHeader",1,"py-3"],[1,"form-group"],[1,"py-1"],["for","paymentDay",1,"label","required"],["errorMsg","Please select a payment day","id","paymentDayError",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-6"],[1,"select-wrap"],["aria-describedby","paymentDayHint paymentDayError","formControlName","paymentDay","name","paymentDay","id","paymentDay","required","",1,"custom-select","custom-select-lg",3,"ngClass"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["id","paymentDayHint",1,"hint"],[1,"col-12","mt-2"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","submit",1,"btn","btn-primary",3,"disabled"],[3,"ngValue"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[3,"ngClass"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2
662.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,s){r&1&&(u(0,lr,2,1,"div",2)(1,ur,11,5,"ng-template",null,0,L),n(3,"section",3),u(4,dr,1,1,"app-request-a-call-back",4),i()),r&2&&(o("ngIf",!s.requestACallBack),a(4),o("ngIf",s.requestACallBack))},dependencies:[F,H,I,se,Ee,ae,fe,ve,_e,ne,ie,ge,oe,le]});let t=l;return t})();var hr=["template"],mt=(t,l)=>({"is-invalid":t,"is-valid":l});function _r(t,l){if(t&1&&(n(0,"option",36),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e),a(),x(" ",e," ")}}function fr(t,l){if(t&1&&(n(0,"option",36),c(1),i()),t&2){let e=l.$implicit;o("ngValue",e.day),a(),x(" ",e.description," ")}}function vr(t,l){if(t&1&&(n(0,"div",12),c(1," To clear your account balance by your next bill the monthly payment would be around "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()),t&2){let e=p(3);a(4),x("",S(5,1,e.paymentAmount,!0)," ")}}function gr(t,l){if(t&1&&(n(0,"div",12),c(1," To clear your account balance in 6 monthly instalments it would be around "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()),t&2){let e=p(3);a(4),x("",S(5,1,e.monthlyPaymentAmount*2,!0)," ")}}function br(t,l){if(t&1&&(n(0,"div",12),c(1," To clear your account balance in 12 monthly instalments it would be around "),n(2,"span"),c(3,"\xA3"),i(),c(4),b(5,"moneyPipe"),i()),t&2){let e=p(3);a(4),x("",S(5,1,e.monthlyPaymentAmount,!0)," ")}}function Cr(t,l){if(t&1&&(n(0,"div",13)(1,"fieldset",14)(2,"div",37),d(3,"input",38,4),n(5,"label",39),c(6," Override Direct Debit delay days "),i()()()()),t&2){let e=p(3);a(3),o("ngClass",O(1,mt,e.submitted&&e.getElement("overrideDelayDays").errors,e.getElement("overrideDelayDays").touched&&e.getElement("overrideDelayDays").valid))}}function Sr(t,l){if(t&1){let e=v();n(0,"button",40),f("click",function(){y(e);let r=p(3);return h(r.setupDD())}),c(1," Set up Direct Debit "),i()}if(t&2){let e=p(3);o("disabled",e.formSubmitted)}}function xr(t,l){if(t&1&&(n(0,"button",41),c(1," Submit "),i()),t&2){let e=p(3);o("disabled",e.formSubmitted)}}function Pr(t,l){if(t&1){let e=v();n(0,"form",10),f("ngSubmit",function(){y(e);let r=p(2);return h(r.onSubmit())}),n(1,"h2",11),c(2,"Affordability plan"),i(),n(3,"h2",12),c(4," Balance: "),n(5,"span"),c(6,"\xA3"),i(),c(7),b(8,"moneyPipe"),i(),n(9,"div",13)(10,"fieldset",14)(11,"legend")(12,"h4")(13,"label",15),c(14,"Payment method"),i()()(),d(15,"app-input-error-message",16),n(16,"div",17)(17,"div",18)(18,"div",19)(19,"select",20,1),f("change",function(){y(e);let r=p(2);return h(r.onPaymentMethodChange())}),n(21,"option",21),c(22," Choose your payment method "),i(),u(23,_r,2,2,"option",22),i()()()()()(),n(24,"div",13)(25,"fieldset",14)(26,"legend")(27,"h4")(28,"label",23),c(29,"Payment day"),i()()(),d(30,"app-input-error-message",24),n(31,"div",17)(32,"div",18)(33,"div",19)(34,"select",25,2)(36,"option",21),c(37," Choose your payment day "),i(),u(38,fr,2,2,"option",22),i()()()()()(),n(39,"div",13)(40,"fieldset",14)(41,"legend")(42,"h4")(43,"label",26),c(44,"Payment amount"),i()()(),d(45,"app-input-error-message",27),n(46,"div",17)(47,"div",18),d(48,"input",28,3),i(),u(50,vr,6,4,"div",29)(51,gr,6,4,"div",29)(52,br,6,4,"div",29),i()()(),u(53,Cr,7,4,"div",30),n(54,"div",17)(55,"div",31)(56,"div",32)(57,"button",33),f("click",function(){y(e);let r=p(2);return h(r.onCancel())}),c(58," Cancel "),i(),u(59,Sr,2,1,"button",34)(60,xr,2,1,"button",35),i()()()()}if(t&2){let e=p(2);o("formGroup",e.unmeasuredAffordabilitySetupForm),a(7),x("",S(8,20,e.customer==null?null:e.customer.balance,!0)," "),a(8),o("displayErrorIf",e.submitted&&e.getElement("paymentMethod").errors),a(4),o("ngClass",O(23,mt,e.submitted&&e.getElement("paymentMethod").errors,e.getElement("paymentMethod").touched&&e.getElement("paymentMethod").valid)),ue("aria-invalid",!e.getElement("paymentMethod").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.paymentMethods),a(7),o("displayErrorIf",e.submitted&&e.getElement("paymentDay").errors),a(4),o("ngClass",O(26,mt,e.submitted&&e.getElement("paymentDay").errors,e.getElement("paymentDay").touched&&e.getElement("paymentDay").valid)),ue("aria-invalid",!e.getElement("paymentDay").valid),a(2),o("ngValue",null),a(2),o("ngForOf",e.paymentDays),a(7),o("displayErrorIf",e.submitted&&e.getElement("paymentAmount").errors),a(3),o("ngClass",O(29,mt,e.submitted&&e.getElement("paymentAmount").errors,e.getElement("paymentAmount").touched&&e.getElement("paymentAmount").valid)),a(2),o("ngIf",e.paymentAmount),a(),o("ngIf",e.monthlyPaymentAmount),a(),o("ngIf",e.monthlyPaymentAmount),a(),o("ngIf",e.getElement("paymentMethod").value=="Direct Debit"&&e.application==="CRM"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(6),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit"&&e.getElement("paymentMethod").value==="Direct Debit"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.getElement("paymentMethod").value!=="Direct Debit")}}function Dr(t,l){if(t&1&&(n(0,"div",8),u(1,Pr,61,32,"form",9),i()),t&2){let e=p();a(),o("ngIf",!e.requestACallBack)}}function wr(t,l){if(t&1&&(n(0,"div"),d(1,"i",51),i()),t&2){let e=p(2);a(),o("ngClass",e.success?"bg-secondary fal fa-check":"bg-danger shadow fal fa-times")}}
6function Er(t,l){t&1&&(n(0,"div")(1,"div",52),w(),n(2,"svg",53),d(3,"path",54),i(),n(4,"svg",55),d(5,"path",56),i()()())}function kr(t,l){t&1&&(n(0,"div")(1,"div",57),w(),n(2,"svg",53),d(3,"path",54),i(),n(4,"svg",58),d(5,"path",59),i()()())}function Ar(t,l){if(t&1&&(n(0,"div"),u(1,Er,6,0,"div",43)(2,kr,6,0,"div",43),i()),t&2){let e=p(2);a(),o("ngIf",e.success),a(),o("ngIf",!e.success)}}function Tr(t,l){if(t&1){let e=v();n(0,"button",49),f("click",function(){y(e);let r=p(2);return h(r.onCallBack())}),c(1," Call back "),i()}}function Ir(t,l){if(t&1){let e=v();n(0,"div",42),u(1,wr,2,1,"div",43)(2,Ar,3,2,"div",43),i(),n(3,"div",44),d(4,"h4",45),i(),n(5,"div",46),d(6,"p",47),i(),n(7,"div",48)(8,"button",49),f("click",function(){y(e);let r=p();return h(r.closeModal())}),c(9," Close "),i(),u(10,Tr,2,0,"button",50),i()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF"),a(2),o("innerHTML",e.modalTitle,E),a(2),o("innerHTML",e.modalBody,E),a(4),o("ngIf",e.application!=="CRM")}}function Mr(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",60),f("status",function(r){y(e);let s=p();return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Other payment enquiry")}var $t=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V,me,ce,pe){this.fb=m,this.pageScrollService=r,this.document=s,this.customerService=g,this.paymentOptionsService=C,this.spinner=P,this.spinnerSevice=k,this.modalService=V,this.analyticsService=me,this.activatedRoute=ce,this.contactDetailsService=pe,this.submitted=!1,this.submittedForm=!1,this.faExclamationCircle=he,this.paymentDays=ke,this.subscriptions=[],this.requestACallBack=!1,this.formSubmitted=!1,this.company=D.company,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.paymentMethods=["Cash","Direct Debit"],this.monthlyPaymentAmount=0,this.status=new T,this.directDebitSetup=new T}ngOnInit(){this.analyticsService.pageView("pay-on-bill-form","./pay-on-bill-form","pay-on-bill form"),this.unmeasuredAffordabilitySetupForm=this.fb.group({paymentMethod:[null,B.required],paymentDay:[null,B.required],paymentAmount:[null,B.required],overrideDelayDays:[!0]}),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.customer?(this.unmeasuredAffordabilitySetupForm.patchValue({paymentDay:this.customer.paymentPlan?.paymentDay?.toString()}),this.onLoad()):this.unmeasuredAffordabilitySetupForm.patchValue({paymentDay:""})}),this.customer=this.customerService.getCustomer(),this.customer?(this.unmeasuredAffordabilitySetupForm.patchValue({paymentDay:this.customer.paymentPlan?.paymentDay?.toString()}),this.unmeasuredAffordabilitySetupForm.patchValue({paymentMethod:this.customer.paymentPlan.paymentMethod==="Cash"?"Cash":"Direct Debit"}),this.onLoad()):(this.unmeasuredAffordabilitySetupForm.patchValue({paymentDay:""}),this.unmeasuredAffordabilitySetupForm.patchValue({paymentMethod:""}))}ngAfterViewInit(){this.pageScrollService.scroll({document:this.document,scrollTarget:".card-body",duration:300})}onLoad(){if(this.customer?.paymentPlan?.paymentMethod==="Bank Direct Debit"?this.paymentDays=ke:this.paymentDays=Me,this.customer.movedOutDate)this.customer?.balance>0?this.monthlyPaymentAmount=this.customer?.balance/12:this.monthlyPaymentAmount=0;else{let m=!0;m=this.unmeasuredAffordabilitySetupForm.get("paymentMethod").value==="Cash",this.paymentOptionsService.getUnmeasuredPaymentPlanCheckResponse("","","",this.unmeasuredAffordabilitySetupForm.get("paymentDay").value,12,m,!0).subscribe(r=>{r.data?.paymentsDue&&r.data?.paymentsDue.length>0&&(this.paymentsDue=r.data.paymentsDue,this.paymentAmount=this.paymentsDue[0].paymentAmount,r.data.paymentsDue.length!==12&&this.customer?.balance>0?this.monthlyPaymentAmount=this.customer?.balance/12:this.monthlyPaymentAmount=0)},r=>{this.paymentAmount=0,this.customer?.balance>0?this.monthlyPaymentAmount=this.customer?.balance/12:this.monthlyPaymentAmount=0})}}focusOnError(m){m.focus()}onPaymentMethodChange(){this.unmeasuredAffordabilitySetupForm.get("paymentDay").patchValue(null),this.unmeasuredAffordabilitySetupForm.get("paymentMethod").value==="Cash"?this.paymentDays=Me:this.paymentDays=ke}onSubmit(){let m=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",r=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),s=this.activatedRoute.snapshot.queryParamMap.get("callerName");!m&&!r&&!s&&(m=this.contactDetailsService.contactMethod,r=this.contactDetailsService.eventTelephoneNumber,s=this.contactDetailsService.eventCallerName),this.submitted=!0;let g=document.querySelector(".ng-invalid[formControlName]");
6if(this.unmeasuredAffordabilitySetupForm.invalid){this.focusOnError(g);return}else this.formSubmitted=!0,this.success=null,this.spinnerSevice.setSpinnerDescription("updating payment info ..."),this.spinner.show(),this.submittedForm=!0,this.customer.movedOutDate||!this.customer.movedInDate?this.paymentOptionsService.getAdhocPaymentUpdateResponse(!0,this.getElement("paymentMethod").value==="Cash"?"0":"1",null,null,null,null,this.getElement("paymentDay").value,this.getElement("paymentAmount").value,null,null,null,null,"COP",this.getElement("overrideDelayDays").value,m,r,s).subscribe(C=>{this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)},C=>{this.formSubmitted=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)}):this.paymentOptionsService.getAffordabilityPlanUpdateResponse(this.getElement("paymentMethod").value==="Cash",null,null,null,this.getElement("paymentDay").value,this.getElement("paymentAmount").value,null,null,null,this.getElement("overrideDelayDays").value,m,r,s).subscribe(C=>{this.spinner.hide(),this.returnMessage=C.data.returnMessage,this.success=this.returnMessage==="GREEN"||this.returnMessage==="AMBER",this.config.class=this.success?"success-modal":"warning-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.returnMessage==="GREEN"&&Z.includes(this.company)&&(this.modalBody+=$),this.openModal(this.templateRef)},C=>{this.formSubmitted=!1,this.spinner.hide(),this.success=!1,this.config.class=this.success?"success-modal":"danger-modal",this.modalTitle=this.success?"All complete":"Sorry we've hit a problem",this.modalBody=this.success?"That's all updated for you. Thanks so much for keeping your details up to date.":"Oh no, I am so sorry but that didn't seem to work, could you complete the form again or you can request a callback if you want one of our team to ring you back",this.openModal(this.templateRef)})}getElement(m){return this.unmeasuredAffordabilitySetupForm.get(m)}setupDD(){this.onCancel(),this.requestACallBack=!1;let m={paymentAmount:this.unmeasuredAffordabilitySetupForm.get("paymentAmount").value,paymentDay:this.unmeasuredAffordabilitySetupForm.get("paymentDay").value};this.directDebitSetup.emit(JSON.stringify(m))}onCancel(){this.status.emit("cancel"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})}ngOnDestroy(){this.customerSubscription.unsubscribe()}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&(this.onCancel(),this.requestACallBack=!1)}))}onCallBack(){this.closeModal(),this.status.emit("callback")}getMessage(m){this.onCancel(),this.requestACallBack=!1}closeModal(){if(this.modalRef)this.success&&(this.onCancel(),this.requestACallBack=!1);else return;this.modalRef.hide(),this.modalRef=null}};l.\u0275fac=function(r){return new(r||l)(_(re),_(U),_(G),_(Y),_(K),_(J),_(X),_(z),_(te),_(W),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-unmeasured-affordability-setup"]],viewQuery:function(r,s){if(r&1&&N(hr,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},inputs:{unmeasuredPayments:"unmeasuredPayments"},outputs:{status:"status",directDebitSetup:"directDebitSetup"},decls:5,vars:2,consts:[["template",""],["paymentMethodErrorRef",""],["paymentDayErrorRef",""],["paymentAmountErrorRef",""],["overrideDelayDaysErrorRef",""],["class","form-wrap mt-8",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"form-wrap","mt-8"],["id","payOnBillForm","name","payOnBillForm",3,"formGroup","ngSubmit",4,"ngIf"],["id","payOnBillForm","name","payOnBillForm",3,"ngSubmit","formGroup"],["id","formHeader",1,"py-0","mb-0"],[1,"small"],[1,"form-group"],[1,"py-1"],["for","paymentMethod",1,"label","required"],["errorMsg","Please select a payment day","id","paymentMethodError",3,"displayErrorIf"],[1,"form-row"],[1,"col-md-6"],[1,"select-wrap"],["aria-describedby","paymentMethodHint paymentMethodError","formControlName","paymentMethod","name","paymentMethod","id","paymentMethod","required","",1,"custom-select","custom-select-lg",3,"change","ngClass"],["disabled","",3,"ngValue"],[3,"ngValue",4,"ngFor","ngForOf"],["for","paymentDay",1,"label","required"],["errorMsg","Please select a payment day","id","paymentDayError",3,"displayErrorIf"],["aria-describedby","paymentDayHint paymentDayError","formControlName","paymentDay","name","paymentDay","id","paymentDay","required","",1,"custom-select","custom-select-lg",3,"ngClass"],["for","paymentAmount",1,"label","required"],["errorMsg","Please enter a payment amount","id","paymentAmountError",3,"displayErrorIf"],["formControlName","paymentAmount","name","paymentAmount","id","paymentAmount","type","number","aria-describedby","name-hint name-error","required","",1,"form-control","form-control-lg",3,"ngClass"],["class","small",4,"ngIf"],["class","form-group",4,"ngIf"],[1,"col-12","mt-2"],[1,"btn-group","float-right"],["type","button",1,"btn","btn-outline-danger","mx-3",3,"click"],["type","button","class","btn btn-primary",3,"disabled","click",4,"ngIf"],["type","submit","class","btn btn-primary",3,"disabled",4,"ngIf"],[3,"ngValue"],[1,"custom-control","custom-checkbox"],["type","checkbox","formControlName","overrideDelayDays","name","overrideDelayDays","id","overrideDelayDays","aria-describedby","overrideDelayDays-error",1,"custom-control-input",3,"ngClass"],["for","overrideDelayDays",1,"custom-control-label"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],[1,"icon-circle"],[4,"ngIf"],[1,"modal-header","justify-content-center"],[1,"modal-title",3,"innerHTML"],[1,"modal-body"],[1,"text-center",3,"innerHTML"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],["type","button","class","btn btn-dark",3,"click",4,"ngIf"],[3,"ngClass"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"],[1,"icon-circle-inner","bg-danger"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512"],["d","M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm101.8-262.2L295.6 256l62.2 62.2c4.7 4.7 4.7 12.3 0 17l-22.6 22.6c-4.7 4.7-12.3 4.7-17 0L256 295.6l-62.2 62.2c-4.7 4.7-12.3 4.7-17 0l-22.6-22.6c-4.7-4.7-4.7-12.3 0-17l62.2-62.2-62.2-62.2c-4.7-4.7-4.7-12.3 0-17l22.6-22.6c4.7-4.7 12.3-4.7 17 0l62.2
662.2 62.2-62.2c4.7-4.7 12.3-4.7 17 0l22.6 22.6c4.7 4.7 4.7 12.3 0 17z"],[3,"status","defaultOption"]],template:function(r,s){r&1&&(u(0,Dr,2,1,"div",5)(1,Ir,11,5,"ng-template",null,0,L),n(3,"section",6),u(4,Mr,1,1,"app-request-a-call-back",7),i()),r&2&&(o("ngIf",!s.requestACallBack),a(4),o("ngIf",s.requestACallBack))},dependencies:[F,H,I,se,Ee,ae,fe,ve,We,at,we,_e,ne,ie,ge,oe,le,De]});let t=l;return t})();var Or=["template"];function Vr(t,l){t&1&&(n(0,"h2"),c(1," Your payment options "),i())}function Gr(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function Fr(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Gr,2,0,"span",2),i()),t&2){let e=p(2);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Yr(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function Ur(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Yr,2,0,"span",2),i()),t&2){let e=p(3);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function Rr(t,l){if(t&1){let e=v();n(0,"div",7),u(1,Ur,3,1,"div",8),n(2,"div",9)(3,"h1",10)(4,"span",11),c(5,"Single payment"),i()(),n(6,"p",17),c(7,"Pay balance with a single payment"),i()(),n(8,"div",13)(9,"button",14),f("click",function(){y(e);let r=p(2);return h(r.onSelect(1))}),c(10," select "),i()()()}if(t&2){let e=p(2);Ae("card mb-4 ",e.company==="LEF"?"bg-secondary":"bg-primary",""),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)<=1&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)<=1&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(3),o("ngClass",e.company==="LEF"?"text-white":""),a(4),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==0,"bg-info")),a(),o("disabled",(e.customer==null?null:e.customer.balance)<=0)}}function Nr(t,l){t&1&&(n(0,"span"),c(1," - cash"),i())}function qr(t,l){if(t&1&&(n(0,"div",16),c(1," current plan "),u(2,Nr,2,0,"span",2),i()),t&2){let e=p(2);a(2),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function jr(t,l){if(t&1){let e=v();n(0,"div",6)(1,"div",7),u(2,Fr,3,1,"div",8),n(3,"div",9)(4,"h1",10)(5,"span",11),c(6,"Monthly payments"),i()(),n(7,"p",12),c(8,"Pay off your balance monthly"),i()(),n(9,"div",13)(10,"button",14),f("click",function(){y(e);let r=p();return h(r.onSelect(12))}),c(11," select "),i()()(),u(12,Rr,11,8,"div",15),n(13,"div",7),u(14,qr,3,1,"div",8),n(15,"div",9)(16,"h1",10)(17,"span",11),c(18,"Special"),i()(),n(19,"p",12),c(20,"You have a special payment plan"),i()(),n(21,"div",13)(22,"button",14),f("click",function(){y(e);let r=p();return h(r.onSelect(12))}),c(23," select "),i()()()()}if(t&2){let e=p();a(),Ae("card mb-4 ",e.company==="LEF"?"bg-secondary":"bg-primary",""),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==0&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)>1&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)!=="Special Plan"),a(3),o("ngClass",e.company==="LEF"?"text-white":""),a(4),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==0,"bg-info")),a(),o("disabled",(e.customer==null?null:e.customer.balance)<=0),a(2),o("ngIf",!e.directDebitSetup&&!e.unmeasuredPlanSetup),a(),Ae("card mb-4 ",e.company==="LEF"?"bg-secondary":e.company==="ICOSA"?"bg-info":"bg-primary",""),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Special Plan"?"bg-info":"border-info"),a(),o("ngIf",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||e.application==="CRM")&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentType)==="Special Plan"),a(3),o("ngClass",e.company==="LEF"?"text-white":""),a(4),o("ngClass",((e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.numberOfInstalments)==0,"bg-info")),a(),o("disabled",!0)}}function Lr(t,l){t&1&&(n(0,"span",27),c(1,"\xA3"),i())}function Hr(t,l){if(t&1&&(n(0,"span",27),c(1),b(2,"number"),i()),t&2){let e=p().$implicit;a(),M(S(2,1,e==null?null:e.paymentAmount,"1.2-2"))}}function zr(t,l){if(t&1&&(n(0,"span",27),c(1),b(2,"date"),i()),t&2){let e=p().$implicit;a(),x(" on ",S(2,1,e==null?null:e.paymentDate,"dd MMM yy"),"")}}function Wr(t,l){if(t&1&&(n(0,"div",25),u(1,Lr,2,0,"span",26)(2,Hr,3,4,"span",26)(3,zr,3,4,"span",26),i()),t&2){let e=l.$implicit;a(),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0),a(),o("ngIf",(e==null?null:e.paymentAmount)!=0)}}function Qr(t,l){t&1&&(n(0,"p"),c(1," As you pay by direct debit your payments will be taken on or around the payment day you have chosen "),i())}function Jr(t,l){t&1&&(n(0,"p"),c(1," Please click on the Make payment button to make a card payment on or before the date of when your payment is due "),i())}function Xr(t,l){if(t&1&&(n(0,"div",20)(1,"div",21)(2,"div",22),c(3,"Upcoming payments"),i(),n(4,"div",23),u(5,Wr,4,3,"div",24)(6,Qr,2,0,"p",2)(7,Jr,2,0,"p",2),i()()()),t&2){let e=p(2);a(5),o("ngForOf",e.paymentsDue),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit"&&e.application!=="C
6RM")}}function $r(t,l){if(t&1&&(n(0,"div",18),u(1,Xr,8,3,"div",19),i()),t&2){let e=p();a(),o("ngIf",e.paymentsDue&&e.paymentsDue.length>0)}}function Zr(t,l){if(t&1){let e=v();n(0,"app-direct-debit-setup",32),f("status",function(r){y(e);let s=p(2);return h(s.getMessage2(r))}),i()}if(t&2){let e=p(2);o("ddOnBill",e.ddOnBill)("unmeasuredPayments",e.unmeasuredPayments)}}function Kr(t,l){if(t&1){let e=v();n(0,"app-unmeasured-plan-change",33),f("status",function(r){y(e);let s=p(2);return h(s.getMessage2(r))}),i()}if(t&2){let e=p(2);o("cashPlan",e.cashPlan)("unmeasuredPayments",e.unmeasuredPayments)}}function es(t,l){if(t&1&&(n(0,"section",28)(1,"div",29),u(2,Zr,1,2,"app-direct-debit-setup",30)(3,Kr,1,2,"app-unmeasured-plan-change",31),i()()),t&2){let e=p();a(2),o("ngIf",e.directDebitSetup),a(),o("ngIf",e.unmeasuredPlanSetup)}}function ts(t,l){t&1&&(n(0,"div"),d(1,"i",39),i())}function ns(t,l){t&1&&(n(0,"div")(1,"div",40),w(),n(2,"svg",41),d(3,"path",42),i(),n(4,"svg",43),d(5,"path",44),i()()())}function is(t,l){if(t&1){let e=v();n(0,"div",34),u(1,ts,2,0,"div",2)(2,ns,6,0,"div",2),i(),n(3,"div",35)(4,"h4",36),c(5,"Cash or direct debit?"),i()(),n(6,"div",37)(7,"button",38),f("click",function(){y(e);let r=p();return h(r.onContinueCash())}),c(8," Cash "),i(),n(9,"button",38),f("click",function(){y(e);let r=p();return h(r.onSetupDD())}),c(10," Direct Debit "),i()()}if(t&2){let e=p();a(),o("ngIf",e.company==="SEW"||e.company==="ESP"),a(),o("ngIf",e.company==="ICOSA"||e.company==="MTX"||e.company==="MUA"||e.company==="LEF")}}var Zt=(()=>{let l=class l{constructor(m,r,s,g,C,P){this.paymentDueService=m,this.customerService=r,this.alertService=s,this.pageScrollService=g,this.document=C,this.modalService=P,this.status=new T,this.subscriptions=[],this.directDebitSetup=!1,this.unmeasuredPlanSetup=!1,this.ddOnBill=null,this.cashSetup=!1,this.company=D.company,this.application=D.application,this.config={animated:!0,keyboard:!0,backdrop:!0,ignoreBackdropClick:!1,class:""},this.paymentsDue=[],this.overduePaymentsDue=[]}ngOnInit(){this.paymentDueSubscription=this.paymentDueService.paymentsDueChange.subscribe(m=>{this.paymentsDue=m,this.splitOutOverdue()}),this.paymentsDue=this.paymentDueService.getPaymentsDue(),this.splitOutOverdue()}splitOutOverdue(){if(this.paymentsDue&&this.paymentsDue.length>0){let r;for(var m=this.paymentsDue.length;m>0;m--)r=this.paymentsDue[m-1],r.overduePayment!=0&&this.overduePaymentsDue.push(...this.paymentsDue.splice(m-1,1))}else this.overduePaymentsDue=[]}onSelect(m){this.unmeasuredPayments=m,this.application==="CRM"?this.openModal(this.templateRef):m===12?(this.unmeasuredPlanSetup=!0,this.status.emit("hide top")):this.customer.paymentPlan.paymentMethod!="Bank Direct Debit"?(this.directDebitSetup=!0,this.status.emit("hide top")):(this.unmeasuredPlanSetup=!0,this.status.emit("hide top"))}onSetupDD(){this.cashPlan=!1,this.customer.paymentPlan.paymentMethod!=="Bank Direct Debit"?(this.unmeasuredPlanSetup=!0,this.closeModal(),this.status.emit("hide top")):(this.unmeasuredPlanSetup=!0,this.closeModal(),this.status.emit("hide top"))}onContinueCash(){this.cashPlan=!0,this.unmeasuredPlanSetup=!0,this.closeModal(),this.status.emit("hide top")}onCallback(){this.status.emit("callback")}onCancel(){this.status.emit("cancel")}getMessage2(m){m=="cancel"?(this.directDebitSetup=!1,this.unmeasuredPlanSetup=!1,this.onCancel()):m=="dd"&&(this.directDebitSetup=!0,this.unmeasuredPlanSetup=!1),m=="callback"&&this.onCallback()}closeModal(){this.modalRef&&(this.modalRef.hide(),this.modalRef=null)}openModal(m){this.modalRef=this.modalService.show(m,Object.assign({},this.config)),this.subscriptions.push(this.modalService.onHide.subscribe(r=>{r=="backdrop-click"&&this.success&&this.onCancel()}))}};l.\u0275fac=function(r){return new(r||l)(_(Qe),_(Y),_(ze),_(U),_(G),_(z))},l.\u0275cmp=A({type:l,selectors:[["app-closed-account-plans"]],viewQuery:function(r,s){if(r&1&&N(Or,5),r&2){let g;q(g=j())&&(s.templateRef=g.first)}},inputs:{customer:"customer"},outputs:{status:"status"},decls:7,vars:4,consts:[["template",""],[1,"container"],[4,"ngIf"],["class","card-deck mb-1 text-center breakdown",4,"ngIf"],["class","row",4,"ngIf"],["class","bg-info mt-5",4,"ngIf"],[1,"card-deck","mb-1","text-center","breakdown"],[3,"ngClass"],["class","current-label text-white bg-success p-2 badge",4,"ngIf"],[1,"card-body","py-1"],[1,"card-title","pricing-card-title"],[1,"h4","mb-0","font-bold",3,"ngClass"],[1,"mb-0"],[1,"card-footer","border-0","py-2",3,"ngClass"],[1,"btn","btn-block","p-3","btn-dark",3,"click","disabled"],[3,"class","ngClass",4,"ngIf"],[1,"current-label","text-white","bg-success","p-2","badge"],[1,"mb-1"],[1,"row"],["class","col-lg-12 mt-2",4,"ngIf"],[1,"col-lg-12","mt-2"],[1,"card","bg-info","mb-3","mb-4","text-center","text-danger","h-100"],[1,"card-header","h3"],[1,"card-body"],["class","h3 badge badge-light",4,"ngFor","ngForOf"],[1,"h3","badge","badge-light"],["class","h4",4,"ngIf"],[1,"h4"],[1,"bg-info","mt-5"],[1,"container","py-8"],[3,"ddOnBill","unmeasuredPayments","status",4,"ngIf"],[3,"cashPlan","unmeasuredPayments","status",4,"ngIf"],[3,"status","ddOnBill","unmeasuredPayments"],[3,"status","cashPlan","unmeasuredPayments"],[1,"icon-circle"],[1,"modal-header","justify-content-center"],[1,"modal-title"],[1,"modal-footer","justify-content-center"],["type","button",1,"btn","btn-dark",3,"click"],[1,"bg-secondary","fal","fa-check"],[1,"icon-circle-inner","bg-active"],["xmlns","http://www.w3.org/2000/svg","width","279.5","height","268.79","viewBox","0 0 279.5 268.79",1,"pentagon"],["d","M856.134,1644.16a30,30,0,0,1-35.268,0L711.1,1564.41a30.009,30.009,0,0,1-10.9-33.55l41.926-129.04a30,30,0,0,1,28.532-20.73H906.338a30,30,0,0,1,28.532,20.73L976.8,1530.86a30.009,30.009,0,0,1-10.9,33.55Z","transform","translate(-698.75 -1381.09)"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 448 512","fill","white"],["d","M413.505 91.951L133.49 371.966l-98.995-98.995c-4.686-4.686-12.284-4.686-16.971 0L6.211 284.284c-4.686 4.686-4.686 12.284 0 16.971l118.794 118.794c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-11.314-11.314c-4.686-4.686-12.284-4.686-16.97 0z"]],template:function(r,s){r&1&&(n(0,"div",1),u(1,Vr,2,0,"h2",2)(2,jr,24,17,"div",3),i(),u(3,$r,2,1,"div",4)(4,es,4,2,"section",5)(5,is,11,2,"ng-template",null,0,L)),r&2&&(a(),o("ngIf",!s.directDebitSetup&&!s.unmeasuredPlanSetup&&s.customer.balance),a(),o("ngIf",!s.directDebitSetup&&!s.unmeasuredPlanSetup),a(),o("ngIf",!s.directDebitSetup&&!s.unmeasuredPlanSetup),a(),o("ngIf",s.directDebitSetup||s.unmeasuredPlanSetup))},dependencies:[F,H,I,Re,st,R,be],styles:[".card-deck[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{min-width:300px}.current-label[_ngcontent-%COMP%]{position:absolute;top:-13px;right:-10px;font-weight:500}"]});let t=l;return t})();function os(t,l){t&1&&(n(0,"alert",22),c(1," You have a credit balance which we use to lower your monthly payment amount. It's likely
6your payments will increase on your next bill to be more in-line with your monthly usage. Any changes to your plan will be shown here and on your bill. "),i())}function ls(t,l){t&1&&(n(0,"alert",23),c(1," To calculate your plan, we work out what you would owe if you were billed today and add this to your balance. Your recommended monthly payment includes paying towards this calculated balance and also keeping up with your monthly usage. "),i())}function rs(t,l){if(t&1){let e=v();n(0,"app-good-payg",24),f("status",function(r){y(e);let s=p(4);return h(s.getMessage(r))}),i()}if(t&2){let e=p(4);o("customer",e.customer)("parentSubject",e.parentSubject)}}function ss(t,l){if(t&1){let e=v();n(0,"app-change-payg",24),f("status",function(r){y(e);let s=p(4);return h(s.getMessage(r))}),i()}if(t&2){let e=p(4);o("customer",e.customer)("parentSubject",e.parentSubject)}}function ms(t,l){if(t&1){let e=v();n(0,"app-new-payg",25),f("status",function(r){y(e);let s=p(4);return h(s.getMessage(r))}),i()}if(t&2){let e=p(4);o("customer",e.customer)("showBreakDown",e.showBreakDown)("parentSubject",e.parentSubject)}}function cs(t,l){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2",16),c(3,"Your Pay As You Go plan"),i(),n(4,"p",17),c(5," Our Pay As You Go plan lets you spread the cost of your bill, taking into account any credit or debit balance. The aim is that when your bill is produced, your credit will go towards the bill and your balance will be close to \xA30.00 "),u(6,os,2,0,"alert",18)(7,ls,2,0,"alert",19),i(),u(8,rs,1,2,"app-good-payg",20)(9,ss,1,2,"app-change-payg",20)(10,ms,1,3,"app-new-payg",21),i()()),t&2){let e=p(3);a(6),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance)<0&&((e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.onPAYG)&&(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.currentPaymentAmount)<(e.customer==null?null:e.customer.payAsYouGo.monthlyUsage)||!(!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.onPAYG)&&(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount)<(e.customer==null?null:e.customer.payAsYouGo.monthlyUsage))),a(),o("ngIf",(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.balance)>0&&(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.includesBillUpToDate)&&(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.recommendedAmount)>(e.customer==null?null:e.customer.payAsYouGo.monthlyUsage)),a(),o("ngIf",e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.payingCorrectAmount),a(),o("ngIf",!(!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.payingCorrectAmount)&&(e.customer==null||e.customer.payAsYouGo==null?null:e.customer.payAsYouGo.onPAYG)),a(),o("ngIf",!(!(e.customer==null||e.customer.payAsYouGo==null)&&e.customer.payAsYouGo.onPAYG))}}function ps(t,l){t&1&&(n(0,"alert",26),c(1," We're already in the process of taking your next direct debit payment and unfortunately it's probably too late to change it. If you make any changes it will take effect once this payment has been made. "),i())}function us(t,l){if(t&1&&(n(0,"div",11),u(1,cs,11,5,"div",12)(2,ps,2,0,"alert",13),i()),t&2){let e=p(2);o("collapse",e.directDebitSetup||e.paymentDayUpdate||e.showUpdate||e.paymentOnBillUpdate||e.cashPaymentOnBillUpdate||e.cashSetup||e.affordabilityPlanSetup||e.hideTop)("isAnimated",!0),a(),o("ngIf",(e.customer==null?null:e.customer.supplyType)==="MEASURED"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.workingDaysToNextPayment)>=0&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.workingDaysToNextPayment)<5&&(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit")}}function ds(t,l){if(t&1){let e=v();n(0,"div",30)(1,"div",15)(2,"button",31),f("click",function(){y(e);let r=p(3);return h(r.onhideBreakDownUpdate())}),n(3,"strong"),d(4,"i",32),c(5," hide"),i()()()()}}function ys(t,l){if(t&1&&(n(0,"section",27)(1,"div",28),u(2,ds,6,0,"div",29),i()()),t&2){let e=p(2);a(2),o("ngIf",e.showBreakDown)}}function hs(t,l){if(t&1){let e=v();n(0,"app-closed-account-plans",36),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}if(t&2){let e=p(3);o("customer",e.customer)}}function _s(t,l){if(t&1){let e=v();n(0,"app-unmeasured-plans",37),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))})("directDebitSetupObj",function(r){y(e);let s=p(3);return h(s.ddChange(r))}),i()}if(t&2){let e=p(3);o("customer",e.customer)}}function fs(t,l){if(t&1&&(n(0,"section",33),u(1,hs,1,1,"app-closed-account-plans",34)(2,_s,1,1,"app-unmeasured-plans",35),i()),t&2){let e=p(2);a(),o("ngIf",e.customer&&(e.customer.movedOutDate||!e.customer.movedInDate)),a(),o("ngIf",e.customer&&!e.customer.movedOutDate&&e.customer.movedInDate)}}function vs(t,l){if(t&1){let e=v();n(0,"app-breakdown-payg",39),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}}function gs(t,l){if(t&1&&(n(0,"section")(1,"div",28),u(2,vs,1,0,"app-breakdown-payg",38),i()()),t&2){let e=p(2);Ae("mt-3 py-8 ",e.company==="LEF"?"bg-secondary-light":"bg-primary",""),a(2),o("ngIf",e.showBreakDown)}}function bs(t,l){if(t&1){let e=v();n(0,"app-direct-debit-setup",43),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}if(t&2){let e=p(3);o("acceptIdeal",e.acceptIdeal)("ddOnBill",e.ddOnBill)("paymentValues",e.paymentValues)}}function Cs(t,l){if(t&1){let e=v();n(0,"app-update-payg",39),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}}function Ss(t,l){if(t&1){let e=v();n(0,"app-buttons-payg",36),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}if(t&2){let e=p(3);o("customer",e.customer)}}function xs(t,l){if(t&1){let e=v();n(0,"app-payment-day-update",39),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}}function Ps(t,l){if(t&1){let e=v();n(0,"app-pay-on-bill",39),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}}function Ds(t,l){if(t&1){let e=v();n(0,"app-cash-on-bill",39),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}}function ws(t,l){if(t&1){let e=v();n(0,"app-cash-setup",39),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))}),i()}}function Es(t,l){if(t&1){let e=v();n(0,"app-unmeasured-affordability-setup",44),f("status",function(r){y(e);let s=p(3);return h(s.getMessage(r))})("directDebitSetup",function(r){y(e);let s=p(3);return h(s.ddChange(r))}),i()}}function ks(t,l){if(t&1&&(n(0,"section",40)(1,"div",28),u(2,bs,1,3,"app-direct-debit-setup",41)(3,Cs,1,0,"app-update-payg",38)(4,Ss,1,1,"app-buttons-payg",34)(5,xs,1,0,"app-payment-day-update",38)(6,Ps,1,0,"app-pay-on-bill",38)(7,Ds,1,0,"app-cash-on-bill",38)(8,ws,1,0,"app-cash-setup",38)(9,Es,1,0,"app-unmeasured-affordability-setup",42),i()()),t&2){let e=p(2);a(2),o("ngIf",e.directDebitSetup),a(),o("ngIf",e.showUpdate),a(),o("ngIf",!e.directDebitSetup&&!e.paymentDayUpdate&&!e.showUpdate&&!e.paymentOnBillUpdate&&!e.cashPaymentOnBillUpdate&&!e.cashSetup&&!e.affordabilityPlanSetup&&(!e.customer||!(e.customer!=null&&e.customer.supplyType)||(e.customer==null?null:e.customer.supplyType)==="MEASURED")),a(),o("ngIf",e.paymentDayUpdate),a(),o("ngIf",e.paymentOnBillUpdate),a(),o("ngIf",e.cashPaymentOnBillUpdate),a(),o("ngIf",e.cashSetup),a(),o("ngIf",e.affordabilityPlanSetup)}}function As(t,l){if(t&1){let e=v();n(0,"div",52)(1,"button",53),f("click",function(){y(e);let r=p(5);return h(r.startForm("affordabilityPlanSetup"))}),c(2," Affordability plan "),i()()}t&2&&(a(),o("pageScrollDuration",100))}function Ts(t,l){t&1&&(n(0,"span"),c(1,"Change to pay when billed"),i())}function Is(t,l){t&1&&(n(0,"span"),c(1,"Pay DD when billed"),i())}function Ms(t,l){if(t&1){let e=v();n(0,"div",52)(1,"button",53),f("click",function(){y(e);let r=p(5);return h(r.startForm("paymentOnBillUpdate"))}),u(2,Ts,2,0,"span",1)(3,Is,2,0,"span",1),i()()}if(t&2){let e=p(5);
6a(),o("pageScrollDuration",100),a(),o("ngIf",e.application!=="CRM"),a(),o("ngIf",e.application==="CRM")}}function Bs(t,l){if(t&1){let e=v();n(0,"div",56)(1,"button",57),f("click",function(){y(e);let r=p(5);return h(r.startForm("cashPaymentOnBillUpdate"))}),c(2," Pay cash when billed "),i()()}t&2&&o("pageScrollDuration",100)}function Os(t,l){if(t&1){let e=v();n(0,"div")(1,"div",15)(2,"div",48)(3,"h5",49),d(4,"i",50),c(5," Smart move paying by Direct Debit! Most of our customers do too as it's the simplest and most convenient way to pay. You can update your bank details or change the day the money comes out of your account by clicking below. "),i(),n(6,"div",51)(7,"div",52)(8,"button",53),f("click",function(){y(e);let r=p(4);return h(r.startForm("directDebitSetup"))}),c(9," Change bank account details "),i()(),u(10,As,3,1,"div",54),n(11,"div",52)(12,"button",53),f("click",function(){y(e);let r=p(4);return h(r.startForm("paymentDayUpdate"))}),c(13," Change your payment day "),i()(),u(14,Ms,4,3,"div",54)(15,Bs,3,1,"div",55),i()()()()}if(t&2){let e=p(4);Ae("card ",e.company==="LEF"?"border-secondary":"border-primary"," border mb-3"),a(8),o("pageScrollDuration",100),a(2),o("ngIf",(e.customer==null?null:e.customer.supplyType)!=="MEASURED"&&e.application==="CRM"),a(2),o("pageScrollDuration",100),a(2),o("ngIf",(e.customer==null?null:e.customer.supplyType)==="MEASURED"&&(e.customer==null?null:e.customer.paymentPlan.paymentType)!=="Due At Billing"),a(),o("ngIf",e.application==="CRM"&&(e.customer==null?null:e.customer.supplyType)==="MEASURED"&&((e.customer==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"||(e.customer==null?null:e.customer.paymentPlan.paymentType)!=="Due At Billing"))}}function Vs(t,l){t&1&&(n(0,"span"),c(1,"Most of our customers prefer to pay using Direct Debit, you can either choose to pay monthly on our Pay As You Go plan at no extra cost which you can see above or pay when we bill you. "),i())}function Gs(t,l){t&1&&(n(0,"span"),c(1,"Most of our customers prefer to pay using Direct Debit, you can either choose to pay by instalments or pay when in one payment when you are billed "),i())}function Fs(t,l){if(t&1){let e=v();n(0,"button",62),f("click",function(){y(e);let r=p(5);return h(r.startForm("affordabilityPlanSetup"))}),c(1," Affordability plan "),i()}t&2&&o("pageScrollDuration",100)}function Ys(t,l){if(t&1){let e=v();n(0,"button",63),f("click",function(){y(e);let r=p(5);return h(r.startForm("directDebitOnBillSetup"))}),c(1," Set up a Direct Debit to pay on bill "),i()}}function Us(t,l){if(t&1){let e=v();n(0,"button",64),f("click",function(){y(e);let r=p(5);return h(r.startForm("cashPaymentOnBillUpdate"))}),c(1," Pay cash when billed "),i()}}function Rs(t,l){if(t&1){let e=v();n(0,"div")(1,"div",48)(2,"h4"),c(3," Have you considered setting up a Direct Debit with us? "),i(),u(4,Vs,2,0,"span",1)(5,Gs,2,0,"span",1),d(6,"br"),u(7,Fs,2,1,"button",58)(8,Ys,2,0,"button",59)(9,Us,2,0,"button",60),n(10,"button",61),f("click",function(){y(e);let r=p(4);return h(r.startForm("paymentDayUpdate"))}),c(11," Change your payment day "),i()()()}if(t&2){let e=p(4);Ae("card ",e.company==="LEF"?"border-secondary":"border-primary",""),a(2),ft(e.company==="MUA"||e.company==="ICOSA"?"text-secondary-light":"text-primary"),a(2),o("ngIf",(e.customer==null?null:e.customer.supplyType)==="MEASURED"),a(),o("ngIf",(e.customer==null?null:e.customer.supplyType)!=="MEASURED"),a(2),o("ngIf",(e.customer==null?null:e.customer.supplyType)!=="MEASURED"&&e.application==="CRM"),a(),o("ngIf",(e.customer==null?null:e.customer.supplyType)==="MEASURED"),a(),o("ngIf",e.application==="CRM"&&(e.customer==null?null:e.customer.supplyType)==="MEASURED"&&(e.customer==null?null:e.customer.paymentPlan.paymentType)!=="Due At Billing"),a(),o("pageScrollDuration",100)}}function Ns(t,l){if(t&1&&(n(0,"div",28)(1,"h2",47),c(2,"Other payment options"),i(),n(3,"div",30)(4,"div",15),u(5,Os,16,8,"div",6)(6,Rs,12,12,"div",6),i()()()),t&2){let e=p(3);a(5),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)==="Bank Direct Debit"),a(),o("ngIf",(e.customer==null||e.customer.paymentPlan==null?null:e.customer.paymentPlan.paymentMethod)!=="Bank Direct Debit")}}function qs(t,l){if(t&1&&(n(0,"section",45),u(1,Ns,7,2,"div",46),i()),t&2){let e=p(2);Ae("py-8 ",e.company==="LEF"?"bg-secondary-light":"bg-primary",""),o("collapse",e.directDebitSetup||e.paymentDayUpdate||e.showUpdate||e.paymentOnBillUpdate||e.cashPaymentOnBillUpdate||e.cashSetup||e.affordabilityPlanSetup||e.hideTop)("isA
6nimated",!0),a(),o("ngIf",!e.requestACallBack)}}function js(t,l){if(t&1&&d(0,"app-campaign",66),t&2){let e=l.$implicit;o("campaign",e)}}function Ls(t,l){if(t&1&&(n(0,"section"),u(1,js,1,1,"app-campaign",65),i()),t&2){let e=p(2);a(),o("ngForOf",e.campaigns)}}function Hs(t,l){if(t&1){let e=v();n(0,"app-request-a-call-back",67),f("status",function(r){y(e);let s=p(2);return h(s.getMessage(r))}),i()}t&2&&o("defaultOption","Payment Plans")}function zs(t,l){if(t&1&&(n(0,"div"),u(1,us,3,4,"div",3)(2,ys,3,1,"section",4)(3,fs,3,2,"section",5)(4,gs,3,4,"section",6)(5,ks,10,8,"section",7)(6,qs,2,6,"section",8)(7,Ls,2,1,"section",1),n(8,"section",9),u(9,Hs,1,1,"app-request-a-call-back",10),i()()),t&2){let e=p();a(),o("ngIf",!e.requestACallBack),a(),o("ngIf",!e.requestACallBack),a(),o("ngIf",(e.customer==null?null:e.customer.supplyType)!=="MEASURED"&&!e.directDebitSetup&&!e.paymentDayUpdate&&!e.requestACallBack&&!e.cashPaymentOnBillUpdate&&!e.cashSetup&&!e.affordabilityPlanSetup),a(),o("ngIf",e.showBreakDown),a(),o("ngIf",!e.requestACallBack),a(),o("ngIf",!e.requestACallBack),a(),o("ngIf",!e.requestACallBack),a(2),o("ngIf",e.requestACallBack)}}function Ws(t,l){t&1&&(n(0,"alert",71),c(1," Please pass the customer to the collections team as we are unable to adjust their payment plan without collections talking to them. "),i())}function Qs(t,l){t&1&&(n(0,"alert",72),c(1," Please give us a call to discuss you payment plan and any changes you'd like to make. "),i())}function Js(t,l){if(t&1&&(n(0,"div",68),u(1,Ws,2,0,"alert",69)(2,Qs,2,0,"alert",70),i()),t&2){let e=p();a(),o("ngIf",e.application==="CRM"),a(),o("ngIf",e.application!=="CRM")}}var Kt=(()=>{let l=class l{constructor(m,r,s,g,C,P,k,V){this.paymentDueService=m,this.customerService=r,this.alertService=s,this.pageScrollService=g,this.document=C,this.analyticsService=P,this.activatedRoute=k,this.contactDetailsService=V,this.status=new T,this.manualRefresh=new Xe,this.requestACallBack=!1,this.faSmileWink=Ce,this.faExclamationTriangle=xe,this.faQuestionCircle=Se,this.faCalendarDay=Pe,this.directDebitSetup=!1,this.paymentDayUpdate=!1,this.paymentOnBillUpdate=!1,this.cashPaymentOnBillUpdate=!1,this.cashSetup=!1,this.affordabilityPlanSetup=!1,this.paymentsDue=[],this.showBreakDown=!1,this.showUpdate=!1,this.acceptIdeal=!1,this.alerts=[],this.campaigns=[],this.monthlyUsage=0,this.minimumValue=0,this.recommendedPayment=0,this.hideMessages=!1,this.ddOnBill=!1,this.hideTop=!1,this.paymentValues=null,this.company=D.company,this.application=D.application,this.parentSubject=new Xe,this.contactMethod="",this.eventTelephoneNumber="",this.eventCallerName=""}ngOnInit(){this.analyticsService.pageView("payment-options-form","./payment-options-form","payment options form"),this.paymentDueSubscription=this.paymentDueService.paymentsDueChange.subscribe(m=>{this.paymentsDue=m}),this.paymentsDue=this.paymentDueService.getPaymentsDue(),this.customerSubscription=this.customerService.customerChange.subscribe(m=>{this.customer=m,this.hideTop=!1,this.alerts=this.customerService.getAlerts("paymentoptions"),this.campaigns=this.customerService.getCampaigns("paymentoptions")}),this.alertSubscription=this.alertService.alertChange.subscribe(m=>{this.alerts=m}),this.customer=this.customerService.getCustomer(),this.alerts=this.customerService.getAlerts("paymentoptions"),this.campaigns=this.customerService.getCampaigns("paymentoptions"),this.alerts=this.alertService.getAlert(),this.contactMethod=this.activatedRoute.snapshot.queryParamMap.get("contactMethod")?this.activatedRoute.snapshot.queryParamMap.get("contactMethod"):"Y",this.eventTelephoneNumber=this.activatedRoute.snapshot.queryParamMap.get("telephoneNumber"),this.eventCallerName=this.activatedRoute.snapshot.queryParamMap.get("callerName"),(this.contactMethod||this.eventTelephoneNumber||this.eventCallerName)&&(this.contactDetailsService.setContactMethod(this.contactMethod),this.contactDetailsService.setEventCallerName(this.eventCallerName),this.contactDetailsService.setEventTelephoneNumber(this.eventTelephoneNumber))}ngOnDestroy(){this.paymentDueSubscription.unsubscribe(),this.customerSubscription.unsubscribe()}getMessage(m){m=="hide top"&&(this.hideTop=!0),m=="cancel"&&(this.directDebitSetup=!1,this.paymentDayUpdate=!1,this.paymentOnBillUpdate=!1,this.cashPaymentOnBillUpdate=!1,this.cashSetup=!1,this.affordabilityPlanSetup=!1,this.hideTop=!1,this.showUpdate=!1,this.hideMessages=!1,setTimeout(()=>{this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})},100)),m=="hide"&&(this.hideMessages=!0,this.showBreakDown=!1),m=="show"&&(this.hideMessages=!1),m=="show breakdown"&&(this.showBreakDown=!0),m=="callback"?(this.requestACallBack=!0,this.pageScrollService.scroll({document:this.document,scrollTarget:"#topnav",duration:100})):this.requestACallBack=!1,m=="show update"&&(this.showUpdate=!0,this.showBreakDown=!1,this.hideMessages=!0),m=="show ddform"&&(this.directDebitSetup=!0,this.acceptIdeal=!0,this.showBreakDown=!1,this.hideMessages=!0)}startForm(m){m=="directDebitSetup"&&(this.acceptIdeal=!1,this.ddOnBill=!1,this.directDebitSetup=!0,this.showBreakDown=!1),m=="directDebitOnBillSetup"&&(this.ddOnBill=!0,this.acceptIdeal=!1,this.directDebitSetup=!0,this.showBreakDown=!1),m=="paymentDayUpdate"&&(this.paymentDayUpdate=!0,this.showBreakDown=!1),m=="paymentOnBillUpdate"&&(this.paymentOnBillUpdate=!0,this.showBreakDown=!1),m=="cashPaymentOnBillUpdate"&&(this.cashPaymentOnBillUpdate=!0,this.showBreakDown=!1),m=="cashSetup"&&(this.cashSetup=!0,this.showBreakDown=!1),m=="affordabilityPlanSetup"&&(this.affordabilityPlanSetup=!0,this.showBreakDown=!1)}ddChange(m){m!==null&&(this.paymentValues=m,this.directDebitSetup=!0)}onhideBreakDownUpdate(){this.showUpdate=!1,this.showBreakDown=!1,this.hideMessages=!1,this.parentSubject.next("hidden breakdown"),this.pageScrollService.scroll({document:this.document,scrollTarget:"#paygHeading",duration:100})}};l.\u0275fac=function(r){return new(r||l)(_(Qe),_(Y),_(ze),_(U),_(G),_(te),_(W),_(Q))},l.\u0275cmp=A({type:l,selectors:[["app-payment-options-form"]],outputs:{status:"status"},decls:3,vars:5,consts:[[3,"alerts","showWelcome","pageHeader"],[4,"ngIf"],["class","container text-center py-5",4,"ngIf"],["class","container pt-3",3,"collapse","isAnimated",4,"ngIf"],["class","mt-5",4,"ngIf"],["class","mt-3",4,"ngIf"],[3,"class",4,"ngIf"],["id","x","class","bg-info mt-5",4,"ngIf"],[3,"class","collapse","isAnimated",4,"ngIf"],[1,"container"],[3,"defaultOption","status",4,"ngIf"],[1,"container","pt-3",3,"collapse","isAnimated"],["class","pt-3 row",4,"ngIf"],["type","warning mb-0 my-4",4,"ngIf"],[1,"pt-3","row"],[1,"col-12"],["id","paygHeading"],[1,"callout","callout-primary"],["type","success mb-0 mt-4",4,"ngIf"],["type","warning mb-0 mt-4",4,"ngIf"],[3,"customer","parentSubject","status",4,"ngIf"],[3,"customer","showBreakDown","parentSubject","status",4,"ngIf"],["type","success mb-0 mt-4"],["type","warning mb-0 mt-4"],[3,"status","customer","parentSubject"],[3,"status","customer","showBreakDown","parentSubject"],["type","warning mb-0 my-4"],[1,"mt-5"],[1,"container","pt-3"],["class","row",4,"ngIf"],[1,"row"],["
6id","goBack","name","goBack",1,"text-success","h5","btn","btn-lg","btn-link","p-0","float-right",3,"click"],[1,"far","fa-chevron-left"],[1,"mt-3"],[3,"customer","status",4,"ngIf"],[3,"customer","status","directDebitSetupObj",4,"ngIf"],[3,"status","customer"],[3,"status","directDebitSetupObj","customer"],[3,"status",4,"ngIf"],[3,"status"],["id","x",1,"bg-info","mt-5"],[3,"acceptIdeal","ddOnBill","paymentValues","status",4,"ngIf"],[3,"status","directDebitSetup",4,"ngIf"],[3,"status","acceptIdeal","ddOnBill","paymentValues"],[3,"status","directDebitSetup"],[3,"collapse","isAnimated"],["class","container pt-3",4,"ngIf"],[1,"text-center"],[1,"card-body"],[1,"card-title"],[1,"far","fa-check-circle","text-success","fa-2x","align-middle"],[1,"row","justify-content-center"],[1,"col-lg-4","my-1"],["href","#topnav","pageScroll","",1,"btn","h-100","btn-dark","btn-block",3,"click","pageScrollDuration"],["class","col-lg-4 my-1",4,"ngIf"],["class","col-lg-4 my-1","href","#topnav","pageScroll","",3,"pageScrollDuration",4,"ngIf"],["href","#topnav","pageScroll","",1,"col-lg-4","my-1",3,"pageScrollDuration"],[1,"btn","h-100","btn-dark","btn-block",3,"click"],["class","btn btn-dark float-right","href","#topnav","pageScroll","",3,"pageScrollDuration","click",4,"ngIf"],["class","btn btn-dark float-right",3,"click",4,"ngIf"],["class","btn btn-dark float-right mr-1",3,"click",4,"ngIf"],["href","#topnav","pageScroll","",1,"btn","btn-dark","float-right","mr-1",3,"click","pageScrollDuration"],["href","#topnav","pageScroll","",1,"btn","btn-dark","float-right",3,"click","pageScrollDuration"],[1,"btn","btn-dark","float-right",3,"click"],[1,"btn","btn-dark","float-right","mr-1",3,"click"],[3,"campaign",4,"ngFor","ngForOf"],[3,"campaign"],[3,"status","defaultOption"],[1,"container","text-center","py-5"],["type","danger text-white h4 mb-0 mt-4",4,"ngIf"],["type","warning text-white h4 mb-0 mt-4",4,"ngIf"],["type","danger text-white h4 mb-0 mt-4"],["type","warning text-white h4 mb-0 mt-4"]],template:function(r,s){r&1&&(d(0,"app-page-head",0),u(1,zs,10,8,"div",1)(2,Js,3,2,"div",2)),r&2&&(o("alerts",s.alerts)("showWelcome",!1)("pageHeader","Payments settings"),a(),o("ngIf",!(s.customer!=null&&s.customer.specialArrangements)),a(),o("ngIf",s.customer==null?null:s.customer.specialArrangements))},dependencies:[xt,Pt,H,I,se,nt,St,it,Bt,Ot,Vt,Re,Ft,Yt,Rt,qt,zt,Qt,Jt,Xt,$t,Zt],styles:[".pricing-header[_ngcontent-%COMP%]{max-width:700px}.card-deck[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{min-width:250px}"]});let t=l;return t})();var Xs=()=>ht(t=>t?!0:["auth/login"]),$s=[{path:"",component:Kt,data:{authGuardPipe:Xs},canActivate:[Et],resolve:{settings:dt}}],en=(()=>{let l=class l{};l.\u0275fac=function(r){return new(r||l)},l.\u0275mod=et({type:l}),l.\u0275inj=Ke({providers:[dt],imports:[ut.forChild($s),ut]});let t=l;return t})();var Hu=(()=>{let l=class l{};l.\u0275fac=function(r){return new(r||l)},l.\u0275mod=et({type:l}),l.\u0275inj=Ke({imports:[en,At,Tt,Mt]});let t=l;return t})();export{Hu as PaymentOptionsFormModule};
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.