PageSourceSearch

https://clients.mymoneysage.in/1945.6afef06c4e0382ad.js

js mymoneysage.in collected 2026-09-30 17:27:36 UTC 69,490 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmyplanner=self.webpackChunkmyplanner||[]).push([[1945],{36462:(K,Y,l)=>{l.d(Y,{O:()=>ee});var d=l(13932),x=l(65730),C=l(67241),E=l(41074),O=l(70814),o=l(24096),_=l(1996),p=l(70661),t=l(94650),M=l(23767),I=l(65938),P=l(36895),F=l(4859),e=l(90811),G=l(28255),q=l(24006),L=l(81638),R=l(21112),y=l(73555);function S(m,T){1&m&&t._UZ(0,"img",29)}function f(m,T){if(1&m&&(t.TgZ(0,"mat-button-toggle",25)(1,"div",6)(2,"div",26),t.YNc(3,S,1,0,"img",27),t.qZA(),t.TgZ(4,"div",28),t._uU(5),t.qZA()()()),2&m){const c=T.$implicit,n=t.oxw();t.Q6J("value",c.familyMemberId),t.xp6(3),t.Q6J("ngIf",c.familyMemberId==n.currentFamilyFilter),t.xp6(2),t.hij(" ",c.displayName," ")}}function D(m,T){1&m&&t._UZ(0,"img",29)}function A(m,T){if(1&m&&(t.TgZ(0,"mat-button-toggle",25)(1,"div",6)(2,"div",30),t.YNc(3,D,1,0,"img",27),t.qZA(),t.TgZ(4,"div",28),t._uU(5),t.qZA()()()),2&m){const c=T.$implicit,n=t.oxw();t.Q6J("value",c.filter),t.xp6(3),t.Q6J("ngIf",c.filter==n.currentAllocationFilter),t.xp6(2),t.hij(" ",c.name," ")}}function v(m,T){1&m&&t._UZ(0,"img",29)}function U(m,T){if(1&m&&(t.TgZ(0,"mat-button-toggle",25)(1,"div",6)(2,"div",30),t.YNc(3,v,1,0,"img",27),t.qZA(),t.TgZ(4,"div",31),t._uU(5),t.qZA()()()),2&m){const c=T.$implicit,n=t.oxw();t.Q6J("value",c.sortKey),t.xp6(3),t.Q6J("ngIf",c.sortKey==n.currentSort),t.xp6(2),t.hij(" ",c.name," ")}}function N(m,T){if(1&m&&(t.TgZ(0,"div",32)(1,"div",33)(2,"div",6)(3,"div",34)(4,"div",35),t._UZ(5,"div",36),t.qZA()()(),t.TgZ(6,"div",6)(7,"div",5)(8,"div",37),t._UZ(9,"div",36),t.qZA()(),t.TgZ(10,"div",38)(11,"div",39),t._UZ(12,"div",36),t.qZA(),t.TgZ(13,"div",39),t._UZ(14,"div",36),t.qZA(),t.TgZ(15,"div",39),t._UZ(16,"div",36),t.qZA()()()(),t.TgZ(17,"div",33)(18,"div",6)(19,"div",34)(20,"div",35),t._UZ(21,"div",36),t.qZA()()(),t.TgZ(22,"div",6)(23,"div",5)(24,"div",37),t._UZ(25,"div",36),t.qZA()(),t.TgZ(26,"div",38)(27,"div",39),t._UZ(28,"div",36),t.qZA(),t.TgZ(29,"div",39),t._UZ(30,"div",36),t.qZA(),t.TgZ(31,"div",39),t._UZ(32,"div",36),t.qZA()()()(),t.TgZ(33,"div",33)(34,"div",6)(35,"div",34)(36,"div",35),t._UZ(37,"div",36),t.qZA()()(),t.TgZ(38,"div",6)(39,"div",5)(40,"div",37),t._UZ(41,"div",36),t.qZA()(),t.TgZ(42,"div",38)(43,"div",39),t._UZ(44,"div",36),t.qZA(),t.TgZ(45,"div",39),t._UZ(46,"div",36),t.qZA(),t.TgZ(47,"div",39),t._UZ(48,"div",36),t.qZA()()()()()),2&m){const c=t.oxw();t.Q6J("appSkeletonLoading",c.isLoading)}}function j(m,T){1&m&&(t.TgZ(0,"div",40),t._UZ(1,"img",41),t.TgZ(2,"h4",42),t._uU(3," No data found "),t.qZA()())}function V(m,T){if(1&m&&(t.TgZ(0,"button",56),t._uU(1),t.qZA()),2&m){const c=t.oxw().$implicit;t.xp6(1),t.Oqu(c.MaturityYear)}}function W(m,T){1&m&&(t.TgZ(0,"button",56),t._uU(1,"-"),t.qZA())}function z(m,T){if(1&m&&(t.TgZ(0,"p",50),t._uU(1,"\u20b9"),t._UZ(2,"span",57),t.qZA()),2&m){const c=t.oxw().$implicit;t.xp6(2),t.Q6J("value",c.maturityValue1)}}function $(m,T){1&m&&(t.TgZ(0,"p",50)(1,"span",53),t._uU(2,"-"),t.qZA()())}const H=function(m,T,c){return{"btn-danger":m,"btn-primary":T,"btn-success":c}};function X(m,T){if(1&m&&(t.TgZ(0,"div",43)(1,"div",44)(2,"div",45)(3,"p",46),t._uU(4),t.qZA()(),t.TgZ(5,"div",6)(6,"div",5)(7,"button",47),t._uU(8),t.qZA(),t.YNc(9,V,2,1,"button",48),t.YNc(10,W,2,0,"button",48),t.qZA(),t.TgZ(11,"div",38)(12,"p",49),t._uU(13,"Owner"),t.qZA(),t.TgZ(14,"p",50),t._uU(15),t.qZA(),t.TgZ(16,"div",51)(17,"div",52)(18,"p",49),t._uU(19,"Current value"),t.qZA(),t.TgZ(20,"p",50),t._uU(21,"\u20b9"),t.TgZ(22,"span",53),t._uU(23),t.qZA()()(),t.TgZ(24,"div",54)(25,"p",49),t._uU(26,"Maturity value"),t.qZA(),t.YNc(27,z,3,1,"p",55),t.YNc(28,$,3,0,"p",55),t.qZA()()()()()()),2&m){const c=T.$implicit;t.Q6J("cdkDragData",c),t.xp6(4),t.Oqu(c.assetName),t.xp6(3),t.Q6J("ngClass",t.kEZ(10,H,100==c.absAllocation,c.absAllocation>0&&c.absAllocation<100,0==c.absAllocation)),t.xp6(1),t.hij(" ",100-c.absAllocation,"% "),t.xp6(1),t.Q6J("ngIf",0!=c.maturityValue),t.xp6(1),t.Q6J("ngIf",0==c.maturityValue),t.xp6(5),t.hij(" ",c.ownerInfoName?c.ownerInfoName:"-",""),t.xp6(8),t.Oqu(c.currentValue1),t.xp6(4),t.Q6J("ngIf",0!=c.maturityValue1),t.xp6(1),t.Q6J("ngIf",0==c.maturityValue1)}}let ee=(()=>{class m{constructor(c,n,b,Z,J,te,ae,ie,oe){this.subInjectService=c,this.goalService=n,this.loaderFn=b,this.eventService=Z,this.peopleService=J,this.planService=te,this.allocateService=ae,this.dialog=ie,this.roleService=oe,this.data={},this.popupHeaderText="KEY INFO",this.allAssetsList=[],this.familyList=[{familyMemberId:"all",displayName:"All"}],this.displayedAssets=[],this.currentAllocationFilter="all",this.currentFamilyFilter="all",this.currentSort="v-H2L",this.allocationBtnList=[{name:"All Assets",filter:"all"},{name:"Unallocated",filter:"unallocated"},{name:"Partially allocated",filter:"partially allocated"},{name:"Fully allocated",filter:"allocated"},{name:"Un-deployed",filter:"not-deployed"},{name:"Asset type",filter:"asset type"}],this.sortBtnList=[{name:"Value - high to low",sortKey:"v-H2L"},{name:"Value - low to high",sortKey:"v-L2H"},{name:"Asset type wise",sortKey:"asset"},{name:"Maturity - near to far",sortKey:"m-N2F"},{name:"Maturity - far to near",sortKey:"m-F2N"}],this.subscription=new o.w,this.isLoading=!0,this.show=!0,this.clientId=x.e.getClientId(),this.advisorId=x.e.getAdvisorId()}ngOnInit(){this.isLoading=!0,0===this.displayedAssets.length&&(this.noDataFound=!0),this.loaderFn.setFunctionToExeOnZero(this,this.filterAndSortAssets),this.getFamilyMembersList(),this.loadAssets(),this.subscription.add(this.planService.assetSubject.subscribe(c=>{this.allAssetsList=c.map(n=>{let b=0;return n.goalAssetMapping&&n.goalAssetMapping.forEach(Z=>{b<=99&&(b+=Z.percentAllocated)}),{absAllocation:b,...n}}),this.filterAndSortAssets()}))}loadAssets(){let c={advisorId:this.advisorId,clientId:this.clientId};this.loaderFn.increaseCounter(),this.goalService.getAssetsForAllocation(c).subscribe(n=>{this.allAssetsList=n,this.allAssetsList&&0!==this.allAssetsList.length?this.allAssetsList=this.allAssetsList.map(b=>{b.MaturityYear=new Date(b.maturityDate).getFullYear();let Z=0;return b.goalAssetMapping&&b.goalAssetMapping.forEach(J=>{Z<=99&&(Z+=J.percentAllocated)}),{absAllocation:Z,...b}}):this.showNoDataMessage=!0,this.loaderFn.decreaseCounter()},n=>{this.loaderFn.decreaseCounter(),this.eventService.openSnackBar(n,"Dismiss")})}getFamilyMembersList(){const c={clientId:this.clientId};this.loaderFn.increaseCounter(),this.peopleService.getClientFamilyMemberListAsset(c).subscribe(n=>{n&&n.length>0&&(this.familyList=n),this.familyList.unshift({familyMemberId:"all",displayName:"All"}),this.loaderFn.decreaseCounter()},n=>{this.eventService.openSnackBar(n,"Dismiss"),this.loaderFn.decreaseCounter()})}
1filterAndSortAssets(){this.filterByFamily(this.currentFamilyFilter),this.filterByAllocation(this.currentAllocationFilter),this.sortList()}filterByFamily(c){this.show=!1,this.isLoading=!1,-1==c.asset_owner_id?(this.displayedAssets=this.allAssetsList,this.displayedAssets.forEach(n=>n.maturityValue1=C.fK.getNumberToWord(n.maturityValue)),this.displayedAssets.forEach(n=>n.currentValue1=C.fK.getNumberToWord(n.currentValue))):"all"!=c?(this.displayedAssets=this.allAssetsList.filter(n=>n.familyMemberId===c),this.displayedAssets.forEach(n=>n.maturityValue1=C.fK.getNumberToWord(n.maturityValue)),this.displayedAssets.forEach(n=>n.currentValue1=C.fK.getNumberToWord(n.currentValue))):(this.displayedAssets=this.allAssetsList,this.displayedAssets.forEach(n=>n.maturityValue1=C.fK.getNumberToWord(n.maturityValue)),this.displayedAssets.forEach(n=>n.currentValue1=C.fK.getNumberToWord(n.currentValue)))}filterByAllocation(c){switch(c){case"all":this.displayedAssets=this.displayedAssets;break;case"unallocated":this.displayedAssets=this.displayedAssets.filter(n=>0==n.absAllocation);break;case"partially allocated":this.displayedAssets=this.displayedAssets.filter(n=>n.absAllocation>0&&n.absAllocation<100);break;case"allocated":this.displayedAssets=this.displayedAssets.filter(n=>100==n.absAllocation);break;case"not-deployed":this.displayedAssets=this.displayedAssets.filter(n=>!n.isDeployed);break;case"asset type":this.displayedAssets=this.displayedAssets.filter(n=>n.assetType);break;default:console.error("Invalid asset filter id found",c)}}sortList(){switch(this.currentSort){case"v-H2L":this.displayedAssets=this.displayedAssets.sort((c,n)=>n.currentValue-c.currentValue);break;case"v-L2H":this.displayedAssets=this.displayedAssets.sort((c,n)=>c.currentValue-n.currentValue);break;case"asset":this.displayedAssets=this.displayedAssets.sort((c,n)=>n.assetType-c.assetType);break;case"m-N2F":this.displayedAssets=this.displayedAssets.sort((c,n)=>c.maturityDate-n.maturityDate);break;case"m-F2N":this.displayedAssets=this.displayedAssets.sort((c,n)=>n.maturityDate-c.maturityDate)}}close(){this.subInjectService.changeNewRightSliderState({state:"close"})}}return m.\u0275fac=function(c){return new(c||m)(t.Y36(M.f),t.Y36(d.D),t.Y36(C.jo),t.Y36(E.P),t.Y36(O.g),t.Y36(d.D),t.Y36(_.b),t.Y36(I.uw),t.Y36(p.N))},m.\u0275cmp=t.Xpm({type:m,selectors:[["app-add-goal"]],inputs:{data:"data",popupHeaderText:"popupHeaderText"},features:[t._Bn([C.jo])],decls:36,vars:13,consts:[[1,"right-side-fixes-x"],[1,"right-sidenav-fixes-y"],[1,"row","bb-1","popup-header-fix","w-25"],[1,"col-md-6","p-0"],[1,"mb-0","wrapper-20"],[1,"col-md-4"],[1,"row"],[1,"col-md-6"],["src","https://res.cloudinary.com/futurewise/image/upload/v1619592699/myplanner/images/svg/people.svg",1,"pt-16","c-p",3,"matMenuTriggerFor"],["peopleMenu","matMenu"],["vertical","",3,"ngModel","change","ngModelChange"],["class","bt-0 h-48",3,"value",4,"ngFor","ngForOf"],["src","https://res.cloudinary.com/futurewise/image/upload/v1619592665/myplanner/images/svg/lines-3.svg",1,"pt-16","c-p",3,"matMenuTriggerFor"],["menu","matMenu"],["vertical","",1,"w-100",3,"ngModel","change","ngModelChange"],[1,"text-primitive","roboto","m-0","pl-12","pt-12","pb-12"],[1,"col-md-2","full-center"],[1,"material-icons","c-p",3,"click"],[1,"pt-72","pl-12","pr-12","pb-44","bl-1","h-full"],[1,"col-md-12","p-0","mb-8"],[1,"m-0","f-14","text-primary"],["class","skeletonAnimation","appSkeletonLoading","",3,"appSkeletonLoading",4,"ngIf"],["class","pt-100 pt-100 row justify-content-center align-items-center",4,"ngIf"],["cdkDropList","","cdkDropListConnectedTo","allottedList",3,"cdkDropListData","cdkDropListSortingDisabled"],["class","mb-12","cdkDrag","",3,"cdkDragData",4,"ngFor","ngForOf"],[1,"bt-0","h-48",3,"value"],[1,"col-md-3","pl-0"],["src","https://res.cloudinary.com/futurewise/image/upload/v1619592718/myplanner/images/svg/right.svg","class","c-p",4,"ngIf"],[1,"col-md-9","text-left","pl-0","f-14"],["src","https://res.cloudinary.com/futurewise/image/upload/v1619592718/myplanner/images/svg/right.svg",1,"c-p"],[1,"col-md-3"],[1,"col-md-9","text-left","f-14","pl-0"],["appSkeletonLoading","",1,"skeletonAnimation",3,"appSkeletonLoading"],[1,"goal-border","mb-8"],[1,"col-md-12"],[1,"relClass","mt-10","mb-10"],[1,"bar","height24"],[1,"relClass"],[1,"col-md-8"],[1,"relClass","mb-10"],[1,"pt-100","pt-100","row","
1justify-content-center","align-items-center"],["src","https://res.cloudinary.com/futurewise/image/upload/v1619592624/myplanner/images/svg/documents-empty-states.svg",1,"pt-100"],[1,"d-flex","justify-content-center","p-44","pt-10"],["cdkDrag","",1,"mb-12",3,"cdkDragData"],[1,"row","goal-border","pb-8"],[1,"col-md-12","pl-8","pt-8"],[1,"m-0","roboto","f-400"],["mat-stroked-button","",1,"br-0","mt-12","text-white","goal-box-btn",3,"ngClass"],["mat-stroked-button","","class","btn-default br-0 mt-12 mb-12 goal-box-btn",4,"ngIf"],[1,"m-0","f-12","roboto","text-primitive","f-400"],[1,"m-0","roboto","text-lighter","f-400"],[1,"row","w-100","pt-12"],[1,"col-md-6","pl-0","pr-0"],["appFormatNumber",""],[1,"col-md-6","pr-10","pl-0"],["class","m-0 roboto text-lighter f-400",4,"ngIf"],["mat-stroked-button","",1,"btn-default","br-0","mt-12","mb-12","goal-box-btn"],["appFormatNumber","",3,"value"]],template:function(c,n){if(1&c&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h4",4),t._uU(5,"ALLOCATIONS"),t.qZA()(),t.TgZ(6,"div",5)(7,"div",6)(8,"div",7),t._UZ(9,"img",8),t.TgZ(10,"mat-menu",null,9)(12,"mat-button-toggle-group",10),t.NdJ("change",function(){return n.filterAndSortAssets()})("ngModelChange",function(Z){return n.currentFamilyFilter=Z}),t.YNc(13,f,6,3,"mat-button-toggle",11),t.qZA()()(),t.TgZ(14,"div",7),t._UZ(15,"img",12),t.TgZ(16,"mat-menu",null,13)(18,"mat-button-toggle-group",14),t.NdJ("change",function(){return n.filterAndSortAssets()})("ngModelChange",function(Z){return n.currentAllocationFilter=Z}),t.YNc(19,A,6,3,"mat-button-toggle",11),t.qZA(),t.TgZ(20,"p",15),t._uU(21,"Sort"),t.qZA(),t.TgZ(22,"mat-button-toggle-group",14),t.NdJ("change",function(){return n.sortList()})("ngModelChange",function(Z){return n.currentSort=Z}),t.YNc(23,U,6,3,"mat-button-toggle",11),t.qZA()()()()(),t.TgZ(24,"div",16)(25,"i",17),t.NdJ("click",function(){return n.close()}),t._uU(26," clear "),t.qZA()()(),t.TgZ(27,"div",18)(28,"div",6)(29,"div",19)(30,"h5",20),t._uU(31,"Drag items & drop in goals section to allocate!"),t.qZA()()(),t.YNc(32,N,49,1,"div",21),t.YNc(33,j,4,0,"div",22),t.TgZ(34,"div",23),t.YNc(35,X,29,14,"div",24),t.qZA()()()()),2&c){const b=t.MAs(11),Z=t.MAs(17);t.xp6(9),t.Q6J("matMenuTriggerFor",b),t.xp6(3),t.Q6J("ngModel",n.currentFamilyFilter),t.xp6(1),t.Q6J("ngForOf",n.familyList),t.xp6(2),t.Q6J("matMenuTriggerFor",Z),t.xp6(3),t.Q6J("ngModel",n.currentAllocationFilter),t.xp6(1),t.Q6J("ngForOf",n.allocationBtnList),t.xp6(3),t.Q6J("ngModel",n.currentSort),t.xp6(1),t.Q6J("ngForOf",n.sortBtnList),t.xp6(9),t.Q6J("ngIf",n.show),t.xp6(1),t.Q6J("ngIf",n.showNoDataMessage),t.xp6(1),t.Q6J("cdkDropListData",n.displayedAssets)("cdkDropListSortingDisabled",!0),t.xp6(1),t.Q6J("ngForOf",n.displayedAssets)}},dependencies:[P.mk,P.sg,P.O5,F.lW,e.A9,e.Yi,G.VK,G.p6,q.JJ,q.On,L.d,R.R,y.Wj,y.Zt],styles:[".goal-border[_ngcontent-%COMP%]{border:1px solid #D9DEE1!important}.goal-box-btn[_ngcontent-%COMP%]{padding:0 8px!important;width:68px}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.cdk-drag-placeholder[_ngcontent-%COMP%]{display:none}.cdk-drag-preview[_ngcontent-%COMP%]{background:white}.height24[_ngcontent-%COMP%]{height:24px}"]}),m})()},68681:(K,Y,l)=>{l.d(Y,{P:()=>R});var d=l(24006),x=l(65938),C=l(13932),E=l(41074),O=l(1996),o=l(94650),_=l(36895),p=l(47873),t=l(4859),M=l(59549),I=l(284),P=l(84385),F=l(33152),e=l(93416);function G(y,S){if(1&y){const f=o.EpF();o.TgZ(0,"i",30),o.NdJ("click",function(){o.CHM(f);const A=o.oxw(2);return o.KtG(A.addMilestone(void 0))}),o._uU(1,"add"),o.qZA()}}function q(y,S){if(1&y){const f=o.EpF();o.TgZ(0,"i",30),o.NdJ("click",function(){o.CHM(f);const A=o.oxw(),v=A.index,U=A.$implicit,N=o.oxw();return o.KtG(N.removeMilestone(v,U))}),o._uU(1,"remove"),o.qZA()}}function L(y,S){if(1&y&&(o.TgZ(0,"div",14)(1,"div",15)(2,"div",16)(3,"div",17)(4,"h5",18),o._uU(5,"Planning"),o.qZA()(),o.TgZ(6,"div",19)(7,"mat-form-field")(8,"mat-select",20)(9,"mat-option",21),o._uU(10,"Select option "),o.qZA(),o.TgZ(11,"mat-option",22),o._uU(12,"Post retirement "),o.qZA(),o.TgZ(13,"mat-option",22),o._uU(14,"Demise"),o.qZA()(),o.TgZ(15,"mat-error",23),o._uU(16,"This field is required"),o.qZA()()()(),o.TgZ(17,"div",16)(18,"div",17)(19,"h5",18),o._uU(20,"Milestone type"),o.qZA()(),o.TgZ(21,"div",19)(22,"mat-form-field")(23,"mat-select",24)(24,"mat-option",21),o._uU(25,"Select option "),o.qZA(),o.TgZ(26,"mat-option",22),o._uU(27,"Philanthrophy"),o.qZA(),o.TgZ(28,"mat-option",22),o._uU(29,"Legacy"),o.qZA(),o.TgZ(30,"mat-option",22),o._uU(31,"Wealth creation "),o.qZA(),o.TgZ(32,"mat-option",22),o._uU(33,"New business"),o.qZA(),o.TgZ(34,"mat-option",22),o._uU(35,"Others"),o.qZA(),o.TgZ(36,"mat-option",22),o._uU(37,"Medical emergency"),o.qZA()(),o.TgZ(38,"mat-error",23),o._uU(39,"This field is required"),o.qZA()()()(),o.TgZ(40,"div",25)(41,"div",17)(42,"h5",18),o._uU(43,"Amount"),o.qZA()(),o.TgZ(44,"div",19)(45,"mat-form-field",26),o._UZ(46,"input",27),o.TgZ(47,"mat-error",23),o._uU(48,"This field is required"),o.qZA()()()(),o.TgZ(49,"div",28),o.YNc(50,G,2,0,"i",29),o.YNc(51,q,2,0,"i",29),o.qZA()()()),2&y){const f=S.index,D=o.oxw();o.Q6J("formGroupName",f),o.xp6(9),o.Q6J("value",0),o.xp6(2),o.Q6J("value",1),o.xp6(2),o.Q6J("value",2),o.xp6(11),o.Q6J("value",0),o.xp6(2),o.Q6J("value",1),o.xp6(2),o.Q6J("value",2),o.xp6(2),o.Q6J("value",3),o.xp6(2),o.Q6J("value",4),o.xp6(2),o.Q6J("value",5),o.xp6(2),o.Q6J("value",6),o.xp6(14),o.Q6J("ngIf",f+1==D.singleYearGoalForm.value.getMilestoneName.length&&f<2),o.xp6(1),o.Q6J("ngIf",D.singleYearGoalForm.value.getMilestoneName.length>1)}}let R=(()=>{class y{constructor(f,D,A,v,U,N){this.dialogRef=f,this.dialogData=D,this.fb=A,this.plansService=v,this.eventService=U,this.allocateOtherAssetService=N,this.barButtonOptions={active:!1,text:"SAVE",buttonColor:"accent",barColor:"accent",raised:!0,stroked:!1,mode:"determinate",value:10,disabled:!1,fullWidth:!1}}ngOnInit(){this.initializeForm()}initializeForm(){this.singleYearGoalForm=this.fb.group({}),this.dialogData.data.length>0?(this.singleYearGoalForm.addControl("getMilestoneName",this.fb.array([])),this.dialogData.data.forEach(f=>{this.getMilestoneName.push(this.fb.group({onRetirementOrDemise:[f.onRetirementOrDemise,[d.kI.required]],milestoneTypeId:[f.milestoneTypeId,[d.kI.required]],amount:[f.amount,d.kI.required],id:f.id}))})):1===this.dialogData.otherData.goalType&&this.singleYearGoalForm.addControl("getMilestoneName",this.fb.array([this.fb.group({onRetirementOrDemise:[0],milestoneTypeId:[0],amount:[0]})]))}get getMilestoneName(){return this.singleYearGoalForm.get("getMilestoneName")}removeMilestone(f,D){this.disabledMember(null,null),this.getMilestoneName.removeAt(f),D.value.id&&this.plansService.deleteMilestone({milestoneId:D.value.id}).subscribe(v=>{this.allocateOtherAssetService.refreshAssetList.next()},v=>{this.eventService.openSnackBar(v)}
1)}disabledMember(f,D){this.callMethod={methodName:"disabledMember",ParamValue:f,disControl:D}}addMilestone(f){this.getMilestoneName.push(this.fb.group({onRetirementOrDemise:[0],milestoneTypeId:[0],amount:[0]}))}saveMilestone(){const f=this.singleYearGoalForm.value.getMilestoneName.filter(A=>A.id),D=this.singleYearGoalForm.value.getMilestoneName.filter(A=>!A.id);if(f.length>0&&f.forEach(A=>{this.plansService.EditMilstone({onRetirementOrDemise:A.onRetirementOrDemise,milestoneTypeId:A.milestoneTypeId,amount:A.amount,id:A.id}).subscribe(U=>{this.allocateOtherAssetService.refreshAssetList.next(),this.eventService.openSnackBar("Milestone updated successfully"),this.dialogRef.close(!0)},U=>{this.eventService.openSnackBar(U)})}),D.length>0){let A={milestoneModels:[]};A.id=this.dialogData.otherData.remainingData.id,D.forEach(v=>{0!=v.onRetirementOrDemise&&(v.id=this.dialogData.otherData.remainingData.id,A.milestoneModels.push(v))}),this.plansService.saveMileStone(A).subscribe(v=>{this.allocateOtherAssetService.refreshObservable.next(),this.eventService.openSnackBar("Milestone added successfully"),this.dialogRef.close()},v=>{this.eventService.openSnackBar(v)})}}}return y.\u0275fac=function(f){return new(f||y)(o.Y36(x.so),o.Y36(x.WI),o.Y36(d.QS),o.Y36(C.D),o.Y36(E.P),o.Y36(O.b))},y.\u0275cmp=o.Xpm({type:y,selectors:[["app-add-milestone"]],decls:17,vars:3,consts:[[1,"popup-header-fix","w-35"],[1,"f-20","mb-0","pl-24","pt-12","pb-12","bb-1"],[1,"p-24"],[1,"row",3,"formGroup"],[1,"col-md-12","p-0"],[1,"pb-6","m-0","text-black"],["formArrayName","getMilestoneName"],["class","row",3,"formGroupName",4,"ngFor","ngForOf"],[1,"edit-footer","mt-52"],[1,"row"],[1,"col-md-7","pl-0","text-left"],[1,"col-md-5","pr-0","d-flex","align-items-center","justify-content-end"],["mat-button","","mat-dialog-close","",1,"text-primitive","mr-12","f-500"],[1,"br-0","text-inherit",3,"options","btnClick"],[1,"row",3,"formGroupName"],[1,"row","w-100","pt-16"],[1,"col-md-4","p-0"],[1,"pr-0","text-left"],[1,"m-0","pt-8","pb-6","f-14"],[1,"form-group"],["formControlName","onRetirementOrDemise",1,"form-control","br-0","br-none",2,"width","90% !important"],["disabled","",1,"",3,"value"],[1,"",3,"value"],[1,"f-12"],["formControlName","milestoneTypeId",1,"form-control","br-0","br-none",2,"width","90% !important"],[1,"col-md-3","p-0"],[1,"iconRupess"],["type","number","autocomplete","off","matInput","","formControlName","amount",1,"form-control","br-0","rupess",2,"width","80% !important"],[1,"col-md-1","d-flex","align-items-center","col-1","pr-0","pt-20"],["class"," material-icons\n                            f-20 c-p",3,"click",4,"ngIf"],[1,"material-icons","f-20","c-p",3,"click"]],template:function(f,D){1&f&&(o.TgZ(0,"div",0)(1,"h2",1),o._uU(2," ADD MILESTONE "),o.qZA()(),o.TgZ(3,"div",2)(4,"div",3)(5,"div",4)(6,"h5",5),o._uU(7,"Milestones you'd also like to plan for?"),o.qZA(),o.TgZ(8,"div",6),o.YNc(9,L,52,13,"div",7),o.qZA()()(),o.TgZ(10,"div",8)(11,"div",9),o._UZ(12,"div",10),o.TgZ(13,"div",11)(14,"button",12),o._uU(15,"Cancel"),o.qZA(),o.TgZ(16,"app-progress-button",13),o.NdJ("btnClick",function(){return D.saveMilestone()}),o.qZA()()()()()),2&f&&(o.xp6(4),o.Q6J("formGroup",D.singleYearGoalForm),o.xp6(5),o.Q6J("ngForOf",D.getMilestoneName.controls),o.xp6(7),o.Q6J("options",D.barButtonOptions))},dependencies:[_.sg,_.O5,p.ey,t.lW,x.ZT,M.TO,M.KE,I.Nt,P.gD,d.Fj,d.wV,d.JJ,d.JL,d.sg,d.u,d.x0,d.CE,F.k,e.l]}),y})()},86129:(K,Y,l)=>{l.d(Y,{h:()=>Je});var d=l(24006),x=l(41074),C=l(13932),E=l(67241),O=l(65923),o=l(71464),_=l(24096),p=l(43489),t=l(1996),M=l(93584),I=l(70661),P=l(65730),F=l(73799),e=l(94650),G=l(23767),q=l(36895),L=l(65938),R=l(47873),y=l(56709),S=l(99602),f=l(59549),D=l(284),A=l(84385),v=l(53626),U=l(3848),N=l(33152),j=l(55350),V=l(11411),W=l(93416);function z(s,u){1&s&&(e.TgZ(0,"div",88)(1,"p",21),e._uU(2,"Monthly expense PV"),e.qZA()())}function $(s,u){1&s&&(e.TgZ(0,"div",89)(1,"p",21),e._uU(2,"Goal amount FV"),e.qZA()())}function H(s,u){1&s&&(e.TgZ(0,"div",89)(1,"p",21),e._uU(2,"Goal amount PV"),e.qZA()())}function X(s,u){if(1&s&&(e.TgZ(0,"mat-option",93)(1,"span"),e._uU(2),e.qZA()()),2&s){const a=u.$implicit;e.Q6J("disabled",a.disable)("value",a.value),e.xp6(2),e.Oqu(a.name)}}function ee(s,u){if(1&s&&(e.TgZ(0,"div",12)(1,"div",20)(2,"p",21),e._uU(3,"Frequency "),e.qZA()(),e.TgZ(4,"div",15)(5,"div",22)(6,"mat-form-field")(7,"mat-form-field")(8,"mat-select",90)(9,"mat-option",91),e._uU(10,"Select option"),e.qZA(),e.YNc(11,X,3,3,"mat-option",92),e.qZA(),e.TgZ(12,"mat-error"),e._uU(13,"This field is required"),e.qZA()(),e.TgZ(14,"mat-error"),e._uU(15,"This field is required"),e.qZA()()()()()),2&s){const a=e.oxw();e.xp6(11),e.Q6J("ngForOf",a.frequency)}}function m(s,u){if(1&s&&(e.TgZ(0,"mat-option",46),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.Q6J("value",a.number),e.xp6(1),e.hij("",a.long," ")}}function T(s,u){if(1&s&&(e.TgZ(0,"mat-option",46),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.Q6J("value",a),e.xp6(1),e.Oqu(a)}}function c(s,u){1&s&&(e.TgZ(0,"div",94)(1,"mat-error"),e._uU(2,"Savings start date cannot be same or greater than savings end date"),e.qZA()())}function n(s,u){1&s&&(e.TgZ(0,"div",94)(1,"mat-error"),e._uU(2,"Savings start date cannot be same or greater than goal start date"),e.qZA()())}function b(s,u){if(1&s&&(e.TgZ(0,"mat-option",46),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.Q6J("value",a.number),e.xp6(1),e.hij("",a.long," ")}}function Z(s,u){if(1&s){const a=e.EpF();e.TgZ(0,"mat-option",95),e.NdJ("click",function(){const g=e.CHM(a).$implicit,h=e.oxw();return e.KtG(h.changeDate(g))}),e._uU(1),e.qZA()}if(2&s){const a=u.$implicit;e.Q6J("value",a),e.xp6(1),e.hij("",a," ")}}function J(s,u){1&s&&(e.TgZ(0,"div",94)(1,"mat-error"),e._uU(2,"Savings end date cannot be greater than retirement date"),e.qZA()())}function te(s,u){1&s&&(e.TgZ(0,"div",94)(1,"mat-error"),e._uU(2,"Savings end date cannot be greater than goal start date"),e.qZA()())}function ae(s,u){1&s&&(e.TgZ(0,"div",20)(1,"p",21),e._uU(2,"Goal start date "),e.qZA()())}function ie(s,u){1&s&&(e.TgZ(0,"div",20)(1,"p",21),e._uU(2,"Retirement age "),e.qZA()())}function oe(s,u){if(1&s&&(e.TgZ(0,"mat-option",46),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.Q6J("value",a.number),e.xp6(1),e.Oqu(a.long)}}function ne(s,u){if(1&s&&(e.TgZ(0,"mat-option",46),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.Q6J("value",a),e.xp6(1),e.Oqu(a)}}function re(s,u){1&s&&(e.TgZ(0,"div",94)(1,"mat-error"),e._uU(2,"Goal start date cannot be greater than goal end date"),e.qZA()())}function le(s,u){1&s&&(e.TgZ(0,"div",20)(1,"p",21),e._uU(2,"Goal end date "),e.qZA()())}function de(s,u){1&s&&(e.TgZ(0,"div",20)(1,"p",21),e._uU(2,"Life expectancy "),e.qZA()())}function ce(s,u){if(1&s&&(e.TgZ(0,"mat-option",46),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.Q6J("value",a.number),e.xp6(1),e.Oqu(a.long)}}function ue(s,u){1&s&&(e.TgZ(0,"mat-error"),e._uU(1," This field is required "),e.qZA())}function pe(s,u){1&s&&(e.TgZ(0,"mat-error"),e._uU(1," Month for retirement date & life expectancy should be same. "),e.qZA())}function ge(s,u){1&s&&(e.TgZ(0,"mat-error"),e._uU(1," Month for Goal start date & Goal end date should be same. "),e.qZA())}function me(s,u){if(1&s&&(e.TgZ(0,"mat-option",46),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.Q6J("value",a),e.xp6(1),e.Oqu(a)}}function _e(s,u){1&s&&(e.TgZ(0,"mat-error"),e._uU(1," This field is required "),e.qZA())}function fe(s,u){1&s&&(e.TgZ(0,"mat-error"),e._uU(1," Life expectancy cannot be less than "),e._UZ(2,"br"),e._uU(3," retirement date "),e.qZA())}function he(s,u){1&s&&(e.TgZ(0,"mat-error"),e._uU(1," Goal end date cannot be less than "),e._UZ(2,"br"),e._uU(3," Goal start date "),e.qZA())}function ve(s,u){1&s&&(e.TgZ(0,"mat-error"),e._uU(1,"This field is required"),e.qZA())}function Ae(s,u){if(1&s){const a=e.EpF();e.TgZ(0,"div",37),e.YNc(1,le,3,0,"div",33),e.YNc(2,de,3,0,"div",33),e.TgZ(3,"div",15)(4,"div",22)(5,"mat-form-field")(6,"mat-select",96),e.NdJ("selectionChange",function(r){e.CHM(a);const g=e.oxw();return e.KtG(g.onLifeExpectancyMonthChange(r.value))}),e.TgZ(7,"mat-option",24),e._uU(8,"Select option"),e.qZA(),e.YNc(9,ce,2,2,"mat-option",25),e.qZA(),e.YNc(10,ue,2,0,"mat-error",97),e.YNc(11,pe,2,0,"mat-error",97),e.YNc(12,ge,2,0,"mat-error",97),e.qZA()()(),e.TgZ(13,"div",15)(14,"div",22)(15,"mat-form-field")(16,"mat-select",98),e.NdJ("selectionChange",function(r){e.CHM(a);const g=e.oxw();return e.KtG(g.onLifeExpectancyYearChange(r.value))}),e.TgZ(17,"mat-option",24),e._uU(18,"Select option"),e.qZA(),e.YNc(19,me,2,2,"mat-option",25),e.qZA(),e.YNc(20,_e,2,0,"mat-error",97),e.YNc(21,fe,4,0,"mat-error",97),e.YNc(22,he,4,0,"mat-error",97),e.YNc(23,ve,2,0,"mat-error",97),e.qZA()()()()}if(2&s){const a=e.oxw();let i,r,g,h,w,B,Q;e.xp6(1),e.Q6J("ngIf",1!=a.data.goalType),e.xp6(1),e.Q6J("ngIf",1==a.data.goalType),e.xp6(7),e.Q6J("ngForOf",a.months),e.xp6(1),e.Q6J("ngIf",null==(i=a.goalDetailsFG.get("goalEndDateMonth"))?null:i.hasError("required")),e.xp6(1),e.Q6J("ngIf",null==(r=a.goalDetailsFG.get("goalEndDateMonth"))?null:r.hasError("monthMismatch")),e.xp6(1),e.Q6J("ngIf",null==(g=a.goalDetailsFG.get("goalEndDateMonth"))?null:g.hasError("goalMonthMismatch")),e.xp6(7),e.Q6J("ngForOf",a.yearsEnd),e.xp6(1),e.Q6J("ngIf",null==(h=a.goalDetailsFG.get("goalEndDateYear"))?null:h.hasError("required")),e.xp6(1),e.Q6J("ngIf",null==(w=a.goalDetailsFG.get("goalEndDateYear"))?null:w.hasError("yearInvalid")),e.xp6(1),e.Q6J("ngIf",null==(B=a.goalDetailsFG.get("goalEndDateYear"))?null:B.hasError("goalDateInvalid")),e.xp6(1),e.Q6J("ngIf",null==(Q=a.goalDetailsFG.get("goalEndDateMonth"))?null:Q.hasError("required"))}}function De(s,u){1&s&&(e.TgZ(0,"div",94)(1,"mat-error"),e._uU(2,"Goal addition date cannot be greater than goal start date"),e.qZA()())}function Te(s,u){1&s&&(e.TgZ(0,"div",32)(1,"div",20)(2,"p",21),e._uU(3,"Saving Type "),e.qZA()(),e.TgZ(4,"div",44)(5,"div",22)(6,"mat-form-field")(7,"mat-select",99)(8,"mat-option",24),e._uU(9,"Select option"),e.qZA(),e.TgZ(10,"mat-option",46),e._uU(11,"Group all years together"),e.qZA(),e.TgZ(12,"mat-option",46),e._uU(13,"Save for individual years"),e.qZA()(),e.TgZ(14,"mat-error"),e._uU(15,"This field is required"),e.qZA()()()()()),2&s&&(e.xp6(10),e.Q6J("value",1),e.xp6(2),e.Q6J("value",2))}function be(s,u){1&s&&(e.TgZ(0,"div",109)(1,"div",110)(2,"h5"),e._uU(3,"Pre retirement"),e.qZA()()())}function Ee(s,u){1&s&&(e.TgZ(0,"div",109)(1,"div",110)(2,"h5"),e._uU(3,"Post retirement asset allocation"),e.qZA()()())}function ye(s,u){if(1&s){const a=e.EpF();e.TgZ(0,"div",101),e.YNc(1,Ee,4,0,"div",102),e.TgZ(2,"div",103)(3,"p",104),e._uU(4,"Equity bifurcation"),e.qZA(),e.TgZ(5,"div",22)(6,"mat-form-field",105)(7,"input",111),e.NdJ("change",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.setOtherBifurcation(r.assetAllocationFG.get("postequityAllocation"),r.assetAllocationFG.get("postdebtAllocation")))}),e.qZA()()()(),e.TgZ(8,"div",103)(9,"p",104),e._uU(10,"Debt bifurcation"),e.qZA(),e.TgZ(11,"div",22)(12,"mat-form-field",105)(13,"input",112),e.NdJ("change",function(){e.CHM(a);const r=e.oxw(2);return e.KtG(r.setOtherBifurcation(r.assetAllocationFG.get("postdebtAllocation"),r.assetAllocationFG.get("postequityAllocation")))}),e.qZA()()()()()}if(2&s){const a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",1==a.data.goalType)}}function Ze(s,u){if(1&s){const a=e.EpF();e.TgZ(0,"div",100)(1,"div",101),e.YNc(2,be,4,0,"div",102),e.TgZ(3,"div",103)(4,"p",104),e._uU(5,"Equity bifurcation"),e.qZA(),e.TgZ(6,"div",22)(7,"mat-form-field",105)(8,"input",106),e.NdJ("change",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.setOtherBifurcation(r.assetAllocationFG.get("equityAllocation"),r.assetAllocationFG.get("debtAllocation")))}),e.qZA()()()(),e.TgZ(9,"div",103)(10,"p",104),e._uU(11,"Debt bifurcation"),e.qZA(),e.TgZ(12,"div",22)(13,"mat-form-field",105)(14,"input",107),e.NdJ("change",function(){e.CHM(a);const r=e.oxw();return e.KtG(r.setOtherBifurcation(r.assetAllocationFG.get("debtAllocation"),r.assetAllocationFG.get("equityAllocation")))}),e.qZA()()()()(),e.YNc(15,ye,14,1,"div",108),e.qZA()}if(2&s){const a=e.oxw();e.xp6(2),e.Q6J("ngIf",1==a.data.goalType),e.xp6(13),e.Q6J("ngIf",1==a.data.goalType)}}function Ce(s,u){1&s&&e._UZ(0,"th",113)}function Me(s,u){if(1&s&&(e.TgZ(0,"td",114),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.xp6(1),e.hij(" ",a.position," ")}}function Oe(s,u){1&s&&(e.TgZ(0,"th",115),e._uU(1," Assumption "),e.qZA())}function Se(s,u){if(1&s){const a=e.EpF();e.TgZ(0,"td",116)(1,"input",117),e.NdJ("ngModelChange",function(r){const h=e.CH
1M(a).$implicit;return e.KtG(h.name=r)}),e.qZA()()}if(2&s){const a=u.$implicit;e.xp6(1),e.Q6J("ngModel",a.name)}}function xe(s,u){1&s&&e._UZ(0,"tr",118)}function Ie(s,u){1&s&&e._UZ(0,"tr",119)}function Pe(s,u){1&s&&(e.TgZ(0,"td",120),e._uU(1," Asset class "),e.qZA())}function Ue(s,u){1&s&&e._UZ(0,"th",113)}function qe(s,u){if(1&s&&(e.TgZ(0,"td",114),e._uU(1),e.qZA()),2&s){const a=u.$implicit;e.xp6(1),e.hij(" ",a.position," ")}}function Fe(s,u){1&s&&(e.TgZ(0,"th",121),e._uU(1," Assumption "),e.qZA())}function Ye(s,u){if(1&s){const a=e.EpF();e.TgZ(0,"td",122)(1,"input",117),e.NdJ("ngModelChange",function(r){const h=e.CHM(a).$implicit;return e.KtG(h.name=r)}),e.qZA()()}if(2&s){const a=u.$implicit;e.xp6(1),e.Q6J("ngModel",a.name)}}function Ge(s,u){1&s&&e._UZ(0,"tr",118)}function Ne(s,u){1&s&&e._UZ(0,"tr",119)}function Le(s,u){1&s&&e._UZ(0,"tr",123)}const Re=function(){return["static-header"]};let Je=(()=>{class s{constructor(a,i,r,g,h,w,B,Q,Qe,ke,Ke){this.subInjectService=a,this.eventService=i,this.fb=r,this.datePipe=g,this.planService=h,this.preferenceService=w,this.allocateOtherAssetService=B,this.dialog=Q,this.roleService=Qe,this.auth=ke,this.enumDataService=Ke,this.displayedColumns=["position","name"],this.dataSource=we,this.displayedColumns1=["position","name"],this.dataSource1=Be,this.validatorType=E.aS,this.months=O.$.getMonthsArr(),this.goalStartYears=Array(50).fill((new Date).getFullYear()).map((se,k)=>se+k),this.years=[],this.subscription=new _.w,this.barButtonOptions={active:!1,text:"SAVE & NEXT",buttonColor:"accent",barColor:"accent",raised:!0,stroked:!1,mode:"determinate",value:10,disabled:!1,fullWidth:!1},this.selectedTab=0,this.subscriber=new p.L,this.freez=!1,this.selected=0,this.frequency=[],this.savingsSDError=!1,this.savingsEDError=!1,this.goalSDError=!1,this.today=new Date,this.stages=Array(50).fill(0).map((se,k)=>({name:k+" years from today",value:k}))}ngOnInit(){this.singleGoalData=this.data,1==this.data.remainingData.freezed&&(this.freez=!0),this.editGoalCapability=this.roleService.planPermission.subModule.goals.capabilityList,1==this.data.singleOrMulti?(this.years=Array(new Date(this.data.remainingData.goalStartDate).getFullYear()-(new Date).getFullYear()+20).fill((new Date).getFullYear()-20).map((a,i)=>a+(i+1)),this.yearsEnd=Array(new Date(this.data.remainingData.goalStartDate).getFullYear()-(new Date).getFullYear()+40).fill((new Date).getFullYear()).map((a,i)=>a+i)):(this.years=Array(new Date(this.data.goalEndDate).getFullYear()-(new Date).getFullYear()+20).fill((new Date).getFullYear()-20).map((a,i)=>a+(i+1)),this.yearsEnd=Array(new Date(this.data.goalEndDate).getFullYear()-(new Date).getFullYear()+40).fill((new Date).getFullYear()).map((a,i)=>a+i)),1==this.data.goalType&&(this.years=Array(new Date(this.data.remainingData.goalStartDate).getFullYear()-(new Date).getFullYear()+20).fill((new Date).getFullYear()-20).map((a,i)=>a+(i+1)),this.yearsEnd=Array(new Date(this.data.remainingData.goalEndDate).getFullYear()-(new Date).getFullYear()+40).fill((new Date).getFullYear()).map((a,i)=>a+i)),this.getFrequency(),this.setForms(),this.setFormListeners()}onRetirementMonthChange(a){const i=this.goalDetailsFG.get("goalEndDateMonth")?.value;this.checkMonthMatch(a,i)}onLifeExpectancyMonthChange(a){const i=this.goalDetailsFG.get("goalStartDateMonth")?.value;this.checkMonthMatch(i,a)}checkMonthMatch(a,i){if(![1,5,6].includes(this.data.goalType))return;const r=this.goalDetailsFG.get("goalEndDateMonth");if(a&&i&&a!==i)r?.setErrors({[5===this.data.goalType||6===this.data.goalType?"goalMonthMismatch":"monthMismatch"]:!0});else if(r?.errors){const g={...r.errors};delete g.monthMismatch,delete g.goalMonthMismatch,0===Object.keys(g).length?r.setErrors(null):r.setErrors(g)}}onRetirementYearChange(a){const i=this.goalDetailsFG.get("goalEndDateYear")?.value;this.validateYear(a,i)}onLifeExpectancyYearChange(a){const i=this.goalDetailsFG.get("goalStartDateYear")?.value;this.validateYear(i,a)}validateYear(a,i){if(![1,5,6].includes(this.data.goalType))return;const r=this.goalDetailsFG.get("goalEndDateYear");if(a&&i&&i<a)r?.setErrors({[5===this.data.goalType||6===this.data.goalType?"goalDateInvalid":"yearInvalid"]:!0});else if(r?.errors){const g={...r.errors};delete g.yearInvalid,delete g.goalDateInvalid,0===Object.keys(g).length?r.setErrors(null):r.setErrors(g)}}getFrequency(){this.frequency=[];for(let a=0;a<20;a++)this.frequency.push(0!=a?{name:"Every "+(a+1)+" year",value:a+1}:{name:"Every year",value:a+1});this.enumDataService.PRODUCTION||console.log("this.frequency",this.frequency)}setForms(){const a=this.data.remainingData;this.createKeyParamsForm(a),this.createAssetForm(a),this.createAssetFormInflamation(a)}setFormListeners(){this.setKeyParamFormListeners(),this.setAssetAllocationListeners(),this.setInflamationReturns()}saveData(a){}changeDate(a){(1==this.data.goalType||2==this.data.singleOrMulti)&&this.goalDetailsFG.controls.savingEnd
1DateYear.value<=this.goalDetailsFG.controls.goalEndDateYear.value||this.goalDetailsFG.controls.goalEndDateYear.setValue(a)}createKeyParamsForm(a){this.goalDetailsFG=this.fb.group({goalValue:[Math.round(this.preferenceService.getGoalValueForForm(this.data)),[d.kI.required]],savingStartDateYear:[new Date(a.savingStartDate).getFullYear(),[d.kI.required]],savingStartDateMonth:[("0"+(new Date(a.savingStartDate).getMonth()+1)).slice(-2),[d.kI.required]],savingEndDateYear:[new Date(a.savingEndDate).getFullYear(),[d.kI.required]],savingEndDateMonth:[("0"+(new Date(a.savingEndDate).getMonth()+1)).slice(-2),[d.kI.required]],goalStartDateYear:[new Date(this.data.goalStartDate).getFullYear(),[d.kI.required]],goalStartDateMonth:[("0"+(new Date(this.data.goalStartDate).getMonth()+1)).slice(-2),[d.kI.required]],goalEndDateMonth:[("0"+(new Date(this.data.goalEndDate).getMonth()+1)).slice(-2),[d.kI.required]],goalEndDateYear:[new Date(this.data.goalEndDate).getFullYear(),[d.kI.required]],savingStatus:[a.savingStatus,[d.kI.required]],freezeCalculation:[a.freezed],name:[this.auth.sanitizeInput(this.data.goalName),[d.kI.required]],priorityFlag:[this.data.priorityFlag],goalAdditionDate:[new Date(a.goalAdditionDate),[d.kI.required]],archiveGoal:[],stepUp:[a.stepUp?a.stepUp:0]}),this.savingStartDate=this.goalDetailsFG.controls.savingStartDateYear.value,!a.goalEndDate&&2==this.data.singleOrMulti&&(this.goalDetailsFG.addControl("goalEndDateYear",this.fb.control(new Date(a.goalEndDate).getFullYear(),[d.kI.required])),this.goalDetailsFG.addControl("goalEndDateMonth",this.fb.control(("0"+(new Date(a.goalEndDate).getMonth()+1)).slice(-2),[d.kI.required]))),2==this.data.singleOrMulti&&this.goalDetailsFG.addControl("savingTypeStatus",this.fb.control(a?.savingTypeStatus?a.savingTypeStatus:"",[d.kI.required])),a.notes?this.storeData=this.auth.sanitizeInput(a.notes):a.goalNote&&(this.storeData=this.auth.sanitizeInput(a.goalNote)),5==this.data.goalType&&this.goalDetailsFG.addControl("frequency",this.fb.control(a.frequency,[d.kI.required]))}unfreez(){if(1==this.freez){const i=this.dialog.open(M.$,{width:"400px",data:{header:"UNFREEZE GOAL",body:"You have frozen the calculations for additional savings required. Allocating an asset will unfreeze the calculations. Are you sure you want to unfreeze?",body2:"This cannot be undone.",btnYes:"CANCEL",btnNo:"UNFREEZE",positiveMethod:()=>{this.planService.freezCalculation({lumpSumAmountDebt:this.data.remainingData.lumpSumAmountDebt,lumpSumAmountEquity:this.data.remainingData.lumpSumAmountEquity,id:this.data.remainingData.id,goalType:this.data.goalType,freezed:!1}).subscribe(g=>{this.allocateOtherAssetService.refreshAssetList.next(),this.subInjectService.closeNewRightSlider({state:"close",refreshRequired:!0}),this.eventService.openSnackBar("Goal unfreeze successfully"),i.close()},g=>{this.eventService.openSnackBar(g)})}},autoFocus:!1})}}restrictFrom100(a){parseInt(a.target.value)>100&&(a.target.value=100)}setKeyParamFormListeners(){1==this.data.singleOrMulti&&this.subscription.add(this.goalDetailsFG.controls.goalStartDateYear.valueChanges.subscribe(a=>{this.goalStartYears=Array(a+1-(new Date).getFullYear()).fill((new Date).getFullYear()).map((i,r)=>i+r),(!this.years.includes(this.goalDetailsFG.controls.savingStartDateYear)||!this.years.includes(this.goalDetailsFG.controls.savingEndDateYear))&&(this.goalDetailsFG.controls.savingStartDateYear.setValue(""),this.goalDetailsFG.controls.savingEndDateYear.setValue("")),(!this.yearsEnd.includes(this.goalDetailsFG.controls.savingStartDateYear)||!this.years.includes(this.goalDetailsFG.controls.savingEndDateYear))&&(this.goalDetailsFG.controls.savingStartDateYear.setValue(""),this.goalDetailsFG.controls.savingEndDateYear.setValue(""))})),(1==this.data.goalType||2==this.data.singleOrMulti)&&this.subscription.add(this.goalDetailsFG.controls.goalEndDateYear.valueChanges.subscribe(a=>{this.years=Array(a+1-(new Date).getFullYear()).fill((new Date).getFullYear()).map((g,h)=>g+h);const r=this.goalDetailsFG.controls.savingEndDateYear.value;(!this.years.includes(this.goalDetailsFG.controls.savingStartDateYear.value)||!this.years.includes(r))&&(this.goalDetailsFG.controls.savingStartDateYear.setValue(""),this.goalDetailsFG.controls.savingEnd
1DateYear.setValue("")),(!this.yearsEnd.includes(this.goalDetailsFG.controls.savingStartDateYear.value)||!this.years.includes(this.goalDetailsFG.controls.savingEndDateYear.value))&&(this.goalDetailsFG.controls.savingStartDateYear.setValue(""),this.goalDetailsFG.controls.savingEndDateYear.setValue(""))}))}setEndDate(){}setInflamationReturns(){this.dataSource.forEach(a=>{"Debt asset class"==a.position?a.name=this.data.remainingData.returnsAssumptions.debt_return+"%":"Equity asset class"==a.position?a.name=this.data.remainingData.returnsAssumptions.equity_return+"%":"Debt funds"==a.position?a.name=this.data.remainingData.returnsAssumptions.debt_fund_returns+"%":"Equity funds"==a.position?a.name=this.data.remainingData.returnsAssumptions.equity_fund_returns+"%":"Balanced funds"==a.position?a.name=this.data.remainingData.returnsAssumptions.balanced_fund_returns+"%":"Stocks"==a.position?a.name=this.data.remainingData.returnsAssumptions.stock_returns+"%":"Real Estates"==a.position?a.name=this.data.remainingData.returnsAssumptions.real_estate+"%":"Bank Accounts Saving"==a.position?a.name=this.data.remainingData.returnsAssumptions.bank_account_saving+"%":"Commodities - Gold"==a.position?a.name=this.data.remainingData.returnsAssumptions.commodity_gold+"%":"Commodities- Others"==a.position?a.name=this.data.remainingData.returnsAssumptions.commodity_other+"%":"Traditional returns"==a.position?a.name=this.data.remainingData.returnsAssumptions.traditional_returns+"%":"Ulip returns"==a.position&&(a.name=this.data.remainingData.returnsAssumptions.ulip_returns+"%")}),this.dataSource1.forEach(a=>{"Inflation rate"==a.position&&(a.name=this.data.remainingData.inflationRateYearly+"%")})}validateGoalDates(){const a=this.goalDetailsFG.controls.goalStartDateYear.value+"-"+this.goalDetailsFG.controls.goalStartDateMonth.value+"-01",i=this.goalDetailsFG.controls.savingStartDateYear.value+"-"+this.goalDetailsFG.controls.savingStartDateMonth.value+"-01",r=this.goalDetailsFG.controls.savingEndDateYear.value+"-"+this.goalDetailsFG.controls.savingEndDateMonth.value+"-01",g=this.datePipe.transform(this.goalDetailsFG.controls.goalAdditionDate.value,"yyyy-MM-dd");if(2==this.data.singleOrMulti&&1==this.data.goalType)this.goalRError=!![-1].includes(E.fK.compareDatesFor(a,r)),this.goalAddError=!![-1].includes(E.fK.compareDates(g,a)),this.goalError=!![-1].includes(E.fK.compareDates(i,a));else if(2==this.data.singleOrMulti){const h=this.goalDetailsFG.controls.goalEndDateYear.value+"-"+this.goalDetailsFG.controls.goalEndDateMonth.value+"-01";this.goalSDrror=!![-1].includes(E.fK.compareDates(a,h)),this.savingsEDError=!![-1].includes(E.fK.compareDates(r,h)),this.savingsSDError=!![-1].includes(E.fK.compareDatesFor(i,r)),this.goalAddError=!![-1].includes(E.fK.compareDates(g,a)),this.goalError=!![-1].includes(E.fK.compareDates(i,a))}else this.savingsEDError=!![-1].includes(E.fK.compareDates(r,a)),this.savingsSDError=!![-1].includes(E.fK.compareDatesFor(i,r)),this.goalAddError=!![-1].includes(E.fK.compareDates(g,a)),this.goalError=!![-1].includes(E.fK.compareDates(i,a));return this.savingsSDError=!![-1].includes(E.fK.compareDatesFor(i,r)),this.goalSDError||this.savingsEDError||this.savingsSDError||this.goalSDrror||this.goalAddError||this.goalError}savePreference(){if(this.goalDetailsFG.invalid||this.validateGoalDates()||this.barButtonOptions.active)return void this.goalDetailsFG.markAllAsTouched();let a;this.goalDetailsFG.value.notes=this.auth.sanitizeInput(this.storeData),this.barButtonOptions.active=!0;const i=this.preferenceService.createGoalObjForGoalTypes(this.data,this.goalDetailsFG.value);i.notes.includes("&lt;SCRIPT")&&(i.notes=" "),1==this.data.singleOrMulti?(this.barButtonOptions.active=!1,a=this.planService.saveSingleGoalPreference(i)):(this.barButtonOptions.active=!1,a=this.planService.saveMultiGoalPreference(i)),a.subscribe(r=>{this.switchToTab(++this.selectedTab),this.eventService.openSnackBar("Preference saved","Dismiss"),this.subInjectService.changeNewRightSliderState({state:"open45",refreshObservable:!0}),this.barButtonOptions.active=!1,this.subInjectService.setRefreshRequired()},r=>{this.eventService.openSnackBar(r,"Dismiss")})}switchToTab(a){a>2?this.close():(this.barButtonOptions.text=2==a?"SAVE & CLOSE":"SAVE & NEXT",this.selectedTab=a)}createAssetForm(a){this.assetAllocationFG=this.fb.group({advisorId:[this.data.remainingData.advisorId],equityAllocation:["",[d.kI.required]],debtAllocation:["",[d.kI.required]],progressiveStages:this.fb.array([this.createStage()]),strategicOrTactical:[1,[d.kI.required]],staticOrProgressive:[1,[d.kI.required]],goalId:[this.data.remainingData.id],goalType:[this.data.goalType]}),1==this.data.goalType&&(this.assetAllocationFG.addControl("postequityAllocation",this.fb.control(a.postRetirementAssetAllocation.equity_ratio)),this.assetAllocationFG.addControl("postdebtAllocation",this.fb.control(a.postRetirementAssetAllocation.debt_ratio)))}createAssetFormInflamation(a){this.inflamationReturnsFG=this.fb.group({advisorId:[this.data.remainingData.advisorId],name:["",[d.kI.required]],priorityFlag:[this.data.priorityFlag],position:["",[d.kI.required]],goalId:[this.data.remainingData.id],goalType:[this.data.goalType]})}setAssetAllocationListeners(){if(2==this.assetAllocationFG.controls.strategicOrTactical.value)this.assetAllocationFG.controls.equityAllocation.disable(),this.assetAllocationFG.controls.debtAllocation.disable(),this.progressiveStageArrayControl.enable();else{this.assetAllocationFG.controls.equityAllocation.enable(),this.assetAllocationFG.controls.debtAllocation.enable(),this.assetAllocationFG.controls.equityAllocation.setValue(this.data.remainingData.bifurcation.equity_ratio),this.assetAllocationFG.controls.debtAllocation.setValue(this.data.remainingData.bifurcation.debt_ratio),this.progressiveStageArrayControl.disable();for(let a=1;a<this.progressiveStageArrayControl.controls.length;a++)this.removeStage(a);1==this.data.goalType&&(this.assetAllocationFG.controls.postequityAllocation.enable(),this.assetAllocationFG.controls.postdebtAllocation.enable(),this.assetAllocationFG.controls.postequityAllocation.setValue(this.data.remainingData.postRetirementAssetAllocation.equity_ratio),this.assetAllocationFG.controls.postdebtAllocation.setValue(this.data.remainingData.postRetirementAssetAllocation.debt_ratio)),this.progressiveStageArrayControl.controls.forEac
1h(a=>{a.setValue({stageTime:"",equityAllocation:"",debtAllocation:""})})}this.subscription.add(this.assetAllocationFG.controls.strategicOrTactical.valueChanges.subscribe(a=>{}))}freezeCalculation(a){let i={lumpSumAmountDebt:this.data.remainingData.lumpSumAmountDebt,lumpSumAmountEquity:this.data.remainingData.lumpSumAmountEquity,id:this.data.remainingData.id,goalType:this.data.goalType,freezed:a.checked};this.freez=a.checked,this.planService.freezCalculation(i).subscribe(r=>{a.checked?(this.eventService.openSnackBar("Goal freezed successfully"),this.close()):this.eventService.openSnackBar("Goal unfreeze successfully"),this.allocateOtherAssetService.refreshObservable.next(),this.subInjectService.setRefreshRequired()},r=>{this.eventService.openSnackBar(r)})}addStages(){this.assetAllocationFG.controls.progressiveStages.push(this.createStage())}removeStage(a){this.assetAllocationFG.controls.progressiveStages.removeAt(a)}getSumOfJsonMap(a={}){let i=0;for(let r in a)a.hasOwnProperty(r)&&(i+=a[r]);return i}createStage(a="",i="",r=""){return this.fb.group({stageTime:[r,d.kI.required],equityAllocation:[a,d.kI.required],debtAllocation:[i,d.kI.required]})}saveInflamatonReturns(){this.obj={},this.barButtonOptions.active=!0,this.dataSource.forEach(i=>{"Debt asset class"==i.position?Object.assign(this.obj,{debtAssetClassReturns:parseFloat(i.name)}):"Equity asset class"==i.position?Object.assign(this.obj,{equityAssetClassReturns:parseFloat(i.name)}):"Debt funds"==i.position?Object.assign(this.obj,{debtFundReturns:parseFloat(i.name)}):"Equity funds"==i.position?Object.assign(this.obj,{equityFundReturns:parseFloat(i.name)}):"Balanced funds"==i.position?Object.assign(this.obj,{balancedFundReturns:parseFloat(i.name)}):"Stocks"==i.position?Object.assign(this.obj,{stockReturns:parseFloat(i.name)}):"Real Estates"==i.position?Object.assign(this.obj,{realEstate:parseFloat(i.name)}):"Bank Accounts Saving"==i.position?Object.assign(this.obj,{bankAccountSaving:parseFloat(i.name)}):"Commodities - Gold"==i.position?Object.assign(this.obj,{commodityGold:parseFloat(i.name)}):"Commodities- Others"==i.position?Object.assign(this.obj,{commodityOther:parseFloat(i.name)}):"Traditional returns"==i.position?Object.assign(this.obj,{traditionalReturns:parseFloat(i.name)}):"Ulip returns"==i.position&&Object.assign(this.obj,{ulipReturns:parseFloat(i.name)})}),this.dataSource1.forEach(i=>{"Inflation rate"==i.position&&Object.assign(this.obj,{inflationRate:parseFloat(i.name)})}),Object.assign(this.obj,{goalId:this.data.remainingData.id}),Object.assign(this.obj,{goalType:this.data.goalType}),Object.assign(this.obj,{advisorId:this.data.remainingData.advisorId}),this.planService.saveAssetPreference(this.obj).subscribe(i=>{this.eventService.openSnackBar("Asset allocation preference saved","Dismiss"),this.close(),this.barButtonOptions.active=!1,this.allocateOtherAssetService.refreshObservable.next(),this.subInjectService.setRefreshRequired()},i=>{this.barButtonOptions.active=!1,this.eventService.openSnackBar(i,"Dismiss")})}saveAssetAllocation(){if(this.assetAllocationFG.invalid||this.validateGoalDates()||this.barButtonOptions.active)return void this.assetAllocationFG.markAllAsTouched();this.barButtonOptions.active=!0;let i=this.assetAllocationFG.value;i.equityAllocation=parseInt(i.equityAllocation),i.debtAllocation=parseInt(i.debtAllocation),i.strategicOrTactical=parseInt(i.strategicOrTactical),i.staticOrProgressive=parseInt(i.staticOrProgressive),i.postRetirementDebtAssetAllocation=parseInt(i.postdebtAllocation),i.postRetirementEquityAssetAllocation=parseInt(i.postequityAllocation),this.planService.saveAssetPreference(i).subscribe(r=>{this.switchToTab(++this.selectedTab),this.eventService.openSnackBar("Asset allocation preference saved","Dismiss"),this.subInjectService.changeNewRightSliderState({state:"open45",refreshObservable:!0}),this.barButtonOptions.active=!1,this.subInjectService.setRefreshRequired()},r=>{this.barButtonOptions.active=!1,this.eventService.openSnackBar(r,"Dismiss")})}get progressiveStageArrayControl(){return this.assetAllocationFG.controls.progressiveStages}setOtherBifurcation(a,i){if(a.value<=100){const r=100-parseInt(a.value);i.setValue(r)}else a.setValue(100),i.setValue(0)}save(){if(this.freez){const i=this.dialog.open(M.$,{width:"400px",data:{header:"UNFREEZE GOAL",body:"You have frozen the calculations for additional savings required. Allocating an asset will unfreeze the calculations. Are you sure you want to unfreeze?",body2:"This cannot be undone.",btnYes:"CANCEL",btnNo:"UNFREEZE",positiveMethod:()=>{this.planService.freezCalculation({lumpSumAmountDebt:this.data.remainingData.lumpSumAmountDebt,lumpSumAmountEquity:this.data.remainingData.lumpSumAmountEquity,id:this.data.remainingData.id,goalType:this.data.goalType,freezed:!1}).subscribe(g=>{this.freez=!1,this.allocateOtherAssetService.refreshAssetList.next(),this.eventService.openSnackBar("Goal unfreeze successfully"),this.subInjectService.closeNewRightSlider({state:"close",refreshRequired:!0}),this.proceedWithSave()},g=>{this.eventService.openSnackBar(g)}),i.close()}},autoFocus:!1})}else this.proceedWithSave()}proceedWithSave(){switch(this.selectedTab){case 0:this.savePreference();break;case 1:this.saveAssetAllocation();break;case 2:this.saveInflamatonReturns()}}resetPageVariables(){this.barButtonOptions.text=2==this.selectedTab?"SAVE & CLOSE":"SAVE & NEXT"}close(){this.subInjectService.closeNewRightSlider({state:"close",refreshRequired:!0})}ngOnDestroy(){this.subscription.unsubscribe()}}return s.\u0275fac=function(a){return new(a||s)(e.Y36(G.f),e.Y36(x.P),e.Y36(d.QS),e.Y36(q.uU),e.Y36(C.D),e.Y36(o.y),e.Y36(t.b),e.Y36(L.uw),e.Y36(I.N),e.Y36(P.e),e.Y36(F.p))},s.\u0275cmp=e.Xpm({type:s,selectors:[["app-preferences"]],inputs:{data:"data"},features:[e._Bn([o.y])],decls:210,vars:52,consts:[[1,"right-side-fixes-x"],[1,"right-sidenav-fixes-y"],[1,"row","bb-1","popup-header-fix","w-45"],[1,"col-md-10","p-0"],[1,"mb-0","wrapper-20"],[1,"col-md-2","pr-12","text-right","right"],["src","https://res.cloudinary.com/futurewise/image/upload/v1622610962/myplanner/images/svg/close-icon.svg","height","50","width","26","alt","close icon",1,"material-icons","c-p","pt-16","pr-12",3,"click"],["id","goal-preferences",1,"row"],[1,"col-md-12","p-0"],["animationDuration","0ms","mat-align-tabs","center",3,"selectedIndex","selectedTabChange","selectedIndexChange"],["label","Key parameters"],[1,"wrapper-28",3,"formGroup"],[1,"row","pb-20"],["class","col-md-4 d-flex align-items-center p-0",4,"ngIf"],["class","col-md-4 d-flex align-items-center justify-content-end",4,"ngIf"],[1,"col-md-4"],[1,"form-group","mb-0","iconRupess"],["matInput","","type","text","formControlName","goalValue","appInputValueValidation","",1,"form-control","br-0","rupess",3,"inputValidator"],["class","row pb-20",4,"ngIf"],[1,"row","pt-20","btl-1"],[1,"col-md-4","pl-0","d-flex","align-items-center"],[1,"roboto","mb-0"],[1,"form-group","mb-0"],["formControlName","savingStartDateMonth",1,"form-control","br-none"],["value","","disabled",""],[3,"value",4,"ngFor","ngForOf"],["formControlName","savingStartDateYear",1,"form-control"],["class","col-md-12",4,"ngIf"],[1,"row","pt-20","pb-20"],["formControlName","savingEnd
1DateMonth",1,"form-control","br-0","br-none"],["formControlName","savingEndDateYear",1,"form-control"],[3,"value","click",4,"ngFor","ngForOf"],[1,"row","pt-20","pb-20","btl-1"],["class","col-md-4 pl-0 d-flex align-items-center",4,"ngIf"],["formControlName","goalStartDateMonth",1,"form-control","br-none",3,"selectionChange"],["formControlName","goalStartDateYear",1,"form-control",3,"selectionChange"],["class","row pt-0 pb-20",4,"ngIf"],[1,"row","pt-0","pb-20"],[1,"col-md-4","mt-10"],[1,"form-group","mb-0","remove-top"],["appearance","standard","floatLabel","never",1,"ba-date"],["formControlName","goalAdditionDate","matInput","",1,"form-control","br-0","b-0",3,"matDatepicker","input","focus"],["matSuffix","",3,"for"],["picker",""],[1,"col-md-8","p-0"],["formControlName","savingStatus",1,"form-control","br-0"],[3,"value"],["class","row pt-20 pb-20 btl-1",4,"ngIf"],[1,"row","pt-10","pb-20"],[1,"col-md-1","p-0","mt-6"],["id","custom-checkbox","formControlName","freezeCalculation",3,"change"],[1,"col-md-7","pr-0","text-right"],[1,"m-0","text-primitive","mt-4"],[1,"row","pt-20","btl-1","pb-20"],[1,"col-md-8","p-0","right"],["matInput","","type","text","maxlength","30","formControlName","name",1,"form-control","br-0"],["goalName",""],["align","end",1,"full-end","f-400","f-12","roboto"],["formControlName","priorityFlag",1,"form-control","br-0"],["disabled","",1,""],[3,"model","modelChange"],["label","Asset allocation"],[1,"wrapper-20",3,"formGroup"],["class","col-md-12 pl-10",4,"ngIf"],["label","Returns & Inflation"],[1,"wrapper-20"],[1,"mt-8","perferences-inflation-rate"],["mat-table","","id","table-low",3,"dataSource"],["matColumnDef","position"],["mat-header-cell","","class","br w-32",4,"matHeaderCellDef"],["mat-cell","","class","br  w-32",4,"matCellDef"],["matColumnDef","name"],["class","text-center","mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","class","text-center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mt-40","Return-Inflation-table"],["matColumnDef","static-header"],["mat-header-cell","","class"," text-left f-400  pl-4 text-primitive bg-white",4,"matHeaderCellDef"],["mat-cell","","class","br w-32",4,"matCellDef"],["mat-header-cell","","class","text-center br",4,"matHeaderCellDef"],["mat-cell","","class","text-center br",4,"matCellDef"],["mat-header-row","","class","p-0 bt-0 bb-0",4,"matHeaderRowDef"],[1,"bottom-fixed","wrapper-12","w-45"],[1,"row"],[1,"mb-0","pt-8","text-white","c-p","f-16",3,"click"],[1,"col-md-8","right","text-right"],[1,"br-0","text-inherit",3,"disabled","options","btnClick"],[1,"col-md-4","d-flex","align-items-center","p-0"],[1,"col-md-4","d-flex","align-items-center","justify-content-end"],["matInput","","formControlName","frequency",1,"form-control","br-0"],["disabled","",3,"value"],[3,"disabled","value",4,"ngFor","ngForOf"],[3,"disabled","value"],[1,"col-md-12"],[3,"value","click"],["formControlName","goalEndDateMonth",1,"form-control","br-0",3,"selectionChange"],[4,"ngIf"],["formControlName","goalEndDateYear",1,"form-control","br-0",3,"selectionChange"],["formControlName","savingTypeStatus",1,"form-control","br-0"],[1,"col-md-12","pl-10"],[1,"row","pb-10"],["class","row w-100",4,"ngIf"],[1,"col-md-5","pl-0"],[1,"m-0","roboto","text-black"],[1,"w-100"],["matInput","","formControlName","equityAllocation","type","text",1,"form-control","br-0",3,"change"],["matInput","","formControlName","debtAllocation","type","text",1,"form-control","br-0",3,"change"],["class","row pb-10",4,"ngIf"],[1,"row","w-100"],[1,"col-md-6","pl-0"],["matInput","","formControlName","postequityAllocation","type","text",1,"form-control","br-0",3,"change"],["matInput","","formControlName","postdebtAllocation","type","text",1,"form-control","br-0",3,"change"],["mat-header-cell","",1,"br","w-32"],["mat-cell","",1,"br","w-32"],["mat-header-cell","",1,"text-center"],["mat-cell","",1,"text-center"],["matInput","","type","text",1,"form-control","br-0",3,"ngModel","ngModelChange"],["mat-header-row",""],["mat-row",""],["mat-header-cell","",1,"text-left","f-400","pl-4","text-primitive","bg-white"],["mat-header-cell","",1,"text-center","br"],["mat-cell","",1,"text-center","br"],["mat-header-row","",1,"p-0","bt-0","bb-0"]],template:function(a,i){if(1&a){const r=e.EpF();e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h4",4),e._uU(5,"Edit Goal"),e.qZA()(),e.TgZ(6,"div",5)(7,"img",6),e.NdJ("click",function(){return i.close()}),e.qZA()()(),e.TgZ(8,"div",7)(9,"div",8)(10,"mat-tab-group",9),e.NdJ("selectedTabChange",function(){return i.resetPageVariables()})("selectedIndexChange",function(h){return i.selectedTab=h}),e.TgZ(11,"mat-tab",10)(12,"div",11)(13,"div",12),e.YNc(14,z,3,0,"div",13),e.YNc(15,$,3,0,"div",14),e.YNc(16,H,3,0,"div",14),e.TgZ(17,"div",15)(18,"div",16)(19,"mat-form-field"),e._UZ(20,"input",17),e.TgZ(21,"mat-error"),e._uU(22,"This field is required"),e.qZA()()()()(),e.YNc(23,ee,16,1,"div",18),e.TgZ(24,"div",19)(25,"div",20)(26,"p",21),e._uU(27,"Savings start date "),e.qZA()(),e.TgZ(28,"div",15)(29,"div",22)(30,"mat-form-field")(31,"mat-select",23)(32,"mat-option",24),e._uU(33,"Select option"),e.qZA(),e.YNc(34,m,2,2,"mat-option",25),e.qZA(),e.TgZ(35,"mat-error"),e._uU(36,"This field is required"),e.qZA()()()(),e.TgZ(37,"div",15)(38,"div",22)(39,"mat-form-field")(40,"mat-select",26)(41,"mat-option",24),e._uU(42,"Select option"),e.qZA(),e.YNc(43,T,2,2,"mat-option",25),e.qZA(),e.TgZ(44,"mat-error"),e._uU(45,"This field is required"),e.qZA()()()(),e.YNc(46,c,3,0,"div",27),e.YNc(47,n,3,0,"div",27),e.qZA(),e.TgZ(48,"div",28)(49,"div",20)(50,"p",21),e._uU(51,"Savings end date "),e.qZA()(),e.TgZ(52,"div",15)(53,"div",22)(54,"mat-form-field")(55,"mat-select",29)(56,"mat-option",24),e._uU(57,"Select option"),e.qZA(),e.YNc(58,b,2,2,"mat-option",25),e.qZA(),e.TgZ(59,"mat-error"),e._uU(60,"This field is required"),e.qZA()()()(),e.TgZ(61,"div",15)(62,"div",22)(63,"mat-form-field")(64,"mat-select",30)(65,"mat-option",24),e._uU(66,"Select option"),e.qZA(),e.YNc(67,Z,2,2,"mat-option",31),e.qZA(),e.TgZ(68,"mat-error"),e._uU(69,"This field is required"),e.qZA()()()(),e.YNc(70,J,3,0,"div",27),e.YNc(71,te,3,0,"div",27),e.qZA(),e.TgZ(72,"div",32),e.YNc(73,ae,3,0,"div",33),e.YNc(74,ie,3,0,"div",33),e.TgZ(75,"div",15)(76,"div",22)(77,"mat-form-field")(78,"mat-select",34),e.NdJ("selectionChange",function(h){return i.onRetirementMonthChange(h.value)}),e.TgZ(79,"mat-option",24),e._uU(80,"Select option"),e.qZA(),e.YNc(81,oe,2,2,"mat-option",25),e.qZA(),e.TgZ(82,"mat-error"),e._uU(83,"This field is required"),e.qZA()()()(),e.TgZ(84,"div",15)(85,"div",22)(86,"mat-form-field")(87,"mat-select",35),e.NdJ("selectionChange",function(h){return i.onRetirementYearChange(h.value)}),e.TgZ(88,"mat-option",24),e._uU(89,"Select option"),e.qZA(),e.YNc(90,ne,2,2,"mat-option",25),e.qZA(),e.TgZ(91,"mat-error"),e._uU(92,"This field is required"),e.qZA()()()(),e.YNc(93,re,3,0,"div",27),e.qZA(),e.YNc(94,Ae,24,11,"div",36),e.TgZ(95,"div",37)(96,"div",20)(97,"p",21),e._uU(98,"Goal addition date "),e.qZA()(),e.TgZ(99,"div",38)(100,"div",39)(101,"mat-form-field",40)(102,"input",41),e.NdJ("input",function(){return i.setEndDate()})("focus",function(){e.CHM(r);const h=e.MAs(105);return e.KtG(h.open())}),e.qZA(),e._UZ(103,"mat-datepicker-toggle",42)(104,"mat-datepicker",null,43),e.TgZ(106,"mat-error"),e._uU(107," This field is required "),e.qZA()()()(),e.YNc(108,De,3,0,"div",27),e.qZA(),e.TgZ(109,"div",32)(110,"div",20)(111,"p",21),e._uU(112,"Saving status "),e.qZA()(),e.TgZ(113,"div",44)(114,"div",22)(115,"mat-form-field")(116,"mat-select",45)(117,"mat-option",24),e._uU(118,"Select option"),e.qZA(),e.TgZ(119,"mat-option",46),e._uU(120,"Breakup"),e.qZA(),e.TgZ(121,"mat-option",46),e._uU(122,"No Breakup"),e.qZA()(),e.TgZ(123,"mat-error"),e._uU(124,"This field is required"),e.qZA()()()()(),e.YNc(125,Te,16,2,"div",47),e.TgZ(126,"div",48)(127,"div",20)(128,"p",21),e._uU(129,"Freeze calculations "),e.qZA()(),e.TgZ(130,"div",49)(131,"mat-checkbox",50),e.NdJ("change",function(h){return i.freezeCalculation(h)}),e.qZA()(),e.TgZ(132,"div",51)(133,"p",52),e._uU(134),e.ALo(135,"date"),e.qZA()()(),e.TgZ(136,"div",53)(137,"div",20)(138,"p",21),e._uU(139,"Goal name"),e.qZA()(),e.TgZ(140,"div",54)(141,"div",22)(142,"mat-form-field"),e._UZ(143,"input",55,56),e.TgZ(145,"mat-error"),e._uU(146,"This field is required"),e.qZA(),e.TgZ(147,"mat-hint",57),e._uU(148),e.qZA()()()()(),e.TgZ(149,"div",32)(150,"div",20)(151,"p",21),e._uU(152,"Priority "),e.qZA()(),e.TgZ(153,"div",44)(154,"div",22)(155,"mat-form-field")(156,"mat-select",58)(157,"mat-option",59),e._uU(158,"Select option "),e.qZA(),e.TgZ(159,"mat-option",46),e._uU(160,"None"),e.qZA(),e.TgZ(161,"mat-option",46),e._uU(162,"Low"),e.qZA(),e.TgZ(163,"mat-option",46),e._uU(164,"Medium"),e.qZA(),e.TgZ(165,"mat-option",46),e._uU(166,"High"),e.qZA()(),e.TgZ(167,"mat-hint"),e._uU(168,"Optional"),e.qZA()()()()(),e.TgZ(169,"div",37)(170,"p",21),e._uU(171,"Goal notes"),e.qZA(),e.TgZ(172,"app-froala",60),e.NdJ("modelChange",function(h){return i.saveData(h)})("modelChange",function(h){return i.storeData=h}),e.qZA()()()(),e.TgZ(173,"mat-tab",61)(174,"div",62),e.YNc(175,Ze,16,2,"div",63),e.qZA()(),e.TgZ(176,"mat-tab",64)(177,"div",65)(178,"div",66)(179,"span"),e._uU(180),e.qZA(),e.TgZ(181,"table",67),e.ynx(182,68),e.YNc(183,Ce,1,0,"th",69),e.YNc(184,Me,2,1,"td",70),e.BQk(),e.ynx(185,71),e.YNc(186,Oe,2,0,"th",72),e.YNc(187,Se,2,1,"td",73),e.BQk(),e.YNc(188,xe,1,0,"tr",74),e.YNc(189,Ie,1,0,"tr",75),e.qZA()(),e.TgZ(190,"div",76)(191,"table",67),e.ynx(192,77),e.YNc(193,Pe,2,0,"td",78),e.BQk(),e.ynx(194,68),e.YNc(195,Ue,1,0,"th",69),e.YNc(196,qe,2,1,"td",79),e.BQk(),e.ynx(197,71),e.YNc(198,Fe,2,0,"th",80),e.YNc(199,Ye,2,1,"td",81),e.BQk(),e.YNc(200,Ge,1,0,"tr",74),e.YNc(201,Ne,1,0,"tr",75),e.YNc(202,Le,1,0,"tr",82),e.qZA()()()()()()(),e.TgZ(203,"div",83)(204,"div",84)(205,"div",15)(206,"h4",85),e.NdJ("click",function(){return i.close()}),e._uU(207,"Cancel"),e.qZA()(),e.TgZ(208,"div",86)(209,"app-progress-button",87),e.NdJ("btnClick",function(){return i.save()}),e.qZA()()()()()()}if(2&a){const r=e.MAs(105),g=e.MAs(144);e.xp6(10),e.Q6J("selectedIndex",i.selectedTab),e.xp6(2),e.Q6J("formGroup",i.goalDetailsFG),e.xp6(2),e.Q6J("ngIf",1==i.data.goalType),e.xp6(1),e.Q6J("ngIf",8==i.data.goalType||7==i.data.goalType),e.xp6(1),e.Q6J("ngIf",1!=i.data.goalType&&8!=i.data.goalType&&7!=i.data.goalType),e.xp6(4),e.Q6J("inputValidator",i.validatorType.NUMBER_ONLY),e.xp6(3),e.Q6J("ngIf",5==i.data.goalType),e.xp6(11),e.Q6J("ngForOf",i.months),e.xp6(9),e.Q6J("ngForOf",i.years),e.xp6(3),e.Q6J("ngIf",i.savingsSDError),e.xp6(1),e.Q6J("ngIf",i.goalError),e.xp6(11),e.Q6J("ngForOf",i.months),e.xp6(9),e.Q6J("ngForOf",i.yearsEnd),e.xp6(3),e.Q6J("ngIf",i.goalRError),e.xp6(1),e.Q6J("ngIf",i.savingsEDError),e.xp6(2),e.Q6J("ngIf",1!=i.data.goalType),e.xp6(1),e.Q6J("ngIf",1==i.data.goalType),e.xp6(7),e.Q6J("ngForOf",i.months),e.xp6(9),e.Q6J("ngForOf",i.goalStartYears),e.xp6(3),e.Q6J("ngIf",i.goalSDrror),e.xp6(1),e.Q6J("ngIf",2==i.data.singleOrMulti||1==i.data.goalType),e.xp6(8),e.Q6J("matDatepicker",r),e.xp6(1),e.Q6J("for",r),e.xp6(5),e.Q6J("ngIf",i.goalAddError),e.xp6(11),e.Q6J("value",1),e.xp6(2),e.Q6J("value",2),e.xp6(4),e.Q6J("ngIf",2==i.data.singleOrMulti),e.xp6(9),e.hij("Last Freeze date: ",e.xi3(135,48,i.data.remainingData.lastFreezedDate,"dd/MM/yyyy"),""),e.xp6(14),e.hij("",g.value.length," / 30"),e.xp6(11),e.Q6J("value",0),e.xp6(2),e.Q6J("value",2),e.xp6(2),e.Q6J("value",4),e.xp6(2),e.Q6J("value",6),e.xp6(7),e.Q6J("model",i.storeData),e.xp6(2),e.Q6J("formGroup",i.assetAllocationFG),e.xp6(1),e.Q6J("ngIf",1==i.assetAllocationFG.get("strategicOrTactical").value),e.xp6(5),e.Oqu(1==i.data.remainingData.goalSpan?"Short term":"Long term"),e.xp6(1),e.Q6J("dataSource",i.dataSource1),e.xp6(7),e.Q6J("matHeaderRowDef",i.displayedColumns1)("matHeaderRowDefSticky",!0),e.xp6(1),e.Q6J("matRowDefColumns",i.displayedColumns1),e.xp6(2),e.Q6J("dataSource",i.dataSource),e.xp6(9),e.Q6J("matHeaderRowDef",i.displayedColumns)("matHeaderRowDefSticky",!0),e.xp6(1),e.Q6J("matRowDefColumns",i.displayedColumns),e.xp6(1),e.Q6J("matHeaderRowDef",e.DdM(51,Re)),e.xp6(7),e.Q6J("disabled",i.freez)("options",i.barButtonOptions)}},dependencies:[q.sg,q.O5,R.ey,y.oG,S.Mq,S.hl,S.nW,f.TO,f.KE,f.bx,f.R9,D.Nt,A.gD,v.BZ,v.fO,v.as,v.w1,v.Dz,v.nj,v.ge,v.ev,v.XQ,v.Gk,U.SP,U.uX,d.Fj,d.JJ,d.JL,d.nD,d.On,d.sg,d.u,N.k,j.L,V.Q,W.l,q.uU]}),s})();const we=[{position:"Debt asset class",name:"7%"},{position:"Equity asset class",name:"17%"},{position:"Debt funds",name:"12%"},{position:"Equity funds",name:"10%"},{position:"Balanced funds",name:"7%"},{position:"Stocks",name:"7%"},{position:"Real Estates",name:"7%"},{position:"Bank Accounts Saving",name:"7%"},{position:"Commodities - Gold",name:"7%"},{position:"Commodities- Others",name:"7%"},{position:"Traditional returns",name:"7%"},{position:"Ulip returns",name:"7%"}],Be=[{position:"Inflation rate",name:"6%"}]},71464:(K,Y,l)=>{l.d(Y,{y:()=>E});var d=l(65923),x=l(94650),C=l(36895);let E=(()=>{class O{constructor(_){this.datePipe=_}createGoalObjForGoalTypes(_,p){switch(_.singleOrMulti){case 1:return this.createSingleYearObj(_,p);
1case 2:return this.createMultiYearEditObj(_,p)}}createMultiYearEditObj(_,p){const t=_.remainingData;let M=p.goalStartDateYear+"-"+p.goalStartDateMonth+"-01",I=p.goalEndDateYear+"-"+p.goalEndDateMonth+"-01",e={id:t.id,goalType:_.goalType,clientId:t.clientId,advisorId:t.advisorId,name:p.name,notes:p.notes,goalEndDate:I,goalStartDate:M,futureValue:p.goalValue,presentValue:p.goalValue,isArchived:p.archiveGoal||!1,isFreezed:p.freezeCalculation||!1,stepUp:p.stepUp,frequency:p.frequency,savingStartDate:p.savingStartDateYear+"-"+p.savingStartDateMonth+"-01",savingEndDate:p.savingEndDateYear+"-"+p.savingEndDateMonth+"-01",savingStatus:p.savingStatus,priorityFlag:p.priorityFlag,savingTypeStatus:p.savingTypeStatus,goalAdditionDate:this.datePipe.transform(p.goalAdditionDate,"yyyy-MM-dd")};switch(e.isFreezed&&(e.lastFreezedDate=this.datePipe.transform(new Date,d.$.DATE_FORMAT_DASHED)),_.goalType){case d.$.VACATION_GOAL:e.vacationStartYr=M,e.vacationEndYr=I;break;case d.$.EDUCATION_GOAL:e.ageAttheStartofTheCourse=new Date(M).getFullYear()-(new Date).getFullYear()+t.presentAge,e.ageAtTheEndofTheCourse=new Date(I).getFullYear()-(new Date).getFullYear()+t.presentAge}return e}createSingleYearObj(_,p){const t=_.remainingData;let e={id:t.id,goalType:_.goalType,clientId:t.clientId,advisorId:t.advisorId,goalName:p.name,notes:p.notes,archivedValue:p.archiveGoal?1:0,isFreezed:p.freezeCalculation?1:0,savingStatus:p.savingStatus,priorityFlag:p.priorityFlag,savingStartDate:p.savingStartDateYear+"-"+p.savingStartDateMonth+"-01",savingEndDate:p.savingEndDateYear+"-"+p.savingEndDateMonth+"-01",goalStartDate:p.goalStartDateYear+"-"+p.goalStartDateMonth+"-01",goalEndDate:p.goalEndDateYear+"-"+p.goalEndDateMonth+"-01",savingType:p.savingStatus,goalAdditionDate:this.datePipe.transform(p.goalAdditionDate,"yyyy-MM-dd")};switch(_.goalType){case d.$.CAR_GOAL:case d.$.HOUSE_GOAL:case d.$.OTHERS_GOAL:case d.$.BIG_SPEND_GOAL:case d.$.MARRIAGE_GOAL:e.goalPresentValue=p.goalValue;break;case d.$.WEALTH_CREATION_GOAL:case d.$.EMERGENCY_GOAL:e.goalFV=p.goalValue;break;case d.$.RETIREMENT_GOAL:e.goalPresentValue=p.goalValue;break;default:return console.error("Invalid goal type found",_.goalType),0}return e.isFreezed&&(e.lastFreezedDate=this.datePipe.transform(new Date,d.$.DATE_FORMAT_DASHED)),e}getGoalValueForForm(_){if(2==_.singleOrMulti)switch(_.goalType){case d.$.VACATION_GOAL:case d.$.EDUCATION_GOAL:return _.remainingData.presentValue;default:return console.error("Invalid goal type found",_.goalType),0}else switch(_.goalType){case d.$.CAR_GOAL:case d.$.HOUSE_GOAL:case d.$.OTHERS_GOAL:case d.$.BIG_SPEND_GOAL:case d.$.MARRIAGE_GOAL:return _.remainingData.goalPresentValue;case d.$.WEALTH_CREATION_GOAL:case d.$.EMERGENCY_GOAL:return _.remainingData.goalFV;case d.$.RETIREMENT_GOAL:return _.remainingData.goalPresentValue;default:return console.error("Invalid goal type found",_.goalType),0}}}return O.\u0275fac=function(_){return new(_||O)(x.LFG(C.uU))},O.\u0275prov=x.Yz7({token:O,factory:O.\u0275fac}),O})()}}]);

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.