1(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{"/NUC":function(e,t,n){"use strict";n.d(t,"a",(function(){return mi}));var i=n("mrSG"),c=n("fXoL"),o=n("TiNC"),s=n("6h7t"),a=n("AcyG"),l=n("gFZo"),r=n("XNiG"),d=n("LW8c"),u=n("Kj3r"),h=n("/uUt"),p=n("vkgz"),m=n("G/fY"),f=n("XRmg"),g=n("nY4S"),b=n("MFdG"),S=n("+NfP"),y=n("iEbP"),v=n("qf4f"),M=n("dEAy"),C=n("bNXi"),q=n("ZyQt"),T=n("tyNb"),w=n("bz11"),z=n("ORRK"),D=n("1W/n"),P=n("W8w6"),I=n("H2Td"),k=n("ofXK"),A=n("Q3HA"),E=n("tqmv"),F=n("6l6k"),O=n("66kx"),U=n("2VHv"),x=n("drXJ"),L=n("B+r4"),R=n("OtHt"),N=n("FwiY"),B=n("OzZK"),_=n("t7Fq"),V=n("9WYH");function H(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-modal",2),c.zc("nzOnCancel",(function(){return c.dd(e),c.Dc().onClose()})),c.rc(1,"h3"),c.mc(2,"i",3),c.qd(3,"Void Transaction"),c.qc(),c.rc(4,"p"),c.qd(5,"Are you sure you want to void this transaction ?"),c.qc(),c.rc(6,"div",4),c.rc(7,"button",5),c.zc("click",(function(){return c.dd(e),c.Dc().onClose()})),c.qd(8,"Cancel"),c.qc(),c.rc(9,"button",6),c.zc("click",(function(){return c.dd(e),c.Dc().onConfirm()})),c.qd(10,"Confirm"),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Mc("nzFooter",null)("nzTitle",null)("nzVisible",e.show)}}function $(e,t){if(1&e){const e=c.sc();c.rc(0,"b2c-mobile-drawer",7),c.zc("showChange",(function(){return c.dd(e),c.Dc().onClose()}))("showChange",(function(t){return c.dd(e),c.Dc().show=t})),c.rc(1,"h3"),c.mc(2,"i",3),c.qd(3,"Void Transaction"),c.qc(),c.rc(4,"p"),c.qd(5,"Are you sure you want to void this transaction ?"),c.qc(),c.rc(6,"b2c-floating-bar"),c.rc(7,"button",8),c.zc("click",(function(){return c.dd(e),c.Dc().onClose()})),c.qd(8,"Cancel"),c.qc(),c.rc(9,"button",9),c.zc("click",(function(){return c.dd(e),c.Dc().onConfirm()})),c.qd(10,"Confirm"),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Mc("show",e.show)("hideButtons",!0)("height",300)}}let j=(()=>{class e{constructor(){this.close=new c.s,this.confirm=new c.s}ngOnInit(){}onClose(){this.close.emit()}onConfirm(){this.confirm.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.fc({type:e,selectors:[["app-rmo-void-confirmation-modal"]],inputs:{show:"show"},outputs:{close:"close",confirm:"confirm"},features:[c.Tb([U.a])],decls:4,vars:6,consts:[["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel",4,"ngIf"],["actionText","Done",3,"show","hideButtons","height","showChange",4,"ngIf"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"text-danger","mr-2"],[1,"d-flex","justify-content-end","align-items-center","p-3"],["nz-button","","nzType","outline",1,"px-3","mr-2",3,"click"],["nz-button","","nzType","primary",3,"click"],["actionText","Done",3,"show","hideButtons","height","showChange"],["nz-button","","nzType","outline",1,"w-100","mb-2",3,"click"],["nz-button","","nzType","primary",1,"w-100",3,"click"]],template:function(e,t){1&e&&(c.od(0,H,11,3,"nz-modal",0),c.Ec(1,"async"),c.od(2,$,11,3,"b2c-mobile-drawer",1),c.Ec(3,"async")),2&e&&(c.Mc("ngIf",!c.Fc(1,2,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(3,4,t.isMobile$)))},directives:[k.t,M.a,N.b,B.a,_.a,V.a],pipes:[k.b],styles:[""]}),Object(i.c)([Object(a.e)(l.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var G=n("gp8a"),W=n("FQWw"),Y=n("ffUl"),K=n("Qw10"),X=n("1Z1e"),Q=n("rMZv"),Z=n("2uUe"),J=n("ar4Q"),ee=n("SYWN"),te=n("5vfD"),ne=n("cFE8"),ie=n("P+IN"),ce=n("J7y+"),oe=n("5vDB"),se=n("45Og");function ae(e,t){1&e&&(c.rc(0,"h3"),c.qd(1,"Order Details"),c.qc())}const le=function(){return{title:"Contract Number",charge:"Sales Charge"}};function re(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(20);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,le))}}function de(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(20);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,le))}}const ue=function(){return{title:"Income Distribution Reference Number",charge:"Sales Charge"}};function he(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(20);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,ue))}}const pe=function(){return{title:"Transfer In Reference Number",charge:"Sales Charge"}};function me(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(20);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,pe))}}const fe=function(){return{title:"Transfer Out Reference Number"}};function ge(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(22);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,fe))}}const be=function(){return{title:"Contract Number"}};function Se(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(22);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,be))}}const ye=function(){return{title:"Contract Number",charge:"Switching Fee"}};function ve(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(20);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,ye))}}function Me(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(22);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,be))}}function Ce(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(20);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,ye))}}function qe(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(20);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,ye))}}function Te(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(22);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,be))}}function we(e,t){if(1&e&&(c.pc(0),c.nc(1,23),c.oc()),2&e){c.Dc(2);const e=c.ad(22);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Rc(2,be))}}function ze(e,t){if(1&e&&(c.pc(0),c.pc(1,1),c.od(2,re,2,3,"ng-container",2),c.od(3,de,2,3,"ng-container",2),c.od(4,he,2,3,"ng-container",2),c.od(5,me,2,3,"ng-container",2),c.od(6,ge,2,3,"ng-container",2),c.od(7,Se,2,3,"ng-container",2),c.od(8,ve,2,3,"ng-container",2),c.od(9,Me,2,3,"ng-container",2),c.od(10,Ce,2,3,"ng-container",2),c.od(11,qe,2,3,"ng-container",2),c.od(12,Te,2,3,"ng-container",2),c.od(13,we,2,3,"ng-container",2),c.oc(),c.oc()),2&e){const e=c.Dc();c.Ub(1),c.Mc("ngSwitch",null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.BUY),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.RSP),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.INCOME_DISTRIBUTION),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.TRANSFER_IN),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.TRANSFER_OUT),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.SELL),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.SWITCH_BUY),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.SWITCH_SELL),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.SWITCH_BUY_INTER),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.SWITCH_BUY_INTRA),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.SWITCH_SELL_INTER),c.Ub(1),c.Mc("ngSwitchCase",e.iPendingTransactionTypeEnum.SWITCH_SELL_INTRA)}}function De(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(3);const e=c.ad(28);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Pe(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(3);const e=c.ad(28);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Ie(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(3);const e=c.ad(30);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function ke(e,t){if(1&e&&(c.pc(0),c.pc(1,1),c.od(2,De,2,1,"ng-container",2),c.od(3,Pe,2,1,"ng-container",2),c.od(4,Ie,2,1,"ng-container",2),c.oc(),c.oc()),2&e){const e=c.Dc(2);c.Ub(1),c.Mc("ngSwitch",null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType),c.Ub(1),c.Mc("ngSwitchCase","Market"),c.Ub(1),c.Mc("ngSwitchCase","Price"),c.Ub(1),c.Mc("ngSwitchCase","Firm")}}function Ae(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(3);const e=c.ad(32);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Ee(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(3);const e=c.ad(32);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Fe(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(3);const e=c.ad(34);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Oe(e,t){if(1&e&&(c.pc(0),c.pc(1,1),c.od(2,Ae,2,1,"ng-container",2),c.od(3,Ee,2,1,"ng-container",2),c.od(4,Fe,2,1,"ng-container",2),c.oc(),c.oc()),2&e){const e=c.Dc(2);c.Ub(1),c.Mc("ngSwitch",null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType),c.Ub(1),c.Mc("ngSwitchCase","Market"),c.Ub(1),c.Mc("ngSwitchCase","Price"),c.Ub(1),c.Mc("ngSwitchCase","Firm")}}function Ue(e,t){if(1&e&&(c.pc(0),c.pc(1,1),c.od(2,ke,5,4,"ng-container",2),c.od(3,Oe,5,4,"ng-container",2),c.oc(),c.oc()),2&e){const e=c.Dc();c.Ub(1),c.Mc("ngSwitch",null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType),c.Ub(1),c.Mc("ngSwitchCase","Buy"),c.Ub(1),c.Mc("ngSwitchCase","Sell")}}function xe(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(2);const e=c.ad(36);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Le(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(2);const e=c.ad(38);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Re(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc(2);const e=c.ad(36);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Ne(e,t){if(1&e&&(c.pc(0),c.pc(1,1),c.od(2,xe,2,1,"ng-container",2),c.od(3,Le,2,1,"ng-container",2),c.od(4,Re,2,1,"ng-container",2),c.oc(),c.oc()),2&e){const e=c.Dc();c.Ub(1),c.Mc("ngSwitch",null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType),c.Ub(1),c.Mc("ngSwitchCase","Buy"),c.Ub(1),c.Mc("ngSwitchCase","Sell"),c.Ub(1),c.Mc("ngSwitchCase","RSP")}}function Be(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc();const e=c.ad(40);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function _e(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc();const e=c.ad(42);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function Ve(e,t){if(1&e&&(c.pc(0),c.nc(1,24),c.oc()),2&e){c.Dc();const e=c.ad(44);c.Ub(1),c.Mc("ngTemplateOutlet",e)}}function He(e,t){if(1&e){const e=c.sc();c.rc(0,"button",25),c.zc("click",(function(){return c.dd(e),c.Dc().onShowVoidConfirm()})),c.qd(1," Void "),c.qc()}if(2&e){const e=c.Dc();c.Mc("nzLoading",e.isVoidButtonLoading)}}function $e(e,t){if(1&e){const e=c.sc();c.rc(0,"button",25),c.zc("click",(function(){return c.dd(e),c.Dc().onVoidClick()})),c.qd(1," Void "),c.qc()}if(2&e){const e=c.Dc();c.Mc("nzLoading",e.isVoidButtonLoading)}}function je(e,t){if(1&e){const e=c.sc();c.rc(0,"button",25),c.zc("click",(function(){return c.dd(e),c.Dc().onEditClick()})),c.qd(1," Modify Scheduled Sell "),c.qc()}if(2&e){const e=c.Dc();c.Mc("nzLoading",e.isVoidButtonLoading)}}function Ge(e,t){if(1&e){const e=c.sc();c.rc(0,"button",26),c.zc("click",(function(){c.dd(e);const t=c.Dc();return t.onPayNowClick(t.pendingTableInfoModel)})),c.qd(1," Pay Now "),c.qc()}}function We(e,t){if(1&e){const e=c.sc();c.rc(0,"button",27),c.zc("click",(function(){return c.dd(e),c.Dc().onShowCoolingOff()})),c.qd(1," Exercise Cooling Off "),c.qc()}}function Ye(e,t){if(1&e){const e=c.sc();c.rc(0,"button",26),c.zc("click",(function(){return c.dd(e),c.Dc().onDoneClick()})),c.qd(1," Done "),c.qc()}}const Ke=function(e){return{title:"Investment Account",value:e}};function Xe(e,t){if(1&e&&c.nc(0,23),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(2,Ke,null==e.investmentAccount?null:e.investmentAccount.nricName))}}const Qe=function(e){return{title:"Product Type",value:e}};function Ze(e,t){if(1&e&&c.nc(0,23),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(2,Qe,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.productTypeDisplay))}}const Je=function(e){return{title:"Order Date",value:e}},et=function(e){return{title:"Product Name",value:e}},tt=function(e,t){return{title:"Action",value:e,class:t}},nt=function(e){return{title:"Order Number",value:e}};function it(e,t){if(1&e&&(c.od(0,Xe,1,4,"ng-container",28),c.Ec(1,"async"),c.nc(2,23),c.Ec(3,"sdate"),c.od(4,Ze,1,4,"ng-container",28),c.Ec(5,"async"),c.nc(6,23),c.nc(7,23),c.nc(8,23)),2&e){const e=t.action,n=t.class,i=c.Dc(),o=c.ad(46);c.Mc("ngIf",!c.Fc(1,10,i.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(16,Je,c.Fc(3,12,null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.orderDate))),c.Ub(2),c.Mc("ngIf",!c.Fc(5,14,i.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(18,et,null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.productName)),c.Ub(1),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Tc(20,tt,e,n)),c.Ub(1),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(23,nt,null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.orderNum))}}const ct=function(e){return{title:"Status",value:e}};function ot(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)))}}const st=function(e){return{action:e,class:"text-profit"}},at=function(e,t){return{title:e,value:t}},lt=function(e){return{title:"Transaction Date",value:e}},rt=function(e){return{title:"Investment Amount",value:e}},dt=function(e){return{title:"Investment Units",value:e}},ut=function(e){return{title:"Purchase Price",value:e}},ht=function(e){return{title:"Payment Method",value:e}};function pt(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.nc(2,23),c.Ec(3,"sdate"),c.nc(4,23),c.Ec(5,"number"),c.nc(6,23),c.Ec(7,"number"),c.nc(8,23),c.nc(9,23),c.nc(10,23),c.od(11,ot,2,6,"ng-container",28),c.Ec(12,"async")),2&e){const e=t.title,n=t.charge,i=c.Dc(),o=c.ad(18),s=c.ad(46);c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(27,st,null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutlet",s)("ngTemplateOutletContext",c.Tc(29,at,e,null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.contractNo)),c.Ub(1),c.Mc("ngTemplateOutlet",s)("ngTemplateOutletContext",c.Sc(32,lt,(null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.transactionDate)===i.DEFAULT_DATE_NUMBER?"To be confirmed":c.Fc(3,17,null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.transactionDate))),c.Ub(2),c.Mc("ngTemplateOutlet",s)("ngTemplateOutletContext",c.Sc(34,rt,0===(null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.amount)?"To be confirmed":(null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.currency)+" "+c.Gc(5,19,null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.amount,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",s)("ngTemplateOutletContext",c.Sc(36,dt,0===(null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.units)?"To be confirmed":c.Gc(7,22,null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.units,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",s)("ngTemplateOutletContext",c.Tc(38,at,n,null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.salesCharge)),c.Ub(1),c.Mc("ngTemplateOutlet",s)("ngTemplateOutletContext",c.Sc(41,ut,0===(null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.price)?"To be confirmed":(null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.fundCurrency)+" "+(null==i.pendingTableInfoModel||null==i.pendingTableInfoModel.pendingTransactionModel?null:i.pendingTableInfoModel.pendingTransactionModel.price))),c.Ub(1),c.
1Mc("ngTemplateOutlet",s)("ngTemplateOutletContext",c.Sc(43,ht,null==i.pendingTableInfoModel?null:i.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(12,25,i.isMobile$))}}const mt=function(e){return{action:e,class:"text-danger"}},ft=function(e){return{title:"Units Sold",value:e}},gt=function(e){return{title:"Redemption Fee",value:e}},bt=function(e){return{title:"Redemption Amount",value:e}},St=function(e){return{title:"Redemption Method",value:e}},yt=function(e){return{title:"Complete Date",value:e,hideDivider:!0}};function vt(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.nc(2,23),c.nc(3,23),c.nc(4,23),c.Ec(5,"number"),c.nc(6,23),c.nc(7,23),c.Ec(8,"sdate"),c.nc(9,23),c.Ec(10,"sdate")),2&e){const e=t.title,n=c.Dc(),i=c.ad(18),o=c.ad(46);c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(23,mt,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Tc(25,at,e,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.contractNo)),c.Ub(1),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(28,ft,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.units)),c.Ub(1),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(30,gt,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.redemptionFee)||"-")),c.Ub(1),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(32,bt,0===(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.redemptionAmount)?"To be confirmed":(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.currency)+" "+c.Gc(5,16,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.redemptionAmount,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(34,St,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(36,lt,(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.transactionDate)===n.DEFAULT_DATE_NUMBER?"To be confirmed":c.Fc(8,19,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.transactionDate))),c.Ub(2),c.Mc("ngTemplateOutlet",o)("ngTemplateOutletContext",c.Sc(38,yt,(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.redemptionSettlementDate)===n.DEFAULT_DATE_NUMBER?"To be confirmed":c.Fc(10,21,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.redemptionSettlementDate)))}}function Mt(e,t){if(1&e&&c.nc(0,23),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(2,Ke,e.investmentAccount.refno))}}function Ct(e,t){if(1&e&&c.nc(0,23),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(2,Qe,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.productTypeDisplay))}}const qt=function(e){return{title:"Ind. Price",value:e}};function Tt(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(5,qt,null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.pendingTransactionModel&&e.pendingTableInfoModel.pendingTransactionModel.indicativePrice?c.Gc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.indicativePrice,"1.4-4"):"-"))}}const wt=function(e){return{title:"Limit Price",value:e}};function zt(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"number"),c.Ec(2,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(8,wt,"Buy"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionType)?null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.pendingTransactionModel&&e.pendingTableInfoModel.pendingTransactionModel.maxPrice?c.Gc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.maxPrice,"1.4-4"):"-":null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.pendingTransactionModel&&e.pendingTableInfoModel.pendingTransactionModel.minPrice?c.Gc(2,5,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.minPrice,"1.3-3"):"-"))}}function Dt(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"number"),c.Ec(2,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Tc(8,at,"Buy"!==(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)||"Market"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)&&"Price"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)?"Sell"!==(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)||"Market"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)&&"Price"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)?"Transacted Amount":"Est. Redemption Amount":"Est. Payable Amou
1nt ("+(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.pendingTransactionModel.productCurrency)+")",(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.pendingTransactionModel.productCurrency)+" "+("priced"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Gc(1,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.amountProductCur,"1.2-2"):c.Gc(2,5,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.estAmtPayable,"1.2-2"))))}}const Pt=function(e){return{title:"Indicative FX Conversion Rate",value:e}};function It(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(5,Pt,null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.pendingTransactionModel&&e.pendingTableInfoModel.pendingTransactionModel.fxConversionRate?c.Gc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.fxConversionRate,"1.6-6"):"-"))}}function kt(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Tc(5,at,"Buy"!==(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)||"Market"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)&&"Price"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)?"Sell"!==(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)||"Market"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)&&"Price"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)?"Transacted Amount":"Est. Redemption Amount":"Est. Payable Amount ("+(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+")",(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+c.Gc(1,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.totalAmount,"1.2-2")))}}function At(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Tc(5,at,"Buy"!==(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)||"Market"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)&&"Price"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)?"Sell"!==(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)||"Market"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)&&"Price"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.orderType)?"Transacted Amount":"Redemption Amount":"Transacted Amount",(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+c.Gc(1,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.amountInvest,"1.2-2")))}}const Et=function(e){return{title:"Contract Number",value:e}},Ft=function(e){return{title:"Nominal Value",value:e}},Ot=function(e){return{title:"Order Type",value:e}},Ut=function(e){return{title:"Processing Fee",value:e}},xt=function(e){return{title:"Ind. Accrued Interest",value:e}};function Lt(e,t){if(1&e&&(c.od(0,Mt,1,4,"ng-container",28),c.Ec(1,"async"),c.nc(2,23),c.Ec(3,"sdate"),c.nc(4,23),c.nc(5,23),c.od(6,Ct,1,4,"ng-container",28),c.Ec(7,"async"),c.nc(8,23),c.nc(9,23),c.nc(10,23),c.Ec(11,"number"),c.nc(12,23),c.od(13,Tt,2,7,"ng-container",28),c.od(14,zt,3,10,"ng-container",28),c.nc(15,23),c.Ec(16,"number"),c.nc(17,23),c.Ec(18,"number"),c.od(19,Dt,3,11,"ng-container",28),c.od(20,It,2,7,"ng-container",28),c.od(21,kt,2,8,"ng-container",28),c.od(22,At,2,8,"ng-container",28)),2&e){const e=t.textColour,n=c.Dc(),i=c.ad(46);c.Mc("ngIf",!c.Fc(1,26,n.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(41,Je,c.Fc(3,28,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.orderDate))),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(43,nt,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.orderNum)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(45,Et,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.contractNo)),c.Ub(1),c.Mc("ngIf",!c.Fc(7,30,n.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(47,et,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.productName)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Tc(49,tt,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.transactionType,e)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(52,Ft,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)+" "+c.Gc(11,32,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.nominalValue,"1.0-0"))),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(54,Ot,"Price"===(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.orderType)?"Limit":null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.orderType)),c.Ub(1),c.Mc("ngIf","Market"===(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.orderType)),c.Ub(1),c.Mc("ngIf","Price"===(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.orderType)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(56,Ut,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)+" "+c.Gc(16,35,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.processingFee,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(58,xt,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)+" "+c.Gc(18,38,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.accruedInt,"1.2-2"))),c.Ub(2),c.Mc("ngIf",(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.currency)!==(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)&&"Buy"===(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.transactionType)&&"complete"!==(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.status)),c.Ub(1),c.Mc("ngIf",(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.currency)!==(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)&&"Buy"===(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngIf","complete"!==(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.status)),c.Ub(1),c.Mc("ngIf","complete"===(null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.status))}}function Rt(e,t){if(1&e&&c.nc(0,23),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(2,Ke,e.investmentAccount.refno))}}function Nt(e,t){if(1&e&&c.nc(0,23),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(2,Qe,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.productTypeDisplay))}}const Bt=function(e){return{title:"FX Conversion Rate Applied",value:e}};function _t(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(5,Bt,null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.pendingTransactionModel&&e.pendingTableInfoModel.pendingTransactionModel.fxConversionRate?c.Gc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.fxConversionRate,"1.4-4"):"-"))}}const Vt=function(){return{title:"Order Type",value:"Bond Express"}},Ht=function(e){return{title:"Transacted Price",value:e}},$t=function(e){return{title:"Accrued Interest",value:e}},jt=function(e){return{title:"Settlement Amount",value:e}};function Gt(e,t){if(1&e&&(c.od(0,Rt,1,4,"ng-container",28),c.Ec(1,"async"),c.nc(2,23),c.Ec(3,"sdate"),c.nc(4,23),c.nc(5,23),c.od(6,Nt,1,4,"ng-container",28),c.Ec(7,"async"),c.nc(8,23),c.nc(9,23),c.nc(10,23),c.Ec(11,"number"),c.nc(12,23),c.nc(13,23),c.Ec(14,"number"),c.nc(15,23),c.Ec(16,"number"),c.nc(17,23),c.Ec(18,"number"),c.od(19,_t,2,7,"ng-container",28),c.nc(20,23),c.Ec(21,"number")),2&e){const e=t.textColour,n=c.Dc(),i=c.ad(46);c.Mc("ngIf",!c.Fc(1,25,n.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(46,Je,c.Fc(3,27,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.orderDate))),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(48,nt,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.orderNum)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(50,Et,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.contractNo)),c.Ub(1),c.Mc("ngIf",!c.Fc(7,29,n.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(52,et,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.productName)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Tc(54,tt,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.transactionType,e)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(57,Ft,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)+" "+c.Gc(11,31,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.nominalValue,"1.0-0"))),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Rc(59,Vt)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(60,Ht,null!=n.pendingTableInfoModel&&null!=n.pendingTableInfoModel.pendingTransactionModel&&n.pendingTableInfoModel.pendingTransactionModel.transactedPrice?c.Gc(14,34,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.transactedPrice,"1.4-4"):"-")),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(62,Ut,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)+" "+c.Gc(16,37,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.processingFee,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(64,$t,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)+" "+c.Gc(18,40,null==n.pendingTableInfoModel||null==n.pendingTableInfoModel.pendingTransactionModel?null:n.pendingTableInfoModel.pendingTransactionModel.accruedInt,"1.2-2"))),c.Ub(2),c.Mc("ngIf",(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.currency)!==(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.pendingTransactionModel.productCurrency)&&"Buy"===(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutlet",i)("ngTemplateOutletContext",c.Sc(66,jt,(null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.currency)+" "+c.Gc(21,43,null==n.pendingTableInfoModel?null:n.pendingTableInfoModel.totalAmount,"1.2-2")))}}function Wt(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)))}}const Yt=function(){return{textColour:"text-profit"}},Kt=function(e){return{title:"Settlement Date",value:e}};function Xt(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.od(2,Wt,2,6,"ng-container",28),c.Ec(3,"async"),c.nc(4,23),c.Ec(5,"sdate"),c.nc(6,23),c.Ec(7,"sdate")),2&e){const e=c.Dc(),t=c.ad(24),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Rc(15,Yt)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(16,ht,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(3,9,e.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(18,lt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(5,11,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionCompleteDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed")),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(20,Kt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(7,13,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.settlementCompleteDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed"))}}function Qt(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)))}}function Zt(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.od(2,Qt,2,6,"ng-container",28),c.Ec(3,"async"),c.nc(4,23),c.Ec(5,"sdate"),c.nc(6,23),c.Ec(7,"sdate")),2&e){const e=c.Dc(),t=c.ad(26),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Rc(15,Yt)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(16,ht,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(3,9,e.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(18,lt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(5,11,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingT
1ableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed")),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(20,Kt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(7,13,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed"))}}function Jt(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)))}}const en=function(){return{textColour:"text-danger"}};function tn(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.od(2,Jt,2,6,"ng-container",28),c.Ec(3,"async"),c.nc(4,23),c.Ec(5,"sdate"),c.nc(6,23),c.Ec(7,"sdate")),2&e){const e=c.Dc(),t=c.ad(24),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Rc(15,en)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(16,St,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(3,9,e.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(18,lt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(5,11,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionCompleteDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed")),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(20,Kt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(7,13,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.settlementCompleteDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed"))}}function nn(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)))}}function cn(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.od(2,nn,2,6,"ng-container",28),c.Ec(3,"async"),c.nc(4,23),c.Ec(5,"sdate"),c.nc(6,23),c.Ec(7,"sdate")),2&e){const e=c.Dc(),t=c.ad(26),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Rc(15,en)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(16,St,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(3,9,e.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(18,lt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(5,11,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed")),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(20,Kt,"complete"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?c.Fc(7,13,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionDate):"void"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)||"unfulfilled"===(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"N.A":"To be confirmed"))}}function on(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.status)))}}const sn=function(e){return{title:"Subscription Fee",value:e}};function an(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.nc(2,23),c.Ec(3,"sdate"),c.Ec(4,"sdate"),c.nc(5,23),c.Ec(6,"number"),c.nc(7,23),c.nc(8,23),c.od(9,on,2,6,"ng-container",28),c.Ec(10,"async"),c.nc(11,23),c.Ec(12,"sdate")),2&e){const e=c.Dc(),t=c.ad(18),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(26,st,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(28,Et,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.contractNo)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(30,lt,(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionDate)===e.DEFAULT_DATE_NUMBER||"processing"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"To be confirmed":e.pendingTableInfoModel.pendingTransactionModel.contractGenDate?c.Fc(3,15,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.contractGenDate):c.Fc(4,17,e.pendingTableInfoModel.transactionDate))),c.Ub(3),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(32,rt,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+c.Gc(6,19,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.amount,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(34,sn,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.salesCharge)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(36,ht,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(10,22,e.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(38,yt,(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.settlementDate)===e.DEFAULT_DATE_NUMBER?"To be confirmed":c.Fc(12,24,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.settlementDate)))}}function ln(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.status)))}}function rn(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.nc(2,23),c.Ec(3,"number"),c.nc(4,23),c.od(5,ln,2,6,"ng-container",28),c.Ec(6,"async"),c.nc(7,23),c.Ec(8,"sdate"),c.Ec(9,"sdate"),c.nc(10,23),c.Ec(11,"sdate")),2&e){const e=c.Dc(),t=c.ad(18),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(24,mt,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(26,Et,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.contractNo)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(28,bt,null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.pendingTransactionModel&&e.pendingTableInfoModel.pendingTransactionModel.redemptionAmount&&0!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.redemptionAmount)?(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+c.Gc(3,13,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.redemptionAmount,"1.2-2"):"To be confirmed")),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(30,St,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(6,16,e.isMobile$)),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(32,lt,(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.transactionDate)===e.DEFAULT_DATE_NUMBER||"processing"!==(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.status)?"To be confirmed":e.pendingTableInfoModel.pendingTransactionModel.contractGenDate?c.Fc(8,18,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.contractGenDate):c.Fc(9,20,e.pendingTableInfoModel.transactionDate))),c.Ub(3),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(34,yt,(null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.settlementDate)===e.DEFAULT_DATE_NUMBER?"To be confirmed":c.Fc(11,22,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.settlementDate)))}}function dn(e,t){if(1&e&&(c.pc(0),c.nc(1,30),c.Ec(2,"sdate"),c.oc()),2&e){const e=c.Dc(2),t=c.ad(18);c.Ub(1),c.Mc("ngTemplateOutletContext",c.Sc(4,mt,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)+" @ "+c.Fc(2,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionDate)))("ngTemplateOutlet",t)}}function un(e,t){if(1&e&&(c.pc(0),c.nc(1,30),c.oc()),2&e){const e=c.Dc(2),t=c.ad(18);c.Ub(1),c.Mc("ngTemplateOutletContext",c.Sc(2,st,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType))("ngTemplateOutlet",t)}}function hn(e,t){if(1&e&&c.nc(0,30),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutletContext",c.Sc(2,St,null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.method&&e.pendingTableInfoModel.method.includes(e.transactionConstant.AUTO_SWEEP)?(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method):(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" Cash Account"))("ngTemplateOutlet",t)}}function pn(e,t){if(1&e&&c.nc(0,30),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutletContext",c.Sc(2,ht,null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.method&&e.pendingTableInfoModel.method.includes(e.transactionConstant.AUTO_SWEEP)?null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method:(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" Cash Account"))("ngTemplateOutlet",t)}}function mn(e,t){if(1&e&&(c.nc(0,30),c.Ec(1,"number")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutletContext",c.Sc(5,rt,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+c.Gc(1,2,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.amount)||"0","1.2-2")))("ngTemplateOutlet",t)}}const fn=function(e){return{title:"Quantity",value:e}},gn=function(){return{title:"Fee",value:"To be confirmed"}};function bn(e,t){if(1&e&&(c.pc(0,1),c.od(1,dn,3,6,"ng-container",2),c.od(2,un,2,4,"ng-container",2),c.oc(),c.od(3,hn,1,4,"ng-container",29),c.od(4,pn,1,4,"ng-container",29),c.nc(5,30),c.Ec(6,"titlecase"),c.od(7,mn,2,7,"ng-container",29),c.nc(8,30),c.Ec(9,"number"),c.nc(10,30)),2&e){const e=c.Dc(),t=c.ad(46);c.Mc("ngSwitch",null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType),c.Ub(1),c.Mc("ngSwitchCase","Sc
1heduled Sell"),c.Ub(1),c.Mc("ngSwitchCase","RSP"),c.Ub(1),c.Mc("ngIf","Scheduled Sell"===(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngIf","RSP"===(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutletContext",c.Sc(17,ct,c.Fc(6,12,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.status)))("ngTemplateOutlet",t),c.Ub(2),c.Mc("ngIf","RSP"===(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutletContext",c.Sc(19,fn,null!=e.pendingTableInfoModel&&null!=e.pendingTableInfoModel.pendingTransactionModel&&e.pendingTableInfoModel.pendingTransactionModel.units?c.Gc(9,14,null==e.pendingTableInfoModel||null==e.pendingTableInfoModel.pendingTransactionModel?null:e.pendingTableInfoModel.pendingTransactionModel.units,"1.0-4"):"To be confirmed"))("ngTemplateOutlet",t),c.Ub(2),c.Mc("ngTemplateOutletContext",c.Rc(21,gn))("ngTemplateOutlet",t)}}function Sn(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.status)))}}const yn=function(e){return{title:"Amount",value:e}};function vn(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.Ec(2,"sdate"),c.nc(3,23),c.Ec(4,"number"),c.nc(5,23),c.od(6,Sn,2,6,"ng-container",28),c.Ec(7,"async")),2&e){const e=c.Dc(),t=c.ad(18),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(16,st,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(18,lt,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionDate)===e.DEFAULT_DATE_NUMBER?"To be confirmed":c.Fc(2,9,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionDate))),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(20,yn,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+c.Gc(4,11,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.amount,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(22,ht,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(7,14,e.isMobile$))}}function Mn(e,t){if(1&e&&(c.nc(0,23),c.Ec(1,"titlecase")),2&e){const e=c.Dc(2),t=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(4,ct,c.Fc(1,2,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.status)))}}function Cn(e,t){if(1&e&&(c.nc(0,23),c.nc(1,23),c.Ec(2,"sdate"),c.nc(3,23),c.Ec(4,"number"),c.nc(5,23),c.od(6,Mn,2,6,"ng-container",28),c.Ec(7,"async")),2&e){const e=c.Dc(),t=c.ad(18),n=c.ad(46);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Sc(16,st,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionType)),c.Ub(1),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(18,lt,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionDate)===e.DEFAULT_DATE_NUMBER?"To be confirmed":c.Fc(2,9,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.transactionDate))),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Sc(20,yn,(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.currency)+" "+c.Gc(4,11,null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.amount,"1.2-2"))),c.Ub(2),c.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",c.Tc(22,at,"sell"===(null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.paymentType)?"Redemption Method":"Payment Method",null==e.pendingTableInfoModel?null:e.pendingTableInfoModel.method)),c.Ub(1),c.Mc("ngIf",!c.Fc(7,14,e.isMobile$))}}function qn(e,t){1&e&&c.mc(0,"nz-divider",36)}function Tn(e,t){if(1&e&&(c.pc(0),c.rc(1,"div",33),c.rc(2,"div",34),c.qd(3),c.qc(),c.rc(4,"div",34),c.qd(5),c.qc(),c.qc(),c.od(6,qn,1,0,"nz-divider",35),c.oc()),2&e){const e=c.Dc(),t=e.title,n=e.class,i=e.value,o=e.hideDivider;c.Ub(2),c.Mc("nzSpan",10),c.Ub(1),c.rd(t),c.Ub(1),c.Wb(n),c.Mc("nzSpan",14),c.Ub(1),c.sd(" ",i," "),c.Ub(1),c.Mc("ngIf",!o)}}function wn(e,t){if(1&e&&(c.rc(0,"nz-row"),c.rc(1,"nz-col",37),c.rc(2,"h6"),c.qd(3),c.qc(),c.qc(),c.rc(4,"nz-col",38),c.rc(5,"h6",39),c.qd(6),c.qc(),c.qc(),c.qc()),2&e){const e=c.Dc(),t=e.title,n=e.value;c.Ub(1),c.Mc("nzSpan",12),c.Ub(2),c.rd(t),c.Ub(1),c.Mc("nzSpan",12),c.Ub(2),c.sd(" ",n," ")}}function zn(e,t){if(1&e&&(c.od(0,Tn,7,7,"ng-container",31),c.Ec(1,"async"),c.od(2,wn,7,4,"ng-template",null,32,c.pd)),2&e){const e=c.ad(3),t=c.Dc();c.Mc("ngIf",!c.Fc(1,2,t.isMobile$))("ngIfElse",e)}}let Dn=(()=>{class e{constructor(e){this.accountService=e,this.isAfterCutoffDate=!0,this.onVoid=new c.s,this.onEdit=new c.s,this.onPay=new c.s,this.onDone=new c.s,this.onCoolingOff=new c.s,this.investmentAccount={},this.iProductEnum=d.b,this.iPendingTransactionTypeEnum=ne.a,this.DEFAULT_DATE_NUMBER=-631179e6,this.transactionConstant=m.a}ngOnInit(){let e=this.accountService.accounts;this.investmentAccount=null==e?void 0:e.find(e=>e.refno===this.refno),this.isCorporate=this.investmentAccount.accountType===ie.a.ACCOUNT_TYPE_CORPORATE}onVoidClick(){this.onVoid.emit({contractNo:this.pendingTableInfoModel.pendingTransactionModel.contractNo,transactionType:this.pendingTableInfoModel.transactionType.toLowerCase(),productType:this.pendingTableInfoModel.productType})}
1onPayNowClick(e){this.onPay.emit(e)}onDoneClick(){this.onDone.emit()}onShowCoolingOff(){this.onCoolingOff.emit()}onShowVoidConfirm(){this.showVoidConfirm=!0}onClose(){this.showVoidConfirm=!1,this.onDone.emit()}onEditClick(){this.onEdit.emit(this.pendingTableInfoModel)}checkVoidCondition(){var e,t,n,i,c,o,s,a,l,r,u,h,p;return!!this.isNotProductTypeTrustAccountAndAutoSweep(this.pendingTableInfoModel)&&(null===(e=this.pendingTableInfoModel)||void 0===e?void 0:e.productType)!==d.b.STOCK_AND_ETF&&((null===(t=this.pendingTableInfoModel)||void 0===t?void 0:t.productType)===d.b.BOND&&"priced"!==(null===(n=this.pendingTableInfoModel)||void 0===n?void 0:n.status)&&"void"!==(null===(i=this.pendingTableInfoModel)||void 0===i?void 0:i.status)&&"complete"!==(null===(c=this.pendingTableInfoModel)||void 0===c?void 0:c.status)&&"unfulfilled"!==(null===(o=this.pendingTableInfoModel)||void 0===o?void 0:o.status)&&"N"===(null===(s=this.pendingTableInfoModel)||void 0===s?void 0:s.regionalBondLockFlag)||"pending"===(null===(a=this.pendingTableInfoModel)||void 0===a?void 0:a.status)&&!(null===(l=this.pendingTableInfoModel)||void 0===l?void 0:l.fpxPaymentSuccessful)&&("PRS"!==(null===(u=null===(r=this.pendingTableInfoModel)||void 0===r?void 0:r.pendingTransactionModel)||void 0===u?void 0:u.paymentMethod)||(null===(p=null===(h=this.pendingTableInfoModel)||void 0===h?void 0:h.pendingTransactionModel)||void 0===p?void 0:p.paymentReceiptDate)===this.DEFAULT_DATE_NUMBER))}checkTrustAccountOrAutoSweepCondition(e){if(this.isProductTypeTrustAccountOrAutoSweep(e)){if(e.productType===d.b.STOCK_AND_ETF)return!1;if(e.paymentRequired&&e.paymentSlipAllowed)return!0;if("MYR"!==e.currency){if(!e.paymentRequired&&e.paymentSlipAllowed)return!0}else if("MYR"===e.currency&&!e.paymentRequired&&e.paymentSlipAllowed)return!0;return!1}return!1}isPendingScheduleSell(e){return e.productType===d.b.STOCK_AND_ETF&&e.transactionType===s.q.SCHEDULED_SELL&&"pending"===e.status&&!1===this.isAfterCutoffDate}isProductTypeTrustAccountOrAutoSweep(e){return e.productType==d.b.TRUST_ACCOUNT||e.productType==d.b.AUTO_SWEEP}isNotProductTypeTrustAccountAndAutoSweep(e){return e.productType!==d.b.TRUST_ACCOUNT&&e.productType!==d.b.AUTO_SWEEP}}return e.\u0275fac=function(t){return new(t||e)(c.lc(F.a))},e.\u0275cmp=c.fc({type:e,selectors:[["app-pending-transactions-detail-info"]],inputs:{refno:"refno",pendingTableInfoModel:"pendingTableInfoModel",isVoidButtonLoading:"isVoidButtonLoading",fpxPaymentSuccessful:"fpxPaymentSuccessful",isAfterCutoffDate:"isAfterCutoffDate"},outputs:{onVoid:"onVoid",onEdit:"onEdit",onPay:"onPay",onDone:"onDone",onCoolingOff:"onCoolingOff"},features:[c.Tb([U.a])],decls:48,vars:17,consts:[[4,"ngIf"],[3,"ngSwitch"],[4,"ngSwitchCase"],[1,"text-right","pt-4"],["nz-button","","class","mx-1","nzType","outline",3,"nzLoading","click",4,"ngIf"],["nz-button","","class","mx-1","nzType","primary",3,"click",4,"ngIf"],["class","mx-1","nz-button","","nzType","outline",3,"click",4,"ngIf"],["generalInfo",""],["generalBuy",""],["generalSell",""],["bondGeneralInfo",""],["bondExpressGeneralInfo",""],["bondBuy",""],["bondExpressBuy",""],["bondSell",""],["bondExpressSell",""],["dpmsBuy",""],["dpmsSell",""],["stockBuySell",""],["trustAccount",""],["autoSweep",""],["webDetailInfoDisplay",""],[3,"show","close","confirm"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngTemplateOutlet"],["nz-button","","nzType","outline",1,"mx-1",3,"nzLoading","click"],["nz-button","","nzType","primary",1,"mx-1",3,"click"],["nz-button","","nzType","outline",1,"mx-1",3,"click"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],[3,"ngTemplateOutletContext","ngTemplateOutlet",4,"ngIf"],[3,"ngTemplateOutletContext","ngTemplateOutlet"],[4,"ngIf","ngIfElse"],["mobileTemplate",""],["nz-row","","nzType","flex","nzAlign","middle",1,"font-weight-bold","py-2"],["nz-col","",3,"nzSpan"],["class","m-0",4,"ngIf"],[1,"m-0"],[1,"text-left",3,"nzSpan"],[1,"text-right",3,"nzSpan"],[1,"font-weight-bold"]],template:function(e,t){1&e&&(c.od(0,ae,2,0,"h3",0),c.Ec(1,"async"),c.pc(2,1),c.od(3,ze,14,13,"ng-container",2),c.od(4,Ue,4,3,"ng-container",2),c.od(5,Ne,5,4,"ng-container",2),c.od(6,Be,2,1,"ng-container",2),c.od(7,_e,2,1,"ng-container",2),c.od(8,Ve,2,1,"ng-container",2),c.rc(9,"app-web-scaffold"),c.rc(10,"div",3),c.od(11,He,2,1,"button",4),c.od(12,$e,2,1,"button",4),c.od(13,je,2,1,"button",4),c.od(14,Ge,2,0,"button",5),c.od(15,We,2,0,"button",6),c.od(16,Ye,2,0,"button",5),c.qc(),c.qc(),c.oc(),c.od(17,it,9,25,"ng-template",null,7,c.pd),c.od(19,pt,13,45,"ng-template",null,8,c.pd),c.od(21,vt,11,40,"ng-template",null,9,c.pd),c.od(23,Lt,23,60,"ng-template",null,10,c.pd),c.od(25,Gt,22,68,"ng-template",null,11,c.pd),c.od(27,Xt,8,22,"ng-template",null,12,c.pd),c.od(29,Zt,8,22,"ng-template",null,13,c.pd),c.od(31,tn,8,22,"ng-template",null,14,c.pd),c.od(33,cn,8,22,"ng-template",null,15,c.pd),c.od(35,an,13,40,"ng-template",null,16,c.pd),c.od(37,rn,12,36,"ng-template",null,17,c.pd),c.od(39,bn,11,22,"ng-template",null,18,c.pd),c.od(41,vn,8,24,"ng-template",null,19,c.pd),c.od(43,Cn,8,25,"ng-template",null,20,c.pd),c.od(45,zn,4,4,"ng-template",null,21,c.pd),c.rc(47,"app-void-confirmation-modal",22),c.zc("close",(function(){return t.onClose()}))("confirm",(function(){return t.onVoidClick()})),c.qc()),2&e&&(c.Mc("ngIf",!c.Fc(1,15,t.isMobile$)),c.Ub(2),c.Mc("ngSwitch",null==t.pendingTableInfoModel||null==t.pendingTableInfoModel.pendingTransactionModel?null:t.pendingTableInfoModel.pendingTransactionModel.productType),c.Ub(1),c.Mc("ngSwitchCase",t.iProductEnum.UNIT_TRUST),c.Ub(1),c.Mc("ngSwitchCase",t.iProductEnum.BOND),c.Ub(1),c.Mc("ngSwitchCase",t.iProductEnum.DPMS),c.Ub(1),c.Mc("ngSwitchCase",t.iProductEnum.STOCK_AND_ETF),c.Ub(1),c.Mc("ngSwitchCase",t.iProductEnum.TRUST_ACCOUNT),c.Ub(1),c.Mc("ngSwitchCase",t.iProductEnum.AUTO_SWEEP),c.Ub(3),c.Mc("ngIf",t.checkVoidCondition()||t.checkTrustAccountOrAutoSweepCondition(t.pendingTableInfoModel)),c.Ub(1),c.Mc("ngIf",t.isPendingScheduleSell(t.pen
1dingTableInfoModel)),c.Ub(1),c.Mc("ngIf",t.isPendingScheduleSell(t.pendingTableInfoModel)),c.Ub(1),c.Mc("ngIf",(("Cheque / FPX"===(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.method)||"Cheque"===(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.method))&&((null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.paymentAllowed)||(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.fxPaymentAllowed)||(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.fpxPaymentAllowed))||(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.goPayzPaymentAllowed))&&"pending"===(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.status)&&!t.fpxPaymentSuccessful&&t.pendingTableInfoModel.productType!==t.iProductEnum.TRUST_ACCOUNT||t.checkTrustAccountOrAutoSweepCondition(t.pendingTableInfoModel)),c.Ub(1),c.Mc("ngIf",t.pendingTableInfoModel.isCoolingOff&&!t.isCorporate),c.Ub(1),c.Mc("ngIf",!((("Cheque / FPX"!==(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.method)||null!=t.pendingTableInfoModel&&t.pendingTableInfoModel.paymentAllowed||null!=t.pendingTableInfoModel&&t.pendingTableInfoModel.fxPaymentAllowed||null!=t.pendingTableInfoModel&&t.pendingTableInfoModel.fpxPaymentAllowed)&&("GoPayz"!==(null==t.pendingTableInfoModel?null:t.pendingTableInfoModel.method)||null!=t.pendingTableInfoModel&&t.pendingTableInfoModel.goPayzPaymentAllowed)||t.pendingTableInfoModel.productType===t.iProductEnum.TRUST_ACCOUNT)&&t.checkTrustAccountOrAutoSweepCondition(t.pendingTableInfoModel)&&t.pendingTableInfoModel.productType!==t.iProductEnum.STOCK_AND_ETF)),c.Ub(31),c.Mc("show",t.showVoidConfirm))},directives:[k.t,k.x,k.y,x.a,ce.a,k.A,B.a,L.c,L.a,oe.a],pipes:[k.b,se.a,k.g,k.G],styles:[""]}),Object(i.c)([Object(a.e)(l.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var Pn=n("6oRW"),In=n("3Pt+"),kn=n("JA5x"),An=n("PpG7"),En=n("PTRe");function Fn(e,t){if(1&e&&c.mc(0,"app-bond-exchange-tag",37),2&e){const e=c.Dc().$implicit;c.Mc("isFullLotType",null==e?null:e.lotFullTypeTag)("isOddLotType",null==e?null:e.lotOddTypeTag)("isRetail","Y"===(null==e?null:e.retailDistribution))}}function On(e,t){1&e&&c.mc(0,"app-bond-otc-tag")}function Un(e,t){if(1&e&&c.mc(0,"app-bond-express-tag",38),2&e){const e=c.Dc().$implicit;c.Mc("isRetail","Y"===(null==e?null:e.retailDistribution))}}function xn(e,t){if(1&e){const e=c.sc();c.pc(0),c.rc(1,"span",39),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit;return c.Dc(3).modifyBond(t,t.rmoLotType,t.transactionType,t.productCode)})),c.qd(2,"Modify"),c.qc(),c.rc(3,"span",40),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit;return c.Dc(3).openPasswordModal(t.contractNum,t.transactionType)})),c.qd(4,"Cancel"),c.qc(),c.oc()}}function Ln(e,t){if(1&e&&(c.pc(0),c.od(1,xn,5,0,"ng-container",27),c.oc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.Mc("ngIf",("partially filled"===(null==e?null:e.rmoExchangeStatus)||"queue"===(null==e?null:e.rmoExchangeStatus)||"pending"===(null==e?null:e.rmoExchangeStatus)&&"Y"===(null==e?null:e.rmoIsNdtFlag))&&("pending"!==(null==e?null:e.amendmentStatus)||void 0===(null==e?null:e.amendmentStatus)))}}function Rn(e,t){if(1&e){const e=c.sc();c.rc(0,"div"),c.rc(1,"button",42),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit,n=c.Dc().$implicit;return c.Dc(2).onDetails(t,n.fpxPaymentSuccessful)})),c.rc(2,"p",43),c.qd(3," Details"),c.qc(),c.qc(),c.rc(4,"span",40),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit;return c.Dc(3).onPayNowClick(t)})),c.qd(5,"Pay Now"),c.qc(),c.qc()}}function Nn(e,t){if(1&e){const e=c.sc();c.rc(0,"button",44),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit,n=c.Dc().$implicit;return c.Dc(2).onDetails(t,n.fpxPaymentSuccessful)})),c.rc(1,"p",43),c.qd(2," Details"),c.qc(),c.qc()}}function Bn(e,t){if(1&e&&(c.od(0,Rn,6,0,"div",35),c.od(1,Nn,3,0,"ng-template",null,41,c.pd)),2&e){const e=c.ad(2),t=c.Dc().$implicit,n=c.Dc().$implicit,i=c.Dc(2);c.Mc("ngIf",1===n.length&&"pending"===t.status&&(i.checkTrustAccountOrAutoSweepCondition(t)||(("Cheque / FPX"===t.method||"Cheque"===t.method)&&(t.paymentAllowed||t.fpxPaymentAllowed||t.fxPaymentAllowed)||t.goPayzPaymentAllowed)&&!n.fpxPaymentSuccessful&&t.productType!==i.productEnum.TRUST_ACCOUNT))("ngIfElse",e)}}function _n(e,t){if(1&e&&(c.pc(0),c.rc(1,"tr"),c.rc(2,"td",25),c.rc(3,"div"),c.od(4,Fn,1,3,"app-bond-exchange-tag",26),c.od(5,On,1,0,"app-bond-otc-tag",27),c.od(6,Un,1,1,"app-bond-express-tag",28),c.qc(),c.rc(7,"div",29),c.qd(8),c.qc(),c.rc(9,"p",30),c.qd(10),c.qc(),c.qc(),c.rc(11,"td",31),c.qd(12),c.Ec(13,"sdate"),c.Ec(14,"sdate"),c.qc(),c.rc(15,"td",32),c.qd(16),c.Ec(17,"sdate"),c.qc(),c.rc(18,"td",32),c.qd(19),c.qc(),c.rc(20,"td",32),c.qd(21),c.qc(),c.rc(22,"td",32),c.qd(23),c.qc(),c.rc(24,"td",32),c.qd(25),c.Ec(26,"number"),c.qc(),c.rc(27,"td",32),c.qd(28),
1c.Ec(29,"number"),c.qc(),c.rc(30,"td",32),c.qd(31),c.Ec(32,"number"),c.qc(),c.rc(33,"td",32),c.qd(34),c.Ec(35,"number"),c.qc(),c.rc(36,"td",32),c.qd(37),c.Ec(38,"number"),c.qc(),c.rc(39,"td",32),c.qd(40),c.Ec(41,"number"),c.qc(),c.rc(42,"td",32),c.rc(43,"nz-tag",33),c.qd(44),c.qc(),c.qc(),c.rc(45,"td",34),c.od(46,Ln,2,1,"ng-container",35),c.od(47,Bn,3,2,"ng-template",null,36,c.pd),c.qc(),c.qc(),c.oc()),2&e){const e=t.$implicit,n=c.ad(48),i=c.Dc(3);c.Ub(4),c.Mc("ngIf",(null==e?null:e.lotFullTypeTag)||(null==e?null:e.lotOddTypeTag)),c.Ub(1),c.Mc("ngIf",!(null!=e&&e.lotFullTypeTag||null!=e&&e.lotOddTypeTag||"Y"===(null==e?null:e.instantFlag))),c.Ub(1),c.Mc("ngIf","Y"===(null==e?null:e.instantFlag)),c.Ub(2),c.rd(e.productName),c.Ub(2),c.rd(null==e?null:e.bondIssuer),c.Ub(2),c.sd(" ","Y"===(null==e?null:e.instantFlag)?null!=e&&e.orderDate?c.Fc(13,20,null==e?null:e.orderDate):"-":"RMO"===(null==e?null:e.bondChannel)?null!=e&&e.rmoOrderValidity?null==e?null:e.rmoOrderValidity:"-":null!=e&&e.orderExpiryDate?c.Fc(14,22,null==e?null:e.orderExpiryDate):"-"," "),c.Ub(4),c.rd(c.Fc(17,24,null==e?null:e.orderDate)),c.Ub(3),c.rd(e.transactionType),c.Ub(2),c.rd(e.orderType),c.Ub(2),c.rd(e.method),c.Ub(2),c.rd(c.Gc(26,26,null==e?null:e.nominalQuantity,"1.0-0")),c.Ub(3),c.rd(c.Gc(29,29,null==e?null:e.price,"1.3-3")),c.Ub(3),c.rd(c.Gc(32,32,null==e?null:e.averageMatchedPrice,"1.3-3")),c.Ub(3),c.rd(void 0!==(null==e?null:e.unmatchedNominal)?c.Gc(35,35,e.unmatchedNominal,"1.0-0"):"-"),c.Ub(3),c.rd(void 0!==(null==e?null:e.matchedNominal)?c.Gc(38,38,e.matchedNominal,"1.0-0"):"-"),c.Ub(3),c.rd(void 0!==(null==e?null:e.matchedAmount)?(null==e?null:e.productCurrency)+" "+c.Gc(41,41,e.matchedAmount,"1.2-2"):"-"),c.Ub(3),c.Mc("ngClass",i.determineStatusColor(e.status)),c.Ub(1),c.rd(e.status),c.Ub(2),c.Mc("ngIf","RMO"===(null==e?null:e.bondChannel))("ngIfElse",n)}}function Vn(e,t){if(1&e&&(c.pc(0),c.od(1,_n,49,44,"ng-container",14),c.oc()),2&e){const e=t.$implicit;c.Ub(1),c.Mc("ngForOf",e)}}const Hn=function(){return{x:"100%"}};function $n(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-table",17,18),c.rc(2,"thead",19),c.zc("nzSortChange",(function(t){return c.dd(e),c.Dc().tableSort(t)})),c.rc(3,"tr",20),c.rc(4,"th",21),c.qd(5,"Bond Name"),c.qc(),c.rc(6,"th",22),c.qd(7,"Validity"),c.qc(),c.rc(8,"th",23),c.qd(9,"Order Time"),c.qc(),c.rc(10,"th",23),c.qd(11,"Action"),c.qc(),c.rc(12,"th",24),c.qd(13,"Order Type"),c.qc(),c.rc(14,"th",24),c.qd(15,"Payment Method"),c.qc(),c.rc(16,"th",24),c.qd(17,"Nominal"),c.qc(),c.rc(18,"th",23),c.qd(19,"Price"),c.qc(),c.rc(20,"th",23),c.qd(21,"Avg. Matched Price"),c.qc(),c.rc(22,"th",24),c.qd(23,"Unmatched Nominal"),c.qc(),c.rc(24,"th",24),c.qd(25,"Matched Nominal"),c.qc(),c.rc(26,"th",24),c.qd(27,"Matched Amount"),c.qc(),c.rc(28,"th",24),c.qd(29,"Status"),c.qc(),c.rc(30,"th",24),c.qd(31,"More Action"),c.qc(),c.qc(),c.qc(),c.rc(32,"tbody"),c.od(33,Vn,2,1,"ng-container",14),c.qc(),c.qc()}if(2&e){const e=c.ad(1),t=c.Dc();c.Mc("nzData",t.pendingTableDisplayData)("nzScroll",c.Rc(27,Hn))("nzShowPagination",(null==t.transactionBondListModel?null:t.transactionBondListModel.length)>=0),c.Ub(4),c.Mc("nzSortKey",t.displayCols[0].key)("nzWidth","250px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[1].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[2].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[13].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[3].key)("nzWidth","120px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[4].key)("nzWidth","150px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[5].key)("nzWidth","150px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[6].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[7].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[9].key)("nzWidth","120px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[8].key)("nzWidth","120px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[10].key)("nzWidth","120px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[11].key)("nzWidth","120px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[12].key)("nzWidth","150px"),c.Ub(3),c.Mc("ngForOf",e.data)}}function jn(e,t){1&e&&c.nc(0)}function Gn(e,t){if(1&e){const e=c.sc();
1c.rc(0,"app-rmo-transaction-details",45),c.zc("onChangeShowBondDetails",(function(t){return c.dd(e),c.Dc().onBondBuyDetailVisibleChange(t)})),c.qc()}if(2&e){const e=c.Dc();c.Mc("show",e.showBondDetails)("routeRefno",e.routeRefno)("bondTransactionModel",e.modifyInfoModel)("lotType",e.lotType)("transType",e.transType)("lsClient",e.lsClient)("isUpdate",!0)("issueCode",e.selectedIssueCode)}}function Wn(e,t){if(1&e){const e=c.sc();c.rc(0,"app-pending-transactions-detail-info",48),c.zc("onCoolingOff",(function(){return c.dd(e),c.Dc(2).onShowCoolingOffModal()}))("onDone",(function(){return c.dd(e),c.Dc(2).onCloseDetailModal()}))("onEdit",(function(t){return c.dd(e),c.Dc(2).onEditClick(t)}))("onVoid",(function(t){return c.dd(e),c.Dc(2).onVoidClick(t.contractNo,t.transactionType,t.productType)}))("onPay",(function(t){return c.dd(e),c.Dc(2).onPayNowClick(t)})),c.qc()}if(2&e){const e=c.Dc(2);c.Mc("refno",e.routeRefno)("pendingTableInfoModel",e.selectedTableInfoModel)("isVoidButtonLoading",e.voidButtonLoading)("fpxPaymentSuccessful",e.fpxPaymentSuccessful)("isAfterCutoffDate",e.isAfterCutoffDate)}}function Yn(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-modal",46),c.zc("nzVisibleChange",(function(t){return c.dd(e),c.Dc().showDetail=t}))("nzOnCancel",(function(){return c.dd(e),c.Dc().onCloseDetailModal()})),c.od(1,Wn,1,5,"app-pending-transactions-detail-info",47),c.Ec(2,"async"),c.qc()}if(2&e){const e=c.Dc();c.Mc("nzVisible",e.showDetail)("nzWrapClassName","vertical-center-modal")("nzFooter",null),c.Ub(1),c.Mc("ngIf",e.showDetail&&!c.Fc(2,4,e.isMobile$))}}function Kn(e,t){if(1&e){const e=c.sc();c.rc(0,"div",52),c.rc(1,"nz-button-group",53),c.rc(2,"button",54),c.zc("click",(function(){c.dd(e);const t=c.Dc(2);return t.onShowVoidConfirm(t.selectedTableInfoModel)})),c.qd(3," Void "),c.qc(),c.qc(),c.qc()}}function Xn(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-modal",46),c.zc("nzVisibleChange",(function(t){return c.dd(e),c.Dc().showDetail=t}))("nzOnCancel",(function(){return c.dd(e),c.Dc().onCloseDetailModal()})),c.mc(1,"div",49),c.mc(2,"app-pending-transactions-detail-info",50),c.od(3,Kn,4,0,"div",51),c.qc()}if(2&e){const e=c.Dc();c.Mc("nzVisible",e.showDetail)("nzWrapClassName","vertical-center-modal")("nzFooter",null),c.Ub(2),c.Mc("isAfterCutoffDate",e.isAfterCutoffDate)("pendingTableInfoModel",e.selectedTableInfoModel)("refno",e.routeRefno),c.Ub(1),c.Mc("ngIf","priced"!==e.selectedTableInfoModel.status&&"void"!==e.selectedTableInfoModel.status&&"complete"!==e.selectedTableInfoModel.status&&"unfulfilled"!==e.selectedTableInfoModel.status&&"N"===e.selectedTableInfoModel.regionalBondLockFlag)}}function Qn(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-modal",56),c.zc("nzVisibleChange",(function(t){return c.dd(e),c.Dc(2).cancelOrderModalVisible=t}))("nzOnCancel",(function(){return c.dd(e),c.Dc(2).handleCancelModalCancel()})),c.rc(1,"nz-row"),c.rc(2,"nz-col",57),c.mc(3,"i",58),c.qc(),c.rc(4,"nz-col",57),c.rc(5,"h4",59),c.qd(6,"Order Cancellation"),c.qc(),c.qc(),c.qc(),c.rc(7,"nz-row"),c.mc(8,"nz-col",57),c.rc(9,"nz-col",57),c.rc(10,"p",59),c.qd(11,"This action will cancel your trade action."),c.qc(),c.qc(),c.qc(),c.rc(12,"nz-row"),c.mc(13,"nz-col",57),c.rc(14,"nz-col",57),c.rc(15,"ui-input-group",60),c.rc(16,"input",61),c.zc("ngModelChange",(function(t){return c.dd(e),c.Dc(2).password=t})),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(17,"nz-row"),c.rc(18,"div",62),c.rc(19,"button",63),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleCancelModalCancel()})),c.qd(20,"Maybe Later"),c.qc(),c.rc(21,"button",64),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleCancelModalOk()})),c.qd(22,"Confirm"),c.qc(),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(2);c.Mc("nzVisible",e.cancelOrderModalVisible)("nzFooter",null)("nzWrapClassName","vertical-center-modal"),c.Ub(2),c.Mc("nzSpan",2),c.Ub(2),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(2),c.Mc("type","password")("ngModel",e.password),c.Ub(3),c.Mc("nzLoading",e.modalButtonLoading),c.Ub(2),c.Mc("nzLoading",e.modalButtonLoading)}}function Zn(e,t){if(1&e&&(c.od(0,Qn,23,13,"nz-modal",55),c.Ec(1,"async"),c.Ec(2,"async")),2&e){const e=c.Dc();c.Mc("ngIf",!c.Fc(1,1,e.isMobile$)||c.Fc(2,3,e.isMobile$))}}function Jn(e,t){1&e&&c.nc(0)}function ei(e,t){1&e&&c.nc(0)}function ti(e,t){if(1&e&&c.mc(0,"app-bond-exchange-tag",37),2&e){const e=c.Dc().$implicit;c.Mc("isFullLotType",null==e?null:e.lotFullTypeTag)("isOddLotType",null==e?null:e.lotOddTypeTag)("isRetail","Y"===(null==e?null:e.retailDistribution))}}function ni(e,t){1&e&&c.mc(0,"app-bond-otc-tag")}function ii(e,t){if(1&e&&c.mc(0,"app-bond-express-tag",38),2&e){const e=c.Dc().$implicit;c.Mc("isRetail","Y"===(null==e?null:e.retailDistribution))}}function ci(e,t){if(1&e){const e=c.sc();c.pc(0),c.rc(1,"span",75),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit;return c.Dc(2).openPasswordModal(t.contractNum,t.transactionType)})),c.qd(2,"Cancel"),c.qc(),c.rc(3,"span",76),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit;return c.Dc(2).modifyBond(t,t.rmoLotType,t.transactionType,t.productC
1ode)})),c.qd(4,"Modify"),c.qc(),c.oc()}}function oi(e,t){if(1&e&&(c.pc(0),c.od(1,ci,5,0,"ng-container",27),c.oc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.Mc("ngIf",("partially filled"===(null==e?null:e.rmoExchangeStatus)||"queue"===(null==e?null:e.rmoExchangeStatus)||"pending"===(null==e?null:e.rmoExchangeStatus)&&"Y"===(null==e?null:e.rmoIsNdtFlag))&&("pending"!==(null==e?null:e.amendmentStatus)||void 0===(null==e?null:e.amendmentStatus)))}}function si(e,t){if(1&e){const e=c.sc();c.rc(0,"div"),c.rc(1,"span",75),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit,n=c.Dc().$implicit;return c.Dc().onDetails(t,n.fpxPaymentSuccessful)})),c.qd(2,"Details"),c.qc(),c.rc(3,"span",76),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit;return c.Dc(2).onPayNowClick(t)})),c.qd(4,"Pay Now"),c.qc(),c.qc()}}function ai(e,t){if(1&e){const e=c.sc();c.rc(0,"span",75),c.zc("click",(function(){c.dd(e);const t=c.Dc(2).$implicit,n=c.Dc().$implicit;return c.Dc().onDetails(t,n.fpxPaymentSuccessful)})),c.qd(1,"Details"),c.qc()}}function li(e,t){if(1&e&&(c.od(0,si,5,0,"div",35),c.od(1,ai,2,0,"ng-template",null,41,c.pd)),2&e){const e=c.ad(2),t=c.Dc().$implicit,n=c.Dc().$implicit,i=c.Dc();c.Mc("ngIf",1===n.length&&"pending"===t.status&&(i.checkTrustAccountOrAutoSweepCondition(t)||(("Cheque / FPX"===t.method||"Cheque"===t.method)&&(t.paymentAllowed||t.fpxPaymentAllowed||t.fxPaymentAllowed)||t.goPayzPaymentAllowed)&&!n.fpxPaymentSuccessful&&t.productType!==i.productEnum.TRUST_ACCOUNT))("ngIfElse",e)}}function ri(e,t){if(1&e&&(c.pc(0),c.rc(1,"nz-card",65),c.rc(2,"div",66),c.rc(3,"div"),c.od(4,ti,1,3,"app-bond-exchange-tag",26),c.od(5,ni,1,0,"app-bond-otc-tag",27),c.od(6,ii,1,1,"app-bond-express-tag",28),c.qc(),c.rc(7,"div"),c.rc(8,"span",67),c.qd(9),c.qc(),c.rc(10,"span",68),c.qd(11),c.qc(),c.qc(),c.qc(),c.rc(12,"p",69),c.qd(13),c.qc(),c.rc(14,"p",70),c.qd(15),c.qc(),c.rc(16,"div",71),c.rc(17,"div",72),c.qd(18),c.Ec(19,"sdate"),c.qc(),c.rc(20,"div",73),c.qd(21),c.qc(),c.qc(),c.rc(22,"div",71),c.rc(23,"div",72),c.qd(24),c.qc(),c.rc(25,"div",73),c.qd(26),c.qc(),c.qc(),c.rc(27,"div",71),c.rc(28,"div",72),c.qd(29),c.qc(),c.rc(30,"div",73),c.qd(31),c.qc(),c.qc(),c.rc(32,"div",71),c.rc(33,"div",72),c.qd(34),c.Ec(35,"number"),c.qc(),c.rc(36,"div",73),c.qd(37),c.qc(),c.qc(),c.mc(38,"nz-divider",74),c.rc(39,"div",71),c.rc(40,"div",72),c.qd(41),c.Ec(42,"sdate"),c.qc(),c.rc(43,"div",73),c.od(44,oi,2,1,"ng-container",35),c.od(45,li,3,2,"ng-template",null,36,c.pd),c.qc(),c.qc(),c.qc(),c.oc()),2&e){const e=t.$implicit,n=c.ad(46);c.Ub(4),c.Mc("ngIf",(null==e?null:e.lotFullTypeTag)||(null==e?null:e.lotOddTypeTag)),c.Ub(1),c.Mc("ngIf",!(null!=e&&e.lotFullTypeTag||null!=e&&e.lotOddTypeTag||"Y"===(null==e?null:e.instantFlag))),c.Ub(1),c.Mc("ngIf","Y"===(null==e?null:e.instantFlag)),c.Ub(3),c.rd(e.transactionType),c.Ub(2),c.rd(e.status),c.Ub(2),c.rd(e.productName),c.Ub(2),c.rd(null==e?null:e.bondIssuer),c.Ub(3),c.sd("Validity: ","RMO"===(null==e?null:e.bondChannel)?null!=e&&e.rmoOrderValidity?null==e?null:e.rmoOrderValidity:"-":null!=e&&e.orderExpiryDate?c.Fc(19,18,null==e?null:e.orderExpiryDate):"-",""),c.Ub(3),c.sd("Avg. Matched Price: ",void 0!==e.averageMatchedPrice?e.averageMatchedPrice:"-",""),c.Ub(3),c.sd("Order Type: ",e.orderType,""),c.Ub(2),c.sd("Matched Nominal: ",e.nominalQuantity,""),c.Ub(3),c.sd("Matched Nominal: ",void 0!==e.matchedNominal?e.matchedNominal:"-",""),c.Ub(2),c.sd("Unmatched Nominal: ",void 0!==e.unmatchedNominal?e.unmatchedNominal:"-",""),c.Ub(3),c.sd("Price: ",c.Gc(35,20,null==e?null:e.price,"1.4-4"),""),c.Ub(3),c.sd("Matched Amt: ",void 0!==e.matchedAmount?e.matchedAmount:"-",""),c.Ub(4),c.rd(c.Fc(42,23,null==e?null:e.orderDate)),c.Ub(3),c.Mc("ngIf","RMO"===(null==e?null:e.bondChannel))("ngIfElse",n)}}function di(e,t){if(1&e&&(c.pc(0),c.od(1,ri,47,25,"ng-container",14),c.oc()),2&e){const e=t.$implicit;c.Ub(1),c.Mc("ngForOf",e)}}function ui(e,t){if(1&e&&c.mc(0,"ui-option",79),2&e){const e=t.$implicit;c.Mc("nzLabel",e.label)("nzValue",e.value)}}function hi(e,t){if(1&e){const e=c.sc();c.rc(0,"ui-select",77),c.zc("ngModelChange",(function(t){return c.dd(e),c.Dc().filterMarket=t}))("ngModelChange",(function(){return c.dd(e),c.Dc().onFilterMarket()})),c.od(1,ui,1,2,"ui-option",78),c.qc()}if(2&e){const e=c.Dc();c.Mc("ngModel",e.filterMarket),c.Ub(1),c.Mc("ngForOf",e.filterOption)}}function pi(e,t){if(1&e){const e=c.sc();c.rc(0,"form",80),c.rc(1,"nz-input-group"),c.rc(2,"input",81),c.zc("ngModelChange",(function(t){return c.dd(e),c.Dc().filterSearchText=t}))("ngModelChange",(function(){return c.dd(e),c.Dc().search()})),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Ub(2),c.Mc("ngModel",e.filterSearchText)}}let mi=(()=>{class e{constructor(e,t,n,i,o,s,a,l,p,m,f,g,y,v,M,C,q,T,w,z){this.iBondFilter=e,this.modalService=t,this.router=n,this.transactionService=i,this.bondSelectorService=o,this.siDeclarationService=s,this.authService=a,this.holdingRestService=l,this.twoFaService=p,this.nzNotificationService=m,this.store=f,this.datePipe=g,this.scheduledSellRestService=y,this.nzNotification=v,this.paymentRestService=M,this.route=C,this.cdRef=q,this.accountService=T,this.transactionBondRestService=w,this.subHandlingService=z,this.displayCols=[{key:"productName",colName:"Bond Name"},{key:"validity",colName:"Validity"},{key:"orderDate",colName:"Order Time"},{key:"orderType",colName:"Order Type"},{key:"method",colName:"Payment Method"},{key:"nominalQuantity",colName:"Nominal"},{key:"price",colName:"Price"},{key:"averageMatchedPrice",colName:"Avg Matched Price"},{key:"matchedNominal",colName:"Matched Nominal"},{key:"unmatchedNominal",colName:"Unmatched Nominal"},{key:"matchedAmount",colName:"Matched Amount"},{key:"status",colName:"Status"},{key:"moreAction",colName:"More Action"},{key:"action",colName:"Action"}],this.noActionStatus=["2","3","4","7","8","9","C","X"],this.blackl
1istedStatus=["7","9"],this.hideAppBar=new c.s,this.emitMarketDepth=new c.s,this.onChangeShowBondDetails=new c.s,this.modalClosed=new c.s,this.successVoid=new c.s,this.liveStreamDate=new Date,this.selectedTableInfoModel={},this.showPasswordModal=!1,this.I2faMethodEnum=b.a,this.e2eeObj={},this.selectedItem={ordPrice:0},this.orderBookLoading=!0,this.modalButtonLoading=!1,this.orderBookInfos=[],this.tempOrderBookInfos=[],this.todayDate=new Date,this.transactionPreviewData={},this.amendOrderModalVisible=!1,this.previewAmendOrderModalVisible=!1,this.cancelOrderModalVisible=!1,this.qty=1,this.password="",this.selectedTransactionType=!0,this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.tempSubMarketDepth=[],this.drawerVisible=!1,this.orderBookUpdateInteral=3e4,this.isHkexLivestreaming=!1,this.isScheduledSellOrder=!1,this.chinaStockModifyModalVisible=!1,this.isNewTradingHourStart=!1,this.isStopOrder=!1,this.isStopLimitOrder=!1,this.isInitialized=!1,this.transactionCompleteListModel=[],this.transactionListModel=[],this.pendingTableInfoModelList=[],this.filteredPendingTableInfoModelList=[],this.transactionBondListModel=[],this.transactionCompleteBondListModel=[],this.pendingTransactionList=[],this.approving=!1,this.invalidPassword="",this.showBondDetails=!1,this.productEnum=d.b,this.isAfterCutoffDate=!0,this.showCoolingOff=!1,this.gotSyariahPortfolio=!1,this.isLoadingBondInfo=!1,this.showReferralChannelPaymentModal=!1,this.totalAmountMap={},this.showPaymentResultModal=!1,this.paymentResultModalSuccess=!1,this.paymentDetails=[],this.coolingOffList=[],this.isShowQuestions=!1,this.investmentAccount={},this.currencyOptions=[],this.fromCA=!1,this.fromCS=!1,this.scheduleSellTickerNoMap=new Map,this.transactionModalVisible=!1,this.searchQuery=new r.a,this.searchByStatus=new r.a,this.modifyInfoModel={},this.filterOption=[{label:"All",value:""},{label:"Bond Express",value:"RMO"},{label:"OTC Bond",value:"OTC"}],this.searchQuery.pipe(Object(u.a)(500),Object(h.a)()).subscribe(e=>{this.filterMarket="",this.filteredPendingTableInfoModelList=Object(S.a)(this.pendingTableInfoModelList),e&&(this.filteredPendingTableInfoModelList=this.filteredPendingTableInfoModelList.filter(t=>t.productName&&t.productName.toLowerCase().includes(e.toLowerCase()))),this.groupByMultipleFields()}),this.searchByStatus.subscribe(()=>{this.filterSearchText="",this.filteredPendingTableInfoModelList=Object(S.a)(this.pendingTableInfoModelList),this.filteredPendingTableInfoModelList=this.filteredPendingTableInfoModelList.filter(e=>e.bondChannel===this.filterMarket||""===this.filterMarket),this.groupByMultipleFields()})}ngOnInit(){this.initRouteParam(),this.subscribeRefnoChange()}search(){this.searchQuery.next(this.filterSearchText)}onFilterMarket(){this.searchByStatus.next(this.filterMarket)}ngOnChanges(e){clearInterval(this.orderBookPolling),this.initRouteParam(),this.search(),this.onFilterMarket()}ngOnDestroy(){clearInterval(this.orderBookPolling)}tableSort(e){this.filteredPendingTableInfoModelList=Object(o.c)(e,this.filteredPendingTableInfoModelList),this.groupByMultipleFields()}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(p.a)(e=>{this.routeRefno=e,this.cdRef.markForCheck(),this.subHandlingService.once(this.findAllPendingTransactionFirst()),this.orderBookPolling=setInterval(()=>{this.subHandlingService.once(this.findAllPendingTransaction())},this.orderBookUpdateInteral)})))}initRouteParam(){this.route.queryParams.subscribe(e=>{e.refno&&this.store.dispatch(new y.N(e.refno))})}findAllPendingTransaction(){return this.pendingTableInfoModelList=[],this.transactionListModel=[],this.holdingRestService.findAllPendingTransactionRmo(this.routeRefno).pipe(Object(p.a)(e=>{(null==e?void 0:e.status)===s.a.RESPONSE_SUCCESS&&(e.data.result.data.buy.forEach(e=>{this.transactionListModel.push(e)}),e.data.result.data.sell.forEach(e=>{this.transactionListModel.push(e)}),this.transactionBondListModel=this.transactionListModel.filter(e=>"bond"===e.productType),this.transactionBondListModel.forEach(e=>{e.pendingTransactionList.forEach(t=>{this.pendingTableInfoModelList.push(this.mapPendingTableInfoModel(e,t))})}),this.filteredPendingTableInfoModelList=this.pendingTableInfoModelList,this.sortByOrderDateDescending(),this.groupByMultipleFields(),this.orderBookLoading=!1)}))}findAllPendingTransactionFirst(){return this.orderBookLoading=!0,this.pendingTableInfoModelList=[],this.transactionListModel=[],this.holdingRestService.findAllPendingTransactionRmo(this.routeRefno).pipe(Object(p.a)(e=>{(null==e?void 0:e.status)===s.a.RESPONSE_SUCCESS&&(e.data.result.data.buy.forEac
1h(e=>{this.transactionListModel.push(e)}),e.data.result.data.sell.forEach(e=>{this.transactionListModel.push(e)}),this.transactionBondListModel=this.transactionListModel.filter(e=>"bond"===e.productType),this.transactionBondListModel.forEach(e=>{e.pendingTransactionList.forEach(t=>{this.pendingTableInfoModelList.push(this.mapPendingTableInfoModel(e,t))})}),this.filteredPendingTableInfoModelList=this.pendingTableInfoModelList,this.sortByOrderDateDescending(),this.groupByMultipleFields(),this.orderBookLoading=!1)}))}sortByOrderDateDescending(){this.filteredPendingTableInfoModelList=this.pendingTableInfoModelList.sort((e,t)=>new Date(t.orderDate).getTime()-new Date(e.orderDate).getTime())}groupByMultipleFields(){var e;let t=[];for(let n of this.filteredPendingTableInfoModelList)t[n.orderNum+n.method+n.currency]?null===(e=t[n.orderNum+n.method+n.currency])||void 0===e||e.push(n):t[n.orderNum+n.method+n.currency]=[n];this.pendingTableDisplayData=Object.values(t);for(let n of this.pendingTableDisplayData){let e=0;for(let t of n)e+=t.amount,n.productTypeDisplay=t.productTypeDisplay,n.transactionType=t.transactionType,n.currency=t.currency,n.goPayzPaymentAllowed=t.goPayzPaymentAllowed,n.fpxPaymentSuccessful=t.fpxPaymentSuccessful,n.orderNum=t.orderNum,n.method=t.method,n.status=t.status,n.pendingTransactionModel=t.pendingTransactionModel,n.paymentAllowed=t.paymentAllowed,n.fxPaymentAllowed=t.fxPaymentAllowed,n.fpxPaymentAllowed=t.fpxPaymentAllowed,n.totalAmount=t.totalAmount;this.totalAmountMap[n.orderNum+n.method+n.currency]=e}}mapPendingTableInfoModel(e,t){var n;let i="-";switch(t.paymentMode){case m.a.CHEQUE_FPX:case m.a.CHEQUE.toLowerCase():i="Cheque";break;case m.a.CASH_FUND:i="CMF2";break;case m.a.TRUST_ACCOUNT:i="Cash Account ("+t.currency+")";break;case m.a.EPF_FUNDS.toUpperCase():i=m.a.EPF_FUNDS.toUpperCase();break;case m.a.GOPAYZ:i=m.a.GOPAYZ;break;case m.a.CASH_MANAGEMENT_FUND:i="Cash Account";break;default:i=this.checkAutoSweepRelatedPaymentMethod(i,null==t?void 0:t.paymentMode,t)}let c=t.status;"received"===t.status?c="RMO"===(null==t?void 0:t.bondChannel)?"pending"===t.rmoExchangeStatus?"pendingExchange":t.rmoExchangeStatus:t.status:"void"===t.status?"RMO"===(null==t?void 0:t.bondChannel)&&(c="rejected by exchange"===t.rmoExchangeStatus?"rejected":"cancel"===t.rmoExchangeStatus?"cancelled":t.rmoExchangeStatus):"complete"===t.status&&"RMO"===(null==t?void 0:t.bondChannel)&&(c=t.rmoExchangeStatus);let o="-";o="full"==t.rmoLotType?"FULL":"odd"==t.rmoLotType?"ODD":"otc"==t.rmoLotType?"OTC":t.rmoLotType;let s=!1,a=!1;return"full"==t.rmoLotType?s=!0:"odd"==t.rmoLotType?a=!0:(a=!1,s=!1),{orderDate:(null==t?void 0:t.orderDate)?t.orderDate:(null==t?void 0:t.transactionDate)?t.transactionDate:e.clientOrderDate,orderNum:e.orderNo,productTypeDisplay:"Bond",productType:e.productType,exchange:t.exchange,transactionType:e.paymentType,amount:null!=t.amountAf?t.amountAf:t.amount,nominalQuantity:null==t?void 0:t.nominalValue,price:t.indicativePrice,method:i,refno:t.refno,orderType:"Price"===t.orderType?"Limit":t.orderType,status:c,fpxPaymentSuccessful:e.fpxPaymentSuccessful,fpxPaymentAllowed:e.fpxPaymentAllowed,currency:t.currency,productCurrency:null==t?void 0:t.productCurrency,pendingTransactionModel:t,fxPaymentAllowed:null==e?void 0:e.fxPaymentAllowed,completeDate:null==t?void 0:t.settlementDate,contractNum:(null==t?void 0:t.contractNo)?null==t?void 0:t.contractNo:"-",accruedInt:null==t?void 0:t.accruedInt,transactionDate:null==t?void 0:t.transactionDate,paymentAllowed:null==e?void 0:e.paymentAllowed,goPayzPaymentAllowed:null==e?void 0:e.goPayzPaymentAllowed,totalAmount:null==e?void 0:e.totalAmount,productName:null==t?void 0:t.productName,matchedNominal:null==t?void 0:t.matchedNominal,matchedAmount:null==t?void 0:t.matchedAmount,unmatchedNominal:null==t?void 0:t.unmatchedNominal,averageMatchedPrice:null==t?void 0:t.averageMatchedPrice,rmoLotType:o,productCode:null==t?void 0:t.productCode,amendmentStatus:null==t?void 0:t.amendmentStatus,bondChannel:"RMO"===(null==t?void 0:t.bondChannel)?"RMO":"OTC",rmoExchangeStatus:null==t?void 0:t.rmoExchangeStatus,gotSyariahPortfolio:(null==e?void 0:e.productType)===d.b.DPMS&&-1!==(null===(n=null==t?void 0:t.productName)||void 0===n?void 0:n.indexOf("Islamic")),rmoOrderValidity:null==t?void 0:t.rmoOrderValidity,orderExpiryDate:null==t?void 0:t.orderExpiryDate,retailDistribution:null==t?void 0:t.retailDistribution,bondIssuer:null==t?void 0:t.bondIssuer,rmoIsNdtFlag:null==t?void 0:t.rmoIsNdtFlag,rmoAccruedIntRate:null==t?void 0:t.rmoAccruedIntRate,maxPrice:null==t?void 0:t.maxPrice,minPrice:null==t?void 0:t.minPrice,paymentMethodForModify:null==t?void 0:t.paymentMethod,instantFlag:null==t?void 0:t.instantFlag,regionalBondLockFlag:null==t?void 0:t.regi
1onalBondLockFlag,amountProductCur:t.amount,estAmtPayable:null==t?void 0:t.estAmtPayable,transactionCompleteDate:null==t?void 0:t.transactionCompleteDate,settlementCompleteDate:null==t?void 0:t.settlementCompleteDate,amountInvest:null==t?void 0:t.amountInvest,lotOddTypeTag:a,lotFullTypeTag:s}}checkAutoSweepRelatedPaymentMethod(e,t,n){return(null==t?void 0:t.includes(m.a.AUTO_SWEEP))?null==t?"":(null==n?void 0:n.autoSweepCurrency)?`${n.autoSweepCurrency} ${t}`:(null==n?void 0:n.currency)?`${n.currency} ${t}`:t:t===m.a.UNIT_TRUST?m.a.UNIT_TRUST_DISPLAY:t===m.a.BOND_DISPLAY?m.a.BOND_DISPLAY:t===m.a.DPMS?m.a.DPMS_DISPLAY:e}openPasswordModal(e,t){this.selectedContract=e,this.buySellType=t,this.bondRmoBuyComVoidModel={status:"void",price:null,contractNo:this.selectedContract,accruedIntRate:null,settlementDate:null,transactionDate:null,dealerCode:null},this.bondRmoSellComVoidModel={status:"void",price:null,contractNo:this.selectedContract,accruedIntRate:null,settlementDate:null,transactionDate:null,dealerCode:null},this.cancelOrderModalVisible=!0}modifyBond(e,t,n,i){this.onShowOrderpadAction(e,i,n,t),this.showBondDetails=!0}handleCancelModalOk(){this.password?(this.modalButtonLoading=!0,this.authService.getPresessionModel().subscribe(e=>{this.e2eeObj=e,this.e2eeObj.hashedPassword=this.authService.getHashPassword(this.e2eeObj,this.password);const t={refno:this.routeRefno||this.refno,status:"void",price:null,contractNo:this.selectedContract,execID:null,accruedIntRate:null,settlementDate:null,transactionDate:null,dealerCode:null,voidReason:null,password:this.e2eeObj.hashedPassword,e2eeRandom:this.e2eeObj.e2eeRandom};this.subHandlingService.once("Buy"==this.buySellType?this.transactionBondRestService.cancelBondBuyWithPassword(t).pipe(Object(p.a)(e=>{this.completeBondVoidOrder(e,"Buy"),this.password=null})):this.transactionBondRestService.cancelBondSellWithPassword(t).pipe(Object(p.a)(e=>{this.completeBondVoidOrder(e,"Sell"),this.password=null})))})):this.createNotification("error","Please enter your password")}createNotification(e,t){if("success"===e){const e=this.modalService.success({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}else if("error"===e){const e=this.modalService.error({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}}onHandleCancel(){this.showPasswordModal=!1}handleCancelModalCancel(){this.cancelOrderModalVisible=!1,this.password=null,this.hideModal(this.cancelOrderModalVisible)}onProceed(e){this.confirmTrade(e)}confirmTrade(e){this.store.dispatch(new f.e(!0));const t=this.twoFaService.getPasswordVerificationModel(e,!1);this.voidBondBuy(t)}voidBondBuy(e){}completeBondVoidOrder(e,t){s.a.RESPONSE_SUCCESS===e.status?(this.modalButtonLoading=!1,this.cancelOrderModalVisible=!1,this.hideModal(this.cancelOrderModalVisible),this.onSuccessVoid(),this.nzNotificationService.success("Successful",t+" Order Cancel Successful."),this.subHandlingService.once(this.findAllPendingTransactionFirst())):(this.modalButtonLoading=!1,this.cancelOrderModalVisible=!1,this.hideModal(this.cancelOrderModalVisible),this.nzNotificationService.error("Failed",e.errorMessage))}onBondBuyDetailVisibleChange(e){e||(this.transType=null),this.showBondDetails=e,this.onChangeShowBondDetails.emit(e),this.hideModal(e)}onShowOrderpadAction(e,t,n,i){this.modifyInfoModel=e,this.transType=n,this.selectedIssueCode=t,this.lotType=i}onDetails(e,t){this.checkIsAfterCutoffDate(e),this.selectedTableInfoModel=e,this.fpxPaymentSuccessful=t,this.showDetail=!0}checkIsAfterCutoffDate(e,t){e.transactionType===s.q.SCHEDULED_SELL&&this.scheduledSellRestService.getTransactionDate(e.pendingTransactionModel.exchange,this.datePipe.transform(new Date,"dd-MMM-yyyy HH:mm:ss")).subscribe(n=>{this.isAfterCutoffDate=e.transactionDate!==n.data.key.transactionDate,t&&(e.pendingTransactionModel.isAfterCutoffDate=this.isAfterCutoffDate)})}onCloseDetailModal(){this.showDetail=!1}onShowCoolingOffModal(){this.showDetail=!1,this.showCoolingOff=!0}onEditClick(e){}onVoidClick(e,t,n){this.voidBond(e,t)}
1voidBond(e,t){this.voidButtonLoading=!0,this.subHandlingService.once(this.transactionBondRestService.voidBondOrder(this.routeRefno,e,t).pipe(Object(p.a)(t=>{this.voidButtonLoading=!1,t.status===s.a.RESPONSE_SUCCESS?(this.nzNotification.success({nzTitle:"Success",nzContent:"Contract No :"+e+"Void Successfully"}),this.showDetail=!1,this.getBankDetailsAndPendingTransaction()):this.nzNotification.error({nzTitle:"Error",nzContent:"Void Contract Failed"})})))}getBankDetailsAndPendingTransaction(){this.orderBookLoading=!0,this.subHandlingService.once(this.findAllPendingTransactionFirst())}onPayNowClick(e){var t,n,i,c,o,s,a,l,r,u;if(this.refnoPay=this.routeRefno,this.nricName=null===(n=null===(t=this.accountService.accounts)||void 0===t?void 0:t.find(e=>(null==e?void 0:e.refno)===this.refnoPay))||void 0===n?void 0:n.nricName,this.gotSyariahPortfolio=!1,(null===(i=null==e?void 0:e.pendingTransactionModel)||void 0===i?void 0:i.paymentMode)===d.b.TRUST_ACCOUNT)this.onPayNowTrustAcctClick(e);else if(this.transactionModelToPay=null==e?void 0:e.pendingTransactionModel,this.paymentAllowed=e.paymentAllowed,this.fpxPaymentAllowed=null==e?void 0:e.fpxPaymentAllowed,this.purchaseOrderNoToPay=null===(c=null==e?void 0:e.pendingTransactionModel)||void 0===c?void 0:c.orderNo,this.fromCurrency=null===(o=null==e?void 0:e.pendingTransactionModel)||void 0===o?void 0:o.currency,this.paymentProduct=null==e?void 0:e.productType,(null===(s=null==e?void 0:e.pendingTransactionModel)||void 0===s?void 0:s.paymentMode)===m.a.GOPAYZ)this.showDetail=!1,this.showReferralChannelPaymentModal=!0,this.paymentMethod=null===(a=null==e?void 0:e.pendingTransactionModel)||void 0===a?void 0:a.paymentMode,this.totalAmount=this.totalAmountMap[this.purchaseOrderNoToPay+this.paymentMethod+this.fromCurrency];else if(this.fromCurrency===m.a.PAYMENT_CURRENCY_MYR){if(this.getTotalBuyTransactionAmount(e),e.productType===d.b.DPMS){const t=this.pendingTableDisplayData.find(t=>t.method===e.method&&t.orderNum===e.orderNum&&t.currency===e.currency);null!=t&&(this.gotSyariahPortfolio=null==t?void 0:t.gotSyariahPortfolio)}}else this.showDetail=!1,this.foreignTotalAmount=(null===(l=null==e?void 0:e.pendingTransactionModel)||void 0===l?void 0:l.amountAf)?null===(r=null==e?void 0:e.pendingTransactionModel)||void 0===r?void 0:r.amountAf:null===(u=null==e?void 0:e.pendingTransactionModel)||void 0===u?void 0:u.amount,this.showForeignPaymentModal=!0}onPayNowTrustAcctClick(e){this.paymentAllowed=!0,this.fpxPaymentAllowed=!0,this.purchaseOrderNoToPay=null==e?void 0:e.orderNum,this.fromCurrency=null==e?void 0:e.currency,this.paymentProduct=null==e?void 0:e.productType,this.showDetail=!1,this.fromCurrency===m.a.PAYMENT_CURRENCY_MYR?(this.fpxTotalAmount=null==e?void 0:e.amount,e.paymentRequired?this.showLocalPaymentModal=!0:e.paymentSlipAllowed&&(this.showLocalPaymentModal=!0,this.fpxPaymentAllowed=!1)):(this.foreignTotalAmount=null==e?void 0:e.amount,e.paymentSlipAllowed&&(this.showForeignPaymentModal=!0))}getTotalBuyTransactionAmount(e){this.subHandlingService.once(this.paymentRestService.getTotalBuyTransactionAmount(this.routeRefno,this.purchaseOrderNoToPay).pipe(Object(p.a)(t=>{var n,i,c;t.status===s.a.RESPONSE_SUCCESS&&(this.fpxTotalAmount=null==t?void 0:t.data,0===this.fpxTotalAmount&&(null==e?void 0:e.pendingTransactionModel.productType)===d.b.BOND&&(this.fpxTotalAmount=(null===(n=null==e?void 0:e.pendingTransactionModel)||void 0===n?void 0:n.amountAf)?null===(i=null==e?void 0:e.pendingTransactionModel)||void 0===i?void 0:i.amountAf:null===(c=null==e?void 0:e.pendingTransactionModel)||void 0===c?void 0:c.amount),this.showDetail=!1,this.showLocalPaymentModal=!0)})))}determineStatusColor(e){return"pending"==e||"pendingExchange"==e||"priced"==e?"tag-pending-processing":"queue"==e?"ant-tag-blue":"filled"==e||"partially filled"==e||"received"==e||"complete"==e?"tag-received":"tag-terminated"}checkTrustAccountOrAutoSweepCondition(e){if(this.isProductTypeTrustAccountOrAutoSweep(e)){if((null==e?void 0:e.productType)===d.b.STOCK_AND_ETF)return!1;if(e.paymentRequired&&e.paymentSlipAllowed)return!0;if("MYR"!==e.currency){if(!e.paymentRequired&&e.paymentSlipAllowed)return!0}else if("MYR"===e.currency&&!e.paymentRequired&&e.paymentSlipAllowed)return!0;return!1}return!1}isProductTypeTrustAccountOrAutoSweep(e){return e.productType==d.b.TRUST_ACCOUNT||e.productType==d.b.AUTO_SWEEP}
1onForeignPaymentModalCancel(){this.showForeignPaymentModal=!1}onSubmitProof(){this.showLocalPaymentModal=!1,this.showForeignPaymentModal=!1,this.showUploadReceiptModal=!0}onSuccess(){this.showSuccessModal=!0}onUploadModalBack(e){this.showUploadReceiptModal=!1,e===m.a.PAYMENT_CURRENCY_MYR?this.showLocalPaymentModal=!0:this.showForeignPaymentModal=!0}onSuccessModalClose(){this.getBankDetailsAndPendingTransaction(),this.showUploadReceiptModal=!1,this.showLocalPaymentModal=!1,this.showForeignPaymentModal=!1,this.showSuccessModal=!1,this.showReferralChannelPaymentModal=!1}onCloseLocalPaymentModal(){this.showLocalPaymentModal=!1}onLoadingOrderPad(e){this.isLoadingBondInfo=e}onLocalPaymentModalPay(e){this.preSubmitToFPX(e.selectedBank,e.email)}preSubmitToFPX(e,t){let n={fpxSellerOrderNo:this.purchaseOrderNoToPay,fpxTxnAmount:this.fpxTotalAmount,fpxBuyerBankId:e,fpxBuyerEmail:t,redirectUrl:this.router.url.split("?")[0]};this.subHandlingService.once(this.paymentRestService.preSubmit(this.refnoPay,!0,n).pipe(Object(p.a)(e=>{e.status===s.a.RESPONSE_SUCCESS&&e&&(this.fpxPaymentDetails=Object(S.a)(e.data),this.transactionService.setLastVisitedUrl(this.router.url))},e=>console.log(e))))}onShowVoidConfirm(e){this.selectedTableInfoModel=e,this.showVoidConfirm=!0}onClose(){this.showCoolingOff=!1,this.showVoidConfirm=!1}onVoidMobileClick(){var e;this.voidBond(this.selectedTableInfoModel.pendingTransactionModel.contractNo,null===(e=this.selectedTableInfoModel)||void 0===e?void 0:e.transactionType.toLowerCase())}hideModal(e){e||this.modalClosed.emit(e)}onSuccessVoid(){this.successVoid.emit()}}return e.\u0275fac=function(t){return new(t||e)(c.lc(v.a),c.lc(M.e),c.lc(T.e),c.lc(w.a),c.lc(z.a),c.lc(D.a),c.lc(P.a),c.lc(I.a),c.lc(g.a),c.lc(C.b),c.lc(a.i),c.lc(k.f),c.lc(A.a),c.lc(M.e),c.lc(E.a),c.lc(T.a),c.lc(c.j),c.lc(F.a),c.lc(O.a),c.lc(U.a))},e.\u0275cmp=c.fc({type:e,selectors:[["bond-app-order-book-your-order"]],inputs:{primaryCashAcctAvailableBalance:"primaryCashAcctAvailableBalance",lsClient:"lsClient",filterMarket:"filterMarket",filterSearchText:"filterSearchText",filterAccount:"filterAccount",isAcctAllowScheduledSell:"isAcctAllowScheduledSell",refno:"refno"},outputs:{hideAppBar:"hideAppBar",emitMarketDepth:"emitMarketDepth",onChangeShowBondDetails:"onChangeShowBondDetails",modalClosed:"modalClosed",successVoid:"successVoid"},features:[c.Tb([g.a]),c.Sb],decls:33,vars:38,consts:[[3,"nzActive","nzLoading"],["class","order-book-your-order-table",3,"nzData","nzScroll","nzShowPagination",4,"ngIf"],[4,"ngTemplateOutlet"],[3,"show","routeRefno","bondTransactionModel","lotType","transType","lsClient","isUpdate","issueCode","onChangeShowBondDetails",4,"ngIf"],[3,"nzVisible","nzWrapClassName","nzFooter","nzVisibleChange","nzOnCancel",4,"ngIf"],[3,"show","close","confirm"],[3,"show","paymentMethod","currency","totalAmount","refno","product","cancel","submit"],[3,"showLocalPaymentModal","paymentMethod","totalAmount","paymentAllowed","islamicPortfolio","closeLocalPaymentModal","upload","payNow"],[3,"refno","nricName","paymentAmount","fromCurrency","purchaseOrderNo","show","success","backed"],[3,"show","cancel","done"],["cancelModalTemplate",""],[3,"hidden"],[1,"bg-white"],[1,"mt-2","mb-3"],[4,"ngFor","ngForOf"],["filterMarketTemplate",""],["filterSearchTextTemplate",""],[1,"order-book-your-order-table",3,"nzData","nzScroll","nzShowPagination"],["orderBookTable",""],[3,"nzSortChange"],[1,"text-xs"],["nzShowSort","","nzLeft","0",1,"text-left",3,"nzSortKey","nzWidth"],["nzShowSort","",1,"align-middle",3,"nzSortKey"],["nzShowSort","",1,"text-center",3,"nzSortKey"],["nzShowSort","",1,"text-center",3,"nzSortKey","nzWidth"],["nzLeft","0"],[3,"isFullLotType","isOddLotType","isRetail",4,"ngIf"],[4,"ngIf"],[3,"isRetail",4,"ngIf"],[1,"font-weight-bold"],[1,"text-xxs","text-gray"],[1,"text-xs","text-center"],[1,"text-center"],[1,"m-0",3,"ngClass"],[1,"text-xs","text-end"],[4,"ngIf","ngIfElse"],["otcBond",""],[3,"isFullLotType","isOddLotType","isRetail"],[3,"isRetail"],[1,"px-2","py-1","text-sm","text-center","green-button","mr-1",3,"click"],[1,"px-2","py-1","text-sm","text-center","red-button","mr-1",3,"click"],["elseBlock",""],["nz-button","","nzSize","small","nzType","outlined",1,"mr-1",3,"click"],[1,"text-sm"],["nz-button","","nzSize","small","nzType","outlined",3,"click"],[3,"show","routeRefno","bondTransactionModel","lotType","transType","lsClient","
1isUpdate","issueCode","onChangeShowBondDetails"],[3,"nzVisible","nzWrapClassName","nzFooter","nzVisibleChange","nzOnCancel"],[3,"refno","pendingTableInfoModel","isVoidButtonLoading","fpxPaymentSuccessful","isAfterCutoffDate","onCoolingOff","onDone","onEdit","onVoid","onPay",4,"ngIf"],[3,"refno","pendingTableInfoModel","isVoidButtonLoading","fpxPaymentSuccessful","isAfterCutoffDate","onCoolingOff","onDone","onEdit","onVoid","onPay"],[1,"text-right","my-4"],[3,"isAfterCutoffDate","pendingTableInfoModel","refno"],["class","text-center my-2",4,"ngIf"],[1,"text-center","my-2"],["nzSize","small",1,"w-100"],["nz-button","","nzType","outlined",1,"w-50",3,"click"],["class","model-cancel-order",3,"nzVisible","nzFooter","nzWrapClassName","nzVisibleChange","nzOnCancel",4,"ngIf"],[1,"model-cancel-order",3,"nzVisible","nzFooter","nzWrapClassName","nzVisibleChange","nzOnCancel"],[3,"nzSpan"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",2,"color","#fd7800","font-size","25px"],["nz-typography",""],["nzLabelPlaceholder","Password","nzSize","small"],["ui-input","",2,"width","100%",3,"type","ngModel","ngModelChange"],[1,"text-right","mt-2","pt-3"],["nz-button","","nzType","outline",1,"mr-3",3,"nzLoading","click"],["nz-button","","nzType","primary",3,"nzLoading","click"],[1,"mb-3"],[1,"d-flex","justify-content-between","mb-2"],[1,"border","p-1","text-xs","mr-1"],[1,"border","p-1","text-xs"],[1,"mb-0","font-weight-bold",2,"font-size","14px"],[1,"text-sm","mt-1"],["nz-row",""],["nz-col","","nzSpan","14",1,"text-xs"],["nz-col","","nzSpan","10",1,"text-xs"],[1,"my-2"],[1,"font-weight-bold","pr-3",2,"color","#0073CF",3,"click"],[1,"font-weight-bold",2,"color","#0073CF",3,"click"],["nzPlaceHolder","Filter by Market","nzAllowClear","",1,"w-100",3,"ngModel","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],[3,"nzLabel","nzValue"],["autocomplete","off"],["type","search","nz-input","","placeholder","Search","name","filterSearch",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e&&(c.rc(0,"app-web-scaffold"),c.rc(1,"nz-row"),c.mc(2,"nz-skeleton",0),c.od(3,$n,34,28,"nz-table",1),c.qc(),c.od(4,jn,1,0,"ng-container",2),c.qc(),c.od(5,Gn,1,8,"app-rmo-transaction-details",3),c.od(6,Yn,3,6,"nz-modal",4),c.Ec(7,"async"),c.od(8,Xn,4,7,"nz-modal",4),c.Ec(9,"async"),c.rc(10,"app-rmo-void-confirmation-modal",5),c.zc("close",(function(){return t.onClose()}))("confirm",(function(){return t.onVoidMobileClick()})),c.qc(),c.rc(11,"foreign-payment-modal",6),c.zc("cancel",(function(){return t.onForeignPaymentModalCancel()}))("submit",(function(){return t.onSubmitProof()})),c.qc(),c.rc(12,"cheque-fpx-local-modal",7),c.zc("closeLocalPaymentModal",(function(){return t.onCloseLocalPaymentModal()}))("upload",(function(){return t.onSubmitProof()}))("payNow",(function(e){return t.onLocalPaymentModalPay(e)})),c.qc(),c.rc(13,"app-upload-deposit-receipt-modal",8),c.zc("success",(function(){return t.onSuccess()}))("backed",(function(e){return t.onUploadModalBack(e)})),c.qc(),c.rc(14,"app-success-payment-modal",9),c.zc("cancel",(function(){return t.onSuccessModalClose()}))("done",(function(){return t.onSuccessModalClose()})),c.qc(),c.od(15,Zn,3,5,"ng-template",null,10,c.pd),c.rc(17,"div",11),c.Ec(18,"async"),c.rc(19,"app-mobile-scaffold"),c.rc(20,"nz-row",12),c.rc(21,"nz-row"),c.rc(22,"nz-col"),c.od(23,Jn,1,0,"ng-container",2),c.qc(),c.qc(),c.rc(24,"nz-row",13),c.rc(25,"nz-col"),c.od(26,ei,1,0,"ng-container",2),c.qc(),c.qc(),c.mc(27,"nz-skeleton",0),c.od(28,di,2,1,"ng-container",14),c.qc(),c.qc(),c.qc(),c.od(29,hi,2,2,"ng-template",null,15,c.pd),c.od(31,pi,3,1,"ng-template",null,16,c.pd)),2&e){const e=c.ad(16),n=c.ad(30),i=c.ad(32);c.Ub(2),c.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),c.Ub(1),c.Mc("ngIf",!t.orderBookLoading),c.Ub(1),c.Mc("ngTemplateOutlet",e),c.Ub(1),c.Mc("ngIf",t.showBondDetails),c.Ub(1),c.Mc("ngIf",!c.Fc(7,32,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(9,34,t.isMobile$)),c.Ub(2),c.Mc("show",t.showVoidConfirm),c.Ub(1),c.Mc("show",t.showForeignPaymentModal)("paymentMethod","Cheque / FPX - "+t.fromCurrency)("currency",t.fromCurrency)("totalAmount",t.foreignTotalAmount)("refno",t.refnoPay)("product",t.paymentProduct),c.Ub(1),c.Mc("showLocalPaymentModal",t.showLocalPaymentModal)("paymentMethod","Cheque / FPX - MYR")("totalAmount",t.fpxTotalAmount)("paymentAllowed",t.fpxPaymentAllowed)("islamicPortfolio",t.gotSyariahPortfolio),c.Ub(1),c.Mc("refno",t.refnoPay)("nricName",t.nricName)("paymentAmount","MYR"===t.fromCurrency?t.fpxTotalAmount:t.foreignTotalAmount)("fromCurrency",t.fromCurrency)("purchaseOrderNo",t.purchaseOrderNoToPay)("show",t.showU
1ploadReceiptModal),c.Ub(1),c.Mc("show",t.showSuccessModal),c.Ub(3),c.Mc("hidden",c.Fc(18,36,t.isMobile$)&&t.showBondDetails),c.Ub(6),c.Mc("ngTemplateOutlet",n),c.Ub(3),c.Mc("ngTemplateOutlet",i),c.Ub(1),c.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),c.Ub(1),c.Mc("ngForOf",t.pendingTableDisplayData)}},directives:[x.a,L.c,R.a,k.t,k.A,j,G.a,W.a,Y.a,K.a,X.a,L.a,k.s,Q.a,Q.f,Q.g,Q.e,Q.c,Q.d,q.a,k.q,Z.a,J.a,ee.a,B.a,te.a,M.a,Dn,B.b,N.b,Pn.c,In.c,Pn.b,In.t,In.w,kn.a,oe.a,An.d,An.a,In.J,In.u,In.v,En.c,En.b],pipes:[k.b,se.a,k.g],styles:[".ant-dropdown-menu-item[_ngcontent-%COMP%], .ant-dropdown-menu-submenu-title[_ngcontent-%COMP%]{color:#000} .ant-modal-footer, .model-cancel-order{border-top:0!important} .img-wrapper{width:27px;margin:5px;text-align:center}.order-book-your-order-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-7px}.order-book-your-order-table[_ngcontent-%COMP%] .ant-table-thead>tr>th{padding:4px}.order-book-your-order-table[_ngcontent-%COMP%] .ant-table-tbody>tr>td{padding:4px}.order-book-order-status[_ngcontent-%COMP%]{max-width:60px;white-space:normal;display:inline-block}.ellipsis-bond-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;width:340px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.button[_ngcontent-%COMP%]{color:var(---3a3a3a-darker-grey-text-secondary-btn-);text-align:left;font:normal normal normal 14px/18px Open Sans;letter-spacing:0;opacity:1}.modify-button[_ngcontent-%COMP%]{color:var(---3a3a3a-darker-grey-text-secondary-btn-);text-align:left;margin-right:8px;margin-bottom:12px;background-color:green}.modify-button[_ngcontent-%COMP%], .withdraw-button[_ngcontent-%COMP%]{letter-spacing:0;font:normal normal normal 14px/18px Open Sans;opacity:1;cursor:pointer;border-radius:5px}.withdraw-button[_ngcontent-%COMP%]{color:var(---3a3a3a-darker-grey-text-secondary-btn-);color:#3a3a3a;text-align:right;background-color:red}.red-button[_ngcontent-%COMP%]{background-color:#ff333a;border-color:#ff333a}.green-button[_ngcontent-%COMP%], .red-button[_ngcontent-%COMP%]{color:#fff;border-radius:5px;cursor:pointer}.green-button[_ngcontent-%COMP%]{border-color:#093;background-color:#093}.text-end[_ngcontent-%COMP%]{text-align:end}"]}),Object(i.c)([Object(a.e)(l.a.isMobile)],e.prototype,"isMobile$",void 0),Object(i.c)([Object(a.e)(y.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})()},"0Tf5":function(e,t,n){"use strict";n.d(t,"a",(function(){return F}));var i=n("NMKc"),c=n("tyNb"),o=n("fXoL");const s=[];let a=(()=>{class e{}return e.\u0275mod=o.jc({type:e}),e.\u0275inj=o.ic({factory:function(t){return new(t||e)},imports:[[c.i.forChild(s)],c.i]}),e})();var l=n("oyxB"),r=n("Q8cG"),d=n("F6ss"),u=n("0lU3"),h=n("Nqz0"),p=n("SKKP"),m=n("ZyQt"),f=n("bQSL"),g=n("2VHv"),b=n("HoDC"),S=n("b/WX"),y=n("xI//"),v=n("9WYH"),M=n("1HOV"),C=n("agyq"),q=n("ofXK"),T=n("wdY2"),w=n("D6yL"),z=n("ztgm"),D=n("eWI0"),P=n("mn7V"),I=n("jaXF"),k=n("GRZ8"),A=n("s8nw");const E=[D.Jb];let F=(()=>{class e{constructor(e){this.b2cIconService=e,this.b2cIconService.registerIcons([...E])}}return e.\u0275mod=o.jc({type:e}),e.\u0275inj=o.ic({factory:function(t){return new(t||e)(o.vc(D.n))},providers:[q.f,g.a],imports:[[i.a,a,l.h,r.e,d.b,f.a,u.b,h.e,d.b,b.a,S.AccountUpdateModule,p.b,m.b,y.b,T.b,v.b,M.b,w.a,z.a,C.a,D.o,P.a,I.a,k.a,A.a]]}),e})()},"2jM0":function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var i=n("mrSG"),c=n("fXoL"),o=n("AcyG"),s=n("gFZo"),a=n("ofXK"),l=n("drXJ"),r=n("dEAy"),d=n("6h7t"),u=n("ildK"),h=n("t7Fq");function p(e,t){if(1&e){const e=c.sc();c.rc(0,"app-web-scaffold"),c.rc(1,"nz-modal",3),c.zc("nzOnCancel",(function(){return c.dd(e),c.Dc().onClose()})),c.nc(2,4),c.qc(),c.qc()}if(2&e){const e=c.Dc(),t=c.ad(5);c.Ub(1),c.Mc("nzClosable",!0)("nzFooter",null)("nzTitle",null)("nzVisible",e.isModalVisible),c.Ub(1),c.Mc("ngTemplateOutlet",t)}}function m(e,t){if(1&e){const e=c.sc();c.rc(0,"b2c-mobile-drawer",5),c.zc("showChange",(function(){return c.dd(e),c.Dc().onClose()}))("showChange",(function(t){return c.dd(e),c.Dc().isModalVisible=t})),c.nc(1,4),c.qc()}if(2&e){const e=c.Dc(),t=c.ad(5);c.Mc("show",e.isModalVisible),c.Ub(1),c.Mc("ngTemplateOutlet",t)}}function f(e,t){if(1&e){const e=c.sc();c.rc(0,"div",6),c.rc(1,"h3"),c.qd(2,"Cooling-off Right"),c.qc(),c.rc(3,"p"),c.qd(4," The cooling-off right refers to your right as an investor to obtain a refund of your investment if you do request within the cooling-off period. However, cooling-off right is only available for your first investment under FSMOne and you are not any one of the following: "),c.qc(),c.rc(5,"ol",7),c.rc(6,"li"),c.qd(7,"\xa0a corporation or institution;"),c.qc(),c.rc(8,"li"),c.qd(9,"\xa0a staff of the fund manager; or"),c.qc(),c.rc(10,"li"),c.qd(11,"\xa0person registered with a body approved by the Securities Commission to deal in unit trust funds."),c.qc(),c.qc(),c.mc(12,"br"),c.rc(13,"p"),c.qd(14,"The cooling-off period shall be within six (6) Business Days and effective from the date of receipt of the application by FSMOne.The refund pursuant to the exercise of your cooling-off right shall not be less than the sum of:"),c.qc(),c.rc(15,"ol",7),c.rc(16,"li"),c.qd(17,"\xa0the price of a unit on the day the units were purchased; and"),c.qc(),c.rc(18,"li"),c.qd(19,"\xa0the charges imposed on the day the units were purchased."),c.qc(),c.qc(),c.mc(20,"br"),c.qd(21," The refund proceeds will be paid to you according to the redemption procedures."),c.mc(22,"br"),c.mc(23,"br"),c.qd(24," *Note:Cooling-off right is not applicable to ALL EPF funds by using EPF Account 1"),c.mc(25,"br"),c.mc(26,"br"),c.mc(27,"br"),c.rc(28,"span"),c.qd(29,"To exercise your cooling-off rights, please go to "),c.rc(30,"a",8),c.zc("click",(function(){return c.dd(e),c.Dc().navigateToTransactionPage()})),c.qd(31,"Void/Cooling-Off page"),c.qc(),c.qd(32," within the cooling-off period."),c.qc(),c.mc(33,"br"),c.mc(34,"br"),c.rc(35,"p"),c.qd(36," The cut off time for receipt of cooling-off request is the same as the dealing day cut off time i.e. 3pm. If the cooling-off request is received after the dealing cut off time, the cooling-off will be held over until the next dealing day as long as it is still within the respective fund cooling off period. "),c.qc(),c.rc(37,"p"),c.qd(38,"We shall contact you should we require any additional documents from you or if the cooling-off request cannot be processed. "),c.qc(),c.qc()}}let g=(()=>{class e{constructor(){this.onCloseModal=new c.s,this.urlToPage=d.a.LIVE_URL+"/"+d.o.APP+"/"+d.o.TRANSACTION_RECORD}ngOnInit(){}onClose(){this.onCloseModal.emit()}navigateToTransactionPage(){Object(u.a)([d.o.APP,d.o.TRANSACTION_RECORD],null)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.fc({type:e,selectors:[["cooling-off-right-modal"]],inputs:{isModalVisible:"isModalVisible"},outputs:{onCloseModal:"onCloseModal"},decls:6,vars:6,consts:[[4,"ngIf"],["actionText","Close",3,"show","showChange",4,"ngIf"],["detailTemplate",""],["nzWidth","800","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzTitle","nzVisible","nzOnCancel"],[3,"ngTemplateOutlet"],["actionText","Close",3,"show","showChange"],[1,"p-2","h5","text-black-7"],["type","a",1,"mb-3"],[1,"text-info","pointer",3,"href","click"]],template:function(e,t){1&e&&(c.od(0,p,3,5,"app-web-scaffold",0),c.Ec(1,"async"),c.od(2,m,2,2,"b2c-mobile-drawer",1),c.Ec(3,"async"),c.od(4,f,39,0,"ng-template",null,2,c.pd)),2&e&&(c.Mc("ngIf",!c.Fc(1,2,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(3,4,t.isMobile$)))},directives:[a.t,l.a,r.a,a.A,h.a],pipes:[a.b],styles:[""]}),Object(i.c)([Object(o.e)(s.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var b=n("oyiF");function S(e,t){if(1&e){const e=c.sc();c.rc(0,"app-web-scaffold"),c.rc(1,"nz-modal",2),c.zc("nzOnCancel",(function(){return c.dd(e),c.Dc().onClose()})),c.rc(2,"div",3),c.rc(3,"h3"),c.qd(4,"Terms and Conditions"),c.qc(),c.rc(5,"p",4),c.qd(6," To enjoy the respective tiered discount, your buy transactions must be placed under the same purchase order if it is to be based on lump sum investment amount. "),c.mc(7,"br"),c.mc(8,"br"),c.qd(9," Click "),c.rc(10,"span",5),c.zc("click",(function(){return c.dd(e),c.Dc().onShowCoolingOffRightModal()})),c.qd(11,"here"),c.qc(),c.qd(12," for information about your right to cancel. "),c.mc(13,"br"),c.mc(14,"br"),c.qd(15," Only information which forms part of the prospectus should be relied upon. Printed copies of the Prospectus can also be obtained at our office or you may request for them via email. "),c.mc(16,"br"),c.mc(17,"br"),c.qd(18," Please note that the unit trusts are offered solely on the basis of the information contained in the electronic prospectus and any other information found elsewhere does not form part of the electronic prospectus. "),c.mc(19,"br"),c.mc(20,"br"),c.qd(21," By investing in unit trusts via EPF Account 1, you understand that from 1 January 2017, you can invest not more than 30% of your savings in excess of Basic Savings amount in Account 1 into the Fund. You also understand that your purchase order(s) will only be processed by iFAST Capital upon their receipt of required documents and that the transaction date be confirmed by fund manager upon successful deduction of EPF Account 1 withdrawal. "),c.mc(22,"br"),c.mc(23,"br"),c.qd(24," You are above 18 years of age and eligible to apply for unit trust. You confirm that you have read, understood and accepted the terms and conditions in the relevant prospectus, product highlight sheets, and FSMOne website. You have also read and understood the "),c.rc(25,"span",5),c.zc("click",(function(){return c.dd(e),c.Dc().onShowUTDisclosureStatementModal()})),c.qd(26," Unit Trust Loan Financing Risk Disclosure Statement"),c.qc(),c.qd(27,". You agree to be bound by the terms and conditions of the prospectus and FSMOne website. You hereby instruct and authorize iFAST Capital to carry out your instructions as indicated. You agree that iFAST Capital may transfer and disclose any information relating to you and your account, which is necessary for carrying out these services and/ or for compliance, to relevant entities involved in unit trust(s), Private Retirement Scheme fund(s) and the Securities Commission. You agree and acknowledge that the value of the Investment(s) may go down and up and by instructing iFAST Capital to apply for any Investments on your behalf, this risk which you are prepared to accept. iFAST Capital shall have no Liability whatsoever to you for any losses you may suffer as a result of the performance of any Investment(s). "),c.qc(),c.qc(),c.qc(),c.rc(28,"cooling-off-right-modal",6),c.zc("onCloseModal",(function(){return c.dd(e),c.Dc().onCloseCo
1olingOffRightModal()})),c.qc(),c.rc(29,"ut-disclosure-statement-modal",6),c.zc("onCloseModal",(function(){return c.dd(e),c.Dc().onCloseUTDisclosureStatementModal()})),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Ub(1),c.Mc("nzClosable",!0)("nzFooter",null)("nzTitle",null)("nzVisible",e.isModalVisible),c.Ub(27),c.Mc("isModalVisible",e.showCoolingOffRight),c.Ub(1),c.Mc("isModalVisible",e.showUTDisclosureStatement)}}function y(e,t){if(1&e){const e=c.sc();c.rc(0,"b2c-mobile-drawer",7),c.zc("showChange",(function(){return c.dd(e),c.Dc().onClose()}))("showChange",(function(t){return c.dd(e),c.Dc().isModalVisible=t})),c.rc(1,"div",3),c.rc(2,"h3"),c.qd(3,"Terms and Conditions"),c.qc(),c.rc(4,"p",4),c.qd(5," To enjoy the respective tiered discount, your buy transactions must be placed under the same purchase order if it is to be based on lump sum investment amount."),c.mc(6,"br"),c.mc(7,"br"),c.qd(8," Click "),c.rc(9,"span",5),c.zc("click",(function(){return c.dd(e),c.Dc().onShowCoolingOffRightModal()})),c.qd(10,"here"),c.qc(),c.qd(11," for information about your right to cancel."),c.mc(12,"br"),c.mc(13,"br"),c.qd(14," Only information which forms part of the prospectus should be relied upon. Printed copies of the Prospectus can also be obtained at our office or you may request for them via email."),c.mc(15,"br"),c.mc(16,"br"),c.qd(17," Please note that the unit trusts are offered solely on the basis of the information contained in the electronic prospectus and any other information found elsewhere does not form part of the electronic prospectus."),c.mc(18,"br"),c.mc(19,"br"),c.qd(20," By investing in unit trusts via EPF Account 1, you understand that from 1 January 2017, you can invest not more than 30% of your savings in excess of Basic Savings amount in Account 1 into the Fund. You also understand that your purchase order(s) will only be processed by iFAST Capital upon their receipt of required documents and that the transaction date be confirmed by fund manager upon successful deduction of EPF Account 1 withdrawal."),c.mc(21,"br"),c.mc(22,"br"),c.qd(23," You are above 18 years of age and eligible to apply for unit trust. You confirm that you have read, understood and accepted the terms and conditions in the relevant prospectus, product highlight sheets, and FSMOne website. You have also read and understood the "),c.rc(24,"span",5),c.zc("click",(function(){return c.dd(e),c.Dc().onShowUTDisclosureStatementModal()})),c.qd(25,"Unit Trust Loan Financing Risk Disclosure Statement"),c.qc(),c.qd(26," . You agree to be bound by the terms and conditions of the prospectus and FSMOne website. You hereby instruct and authorize iFAST Capital to carry out your instructions as indicated. You agree that iFAST Capital may transfer and disclose any information relating to you and your account, which is necessary for carrying out these services and/ or for compliance, to relevant entities involved in unit trust(s), Private Retirement Scheme fund(s) and the Securities Commission. You agree and acknowledge that the value of the Investment(s) may go down and up and by instructing iFAST Capital to apply for any Investments on your behalf, this risk which you are prepared to accept. iFAST Capital shall have no Liability whatsoever to you for any losses you may suffer as a result of the performance of any Investment(s). "),c.qc(),c.qc(),c.rc(27,"cooling-off-right-modal",6),c.zc("onCloseModal",(function(){return c.dd(e),c.Dc().onCloseCoolingOffRightModal()})),c.qc(),c.rc(28,"ut-disclosure-statement-modal",6),c.zc("onCloseModal",(function(){return c.dd(e),c.Dc().onCloseUTDisclosureStatementModal()})),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Mc("show",e.isModalVisible),c.Ub(27),c.Mc("isModalVisible",e.showCoolingOffRight),c.Ub(1),c.Mc("isModalVisible",e.showUTDisclosureStatement)}}let v=(()=>{class e{constructor(){this.onCloseModal=new c.s,this.showCoolingOffRight=!1,this.showUTDisclosureStatement=!1}ngOnInit(){}onClose(){this.onCloseModal.emit()}onShowCoolingOffRightModal(){this.showCoolingOffRight=!0,this.isModalVisible=!1}onCloseCoolingOffRightModal(){this.showCoolingOffRight=!1,this.isModalVisible=!0}onShowUTDisclosureStatementModal(){this.showUTDisclosureStatement=!0,this.isModalVisible=!1}onCloseUTDisclosureStatementModal(){this.showUTDisclosureStatement=!1,this.isModalVisible=!0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.fc({type:e,selectors:[["buy-tnc-modal"]],inputs:{isModalVisible:"isModalVisible"},outputs:{onCloseModal:"onCloseModal"},decls:4,vars:6,consts:[[4,"ngIf"],["actionText","Accept and Continue",3,"show","showChange",4,"ngIf"],["nzWidth","720","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzTitle","nzVisible","nzOnCancel"],[1,"p-2"],[1,"h5","text-black-7"],[1,"text-info","pointer",3,"click"],[3,"isModalVisible","onCloseModal"],["actionText","Accept and Continue",3,"show","showChange"]],template:function(e,t){1&e&&(c.od(0,S,30,6,"app-web-scaffold",0),c.Ec(1,"async"),c.od(2,y,29,3,"b2c-mobile-drawer",1),c.Ec(3,"async")),2&e&&(c.Mc("ngIf",!c.Fc(1,2,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(3,4,t.isMobile$)))},directives:[a.t,l.a,r.a,g,b.a,h.a],pipes:[a.b],styles:[""]}),Object(i.c)([Object(o.e)(s.a.isMobile)],e.prototype,"isMobile$",void 0),e})()},"3IYF":function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("xeZY"),c=n("fXoL"),o=n("tk/3"),s=n("31Y2");let a=(()=>{class e{constructor(e,t){this.http=e,this.paramService=t,this.BASE_URL=i.a.STOCKS}readOrderBook(e,t,n){const c=this.paramService.buildHttpParams({refno:e,cache:n,exchange:t});return this.http.post(this.BASE_URL+i.a.READ_ORDER_BOOK,{},{params:c})}readOrderBookDetail(){}readOrderHistory(e,t){const n=this.paramService.buildHttpParams({refno:e,exchange:t});return this.http.post(this.BASE_URL+i.a.READ_ORDER_HISTORY,{},{params:n})}readOrderHistoryDetail(){}}return e.\u0275fac=function(t){return new(t||e)(c.vc(o.c),c.vc(s.a))},e.\u0275prov=c.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},"3WOW":function(e,t,n){"use strict";n.d(t,"a",(function(){return y}
1));var i=n("6h7t"),c=n("fXoL"),o=n("ofXK"),s=n("IvDN"),a=n("rMZv"),l=n("B+r4");function r(e,t){1&e&&(c.rc(0,"span",9),c.qd(1,"Collapse All"),c.qc())}function d(e,t){1&e&&(c.rc(0,"span",9),c.qd(1,"Expand All"),c.qc())}function u(e,t){if(1&e&&(c.rc(0,"div"),c.rc(1,"h5",14),c.qd(2,"Summary:"),c.qc(),c.rc(3,"nz-table",15),c.rc(4,"tbody"),c.rc(5,"tr"),c.rc(6,"td"),c.qd(7,"1.Investment Objective"),c.qc(),c.rc(8,"td"),c.qd(9),c.qc(),c.qc(),c.rc(10,"tr"),c.rc(11,"td"),c.qd(12,"2.Asset Allocation"),c.qc(),c.rc(13,"td"),c.qd(14),c.qc(),c.qc(),c.rc(15,"tr"),c.rc(16,"td"),c.qd(17,"3.Suitable For"),c.qc(),c.rc(18,"td"),c.qd(19),c.mc(20,"br"),c.rc(21,"div",16),c.qd(22),c.mc(23,"br"),c.qd(24),c.qc(),c.qd(25),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(26,"h5",17),c.qd(27,"General:"),c.qc(),c.rc(28,"ol",18),c.rc(29,"li"),c.qd(30," In view of different market conditions, FSMOne may, from time to time, deviate 15% away from its neutral allocation as tabled below "),c.rc(31,"nz-table",19),c.rc(32,"thead"),c.rc(33,"tr"),c.rc(34,"th"),c.qd(35,"Permitted investments"),c.qc(),c.rc(36,"th"),c.qd(37,"Min"),c.qc(),c.rc(38,"th"),c.qd(39,"Max"),c.qc(),c.qc(),c.qc(),c.rc(40,"tbody"),c.rc(41,"tr"),c.rc(42,"td"),c.qd(43,"Equities-related securities"),c.qc(),c.rc(44,"td"),c.qd(45),c.qc(),c.rc(46,"td"),c.qd(47),c.qc(),c.qc(),c.rc(48,"tr"),c.rc(49,"td"),c.qd(50,"Fixed income-related securities"),c.qc(),c.rc(51,"td"),c.qd(52),c.qc(),c.rc(53,"td"),c.qd(54),c.qc(),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(55,"li"),c.qd(56," The permitted investments are subject to the following restrictions:"),c.mc(57,"br"),c.rc(58,"div",20),c.rc(59,"nz-row"),c.rc(60,"nz-col",21),c.qd(61," - "),c.qc(),c.rc(62,"nz-col",22),c.qd(63," The value of the portfolio's investments in units of any collective investment scheme must not exceed 20% of the portfolio's value. "),c.qc(),c.qc(),c.rc(64,"nz-row"),c.rc(65,"nz-col",21),c.qd(66," - "),c.qc(),c.rc(67,"nz-col",22),c.qd(68," The value of the portfolio's direct investments in any ordinary shares issued by any single issuer must not exceed 10% of the portfolio's value. "),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(69,"li"),c.qd(70,"The portfolio is not permitted to invest directly in derivatives and structured products."),c.qc(),c.rc(71,"li",20),c.qd(72,"The portfolio is not permitted to borrow cash or other assets."),c.qc(),c.rc(73,"li"),c.qd(74),c.qc(),c.qc(),c.rc(75,"h5",17),c.qd(76,"Investment Universe:"),c.qc(),c.rc(77,"ol",18),c.rc(78,"li"),c.qd(79,"All types of collective investment schemes (both local and foreign)"),c.qc(),c.rc(80,"li",20),c.qd(81,"Equities listed on the Bursa Malaysia and foreign stock exchanges"),c.qc(),c.rc(82,"li"),c.qd(83,'Malaysia Government Securities ("MGS"), treasury bills, Bank Negara Malaysia certificates and government investment certificates '),c.qc(),c.rc(84,"li",20),c.qd(85,"Deposit and money market instruments"),c.qc(),c.rc(86,"li"),c.qd(87,"Any other form of investments as may be permitted by the relevant authorities from time to time"),c.qc(),c.qc(),c.qc()),2&e){const e=c.Dc().$implicit,t=c.Dc(3);c.Ub(3),c.Mc("nzShowPagination",!1)("nzBordered",!0),c.Ub(6),c.rd(e.investmentObjective),c.Ub(5),c.rd(e.assetAllocation),c.Ub(5),c.sd(" This portfolio is suitable for ",e.typeOfInvestor," Investors who: "),c.Ub(3),c.sd(" ",e.pointA,""),c.Ub(2),c.sd(" ",e.pointB," "),c.Ub(1),c.sd(" ",e.description," "),c.Ub(6),c.Mc("nzShowPagination",!1),c.Ub(14),c.rd(e.equitiesPercentageA),c.Ub(2),c.rd(e.equitiesPercentageB),c.Ub(5),c.rd(e.fixedIncomePercentageA),c.Ub(2),c.rd(e.fixedIncomePercentageB),c.Ub(20),c.rd(t.specificDpmsFifthGeneralContent)}}function h(e,t){if(1&e&&(c.rc(0,"div"),c.od(1,u,88,14,"div",12),c.qc()),2&e){const e=t.$implicit,n=c.Dc(3);c.Ub(1),c.Mc("ngIf",e.riskLevel===n.riskAppetite)}}function p(e,t){if(1&e&&(c.rc(0,"div"),c.od(1,h,2,1,"div",13),c.qc()),2&e){const e=c.Dc(2);c.Ub(1),c.Mc("ngForOf",e.specificDpmsSubscribeInfo)}}function m(e,t){1&e&&(c.rc(0,"div"),c.rc(1,"div"),c.qd(2," Customers should be aware that the Manager might invest in fixed income securities, equities, money market instruments and collective investment schemes. Depending on the underlying securities and investment strategy, the investments will be exposed to the following significant risks:"),c.mc(3,"br"),c.rc(4,"nz-row",20),c.rc(5,"nz-col",21),c.qd(6," - "),c.qc(),c.rc(7,"nz-col",22),c.rc(8,"strong"),c.qd(9,"Investment risk:"),c.qc(),c.qd(10," Past performance may not be a reliable guide to future performance. The value of the underlying investments and the return derived from them can fluctuate and go down as well as up. There can be no assurance, and n
1o assurance is given, that the portfolio will achieve its investment objectives. There is also no guarantee of repayment of capital. "),c.qc(),c.qc(),c.rc(11,"nz-row"),c.rc(12,"nz-col",21),c.qd(13," - "),c.qc(),c.rc(14,"nz-col",22),c.rc(15,"strong"),c.qd(16,"Market risk:"),c.qc(),c.qd(17," Risks that affect the entire equity markets, including investor sentiment, economic impacts, regulatory conditions, political and catastrophic events. "),c.qc(),c.qc(),c.rc(18,"nz-row",20),c.rc(19,"nz-col",21),c.qd(20," - "),c.qc(),c.rc(21,"nz-col",22),c.rc(22,"strong"),c.qd(23,"Emerging-market risk:"),c.qc(),c.qd(24," The Manager might invest in equities and fixed income securities across emerging markets, thereby providing exposure to emerging markets that tend to be more volatile than developed markets, and its value could move sharply up or down. Political risks and adverse economic circumstances are more likely to arise, putting the value of the Customer's investment at risk. "),c.qc(),c.qc(),c.rc(25,"nz-row"),c.rc(26,"nz-col",21),c.qd(27," - "),c.qc(),c.rc(28,"nz-col",22),c.rc(29,"strong"),c.qd(30,"Single-country/sectorial risk:"),c.qc(),c.qd(31," The Manager may invest in securities that may have concentrated holdings in a single country or sector, and thus may have greater exposure to the market, political, legal, economic and social risks of that particular country or sector than securities that diversify country risk across a number of countries. As a result, the value of the single-country or-sectorial securities may be more volatile than securities that diversify across a larger number of countries or investments. "),c.qc(),c.qc(),c.rc(32,"nz-row",20),c.rc(33,"nz-col",21),c.qd(34," - "),c.qc(),c.rc(35,"nz-col",22),c.rc(36,"strong"),c.qd(37,"Volatility risk:"),c.qc(),c.qd(38," The price of investments in the Portfolio may vary, sometimes markedly and over a short period of time. Generally, the higher the potential return, the higher the risk and the greater the chance of substantial fluctuations in returns over a short period of time. In particular, investments in equity securities are traditionally towards the higher end of the risk-return spectrum. This may lead to fluctuations in the value of the Portfolio, including fluctuation over the period between a withdrawal request being made and the time of payment. Markets are volatile and indeed volatility in some markets can often be very high. "),c.qc(),c.qc(),c.rc(39,"nz-row"),c.rc(40,"nz-col",21),c.qd(41," - "),c.qc(),c.rc(42,"nz-col",22),c.rc(43,"strong"),c.qd(44,"Currency risk:"),c.qc(),c.qd(45," The risk that fluctuations in exchange rates may cause the value of international investments to decline significantly. "),c.qc(),c.qc(),c.rc(46,"nz-row",20),c.rc(47,"nz-col",21),c.qd(48," - "),c.qc(),c.rc(49,"nz-col",22),c.rc(50,"strong"),c.qd(51,"Currency-hedging risk:"),c.qc(),c.qd(52," The Manager may invest in securities with a currency-hedged share class. While potentially reducing the currency risks to which the funds would otherwise be exposed, currency-hedging instruments may involve the risk of default by a counterparty (counterparty risk). "),c.qc(),c.qc(),c.rc(53,"nz-row"),c.rc(54,"nz-col",21),c.qd(55," - "),c.qc(),c.rc(56,"nz-col",22),c.rc(57,"strong"),c.qd(58,"Interest rate risk:"),c.qc(),c.qd(59," Movements in domestic and international interest rates may cause the value of the Portfolio to decline. "),c.qc(),c.qc(),c.rc(60,"nz-row",20),c.rc(61,"nz-col",21),c.qd(62," - "),c.qc(),c.rc(63,"nz-col",22),c.rc(64,"strong"),c.qd(65,"Implementation risk:"),c.qc(),c.qd(66," The performance of the Portfolio may differ from the performance of the relevant portfolio due to a number of factors such as cash flows, liquidity of instruments, portfolio reweighting and timing differences. "),c.qc(),c.qc(),c.rc(67,"nz-row"),c.rc(68,"nz-col",21),c.qd(69," - "),c.qc(),c.rc(70,"nz-col",22),c.rc(71,"strong"),c.qd(72,"Investment manager risk:"),c.qc(),c.qd(73," The risk that the Manager will not achieve the performance objectives or produce returns that compare favourably against its peers. Additionally, there is the risk that the Manager's investment strategy may not prove to be effective. Many factors can negatively impact the Manager's ability to generate acceptable returns from its investment management process, including the loss of key staff. Furthermore, Portfolios may be discontinued, altered or terminated. "),c.qc(),c.qc(),c.rc(74,"nz-row",20),c.rc(75,"nz-col",21),c.qd(76," - "),c.qc(),c.rc(77,"nz-col",22),c.rc(78,"strong"),c.qd(79,"Counterparty risk:"),c.qc(),c.qd(80," The risk of loss due to a counterparty not honouring a commitment, which may cause the value of the Portfolio to fall. Counterparties include custodians, brokers and settlement houses. "),c.qc(),c.qc(),c.rc(81,"nz-row"),c.rc(82,"nz-col",21),c.qd(83," - "),c.qc(),c.rc(84,"nz-col",22),c.rc(85,"strong"),c.qd(86,"Fixed income securities and downgrade risk:"),c.qc(),c.qd(87," The Manager may invest in fixed income securities. Fixed income securities are subject to the risk of an issuer's ability to meet principal and interest payments on the obligation (credit risk), and may also be subject to price volatility due to such factors as interest rate sensitivity, market perception of the creditworthiness of the issuer and general market liquidity (market risk). The Manager may also invest in fixed income securities that are interest rate sensitive. An increase in interest rates will generally reduce the value of fixed income securities, while a decline in interest rates will generally increase the value of fixed income securities. The performance of the Portfolio will therefore depend in part on the ability to anticipate and respond to such fluctuations on market interest rates, and to utilise appropriate strategies to maximise returns while attempting to minimise the associated risks to investment capital. Fixed income securities are also exposed to the risk of being downgraded, which can cause a significant drop in the value of the Portfolio. "),c.qc(),c.qc(),c.rc(88,"nz-row",20),c.rc(89,"nz-col",21),c.qd(90," - "),c.qc(),c.rc(91,"nz-col",22),c.rc(92,"strong"),c.qd(93,"Credit and sovereign debt risk:"),c.qc(),c.qd(94," The Manager may invest in government/sovereign and corporate fixed income securities. Investment in sovereign debts issued or guaranteed by governments as well as corporate-issued securities involves a high degree of risk as default can occur if the government or corporate entity is not able or willing to repay the principal and/or interest when due. "),c.qc(),c.qc(),c.qc(),c.qc())}function f(e,t){1&e&&(c.rc(0,"div"),c.rc(1,"div"),c.qd(2," Name: "),c.mc(3,"br"),c.qd(4," Malayan Banking Berhad (Reg No. 787435-M)"),c.mc(5,"br"),c.mc(6,"br"),c.qd(7," Address: "),c.mc(8,"br"),c.qd(9," 14th Floor, Menara Maybank, Jalan Tun Perak, 50050 Kuala Lumpur "),c.rc(10,"div",23),c.qd(11," Note: "),c.mc(12,"br"),c.qd(13," 1. Assets received or held outside Malaysia will be subject to regulations of the foreign jurisdiction and may not be subject to the same protection as that conferred on client assets received or held in Malaysia."),c.mc(14,"br"),c.mc(15,"br"),c.qd(16," 2. Investors may receive reports, statements or any other documents in relation to the portfolio investment from Malayan Banking Berhad by email, mail, courier, fax transmission or by such other means as the Custodian may designate from time to time. "),c.qc(),c.qc(),c.qc())}function g(e,t){if(1&e&&(c.rc(0,"nz-collapse-panel",10,11),c.od(2,p,2,1,"div",12),c.od(3,m,95,0,"div",12),c.od(4,f,17,0,"div",12),c.qc()),2&e){const e=t.$implicit,n=t.index,i=c.ad(1);c.Dc();const o=c.ad(12),s=c.ad(10);c.Mc("nzHeader",e.name)("nzActive",e.active)("nzExpandedIcon",i.nzActive?o:s),c.Ub(2),c.Mc("ngIf",0===n),c.Ub(1),c.Mc("ngIf",1===n),c.Ub(1),c.Mc("ngIf",2===n)}}function b(e,t){if(1&e&&c.mc(0,"img",24),2&e){const e=c.Dc();c.Mc("src",e.transactionImgPath+"plus-circle-icon.svg",c.gd)}}function S(e,t){if(1&e&&c.mc(0,"img",25),2&e){const e=c.Dc();c.Mc("src",e.transactionImgPath+"minus-circle-icon.svg",c.gd)}}let y=(()=>{class e{constructor(){this.isCashPortfolio=!1,this.transactionImgPath=i.g.TRANSACTION_IMG_PATH,this.panels=[{active:!1,name:null},{active:!1,name:"Risk Disclosure Statement"},{active:!1,name:"Custodian's Details"}],this.dpmsSubscribeInfo=[{riskLevel:"Conservative",investmentObjective:"Aim to achieve capital preservation and provide an opportunity for capital appreciation",assetAllocation:"90% Fixed Income/10% Equities",typeOfInvestor:"Conservative",pointA:"a.\tWant a stable, low-risk portfolio; and/or",pointB:"b.\tRequire a shorter-term investment horizon.",description:"Specific examples include retirees and risk-adverse investors.",equitiesPercentageA:"10%",equitiesPercentageB:"25%",fixedIncomePercentageA:"75%",fixedIncomePercentageB:"90%"},{riskLevel:"Moderately Conservative",investmentObjective:"Aim to achieve stable return and provide an opportunity for capital appreciation",assetAllocation:"70% Fixed Income/30% Equities",typeOfInvestor:"Moderately Conservative",pointA:"a. Want a stable, below average-risk portfolio; and/or",pointB:"b. Require a short to medium-term investment horizon.",description:"Specific examples include retirees and risk-adverse investors",equitiesPercentageA:"15%",equitiesPercentageB:"45%",fixedIncomePercentageA:"55%",fixedIncomePercentageB:"85%"},{riskLevel:"Balanced",investmentObjective:"Aim to achieve a stable return and generate capital growth over medium to long term",assetAllocation:"50% Fixed Income/50% Equities",typeOfInvestor:"Balanced",pointA:"a.\tWant reasonably good returns and are able to bear some risk; and/or",pointB:"b.\tHave medium to long-term financial goals like saving for children's education or upgrading a home.",description:"Specific examples include middle-aged persons who have no immediate cash commitments and those preparing for medium to long-term retirement planning.",equitiesPercentageA:"35%",equitiesPercentageB:"65%",fixedIncomePercentageA:"35%",fixedIncomePercentageB:"65%"},{riskLevel:"Moderately Aggressive",investmentObjective:"Aim to achieve above average capital appreciation over medium to long term",assetAllocation:"30% Fixed Income/70% Equities",typeOfInvestor:"Moderately Aggressive",pointA:"a. Want an above average-risk portfolio and are able to handle higher risks; and/or",pointB:"b. Have a medium to long-term horizon and can bear volatile market ",description:"Specific examples include singles with no near-term commitments and couples saving for medium to long-term retirement.",equitiesPercentageA:"55%",equitiesPercentageB:"85%",fixedIncomePercentageA:"15%",fixedIncomePercentageB:"45%"},{riskLevel:"Aggressive",investmentObjective:"Aim to achieve above average capital appreciation over long term",assetAllocation:"10% Fixed Income/90% Equities",typeOfInvestor:"Aggressive",pointA:"a. Are able to handle higher risks and understand the fluctuations that come with being invested in stock markets; and/or",pointB:"b. Have a long-term horizon and can bear temporary market setbacks.",description:"Specific examples include singles with no near-term commitments and couples saving for long-term retirement.",equitiesPercentageA:"75%",equitiesPercentageB:"90%",fixedIncomePercentageA:"10%",fixedIncomePercentageB:"25%"}],this.cashPortfolioDpmsSubscribeInfo=[{riskLevel:"Balanced",investmentObjective:"Aim to distribute all income received from its underlying investments on a monthly basis with a neutral asset allocation of 60% to fixed income and 40% to equities. This is a globally diversified portfolio balancing between equity and fixed income funds to achieve the objective of income distribution on a sustainable basis",assetAllocation:"60% Fixed Income/40% Equities",typeOfInvestor:"Balanced",pointA:"a.\tAre seeking a stable and low-to-medium risk income-themed portfolio; and/or",pointB:"b.\tAre willing to sacrifice some potential returns for lower risk.",description:"Specific examples include retirees and risk-adverse investors.",equitiesPercentageA:"25%",equitiesPercentageB:"55%",fixedIncomePercentageA:"45%",fixedIncomePercentageB:"75%"}]}ngOnInit(){this.panels[0].name="Investment Mandate ("+this.riskAppetite+")"}
1onExpandAll(){this.isExpandAll=!this.isExpandAll,this.panels.forEach(e=>{e.active=this.isExpandAll})}get specificDpmsSubscribeInfo(){return this.isCashPortfolio?this.cashPortfolioDpmsSubscribeInfo:this.dpmsSubscribeInfo}get specificDpmsFifthGeneralContent(){return this.isCashPortfolio?"Income distributions, after deduction of applicable taxes and expenses and any currency conversion, will be paid in the portfolio's base currency.":"Income distribution (if any), after deduction of taxation and expenses, will be reinvested."}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.fc({type:e,selectors:[["related-info-collapse"]],inputs:{riskAppetite:"riskAppetite",isCashPortfolio:"isCashPortfolio"},decls:13,vars:4,consts:[[1,"mb-2","clearfix"],[1,"float-left"],[1,"float-right",3,"click"],[3,"ngTemplateOutlet"],["class","text-sm font-weight-bold",4,"ngIf"],["nzAccordion",""],["class","text-sm",3,"nzHeader","nzActive","nzExpandedIcon",4,"ngFor","ngForOf"],["plusCircleIcon",""],["minusCircleIcon",""],[1,"text-sm","font-weight-bold"],[1,"text-sm",3,"nzHeader","nzActive","nzExpandedIcon"],["colPanel",""],[4,"ngIf"],[4,"ngFor","ngForOf"],[1,"font-weight-bold","mb-3"],["nzTemplateMode","",3,"nzShowPagination","nzBordered"],[1,"ml-2"],[1,"font-weight-bold","my-3"],["type","1"],["nzTemplateMode","",1,"my-4",3,"nzShowPagination"],[1,"my-3"],["nzSpan","1"],["nzSpan","23"],[1,"text-xs","text-black-6","my-3"],["alt","plus circle icon",1,"h-100","pl-3","mr-2",3,"src"],["alt","minus circle icon",1,"h-100","pl-3","mr-2",3,"src"]],template:function(e,t){if(1&e&&(c.rc(0,"div",0),c.rc(1,"strong",1),c.qd(2,"Related Portfolio Information"),c.qc(),c.rc(3,"div",2),c.zc("click",(function(){return t.onExpandAll()})),c.nc(4,3),c.od(5,r,2,0,"span",4),c.od(6,d,2,0,"span",4),c.qc(),c.qc(),c.rc(7,"nz-collapse",5),c.od(8,g,5,6,"nz-collapse-panel",6),c.qc(),c.od(9,b,1,1,"ng-template",null,7,c.pd),c.od(11,S,1,1,"ng-template",null,8,c.pd)),2&e){const e=c.ad(10),n=c.ad(12);c.Ub(4),c.Mc("ngTemplateOutlet",t.isExpandAll?n:e),c.Ub(1),c.Mc("ngIf",t.isExpandAll),c.Ub(1),c.Mc("ngIf",!t.isExpandAll),c.Ub(2),c.Mc("ngForOf",t.panels)}},directives:[o.A,o.t,s.a,o.s,s.c,a.a,a.c,a.g,a.d,a.f,a.e,l.c,l.a],styles:[""]}),e})()},"82pO":function(e,t,n){"use strict";function i(e,t){return e.filter((e,n,i)=>i.findIndex(n=>n[t]===e[t])===n)}n.d(t,"a",(function(){return i}))},"9Or2":function(e,t,n){"use strict";n.d(t,"a",(function(){return dn}));var i=n("fXoL"),c=n("ofXK"),o=n("iEbP"),s=n("j0Y6"),a=n("G/fY"),l=n("AcyG"),r=n("rMZv"),d=n("B+r4"),u=n("mrSG"),h=n("6h7t"),p=n("gFZo"),m=n("H8v0"),f=n("vkgz"),g=n("lJxs"),b=n("VOXV"),S=n("+NfP"),y=n("ildK"),v=n("Zk2z"),M=n("2VHv"),C=n("nJia"),q=n("T0I8"),T=n("FwiY"),w=n("OzZK"),z=n("bE2y"),D=n("3Pt+"),P=n("drXJ"),I=n("1Z1e"),k=n("qAZ0"),A=n("h76Y");function E(e,t){if(1&e){const e=i.sc();i.rc(0,"span",14),i.zc("click",(function(){return i.dd(e),i.Dc(3).redirectToFactsheetPage()})),i.qd(1),i.qc()}if(2&e){const e=i.Dc(3);i.Ub(1),i.rd(e.product.fundInfoName)}}function F(e,t){if(1&e&&(i.rc(0,"span"),i.qd(1),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.rd(e.product.dpmsPortfolioName)}}const O=function(e,t){return{"fund-mobile-logo":e,"mx-1 mr-2":t}},U=function(e){return{"fund-logo-web":e}};function x(e,t){if(1&e&&(i.rc(0,"div",15),i.Ec(1,"async"),i.Ec(2,"async"),i.mc(3,"img",16),i.Ec(4,"async"),i.qc()),2&e){const e=i.Dc(3);i.Mc("ngClass",i.Tc(9,O,i.Fc(1,3,e.isMobile$),!i.Fc(2,5,e.isMobile$))),i.Ub(3),i.Mc("ngClass",i.Sc(12,U,!i.Fc(4,7,e.isMobile$)))("src",e.transactionImgPath+"epf-approved-fund.svg",i.gd)}}const L=function(e,t){return{"fund-mobile-logo":e,"mx-1 pl-1":t}};function R(e,t){if(1&e&&(i.rc(0,"div",15),i.Ec(1,"async"),i.Ec(2,"async"),i.mc(3,"img",17),i.Ec(4,"async"),i.qc()),2&e){const e=i.Dc(3);i.Mc("ngClass",i.Tc(9,L,i.Fc(1,3,e.isMobile$),!i.Fc(2,5,e.isMobile$))),i.Ub(3),i.Mc("ngClass",i.Sc(12,U,!i.Fc(4,7,e.isMobile$)))("src",e.transactionImgPath+"recommended-fund.svg",i.gd)}}const N=function(e,t){return{"fund-mobile-logo":e,"mx-1 pl-2":t}};function B(e,t){if(1&e&&(i.rc(0,"div",15),i.Ec(1,"async"),i.Ec(2,"async"),i.mc(3,"img",18),i.Ec(4,"async"),i.qc()),2&e){const e=i.Dc(3);i.Mc("ngClass",i.Tc(9,N,i.Fc(1,3,e.isMobile$),!i.Fc(2,5,e.isMobile$))),i.Ub(3),i.Mc("ngClass",i.Sc(12,U,!i.Fc(4,7,e.isMobile$)))("src",e.transactionImgPath+"islamic-fund.svg",i.gd)}}function _(e,t){if(1&e&&(i.rc(0,"div",15),i.Ec(1,"async"),i.Ec(2,"async"),i.mc(3,"img",19),i.Ec(4,"async"),i.qc()),2&e){const e=i.Dc(3);i.Mc("ngClass",i.Tc(9,N,i.Fc(1,3,e.isMobile$),!i.Fc(2,5,e.isMobile$))),i.Ub(3),i.Mc("ngClass",i.Sc(12,U,!i.Fc(4,7,e.isMobile$)))("src",e.transactionImgPath+"wholesale-fund.svg",i.gd)}}function V(e,t){if(1&e&&(i.rc(0,"div"),i.qd(1),i.mc(2,"br"),i.rc(3,"p",20),i.qd(4),i.Ec(5,"currencyFormat"),i.qc(),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.sd(" ",e.header1," "),i.Ub(3),i.sd(" ",i.Gc(5,2,e.product.minInvestmentAmount,e.product.minInvestmentAmountCurrency)," ")}}function H(e,t){if(1&e&&(i.mc(0,"b2b-statistic",21),i.Ec(1,"currencyFormat")),2&e){const e=i.Dc(3);i.Mc("title",e.header1)("value",i.Gc(1,2,e.product.investmentAmount,e.product.investmentCurrency))}}function $(e,t){if(1&e&&(i.mc(0,"b2b-statistic",25),i.Ec(1,"number")),2&e){const e=i.Dc(4);i.Mc("title",e.header2)("tooltip",e.tooltip2)("value",-1!==e.product.riskRating.indexOf("%")?i.Gc(1,4,e.product.riskRating.split("%")[0],"1.2-2")+"%":e.product.riskRating)("ngClass",e.product.appliedPromoCode?"text-info":"")}}function j(e,t){if(1&e&&i.mc(0,"b2b-statistic",26),2&e){const e=i.Dc(4);i.Mc("title",e.header2)("tooltip",e.tooltip2)("value",e.product.minInvestmentAmountCurrency)}}const G=function(e,t){return{"text-loss":e,"text-profit":t}};function W(e,t){if(1&e&&(i.mc(0,"b2b-statistic",25),i.Ec(1,"currencyFormat")),2&e){const e=i.Dc(4);i.Mc("title",e.header2)("tooltip",e.tooltip2)("value",(i.Gc(1,4,e.product.profitLossAmount,e.product.profitLossCurrency)||"-")+" | "+e.product.profitLossPercentage+"%")("ngClass",i.Tc(7,G,e.product.profitLossPercentage<0,e.product.profitLossPercentage>0))}}function Y(e,t){if(1&e&&(i.mc(0,"b2b-statistic",25),i.Ec(1,"currencyFormat")),2&e){const e=i.Dc(4);i.Mc("title",e.header2)("tooltip",e.tooltip2)("value",e.product.minInvestmentAmount>0?i.Gc(1,4,e.product.profitLossAmount,e.product.profitLossCurrency)+" | "+e.product.profitLossPercentage+"%":"-")("ngClass",i.Tc(7,G,e.product.profitLossPercentage<0,e.product.profitLossPercentage>0))}}function K(e,t){if(1&e&&(i.rc(0,"div",22),i.od(1,$,2,7,"b2b-statistic",23),i.od(2,j,1,3,"b2b-statistic",24),i.od(3,W,2,10,"b2b-statistic",23),i.od(4,Y,2,10,"b2b-statistic",23),i.qc()),2&e){const e=i.Dc(3);i.Mc("nzSpan",e.isMobile?12:6),i.Ub(1),i.Mc("ngIf",!e.showProfitLoss&&!e.isDpms),i.Ub(1),i.Mc("ngIf",!e.showProfitLoss&&e.isDpms),i.Ub(1),i.Mc("ngIf",e.showProfitLoss&&!e.isDpms),i.Ub(1),i.Mc("ngIf",e.showProfitLoss&&e.isDpms)}}function X(e,t){if(1&e&&(i.rc(0,"div",22),i.mc(1,"b2b-statistic",25),i.qc()),2&e){const e=i.Dc(3);i.Mc("nzSpan",e.isMobile?12:5),i.Ub(1),i.Mc("title",e.header3)("tooltip",e.tooltip3)("value",e.product.additionalInfo)("ngClass",e.showPerformanceColour?"text-info":"text-black")}}function Q(e,t){if(1&e){const e=i.sc();i.rc(0,"i",36),i.zc("click",(function(){i.dd(e);const t=i.Dc(5);return t.add(t.product.sedolnumber)})),i.qc()}if(2&e){i.Dc();const e=i.ad(10);i.Mc("nz-tooltip",e)}}function Z(e,t){1&e&&i.mc(0,"i",37)}function J(e,t){if(1&e&&i.mc(0,"i",38),2&e){i.Dc();const e=i.ad(8);i.Mc("nz-tooltip",e)}}function ee(e,t){if(1&e){const e=i.sc();i.rc(0,"i",39),i.zc("click",(function(){i.dd(e);const t=i.Dc(5);return t.add(t.product.sedolnumber)})),i.qc()}}function te(e,t){1&e&&i.mc(0,"i",40)}function ne(e,t){if(1&e){const e=i.sc();i.rc(0,"i",39),i.zc("click",(function(){i.dd(e);const t=i.Dc(5);return t.addDpms(t.product.dpmsPortfolioId)}
1)),i.qc()}}function ie(e,t){1&e&&(i.rc(0,"span"),i.qd(1,"Unable to sell PRS Fund"),i.qc())}function ce(e,t){1&e&&(i.rc(0,"span"),i.qd(1,"Add to Cart"),i.qc())}function oe(e,t){if(1&e&&(i.rc(0,"div",28),i.od(1,Q,1,1,"i",29),i.od(2,Z,1,0,"i",30),i.od(3,J,1,1,"i",31),i.od(4,ee,1,0,"i",32),i.od(5,te,1,0,"i",33),i.od(6,ne,1,0,"i",32),i.od(7,ie,2,0,"ng-template",null,34,i.pd),i.od(9,ce,2,0,"ng-template",null,35,i.pd),i.qc()),2&e){const e=i.Dc(4);i.Mc("nzLg",2),i.Ub(1),i.Mc("ngIf",!e.product.addedToCart&&!e.product.isPrs&&!e.product.isPrsGov&&e.product.minInvestmentAmount>0&&!e.isDpms),i.Ub(1),i.Mc("ngIf",e.product.addedToCart),i.Ub(1),i.Mc("ngIf",e.product.isPrs&&!e.product.isSwitch&&e.product.minInvestmentAmount>0),i.Ub(1),i.Mc("ngIf",(e.product.isPrs||e.product.isPrsGov)&&e.product.isSwitch&&!e.product.addedToCart&&e.product.minInvestmentAmount>0),i.Ub(1),i.Mc("ngIf",e.product.minInvestmentAmount<=0),i.Ub(1),i.Mc("ngIf",e.product.minInvestmentAmount>0&&e.isDpms&&!e.product.addedToCart)}}function se(e,t){if(1&e){const e=i.sc();i.rc(0,"i",42),i.zc("click",(function(){i.dd(e);const t=i.Dc(5);return t.edit(t.product.sedolnumber)})),i.qc()}}function ae(e,t){if(1&e){const e=i.sc();i.rc(0,"i",42),i.zc("click",(function(){i.dd(e);const t=i.Dc(5);return t.editDpms(t.product.dpmsPortfolioId)})),i.qc()}}function le(e,t){if(1&e&&(i.rc(0,"div",28),i.od(1,se,1,0,"i",41),i.od(2,ae,1,0,"i",41),i.q
1c()),2&e){const e=i.Dc(4);i.Mc("nzLg",2),i.Ub(1),i.Mc("ngIf",!e.isDpmsSubsequentPage),i.Ub(1),i.Mc("ngIf",e.isDpmsSubsequentPage)}}function re(e,t){if(1&e){const e=i.sc();i.rc(0,"div",28),i.rc(1,"button",43),i.zc("click",(function(){i.dd(e);const t=i.Dc(4);return t.buyBond(t.product.sedolnumber)})),i.qd(2,"Buy Bond "),i.qc(),i.qc()}2&e&&i.Mc("nzLg",2)}function de(e,t){if(1&e&&(i.pc(0),i.od(1,oe,11,7,"div",27),i.od(2,le,3,3,"div",27),i.od(3,re,3,1,"div",27),i.oc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("ngIf",e.showAddToCartBtn),i.Ub(1),i.Mc("ngIf",e.showEditBtn&&e.product.paymentMethod),i.Ub(1),i.Mc("ngIf",e.showBuyBondBtn)}}function ue(e,t){if(1&e&&(i.rc(0,"label",47),i.qd(1),i.qc()),2&e){const e=t.$implicit;i.Mc("nzValue",e.value),i.Ub(1),i.sd(" ",e.label," ")}}function he(e,t){if(1&e){const e=i.sc();i.rc(0,"div",44),i.rc(1,"div",4),i.rc(2,"p",20),i.qd(3," Utilize Your Referral Token? "),i.qc(),i.qc(),i.rc(4,"div",4),i.rc(5,"nz-radio-group",45),i.zc("ngModelChange",(function(t){return i.dd(e),i.Dc(3).onTabChange(t)}))("ngModelChange",(function(t){return i.dd(e),i.Dc(3).token=t})),i.od(6,ue,2,2,"label",46),i.qc(),i.qc(),i.qc()}if(2&e){const e=i.Dc(3);i.Mc("nzSpan",24),i.Ub(1),i.Mc("nzSpan",11),i.Ub(3),i.Mc("nzSpan",13),i.Ub(1),i.Mc("ngModel",e.token),i.Ub(1),i.Mc("ngForOf",e.tokenList)}}function pe(e,t){if(1&e&&(i.rc(0,"div",3),i.rc(1,"div",4),i.rc(2,"p",5),i.Ec(3,"async"),i.od(4,E,2,1,"span",6),i.od(5,F,2,1,"span",0),i.pc(6),i.rc(7,"span",7),i.Ec(8,"async"),i.od(9,x,5,14,"div",8),i.od(10,R,5,14,"div",9),i.od(11,B,5,14,"div",9),i.od(12,_,5,14,"div",9),i.qc(),i.oc(),i.qc(),i.qc(),i.rc(13,"div",10),i.od(14,V,6,5,"div",0),i.od(15,H,2,5,"b2b-statistic",11),i.qc(),i.od(16,K,5,5,"div",12),i.od(17,X,2,5,"div",12),i.od(18,de,4,3,"ng-container",0),i.od(19,he,7,5,"div",13),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.Mc("nzSpan",e.isMobile?24:11),i.Ub(1),i.Mc("ngClass",i.Fc(3,16,e.isMobile$)?"text-base":"text-sm"),i.Ub(2),i.Mc("ngIf",!e.isDpms),i.Ub(1),i.Mc("ngIf",e.isDpms),i.Ub(2),i.Mc("ngClass",i.Fc(8,18,e.isMobile$)?"d-flex position-absolute":"ml-2"),i.Ub(2),i.Mc("ngIf","Y"===e.product.epfApproved),i.Ub(1),i.Mc("ngIf","Y"===e.product.recommendedFund),i.Ub(1),i.Mc("ngIf","Y"===e.product.syariahEpf),i.Ub(1),i.Mc("ngIf","restricted"===e.product.fundType),i.Ub(1),i.Mc("nzSpan",e.isMobile?12:5),i.Ub(1),i.Mc("ngIf",!e.isDpmsSubsequentPage),i.Ub(1),i.Mc("ngIf",e.isDpmsSubsequentPage),i.Ub(1),i.Mc("ngIf",e.header2),i.Ub(1),i.Mc("ngIf",e.showHeader3),i.Ub(1),i.Mc("ngIf",!e.isMobile),i.Ub(1),i.Mc("ngIf",e.tokenList.length>1)}}function me(e,t){if(1&e&&(i.rc(0,"span"),i.qd(1),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.rd(e.product.fundInfoName)}}function fe(e,t){if(1&e&&(i.rc(0,"span"),i.qd(1),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.rd(e.product.dpmsPortfolioName)}}function ge(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",54),i.qc()),2&e){const e=i.Dc(4);i.Ub(1),i.Mc("src",e.transactionImgPath+"epf-approved-fund.svg",i.gd)}}function be(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",55),i.qc()),2&e){const e=i.Dc(4);i.Ub(1),i.Mc("src",e.transactionImgPath+"recommended-fund.svg",i.gd)}}function Se(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",55),i.qc()),2&e){const e=i.Dc(4);i.Ub(1),i.Mc("src",e.transactionImgPath+"islamic-fund.svg",i.gd)}}function ye(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",55),i.qc()),2&e){const e=i.Dc(4);i.Ub(1),i.Mc("src",e.transactionImgPath+"wholesale-fund.svg",i.gd)}}function ve(e,t){if(1&e&&(i.pc(0),i.rc(1,"span",51),i.od(2,ge,2,1,"div",52),i.od(3,be,2,1,"div",52),i.od(4,Se,2,1,"div",52),i.od(5,ye,2,1,"div",52),i.qc(),i.oc()),2&e){const e=i.Dc(3);i.Ub(2),i.Mc("ngIf","Y"===e.product.epfApproved),i.Ub(1),i.Mc("ngIf","Y"===e.product.recommendedFund),i.Ub(1),i.Mc("ngIf","Y"===e.product.syariahEpf),i.Ub(1),i.Mc("ngIf","restricted"===e.product.fundType)}}function Me(e,t){if(1&e&&(i.mc(0,"b2b-statistic",21),i.Ec(1,"currencyFormat")),2&e){const e=i.Dc(3);i.Mc("title",e.header1)("value",i.Gc(1,2,e.product.redemptionAmount,e.product.redemptionCurrency))}}function Ce(e,t){if(1&e&&(i.mc(0,"b2b-statistic",21),i.Ec(1,"number")),2&e){const e=i.Dc(3);i.Mc("title",e.header1)("value",i.Gc(1,2,e.product.redemptionUnit,"1.2-2")||"0")}}function qe(e,t){if(1&e&&i.mc(0,"b2b-statistic",21),2&e){const e=i.Dc(3);i.Mc("title",e.header1)("value",e.product.redemptionPercentage+"%")}}function Te(e,t){if(1&e&&(i.mc(0,"b2b-statistic",26),i.Ec(1,"currencyFormat")),2&e){const e=i.Dc(4);i.Mc("title",e.header2)("tooltip",e.tooltip2)("value",i.Gc(1,3,e.product.redemptionAmount,e.product.redemptionCurrency))}}function we(e,t){if(1&e&&i.mc(0,"b2b-statistic",26),2&e){const e=i.Dc(4);i.Mc("title",e.header2)("tooltip",e.tooltip2)("value","-")}}function ze(e,t){if(1&e&&(i.mc(0,"b2b-statistic",26),i.Ec(1,"currencyFormat")),2&e){const e=i.Dc(4);i.Mc("title",e.header2)("tooltip",e.tooltip2)("value",i.Gc(1,3,e.product.indicativeAmount,e.product.redemptionCurrency))}}function De(e,t){if(1&e&&(i.rc(0,"div",56),i.od(1,Te,2,6,"b2b-statistic",24),i.od(2,we,1,3,"b2b-statistic",24),i.od(3,ze,2,6,"b2b-statistic",24),i.qc()),2&e){const e=i.Dc(3);i.Mc("nzSpan",e.isMobile?12:5),i.Ub(1),i.Mc("ngIf",!e.product.cashFund&&!e.isDpms),i.Ub(1),i.Mc("ngIf",e.product.cashFund&&!e.isDpms),i.Ub(1),i.Mc("ngIf",e.isDpms)}}function Pe(e,t){1&e&&i.qd(0," This fee is charged by the respective fund house and borned by investor. ")}function Ie(e,t){if(1&e&&(i.qd(0),i.mc(1,"i",59),i.od(2,Pe,1,0,"ng-template",null,60,i.pd)),2&e){const e=i.ad(3),t=i.Dc(4);i.sd(" ",t.product.redemptionFee," "),i.Ub(1),i.Mc("nzTooltipTitle",e)}}function ke(e,t){if(1&e&&(i.rc(0,"div",56),i.mc(1,"b2b-statistic",57),i.od(2,Ie,4,2,"ng-template",null,58,i.pd),i.qc()),2&e){const e=i.ad(3),t=i.Dc(3);i.Mc("nzSpan",t.isMobile?12:t.dataColSize),i.Ub(1),i.Mc("ngClass",t.showPerformanceColour?"text-info":"")("title",t.header3)("tooltip",t.tooltip3)("value",t.fromSellCheckOut&&"-"!==t.product.redemptionFee?e:t.product.redemptionFee)}}function Ae(e,t){if(1&e){const e=i.sc();i.rc(0,"i",39),i.zc("click",(function(){i.dd(e);const t=i.Dc(5);return t.add(t.product.sedolnumber)})),i.qc()}}function Ee(e,t){1&e&&i.mc(0,"i",63)}function Fe(e,t){if(1&e&&(i.rc(0,"div",28),i.od(1,Ae,1,0,"i",32),i.od(2,Ee,1,0,"i",62),i.qc()),2&e){const e=i.Dc(4);i.Mc("nzLg",2),i.Ub(1),i.Mc("ngIf",!e.product.addedToCart),i.Ub(1),i.Mc("ngIf",e.product.addedToCart)}}function Oe(e,t){if(1&e){const e=i.sc();i.rc(0,"i",65),i.zc("click",(function(){i.dd(e);const t=i.Dc(5);return t.isDpmsSubsequentPage?t.editDpms(t.product.dpmsPortfolioId):t.edit(t.product.sedolnumber)})),i.qc()}}function Ue(e,t){if(1&e&&(i.rc(0,"div",28),i.od(1,Oe,1,0,"i",64),i.qc()),2&e){const e=i.Dc(4),t=i.ad(3);i.Mc("nzLg",2),i.Ub(1),i.Mc("ngIf",!e.isLoading)("ngIfElse",t)}}function xe(e,t){if(1&e){const e=i.sc();i.rc(0,"div",28),i.rc(1,"button",66),i.zc("click",(function(){i.dd(e);const t=i.Dc(4);return t.buyBond(t.product.sedolnumber)})),i.qd(2,"Buy Bond "),i.qc(),i.qc()}2&e&&i.Mc("nzLg",4)}function Le(e,t){if(1&e&&(i.pc(0),i.od(1,Fe,3,3,"div",61),i.od(2,Ue,2,3,"div",61),i.od(3,xe,3,1,"div",61),i.oc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("ngIf",e.showAddToCartBtn),i.Ub(1),i.Mc("ngIf",e.showEditBtn&&e.product.paymentMethod),i.Ub(1),i.Mc("ngIf",e.showBuyBondBtn)}}function Re(e,t){if(1&e&&(i.rc(0,"div",3),i.rc(1,"div",4),i.rc(2,"p",48),i.od(3,me,2,1,"span",0),i.od(4,fe,2,1,"span",0),i.od(5,ve,6,4,"ng-container",0),i.q
1c(),i.qc(),i.rc(6,"div",49),i.od(7,Me,2,5,"b2b-statistic",11),i.od(8,Ce,2,5,"b2b-statistic",11),i.od(9,qe,1,2,"b2b-statistic",11),i.qc(),i.od(10,De,4,4,"div",50),i.od(11,ke,4,5,"div",50),i.od(12,Le,4,3,"ng-container",0),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.Mc("nzSpan",e.isMobile?24:7),i.Ub(2),i.Mc("ngIf",!e.isDpms),i.Ub(1),i.Mc("ngIf",e.isDpms),i.Ub(1),i.Mc("ngIf",e.isMobile),i.Ub(1),i.Mc("nzSpan",e.isMobile?12:5)("nzOffset",e.isDpms?5:0),i.Ub(1),i.Mc("ngIf",e.product.isRedeemByAmount&&!e.isDpms),i.Ub(1),i.Mc("ngIf",!e.product.isRedeemByAmount&&!e.isDpms),i.Ub(1),i.Mc("ngIf",e.isDpms),i.Ub(1),i.Mc("ngIf",e.header2),i.Ub(1),i.Mc("ngIf",e.showHeader3),i.Ub(1),i.Mc("ngIf",!e.isMobile)}}function Ne(e,t){if(1&e&&(i.rc(0,"nz-row"),i.od(1,pe,20,20,"div",2),i.od(2,Re,13,12,"div",2),i.qc()),2&e){const e=i.Dc();i.Ub(1),i.Mc("ngIf",!(e.fromSellCheckOut||e.fromSellOrderPlaced||e.fromSwitchCheckOut||e.fromSwitchOrderPlaced)),i.Ub(1),i.Mc("ngIf",e.fromSellCheckOut||e.fromSellOrderPlaced)}}function Be(e,t){if(1&e&&(i.rc(0,"span",87),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.sd("Contract No: ",e.product.sellContractNo,"")}}function _e(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",54),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"epf-approved-fund.svg",i.gd)}}function Ve(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",55),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"recommended-fund.svg",i.gd)}}function He(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",88),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"islamic-fund.svg",i.gd)}}function $e(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",89),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"wholesale-fund.svg",i.gd)}}function je(e,t){if(1&e&&(i.pc(0),i.rc(1,"span",51),i.od(2,_e,2,1,"div",52),i.od(3,Ve,2,1,"div",52),i.od(4,He,2,1,"div",52),i.od(5,$e,2,1,"div",52),i.qc(),i.oc()),2&e){const e=i.Dc(2);i.Ub(2),i.Mc("ngIf","Y"===e.product.epfApproved),i.Ub(1),i.Mc("ngIf","Y"===e.product.recommendedFund),i.Ub(1),i.Mc("ngIf","Y"===e.product.syariahEpf),i.Ub(1),i.Mc("ngIf","restricted"===e.product.fundType)}}function Ge(e,t){if(1&e&&(i.rc(0,"span",87),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.sd("Contract No: ",e.product.buyContractNo,"")}}function We(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",54),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"epf-approved-fund.svg",i.gd)}}function Ye(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",55),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"recommended-fund.svg",i.gd)}}function Ke(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",88),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"islamic-fund.svg",i.gd)}}function Xe(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",89),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"wholesale-fund.svg",i.gd)}}function Qe(e,t){if(1&e&&(i.pc(0),i.rc(1,"span",51),i.od(2,We,2,1,"div",52),i.od(3,Ye,2,1,"div",52),i.od(4,Ke,2,1,"div",52),i.od(5,Xe,2,1,"div",52),i.qc(),i.oc()),2&e){const e=i.Dc(2);i.Ub(2),i.Mc("ngIf","Y"===e.product.epfApproved),i.Ub(1),i.Mc("ngIf","Y"===e.product.recommendedFund),i.Ub(1),i.Mc("ngIf","Y"===e.product.syariahEpf),i.Ub(1),i.Mc("ngIf","restricted"===e.product.fundType)}}function Ze(e,t){if(1&e){const e=i.sc();i.rc(0,"i",65),i.zc("click",(function(){i.dd(e);const t=i.Dc(4);return t.edit(t.product.sedolnumber)})),i.qc()}}function Je(e,t){if(1&e&&(i.rc(0,"nz-col",91),i.od(1,Ze,1,0,"i",64),i.qc()),2&e){const e=i.Dc(3),t=i.ad(3);i.Mc("nzLg",2)("nzOffset",3),i.Ub(1),i.Mc("ngIf",!e.isLoading)("ngIfElse",t)}}function et(e,t){if(1&e&&(i.pc(0),i.od(1,Je,2,4,"nz-col",90),i.oc()),2&e){const e=i.Dc(2);i.Ub(1),i.Mc("ngIf",e.showEditBtn&&e.product.paymentMethod)}}function tt(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"currencyFormat"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",e.dataColSize),i.Ub(1),i.sd(" ",e.header6," "),i.Ub(3),i.rd(i.Gc(5,3,e.product.redemptionAmount,e.product.redemptionCurrency))}}function nt(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"number"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",e.dataColSize),i.Ub(1),i.sd(" ",e.header1," "),i.Ub(3),i.rd(i.Gc(5,3,e.product.redemptionUnit,"1.2-2"))}}function it(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1," Redemption Percentages "),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"number"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",e.dataColSize),i.Ub(4),i.sd("",i.Gc(5,2,e.product.redemptionUnit,"1.2-2"),"%")}}function ct(e,t){if(1&e&&i.mc(0,"i",93),2&e){const e=i.Dc(2);i.Mc("nzTooltipTitle",e.tooltip2)}}function ot(e,t){if(1&e&&(i.rc(0,"p",92),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.rd(e.product.redemptionFee)}}function st(e,t){1&e&&(i.rc(0,"p",92),i.qd(1,"0.00%"),i.qc())}function at(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"currencyFormat"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",6),i.Ub(1),i.sd(" ",e.header5," "),i.Ub(3),i.rd(i.Gc(5,3,e.product.indicativeAmount,e.product.redemptionCurrency))}}function lt(e,t){if(1&e&&i.mc(0,"i",93),2&e){const e=i.Dc(3);i.Mc("nzTooltipTitle",e.tooltip3)}}function rt(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.rc(1,"div",76),i.rc(2,"span"),i.qd(3),i.qc(),i.od(4,lt,1,1,"i",73),i.qc(),i.mc(5,"br"),i.rc(6,"p",92),i.qd(7),i.Ec(8,"currencyFormat"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",6),i.Ub(3),i.rd(e.header3),i.Ub(1),i.Mc("ngIf",null!=e.tooltip3),i.Ub(3),i.rd(i.Gc(8,4,e.product.indicativeAmount,e.product.redemptionCurrency))}}function dt(e,t){if(1&e&&(i.rc(0,"span"),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.rd(e.header4)}}function ut(e,t){if(1&e&&i.mc(0,"i",93),2&e){const e=i.Dc(2);i.Mc("nzTooltipTitle",e.tooltip4)}}function ht(e,t){1&e&&(i.rc(0,"span"),i.qd(1,"Switching Fee"),i.qc())}function pt(e,t){if(1&e&&(i.rc(0,"p",92),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.rd(e.product.additionalInfo)}}const mt=function(e){return{"mb-0":e}};function ft(e,t){if(1&e&&(i.rc(0,"p",94),i.qd(1,"0.00%"),i.qc()),2&e){const e=i.Dc(2);i.Mc("ngClass",i.Sc(1,mt,e.product.isWaived))}}function gt(e,t){1&e&&(i.rc(0,"span"),i.qd(1,"(Waived By Credit)"),i.qc())}function bt(e,t){if(1&e&&(i.rc(0,"div",95),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.sd("Contract No: ",e.product.sellContractNo,"")}}function St(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",54),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"epf-approved-fund.svg",i.gd)}}function yt(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",55),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"recommended-fund.svg",i.gd)}}function vt(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",88),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"islamic-fund.svg",i.gd)}}function Mt(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",89),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"wholesale-fund.svg",i.gd)}}function Ct(e,t){if(1&e&&(i.pc(0),i.rc(1,"span",51),i.od(2,St,2,1,"div",52),i.od(3,yt,2,1,"div",52),i.od(4,vt,2,1,"div",52),i.od(5,Mt,2,1,"div",52),i.qc(),i.oc()),2&e){const e=i.Dc(2);i.Ub(2),i.Mc("ngIf","Y"===e.product.epfApproved),i.Ub(1),i.Mc("ngIf","Y"===e.product.recommendedFund),i.Ub(1),i.Mc("ngIf","Y"===e.product.syariahEpf),i.Ub(1),i.Mc("ngIf","restricted"===e.product.fundType)}}function qt(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"currencyFormat"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",12),i.Ub(1),i.sd(" ",e.header6," "),i.Ub(3),i.rd(i.Gc(5,3,e.product.redemptionAmount,e.product.redemptionCurrency))}}function Tt(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"number"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",12),i.Ub(1),i.sd(" ",e.header1," "),i.Ub(3),i.rd(i.Gc(5,3,e.product.redemptionUnit,"1.2-2"))}}function wt(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1," Redemption Percentages "),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"number"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",12),i.Ub(4),i.sd("",i.Gc(5,2,e.product.redemptionUnit,"1.2-2"),"%")}}function zt(e,t){if(1&e&&i.mc(0,"i",93),2&e){const e=i.Dc(2);i.Mc("nzTooltipTitle",e.tooltip2)}}function Dt(e,t){if(1&e&&(i.rc(0,"p",92),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.rd(e.product.redemptionFee)}}function Pt(e,t){1&e&&(i.rc(0,"p",92),i.qd(1,"0.00%"),i.qc())}function It(e,t){if(1&e&&(i.rc(0,"div",95),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.sd("Contract No: ",e.product.buyContractNo,"")}}function kt(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",54),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"epf-approved-fund.svg",i.gd)}}function At(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",55),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"recommended-fund.svg",i.gd)}}function Et(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",88),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"islamic-fund.svg",i.gd)}}function Ft(e,t){if(1&e&&(i.rc(0,"div",53),i.mc(1,"img",89),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("src",e.transactionImgPath+"wholesale-fund.svg",i.gd)}}function Ot(e,t){if(1&e&&(i.pc(0),i.rc(1,"span",51),i.od(2,kt,2,1,"div",52),i.od(3,At,2,1,"div",52),i.od(4,Et,2,1,"div",52),i.od(5,Ft,2,1,"div",52),i.qc(),i.oc()),2&e){const e=i.Dc(2);i.Ub(2),i.Mc("ngIf","Y"===e.product.epfApproved),i.Ub(1),i.Mc("ngIf","Y"===e.product.recommendedFund),i.Ub(1),i.Mc("ngIf","Y"===e.product.syariahEpf),i.Ub(1),i.Mc("ngIf","restricted"===e.product.fundType)}}function Ut(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.qd(1),i.mc(2,"br"),i.rc(3,"p",92),i.qd(4),i.Ec(5,"currencyFormat"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",12),i.Ub(1),i.sd(" ",e.header5," "),i.Ub(3),i.rd(i.Gc(5,3,e.product.indicativeAmount,e.product.redemptionCurrency))}}function xt(e,t){if(1&e&&i.mc(0,"i",93),2&e){const e=i.Dc(3);i.Mc("nzTooltipTitle",e.tooltip3)}}function Lt(e,t){if(1&e&&(i.rc(0,"nz-col",67),i.rc(1,"div",76),i.rc(2,"span"),i.qd(3),i.qc(),i.od(4,xt,1,1,"i",73),i.qc(),i.mc(5,"br"),i.rc(6,"p",92),i.qd(7),i.Ec(8,"currencyFormat"),i.qc(),i.qc()),2&e){const e=i.Dc(2);i.Mc("nzSpan",12),i.Ub(3),i.rd(e.header3),i.Ub(1),i.Mc("ngIf",null!=e.tooltip3),i.Ub(3),i.rd(i.Gc(8,4,e.product.indicativeAmount,e.product.redemptionCurrency))}}function Rt(e,t){if(1&e&&(i.rc(0,"span"),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.rd(e.header4)}}function Nt(e,t){if(1&e&&i.mc(0,"i",93),2&e){const e=i.Dc(2);i.Mc("nzTooltipTitle",e.tooltip4)}}function Bt(e,t){1&e&&(i.rc(0,"span"),i.qd(1,"Switching Fee"),i.qc())}function _t(e,t){if(1&e&&(i.rc(0,"p",92),i.qd(1),i.qc()),2&e){const e=i.Dc(2);i.Ub(1),i.rd(e.product.additionalInfo)}}function Vt(e,t){1&e&&(i.rc(0,"p",92),i.qd(1,"0.00%"),i.qc())}function Ht(e,t){1&e&&(i.rc(0,"span"),i.qd(1,"(Waived By Credit)"),i.qc())}function $t(e,t){if(1&e&&(i.rc(0,"div"),i.rc(1,"app-web-scaffold"),i.rc(2,"nz-row"),i.rc(3,"nz-col",67),i.rc(4,"div",68),i.od(5,Be,2,1,"span",69),i.mc(6,"br"),i.qd(7),i.od(8,je,6,4,"ng-container",0),i.q
1c(),i.qc(),i.rc(9,"nz-col",70),i.rc(10,"p",68),i.od(11,Ge,2,1,"span",69),i.mc(12,"br"),i.qd(13),i.od(14,Qe,6,4,"ng-container",0),i.qc(),i.qc(),i.od(15,et,2,1,"ng-container",0),i.qc(),i.rc(16,"nz-row"),i.od(17,tt,6,6,"nz-col",71),i.od(18,nt,6,6,"nz-col",71),i.od(19,it,6,5,"nz-col",71),i.rc(20,"nz-col",72),i.qd(21),i.mc(22,"br"),i.od(23,ct,1,1,"i",73),i.od(24,ot,2,1,"p",74),i.od(25,st,2,0,"p",74),i.qc(),i.rc(26,"nz-col",67),i.mc(27,"img",75),i.qc(),i.od(28,at,6,6,"nz-col",71),i.od(29,rt,9,7,"nz-col",71),i.rc(30,"nz-col",70),i.rc(31,"div",76),i.od(32,dt,2,1,"span",77),i.od(33,ut,1,1,"i",73),i.qc(),i.od(34,ht,2,0,"ng-template",null,78,i.pd),i.od(36,pt,2,1,"p",74),i.od(37,ft,2,3,"p",79),i.od(38,gt,2,0,"span",0),i.qc(),i.qc(),i.qc(),i.rc(39,"app-mobile-scaffold"),i.rc(40,"nz-row"),i.rc(41,"nz-col",67),i.rc(42,"div",80),i.od(43,bt,2,1,"div",81),i.qd(44),i.od(45,Ct,6,4,"ng-container",0),i.qc(),i.qc(),i.qc(),i.rc(46,"nz-row",82),i.od(47,qt,6,6,"nz-col",71),i.od(48,Tt,6,6,"nz-col",71),i.od(49,wt,6,5,"nz-col",71),i.rc(50,"nz-col",83),i.qd(51),i.mc(52,"br"),i.od(53,zt,1,1,"i",73),i.od(54,Dt,2,1,"p",74),i.od(55,Pt,2,0,"p",74),i.qc(),i.qc(),i.rc(56,"nz-row",84),i.rc(57,"nz-col"),i.mc(58,"img",85),i.qc(),i.qc(),i.rc(59,"nz-row"),i.rc(60,"nz-col",67),i.rc(61,"div",86),i.od(62,It,2,1,"div",81),i.qd(63),i.od(64,Ot,6,4,"ng-container",0),i.qc(),i.qc(),i.qc(),i.rc(65,"nz-row"),i.od(66,Ut,6,6,"nz-col",71),i.od(67,Lt,9,7,"nz-col",71),i.rc(68,"nz-col",83),i.rc(69,"div",76),i.od(70,Rt,2,1,"span",77),i.od(71,Nt,1,1,"i",73),i.qc(),i.od(72,Bt,2,0,"ng-template",null,78,i.pd),i.mc(74,"br"),i.od(75,_t,2,1,"p",74),i.od(76,Vt,2,0,"p",74),i.od(77,Ht,2,0,"span",0),i.qc(),i.qc(),i.qc(),i.qc()),2&e){const e=i.ad(35),t=i.Dc();i.Ub(3),i.Mc("nzSpan",7),i.Ub(2),i.Mc("ngIf",t.showContractNo),i.Ub(2),i.sd(" ",t.product.switchSellFundName," "),i.Ub(1),i.Mc("ngIf",t.isMobile),i.Ub(1),i.Mc("nzSpan",7)("nzOffset",5),i.Ub(2),i.Mc("ngIf",t.showContractNo),i.Ub(2),i.sd(" ",t.product.switchBuyFundName," "),i.Ub(1),i.Mc("ngIf",t.isMobile),i.Ub(1),i.Mc("ngIf",!t.isMobile),i.Ub(2),i.Mc("ngIf",t.product.isRedeemByAmount),i.Ub(1),i.Mc("ngIf",!t.product.isRedeemByAmount&&!t.product.isPercent),i.Ub(1),i.Mc("ngIf",t.product.isPercent),i.Ub(1),i.Mc("nzSpan",5)("nzOffset",1),i.Ub(1),i.sd(" ",t.header2," "),i.Ub(2),i.Mc("ngIf",null!=t.tooltip2),i.Ub(1),i.Mc("ngIf",t.product.redemptionFee&&"-"!==t.product.redemptionFee&&"null%"!==t.product.redemptionFee),i.Ub(1),i.Mc("ngIf",!t.product.redemptionFee||"-"===t.product.redemptionFee||"null%"===t.product.redemptionFee),i.Ub(1),i.Mc("nzSpan",2),i.Ub(1),i.Mc("src",t.transactionImgPath+"up-circle.svg",i.gd),i.Ub(1),i.Mc("ngIf",t.product.cashFund),i.Ub(1),i.Mc("ngIf",!t.product.cashFund),i.Ub(1),i.Mc("nzSpan",t.dataColSize)("nzOffset",1),i.Ub(2),i.Mc("ngIf",!t.product.additionalInfo.includes("MYR"))("ngIfElse",e),i.Ub(1),i.Mc("ngIf",null!=t.tooltip4),i.Ub(3),i.Mc("ngIf",t.product.additionalInfo&&"-"!==t.product.additionalInfo&&"null%"!==t.product.additionalInfo&&!t.product.isWaived),i.Ub(1),i.Mc("ngIf",!t.product.additionalInfo||"-"===t.product.additionalInfo||"null%"===t.product.additionalInfo||t.product.isWaived),i.Ub(1),i.Mc("ngIf",t.product.isWaived),i.Ub(3),i.Mc("nzSpan",16),i.Ub(2),i.Mc("ngIf",t.showContractNo),i.Ub(1),i.sd(" ",t.product.switchSellFundName," "),i.Ub(1),i.Mc("ngIf",t.isMobile),i.Ub(2),i.Mc("ngIf",t.product.isRedeemByAmount),i.Ub(1),i.Mc("ngIf",!t.product.isRedeemByAmount&&!t.product.isPercent),i.Ub(1),i.Mc("ngIf",t.product.isPercent),i.Ub(1),i.Mc("nzSpan",12),i.Ub(1),i.sd(" ",t.header2," "),i.Ub(2),i.Mc("ngIf",null!=t.tooltip2),i.Ub(1),i.Mc("ngIf",t.product.redemptionFee&&"-"!==t.product.redemptionFee&&"null%"!==t.product.redemptionFee),i.Ub(1),i.Mc("ngIf",!t.product.redemptionFee||"-"===t.product.redemptionFee||"null%"===t.product.redemptionFee),i.Ub(3),i.Mc("src",t.transactionImgPath+"down-circle.svg",i.gd),i.Ub(2),i.Mc("nzSpan",16),i.Ub(2),i.Mc("ngIf",t.showContractNo),i.Ub(1),i.sd(" ",t.product.switchBuyFundName," "),i.Ub(1),i.Mc("ngIf",t.isMobile),i.Ub(2),i.Mc("ngIf",t.product.cashFund),i.Ub(1),i.Mc("ngIf",!t.product.cashFund),i.Ub(1),i.Mc("nzSpan",12),i.Ub(2),i.Mc("ngIf",!t.product.additionalInfo.includes("MYR"))("ngIfElse",e),i.Ub(1),i.Mc("ngIf",null!=t.tooltip4),i.Ub(4),i.Mc("ngIf",t.product.additionalInfo&&"-"!==t.product.additionalInfo&&"null%"!==t.product.additionalInfo),i.Ub(1),i.Mc("ngIf",!t.product.additionalInfo||"
1-"===t.product.additionalInfo||"null%"===t.product.additionalInfo),i.Ub(1),i.Mc("ngIf",t.product.isWaived)}}function jt(e,t){1&e&&i.mc(0,"i",98)}function Gt(e,t){if(1&e&&(i.od(0,jt,1,0,"ng-template",null,96,i.pd),i.mc(2,"nz-spin",97)),2&e){const e=i.ad(1);i.Ub(2),i.Mc("nzIndicator",e)}}let Wt=(()=>{class e{constructor(e,t,n,c,o){this.zone=e,this.cd=t,this.store=n,this.authState=c,this.subHandlingService=o,this.showAddToCartBtn=!1,this.showEditBtn=!1,this.showBuyBondBtn=!1,this.showProfitLoss=!1,this.showHeader3=!1,this.tooltip2=null,this.tooltip3=null,this.tooltip4=null,this.isDpmsSubsequentPage=!1,this.dataColSize=4,this.isOrderPlacedPage=!1,this.selectedSedolnumberAdd=new i.s,this.selectedSedolnumberEdit=new i.s,this.buyBondAction=new i.s,this.addDpmsAction=new i.s,this.editDpmsAction=new i.s,this.selectedToken=new i.s,this.isMobile=!1,this.tokenList=[],this.tempTokenList=[],this.salesCharge="",this.transactionImgPath=h.g.TRANSACTION_IMG_PATH,this.store.select(e=>e.global.mobile).subscribe(e=>{this.isMobile=e})}set product(e){this._product=e}get product(){return this._product}set campaignCodeApplied(e){this._campaignCodeApplied=e,this.subHandlingService.once(this.performanceColorObserver())}get campaignCodeApplied(){return this._campaignCodeApplied}ngOnInit(){this.refno$.subscribe(e=>this.refno=e),this.isDpms||!this.fromSellCheckOut&&!this.fromSellOrderPlaced||(this.header1=this.product.isRedeemByAmount?"Redemption Amounts":"Redemption Units"),this.checkTokens(),this.getItemSalesCharge(),"None"!==this._product.selectedToken&&this.isOrderPlacedPage&&(this._product.additionalInfo=this._product.selectedToken)}ngAfterViewInit(){this.performanceColorObserver().subscribe()}ngOnChanges(){this.tokenList=Object(S.a)(this.tempTokenList)}performanceColorObserver(){return this.primaryAccount$.pipe(Object(f.a)(e=>{var t,n,i;this.showPerformanceColour=!!(e.tierStatus!=b.a.FSM&&e.tierStatus!=b.a.FSM_PLUS||(null===(t=this.product)||void 0===t?void 0:t.referralTokenOnePercent)||(null===(n=this.product)||void 0===n?void 0:n.referralTokenZeroPointEight)||(null===(i=this.product)||void 0===i?void 0:i.referralTokenZeroPointFive)||this.campaignCodeApplied)}))}add(e){this.selectedSedolnumberAdd.emit(this.product.addedToCart?null:e)}edit(e){this.selectedSedolnumberEdit.emit(e)}buyBond(e){this.buyBondAction.emit(e)}addDpms(e){this.addDpmsAction.emit(e)}editDpms(e){this.editDpmsAction.emit(e)}checkTokens(){var e,t,n;this.tokenList=[{label:"None",value:"None",active:!0},{label:"1%",value:"1",active:null===(e=this.product)||void 0===e?void 0:e.referralTokenOnePercent},{label:"0.8%",value:"0.8",active:null===(t=this.product)||void 0===t?void 0:t.referralTokenZeroPointEight},{label:"0.5%",value:"0.5",active:null===(n=this.product)||void 0===n?void 0:n.referralTokenZeroPointFive}],this.tokenList=this.tokenList.filter(e=>e.active),this.token=this.product.selectedToken}onTabChange(e){this.token=e,this.selectedToken.emit(this.token)}getItemSalesCharge(){this.cartList$=this.store.select(o.l.getCartList).pipe(Object(g.a)(e=>e(this.refno))),this.cartList$.subscribe(e=>e.forEach(e=>{var t,n,i,o;e.sedolNumber!=(null===(t=this.product)||void 0===t?void 0:t.sedolnumber)||(null===(n=this.product)||void 0===n?void 0:n.referralTokenOnePercent)||(null===(i=this.product)||void 0===i?void 0:i.referralTokenZeroPointEight)||(null===(o=this.product)||void 0===o?void 0:o.referralTokenZeroPointFive)||(this._product=Object(S.a)(this._product),this._product.additionalInfo=(null==e?void 0:e.promoSalesCharge)||0==(null==e?void 0:e.promoSalesCharge)?Object(c.L)(+e.promoSalesCharge,h.a.LOCALE_EN,"1.2-2")+" %":e.defaultSalesCharge+" %")}))}redirectToFactsheetPage(){var e;if(!this.isDpms){let t=this._product.sedolnumber;Object(y.a)(["/"+h.o.FUNDS,h.o.TOOLS,h.o.FACTSHEET,Object(v.e)(null===(e=this._product)||void 0===e?void 0:e.fundInfoName)],{fund:t})}}}return e.\u0275fac=function(t){return new(t||e)(i.lc(i.J),i.lc(i.j),i.lc(l.i),i.lc(m.a),i.lc(M.a))},e.\u0275cmp=i.fc({type:e,selectors:[["app-trade-product-info-details"]],inputs:{product:"product",showAddToCartBtn:"showAddToCartBtn",showEditBtn:"showEditBtn",showBuyBondBtn:"showBuyBondBtn",showProfitLoss:"showProfitLoss",showHeader3:"showHeader3",header1:"header1",header2:"header2",header3:"header3",header4:"header4",header5:"header5",header6:"header6",tooltip2:"tooltip2",tooltip3:"tooltip3",tooltip4:"tooltip4",fromSellCheckOut:"fromSellCheckOut",fromSellOrderPlaced:"fromSellOrderPlaced",fromSwitchCheckOut:"fromSwitchCheckOut",fromSwitchOrderPlaced:"fromSwitchOrderPlaced",showContractNo:"showContractNo",isLoading:"isLoading",isDpms:"isDpms",isDpmsSubsequentPage:"isDpmsSubsequentPage",dataColSize:"dataColSize",isOrderPlacedPage:"isOrderPlacedPage",campaignCodeApplied:"campaignCodeApplied"},outputs:{selectedSedolnumberAdd:"selectedSedolnumberAdd",selectedSedolnumberEdit:"selectedSedolnumberEdit",buyBondAction:"buyBondAction",addDpmsAction:"addDpmsAction",editDpmsAction:"editDpmsAction",selectedToken:"selectedToken"},features:[i.Sb],decls:4,vars:2,consts:[[4,"ngIf"],["loadingTemplate",""],["class","pt-3",4,"ngIf"],[1,"pt-3"],["nz-col","",3,"nzSpan"],[1,"text-black-7","d-inline-block","font-weight-bold","w-80","text-capitalize",3,"ngClass"],["class","product-factsheet-link",3,"click",4,"ngIf"],[1,"fund-logo-container",3,"ngClass"],["class","fund-logo d-inline-block ",3,"ngClass",4,"ngIf"],["class","fund-logo d-inline-block",3,"ngClass",4,"ngIf"],["nz-col","",1,"pr-4",3,"nzSpan"],[3,"title","value",4,"ngIf"],["nz-col","","class","pl-2",3,"nzSpan",4,"ngIf"],["class","pt-2 pb-3 ","nz-col","",3,"nzSpan",4,"ngIf"],[1,"product-factsheet-link",3,"click"],[1,"fund-logo","d-inline-block",3,"ngClass"],["alt","epf approved fund icon","nzTooltipTitle","EPF Approved","nzTooltipPlacement","top","nz-tooltip","",1,"img-fluid",3,"ngClass","src"],["alt","recommended fund icon","nzTooltipTitle","Recommended Fund","nzTooltipPlacement","top","nz-tooltip","",1,"img-fluid",2,"width","24px",3,"ngClass","src"],["alt","islamic fund icon","nzTooltipTitle","Shariah Fund","nzTooltipPlacement","top","nz-tooltip","",1,"img-fluid",3,"ngClass","src"],["alt","wholesale fund icon","nzTooltipTitle","Wholesale Fund","nzTooltipPlacement","top","nz-tooltip","",1,"img-fluid",3,"ngClass","src"],[1,"font-weight-bold"],[3,"title","value"],["nz-col","",1,"pl-2",3,"nzSpan"],[3,"title","tooltip","value","ngClass",4,"ngIf"],[3,"title","tooltip","value",4,"ngIf"],[3,"title","tooltip","value","ngClass"],[3,"title","tooltip","value"],["nz-col","","class","text-right",3,"nzLg",4,"ngIf"],["nz-col","",1,"text-right",3,"nzLg"],["class","pointer pt-1 pr-3 text-black-4 text-lg","nz-icon","","nzTheme","fill","nzType","plus-circle",3,"nz-tooltip","click",4,"ngIf"],["nz-icon","","nzType","plus-circle","nzTheme","fill","class","pointer pt-1 pr-3 text-info text-lg",4,"ngIf"],["class","pt-1 pr-3 text-gray text-lg","nz-icon","","nzTheme","fill","nzType","plus-circle",3,"nz-tooltip",4,"ngIf"],["class","pointer pt-1 pr-3 text-black-4 text-lg","nz-icon","","nzTheme","fill","nzType","plus-circle",3,"click",4,"ngIf"],["nz-tooltip","No Available Holdings to Sell / Switch","class","pointer pt-1 pr-3 text-black-4 text-lg","nz-icon","","nzTheme","fill","nzType","plus-circle",4,"ngIf"],["noPrsTemplate",""],["addToCartTemplate",""],["nz-icon","","nzTheme","fill","nzType","plus-circle",1,"pointer","pt-1","pr-3","text-black-4","text-lg",3,"nz-tooltip","click"],["nz-icon","","nzType","plus-circle","nzTheme","fill",1,"pointer","pt-1","pr-3","text-info","text-lg"],["nz-icon","","nzTheme","fill","nzType","plus-circle",1,"pt-1","pr-3","text-gray","text-lg",3,"nz-tooltip"],["nz-icon","","nzTheme","fill","nzType","plus-circle",1,"pointer","pt-1","pr-3","text-black-4","text-lg",3,"click"],["nz-tooltip","No Available Holdings to Sell / Switch","nz-icon","","nzTheme","fill","nzType","plus-circle",1,"pointer","pt-1","pr-3","text-black-4","text-lg"],["nz-icon","","nzType","edit","nzTheme","outline","class","pointer pt-3 pr-3 text-dark",3,"click",4,"ngIf"],["nz-icon","","nzType","edit","nzTheme","outline",1,"pointer","pt-3","pr-3","text-dark",3,"click"],["nz-button","","nzType","outline","nzSize","small",1,"mt-3","mr-3",3,"click"],["nz-col","",1,"pt-2","pb-3",3,"nzSpan"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["class","px-4","nz-radio-button","",3,"nz
1Value",4,"ngFor","ngForOf"],["nz-radio-button","",1,"px-4",3,"nzValue"],[1,"text-sm","text-black-7","d-inline-block","font-weight-bold","w-80","text-capitalize"],["nz-col","","nzOffset","1",3,"nzSpan","nzOffset"],["class","pl-3","nz-col","",3,"nzSpan",4,"ngIf"],[1,"fund-logo-container","d-flex","position-absolute"],["class","fund-logo d-inline-block mx-1",4,"ngIf"],[1,"fund-logo","d-inline-block","mx-1"],["alt","epf approved fund icon",1,"h-100",3,"src"],["alt","recommended fund icon",1,"h-100",3,"src"],["nz-col","",1,"pl-3",3,"nzSpan"],[3,"ngClass","title","tooltip","value"],["redemptionFeeValueTemplate",""],["nz-icon","","nz-tooltip","","nzType","info-circle","nzTheme","outline",1,"text-warning",3,"nzTooltipTitle"],["redemptionFeeTooltip",""],["class","text-right","nz-col","",3,"nzLg",4,"ngIf"],["class","pointer pt-1 pr-3 text-info text-lg","nz-icon","","nzTheme","fill","nzType","plus-circle",4,"ngIf"],["nz-icon","","nzTheme","fill","nzType","plus-circle",1,"pointer","pt-1","pr-3","text-info","text-lg"],["class","pointer pt-3 pr-3 text-dark","nz-icon","","nzTheme","outline","nzType","edit",3,"click",4,"ngIf","ngIfElse"],["nz-icon","","nzTheme","outline","nzType","edit",1,"pointer","pt-3","pr-3","text-dark",3,"click"],["nz-button","","nzSize","small","nzType","outline",1,"mt-3","mr-3",3,"click"],[3,"nzSpan"],[1,"text-sm","text-black-7","d-inline-block","font-weight-bold","text-capitalize"],["class","text-theme",4,"ngIf"],[3,"nzSpan","nzOffset"],[3,"nzSpan",4,"ngIf"],[1,"pl-3",3,"nzSpan","nzOffset"],["class","d-flex align-item-center pointer","nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",3,"nzOverlayClassName","nzTooltipTitle",4,"ngIf"],["class","font-weight-bold text-base",4,"ngIf"],["alt","up circle icon",1,"h-100",3,"src"],[1,"d-flex","align-item-center","gap-2px"],[4,"ngIf","ngIfElse"],["switchingFeeTemplate",""],["class","font-weight-bold text-base",3,"ngClass",4,"ngIf"],[1,"text-base","text-black-7","d-inline-block","font-weight-bold","text-capitalize"],["class","text-theme mb-1",4,"ngIf"],[1,"mt-2"],[1,"pl-3",3,"nzSpan"],["nzType","flex","nzJustify","center"],["alt","up circle icon",1,"h-100","pr-3","mb-3",3,"src"],[1,"text-base","text-black-7","d-inline-block","font-weight-bold","text-capitalize","mb-2"],[1,"text-theme"],["alt","islamic fund icon",1,"h-100",3,"src"],["alt","wholesale fund icon",1,"h-100",3,"src"],["class","text-right","class","text-center",3,"nzLg","nzOffset",4,"ngIf"],[1,"text-center",3,"nzLg","nzOffset"],[1,"font-weight-bold","text-base"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",1,"d-flex","align-item-center","pointer",3,"nzOverlayClassName","nzTooltipTitle"],[1,"font-weight-bold","text-base",3,"ngClass"],[1,"text-theme","mb-1"],["indicatorTemplate",""],["nzSimple","",3,"nzIndicator"],["nz-icon","","nzType","loading",1,"pt-3","pr-3","text-dark","pointer"]],template:function(e,t){1&e&&(i.od(0,Ne,3,2,"nz-row",0),i.od(1,$t,78,57,"div",0),i.od(2,Gt,3,1,"ng-template",null,1,i.pd)),2&e&&(i.Mc("ngIf",!t.fromSwitchCheckOut||!t.fromSwitchOrderPlaced),i.Ub(1),i.Mc("ngIf",t.fromSwitchCheckOut||t.fromSwitchOrderPlaced))},directives:[c.t,d.c,d.a,c.q,C.e,q.c,T.b,w.a,z.c,D.t,D.w,c.s,z.a,P.a,I.a,k.a],pipes:[c.b,A.a,c.g],styles:[".fund-logo-container[_ngcontent-%COMP%]{top:0;right:8px}.fund-logo-container[_ngcontent-%COMP%] .fund-logo[_ngcontent-%COMP%]{height:12px;width:12px}.fund-logo-container[_ngcontent-%COMP%] .fund-mobile-logo[_ngcontent-%COMP%]{height:30px;width:30px}.fund-logo-web[_ngcontent-%COMP%]{position:absolute}.product-factsheet-link[_ngcontent-%COMP%]{cursor:pointer}"]}),Object(u.c)([Object(l.e)(p.a.isMobile)],e.prototype,"isMobile$",void 0),Object(u.c)([Object(l.e)(m.a.getPrimaryAccount)],e.prototype,"primaryAccount$",void 0),Object(u.c)([Object(l.e)(o.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();var Yt=n("OtHt"),Kt=n("45Og");const Xt=function(e,t,n){return{"trade-product":e,"without-bg":t,pointer:n}};function Qt(e,t){if(1&e){const e=i.sc();i.rc(0,"tr"),i.rc(1,"div",8),i.zc("click",(function(){i.dd(e);
1const n=t.$implicit,c=i.Dc(2);return!n.addedToCart&&c.onClickAddProduct(n,!1)})),i.Ec(2,"async"),i.rc(3,"app-trade-product-info-details",9),i.zc("selectedSedolnumberAdd",(function(){i.dd(e);const n=t.$implicit;return i.Dc(2).add(n.sedolnumber,n.paymentMethodForCheck,!0)}))("selectedSedolnumberEdit",(function(){i.dd(e);const n=t.$implicit;return i.Dc(2).edit(n.sedolnumber,n.paymentMethodForCheck)}))("buyBondAction",(function(t){return i.dd(e),i.Dc(2).buyBond(t)}))("addDpmsAction",(function(t){return i.dd(e),i.Dc(2).addDpms(t,!0)})),i.qc(),i.qc(),i.qc()}if(2&e){const e=t.$implicit,n=i.Dc(2);i.Ub(1),i.Mc("ngClass",i.Uc(19,Xt,n.showBgColour,!n.showBgColour,i.Fc(2,17,n.isMobile$))),i.Ub(2),i.Mc("campaignCodeApplied",n.campaignCodeApplied)("showAddToCartBtn",n.showAddToCartBtn)("header1",n.header1)("header2",n.header2)("header3",n.header3)("tooltip2",n.tooltip2)("tooltip3",n.tooltip3)("tooltip4",n.tooltip4)("product",e)("showEditBtn",n.showEditBtn)("showProfitLoss",n.showProfitLoss)("showBuyBondBtn",n.showBuyBondBtn)("showHeader3",n.showHeader3)("isLoading",n.isLoading)("isDpms",n.isDpms)("isOrderPlacedPage",n.isOrderPlacedPage)}}function Zt(e,t){1&e&&i.mc(0,"td",10)}function Jt(e,t){if(1&e&&(i.rc(0,"div"),i.rc(1,"nz-table",3,4),i.rc(3,"tbody"),i.od(4,Qt,4,23,"tr",5),i.qc(),i.rc(5,"tr"),i.od(6,Zt,1,0,"td",6),i.qc(),i.rc(7,"tr"),i.rc(8,"td",7),i.qd(9),i.Ec(10,"sdate"),i.qc(),i.qc(),i.qc(),i.qc()),2&e){const e=i.ad(2),t=i.Dc(),n=i.ad(3);i.Ub(1),i.Mc("nzData",t.tradeProductInfoList)("nzShowPagination",!1)("nzFrontPagination",!1),i.Ub(3),i.Mc("ngForOf",e.data),i.Ub(2),i.Mc("ngIf",!t.isLoadingProductInfo)("ngIfElse",n),i.Ub(3),i.sd(" Last Updated: ",i.Fc(10,7,t.currentDate)," ")}}function en(e,t){if(1&e&&(i.rc(0,"p",19),i.qd(1),i.qc()),2&e){const e=i.Dc(2).$implicit;i.Ub(1),i.rd(e.key)}}function tn(e,t){if(1&e&&(i.rc(0,"h3",20),i.qd(1),i.qc()),2&e){const e=i.Dc(2).$implicit;i.Ub(1),i.rd(e.key)}}function nn(e,t){if(1&e&&(i.rc(0,"div",16),i.od(1,en,2,1,"p",17),i.od(2,tn,2,1,"h3",18),i.qc()),2&e){const e=i.Dc(3);i.Ub(1),i.Mc("ngIf",!e.showContractNo),i.Ub(1),i.Mc("ngIf",e.showContractNo)}}function cn(e,t){1&e&&i.mc(0,"hr",11)}function on(e,t){if(1&e){const e=i.sc();i.rc(0,"div",21),i.zc("click",(function(){i.dd(e);const n=t.$implicit,c=i.Dc(3);return!n.addedToCart&&c.onClickAddProduct(n,!1)})),i.rc(1,"app-trade-product-info-details",22),i.zc("selectedSedolnumberAdd",(function(){i.dd(e);const n=t.$implicit;return i.Dc(3).add(n.sedolnumber,n.paymentMethodForCheck,!0)}))("selectedSedolnumberEdit",(function(){i.dd(e);const n=t.$implicit;return i.Dc(3).edit(n.sedolnumber,n.paymentMethodForCheck)}))("selectedToken",(function(n){i.dd(e);const c=t.$implicit;return i.Dc(3).selectToken(c.sedolnumber,n)}))("buyBondAction",(function(t){return i.dd(e),i.Dc(3).buyBond(t)}))("editDpmsAction",(function(t){return i.dd(e),i.Dc(3).editDpms(t)})),i.qc(),i.od(2,cn,1,0,"hr",1),i.qc()}if(2&e){const e=t.$implicit,n=t.last,c=i.Dc(3);i.Ub(1),i.Mc("header1",c.header1)("header2",c.header2)("header3",c.header3)("tooltip2",c.tooltip2)("tooltip3",c.tooltip3)("tooltip4",c.tooltip4)("header4",c.header4)("header5",c.header5)("header6",c.header6)("showHeader3",c.showHeader3)("product",e)("showEditBtn",c.showEditBtn)("showProfitLoss",c.showProfitLoss)("showBuyBondBtn",c.showBuyBondBtn)("showAddToCartBtn",c.showAddToCartBtn)("campaignCodeApplied",c.campaignCodeApplied)("fromSellCheckOut",c.fromSellCheckOut)("fromSellOrderPlaced",c.fromSellOrderPlaced)("fromSwitchCheckOut",c.fromSwitchCheckOut)("fromSwitchOrderPlaced",c.fromSwitchOrderPlaced)("showContractNo",c.showContractNo)("isLoading",c.isLoading)("isDpms",c.isDpms)("isDpmsSubsequentPage",c.isDpmsSubsequentPage),i.Ub(1),i.Mc("ngIf",!n)}}const sn=function(e,t,n){return{"trade-product":e,"without-bg":t,"pl-3":n}};function an(e,t){if(1&e&&(i.rc(0,"tr"),i.rc(1,"div",13),i.od(2,nn,3,2,"div",14),i.od(3,on,3,25,"div",15),i.qc(),i.qc()),2&e){const e=t.$implicit,n=i.Dc(2);i.Ub(1),i.Mc("ngClass",i.Uc(3,sn,n.showBgColour,!n.showBgColour,!n.noBgLayout)),i.Ub(1),i.Mc("ngIf",e.key),i.Ub(1),i.Mc("ngForOf",e.value)}}function ln(e,t){if(1&e&&(i.rc(0,"div",11),i.rc(1,"nz-table",3,12),i.rc(3,"tbody"),i.od(4,an,4,7,"tr",5),i.qc(),i.qc(),i.qc()),2&e){const e=i.ad(2),t=i.Dc();i.Ub(1),i.Mc("nzData",t.groupedItemList)("nzShowPagination",!1)("nzFrontPagination",!1),i.Ub(3),i.Mc("ngForOf",e.data)}}function rn(e,t){if(1&e&&(i.rc(0,"nz-spin",23),i.mc(1,"nz-skeleton",24),i.qc()),2&e){const e=i.Dc();i.Mc("nzSpinning",e.isLoadingProductInfo),i.Ub(1),i.Mc("nzLoading",e.isLoadingProductInfo)}}let dn=(()=>{class e{constructor(e,t){this.store=e,this.asyncPipe=t,this.showAddToCartBtn=!1,this.showBuyBondBtn=!1,this.showEditBtn=!1,this.showProfitLoss=!1,this.showBgColour=!0,this.noBgLayout=!1,this.showHeader3=!1,this.tooltip2=null,this.tooltip3=null,this.tooltip4=null,this.isDpmsSubsequentPage=!1,this.isOrderPlacedPage=!1,this.selectedSedolnumberAdd=new i.s,this.selectedSedolnumberEdit=new i.s,this.buyBondAction=new i.s,this.sellPrs=new i.s,this.addDpmsAction=new i.s,this.editDpmsAction=new i.s,this.selectedToken=new i.s,this.hasPaymentMethod=!1,this.groupedItemList=[],this.isMobile$=this.store.select(e=>e.global.mobile)}set tradeProductInfoList(e){this._tradeProductInfoList=e}get tradeProductInfoList(){return this._tradeProductInfoList}ngOnInit(){this.currentDate=new Date,this.getGroupItemList()}getGroupItemList(){var e;this.groupedItemList=[],this.tradeProductInfoList&&this.tradeProductInfoList[0]&&(null===(e=this.tradeProductInfoList[0])||void 0===e?void 0:e.paymentMethod)&&(this.hasPaymentMethod=!0),this.grouped=this.groupBy(this.tradeProductInfoList,e=>e.paymentMethod),this.grouped.forEach((e,t)=>{const n={key:t,value:e};switch(n.key){case"cheque":n.key=a.a.CASH_INVESTMENTS;break;case"EPF":case"PRS":n.key+=" Investments"}this.groupedItemList.push(n)})}groupBy(e,t){const n=new Map;
1return null==e||e.forEach(e=>{const i=t(e),c=n.get(i);c?c.push(e):n.set(i,[e])}),n}add(e,t,n){(this.asyncPipe.transform(this.isMobile$)||n)&&this.selectedSedolnumberAdd.emit({sedolnumber:e,paymentMethod:t})}edit(e,t){this.selectedSedolnumberEdit.emit({sedolnumber:e,paymentMethod:t})}selectToken(e,t){this.selectedToken.emit({sedolnumber:e,token:t})}buyBond(e){this.buyBondAction.emit(e)}ngOnChanges(e){const t=e.tradeProductInfoList;(null==t?void 0:t.currentValue)&&this.getGroupItemList()}onClickAddProduct(e,t){let n=this.store.selectSnapshot(o.X.getSelectedTransactionType);e.isPrs&&n===s.d.SELL?this.sellPrs.emit():this.isDpms?this.addDpms(e.dpmsPortfolioId,t):this.add(e.sedolnumber,e.paymentMethodForCheck,t)}addDpms(e,t){(this.asyncPipe.transform(this.isMobile$)||t)&&this.addDpmsAction.emit(e)}editDpms(e){this.editDpmsAction.emit(e)}}return e.\u0275fac=function(t){return new(t||e)(i.lc(l.i),i.lc(c.b))},e.\u0275cmp=i.fc({type:e,selectors:[["app-trade-product-info"]],inputs:{tradeProductInfoList:"tradeProductInfoList",showAddToCartBtn:"showAddToCartBtn",showBuyBondBtn:"showBuyBondBtn",showEditBtn:"showEditBtn",showProfitLoss:"showProfitLoss",showBgColour:"showBgColour",noBgLayout:"noBgLayout",showHeader3:"showHeader3",header1:"header1",header2:"header2",header3:"header3",header4:"header4",header5:"header5",header6:"header6",tooltip2:"tooltip2",tooltip3:"tooltip3",tooltip4:"tooltip4",campaignCodeApplied:"campaignCodeApplied",fromSellCheckOut:"fromSellCheckOut",fromSellOrderPlaced:"fromSellOrderPlaced",fromSwitchCheckOut:"fromSwitchCheckOut",fromSwitchOrderPlaced:"fromSwitchOrderPlaced",showContractNo:"showContractNo",isLoading:"isLoading",isDpms:"isDpms",isDpmsSubsequentPage:"isDpmsSubsequentPage",isOrderPlacedPage:"isOrderPlacedPage",isLoadingProductInfo:"isLoadingProductInfo"},outputs:{selectedSedolnumberAdd:"selectedSedolnumberAdd",selectedSedolnumberEdit:"selectedSedolnumberEdit",buyBondAction:"buyBondAction",sellPrs:"sellPrs",addDpmsAction:"addDpmsAction",editDpmsAction:"editDpmsAction",selectedToken:"selectedToken"},features:[i.Tb([c.b]),i.Sb],decls:4,vars:2,consts:[[4,"ngIf"],["class","pt-2",4,"ngIf"],["infinityFundLoadingTemplate",""],[3,"nzData","nzShowPagination","nzFrontPagination"],["tradeProductInfo",""],[4,"ngFor","ngForOf"],["class","h-50",4,"ngIf","ngIfElse"],[1,"text-black-6","border-bottom-0"],["nz-row","",1,"pl-3","mb-2","trade-product-info-bg",3,"ngClass","click"],[3,"campaignCodeApplied","showAddToCartBtn","header1","header2","header3","tooltip2","tooltip3","tooltip4","product","showEditBtn","showProfitLoss","showBuyBondBtn","showHeader3","isLoading","isDpms","isOrderPlacedPage","selectedSedolnumberAdd","selectedSedolnumberEdit","buyBondAction","addDpmsAction"],[1,"h-50"],[1,"pt-2"],["tradeProductInfoWithPaymentMethod",""],[1,"mb-2","pb-3","trade-product-info-bg",3,"ngClass"],["nz-row","",4,"ngIf"],[3,"click",4,"ngFor","ngForOf"],["nz-row",""],["class","text-theme pt-3 mb-0 font-weight-bold",4,"ngIf"],["class","mb-3 mb-0",4,"ngIf"],[1,"text-theme","pt-3","mb-0","font-weight-bold"],[1,"mb-3","mb-0"],[3,"click"],[3,"header1","header2","header3","tooltip2","tooltip3","tooltip4","header4","header5","header6","showHeader3","product","showEditBtn","showProfitLoss","showBuyBondBtn","showAddToCartBtn","campaignCodeApplied","fromSellCheckOut","fromSellOrderPlaced","fromSwitchCheckOut","fromSwitchOrderPlaced","showContractNo","isLoading","isDpms","isDpmsSubsequentPage","selectedSedolnumberAdd","selectedSedolnumberEdit","selectedToken","buyBondAction","editDpmsAction"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzLoading"]],template:function(e,t){1&e&&(i.od(0,Jt,11,9,"div",0),i.od(1,ln,5,4,"div",1),i.od(2,rn,2,2,"ng-template",null,2,i.pd)),2&e&&(i.Mc("ngIf",!t.hasPaymentMethod),i.Ub(1),i.Mc("ngIf",t.hasPaymentMethod))},directives:[c.t,r.a,r.c,c.s,r.g,r.d,d.c,c.q,Wt,k.a,Yt.a],pipes:[Kt.a,c.b],styles:[".trade-product-info-bg[_ngcontent-%COMP%] .fund-logo-container[_ngcontent-%COMP%]{top:0;right:8px}.trade-product-info-bg[_ngcontent-%COMP%] .fund-logo-container[_ngcontent-%COMP%] .fund-logo[_ngcontent-%COMP%]{height:12px;width:12px}.without-bg[_ngcontent-%COMP%] .fund-logo-container[_ngcontent-%COMP%]{top:0;right:8px}.without-bg[_ngcontent-%COMP%] .fund-logo-container[_ngcontent-%COMP%] .fund-logo[_ngcontent-%COMP%]{height:12px;width:12px}.trade-product[_ngcontent-%COMP%]{background-color:#f5f8f9}"]}),e})()},Cj6e:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var i=n("ofXK"),c=n("dEAy"),o=n("fXoL");let s=(()=>{class e{}return e.\u0275mod=o.jc({type:e}),e.\u0275inj=o.ic({factory:function(t){return new(t||e)},imports:[[i.c,c.c]]}),e})()},CnlF:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("fXoL"),c=n("ofXK");const o=[[["","header",""]],[["","body",""]],[["","footer",""]]],s=["[header]","[body]","[footer]"];let a=(()=>{class e{constructor(){this.isVisible=!1,this.shadow=!1}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=i.fc({type:e,selectors:[["uic-mobile-full-screen"]],inputs:{isVisible:"isVisible",shadow:"shadow",borderColor:"borderColor"},ngContentSelectors:s,decls:7,vars:1,consts:[[1,"uic-mobile-full-screen",3,"ngClass"],[1,"uic-mobile-full-screen-header"],[1,"uic-mobile-full-screen-body"],[1,"uic-mobile-full-screen-footer"]],template:function(e,t){1&e&&(i.Lc(o),i.rc(0,"div",0),i.rc(1,"div",1),i.Kc(2),i.qc(),i.rc(3,"div",2),i.Kc(4,1),i.qc(),i.rc(5,"div",3),i.Kc(6,2),i.qc(),i.qc()),2&e&&i.Mc("ngClass",(t.isVisible?"animate-up ":"animate-down ")+(t.shadow?"order-pad-shadow ":"")+t.borderColor)},directives:[c.q],styles:[".uic-mobile-full-screen[_ngcontent-%COMP%]{transform:translateY(100%);position:fixed;top:0;bottom:0;right:0;width:100%;z-index:100000;background:#fff;overflow-y:auto;overflow-x:hidden;padding:20px}.uic-mobile-full-screen[_ngcontent-%COMP%] .uic-mobile-full-screen-body[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto;overflow-x:hidden}.uic-mobile-full-screen.order-pad-shadow[_ngcontent-%COMP%]{box-shadow:0 4px 8px rgba(0,0,0,.1607843137254902)}.uic-mobile-full-screen.animate-up[_ngcontent-%COMP%]{transform:translateY(0);transition:.3s ease}.uic-mobile-full-screen.animate-down[_ngcontent-%COMP%]{transform:translateY(100%);transition:.3s ease}.uic-mobile-full-screen.profit[_ngcontent-%COMP%]{border:2px solid var(--brand-profit);border-bottom:none}.uic-mobile-full-screen.loss[_ngcontent-%COMP%]{border:2px solid var(--brand-loss);border-bottom:none}@media screen and (max-width:1023px){.uic-mobile-full-screen[_ngcontent-%COMP%]{min-width:unset;min-height:unset;left:0;right:0;top:0;bottom:0;border:none!important;z-index:1100;border-radius:0;display:flex;flex-direction:column;height:100%;padding:0}.uic-mobile-full-screen[_ngcontent-%COMP%] .uic-mobile-full-screen-header[_ngcontent-%COMP%]{position:sticky;top:0;z-index:1100;background:var(--white);padding-top:12px;padding-bottom:12px}.uic-mobile-full-screen[_ngcontent-%COMP%] .uic-mobile-full-screen-body[_ngcontent-%COMP%]{flex-grow:1;overflow-y:auto}.uic-mobile-full-screen[_ngcontent-%COMP%] .uic-mobile-full-screen-footer[_ngcontent-%COMP%]{position:sticky;bottom:0;z-index:1100;padding-top:8px;padding-bottom:8px;background:var(--white)}}@media screen and (min-width:1024px){.ui-order-pad[_ngcontent-%COMP%] .order-pad-header[_ngcontent-%COMP%]{margin-bottom:24px}}"]}),e})()},DiG0:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var i=function(e){return e.ISLAMIC_AGGRESSIVE="Islamic Aggressive Portfolio",e.AGGRESSIVE="Aggressive Portfolio",e.ISLAMIC_MODERATELY_AGGRESSIVE="Islamic Moderately Aggressive Portfolio",e.MODERATELY_AGGRESSIVE="Moderately Aggressive Portfolio",e.ISLAMIC_BALANCED="Islam
1ic Balanced Portfolio",e.BALANCED="Balanced Portfolio",e.ISLAMIC_MODERATELY_CONSERVATIVE="Islamic Moderately Conservative Portfolio",e.MODERATELY_CONSERVATIVE="Moderately Conservative Portfolio",e.ISLAMIC_CONSERVATIVE="Islamic Conservative Portfolio",e.CONSERVATIVE="Conservative Portfolio",e.USD_AUTO_SWEEP="USD Auto-Sweep",e}({});let c=(()=>{class e{}return e.PORTFOLIO_SEQUENCE=[i.AGGRESSIVE,i.MODERATELY_AGGRESSIVE,i.BALANCED,i.MODERATELY_CONSERVATIVE,i.CONSERVATIVE,i.ISLAMIC_AGGRESSIVE,i.ISLAMIC_MODERATELY_AGGRESSIVE,i.ISLAMIC_BALANCED,i.ISLAMIC_MODERATELY_CONSERVATIVE,i.ISLAMIC_CONSERVATIVE,i.USD_AUTO_SWEEP],e})()},EZek:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var i=n("xeZY"),c=n("fXoL"),o=n("tk/3"),s=n("31Y2");let a=(()=>{class e{constructor(e,t){this.http=e,this.paramService=t,this.BASE_URL=i.a.TRANSACTION+i.a.DPMS+i.a.PROTECTED}getDpmsBuyList(e){const t=this.paramService.buildHttpParams({refno:e});return this.http.post(this.BASE_URL+i.a.BUY_LIST+i.a.READ,{},{params:t})}getDpmsBuyDetails(e,t){const n=this.paramService.buildHttpParams({portfolioId:e,refno:t});return this.http.post(this.BASE_URL+i.a.BUY_DETAILS+i.a.READ,{},{params:n})}getDpmsHoldingList(e){const t=this.paramService.buildHttpParams({refno:e});return this.http.post(this.BASE_URL+i.a.HOLDING_LIST+i.a.READ,{},{params:t})}validateBuyCart(e,t){const n=this.paramService.buildHttpParams({refno:e});return this.http.post(this.BASE_URL+i.a.BUY+i.a.VALIDATE,t,{params:n})}confirmOrderBuy(e,t){const n=this.paramService.buildHttpParams({refno:e});return this.http.post(this.BASE_URL+i.a.BUY+i.a.CONFIRM_ORDER+i.a.CREATE,t,{params:n})}validateSellCart(e,t){const n=this.paramService.buildHttpParams({refno:e});return this.http.post(this.BASE_URL+i.a.SELL+i.a.VALIDATE,t,{params:n})}confirmOrderSell(e,t,n){const c=this.paramService.buildHttpParams(Object.assign({refno:e},n));return this.http.post(this.BASE_URL+i.a.SELL+i.a.CONFIRM_ORDER+i.a.CREATE+i.a.V2,t,{params:c})}voidDpmsOrder(e,t,n){const c=this.paramService.buildHttpParams({refno:e,contractNo:t,transactionType:n});return this.http.post(this.BASE_URL+i.a.BUY+i.a.VOID,{},{params:c})}confirmOrderBuyWithCredential(e,t,n){const c=this.paramService.buildHttpParams(Object.assign({refno:e},n));return this.http.post(this.BASE_URL+i.a.BUY+i.a.CONFIRM_ORDER+i.a.CREATE,t,{params:c})}getDpmsRspList(e){const t=this.paramService.buildHttpParams({refno:e});return this.http.post(this.BASE_URL+i.a.AVAILABLE_RSP_LIST+i.a.READ,{},{params:t})}getDpmsRspDetails(e,t){const n=this.paramService.buildHttpParams({refno:e,dpmsPortfolioId:t});return this.http.post(this.BASE_URL+i.a.RSP+i.a.PAYMENT_MODE+i.a.READ,{},{params:n})}confirmOrderRspWithCredential(e,t,n){const c=this.paramService.buildHttpParams(Object.assign({refno:e},n));return this.http.post(this.BASE_URL+i.a.BUY+i.a.RSP+i.a.CREATE,t,{params:c})}getPromoSalesCharge(e,t){const n=this.paramService.buildHttpParams({refno:e});return this.http.post(this.BASE_URL+i.a.GET_BUY_SALES_CHARGE,t,{params:n})}getDpmsRspNextDate(){return this.http.post(this.BASE_URL+i.a.RSP+i.a.NEXT_DATE+i.a.READ,{},{})}}return e.\u0275fac=function(t){return new(t||e)(c.vc(o.c),c.vc(s.a))},e.\u0275prov=c.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()},Fpuq:function(e,t,n){"use strict";n.r(t),n.d(t,"TransactionModule",(function(){return YN}));var i=n("NMKc"),c=n("tyNb"),o=n("mrSG"),s=n("AcyG"),a=n("gFZo"),l=n("2VHv"),r=n("LW8c"),d=n("j0Y6"),u=n("iEbP"),h=n("fXoL"),p=n("ofXK"),m=n("itXk"),f=n("H8v0"),g=n("+NfP"),b=n("/uUt"),S=n("lJxs"),y=n("vkgz"),v=n("j+kT"),M=n("6h7t"),C=n("bz11"),q=n("Yk7X"),T=n("JZDV"),w=n("yPVp"),z=n("1Z1e"),D=n("1HOV"),P=n("B+r4"),I=n("JA5x"),k=n("FwiY"),A=n("9Or2"),E=n("bOdf"),F=n("eIep"),O=n("aLIQ"),U=n("G/fY"),x=n("nY4S"),L=n("Acs3"),R=n("8M/t"),N=n("XRmg"),B=n("drXJ"),_=n("OzZK"),V=n("jyh5"),H=n("2jM0"),$=n("j2hF"),j=n("dEAy"),G=n("t7Fq"),W=n("OtHt");function Y(e,t){if(1&e&&h.mc(0,"span",10),2&e){const e=h.Dc(3);h.Mc("innerHTML",e.errorMessage,h.ed)}}function K(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.od(1,Y,1,1,"span",6),h.rc(2,"div",7),h.rc(3,"div",8),h.rc(4,"button",9),h.zc("click",(function(){return h.dd(e),h.Dc(2).closeErrorMessage()})),h.qd(5,"Ok "),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",e.errorMessage)}}function X(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",3),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().closeErrorMessage()}))("nzVisibleChange",(function(t){return h.dd(e),h.Dc().showErrorMessageModal=t})),h.rc(1,"h3"),h.mc(2,"i",4),h.qd(3,"Notices"),h.qc(),h.od(4,K,6,1,"div",5),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Mc("nzVisible",e.showErrorMessageModal)("nzFooter",null),h.Ub(4),h.Mc("ngIf",!e.isLoading)("ngIfElse",t)}}function Q(e,t){if(1&e&&h.mc(0,"span",10),2&e){const e=h.Dc(3);h.Mc("innerHTML",e.errorMessage,h.ed)}}function Z(e,t){if(1&e&&(h.rc(0,"div"),h.od(1,Q,1,1,"span",6),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",e.errorMessage)}}function J(e,t){if(1&e){const e=h.sc();h.rc(0,"div",15),h.rc(1,"button",16),h.zc("click",(function(){return h.dd(e),h.Dc(2).closeErrorMessage()})),h.qd(2,"Ok "),h.qc(),h.qc()}}function ee(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-mobile-drawer",11),h.zc("showChange",(function(t){return h.dd(e),h.Dc().showErrorMessageModal=t})),h.rc(1,"nz-row",12),h.rc(2,"nz-col",13),h.rc(3,"h3"),h.mc(4,"i",4),h.qd(5,"Notices"),h.qc(),h.qc(),h.qc(),h.od(6,Z,2,1,"div",5),h.od(7,J,3,0,"div",14),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Mc("show",e.showErrorMessageModal)("hideButtons",!0),h.Ub(6),h.Mc("ngIf",!e.isLoading)("ngIfElse",t),h.Ub(1),h.Mc("ngIf",!e.isLoading)}}function te(e,t){if(1&e&&h.mc(0,"nz-skeleton",17),2&e){const e=h.Dc();h.Mc("nzActive",!0)("nzLoading",e.isLoading)}}let ne=(()=>{class e{constructor(){this.closeErrorMessageModal=new h.s,this.isLoading=!1}ngOnInit(){}closeErrorMessage(){this.closeErrorMessageModal.emit(!0)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["checkout-error-message-modal"]],inputs:{errorMessage:"errorMessage",showErrorMessageModal:"showErrorMessageModal"},outputs:{closeErrorMessageModal:"closeErrorMessageModal"},decls:7,vars:6,consts:[["nzWrapClassName","vertical-center-modal",3,"nz
1Visible","nzFooter","nzOnCancel","nzVisibleChange",4,"ngIf"],[3,"show","hideButtons","showChange",4,"ngIf"],["loadingTemplate",""],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzOnCancel","nzVisibleChange"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning"],[4,"ngIf","ngIfElse"],["class","font-semibold m-b-md",3,"innerHTML",4,"ngIf"],["nz-row","","nzGutter","16","nzJustify","end","nzType","flex",1,"pt-2","mx-0","container"],[1,"text-right"],["nz-button","","nzType","outline",1,"rounded-calertircle",3,"click"],[1,"font-semibold","m-b-md",3,"innerHTML"],[3,"show","hideButtons","showChange"],["nzType","flex"],["nzSpan","20"],["class","text-right fixed-bottom px-3 pb-3","nz-row","",4,"ngIf"],["nz-row","",1,"text-right","fixed-bottom","px-3","pb-3"],["nz-button","","nzBlock","","nzType","primary",1,"rounded-calertircle",3,"click"],[3,"nzActive","nzLoading"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,X,5,4,"nz-modal",0),h.Ec(2,"async"),h.qc(),h.od(3,ee,8,5,"b2c-mobile-drawer",1),h.Ec(4,"async"),h.od(5,te,1,2,"ng-template",null,2,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,2,t.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(4,4,t.isMobile$)))},directives:[B.a,p.t,j.a,k.b,P.c,_.a,G.a,P.a,W.a],pipes:[p.b],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})(),ie=(()=>{class e{constructor(){this.onClose=new h.s}ngOnInit(){}onOkPressed(){this.onClose.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-epf-min-notice-modal"]],inputs:{show:"show"},outputs:{onClose:"onClose"},decls:11,vars:2,consts:[["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzOnCancel"],[1,"px-3"],["nz-icon","","nzType","info-circle","nzTheme","fill",1,"text-accent-1","d-inline-block","text-lg"],[1,"d-inline-block","pt-1","pl-2","font-weight-bold"],["nzType","flex",1,"py-3"],[1,"text-right"],["nz-button","","nzType","primary",1,"mx-1",3,"click"]],template:function(e,t){1&e&&(h.rc(0,"nz-modal",0),h.zc("nzOnCancel",(function(){return t.onOkPressed()})),h.rc(1,"div",1),h.mc(2,"em",2),h.rc(3,"h3",3),h.qd(4,"Invalid Investment Amount"),h.qc(),h.rc(5,"nz-row",4),h.rc(6,"p"),h.qd(7," Your total investment amount via EPF payment method must be at least MYR 1,000.00 "),h.qc(),h.qc(),h.rc(8,"div",5),h.rc(9,"button",6),h.zc("click",(function(){return t.onOkPressed()})),h.qd(10,"OK"),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("nzVisible",t.show)("nzFooter",null)},directives:[j.a,k.b,P.c,_.a],styles:[""]}),e})();var ce=n("Kj3r"),oe=n("3Pt+"),se=n("ocnv"),ae=n("6oRW"),le=n("ZyQt");function re(e,t){1&e&&(h.rc(0,"nz-tag",8),h.rc(1,"span",9),h.qd(2,"Valid"),h.qc(),h.qc()),2&e&&h.Mc("nzColor","green")}function de(e,t){1&e&&(h.rc(0,"nz-tag",8),h.rc(1,"span",10),h.qd(2,"Invalid"),h.qc(),h.qc()),2&e&&h.Mc("nzColor","red")}function ue(e,t){if(1&e&&(h.pc(0),h.od(1,re,3,1,"nz-tag",6),h.od(2,de,3,1,"ng-template",null,7,h.pd),h.oc()),2&e){const e=h.ad(3),t=h.Dc(2);h.Ub(1),h.Mc("ngIf",t.campaignCodeStatus)("ngIfElse",e)}}function he(e,t){if(1&e&&h.od(0,ue,4,2,"ng-container",5),2&e){const e=h.Dc();h.Mc("ngIf",!e.isLoading&&""!==(null==e.campaignCode?null:e.campaignCode.value))}}function pe(e,t){if(1&e&&(h.rc(0,"div",11),h.qd(1),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.sd(" ",e.campaignCodeErrorMessage," ")}}const me=function(e){return{"pb-1 mt-2":e}};let fe=(()=>{class e{constructor(e,t,n,i,c){this.fb=e,this.subHandlingService=t,this.transactionRestService=n,this.store=i,this.transactionService=c,this.promoCodeApplied=new h.s,this.fundBuyTransactionSalesChargeModel={},this.buyInfoModel=[],this.fundSwitchTransactionModels=[],this.campaignCodeStatus=!1,this.campaignCodeErrorMessage="",this.isLoading=!1,this.invalidCampaignCodeMessage="Invalid campaign code.",this.lowestApplicableSalesChargeMessage="Your current sales charge is already the lowest applicable rate. This campaign code does not provide any further discount.",this.campaignCodeForm=this.fb.group({campaignCode:[]}),this.fromBuy=this.store.selectSnapshot(u.X.getSelectedTransactionType)===d.d.BUY,this.fromBuy?(this.cartList$=this.store.select(u.l.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.lastEnteredCode$=this.store.select(u.l.getCampaignCode).pi
1pe(Object(S.a)(e=>e(this.refno)))):(this.cartSwitchList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.lastEnteredCode$=this.store.select(u.W.getCampaignCode).pipe(Object(S.a)(e=>e(this.refno))))}buildCampaignCodeErrorMessage(e,t,n){return t?`This campaign code is only applicable for investments up to RM${null!=n?n.toLocaleString("en-MY"):""}. Please adjust your investment amount to enjoy the campaign sales charge.`:e?this.lowestApplicableSalesChargeMessage:this.invalidCampaignCodeMessage}getBuyInfoModelList(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.buyInfoModel=[];for(let t of e)this.buyInfoModel.push(t.buyInfoModel)})))}getSwitchModelList(){this.subHandlingService.subscribe(this.cartSwitchList$.pipe(Object(y.a)(e=>{this.fundSwitchTransactionModels=[];for(let t of e)this.fundSwitchTransactionModels.push(t.fundSwitchTransactionModel)})))}ngOnInit(){}ngOnChanges(e){this.store.selectSnapshot(u.X.getSelectedTransactionType)===d.d.BUY?this.getBuyInfoModelList():this.getSwitchModelList(),this.subscribeCampaignCodeChange(),this.subscribeCartChange(),this.subscribeLastEnteredCode()}subscribeCartChange(){const e=this.fromBuy?this.cartList$.pipe(Object(S.a)(e=>this.buildBuyCartSignature(e))):this.cartSwitchList$.pipe(Object(S.a)(e=>this.buildSwitchCartSignature(e)));this.subHandlingService.subscribe(e.pipe(Object(b.a)(),Object(ce.a)(500),Object(y.a)(()=>{const e=this.campaignCode.value;e&&this.validateCampaignCode(e)})))}buildBuyCartSignature(e){return(e||[]).map(e=>{const t=null==e?void 0:e.buyInfoModel;return[null==t?void 0:t.sedolNumber,null==t?void 0:t.amount,null==t?void 0:t.currency,null==t?void 0:t.paymentMethod,null==t?void 0:t.investmentType].join("|")}).join(";")}buildSwitchCartSignature(e){return(e||[]).map(e=>{const t=null==e?void 0:e.fundSwitchTransactionModel;return[null==t?void 0:t.switchSellSedolnumber,null==t?void 0:t.switchBuySedolnumber,null==t?void 0:t.switchUnit,null==t?void 0:t.switchPercent,null==t?void 0:t.switchAmount,null==t?void 0:t.paymentMethod].join("|")}).join(";")}validateCampaignCode(e){this.fromBuy?(this.isLoading=!0,this.subHandlingService.subscribe(this.transactionRestService.validateCampaignCode(e,this.buyInfoModel,this.refno).pipe(Object(y.a)(t=>{if(this.isLoading=!1,t.status!==M.a.RESPONSE_SUCCESS)return this.campaignCodeStatus=!1,this.campaignCodeErrorMessage=this.invalidCampaignCodeMessage,this.transactionService.addBuyCampaignCode(this.refno,""),void this.promoCodeApplied.emit(!1);this.fundBuyTransactionSalesChargeModel=Object(g.a)(t.data.summary);const n=!0===this.fundBuyTransactionSalesChargeModel.isLowestApplicableSalesCharge,i=!0===this.fundBuyTransactionSalesChargeModel.isCampaignCodeInvestmentCapExceeded,c=!n&&!i,o=""!==this.campaignCode.value&&c;this.campaignCodeStatus=c,this.campaignCodeErrorMessage=this.buildCampaignCodeErrorMessage(n,i,this.fundBuyTransactionSalesChargeModel.campaignCodeInvestmentCapMyr),this.transactionService.addBuyCampaignCode(this.refno,o?e:""),this.promoCodeApplied.emit(o),this.transactionService.updateBuyFundsSalesCharge(this.fundBuyTransactionSalesChargeModel.buyInfo,this.refno),this.store.dispatch(new u.J(o,this.refno))})))):(this.isLoading=!0,this.subHandlingService.subscribe(this.transactionRestService.validateSwitchCampaignCode(e,this.fundSwitchTransactionModels,this.refno).pipe(Object(y.a)(e=>{var t;if(this.isLoading=!1,e.status!==M.a.RESPONSE_SUCCESS)return this.campaignCodeStatus=!1,this.campaignCodeErrorMessage=this.invalidCampaignCodeMessage,void this.promoCodeApplied.emit(!1);let n=Object(g.a)(e.data);const i=n.length>0&&n.every(e=>!0===e.isLowestApplicableSalesCharge),c=n.some(e=>!0===e.isCampaignCodeInvestmentCapExceeded),o=!i&&!c&&n.some(e=>null!=e.campaignCode),s=""!==this.campaignCode.value&&o;this.campaignCodeStatus=o,this.campaignCodeErrorMessage=this.buildCampaignCodeErrorMessage(i,c,null===(t=n.find(e=>!0===e.isCampaignCodeInvestmentCapExceeded))||void 0===t?void 0:t.campaignCodeInvestmentCapMyr),this.promoCodeApplied.emit(s),this.transactionService.updateSwitchFundsSalesCharge(this.refno,n),this.store.dispatch(new u.T(this.refno,s))}))))}get campaignCode(){return this.campaignCodeForm.get("campaignCode")}subscribeCampaignCodeChange(){this.subHandlingService.subscribe(this.campaignCode.valueChanges.pipe(Object(ce.a)(500),Object(b.a)(),Object(y.a)(e=>{this.transactionService.addBuyCampaignCode(this.refno,""),this.transactionService.addSwitchCampaignCode(this.refno,e),this.validateCampaignCode(e)})))}subscribeLastEnteredCode(){this.subHandlingService.once(this.lastEnteredCode$.pipe(Object(y.a)(e=>{var t;null===(t=this.campaignCode)||void 0===t||t.setValue(e||"")})))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(l.a),h.lc(T.a),h.lc(s.i),h.lc(C.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-campaign-code-input-box"]],inputs:{refno:"refno"},outputs:{promoCodeApplied:"promoCodeApplied"},features:[h.Tb([l.a]),h.Sb],decls:9,vars:10,consts:[["nz-form","",3,"formGroup"],[3,"ngClass","nzLabelPlaceholder","nzSuffix"],["type","string","ui-input","",1,"font-weight-bold","text-black","pt-3",3,"formControl"],["codeStatus",""],["class","text-danger text-xs mt-1",4,"ngIf"],[4,"ngIf"],["class","",3,"nzColor",4,"ngIf","ngIfElse"],["invali
1d",""],[1,"",3,"nzColor"],[1,"text-profit"],[1,"text-danger"],[1,"text-danger","text-xs","mt-1"]],template:function(e,t){if(1&e&&(h.rc(0,"form",0),h.rc(1,"nz-form-item"),h.rc(2,"nz-form-control"),h.rc(3,"ui-input-group",1),h.Ec(4,"async"),h.mc(5,"input",2),h.od(6,he,1,1,"ng-template",null,3,h.pd),h.qc(),h.od(8,pe,2,1,"div",4),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(7);h.Mc("formGroup",t.campaignCodeForm),h.Ub(3),h.Mc("ngClass",h.Sc(8,me,!h.Fc(4,6,t.isMobile$)))("nzLabelPlaceholder","Campaign Code")("nzSuffix",e),h.Ub(2),h.Mc("formControl",t.campaignCode),h.Ub(3),h.Mc("ngIf",!t.isLoading&&""!==(null==t.campaignCode?null:t.campaignCode.value)&&!t.campaignCodeStatus)}},directives:[oe.J,oe.u,se.b,oe.l,se.e,se.a,ae.c,p.q,oe.c,ae.b,oe.t,oe.i,p.t,le.a],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var ge=n("3O+M"),be=n("T0I8"),Se=n("9WYH"),ye=n("u52B"),ve=n("rMZv");let Me=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-annexure-mycimbpri"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:166,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],[1,"pl-3"],[1,"ml-3"],["type","a",1,"pl-3","my-3"],["href","http://www.cwealthadvisors.com.my"],["type","a"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"div"),h.rc(2,"ol",1),h.rc(3,"li"),h.rc(4,"p"),h.qd(5," This annexure will be read in conjunction with the Client Registration Form, the Unit Trust Account Opening Form, the PRS Joint Account Opening Form and relevant terms and conditions, where applicable. "),h.qc(),h.rc(6,"p"),h.qd(7,' Pursuant to the Personal Data Protection Act 2010, please take note that it is mandatory for you to provide CIMB-Principal Asset Management Berhad ("CIMB-Principal") with the information requested within the Client Registration Form, the Unit Trust Account Opening Form, the PRS Joint Account Opening Form, where applicable. However, the following personal information requested within the respective forms are optional:- '),h.qc(),h.qc(),h.rc(8,"table",2),h.rc(9,"tr"),h.rc(10,"th"),h.qd(11,"Client Registration Form"),h.qc(),h.rc(12,"th"),h.qd(13,"Unit Trust Account Opening Form"),h.qc(),h.rc(14,"th"),h.qd(15,"PRS Joint Account Opening Form"),h.qc(),h.qc(),h.rc(16,"tr"),h.rc(17,"td"),h.rc(18,"ol",3),h.rc(19,"li"),h.rc(20,"span"),h.qd(21,"Gender"),h.qc(),h.qc(),h.rc(22,"li"),h.rc(23,"span"),h.qd(24,"Salutation"),h.qc(),h.qc(),h.rc(25,"li"),h.rc(26,"span"),h.qd(27,"Marital Status"),h.qc(),h.qc(),h.rc(28,"li"),h.rc(29,"span"),h.qd(30,"Annual Income"),h.qc(),h.qc(),h.rc(31,"li"),h.rc(32,"span"),h.qd(33,"No. of Dependent"),h.qc(),h.qc(),h.rc(34,"li"),h.rc(35,"span"),h.qd(36,"Mother's Maiden Name"),h.qc(),h.qc(),h.rc(37,"li"),h.rc(38,"span"),h.qd(39,"Employer Address"),h.qc(),h.qc(),h.rc(40,"li"),h.rc(41,"span"),h.qd(42,"Fax No."),h.qc(),h.qc(),h.rc(43,"li"),h.rc(44,"span"),h.qd(45,"E-mail Address"),h.qc(),h.qc(),h.rc(46,"li"),h.rc(47,"span"),h.qd(48,"Spouse Details"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(49,"td"),h.rc(50,"ol",3),h.rc(51,"li"),h.rc(52,"span"),h.qd(53,"Fax No."),h.qc(),h.qc(),h.rc(54,"li"),h.rc(55,"span"),h.qd(56,"E-mail Address"),h.qc(),h.qc(),h.rc(57,"li"),h.rc(58,"span"),h.qd(59,"Relationship to First Applicant"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(60,"td"),h.rc(61,"ol",3),h.rc(62,"li"),h.rc(63,"span"),h.qd(64,"Salutation"),h.qc(),h.qc(),h.rc(65,"li"),h.rc(66,"span"),h.qd(67,"Mother's Maiden Name"),h.qc(),h.qc(),h.rc(68,"li"),h.rc(69,"span"),h.qd(70,"E-mail Address"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(71,"li"),h.rc(72,"div"),h.rc(73,"p"),h.rc(74,"span"),h.qd(75,"Please note that the following clauses will form part of the terms and conditions governing your account with CIMB-Principal in line with the Personal Data Protection 2010."),h.qc(),h.qc(),h.rc(76,"ol"),h.rc(77,"li"),h.rc(78,"p"),h.qd(79,"Privacy Clause (for Individual Applicant(s))"),h.qc(),h.rc(80,"ol"),h.rc(81,"li"),h.rc(82,"div"),h.rc(83,"p"),h.qd(84," You hereby confirm that you have read, understood and agreed to be bound by the CIMB-Principal Privacy Notice (which is available at "),h.rc(85,"a",4),h.qd(86,"www.cwealthadvisors.com.my"),h.qc(),h.qd(87,") and the clauses herein, as may relate to the processing of your personal information. For the avoidance of doubt, you agree that the said Privacy Notice shall be deemed to be incorporated by reference into this application form. "),h.qc(),h.qc(),h.qc(),h.rc(88,"li"),h.rc(89,"div"),h.rc(90,"p"),h.qd(91,"In the event you provide personal and financial information relating to third parties, including information relating to your next-of-kin and dependents (where you are an individual) or information relating to your directors, shareholders, officers, individual guarantors and security providers (where you are a corporation), for the purpose of opening or operating your account(s)/investments with us or otherwise subscribing to our products and services, you (a) confirm that you have obtained their consent or are otherwise entitled to provide this information to us and for us to use it in accordance with this agreement; (b) agree to ensure that the personal and financial information of the said third parties is accurate; (c) agree to update us in writing in the event of any material change to the said personal and financial information; and (d) agree to our right to terminate this agreement should such consent be withdrawn by any of the said third parties."),h.qc(),h.qc(),h.qc(),h.rc(92,"li"),h.rc(93,"div"),h.rc(94,"p"),h.qd(95,"Where you instruct us to effect any sort of cross-border transaction (including to make or receive payments), the details relevant to the cross-border transaction (including information relating to those involved in the said transaction) may be received from or sent abroad, where it could be accessible (whether directly or indirectly) by overseas regulators and authorities in connection with their legitimate duties (e.g. the prevention of crime). In instructing us and/or our agents to enter into any cross-border transaction on your behalf, you agree to the above said disclosures on behalf of yourself and others involved in the said cross-border transaction."),h.qc(),h.qc(),h.qc(),h.rc(96,"li"),h.rc(97,"div"),h.rc(98,"p"),h.qd(99,"We may use a credit reporting/reference agency to help make decisions, for example when we need to (a) check details on applications for credit and credit-related or other facilities; (b) manage credit and credit-related accounts or facilities, including conducting reviews of your portfolio(s); and/or recover debts. You will be linked by credit reporting/reference agencies to any other names you use or have used, and any joint and several applicants. We may al
1so share information about you and how you manage your account(s)/investment(s) with relevant credit reporting/reference agencies."),h.qc(),h.qc(),h.qc(),h.rc(100,"li"),h.rc(101,"div"),h.rc(102,"p"),h.qd(103,"Even after you have provided us with any information, you will have the option to withdraw the consent given earlier. In such instances, we will have the right to not provide or discontinue the provision of any product, service and/or account(s) and/or investment(s) that is/are linked with such information."),h.qc(),h.qc(),h.qc(),h.rc(104,"li"),h.rc(105,"div"),h.rc(106,"p"),h.qd(107,"We reserve the right to amend this clause from time to time at our sole discretion and shall provide prior notification to you in writing and place any such amendments on our websites and/or by placing notices at prominent locations within our branches."),h.qc(),h.qc(),h.qc(),h.rc(108,"li"),h.rc(109,"div"),h.rc(110,"p"),h.qd(111,"This clause shall be without prejudice to any other clause in this application form which provides for the disclosure of information."),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(112,"li"),h.rc(113,"p"),h.qd(114,"Privacy Clause for (for Non-Individual Applicant(s))"),h.qc(),h.rc(115,"ol"),h.rc(116,"li"),h.rc(117,"div"),h.rc(118,"p"),h.qd(119,"You hereby irrevocably consent and authorise, and confirm that you have duly obtained your directors, shareholders, officers, guarantors and/or such other relevant persons consent and authority, for CIMB-Principal:"),h.qc(),h.rc(120,"ol",5),h.rc(121,"li"),h.rc(122,"div"),h.rc(123,"p"),h.qd(124,"to be provided information (inclusive of relevant personal information of the said directors, shareholders, officers, guarantors and/or relevant persons) as may be required by CIMB-Principal for use in accordance with this application form;"),h.qc(),h.qc(),h.qc(),h.rc(125,"li"),h.rc(126,"div"),h.rc(127,"p"),h.qd(128,"to carry out the necessary reference checks including but not limited to credit reference/reporting checks to further ascertain your status and your subsidiaries, directors, shareholders, officers, guarantors and/or such other relevant persons;"),h.qc(),h.qc(),h.qc(),h.rc(129,"li"),h.rc(130,"div"),h.rc(131,"p"),h.qd(132,"to disclose the said directors, shareholders, officers, guarantors and/or relevant persons personal information to the classes of parties described in CIMB-Principal's Privacy Notice; and"),h.qc(),h.qc(),h.qc(),h.rc(133,"li"),h.rc(134,"div"),h.rc(135,"p"),h.qd(136,"to provide the said directors, shareholders, officers, guarantors and/or relevant persons with information on CIMB-Principal's products, services and/or offers (inclusive of the products, services and offers of entities within the CIMB Group) which may be of interest and/or financial benefit to them,"),h.qc(),h.qc(),h.qc(),h.qc(),h.mc(137,"br"),h.rc(138,"p"),h.qd(139,"at CIMB-Principal's sole discretion without further reference to you, your subsidiaries, directors, shareholders, officers, guarantors and/or relevant persons. You agree to undertake the responsibility to update CIMB-Principal in writing should there be any change to the personal and financial information relating to the said directors, shareholders, officers, guarantors and/or relevant persons. Should the said consent and/or authority be subsequently revoked by any of the said directors, shareholders, officers, guarantors and/or relevant persons, you agree that CIMB-Principal shall have the right to terminate its products and/or services."),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(140,"li"),h.rc(141,"div"),h.rc(142,"p"),h.rc(143,"span"),h.qd(144,'Foreign Account Tax Compliance Act ("FATCA") Declaration for Unit Trust and PRS Products'),h.qc(),h.qc(),h.rc(145,"ol"),h.rc(146,"li"),h.rc(147,"div"),h.rc(148,"p"),h.qd(149,"You hereby confirm that you are not a US resident/US citizen/US permanent resident or not an US entity/legal entity with US directors/shareholders with more than twenty-five percent (25%) ownership/US person(s) as beneficial owner(s) and hereby declare that the confirmation provided by you in this Annexure as of date is true, accurate and complete."),h.qc(),h.qc(),h.qc(),h.rc(150,"li"),h.rc(151,"div"),h.rc(152,"p"),h.qd(153,"Where required and subject to any applicable local laws, you also consent for CIMB-Principal, its parent or ultimate holding company or any of its affiliates (including branches) to share your information with domestic or overseas regulators or tax authorities where necessary to establish your tax liability in any/or the relevant jurisdiction."),h.qc(),h.qc(),h.qc(),h.rc(154,"li"),h.rc(155,"div"),h.rc(156,"p"),h.qd(157,"Where required by domestic or overseas regulators or tax authorities, you also understand and agree that CIMB-Principal may be required to obtain additional documents and/or forms, which you/authorized signatory/director(s) will sign, if you/shareholders/
1director(s) are subject to the relevant jurisdiction's requirements."),h.qc(),h.qc(),h.qc(),h.rc(158,"li"),h.rc(159,"div"),h.rc(160,"p"),h.qd(161,"You also agree and undertake to notify CIMB-Principal within thirty (30) days, or provide additional information if requested by CIMB-Principal, if there is any change in the information which you have provided to CIMB-Principal."),h.qc(),h.qc(),h.qc(),h.rc(162,"li"),h.rc(163,"div"),h.rc(164,"p"),h.qd(165,"Where in the event of any indication that you may be deemed as possibly US person(s), whether individual or entity wise, you are required to complete the relevant form for individual or entity respectively and return the completed form with the supporting identification document(s) to CIMB-Principal within thirty (30) days of our request. Failure to do so shall render CIMB-Principal the right to terminate the business relationship with you."),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("title","Annexure to Client Registration Form, Unit Trust Account Opening Form and PRS Joint Account Opening Form")("show",t.show)},directives:[G.a,ve.g,ve.e,ve.d],styles:[""]}),e})(),Ce=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-annexure-myhwdbs"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:106,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],[1,"text-center"],[1,"mb-2"],["href","mailto:[email protected]"],[2,"font-weight","bold","font-size","16px"],["type","1"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"h3",1),h.qd(2,"Asset Management"),h.qc(),h.rc(3,"div",2),h.rc(4,"strong"),h.qd(5,"PERSONAL DATA PROTECTION SPECIFIC CONSENT"),h.qc(),h.qc(),h.rc(6,"p"),h.qd(7,'Affin Hwang Asset Management Berhad ("Affin Hwang AM") hereby gives you notice pursuant to Section 7 of the Personal Data Protection Act 2010 (the "Act") as follows:'),h.qc(),h.rc(8,"p"),h.qd(9,"Information may be collected at any time and from time to time by Affin Hwang AM that relates directly or indirectly to you and / or your account. Such information shall be processed by Affin Hwang AM or on behalf of Aff
1in Hwang AM by a third party service provider for the purposes of the provision of the services to you as well as for administration, marketing, customer services, risk profiling, improving Affin Hwang AM's services to you, maintaining and updating your records. The Information may also be processed for the purposes of complying with applicable laws, including anti-money laundering laws and regulations."),h.qc(),h.rc(10,"p"),h.qd(11,'Such Information is sourced from and may include, but is not limited to, information provided by you, or someone acting on your behalf, details of orders placed and trades entered by you, other transactions conducted by you through or in connection with our online portal, other information concerning you that Affin Hwang AM may receive from your use of our online portal, or any associated website, but excluding security details, information obtained about you through checks which we may perform prior to or during your use of our services, and information regarding you that we may receive from any relevant third party providing services to us (collectively referred to as "Information").'),h.qc(),h.rc(12,"p"),h.qd(13,"For the above purposes, Affin Hwang AM may disclose the Information to:-"),h.qc(),h.rc(14,"ul"),h.rc(15,"li"),h.qd(16,"Our directors, officers and dealer's representatives for purposes relating to your application and use of our services / products;"),h.qc(),h.rc(17,"li"),h.qd(18,"Our related, associated or affiliated companies"),h.qc(),h.rc(19,"li"),h.qd(20,"Regulatory bodies such as Bank Negara Malaysia, Securities Commission, Bursa Malaysia Securities Berhad, clearing house and other regulatory bodies which have oversight over us and our activities;"),h.qc(),h.rc(21,"li"),h.qd(22,"Any third party service provider, agent or contractors who have been appointed by us to provide services to us whether in or outside Malaysia subject to sufficient security controls over the information;"),h.qc(),h.rc(23,"li"),h.qd(24,"Our auditors, lawyers, consultants and other advisors;"),h.qc(),h.rc(25,"li"),h.qd(26,"Parties authorised by you; and"),h.qc(),h.rc(27,"li"),h.qd(28,"Any other party to whom such disclosure is required by law or regulatory requirement or pursuant to a Court order."),h.qc(),h.qc(),h.rc(29,"p"),h.qd(30,"To enable Affin Hwang AM to accept and process your account opening application, administration of your account and for anti-money laundering purposes, Affin Hwang AM may effect searches in relation to you."),h.qc(),h.rc(31,"p"),h.qd(32,"You have the right to request a copy of the Information that Affin Hwang AM holds that relates directly to you or your account (for which Affin Hwang AM may charge a nominal fee) and to correct inaccuracies in such Information."),h.qc(),h.rc(33,"p"),h.qd(34," You are required to provide the information as requested in this application to be processed by or on behalf of Aff
1in Hwang AM as described above. If you do not agree to supply the information to Affin Hwang AM in according with this notice, Affin Hwang AM will not be able to provide you with Affin Hwang AM's services and / or open an account for you. If you have any enquiries or complaints, you may contact Affin Hwang AM by phone at 03-2116 6000 or via email at "),h.rc(35,"a",3),h.qd(36,"[email protected]"),h.qc(),h.qc(),h.rc(37,"p"),h.qd(38,"To make sure we follow your instructions correctly and to improve our service to you through training of our staff, Affin Hwang AM may monitor or record all communications."),h.qc(),h.rc(39,"p"),h.qd(40,"If you are a corporation supplying personal data of your directors, shareholders and / or officers to us, please do ensure that you have obtained their consent and bring our Privacy Notice to the attention of your directors, shareholders and/or officers whose personal data you are supplying / have been supplied to us."),h.qc(),h.rc(41,"p",4),h.qd(42,"NOTIS BAWAH AKTA PERLINDUNGAN DATA PERIBADI 2010"),h.qc(),h.rc(43,"p"),h.qd(44,'Affin Hwang Asset Management Berhad ("Affin Hwang AM") dengan ini memberi notis selaras dengan Seksyen 7 Akta Perlindungan Data Peribadi 2010 seperti berikut:'),h.qc(),h.rc(45,"p"),h.qd(46,"Maklumat boleh dikumpul pada bila-bila masa dan dari masa ke semasa oleh Affin Hwang AM yang mempunyai kaitan secara langsung atau tidak langsung dengan anda dan / atau transaksi-transaksi anda. Maklumat tersebut akan diproses oleh Affin Hwang AM atau untuk pihak Affin Hwang AM oleh pihak penyampai khidmat pihak ketiga bagi maksud Perkhidmatan kepad
1a anda selain untuk pentadbiran, analisis statistik, taksiran dan analisis, pemasaran, pelanggan, pro\ufb01l pelanggan, memperbaiki khidmat Affin Hwang AM kepada anda, mengekalkan dan mengemaskini rekod-rekod anda. Maklumat juga boleh diproses bagi maksud mematuhi undang-undang terpakai termasuk undang-undang dan peraturan anti pengubahan wang haram."),h.qc(),h.rc(47,"p"),h.qd(48,'Maklumat yang boleh diperolehi adalah termasuk, tetapi tidak terhad kepada, maklumat yang diberikan oleh anda, atau seseorang yang bertindak bagi pihak anda, butir-butir pesanan dan dagangan yang dilakukan dan didagangkan oleh anda, transaksi-transaksi lain yang dilakukan oleh anda melalui atau yang berkaitan dengan tapak dagangan, dan maklumat lain yang melibatkan anda yang mungkin diterima oleh Affin Hwang AM dari penggunaan anda terhadap tapak dagangan, mana-mana laman sesawang yang berkaitan, tetapi tidak termasuk butir-butir keselamatan, maklumat yang dikumpul melalui penggunaan pusat perhubungan pelanggan pihak Affin Hwang AM, maklumat yang diperolehi yang mempunyai kaitan dengan anda yang boleh diterima dari mana-mana pihak ketiga yang memberikan khidmat kepada Affin Hwang AM (secara kolektif dirujuk sebagai "Maklumat").'),h.qc(),h.rc(49,"p"),h.qd(50,"Bagi tujuan-tujuan di atas, Affin Hwang AM boleh mendedahkan Maklumat kepada:-"),h.qc(),h.rc(51,"ul"),h.rc(52,"li"),h.qd(53,"Pengarah-pengarah, pegawai-pegawai dan wakil-wakil penjual kami untuk tujuan yang berhubungan dengan permohonan dan penggunaan perkhidmatan- perkhidmatan / produk-produk kami oleh anda;"),h.qc(),h.rc(54,"li"),h.qd(55,"Syarikat-syarikat berkaitan, bersekutu atau bergabung dengan kami;"),h.qc(),h.rc(56,"li"),h.qd(57,"Badan-badan kawal selia seperti Bank Negara Malaysia, Suruhanjaya Sekuriti, Bursa Malaysia Securities Berhad, gedung penjelasan dan badan-badan kawal selia yang lain yang mempunyai pengawasan ke atas kami dan aktiviti-aktiviti kami;"),h.qc(),h.rc(58,"li"),h.qd(59,"Mana-mana pembekal perkhidmatan pihak ketiga, ejen atau kontraktor yang telah dilantik oleh kami untuk memberikan perkhidmatan kepad
1a kami sama ada di dalam atau di luar Malaysia tertakluk kepada kawalan keselamatan yang mencukupi ke atas maklumat itu"),h.qc(),h.rc(60,"li"),h.qd(61,"Juruaudit, peguam, perunding dan penasihat lain kami;"),h.qc(),h.rc(62,"li"),h.qd(63,"Pihak-pihak yang diberi kuasa oleh anda; dan"),h.qc(),h.rc(64,"li"),h.qd(65,"Mana-mana pihak lain yang kepadanya penzahiran itu dikehendaki oleh undang-undang atau keperluan kawal selia atau menurut suatu perintah Mahkamah."),h.qc(),h.qc(),h.rc(66,"p"),h.qd(67,"Bagi membolehkan pihak Affin Hwang AM membuat keputusan untuk memproses aplikasi akaun anda, pihak Affin Hwang AM boleh menjalankan carian-carian yang berkaitan dengan anda."),h.qc(),h.rc(68,"p"),h.qd(69,"Anda adalah berhak untuk meminta sesalinan maklumat peribadi anda yang dipegang oleh Affin Hwang AM yang berkaitan secara langsung atau secara tidak langsung kepada anda atau transaksi anda (yang mana Affin Hwang AM boleh mengenakan sedikit fi) dan untuk membetulkan sebarang maklumat yang tidak tepat tersebut"),h.qc(),h.rc(70,"p"),h.qd(71," Anda adalah dikehendaki untuk memberikan maklumat seperti yang diminta dalam permohonan ini untuk diproses oleh atau bagi pihak Affin Hwang AM seperti dinyatakan di atas. Jika anda tidak bersetuju untuk memberikan Maklumat kepada Affin Hwang AM selaras dengan notis ini, Affin Hwang AM tidak dapat memberikan perkhidmatan kepad
1a anda. Jika anda mempunyai apa-apa pertanyaan atau aduan-aduan, anda boleh menghubungi Affin Hwang AM melalui telefon di 03-2116 6000 atau melalui emel di "),h.rc(72,"a",3),h.qd(73,"[email protected]"),h.qc(),h.qc(),h.rc(74,"p"),h.qd(75,"Bagi memastikan kami mengikut arahan-arahan anda dengan betul dan bagi memperbaiki khidmat kami kepada anda melalui latihan kakitangan kami, Affin Hwang AM akan memantau atau merekod semua komunikasi."),h.qc(),h.rc(76,"p"),h.qd(77,"Jika anda adalah sebuah syarikat yang membekalkan data peribadi pengarah, pemegang saham dan / atau pegawai anda kepada kami, sila pastikan anda telah mendapat persetujuan mereka dan membawa Notis Privasi ini kepada perhatian pengarah, pemegang saham dan/atau pegawai anda yang data peribadinya dibekalkan / telah dibekalkan kepada kami."),h.qc(),h.rc(78,"div"),h.rc(79,"ol",5),h.rc(80,"li"),h.qd(81,"I / We hereby consent, permit and authorise Affin Hwang AM, and its employees, agents and authorised officers: "),h.rc(82,"ol"),h.rc(83,"li"),h.qd(84,'To have access to and / or to obtain and / or to extract any information and or documents whatsoever and however described relating to me / us ("Customer Information") from any source whatsoever;'),h.qc(),h.rc(85,"li"),h.qd(86,"To carry out the necessary checks for compliance with anti-money laundering laws, at Affin Hwang AM's sole discretion without further reference to me / us; and"),h.qc(),h.rc(87,"li"),h.qd(88,"To maintain and update records my investments with Affin Hwang AM and disclosing all or any of information on my / our investments to person(s) authorised by me / us in writing."),h.qc(),h.qc(),h.qc(),h.rc(89,"li"),h.qd(90,"I / We hereby irrevocably consent, permit and authorise Affin Hwang AM to provide information about me / us and / or my / our account, including but not limited to the type of investments, transactions and balance to: "),h.rc(91,"ol"),h.rc(92,"li"),h.qd(93,'The subsidiaries, holding companies, related corporations and associates (the term "related corporations" is as defined in the Companies Act 2016 or the equivalent legislation in a foreign jurisdiction) of the Company in and outside of Malaysia (collectively the "Interested Parties" and each an "Interested Party") whether present or future notwithstanding that an Interested Party\'s principal place of business may be outside of Malaysia;'),h.qc(),h.rc(94,"li"),h.qd(95,"Affin Hwang AM's officers and employees (for accounting and other purposes, including marketing further services to me);"),h.qc(),h.rc(96,"li"),h.qd(97,"Bank Negara Malaysia, Securities Commission, Bursa Malaysia Securities Berhad, clearing house and other regulatory bodies, as and when required."),h.qc(),h.qc(),h.qc(),h.rc(98,"li"),h.qd(99,"I / We hereby acknowledge and agree that such information may be processed by Affin Hwang AM or on its behalf by third party service providers."),h.qc(),h.rc(100,"li"),h.qd(101,"I / We hereby agree that neither Affin Hwang AM nor its employees or authorised officers or agents will be responsible for the accuracy, correctness, completeness, timeliness or sequence of my / our account balance, nor are they liable for any delays in delivering my account balance or any part thereof to me / us."),h.qc(),h.qc(),h.rc(102,"p"),h.qd(103,"\xa0"),h.qc(),h.rc(104,"p"),h.qd(105,"I / We have read and clearly understood the terms and notices in relation to the protection of personal data above and hereby inscribe my / our signature as an attestation of my / our agreement and acknowledgement of the above terms and notice."),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("title","Affin-Hwang-Capital")("show",t.show)},directives:[G.a],styles:[""]}),e})(),qe=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-annexure-mykenanga"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:219,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],["href","http://www.bursamalaysia.com"],["href","mailto:[email protected]"],[1,"font-weight-bold"],["href","https://www.ppa.my"],["href","http://www.ppa.my/ppa/member-services/prs-transactions/"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"div"),h.rc(2,"p"),h.qd(3,"At Kenanga Group (consists of Kenanga Investment Bank Berhad and its group of companies including subsidiaries and related companies), we respect your Personal Data and strive to ensure that your Personal Data is protected in accordance with the laws of Malaysia. The security of your Personal Data is important to us and we shall maintain appropriate physical, technical and organizational measures needed to ensure the security and confidentiality of your Personal Data."),h.qc(),h.rc(4,"p"),h.qd(5,"We may store and process your Personal Data on our computers wherever located and in any other medium. We may retain your Personal Data up to the maximum period permitted for legitimate business purposes, legal, regulatory and internal requirements. We may, over time, delete these records if they are no longer necessary or permissible by law."),h.qc(),h.rc(6,"p"),h.qd(7,'Some pages on our website may include links to third party websites. These sites are governed by their own privacy statements and we are not responsible for their privacy practices, operations and contents of the said links. You are advised to review the privacy statements of these sites before furnishing any information. Please remember that internet communications are not secure. We cannot accept any responsibility for unauthorised access by a third party and/or the corruption of information/data being sent by any individuals to us via internet communications or electronic mail. Kenanga Group will collect process and use your Personal Data in accordance with this Personal Data Protection Notice ("PDP Notice"). This PDP Notice describes the type of Personal Data we collect and how we
1collect it, how such Personal Data is used, the parties that we disclose the Personal Data to, the choices we and your rights over your Personal Data including how to access and update your Personal Data.'),h.qc(),h.rc(8,"p"),h.qd(9,"Types of data and information we collect"),h.qc(),h.rc(10,"p"),h.qd(11,'We collect and process your personal data and information including but not limited to, information to establish your identity and background (including your images), contact details, financial data, creditworthiness information, audio recordings and other information that you provide when you apply for any of our products and/or services ("Personal Data"). We may obtain these Personal Data from yourself or from variety of sources, including when you apply for any of our products and services, through your relationship with us from any analysis of the way you use and manage your account/facility with us, from recordings of Closed Circuit Television (CCTV) installed at our premises, from third parties or other sources in respect of which you have given your consent to disclose the Personal Data and/or where not otherwise restricted.'),h.qc(),h.rc(12,"p"),h.qd(13,"Use and Disclosure of Personal Data"),h.qc(),h.rc(14,"p"),h.qd(15,'We may use, process and/or disclose your Personal Data for the following purposes in and/or outside Malaysia ("Purpose") :-'),h.qc(),h.rc(16,"ul"),h.rc(17,"li"),h.qd(18,"to assess and process your applications for our products and/or services;"),h.qc(),h.rc(19,"li"),h.qd(20,"to manage and maintain your accounts/facilities with us;"),h.qc(),h.rc(21,"li"),h.qd(22,"to conduct credit checks and assisting other financial institutions to conduct credit checks;"),h.qc(),h.rc(23,"li"),h.qd(24,"to evaluate your financial needs;"),h.qc(),h.rc(25,"li"),h.qd(26,"for crime or fraud detection, investigation, prevention and prosecution;"),h.qc(),h.rc(27,"li"),h.qd(28,"to respond to the requirements of a civil or criminal legal process and/or as required by law or regulation and/or for regulatory compliance purpose;"),h.qc(),h.rc(29,"li"),h.qd(30,"for debt collection and enforcement of your obligations to us;"),h.qc(),h.rc(31,"li"),h.qd(32,"for market research and statistical analysis and surveys with the aim of improving our products and services;"),h.qc(),h.rc(33,"li"),h.qd(34,"to provide you with information on our and third party products and services which may be of interest to you;"),h.qc(),h.rc(35,"li"),h.qd(36,"to compare information/data for accuracy of our record, and verify with third parties;"),h.qc(),h.rc(37,"li"),h.qd(38,"to research, design and improve our products and services, operational and business processes;"),h.qc(),h.rc(39,"li"),h.qd(40,"to support our business, financial and risk monitoring, planning and decision making;"),h.qc(),h.rc(41,"li"),h.qd(42,"to handle complaints and queries;"),h.qc(),h.rc(43,"li"),h.qd(44,"for audit, compliance and risk management;"),h.qc(),h.rc(45,"li"),h.qd(46,"to transfer or assign our rights and duties under any governing terms and conditions between us and yourself;"),h.qc(),h.rc(47,"li"),h.qd(48,"to perform shared services within Kenanga Group;"),h.qc(),h.rc(49,"li"),h.qd(50,"for the outsourcing of business and back room operations of Kenanga Group;"),h.qc(),h.rc(51,"li"),h.qd(52,"to transfer your Personal Data to foreign jurisdictions to enable any cross border transactions, for the performance of a contract, for the purposes of legal proceedings, upon written request from a foreign regulatory or government authority or body, to protect your vital interest or where it is in the public interest to do so; and/or"),h.qc(),h.rc(53,"li"),h.qd(54,"for any other purposes that is required or permitted by any law, regulation, order and/or guidelines."),h.qc(),h.rc(55,"li"),h.qd(56,"for security reasons in particular Personal Data collected from CCTVs installed at our premises or any other security surveillance systems;"),h.qc(),h.rc(57,"li"),h.qd(58,"It is possible that in the future we could merge with, or be acquired by, another company. If such an acquisition occurs, you consent to the successor company having access to your Personal Data maintained by us, including account information, and such successor company would continue to be bound by this PDP Notice unless and until it is amended."),h.qc(),h.rc(59,"li"),h.qd(60,'You may have provided personal and financial information relating to others (including but not limited to joint applicant, spouse, related parties and/or emergency contact persons) for the Purpose. In such cases, you represent and warrant that you have their consent or are otherwise entitled to provide their information to us to be used, processed and/or disclosed in accordance with this PDP Notice. Where your Personal Data has been provided to Bursa entity (which shall include Bursa Malaysia Berhad, Burs
1a Malaysia Securities Berhad, Bursa Malaysia Securities Clearing Sdn Bhd, Bursa Malaysia Depository Sdn Bhd, Bursa Malaysia Derivatives Clearing Berhad, and Bursa Malaysia Derivatives Berhad) (collectively, "Bursa") for any of the Purpose, including any legal and regulatory purposes, you hereby agree for the processing of your Personal Data by Bursa in accordance with the terms of the Bursa\'s personal data notice as provided under '),h.rc(61,"a",1),h.qd(62,"www.bursamalaysia.com"),h.qc(),h.qc(),h.qc(),h.rc(63,"p"),h.qd(64,"Disclosure of your Personal Data"),h.qc(),h.rc(65,"p"),h.qd(66,"Your Personal Data held by us shall be kept confidential. However, in order to provide you with effective and continuous products and services and subject at all times to any laws, regulations and guidelines, we may need to disclose your Personal Data to the following parties:"),h.qc(),h.rc(67,"ul"),h.rc(68,"li"),h.qd(69,"the other entitles within Kenanga Group, and its agents, affiliates and associates;"),h.qc(),h.rc(70,"li"),h.qd(71,"professional advisers, contractors, service providers, debt collection agencies and our other agents with whom we have contractual agreements for some of our functions and services"),h.qc(),h.rc(72,"li"),h.qd(73,"credit reference agencies, rating agencies, insurers or insurance brokers;"),h.qc(),h.rc(74,"li"),h.qd(75,"financial service providers in relation to the products and services that you have with us;"),h.qc(),h.rc(76,"li"),h.qd(77,"any actual or potential participants or assignee or transferee of our rights and/or obligations under any transaction between us and you;"),h.qc(),h.rc(78,"li"),h.qd(79,"any guarantor or security provider for the products and/or services granted by us to you;"),h.qc(),h.rc(80,"li"),h.qd(81,"any authorities or regulators, including foreign regulators for the performance of their functions, or any party as required by any law or any overnment, quasi-government, administrative, court or tribunal;"),h.qc(),h.rc(82,"li"),h.qd(83,"strategic/business partners with whom Kenaga Group have a relationship with for specific products and services;"),h.qc(),h.rc(84,"li"),h.qd(85,"any person connected to the enforcement or preservation of any of our rights under your agreements with us; and/or"),h.qc(),h.rc(86,"li"),h.qd(87,"any party authorized and/or consented to by you."),h.qc(),h.qc(),h.rc(88,"p"),h.qd(89,"Marketing Communications"),h.qc(),h.rc(90,"p"),h.qd(91,"We may also use your Personal Data to market Kenanga Group's products and services and to deliver targeted marketing and advertising, service updates, promotional offers and for the purposes of cross-selling within Kenanga Group. As such you may receive marketing communications from us or Kenanga Group for direct marketing and cross-selling marketing activities. For the purposes of direct marketing, your Personal Data would or may be disclosed to third parties which would include merchants and strategic business partners of Kenanga Group. You may tell us at any time if you do not wish to receive marketing communications from us by writing to us, providing your full name, NRIC/Passport number (as applicable) and account details and details of any products or services you may have with us"),h.qc(),h.rc(92,"p"),h.qd(93,"Access to Information"),h.qc(),h.rc(94,"p"),h.qd(95,"You are entitled to review the Personal Data that we may have collected about you and request correction of the Personal Data. Should you wish to exercise this right please write to our Data Officer setting out the details of your request and your name and NRIC/Passport number. A fee may be charged for this service. We shall correct or update the information/data as soon as possible. The Data Officer may request information or documents from you to verify the authenticity of the person making the request and any information relating to the corrections requested"),h.qc(),h.rc(96,"p"),h.qd(97,"Options On Disclosure"),h.qc(),h.rc(98,"p"),h.qd(99," We allow you the opportunity to remove yourself and any information about you (save for information which is necessarily retained by us to comply with legal or regulatory requirements) from our database or require us to cease processing all or part of your Personal Data by submitting a written notification addressed to our Data Officer. We will require a reasonable amount of time to process such notices. However, in such an event, we reserves the right to take the necessary actions if we feel that such removal or cessation would not allow us to provide our products and services or fulfill our obligations in a satisfactory manner. "),h.mc(100,"br"),h.qd(101," Where you have failed or refused or deemed to have failed or refused to provide us with any data, information or answers as requested, then you will also be taken as having acknowledged (and we will be regarded as materially relying on you having acknowledged) that we cannot identify with any certainty your Personal Data or information and you agree that we shall be entitled to refuse to provide or cease providing any facilities, products or our services to you. "),h.qc(),h.rc(102,"p"),h.qd(103,"E-Service"),h.qc(),h.rc(104,"p"),h.qd(105,"You hereby consent to the transmission by electronic means of your Personal Data through our E-Services, such consent shall be effective at all times that you access and/or use the E-Services"),h.qc(),h.rc(106,"p"),h.qd(107,"Enquiries and Complaints"),h.qc(),h.rc(108,"p"),h.qd(109," Any queries, requests, concerns or complaints regarding the use of your Personal Data, removal from any of the mailing lists or any matter herein may be raised to the following contact:- "),h.mc(110,"br"),h.qd(111," Data Officer "),h.mc(112,"br"),h.qd(113," Kenanga Investors Berhad, "),h.mc(114,"br"),h.qd(115," Level 14, Kenanga Tower,"),h.mc(116,"br"),h.qd(117," 237, Jalan Tun Razak,"),h.mc(118,"br"),h.qd(119," 50400 Kuala Lumpur, Malaysia."),h.mc(120,"br"),h.qd(121," Toll Free : 1-800-88-3737"),h.mc(122,"br"),h.qd(123," Email: "),h.rc(124,"a",2),h.qd(125,"[email protected]"),h.qc(),h.mc(126,"br"),h.qd(127," In applying for, using or continuing to use our services, including any other contractual relationship which you may have with us, you shall be deemed to have accepted and consented to the terms of this PDP Notice. If you do not consent to the terms herein, kindly contact us at the abovementioned contact details. "),h.qc(),h.rc(128,"p"),h.qd(129,"Changes to the PDP Notice"),h.qc(),h.rc(130,"p"),h.qd(131," We reserve the right to change the contents of this PDP Notice at any time via posting on our website. You are advised to periodically view our website for any updates or the most current version of our PDP Notice."),h.mc(132,"br"),h.qd(133,"Your continued usage of our services or continued relationship with us shall be deemed as acceptance of any updates, revisions or amendments made to our PDP Notice "),h.qc(),h.rc(134,"p"),h.qd(135,"Consent and Acknowledgement"),h.qc(),h.rc(136,"p"),h.qd(137,"By providing us with your Personal Data, you hereby consent to the use, processing, transfer and/or disclosure of your Personal Data in accordance with this PDP Notice."),h.qc(),h.mc(138,"br"),h.rc(139,"p",3),h.qd(140,"PPA TERMS AND CONDITIONS"),h.qc(),h.rc(141,"p"),h.qd(142,"The Private Pension Administrator (PPA) is a body approved under section 139C of the Capital Markets and Services Act 2007 to perform the function of record keeping, administration and customer service for members and contributors in relation to contributions made in respect of a private retirement scheme. All PRS applicants are required to open an account with the PPA and upon successful creation of the respective account, the PRS applicants are subsequently referred to as PPA members."),h.qc(),h.rc(143,"p",3),h.qd(144,"1. GENERAL"),h.qc(),h.rc(145,"p"),h.qd(146," The PPA members shall be bound by these terms and conditions, and also the terms and conditions stated in the E-Application Form and the webpage of the PPA at "),h.rc(147,"a",4),h.qd(148,"www.ppa.my"),h.qc(),h.qc(),h.rc(149,"p",3),h.qd(150,"2. ACCOUNT OPENING"),h.qc(),h.rc(151,"p"),h.qd(152," Upon receipt of information via this E-Application Form as well as other supporting documents (if any), the information contained therein will be used by the PPA for creation of account and record purposes. "),h.mc(153,"br"),h.qd(154," The PPA shall have the absolute discretion in the opening of a PPA account. "),h.mc(155,"br"),h.qd(156," All instructions and/or information given by the PPA, including those given here are binding on the Applicant. "),h.qc(),h.rc(157,"p",3),h.qd(158,"3. FEES PAYABLE TO PPA"),h.qc(),h.rc(159,"p"),h.qd(160," The PPA Fees payable to the PPA are as follows: - "),h.mc(161,"br"),h.qd(162," Account opening fee (RM10) "),h.mc(163,"br"),h.qd(164," Annual maintenance fee (RM8) (payable only when there is contribution) "),h.mc(165,"br"),h.qd(166," Administration Fees (0.04% of the fund's NAV charged to the funds by Providers) "),h.qc(),h.rc(167,"p"),h.qd(168," The above may be collected by the PRS Provider acting on behalf of the PPA. For further information on PPA fees and charges, please refer to "),h.rc(169,"a",5),h.qd(170,"http://www.ppa.my/ppa/member-services/prs-transactions/"),h.qc(),h.qc(),h.rc(171,"p",3),h.qd(172,"4. CHANGE OF CONTACT DETAILS"),h.qc(),h.rc(173,"p"),h.qd(174,"It shall be the duty of PPA members' obligation to notify the PRS Provider and PPA of any change in PPA members' address, e-mail and/or contact number immediately to ensure continuity in the receipt of communication from the PPA"),h.qc(),h.rc(175,"p",3),h.qd(176,"5. PERSONAL DATA STATEMENT"),h.qc(),h.rc(177,"p"),h.qd(178,"Personal data provided by the Member on the E-Application Form and details of transactions or dealings by Members provided from time to time thereafter may be used and/or disclosed by the PPA and/or the PPA's personnel for the following purpose: -"),h.qc(),h.rc(179,"p"),h.qd(180,"a. The use and/or disclosure of the PPA members' personal information to any party is necessary for the completion of any transaction, dealings or in connection with services that the PPA may provide to the PPA members;"),h.qc(),h.rc(181,"p"),h.qd(182,"b. If required by the applicable laws, regulations, directives, guidelines, regulatory authorities, government authorities and/or court of competent jurisdiction; and"),h.qc(),h.rc(183,"p"),h.qd(184,"c. To any PPA's delegates, service providers or any third party that the PPA may engage on the basis that the recipient would continue to maintain confidentiality of the PPA's members personal information."),h.qc(),h.rc(185,"p"),h.qd(186,"Members are also advised to read the PPA Privacy Notification."),h.qc(),h.rc(187,"p",3),h.qd(188,"6. SELF-SELECTIVE"),h.qc(),h.rc(189,"p"),h.qd(190,"Members are instructed to seek advice from the PRS Provider and/or a professional adviser when choosing to invest using self
1-selective options."),h.qc(),h.rc(191,"p",3),h.qd(192,"7. NIL BALANCE ACCOUNTS"),h.qc(),h.rc(193,"p"),h.qd(194," PPA reserves the right after 6 months of notification to the member to close a PPA account that does not reflect any balance in the PPA account due to the following reasons: -"),h.mc(195,"br"),h.qd(196," a) Full amount withdrawn (upon attaining retirement age/ permanent departure) and account has zero units for 6 months; or "),h.mc(197,"br"),h.qd(198," b) Upon release of the deceased member's funds to beneficiaries/ nominees/ next-of-kin pursuant to a Letter of Administration or Grant of Probate "),h.qc(),h.rc(199,"p",3),h.qd(200,"8. VARIATION"),h.qc(),h.rc(201,"p"),h.qd(202,"The PPA shall be entitled at any time and without prior reference to the PPA members' to add, vary or amend any or all of the terms and conditions herein and/or the PPA's website and/or the E-Application at its sole and absolute discretion."),h.qc(),h.rc(203,"p",3),h.qd(204,"PRIVACY NOTIFICATION"),h.qc(),h.rc(205,"p"),h.qd(206,'The PPA wish to assure you that we take your privacy seriously and are committed to the protection of our member\'s personal information in connection to the Personal Data Protection Act 2010 ("PDPA") which was introduced to regulate the processing of personal data in commercial transactions.'),h.qc(),h.rc(207,"p"),h.qd(208,"In line with PPA's compliance to PDPA, PPA has put in place a personal data protection and compliance principles framework in the provision of PPA services. Kindly refer to the PPA Privacy Statement at www.ppa.my for further details."),h.qc(),h.rc(209,"p"),h.qd(210,"The PPA Privacy Statement forms an integral part of the terms and conditions of the PPA account and by continuing to use the PPA account, you are accepting and consenting to your personal information being processed by PPA for the purpose and in the manner as set out in the PPA Privacy Statement."),h.qc(),h.rc(211,"p"),h.qd(212,"Your personal information was collected from the online PRS Application or E-Application Form with your Private Retirement Scheme (PRS) Provider(s) and/or processed through your PRS Provider. The accuracy of your personal information depends on the information you provide to your PRS Provider at the point of application. Kindly update both the PRS Provider and PPA as and when there are changes to your personal information which have become incorrect or out of date. "),h.qc(),h.rc(213,"p"),h.qd(214,"PPA members may receive additional informative materials for awareness and educational purposes. In relation to these materials, you may request the PPA by written notice not to forward such materials to you via (i) phone, (ii) post, (iii) e-mail or sms, or (iv) communicating to you by whatever means."),h.qc(),h.rc(215,"p"),h.qd(216,"PPA is committed to protecting the security of your personal information from unauthorized access, use or disclosure. The PPA online password is used to help protect your account and personal information. You are therefore advised to keep your PPA online password confidential. If you are sharing a computer with anyone, you are advised to log out from your account before leaving a site or service to protect access to your information by subsequent users."),h.qc(),h.rc(217,"p"),h.qd(218,"PPA will occasionally update this privacy statement to reflect changes from time to time in compliance with regulatory requirements. If there are material changes to this statement or in how PPA will use your personal information, we will notify you either by prominently posting a notice of such changes prior to implementing the change or by directly sending you a notification. We encourage you to periodically visit the PPA's website to be informed of how PPA is protecting your information."),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("title","PERSONAL DATA PROTECTION NOTICE")("show",t.show)},directives:[G.a],styles:[""]}),e})(),Te=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-annexure-myrhbim"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:67,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],[1,"font-weight-bold"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"p"),h.qd(2,'I/We understand that RHB Asset Management Sdn Bhd ("RHBAM") will use, collect, record, store, share and/or process my/
1our personal information, including, without limitation, my/our contact details, background information, financial data, tax residency and other information relevant to my/our application for the product and / or service which'),h.qc(),h.rc(3,"p"),h.qd(4,"(a) I/we have provided in this form or through any other contact with RHB Banking Group (which shall include its holding company, subsidiary(s), and any associated company(s), including any company as a result of any restructuring, merger, sale or acquisition), or"),h.qc(),h.rc(5,"p"),h.qd(6,"(b) has been obtained from analysis of my/our payment and other transactions/services within the RHB Banking Group, or"),h.qc(),h.rc(7,"p"),h.qd(8,"(c) has been obtained from third parties such as employers, joint applicants/accountholders, guarantors, legal representatives, industry/financial related associations, government/regulatory authorities, credit bureaus or credit reporting agencies, retailers, social networks and fraud prevention agencies or other organizations"),h.qc(),h.rc(9,"p"),h.qd(10,"for any and/or all of the following purposes (\u201cPurpose\u201d), if applicable:"),h.qc(),h.rc(11,"p"),h.qd(12,"(i) providing this product and/or service and notifying me/us about important changes or developments to the features;"),h.qc(),h.rc(13,"p"),h.qd(14,"(ii) updating and managing the accuracy of RHB Banking Group's records;"),h.qc(),h.rc(15,"p"),h.qd(16,"(iii) prevention, detection or prosecution of crime, and complying with legal and regulatory obligations; "),h.qc(),h.rc(17,"p"),h.qd(18,"(iv) assessment and analysis including credit / lending / insurance risks / behaviour scoring / market and product analysis and market research;"),h.qc(),h.rc(19,"p"),h.qd(20,"(v) communications and ensuring customer satisfaction, which may include conducting surveys to improve"),h.qc(),h.rc(21,"p"),h.qd(22,"(vi) determining the amount of my/our indebtedness and recovering debt that I/we owe to RHBAM;"),h.qc(),h.rc(23,"p"),h.qd(24,"(vii) maintaining my/our credit history for present and future reference;"),h.qc(),h.rc(25,"p"),h.qd(26,"(viii) enabling an actual or proposed assignee of RHBAM, or participant or sub-participant of RHBAM to evaluate my/our transactions which are intended to be the subject of the assignment, participation or sub-participation;"),h.qc(),h.rc(27,"p"),h.qd(28,"(ix) cross-selling, marketing and promotions of products and/or services of RHB Banking Group and its strategic alliances;"),h.qc(),h.rc(29,"p"),h.qd(30,"(x) for RHBAM\u2019s corporate events (including networking events, launching of products, etc) /contests, of which photographs / images of I/we may be captured and may be used for RHBAM\u2019s publications; or"),h.qc(),h.rc(31,"p"),h.qd(32,"(xi) protecting RHB Banking Group's interests and other ancillary or related purposes."),h.qc(),h.rc(33,"p"),h.qd(34,"I/We understand and acknowledge that it is necessary for RHBAM to process my/our personal information for the Purpose, without which RHBAM will not be able to provide the product/service that I/we have requested from RHBAM and to notify I/we about important changes or developments to the products/services. Where I/we have provided RHBAM with sensitive personal information (in particular, information consisting my/our physical/mental health for applications of insurance products/services), I/we hereby provide RHBAM with my/our express consent to process the same in the manner described in this Privacy Notice. I/we may exercise my/our options in respect of receiving marketing materials (including cross-selling, marketing and promotions as described above) at any time by contacting our Customer Service at 03 - 9205 8000."),h.qc(),h.rc(35,"p"),h.qd(36,"I/We understand that RHBAM may disclose my/our personal information (or sensitive personal information, if applicable) to other companies within the RHB Banking Group, service providers, merchants and strategic partners, vendors including debt collection agencies, professional advisers, industry/financial related associations, credit bureaus or credit reporting agencies and fraud prevention agencies, governmental agencies, other financial institutions and any of their respective agents, servants and/or such persons, whether located within or outside Malaysia for the Purpose, if applicable, subject at all times to any laws (including regulations, standards, guidelines and/or obligations) applicable to RHBAM. I/We further understand that I/we may request for correction (if my/our personal information is inaccurate, outdated, incomplete, etc), access to (a prescribed fee may be charged), or deleti
1on (if I/we no longer have any existing products/services with RHB Banking Group) of my/our personal information or limit the processing thereof at any time hereafter by submitting such request via post, email or fax to the following address:"),h.qc(),h.rc(37,"p",1),h.qd(38,"Customer Service"),h.mc(39,"br"),h.qd(40," RHB Asset Management Sdn Bhd"),h.mc(41,"br"),h.qd(42," Level 8, Tower 2 & 3, RHB Centre, Jalan Tun Razak, 50400 Kuala Lumpur, Malaysia"),h.mc(43,"br"),h.qd(44," Contact: +603-9205 8000"),h.mc(45,"br"),h.qd(46," Facsimile: +603-9205 8100"),h.mc(47,"br"),h.qd(48," Email: [email protected]"),h.qc(),h.rc(49,"p"),h.qd(50,"I/We acknowledge that RHB Banking Group may modify or update its Privacy Notice from time to time, a copy of which is available at www.rhbgroup.com and that I/we may channel any complaints or inquiries I/we may have in the manner indicated above."),h.qc(),h.rc(51,"u",1),h.qd(52,"ACKNOWLEDGEMENT AND CONSENT"),h.qc(),h.rc(53,"p"),h.qd(54,"\u2022 By providing my/our personal information and signature, I/we consent to RHBAM processing my/our personal information for any necessary disclosures and overseas transfers of my/our personal information to relevant third parties, for the Purpose, if applicable."),h.qc(),h.rc(55,"p"),h.qd(56,"\u2022 I/We agree to the disclosure and/or transfer of my/our personal information to relevant third parties as a result of any restructuring, sale or acquisition of any company within the RHB Banking Group, provided that the recipient uses my/our personal information for the Purpose, if applicable."),h.qc(),h.rc(57,"p"),h.qd(58,"\u2022 I/We also represent and warrant that I/we have sufficiently obtained the consent of third party individual(s) (e.g. family, spouse, related parties, supplementary cardholder and/or emergency contact persons, etc) whose personal information I/we have disclosed to RHBAM to allow RHBAM to process the same in relation to the Purpose, if applicable."),h.qc(),h.rc(59,"p",1),h.qd(60,"[This paragraph is only applicable to the authorized signatory(s)/contact person(s) of RHBAM's corporate customer(s), if any ]"),h.qc(),h.rc(61,"p"),h.qd(62,"\u2022 As the authorized signatory(s)/contact person(s) of RHBAM\u2019s corporate customer, I/we understand that personal information of the directors, individual shareholders, employees, other authorised signatories, individual guarantors, individual security providers, suppliers/vendors and/or related parties etc, may be collected and processed by RHBAM for the purpose of the commercial transactions between the corporate customer and RHBAM. I/We represent and warrant that I/we am/are entitled to provide the said personal information to RHBAM and/or the appropriate consent have been obtained to allow RHBAM to process the said personal information for the purpose."),h.qc(),h.rc(63,"p",1),h.qd(64,"[This paragraph is only applicable to parent/legal guardian/next-of-kin/authorized representative of Junior Accountholder(s), if any ]"),h.qc(),h.rc(65,"p"),h.qd(66,"\u2022 If I/we am/are providing consent as parent / legal guardian / next-of-kin / authorized representative of a junior applicant, I/we understand that the personal information of the junior applicant will be processed by RHBAM for the Purpose described above."),h.qc(),h.qc()),2&e&&h.Mc("title","RHB PRIVACY NOTICE")("show",t.show)},directives:[G.a],styles:[""]}),e})(),we=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-tnc-mycimbpri"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:298,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],["href","http://www.ppa.my"],[1,"h5"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"div"),h.rc(2,"p"),h.qd(3,"PLEASE READ THE FOLLOWING TERMS AND CONDITIONS BELOW BEFORE COMPLETING THE SUBMISSION"),h.qc(),h.rc(4,"h3"),h.rc(5,"u"),h.qd(6,"JOINT ACCOUNT OPENING FORM TERMS AND CONDITIONS"),h.qc(),h.qc(),h.rc(7,"p"),h.qd(8,"A. GENERAL TERMS AND CONDITIONS applicable to Providers and PPA (Governed by and construed in accordance with laws of Malaysia)."),h.qc(),h.rc(9,"p"),h.qd(10,"1. Account Opening "),h.qc(),h.rc(11,"p"),h.qd(12,'a) The Applicant shall be bound by these terms and conditions, the Disclosure Document, the Supplementary Disclosure Document(s) (if any) and also the terms and conditions stated in this application form and the webpage of CIMB-Principal Asset Management Berhad ("CIMB-Principal") and the Private Pension Administrator ("PPA"). For further information about the PRS Scheme or Funds with CIMB-Principal, please refer to CIMB-Principal\'s webpage at www.cimb-principal.com.my and for further information about PPA, please refer to the PPA\'s webpage at '),h.rc(13,"a",1),h.qd(14,"www.ppa.my"),h.qc(),h.qc(),h.rc(15,"p"),h.qd(16,"b) CIMB-Principal and /or PPA shall be entitled at any time and without prior reference to the Applicant to add, vary or amend any or all of the terms and conditions herein at its sole and absolute discretion."),h.qc(),h.rc(17,"p"),h.qd(18,"c) Upon submission of this form as well as other supporting documents, the information contained therein will be used by CIMB-Principal and PPA for creation of account and record purposes."),h.qc(),h.rc(19,"p"),h.qd(20,"d) CIMB-Principal and PPA shall have absolute discretion in the opening of an account."),h.qc(),h.rc(21,"p"),h.qd(22,"e) All instructions and/or information given in writing to CIMB-Principal and/or PPA, including this form are binding on the Applicant. "),h.qc(),h.mc(23,"br"),h.rc(24,"p"),h.qd(25,"2. Personal Data/Information"),h.qc(),h.rc(26,"p"),h.qd(27,"Personal data provided by the Member on the joint application form and details of transactions or dealings by Members provided from time to time thereafter may be used and/or disclosed by CIMB-Principal and/or PPA and/or its personnel for the following purpose:-"),h.qc(),h.rc(28,"p"),h.qd(29,"a) The use and/or disclosure of the PPA members' personal information to any party is necessary for the completion of any transactions, dealings or in connection with services that CIMB-Principal and/or PPA may provide to the PPA members;"),h.qc(),h.rc(30,"p"),h.qd(31,"b) If required by the applicable laws, regulations, directives, guidelines, regulatory authorities, government authorities and/or court of competent jurisdiction; and "),h.qc(),h.rc(32,"p"),h.qd(33,"c) To any CIMB-Principal and/or PPA's delegates, service providers or any third party that CIMB-Principal and/or PPA may engage on the basis that the recipient would continue to maintain confidentiality of the PPA's members personal information. "),h.qc(),h.rc(34,"p"),h.qd(35,"d) Members are also advise to read the PPA Privacy Notification."),h.qc(),h.rc(36,"p"),h.qd(37,"\xa0"),h.qc(),h.rc(38,"p"),h.qd(39,"3. Change of Contact Details"),h.qc(),h.rc(40,"p"),h.qd(41,"It shall be the PPA members' obligation to notify the PRS Provider and PPA of any change in PPA members' address, e-mail or contact number immediately to ensure continuity in the receipt of communication from CIMB-Principal and PPA."),h.qc(),h.rc(42,"p"),h.qd(43,"\xa0"),h.qc(),h.rc(44,"p"),h.qd(45,"4. Anti-Money Laundering"),h.qc(),h.rc(46,"p"),h.qd(47,"The Applicant hereby warrants that:-"),h.qc(),h.rc(48,"p"),h.qd(49,"a) No person other than the applicant has or will have any interest in the account (where applicable);
1 and"),h.qc(),h.rc(50,"p"),h.qd(51,"b) All monies as may be paid to CIMB-Principal and/or PPA from time to time shall come from legitimate (and not illegal) source;"),h.qc(),h.rc(52,"p"),h.qd(53,"c) The Applicant agrees to provide such information and documents as may be necessary to verify the Applicant's identity and do all such acts and things as may be necessary to enable CIMB-Principal and/or PPA to comply with all applicable anti-money laundering and counter financing terrorism (AML/CFT) and the governing law, rules and regulations (whether in Malaysia or elsewhere). The Applicant agrees that CIMB-Principal and/or PPA shall not be liable or responsible in anyway whatsoever and shall be held harmless against any loss arising as a result of or in connection with any delay or failure to process any application or transaction if such information or documents requested by CIMB-Principal and/or PPA have not been promptly provided by the Applicant to CIMB-Principal and/or PPA."),h.qc(),h.rc(54,"p"),h.qd(55,"d) CIMB-Principal and/or PPA reserves the right to terminate the relationship if any documents requested pursuant to the AML/CFT requirements are not received within 14 days.\xa0"),h.qc(),h.rc(56,"p"),h.qd(57,"\xa0"),h.qc(),h.rc(58,"p"),h.qd(59,"B. PPA'S TERMS AND CONDITIONS"),h.qc(),h.rc(60,"p"),h.qd(61,"1. The PPA members have been informed of the fees payable to the PPA. The PPA fees payable to the PPA are as follow:-"),h.qc(),h.rc(62,"p"),h.qd(63," a) Account opening fee (RM10)"),h.qc(),h.rc(64,"p"),h.qd(65," b) Annual maintenance fee (RM8) (payable only when there is contribution)"),h.qc(),h.rc(66,"p"),h.qd(67," c) Administration fee of 0.04% of the Fund's NAV charged to the funds by Provider"),h.qc(),h.rc(68,"p"),h.qd(69,"The above may be collected by the PRS Provider acting on behalf of the PPA. For further information on the PPA's fees and charges, please refer to http://www.ppa.my/ppa/member-services/prs-transactions/"),h.qc(),h.rc(70,"p"),h.qd(71,"2. PPA reserves the right after 6 months of notification to the member to close a PPA account that does not reflect any balance in the PPA account due to the following reasons: -"),h.qc(),h.rc(72,"p"),h.qd(73,"a) Full amount withdrawn (upon attaining retirement age)/ permanent departure and account has zero units for 6 months; or"),h.qc(),h.rc(74,"p"),h.qd(75,"b) Upon release of the deceased member's funds to beneficiaries/ nominees/ next-of-kin pursuant to a Letter of Administration or Grant of Probate."),h.qc(),h.rc(76,"p"),h.qd(77,"\xa0"),h.qc(),h.rc(78,"p"),h.qd(79,"3. Variation"),h.qc(),h.rc(80,"p"),h.qd(81,"The PPA shall be entitled at any time and without prior reference to the PPA members' to add, vary or amend any or all of the terms and conditions herein and/or the PPA's website and/or the joint application form at its sole and absolute discretion."),h.qc(),h.rc(82,"p"),h.qd(83,"\xa0"),h.qc(),h.rc(84,"p"),h.qd(85,"C. CIMB-PRINCIPAL'S TERM AND CONDITIONS"),h.qc(),h.rc(86,"p"),h.qd(87,"1. Applicant"),h.qc(),h.rc(88,"p"),h.qd(89,"The Applicant warrants that they have the capacity, power and all necessary authorization under the laws of the jurisdiction to which it applies in the Fund(s)/Scheme(s) under such laws. Applicant must be 18 years old and above and not be an undischarged bankrupt at the date of application. Applications must be accompanied by a copy of the Applicant's identity card/passport and/or such other documents as CIMB- Principal may require from time to time."),h.qc(),h.rc(90,"p"),h.qd(91,"\xa0"),h.qc(),h.rc(92,"p"),h.qd(93,"2. Rights of Provider"),h.qc(),h.rc(94,"p"),h.qd(95,"a) CIMB-Principal reserves the right to accept or reject any application in whole or in part thereof without assigning any reason in respect thereof, without compensation to the Applicant and the duly completed application form received by CIMB-Principal is deemed irrevocable by the Applicant. "),h.qc(),h.rc(96,"p"),h.qd(97,"b) Notwithstanding anything contained herein, CIMB-Principal shall be at liberty to disregard or refuse to carry out any of the Applicant's instruction if the carrying out of such instructions, would be in contravention of any existing laws or regulatory requirements, whether or not having the force of law and/or would or may expose CIMB-Principal to any liability or risk (whether valid or otherwise)."),h.qc(),h.rc(98,"p"),h.qd(99,"\xa0"),h.qc(),h.rc(100,"p"),h.qd(101,"3. Instructions/Voice Recordings"),h.qc(),h.rc(102,"p"),h.qd(103,"a) All instructions given by the Applicant or its authorized representative either verbally or in writing, by facsimile transmission or such other permitted means of communication as notified by CIMB-Principal from time to time arising out of and/or in connection with the Applicants account held with CIMB-Principal, shall be binding on the Applicant. CIMB-Principal shall have no obligation to verify the authenticity of any such instructions or the identity of any person giving such instructions. "),h.qc(),h.rc(104,"p"),h.qd(105,"b) The Applicant must submit a written request to CIMB-Principal to change their personal records and details. CIMB-Principal shall have the right to request any other documents or evidence before acting on any such change. In view of conflicting information on personal record and/
1or details, CIMB-Principal will only rely upon the personal record and/or details as provided in this form for all future transactions unless notified via a written request by the Applicant of a change of address and/or any other personal record/details."),h.qc(),h.rc(106,"p"),h.qd(107,"c) Any instruction or communication given to CIMB-Principal shall only take effect upon actual receipt by CIMB-Principal and during the normal working hours of CIMB-Principal. "),h.qc(),h.rc(108,"p"),h.qd(109,"d) CIMB-Principal shall be entitled to use voice recording devices to record telephone instructions communicated to it and such recording(s) may constitute evidence of the instructions."),h.qc(),h.rc(110,"p"),h.qd(111,"\xa0"),h.qc(),h.rc(112,"p"),h.qd(113,"4. Fees, Charges and Expenses"),h.qc(),h.rc(114,"p"),h.qd(115,"a) The Applicant shall be responsible for the payment of any charges, fees, costs, expenses and other liabilities properly payable or incurred by CIMB-Principal and in holding or executing transaction in respect to any contribution to the PRS Scheme."),h.qc(),h.rc(116,"p"),h.qd(117,"b) CIMB-Principal shall not be liable to pay any profit to the Applicant for any monies held by CIMB-Principal for the Applicant for any reason whatsoever."),h.qc(),h.rc(118,"p"),h.qd(119,"\xa0"),h.qc(),h.rc(120,"p"),h.qd(121,"5. Authorised PRS Consultant"),h.qc(),h.rc(122,"p"),h.qd(123,"a)\xa0The Applicant should check that the PRS Consultant has a VALID authorization and registration card. All authorised PRS Consultants are registered with Federation of Investment Managers Malaysia (FiMM). For more information, please visit www.fimm.com.my "),h.qc(),h.rc(124,"p"),h.qd(125,"b) If a PRS Consultant is named in this Form, CIMB-Principal is entitled to process any instructions received from such PRS Consultant without further reference to the Applicant unless CIMB-Principal has received prior written instructions to the contrary from the Applicant. "),h.qc(),h.rc(126,"p"),h.qd(127,"c) CIMB-Principal shall not be responsible for any action or omission on the part of the PRS Consultant and shall be under no obligation to verify the authenticity of the instructions received or to determine whether or not such instructions were authorized. The Applicant shall have no right of action against CIMB-Principal in connection with the execution by CIMB-Principal of such instructions and undertakes not to make any claim against CIMB-Principal in connection thereof."),h.qc(),h.rc(128,"p"),h.qd(129,"\xa0"),h.qc(),h.rc(130,"p"),h.qd(131,"6. Notices"),h.qc(),h.rc(132,"p"),h.qd(133,"a) Any instruction or communication to be given by the Applicant to CIMB-Principal shall be in writing and sent to such address or any other alternative method as may be notified by CIMB-Principal from time to time to the Applicant and shall take effect upon actual receipt by CIMB-Principal and during the normal working hours of CIMB-Principal."),h.qc(),h.rc(134,"p"),h.qd(135,"b) All written communication from CIMB-Principal to the Applicant shall be sent to the last address notified or any other method prescribed and agreed to by the Applicant for the delivery of notices."),h.qc(),h.rc(136,"p"),h.qd(137,"\xa0"),h.qc(),h.rc(138,"p"),h.qd(139,"7. Statements "),h.qc(),h.rc(140,"p"),h.qd(141,"These shall be sent at the risk of the Applicant to the Applicant's address or any other method prescribed and agreed to by the Applicant for the delivery of statements.\xa0 If the Applicant fails to notify CIMB-Principal in writing of any errors in the statements within 14 days from date of statement, the Applicant shall be deemed to have waived any right to raise any objection or to pursue any remedies against CIMB-Principal or the Trustee.\xa0 "),h.qc(),h.rc(142,"p"),h.qd(143,"\xa0"),h.qc(),h.rc(144,"p"),h.qd(145,"8. Set Off"),h.qc(),h.rc(146,"p"),h.qd(147,"CIMB-Principal is entitled to set off any monies due to the Applicant in relation to the account against any debts or liabilities due and/or owing by the Applicant to CIMB-Principal from time to time."),h.qc(),h.rc(148,"p"),h.qd(149,"\xa0"),h.qc(),h.rc(150,"p"),h.qd(151,"9. Online Access"),h.qc(),h.rc(152,"p"),h.qd(153,"Applicant will be provided with access to an Online Member website upon execution of this form. Applicant will be provided with all relevant information to access an online member account and this will be sent to the mailing address provided on this form. Applicant agrees to receive online statement unless a request is made for printed statement."),h.qc(),h.rc(154,"p"),h.qd(155,"\xa0"),h.qc(),h.rc(156,"p"),h.qd(157,"10. Liability"),h.qc(),h.rc(158,"p"),h.qd(159,"Neither CIMB-Principal nor any of its PRS consultant shall be liable for any direct, indirect, special or consequential damages which may be suffered and/or to be suffered by the Applicant, such as, but not limited to, loss of anticipated profits or other anticipated economic benefits, whatsoever or howsoever caused, whether in contract or in tort (which includes but is not limited to negligence), arising directly or indirectly in connection with or arising out of this Application and these terms and conditions. "),h.qc(),h.rc(160,"p"),h.qd(161,"\xa0"),h.qc(),h.rc(162,"p"),h.qd(163,"11. Indemnity"),h.qc(),h.rc(164,"p"),h.qd(165,"The Applicant hereby agrees to indemnify C
1IMB-Principal against all claims by third parties which may be made against CIMB-Principal in connection with this Application and these terms and conditions."),h.qc(),h.rc(166,"p"),h.qd(167,"\xa0"),h.qc(),h.rc(168,"p"),h.qd(169,"12. Severability"),h.qc(),h.rc(170,"p"),h.qd(171,"Each of the provisions contained herein is severable and distinct from the others and if at any time one or more of such provisions is or becomes invalid, void and/or illegal the enforceability of the remaining provisions hereof shall not in any way be affected or impaired thereby."),h.qc(),h.rc(172,"p"),h.qd(173,"\xa0"),h.qc(),h.rc(174,"p"),h.qd(175,"13. Successors Bound"),h.qc(),h.rc(176,"p"),h.qd(177,"The form shall be binding upon the heirs, personal representatives, successors in title and permitted assigns of the Applicant."),h.qc(),h.rc(178,"p"),h.qd(179,"\xa0"),h.qc(),h.rc(180,"p"),h.qd(181,"14. Applicable Law"),h.qc(),h.rc(182,"p"),h.qd(183,"These terms and conditions shall be governed by and construed in accordance with the Laws of Malaysia.\xa0"),h.qc(),h.rc(184,"p"),h.qd(185,"\xa0"),h.qc(),h.rc(186,"p"),h.qd(187,"15. Declaration by PRS Consultant"),h.qc(),h.rc(188,"p"),h.qd(189,"a) I agree to abide by all relevant policies of CIMB-Principal and applicable laws including amendments as may be in force from time to time."),h.qc(),h.rc(190,"p"),h.qd(191,"b) I hereby confirm that I have sighted the original personal identity documents (i.e. either NRIC or Passport) of the Applicant and I have satisfactorily completed the verification of the identity of the Applicant and the name, address, contact numbers, occupation and/or nature of business shown on this application correspond with my records, and agree to make such relevant documentation available to you on request."),h.qc(),h.rc(192,"p"),h.qd(193,"c) I hereby confirm that I witnessed the signature of the Applicant and I confirm that the particulars of the Applicant stated herein to be true and correct. You are required to satisfactorily verify the identity and address of the Applicant and have adequate records to demonstrate that fact under the local Anti-Money Laundering and Anti-Terrorism Financing Laws, Guidelines and/or Regulations. You should ensure that the names and address of the Applicant are accurate and complete and in accordance with the relevant records."),h.qc(),h.rc(194,"p"),h.qd(195,"Occupation codes"),h.qc(),h.rc(196,"p"),h.qd(197,"\xa0"),h.qc(),h.rc(198,"p"),h.qd(199,"Nature of occupation codes"),h.qc(),h.rc(200,"p"),h.qd(201,"\xa0"),h.qc(),h.rc(202,"p"),h.rc(203,"u"),h.qd(204,"CONTRIBUTION TERMS AND CONDITIONS"),h.qc(),h.qc(),h.rc(205,"p"),h.qd(206,"1. CONTRIBUTION"),h.qc(),h.rc(207,"p"),h.qd(208,"1.1 Cheques/bank draft for contribution must be made payable to CIMB-PAM PRS FOR <NAME OF APPLICANT AS PER IDENTIFICATION DOCUMENT>. \xa0At the back of the cheque/bank draft, please write your full name, new NRIC number/passport and telephone number."),h.qc(),h.rc(209,"p"),h.qd(210,"1.2 No physical CASH shall be accepted as payment for PRS contribution via PRS Consultants."),h.qc(),h.rc(211,"p"),h.qd(212,'1.3 Without prejudice to the generality of the foregoing, all PRS Consultants of CIMB-Principal Asset Management Berhad ("CIMB-Principal") are prohibited from receiving from any party monies for PRS contributions (whether by way of cash or cheque or any other instrument made out in favour of the PRS Consultant) for their onward transmission to CIMB-Principal and in the event that the Applicant does hand over such monies to the PRS Consultants of CIMB-Principal, such PRS consultants shall for the purposes of such transmission of monies to CIMB-Principal, be the Applicant\'s consultant and not CIMB-Principal and CIMB-Principal shall not be liable for any loss whatsoever occasioned to the Applicant or any other person as a result of the Applicant handing over such monies to the said PRS Consultants. CIMB-Principal is under no obligation to accept payments for PRS contribution via PRS Consultants of CIMB-Principal or any third party and may at its sole and absolute discretion reject any such payments. \xa0'),h.qc(),h.rc(213,"p"),h.qd(214,"1.4 For other CIMB-Principal authorised distribution channels, please direct your enquiries on contribution methods with the respective sales representative."),h.qc(),h.rc(215,"p"),h.qd(216,"\xa0"),h.qc(),h.rc(217,"p"),h.qd(218,"2. RIGHTS OF PROVIDER\xa0"),h.qc(),h.rc(219,"p"),h.qd(220,"2.1 CIMB-Principal reserves the right to accept or reject any application in whole or in part thereof without assigning any reason in respect thereof, without compensation to the Applicant and the duly completed application form received by CIMB-Principal is deemed irrevocable by the Applicant. "),h.qc(),h.rc(221,"p"),h.qd(222,"2.2 Notwithstanding anything contained herein, CIMB-Principal shall be at liberty to disregard or refuse to carry out any of the Applicant's instruction if the carrying out of such instructions, would be in contravention of any existing laws or regulatory requirements, whether or not having the force of law and/or would or may expose CIMB-Principal to any liability or risk (whether valid or otherwise)."),h.qc(),h.rc(223,"p"),h.qd(224,"\xa0"),h.qc(),h.rc(225,"p"),h.qd(226,"3. FEES, CHARGES AND EXPENSES"),h.qc(),h.rc(227,"p"),h.qd(228,"3.1 The Applicant shall be responsible for the payment of any charges, fees, costs, expenses and other liabilities properly payable or incurred by CIMB-Principal and in holding or executing transaction in respect to any contribution to the PRS Scheme."),h.qc(),h.rc(229,"p"),h.qd(230,"3.2 CIMB-Principal shall not be liable to pay any profit to the Applicant for any monies held by CIMB-Principal for the Applicant for any reason whatsoever."),h.qc(),h.rc(231,"p"),h.qd(232,"\xa0"),h.qc(),h.rc(233,"p"),h.qd(234,"4. AUTHORISED PRS CONSULTANTS"),h.qc(),h.rc(235,"p"),h.qd(236,"4.1 The Applicant should check that the PRS Consultant has a VALID authorization and registration card. All authorised PRS Consultants are registered with Federation of Investment Managers Malaysia (FiMM). For more information, please visit www.fimm.com.my. "),h.qc(),h.rc(237,"p"),h.qd(238,"4.2 If a PRS Consultant is named in this Form, CIMB-Principal is entitled to process any instructions received from such PRS Consultant without further reference to the Applicant unless CIMB-Principal has received prior written instructions to the contrary from the Applicant. "),h.qc(),h.rc(239,"p"),h.qd(240,"4.3 CIMB-Principal shall not be responsible for any action or omission on the part of the PRS Consultant and shall be under no obligation to verify the authenticity of the instructions received or to determine whether or not such instructions were authorized. The Applicant shall have no right of action against CIMB-Principal in connection with the execution by CIMB-Principal of such instructions and undertakes not to make any claim against CIMB-Principal in connection thereof."),h.qc(),h.rc(241,"p"),h.qd(242,"\xa0"),h.qc(),h.rc(243,"p"),h.qd(244,"5. STATEMENTS "),h.qc(),h.rc(245,"p"),h.qd(246,"5.1 These shall be sent at the risk of the\nApplicant to the Applicant's address or any other method prescribed and agreed\nto by the Applicant for the delivery of statements. If the Applicant fails to notify\nCIMB-Principal in writing of any errors in the statements within 14 days from\nthe date of statement, the Applicant shall be deemed to have waived any right\nto raise any objection or to pursue any remedies against CIMB-Principal or the\nTrustee. "),h.qc(),h.rc(247,"p"),h.qd(248,"\xa0"),h.qc(),h.rc(249,"p"),h.qd(250,"6. SET-OFF"),h.qc(),h.rc(251,"p"),h.qd(252,"6.1 CIMB-Principal is entitled to set off any monies due to the Applicant in relation to the account against any debts or liabilities due and/or owing by the Applicant to CIMB-Principal from time to time."),h.qc(),h.rc(253,"p"),h.qd(254,"\xa0"),h.qc(),h.rc(255,"p"),h.qd(256,"7. LIABILITY"),h.qc(),h.rc(257,"p"),h.qd(258,"7.1 Neither CIMB-Principal nor any of its PRS consultants shall be liable for any direct, indirect, special or consequential damages which may be suffered and/or to be suffered by the Applicant, such as, but not limited to, loss of anticipated profits or other anticipated economic benefits, whatsoever or howsoever caused, whether in contract or in tort (which includes but is not limited to negligence), arising directly or indirectly in connection with or arising out of this Application and these terms and conditions. "),h.qc(),h.rc(259,"p"),h.qd(260,"\xa0"),h.qc(),h.rc(261,"p"),h.qd(262,"8. INDEMNITY"),h.qc(),h.rc(263,"p"),h.qd(264,"8.1 The Applicant hereby agrees to indemnify C
1IMB-Principal against all claims by third parties which may be made against CIMB-Principal in connection with this Application and these terms and conditions and other terms and conditions relevant to this investment."),h.qc(),h.rc(265,"p"),h.qd(266,"\xa0"),h.qc(),h.rc(267,"p"),h.qd(268,"9. SEVERABILITY"),h.qc(),h.rc(269,"p"),h.qd(270,"9.1 Each of the provisions contained herein is severable and distinct from the others and if at any time one or more of such provisions is or becomes invalid, void and/or illegal the enforceability of the remaining provisions hereof shall not in any way be affected or impaired thereby."),h.qc(),h.rc(271,"p"),h.qd(272,"\xa0"),h.qc(),h.rc(273,"p"),h.qd(274,"10. SUCCESSORS BOUND"),h.qc(),h.rc(275,"p"),h.qd(276,"10.1 The form shall be binding upon the heirs, personal representatives, successors in title and permitted assigns of the Applicant."),h.qc(),h.rc(277,"p"),h.qd(278,"\xa0"),h.qc(),h.rc(279,"p"),h.qd(280,"11. APPLICABLE LAW"),h.qc(),h.rc(281,"p"),h.qd(282,"11.1 These terms and conditions shall be governed by and construed in accordance with the Laws of Malaysia."),h.qc(),h.rc(283,"p"),h.qd(284,"\xa0"),h.qc(),h.rc(285,"p"),h.qd(286,"12. DECLARATION BY PRS CONSULTANT"),h.qc(),h.rc(287,"p"),h.qd(288,"12.1 I agree to abide by all relevant policies of CIMB-Principal Asset Management Berhad and applicable laws including amendments as may be in force from time to time."),h.qc(),h.rc(289,"p"),h.qd(290,"12.2 I hereby confirm that I witnessed the signature of the Applicant and I confirm that the particulars of the Applicant stated herein to be true and correct."),h.qc(),h.rc(291,"p",2),h.qd(292,"Important Note:"),h.qc(),h.rc(293,"p",2),h.qd(294,"You are required to satisfactorily verify the identity and address of the Applicant and have adequate records to demonstrate that fact under the local Anti-Money Laundering and Anti-Terrorism Financing Laws, Guidelines and/or Regulations. You should ensure that the names and address of the Applicant are accurate and complete and in accordance with the relevant records."),h.qc(),h.rc(295,"p",2),h.rc(296,"strong"),h.qd(297,"Thank you for reading these terms and conditions. Please do not hesitate to contact our Customer Care Centre at 03-7718 3100 if you require any assistance."),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("title","CIMB-Principal Asset Management")("show",t.show)},directives:[G.a],styles:[""]}),e})(),ze=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-tnc-myhwdbs"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:185,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],["type","A",1,"font-weight-bold"],["href","http://www.affinhwangam.com"],["href","http://www.ppa.my"],["type","a"],["type","A","start","2",1,"font-weight-bold"],["type","A","start","3",1,"font-weight-bold"],["type","i"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"div"),h.rc(2,"ol",1),h.rc(3,"li"),h.qd(4,"GENERAL TERMS AND CONDITIONS applicable to Providers and PPA (Governed by and construed in accordance with laws of Malaysia)."),h.qc(),h.qc(),h.rc(5,"ol"),h.rc(6,"li"),h.qd(7,"Account Opening "),h.rc(8,"ol"),h.rc(9,"li"),h.qd(10,'The Applicant shall be bound by these terms and conditions, the Disclosure Document, the Supplementary Disclosure Document(s) (if any) and also the terms and conditions stated in this application form and the webpage of the Provider and the Private Pension Administrator ("PPA"). For further information about the PRS Scheme or Funds with the Provider, please refer to Provider\'s webpage at '),h.rc(11,"a",2),h.qd(12,"(www.affinhwangam.com)"),h.qc(),h.qd(13," and for further information about PPA, please refer to the PPA's webpage at "),h.rc(14,"a",3),h.qd(15,"www.ppa.my"),h.qc(),h.qc(),h.rc(16,"li"),h.qd(17,"The Provider and /or PPA shall be entitled at any time and without prior reference to the Applicant to add, vary or amend any or all of the terms and conditions herein at its sole and absolute discretion."),h.qc(),h.rc(18,"li"),h.qd(19,"Upon submission of this form as well as other supporting documents, the information contained therein will be used by the Provider and PPA for creation of account and record purposes."),h.qc(),h.rc(20,"li"),h.qd(21,"The Provider and PPA shall have absolute discretion in the opening of an account."),h.qc(),h.rc(22,"li"),h.qd(23,"All instructions and/or information given in writing to the Provider and/or PPA, including this form are binding on the Applicant."),h.qc(),h.qc(),h.qc(),h.rc(24,"li"),h.qd(25,"Personal Data/Information"),h.mc(26,"br"),h.qd(27," Personal data provided by the Member on the joint application form and details of transactions or dealings by Members provided from time to time thereafter may be used and/or disclosed by the PPA and/or the PPA's personnel for the following purpose:- "),h.rc(28,"ol",4),h.rc(29,"li"),h.qd(30,"The use and/or disclosure of the PPA members' personal information to any party is necessary for the completion of any transactions, dealings or in connection with services that the PPA may provide to the PPA members;"),h.qc(),h.rc(31,"li"),h.qd(32,"If required by the applicable laws, regulations, directives, guidelines, regulatory authorities, government authorities and/or court of competent jurisdiction; and"),h.qc(),h.rc(33,"li"),h.qd(34,"To any PPA's delegates, service providers or any third party that the PPA may engage on the basis that the recipient would continue to maintain confidentiality of the PPA's members personal information."),h.qc(),h.rc(35,"li"),h.qd(36,"Members are also advise to read the PPA Privacy Notification."),h.qc(),h.qc(),h.qc(),h.rc(37,"li"),h.qd(38,"Change of Contact Details"),h.mc(39,"br"),h.qd(40," It shall be the PPA members' obligation to notify the PRS Provider and PPA of any change in PPA members' address, e-mail or contact number immediately to ensure continuity in the receipt of communication from the PPA. "),h.qc(),h.rc(41,"li"),h.qd(42,"Anti-Money Laundering"),h.mc(43,"br"),h.qd(44,"The Applicant hereby warrants that:- "),h.rc(45,"ol",4),h.rc(46,"li"),h.qd(47,"No person other than the applicant has or will have any interest in the account (where applicable);
1 and"),h.qc(),h.rc(48,"li"),h.qd(49,"All monies as may be paid to the Provider and/or PPA from time to time shall come from legitimate (and not illegal) source; "),h.qc(),h.rc(50,"li"),h.qd(51,"The Applicant agrees to provide all such information and documents as may be necessary to verify the Applicant's identity and do all such acts and things as may be necessary to enable the Provider and/or PPA to comply with all applicable anti-money laundering and counter financing terrorism (AML/CFT) and the governing law, rules and regulations (whether in Malaysia or elsewhere). The Applicant agrees that the Provider and/or PPA shall not be liable or responsible in anyway whatsoever and shall be held harmless against any loss arising as a result of or in connection with any delay or failure to process any application or transaction if such information or documents requested by the Provider and/or PPA have not been promptly provided by the Applicant to the Provider and/or PPA."),h.qc(),h.rc(52,"li"),h.qd(53,"The Provider and/or PPA reserves the right to terminate the relationship if any documents requested pursuant to the AML/CFT requirements are not received within 14 days.\xa0"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(54,"div"),h.rc(55,"ol",5),h.rc(56,"li"),h.qd(57,"PPA'S TERMS AND CONDITIONS"),h.qc(),h.qc(),h.rc(58,"ol"),h.rc(59,"li"),h.qd(60,"The PPA members have been informed of the fees payable to the PPA. The PPA fees payable to the PPA are as follow:- "),h.rc(61,"ol",4),h.rc(62,"li"),h.qd(63,"Account opening fee (RM10)"),h.qc(),h.rc(64,"li"),h.qd(65,"Annual maintenance fee (RM8) (payable only when there is contribution)"),h.qc(),h.rc(66,"li"),h.qd(67,"Administration fee of 0.04% of the Fund's NAV charged to the funds by Provider The above may be collected by the PRS Provider acting on behalf of the PPA. For further information on the PPA's fees and charges, please refer to http://www.ppa.my/ppa/member-services/prs-transactions/"),h.qc(),h.qc(),h.qc(),h.rc(68,"li"),h.qd(69,"PPA reserves the right after 6 months of notification to the member to close a PPA account that does not reflect any balance in the PPA account due to the following reasons: - "),h.rc(70,"ol",4),h.rc(71,"li"),h.qd(72,"Full amount withdrawn (upon attaining retirement age)/ permanent departure and account has zero units for 6 months; or"),h.qc(),h.rc(73,"li"),h.qd(74,"Upon release of the deceased member's funds to beneficiaries/ nominees/ next-of-kin pursuant to a Letter of Administration or Grant of Probate."),h.qc(),h.qc(),h.qc(),h.rc(75,"li"),h.qd(76,"Variation"),h.mc(77,"br"),h.qd(78," The PPA shall be entitled at any time and without prior reference to the PPA members' to add, vary or amend any or all of the terms and conditions herein and/or the PPA's website and/or the joint application form at its sole and absolute discretion. "),h.qc(),h.qc(),h.qc(),h.rc(79,"div"),h.rc(80,"ol",6),h.rc(81,"li"),h.qd(82,"PROVIDER'S TERMS AND CONDITIONS"),h.qc(),h.qc(),h.rc(83,"ol"),h.rc(84,"li"),h.qd(85,"Minimum Investment"),h.mc(86,"br"),h.qd(87," Initial and subsequent investment must be for a minimum amount stated in the Disclosure Document. "),h.qc(),h.rc(88,"li"),h.qd(89,"Mode of payment for the contribution "),h.rc(90,"ol",4),h.rc(91,"li"),h.qd(92,"Applicant is required to submit this form together with the payment for the contribution and/or proof of payment. All payment made must be honoured. "),h.rc(93,"ol",7),h.rc(94,"li"),h.qd(95,"Cash-Required to submit a copy of the cash deposit stating Applicant\u2019s name and identification card number/PPA account number as proof of payment."),h.qc(),h.rc(96,"li"),h.qd(97,"Cheque-Required to submit a copy of the cheque deposit slip stating the Applicant\u2019s name and identification card number/PPA account number as proof of payment."),h.qc(),h.rc(98,"li"),h.qd(99,"Online/Telegraphic Transfer-Required to submit a copy of the online/telegraphic transfer statement as proof of payment"),h.qc(),h.qc(),h.qc(),h.rc(100,"li"),h.qd(101,"If an application is rejected, the payment made will be returned (without interest) by the Provider by cheque or by telegraphic transfer (at the cost of the Applicant) within 30 days for the date of application."),h.qc(),h.rc(102,"li"),h.qd(103,"The Provider shall not in any way be liable to pay interest to the Applicant/member for any monies held by the Provider for any reason(s) whatsoever."),h.qc(),h.qc(),h.qc(),h.rc(104,"li"),h.qd(105,"Investment Choice"),h.mc(106,"br"),h.qd(107," The Applicant may choose to invest using the default or self-selective. If the Applicant does not select a funder under the scheme, all contributions to the scheme will be automatically allocated in accordance with the default option, which means that the contributions will allocated for the purchase of units in the following core funds depending on the Applicant\u2019s age at the time of contribution. For member that are investing under the default option, they will be notified in writing at least 1 month before attaining the age of 40 or 50 as the case may be, that their investments in the core funds will be automatically switched in accordance with the rules of the default option unless the Provider has been instructed otherwise. "),h.qc(),h.rc(108,"li"),h.qd(109,"Indemnity"),h.mc(110,"br"),h.qd(111," The Applicant hereby indemnities and hold harmless the Provider and any if their agents against any actions, proceedings, claims, looses, damages and cost and expenses which may be bought against, suffered or incurred by any or all of them arising either directly or indirectly out of or in connection with the PRS account or in connection with the Provider accepting, relying on or committing to act as a result of any instructions given by or on behalf of the Applicant unless due to willful default or negligence of the Provider. "),h.qc(),h.rc(112,"li"),h.qd(113,"Acceptance"),h.mc(114,"br"),h.qd(115," By reading and understanding of the contents contained in the disclosure document and thereafter completing this form for the relevant fund, the customer hereby acknowledge and agree that the customer has entered into a legally binding relationship with Affin Hwang Asset Management Berhad (\u201cAffin Hwang AM\u201d) and further accepts to be bound by the terms and conditions contained in this form, contents of the disclosure document and deed of the relevant fund including any supplemental made thereto. "),h.qc(),h.rc(116,"li"),h.qd(117,"Forms "),h.rc(118,"ol",4),h.rc(119,"li"),h.qd(120,"The customer expressly consents to the recording of telephone conversation exchange for whatever purpose under this form, account and./or instructions made by the customer to Affin Hwang AM and the customer further agrees that such recordings shall constitute conclusive evidence"),h.qc(),h.rc(121,"li"),h.qd(122,"No instructions from the customer shall be deemed to be received by Affin Hwang AM until such time Affin Hwang AM confirms acceptance of the same, the customer acknowledges the risk associated with each means of communication and agrees that Affin Hwang AM shall not be liable for any losses and/or damages arising form and/or in connection with the instructions."),h.qc(),h.qc(),h.qc(),h.rc(123,"li"),h.qd(124,"Physical Statement"),h.mc(125,"br"),h.qd(126," The customer acknowledges and agrees that Affin-Hwang AM may send statements including but not limited to the customer's tax voucher, statement of account, transaction slip, switching advice, payment and redemption advice, confirmation advice and such other documents (collectively knows as \"Statements\") to the customer's correspondence address contained in Affin Hwang AM\u2019s record. It is the responsibility of the customer to notify Affin Hwang AM in writing of any (i) non-receipt of Statements or (ii)(a)(a) within 14 days from the date appearing in the switching advice, payment and redemption advice and confirmation advice pertaining to any discrepancy contained therein; (b)(b) within 30 days from the date appearing in the statement of account pertaining to any discrepancy contained therein (c)(c) save for (ii)(a)(a) and (ii)(b)(b), within 14 days from the date appearing in such Statements. The customer understands and accepts the risk associated with the customer\u2019s own request to have the Statements sent via postal service and/or such other agreed means of communication as notified by Affin Hwang AM from time to time. "),h.qc(),h.rc(127,"li"),h.qd(128,"E-Statement"),h.mc(129,"br"),h.qd(130," The customer acknowledges and agrees that Affin Hwang AM may transmit the Statements (as defined above) via email the customer's last
1known email address contained in Affin Hwang AM's record. The customer shall promptly notify Affin Hwang AM in writing any (i) non-receipt of the Statements or (ii)(a)(a) within 14 days from the date appearing in the switching advice, payment and redemption advice and confirmation advice pertaining to any discrepancy contained therein; (b)(b) within 30 days from the date appearing in the statement of account pertaining to any discrepancy contained therein (c)(c) save (ii)(a)(a) and (ii)(b)(b), within 14 days from the date appearing in such Statements. The customer understands and accepts the risk associated with the customer's own request to have the Statements sent via the internet. "),h.qc(),h.rc(131,"li"),h.qd(132,"Monies "),h.rc(133,"ol",4),h.rc(134,"li"),h.qd(135,"All monies due and payable by the customer to Affin Hwang AM shall be made with clear funds and any cheques issued by the customer must be honoured when presented."),h.qc(),h.rc(136,"li"),h.qd(137,"If any application made by the customer is rejected for whatever reason, whether in part or whole, any monies paid or remaining balance thereof will be returned (without interest or return) via cheque or such other manner determined to be practicable"),h.qc(),h.rc(138,"li"),h.qd(139,"Any monies payable by Affin Hwang AM to the customer will be made via cheque and denominated in Ringgit Malaysia. Unless notified otherwise, the cheque will be issued in the name and sent to the address appearing in the unit holder register of Affin Hwang AM's record"),h.qc(),h.rc(140,"li"),h.qd(141,"Affin Hwang AM is entitled to withhold any monies held or received by Affin Hwang AM and apply the same for the satisfaction of any liabilities, taxes and charges by whatsoever name called imposed by the relevant authorities and/or under the applicable laws."),h.qc(),h.qc(),h.qc(),h.rc(142,"li"),h.qd(143,"Representations and Warranties "),h.rc(144,"ol"),h.rc(145,"li"),h.qd(146,"In reliance of the customer's representations and warranties stipulated hereunder, Affin Hwang AM agrees to enter into a relationship with the customer and in continuance thereafter for the provision of services contemplated in this form relevant disclosure document and deed including any supplemental thereto, the customer hereby represent and warrant the following to Affin Hwang AM:"),h.qc(),h.rc(147,"li"),h.qd(148,"The contents of the relevant disclosure document and deed including any supplemental thereto constitutes the complete and entire understanding of the customer with respect to the relevant fund, the customer has not relied upon any other representation (whether oral or in writing) or information other than those contained in the relevant disclosure document and deed including any supplemental thereto:"),h.qc(),h.rc(149,"li"),h.qd(150,"Unless declared otherwise, the customer is neither a citizen nor a resident of the United States of America"),h.qc(),h.rc(151,"li"),h.qd(152,"The customer has legal capacity and power to enter into this application; and"),h.qc(),h.rc(153,"li"),h.qd(154,"The customer is not undischarged bankrupt or subject to any material proceedings which would impair the customer in performing its obligations envisaged herein"),h.qc(),h.rc(155,"li"),h.qd(156,"Notwithstanding the generality of the foregoing, the customer shall be deemed to represent and warrant to Affin Hwang AM at all material times that the representation and warranties contained above are true, accurate and correct in all respects and manner as if it were on such date and repeated by virtue of each and every subsequent transaction entered into between the customer and Affin Hwang AM. The customer shall as soon as possible notify Affin Hwang AM in writing should the representation and warrants stipulated in this form are untrue, inaccurate and/or incorrect."),h.qc(),h.qc(),h.qc(),h.rc(157,"li"),h.qd(158,"Personal Information "),h.mc(159,"br"),h.qd(160," It is the customer's responsibility to notify Affin Hwang AM in writing should there be any changes to the customer's personal information "),h.qc(),h.rc(161,"li"),h.qd(162,"Set Off"),h.mc(163,"br"),h.qd(164," Any monies that is due and owing by the customer to Affin Hwang AM in relation to the form and/or relevant fund, Aff
1in Hwang AM shall be entitled to set-off those monies due and owing against any asset, cash and/or units held with and/or in the possession of Affin Hwang AM. "),h.qc(),h.rc(165,"li"),h.qd(166,"Successor Bound"),h.mc(167,"br"),h.qd(168," This form and all other transactions envisaged shall be binding upon heirs, personal representatives. Successors-in-title and permitted assigns of the customer subject to the approval of the Manager. "),h.qc(),h.rc(169,"li"),h.qd(170,"Governing Law"),h.mc(171,"br"),h.qd(172," The terms and conditions contained in this form shall be governed band construed in accordance with the laws of Malaysia and all parties hereby agree to submit to the exclusive jurisdiction of the courts of Malaysia. "),h.qc(),h.rc(173,"li"),h.qd(174,"Amendment"),h.mc(175,"br"),h.qd(176," Affin Hwang AM reserves its sole and absolute discretion to amend, modify and/or vary the terms and conditions contained in this form without giving any prior notification to the customer. "),h.qc(),h.rc(177,"li"),h.qd(178,"Severability"),h.mc(179,"br"),h.qd(180," If any of the terms and conditions contained in this form is illegal, void or unenforceable for any reason whatsoever shall be deemed ineffective to the extent of such illegality, voidness, or unenforceability without invalidating the remaining portion hereof. "),h.qc(),h.qc(),h.rc(181,"p"),h.qd(182," PRIVATE RETIREMENT SCHEME"),h.mc(183,"br"),h.qd(184," Joint Application Form "),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("title","AFFIN HWANG PRS TERMS AND CONDITIONS")("show",t.show)},directives:[G.a],styles:[""]}),e})(),De=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-tnc-mykenanga"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:172,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],[1,"font-weight-bold"],["href","https://www.kenangainvestors.com.my"],["href","https://www.ppa.my"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"div"),h.rc(2,"p"),h.qd(3,"Please read these notes before completing the E-Application Form as you are bound by them. You must read and understand the contents of the relevant Product Highlights Sheet(s) and Disclosure Document(s) before completing this E-Application Form. A copy of the Deed will be made available to you upon request. Please check that the PRS distributor / consultant servicing you has a valid authorisation and registration card. Pursuant to Regulation 7(1) of the Capital Markets and Services (Private Retirement Scheme Industry) Regulations 2012, this E-Application Form should not be circulated unless accompanied by the Disclosure Document made available on this E-Application."),h.qc(),h.rc(4,"p",1),h.qd(5,"A. GENERAL TERMS AND CONDITIONS applicable to PRS Providers and PPA (Governed by and construed in accordance with laws of Malaysia)"),h.qc(),h.rc(6,"p"),h.qd(7,"1) Account opening"),h.qc(),h.rc(8,"ol"),h.rc(9,"li"),h.rc(10,"p"),h.qd(11,' The Applicant shall be bound by these terms and conditions, the Disclosure Document, the Supplementary Document(s) (if any) and also the terms and conditions stated in this E-Application Form and the webpage of the PRS Provider and the Private Pension Administrator ("PPA"). For further information about the private retirement scheme or funds, please refer to the PRS Provider\'s webpage at ('),h.rc(12,"a",2),h.qd(13,"www.kenangainvestors.com.my"),h.qc(),h.qd(14,") and further information about PPA, please refer to PPA's webpage at "),h.rc(15,"a",3),h.qd(16,"www.ppa.my"),h.qc(),h.qd(17,". "),h.qc(),h.qc(),h.rc(18,"li"),h.rc(19,"p"),h.qd(20,"The PRS Provider and/or PPA shall be entitled at any time and without prior reference to the Applicant to add, vary or amend any or all of the terms and conditions herein at its sole and absolute discretion."),h.qc(),h.qc(),h.rc(21,"li"),h.rc(22,"p"),h.qd(23,"Upon submission of this E-Application Form as well as other supporting documents, the information contained therein will be used by the PRS Provider and PPA for creation of account and record purposes."),h.qc(),h.qc(),h.rc(24,"li"),h.rc(25,"p"),h.qd(26,"The PRS Provider and PPA shall have the absolute discretion in the opening of an account."),h.qc(),h.qc(),h.rc(27,"li"),h.rc(28,"p"),h.qd(29,"All instructions and/or information given in writing to the PRS Provider and/or PPA, including this E-Application Form are binding on the Applicant."),h.qc(),h.qc(),h.qc(),h.rc(30,"p"),h.qd(31," 2) Personal Data / Information "),h.mc(32,"br"),h.qd(33," Personal data provided by the Applicant on the E-Application Form and details of transactions or dealings by the Applicant provided from time to time thereafter may be used and/or disclosed by the PPA/PRS Provider and/or the PPA/PRS Provider's personnel for the following purpose: "),h.qc(),h.rc(34,"ol"),h.rc(35,"li"),h.rc(36,"p"),h.qd(37,"The use and/or disclosure of the Applicant's personal information to any party where necessary for the completion of any transaction, dealings or in connection with services that the PPA/PRS Provider may provide to the Applicant;"),h.qc(),h.qc(),h.rc(38,"li"),h.rc(39,"p"),h.qd(40,"If required by the applicable laws, regulations, directives, guidelines, regulatory authorities, government authorities and/or court of competent jurisdiction;"),h.qc(),h.qc(),h.rc(41,"li"),h.rc(42,"p"),h.qd(43,"To any PPA/PRS Provider delegates, service providers or any third party that the PPA/PRS Provider may engage on the basis that the recipient would continue to maintain confidentiality of the PPA's members personal information;and"),h.qc(),h.qc(),h.rc(44,"li"),h.rc(45,"p"),h.qd(46,"Members are also advised to read the PPA and PRS Provider's Personal Data Protection Notice."),h.qc(),h.qc(),h.qc(),h.rc(47,"p"),h.qd(48," 3) Change of Contact Details "),h.mc(49,"br"),h.qd(50," It shall be the Applicant's obligation to notify the PRS Provider and PPA of any change in the Applicant's address, email or contact number immediately to ensure continuity in the receipt of communication from the PPA and the PRS Provider. "),h.qc(),h.rc(51,"p"),h.qd(52," 4) Anti-Money Laundering "),h.mc(53,"br"),h.qd(54," The Applicant hereby warrants that:- "),h.qc(),h.rc(55,"ol"),h.rc(56,"li"),h.qd(57,"No person other than the Applicant has or will have any interest in the account (where applicable);
1 and"),h.qc(),h.rc(58,"li"),h.qd(59,"All monies as may be paid to the PRS Provider and/or PPA from time to time shall come from a legitimate (and not illegal) source;"),h.qc(),h.rc(60,"li"),h.qd(61,"The Applicant agrees to provide all such information and documents as may be necessary to verify the Applicant's identity and do all such acts and things as may be necessary to enable the PRS Provider and/or PPA to comply with all applicable anti-money laundering and counter financing terrorism (AML/CFT) and the governing law, rules and regulations (whether in Malaysia or elsewhere). The Applicant agrees that the PRS Provider and/or PPA shall not be liable or responsible in anyway whatsoever and shall be held harmless against any loss arising as a result of or in connection with any delay or failure to process any application or transaction if such information or documents requested by the PRS Provider and/or PPA have not been promptly provided by the Applicant to the PRS Provider and/or PPA."),h.qc(),h.rc(62,"li"),h.qd(63,"The PRS Provider and/or PPA reserves the right to terminate the relationship if any documents requested pursuant to the AML/CFT requirements are not received within 14 days."),h.qc(),h.qc(),h.rc(64,"p",1),h.qd(65,"PRS PROVIDER'S TERMS AND CONDITIONS"),h.qc(),h.rc(66,"p"),h.qd(67," Please read these notes before completing the E-Application Form as you are bound by them. You must read and understand the contents of the relevant Product Highlights Sheet(s) and Disclosure Document(s) before completing this E-Application Form. A copy of the Deed will be made available to you upon request. "),h.mc(68,"br"),h.qd(69," Please check that the PRS distributor / consultant servicing you has a valid authorisation and registration card. Pursuant to Regulation 7(1) of the Capital Markets and Services (Private Retirement Scheme Industry) Regulations 2012, this E-Application Form should not be circulated unless accompanied by the Disclosure Document made available on this E-Application. "),h.qc(),h.rc(70,"p"),h.qd(71,"Eligibility"),h.qc(),h.rc(72,"p"),h.qd(73,"The Applicant must be at least 18 years of age at the date of application."),h.qc(),h.rc(74,"p"),h.qd(75,"PRS Account"),h.qc(),h.rc(76,"p"),h.qd(77,"All contributions made to the OnePRS Scheme will be allocated and maintained in 2 sub-accounts:"),h.qc(),h.rc(78,"ol"),h.rc(79,"li"),h.qd(80,"Sub-account A - 70% of all contributions made to any fund within the PRS Scheme and/or Shariah PRS Scheme cannot be withdrawn until the member reaches the retirement age;"),h.qc(),h.rc(81,"li"),h.qd(82,"Sub-account B - 30% of all contribution made to any fund within the PRS Scheme and/or Shariah PRS Scheme and can be withdrawn once a year upon payment of a tax penalty. The PRS Provider would need to deduct the applicable tax penalty of 8% from the withdrawn amount before making payment to you."),h.qc(),h.qc(),h.rc(83,"p"),h.qd(84,"Fund Selection"),h.qc(),h.rc(85,"p"),h.qd(86,"Self-Selection Option - where an Applicant decides to invest according to his/her risk and return profile"),h.qc(),h.rc(87,"p"),h.qd(88,"Minimum Initial Amount and Additional Contribution Amount"),h.qc(),h.rc(89,"p"),h.qd(90,"The minimum initial and additional contribution amount may vary between the PRS Providers and the PRS Provider may decide such other amount from time to time. You must read and understand the contents of the relevant Product Highlights Sheet(s) and Disclosure Document(s) before completing this E-Application Form. Units will be transacted based on the forward pricing prevailing at the time the request is received by the PRS Provider. Units will be credited based on the closing NAV price of the day."),h.qc(),h.rc(91,"p"),h.qd(92,"Documents required"),h.qc(),h.rc(93,"p"),h.qd(94,"This E-Application Form must be submitted and the Applicant is required to upload his/her NRIC / passport online (digital image of both sides). The Applicant agrees that the PRS Provider shall not be liable or responsible in anyway whatsoever and shall be held harmless against any loss arising as a result or in connection with any delay or failure to process any application or transaction; if such information or document requested by the PRS Provider have not been promptly provided by the Applicant to the PRS Provider."),h.qc(),h.rc(95,"p"),h.qd(96,"Fees, Charges and Expenses"),h.qc(),h.rc(97,"ol"),h.rc(98,"li"),h.qd(99,"The Applicant shall be responsible for the payment of any charges, fees, costs, expenses and other liabilities properly payable or incurred by the PRS Provider and in holding or executing transaction in respect to any contribution to the private retirement scheme."),h.qc(),h.rc(100,"li"),h.qd(101,"The PRS Provider shall not be liable to pay any profit to the Applicant for any monies held by the PRS Provider for the Applicant for any reason whatsoever."),h.qc(),h.qc(),h.rc(102,"p"),h.qd(103,"Taxes"),h.qc(),h.rc(104,"p"),h.qd(105,"All fees and charges payable to the Manager and the Trustee are subject to the goods and services tax, sales and services tax, and/or any other forms of taxes as may be imposed by the government or other authorities from time to time. Units will be transacted based on forward pricing prevailing at the time the request is received by the PRS Provider. Units will be credited based on the closing NAV price of the day."),h.qc(),h.rc(106,"p"),h.qd(107,"Payment, Confirmation Advice and Statements"),h.qc(),h.rc(108,"p"),h.qd(109,"Payment, confirmation advices, statements and other documents shall be sent at the risk of the Applicant to the Applicant's correspondence address as stated in this E-Application Form. If the Applicant fails to notify the PRS Provider in writing of any errors in the confirmation advice within 14 days, or in the statement within 14 days of issue, the Applicant shall be deemed to have waived any right to raise an objection or to pursue any remedies against the PRS Provider or the Scheme Trustee"),h.qc(),h.rc(110,"p"),h.qd(111,"Instructions/Voice Recordings"),h.qc(),h.rc(112,"ol"),h.rc(113,"li"),h.qd(114,"All instructions given by the Applicant or his authorized representative either verbally or in writing, by facsimile transmission or such other permitted means of communication as notified by the PRS Provider from time to time arising out of and/or in connection with the Applicant account held with the PRS Provider, shall be binding on the Applicant. The PRS Provider shall have no obligation to verify the authenticity of any such instructions or the identity of any person giving such instructions."),h.qc(),h.rc(115,"li"),h.qd(116,"The Applicant must submit a written request to the PRS Provider to change their personal records and details. The PRS Provider shall have the right to request any other documents or evidence before acting on any such change. In view of conflicting information on personal records and/or details, the PRS Provider will only rely upon the personal record and/
1or details as provided in this E-Application Form for all future transactions unless notified via a written request by the Applicant of a change of address and/or any other personal record/details."),h.qc(),h.rc(117,"li"),h.qd(118,"Any instruction or communication given to the PRS Provider shall only take effect upon actual receipt by the PRS Provider and during the normal working hours of the PRS Provider."),h.qc(),h.rc(119,"li"),h.qd(120,"The PRS Provider shall be entitled to use voice recording devices to record telephone instructions communicated to it and such recording(s) may constitute evidence of the instructions."),h.qc(),h.qc(),h.rc(121,"p"),h.qd(122,"Set Off"),h.qc(),h.rc(123,"p"),h.qd(124,"The PRS Provider is entitled to set off any monies in relation to the account against any fees, or charges permitted to be charged under the Disclosure Documents and/or any regulations and guidelines, due to the PRS Provider at any time and from time to time."),h.qc(),h.rc(125,"p"),h.qd(126,"Liability"),h.qc(),h.rc(127,"p"),h.qd(128,"The PRS Provider shall act in good faith and use the highest standard of skill and care and exercise all due diligence and vigilance expected from a reputable fund PRS Provider, the PRS Provider shall not be liable for any liabilities, claims, loss, damage or litigation costs resulting from any error of factor judgement or from action taken by the PRS Provider so long as there has been no willful default or bad faith on its part. For the purpose of carrying out its duties under this terms and conditions the PRS Provider shall have the powers of a natural person to deal with the fund and/ or portfolio and to do all things and execute all documents necessary for the purpose of managing the fund and/ or portfolio."),h.qc(),h.rc(129,"p"),h.qd(130,"Rights of the PRS Provider"),h.qc(),h.rc(131,"ol"),h.rc(132,"li"),h.qd(133,"The PRS Provider reserves the right to accept or reject any application."),h.qc(),h.rc(134,"li"),h.qd(135,"The PRS Provider reserves the right to accept or reject any application if any documents requested pursuant to the AML / CFT requirements are not received within 14 business days. In the event of rejection, units will be redeemed at the closing NAV price on the 15th business day."),h.qc(),h.rc(136,"li"),h.qd(137,"The PRS Provider reserves the right to terminate any relationship without assigning reasons in respect thereof."),h.qc(),h.rc(138,"li"),h.qd(139,"The PRS Provider reserves the right to decide and make any changes to the terms and conditions."),h.qc(),h.qc(),h.rc(140,"p"),h.qd(141,"Indemnity"),h.qc(),h.rc(142,"p"),h.qd(143,"The Applicant hereby agrees to indemnify the PRS Provider, Scheme Trustee and any of their PRS distributor(s)/consultant(s) against any damages, loss, costs, expenses and claims which may be made against the PRS Provider, Scheme Trustee and any of their PRS distributor(s)/consultant(s) in connection with:"),h.qc(),h.rc(144,"ol"),h.rc(145,"li"),h.qd(146,"the E-Application Form; or"),h.qc(),h.rc(147,"li"),h.qd(148,"in connection with the PRS Provider accepting, relying on or acting on any instructions given by or on behalf of the Applicant, except due to the wilful default or negligence of the PRS Provider."),h.qc(),h.qc(),h.rc(149,"p"),h.qd(150,"Money Laundering Statements"),h.qc(),h.rc(151,"p"),h.qd(152,"The Applicant hereby warrants that all monies as may be paid to the PRS Provider from time to time shall come from a legitimate (and not illegal) source."),h.qc(),h.rc(153,"p"),h.qd(154,"Loan Financing Statement"),h.qc(),h.rc(155,"p"),h.qd(156,"Contributing in a private retirement scheme with borrowed money is more risky than investing with your own savings. You should assess if loan financing is suitable for you in light of your objectives, attitude to risk and financial circumstances. You should be aware of the risks which would include the following:"),h.qc(),h.rc(157,"ol"),h.rc(158,"li"),h.rc(159,"p"),h.qd(160,"The higher the margin of financing (that is, the amount of money you borrow for every Ringgit of your own money which you put in as deposit or down payment) the greater the loss and gain on your investment."),h.qc(),h.qc(),h.rc(161,"li"),h.rc(162,"p"),h.qd(163,"You should asse
1ss whether you have the ability to service the repayments on the proposed loan. If your loan is a variable rate loan and if interest rate rises, your total repayment amount will be increased."),h.qc(),h.qc(),h.rc(164,"li"),h.rc(165,"p"),h.qd(166,"If unit prices fall beyond a certain level, you may be asked to provide additional acceptable collateral (where units are used as collateral) or pay additional amount on top of your normal installments. If you fail to comply within the prescribed time, your units may be sold to settle your loan."),h.qc(),h.qc(),h.rc(167,"li"),h.rc(168,"p"),h.qd(169,"Returns on investment are not guaranteed and may not be earned evenly over time. This means that there may be some year where returns are high and other years where losses incurred instead. Whether you eventually realise a gain or incur loss maybe affected by the timing of the sale of your units. The value of units may fall just when you want your money back even though the investment may have done well in the past."),h.qc(),h.qc(),h.qc(),h.rc(170,"p"),h.qd(171,"This brief statement cannot disclose all the risks and other aspects of loan financing. You should therefore study the terms and conditions before you decide to take the loan. If you have doubts in respect of any aspect of this statement or the terms of the loan financing, you should consult the institution offering the loan."),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("title","GENERAL TERMS AND CONDITIONS")("show",t.show)},directives:[G.a],styles:[""]}),e})(),Pe=(()=>{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-tnc-myrhbim"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:25,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],["href","https://www.ppa.my"],["href","https://www.ppa.my/joining-prs/Other-Important-Information/"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"p"),h.qd(2,"I hereby acknowledge, consent and agree to the following:"),h.qc(),h.rc(3,"p"),h.qd(4,"1. I have read and fully understood the contents of this Declarations, Acknowledgement and Authorizations, the relevant Disclosure Document for the Fund(s) and supplementary Disclosure Document(s) (if any) for the fund(s) to be invested in, the T&C (which has incorporated FATCA, CRS and UT Loan Financing Risk Disclosure Statement), Privacy Policy, Internet Risk and Disclaimer of this PRS account application and I undertake to be bound by them for all my PRS transactions with RHBAM MY."),h.qc(),h.rc(5,"p"),h.qd(6,"2. I further acknowledge that I have read, fully understood and undertake to be bound by the T&C stipulated in the PPA's website ("),h.rc(7,"a",1),h.qd(8,"www.ppa.my"),h.qc(),h.qd(9,")"),h.qc(),h.rc(10,"p"),h.qd(11,"3. I am 18 years old and above and am not an undischarged bankrupt."),h.qc(),h.rc(12,"p"),h.qd(13,"4. I acknowledge that the account opening is subject to the approval of RHBAM MY and PPA."),h.qc(),h.rc(14,"p"),h.qd(15,"5.Upon submission of this application as well as other supporting documents, I am aware the information contained therein will be used by RHBAM MY and PPA for account creation and record purposes."),h.qc(),h.rc(16,"p"),h.qd(17,"6. I am aware of the fees and charges that I will incur directly and indirectly in this account opening and when transacting in the Fund(s). (Please refer to "),h.rc(18,"a",2),h.qd(19,"https://www.ppa.my/joining-prs/Other-Important-Information/"),h.qc(),h.qd(20," for PPA's fees and charges)."),h.qc(),h.rc(21,"p"),h.qd(22,"7. My investment decisions are based solely on my own assessment of the product suitability, its potential losses/gains as unit prices may go down/up and the internet risks inherent in performing the online application."),h.qc(),h.rc(23,"p"),h.qd(24,"8. I consent to the disclosure of my information to the relevant entities involved in this online transaction/application, including regulatory bodies and/or any other relevant person(s) in respect to reporting requirements"),h.qc(),h.qc()),2&e&&h.Mc("title","RHBAM MY TERMS AND CONDITIONS")("show",t.show)},directives:[G.a],styles:[""]}),e})(),Ie=(()=>
1{class e{constructor(){this.closeEvent=new h.s}ngOnInit(){}onClose(){this.closeEvent.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-ppa-tnc"]],inputs:{show:"show"},outputs:{closeEvent:"closeEvent"},decls:110,vars:2,consts:[["actionText","Done",3,"title","show","showChange"],[1,"pb-4"],["href","https://www.ppa.my"],["type","a"]],template:function(e,t){1&e&&(h.rc(0,"b2c-mobile-drawer",0),h.zc("showChange",(function(){return t.onClose()}))("showChange",(function(e){return t.show=e})),h.rc(1,"div",1),h.rc(2,"h3"),h.qd(3,"PPA TERMS AND CONDITIONS"),h.qc(),h.rc(4,"p"),h.qd(5,"The Private Pension Administrator (PPA) is a body approved under section 139C of the Capital Markets and Services Act 2007 to perform the function of record keeping, administration and customer service for members and contributors in relation to contributions made in respect of a private retirement scheme. All PRS applicants are required to open an account with the PPA and upon successful creation of the respective account, the PRS applicants are subsequently referred to as PPA members."),h.qc(),h.rc(6,"ol"),h.rc(7,"li"),h.rc(8,"div"),h.rc(9,"p"),h.qd(10,"GENERAL"),h.qc(),h.rc(11,"p"),h.qd(12,"The PPA members shall be bound by these terms and conditions, and also the terms and conditions stated in the E-Application Form and the webpage of the PPA at "),h.rc(13,"a",2),h.qd(14,"www.ppa.my"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(15,"li"),h.rc(16,"div"),h.rc(17,"p"),h.qd(18,"ACCOUNT OPENING"),h.qc(),h.rc(19,"p"),h.qd(20,"Upon receipt of information via this E-Application Form as well as other supporting documents (if any), the information contained therein will be used by the PPA for creation of account and record purposes."),h.qc(),h.rc(21,"p"),h.qd(22,"The PPA shall have the absolute discretion in the opening of a PPA account."),h.qc(),h.rc(23,"p"),h.qd(24,"All instructions and/or information given by the PPA, including those given here are binding on the Applicant."),h.qc(),h.qc(),h.qc(),h.rc(25,"li"),h.rc(26,"div"),h.rc(27,"p"),h.qd(28,"FEES PAYABLE TO PPA"),h.qc(),h.rc(29,"p"),h.qd(30,"The PPA Fees payable to the PPA are as follows:"),h.qc(),h.rc(31,"p"),h.qd(32,"- Account opening fee (RM10)"),h.qc(),h.rc(33,"p"),h.qd(34,"Annual maintenance fee (RM8) (payable only when there is contribution)"),h.qc(),h.rc(35,"p"),h.qd(36,"Administration Fees (0.04% of the Fund's NAV charged to the funds by Providers)"),h.qc(),h.rc(37,"p"),h.qd(38,"The above may be collected by the PRS Provider acting on behalf of the PPA. For further information on PPA fees and charges, please refer to http://www.ppa.my/ppa/member- services/prs-transactions/"),h.qc(),h.qc(),h.qc(),h.rc(39,"li"),h.rc(40,"div"),h.rc(41,"p"),h.qd(42,"CHANGE OF CONTACT DETAILS"),h.qc(),h.rc(43,"p"),h.qd(44,"It shall be the duty of PPA members' obligation to notify the PRS Provider and PPA of any change in PPA members' address, e-mail and/or contact number immediately to ensure continuity in the receipt of communication from the PPA"),h.qc(),h.qc(),h.qc(),h.rc(45,"li"),h.rc(46,"div"),h.rc(47,"p"),h.qd(48,"PERSONAL DATA STATEMENT"),h.qc(),h.rc(49,"p"),h.qd(50,"Personal data provided by the Member on the E-Application Form and details of transactions or dealings by Members provided from time to time thereafter may be used and/or disclosed by the PPA and/or the PPA's personnel for the following purpose: -"),h.qc(),h.rc(51,"ol"),h.rc(52,"ol",3),h.rc(53,"li"),h.qd(54,"The use and/or disclosure of the PPA members' personal information to any party is necessary for the completion of any transaction, dealings or in connection with services that the PPA may provide to the PPA members; "),h.qc(),h.rc(55,"li"),h.qd(56,"If required by the applicable laws, regulations, directives, guidelines, regulatory authorities, government authorities and/or court of competent jurisdiction; and "),h.qc(),h.rc(57,"li"),h.qd(58,"To any PPA's delegates, service providers or any third party that the PPA may engage on the basis that the recipient would continue to maintain confidentiality of the PPA's members personal information. "),h.qc(),h.qc(),h.qc(),h.rc(59,"p"),h.qd(60,"Members are also advised to read the PPA Privacy Notification."),h.qc(),h.qc(),h.qc(),h.rc(61,"li"),h.rc(62,"div"),h.rc(63,"p"),h.qd(64,"SELF-SELECTIVE"),h.qc(),h.rc(65,"p"),h.qd(66,"Members are instructed to seek advice from the PRS Provider and/or a professional adviser when choosing to invest using self
1-selective options."),h.qc(),h.qc(),h.qc(),h.rc(67,"li"),h.rc(68,"div"),h.rc(69,"p"),h.qd(70,"NIL BALANCE ACCOUNTS"),h.qc(),h.rc(71,"p"),h.qd(72,"PPA reserves the right after 6 months of notification to the member to close a PPA account that does not reflect any balance in the PPA account due to the following reasons: -"),h.qc(),h.rc(73,"ol",3),h.rc(74,"li"),h.qd(75,"Full amount withdrawn (upon attaining retirement age/ permanent departure) and account has zero units for 6 months; or "),h.qc(),h.rc(76,"li"),h.qd(77,"Upon release of the deceased member's funds to beneficiaries/ nominees/ next-of-kin pursuant to a Letter of Administration or Grant of Probate "),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(78,"li"),h.rc(79,"div"),h.rc(80,"p"),h.qd(81,"VARIATION"),h.qc(),h.rc(82,"p"),h.qd(83,"The PPA shall be entitled at any time and without prior reference to the PPA members' to add, vary or amend any or all of the terms and conditions herein and/or the PPA's website and/or the E-Application at its sole and absolute discretion."),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(84,"p"),h.qd(85,"PRIVACY NOTIFICATION"),h.qc(),h.rc(86,"p"),h.qd(87,'The PPA wish to assure you that we take your privacy seriously and are committed to the protection of our member\'s personal information in connection to the Personal Data Protection Act 2010 ("PDPA"") which was introduced to regulate the processing of personal data in commercial transactions.'),h.qc(),h.rc(88,"p"),h.qd(89,"In line with PPA's compliance to PDPA, PPA has put in place a personal data protection and compliance principles framework in the provision of PPA services. Kindly refer to the PPA Privacy Statement at www.ppa.my for further details."),h.qc(),h.rc(90,"p"),h.qd(91,"The PPA Privacy Statement forms an integral part of the terms and conditions of the PPA account and by continuing to use the PPA account, you are accepting and consenting to your personal information being processed by PPA for the purpose and in the manner as set out in the PPA Privacy Statement."),h.qc(),h.rc(92,"p"),h.qd(93,"Your personal information was collected from the online PRS Application or E-Application Form with your Private Retirement Scheme (PRS) Provider(s) and/or processed through your PRS Provider. The accuracy of your personal information depends on the information you provide to your PRS Provider at the point of application. Kindly update both the PRS Provider and PPA as and when there are changes to your personal information which have become incorrect or out of date."),h.qc(),h.rc(94,"p"),h.qd(95,"PPA members may receive additional informative materials for awareness and educational purposes. In relation to these materials, you may request the PPA by written notice not to forward such materials to you via (i) phone, (ii) post, (iii) e-mail or sms, or (iv) communicating to you by whatever means."),h.qc(),h.rc(96,"p"),h.qd(97,"PPA is committed to protecting the security of your personal information from unauthorized access, use or disclosure. The PPA online password is used to help protect your account and personal information. You are therefore advised to keep your PPA online password confidential. If you are sharing a computer with anyone, you are advised to log out from your account before leaving a site or service to protect access to your information by subsequent users."),h.qc(),h.rc(98,"p"),h.qd(99,"We will occasionally update this privacy statement to reflect changes from time to time in compliance with regulatory requirements. If there are material changes to this statement or in how PPA will use your personal information, we will notify you either by prominently posting a notice of such changes prior to implementing the change or by directly sending you a notification. We encourage you to periodically visit the PPA's website to be informed of how PPA is protecting your information."),h.qc(),h.rc(100,"p"),h.qd(101,"DECLARATION"),h.qc(),h.rc(102,"p"),h.qd(103,"I hereby acknowledge that my personal information provided through the online PRS Application or e-Application through iFAST mobile app will be automatically transmitted to the PPA."),h.qc(),h.rc(104,"p"),h.qd(105,"I hereby declare that the particulars given herein are true, correct and complete and that I have not withheld any material facts or information which may influence the acceptance of this application."),h.qc(),h.rc(106,"p"),h.qd(107,"I am aware of the fees and charges that will be incurred by me directly or indirectly when investing in the PRS fund(s)."),h.qc(),h.rc(108,"p"),h.qd(109,"I declare that I have not been convicted by any court for any criminal offence whether within or outside Malaysia."),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("title","TERMS AND CONDITIONS FOR PRIVATE RETIREMENT SCHEME (PRS) ACCOUNT OPENING AND SUBSCRIPTION VIA E-APPLICATION")("show",t.show)},directives:[G.a],styles:[""]}),e})();var ke=n("h76Y");function Ae(e,t){if(1&e){const e=h.sc();h.rc(0,"app-campaign-code-input-box",21),h.zc("promoCodeApplied",(function(t){return h.dd(e),h.Dc().promoApplied(t)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("refno",e.refno)}}function Ee(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.value,e.currencyCode)," ")}}function Fe(e,t){if(1&e&&(h.rc(0,"b2c-order-cart",22),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",23),h.od(3,Ee,2,4,"ng-template",null,24,h.pd),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.ad(4),i=h.Dc();h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",i.orderCartConstant.PENDING)("paymentTitle",e.title),h.Ub(2),h.Mc("value",n)}}const Oe=function(e){return{"h5 mt-2":e}};function Ue(e,t){if(1&e){const e=h.sc();h.rc(0,"p",5),h.Ec(1,"async"),h.qd(2," I acknowledge reading the "),h.rc(3,"a",25),h.zc("click",(function(t){return h.dd(e),t.stopPropagation()}
1)),h.qd(4,"Kenanga Customer Consent Form"),h.qc(),h.qd(5," and "),h.rc(6,"a",26),h.zc("click",(function(t){return h.dd(e),t.stopPropagation()})),h.qd(7,"Privacy Policy of Kenanga Investors Berhad"),h.qc(),h.qd(8," and consent to the processing of my personal data in accordance with it. "),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(4,Oe,h.Fc(1,2,e.isMobile$))),h.Ub(3),h.Mc("href",e.AppConstant.LIVE_URL+"/articleFiles/Kenanga CO Form.pdf",h.gd)}}function xe(e,t){}function Le(e,t){1&e&&h.od(0,xe,0,0,"ng-template")}const Re=function(e){return{prs:e}};function Ne(e,t){if(1&e){const e=h.sc();h.rc(0,"p"),h.qd(1," I acknowledge reading the "),h.od(2,Le,1,0,void 0,27),h.qd(3," and "),h.rc(4,"a",7),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().onClickAccountTnC(t.managerCode)})),h.qd(5,"General Terms and Conditions"),h.qc(),h.qd(6," by "),h.rc(7,"b"),h.qd(8),h.qc(),h.qd(9," and agree to be bound by them. "),h.qc()}if(2&e){const e=h.Dc().$implicit;h.Dc();const t=h.ad(34),n=h.ad(36);h.Ub(2),h.Mc("ngTemplateOutlet","MYKENANGA"==e.managerCode?t:n)("ngTemplateOutletContext",h.Sc(3,Re,e)),h.Ub(6),h.rd(e.managerName)}}function Be(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"privacy policy"),h.qc())}function _e(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1," I provide consent for "),h.rc(2,"b"),h.qd(3),h.qc(),h.qd(4," to process my personal data in accordance with their "),h.od(5,Be,2,0,"span",28),h.qd(6,". "),h.qc()),2&e){const e=h.Dc().$implicit;h.Dc();const t=h.ad(38);h.Ub(3),h.rd(e.managerName),h.Ub(2),h.Mc("ngIf","MYKENANGA"==e.managerCode)("ngIfElse",t)}}function Ve(e,t){if(1&e&&(h.pc(0),h.od(1,Ne,10,5,"p",10),h.od(2,_e,7,3,"p",10),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf",e.exist),h.Ub(1),h.Mc("ngIf",e.exist)}}function He(e,t){if(1&e){const e=h.sc();h.rc(0,"p"),h.qd(1," My personal information provided through online PRS Application or e-Application will be transmitted to the PPA, and I am bound by the "),h.rc(2,"a",7),h.zc("click",(function(){return h.dd(e),h.Dc().onClickPPATnC()})),h.qd(3,"PPA Terms & Conditions."),h.qc(),h.qc()}}function $e(e,t){1&e&&(h.rc(0,"p"),h.qd(1," I acknowledge and agree that my personal information will be provided by iFAST Capital Sdn Bhd to the relevant product provider or fund manager for completing transactions or services. "),h.qc())}function je(e,t){}function Ge(e,t){1&e&&h.od(0,je,0,0,"ng-template")}function We(e,t){if(1&e){const e=h.sc();h.rc(0,"p"),h.qd(1," I acknowledge reading the "),h.od(2,Ge,1,0,void 0,27),h.qd(3," and "),h.rc(4,"a",7),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).onClickAccountTnC(t.managerCode)})),h.qd(5,"General Terms and Conditions"),h.qc(),h.qd(6," by "),h.rc(7,"b"),h.qd(8),h.qc(),h.qd(9," and agree to be bound by them. "),h.qc()}if(2&e){const e=h.Dc().$implicit;h.Dc(2);const t=h.ad(34),n=h.ad(36);h.Ub(2),h.Mc("ngTemplateOutlet","MYKENANGA"==e.managerCode?t:n)("ngTemplateOutletContext",h.Sc(3,Re,e)),h.Ub(6),h.rd(e.managerName)}}function Ye(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"privacy policy"),h.qc())}function Ke(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1," I provide consent for "),h.rc(2,"b"),h.qd(3),h.qc(),h.qd(4," to process my personal data in accordance with their "),h.od(5,Ye,2,0,"span",28),h.qd(6,". "),h.qc()),2&e){const e=h.Dc().$implicit;h.Dc(2);const t=h.ad(38);h.Ub(3),h.rd(e.managerName),h.Ub(2),h.Mc("ngIf","MYKENANGA"==e.managerCode)("ngIfElse",t)}}function Xe(e,t){if(1&e&&(h.pc(0),h.od(1,We,10,5,"p",10),h.od(2,Ke,7,3,"p",10),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf",e.exist),h.Ub(1),h.Mc("ngIf",e.exist)}}function Qe(e,t){if(1&e){const e=h.sc();h.rc(0,"p"),h.qd(1," My personal information provided through online PRS Application or e-Application will be transmitted to the PPA, and I am bound by the "),h.rc(2,"a",7),h.zc("click",(function(){return h.dd(e),h.Dc(2).onClickPPATnC()})),h.qd(3,"PPA Terms & Conditions."),h.qc(),h.qc()}}function Ze(e,t){1&e&&(h.rc(0,"p"),h.qd(1," I acknowledge and agree that my personal information will be provided by iFAST Capital Sdn Bhd to the relevant product provider or fund manager for completing transactions or services. "),h.qc())}function Je(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold",29),h.od(1,Xe,3,2,"ng-container",9),h.od(2,Qe,4,0,"p",10),h.od(3,Ze,2,0,"p",10),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngForOf",e.prsList),h.Ub(1),h.Mc("ngIf",e.isPrsExist&&e.isFirstBuyPrs),h.Ub(1),h.Mc("ngIf",e.isPrsExist&&e.isFirstBuyPrs)}}function et(e,t){if(1&e){const e=h.sc();h.rc(0,"a",25),h.zc("click",(function(t){return h.dd(e),t.stopPropagation()})),h.qd(1,"Kenanga Customer Consent Form"),h.qc(),h.qd(2," and "),h.rc(3,"a",26),h.zc("click",(function(t){return h.dd(e),t.stopPropagation()})),h.qd(4,"Privacy Policy"),h.qc()}if(2&e){const e=h.Dc();h.Mc("href",e.AppConstant.LIVE_URL+"/articleFiles/Kenanga CO Form.pdf",h.gd)}}function tt(e,t){if(1&e){const e=h.sc();h.rc(0,"a",7),h.zc("click",(function(){h.dd(e);const n=t.prs;return h.Dc().onClickPrivacyNotice(n.managerCode)})),h.qd(1,"Privacy Notice"),h.qc()}}function nt(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"privacy notice"),h.qc())}function it(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",30),h.zc("click",(function(){return h.dd(e),h.Dc().proceedOrderPlaced()})),h.qd(2,"I Agree & Check Out "),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("nzLoading",e.isLoading||e.approving)}}function ct(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"shared-approve-action",31),h.zc("emitCancel",(function(){return h.dd(e),h.Dc().onHandleCancel()}))("onApprove",(function(t){return h.dd(e),h.Dc().onClickApprove(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("refno",e.refno)("requestKey",e.APPROVE_TRADE_REQUEST_KEY)("actionKey",e.UT_BUY_ACTION_KEY)("width",600)}}function ot(e,t){if(1&e){const e=h.sc();h.rc(0,"app-mobile-scaffold"),h.rc(1,"app-annexure-mycimbpri",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.rc(2,"app-annexure-myhwdbs",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.rc(3,"app-annexure-mykenanga",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.rc(4,"app-annexure-myrhbim",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.rc(5,"app-tnc-mycimbpri",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.rc(6,"app-tnc-myhwdbs",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.rc(7,"app-tnc-mykenanga",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()}
1)),h.qc(),h.rc(8,"app-tnc-myrhbim",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.rc(9,"app-ppa-tnc",32),h.zc("closeEvent",(function(){return h.dd(e),h.Dc().onCloseMobileDrawer()})),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("show",e.prsList[0].showAnnexure),h.Ub(1),h.Mc("show",e.prsList[1].showAnnexure),h.Ub(1),h.Mc("show",e.prsList[2].showAnnexure),h.Ub(1),h.Mc("show",e.prsList[3].showAnnexure),h.Ub(1),h.Mc("show",e.prsList[0].showTnc),h.Ub(1),h.Mc("show",e.prsList[1].showTnc),h.Ub(1),h.Mc("show",e.prsList[2].showTnc),h.Ub(1),h.Mc("show",e.prsList[3].showTnc),h.Ub(1),h.Mc("show",e.showPPATnC)}}const st=function(e){return{"py-3 bg-white shadow":e}},at=function(e){return{"bg-white shadow mt-3 mb-6 pt-3 pb-2":e}},lt=function(e){return{"px-2":e}};let rt=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.subHandlingService=t,this.transactionRestService=n,this.router=i,this.transactionService=c,this.twoFaService=o,this.cdRef=s,this.promoCodeApplied=new h.s,this.orderCartConstant=O.a,this.cartDisplayListModel=[],this.buyInfoModelList=[],this.isLoading=!1,this.showBuyTnc=!1,this.showProceedModal=!1,this.showErrorMessageModal=!1,this.containOtherPayMethod=!1,this.isPrsExist=!1,this.isFirstBuyPrs=!1,this.isKIBFund=!1,this.prsList=[{managerCode:M.c.PRINCIPAL_MANAGER_CODE,managerName:M.c.PRINCIPAL_MANAGER_NAME,exist:!1,showAnnexure:!1,showTnc:!1},{managerCode:M.c.AFFIN_HWANG_MANAGER_CODE,managerName:M.c.AFFIN_MANAGER_NAME,exist:!1,showAnnexure:!1,showTnc:!1},{managerCode:M.c.KENANGA_MANAGER_CODE,managerName:M.c.KENANGA_MANAGER_NAME,exist:!1,showAnnexure:!1,showTnc:!1},{managerCode:M.c.RHB_MANAGER_CODE,managerName:M.c.RHB_MANAGER_NAME,exist:!1,showAnnexure:!1,showTnc:!1}],this.showPPATnC=!1,this.showEpfNotice=!1,this.buyInfoModels=[],this.fepBreached=!1,this.approving=!1,this.APPROVE_TRADE_REQUEST_KEY=R.a.APPROVE_TRADE,this.UT_BUY_ACTION_KEY=L.a.UT_BUY,this.AppConstant=M.a,this.detectRefnoChange(),this.subscribeIsMobile()}ngOnInit(){this.store.dispatch(new N.b)}ngOnChanges(e){this.getSelectedInvestmentAcctTradeData()}getCheckOutCartData(){this.cartDisplayListModel=[],this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.checkOutCartData=this.groupByPaymentMethod(e,"paymentCategory"),this.cartDisplayListModel=Object.keys(this.checkOutCartData).map(e=>({title:e,value:this.checkOutCartData[e].value,currencyCode:this.checkOutCartData[e].currencyCode})),this.buyCartData=Object(g.a)(e),this.buyCartData.find(e=>{e.paymentMethod===U.a.PAYMENT_METHOD_EPF&&(this.isEPFPaymentMethod=!0)}),this.buyCartData.forEach(e=>{e.paymentMethod!==U.a.PAYMENT_METHOD_EPF&&(this.containOtherPayMethod=!0)}),this.checkPrsFundExist()})))}groupByPaymentMethod(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.currencyCode},n.push(e[i[t]])),e[i[t]].value+=i.investAmount,e),{})}validateBuyCart(){this.isLoading=!0,this.showProceedModal=!1,this.subHandlingService.once(this.transactionRestService.validateBuy(this.populateBuyInfoModelList(),this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status!==M.a.RESPONSE_FAILED?(this.fepBreached=!1,this.onProceed()):this.fepBreached=e.errorMessage.includes("foreign.exchange.policy.breached")})))}proceedOrderPlaced(){this.isLoading=!0;const e=this.buyInfoModelList.map(e=>(null==e?void 0:e.paymentMethod.includes(U.a.AUTO_SWEEP))?Object.assign(Object.assign({},e),{paymentMethod:U.a.AUTO_SWEEP,paymentMode:U.a.AUTO_SWEEP}):e);this.subHandlingService.once(this.transactionRestService.validateCampaignCode("",e,this.refno).pipe(Object(y.a)(e=>{if(this.isLoading=!1,e.status!==M.a.RESPONSE_SUCCESS)return;let t=0,n=0,i=0;if(this.store.selectSnapshot(u.l).buyUt.forEach(e=>{"1"===e.selectedToken?t+=1:"0.8"===e.selectedToken?n+=1:"0.5"===e.selectedToken&&(i+=1)}),t>e.data.summary.onePercentReferrerToken||n>e.data.summary.zeroPointEightReferrerToken||i>e.data.summary.zeroPointFiveReferrerToken)this.errorMessage="One token can only be used for one fund",this.showErrorMessageModal=!0;else{if(this.checkOutCartData["EPF Account 1"]&&this.checkOutCartData["EPF Account 1"].value<1e3)return void(this.showEpfNotice=!0);let e=!1;this.buyInfoModelList.forEach(t=>{t.paymentMethod.includes(U.a.CHEQUE_FPX)&&(e=!0)}),e?this.showProceedModal=!0:this.validateBuyCart()}})))}onCancel(){this.showProceedModal=!1}onProceed(){this.buyInfoModels=this.populateBuyInfoModelList();const e=[],t=[];
1if(this.buyInfoModels.forEach(n=>{var i;if(n.fundType!==U.a.PRS_FUND.toUpperCase()||n.managerCode!==M.c.PRINCIPAL_MANAGER_CODE&&n.managerCode!==M.c.AFFIN_HWANG_MANAGER_CODE&&n.managerCode!==M.c.KENANGA_MANAGER_CODE)e.push(n);else{const e={amount:n.amount,paymentId:n.paymentId,paymentMethod:n.paymentMethod,salesCharge:null===(i=null==n?void 0:n.salesCharge)||void 0===i?void 0:i.toString(),sedolnumber:n.sedolNumber,cashFundSedol:null==n?void 0:n.cashFundSedol};(null==n?void 0:n.currency)&&(null==n?void 0:n.paymentMethod)===U.a.AUTO_SWEEP&&(e.currency=n.currency),t.push(e)}}),this.fundBuyTransactionModel={buyInfo:e,refno:this.refno,prsTransactionModel:{buyCart:t}},this.buyInfoModelList.find(e=>e.paymentMode.includes(U.a.GOPAYZ)))return this.errorMessage="GoPayz is no longer in Service.",void(this.showErrorMessageModal=!0);this.buyInfoModelList.find(e=>e.paymentMode.includes(U.a.TRUST_ACCOUNT)||e.paymentMode.includes(U.a.AUTO_SWEEP)||e.paymentMode.includes(U.a.CASH_FUND)||e.paymentMode.includes(U.a.EPF_FUNDS.toUpperCase()))?this.checkCredential():this.checkOutWithoutCredential()}fireTncModal(){this.showBuyTnc=!0}onCloseBuyTncModal(){this.showBuyTnc=!1}onCloseErrorMessage(){this.showErrorMessageModal=!1}checkOutWithoutCredential(){this.isLoading=!0,this.subHandlingService.once(this.isMobile||this.isAdditionalInfoReady&&this.isSupportingDocReady?this.transactionRestService.confirmOrderBuyWithPrsContract(this.refno,this.fundBuyTransactionModel).pipe(Object(y.a)(e=>{this.completeCheckout(e)})):this.transactionRestService.confirmOrderBuy(this.refno,this.buyInfoModels).pipe(Object(y.a)(e=>{this.completeCheckout(e)})))}getBuyInfoModel(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.buyInfoModelList=[];for(const t of e)this.buyInfoModelList.push(t.buyInfoModel)})))}promoApplied(e){this.promoCodeApplied.emit(e)}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.l.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getCheckOutCartData(),this.getBuyInfoModel()}detectRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>
1{this.refno=e,this.cdRef.markForCheck(),this.getSelectedInvestmentAcctTradeData()})))}onHandleCancel(){this.isLoading=!1,this.showProceedModal=!1,this.approving=!1}populateBuyInfoModelList(){return this.buyInfoModelList.map(e=>{const t=Object(g.a)(e);return t.paymentMethod.includes(U.a.TRUST_ACCOUNT)&&(t.paymentId=t.paymentMethod.split("|")[1]),t.paymentMethod.includes(U.a.AUTO_SWEEP)&&(t.paymentMethod=U.a.AUTO_SWEEP,t.paymentMode=U.a.AUTO_SWEEP),t.paymentMethod=t.paymentMethod.split("|")[0],t.paymentMode=t.paymentMethod,t})}onClickApprove(e){this.subHandlingService.once(e.pipe(Object(E.a)(e=>this.isMobile||this.isAdditionalInfoReady&&this.isSupportingDocReady?this.transactionRestService.confirmOrderBuyWithPrsContractAndCredential(this.refno,this.fundBuyTransactionModel,e).pipe(this.twoFaService.intercept()):this.transactionRestService.confirmOrderBuyWithCredential(this.refno,this.buyInfoModels,e).pipe(this.twoFaService.intercept())),Object(y.a)(e=>{this.completeCheckout(e)}),Object(F.a)(()=>this.store.dispatch(new N.e(!1,!0)))))}checkCredential(){this.approving=!0}completeCheckout(e){var t;if(this.onHandleCancel(),e.status!==M.a.RESPONSE_SUCCESS)return this.errorMessage=e.errorMessage,void(this.showErrorMessageModal=!0);const n=(null!==(t=this.buyCartData)&&void 0!==t?t:[]).filter(e=>e.fundType===U.a.PRS_FUND.toUpperCase()),i=Date.parse("2026-10-01T00:00:00+08:00"),c=Date.parse("2026-12-16T00:00:00+08:00"),o=Date.now(),s=o>=i&&o<c&&n.some(e=>"MYR"===e.currencyCode&&Number.isFinite(e.investAmount)&&e.investAmount>=3e3);this.purchaseOrderNo=e.data.summary.orderNo,this.transactionService.updateBuyOrderStatusToOrderPlaced(this.refno),this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.ORDER_PLACED)],{queryParams:Object.assign(Object.assign({poNumber:this.purchaseOrderNo,refno:this.refno},n.length>0?{prsFund:"Y"}:{}),s?{prsCampaignComplete:"Y"}:{})})}checkPrsFundExist(){var e,t;this.buyCartData.find(e=>e.managerCode===M.c.KENANGA_MANAGER_CODE)&&(this.isKIBFund=!0),this.buyCartData.find(e=>e.fundType===U.a.PRS_FUND.toUpperCase())&&(this.isSupportingDocReady=null===(e=this.buyCartData.find(e=>e.isSupportingDocReady))||void 0===e?void 0:e.isSupportingDocReady,this.isAdditionalInfoReady=null===(t=this.buyCartData.find(e=>e.isAdditionalInfoReady))||void 0===t?void 0:t.isAdditionalInfoReady,console.log(this.isAdditionalInfoReady,this.isSupportingDocReady)),this.buyCartData.forEach(e=>{e.fundType===U.a.PRS_FUND.toUpperCase()&&this.prsList.forEach(t=>{t.managerCode===e.managerCode&&(t.exist=!0,this.isPrsExist=!0)})}),this.buyCartData.forEach(e=>{this.subHandlingService.once(this.transactionRestService.getPrsFirstBuyAvailableStatus(e.refno,null==e?void 0:e.sedolNumber).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data&&(this.isFirstBuyPrs=!0)})))})}onClickPrivacyNotice(e){this.prsList.forEach(t=>{t.showAnnexure=t.managerCode===e})}onClickAccountTnC(e){this.prsList.forEach(t=>{t.showTnc=t.managerCode===e})}onCloseMobileDrawer(){this.prsList.forEach(e=>{e.showTnc=!1,e.showAnnexure=!1}),this.showPPATnC=!1}onClickPPATnC(){this.showPPATnC=!0}onCloseEpfNotice(){this.showEpfNotice=!1}subscribeIsMobile(){this.subHandlingService.once(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e})))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(T.a),h.lc(c.e),h.lc(C.a),h.lc(x.a),h.lc(h.j))},e.\u0275cmp=h.fc({type:e,selectors:[["buy-checkout-cart-sider"]],outputs:{promoCodeApplied:"promoCodeApplied"},features:[h.Tb([l.a,x.a]),h.Sb],decls:52,vars:50,consts:[[3,"ngClass"],[3,"refno","promoCodeApplied",4,"ngIf"],[1,"font-weight-bold","mb-2"],[1,""],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle",4,"ngFor","ngForOf"],[1,"mt-3",3,"ngClass"],[1,"numbered-paragraphs"],[3,"click"],["class","mt-3",3,"ngClass",4,"ngIf"],[4,"ngFor","ngForOf"],[4,"ngIf"],["class","h5",4,"ngIf"],["usePrivacyPolicy",""],["usedPrivacyNotice",""],["usedprivacynotice",""],["nz-button","","nzType","primary",1,"font-weight-bold","mb-4","mt-3","w-100",3,"nzLoading","click"],[3,"isLoading","show","cancel","proceed"],[3,"isModalVisible","onCloseModal"],[3,"showModal","refno","showModalChange","proceedTransaction"],[3,"errorMessage","showErrorMessageModal","closeErrorMessageModal"],[3,"show","onClose"],[3,"refno","promoCodeApplied"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle"],["horizontal","true","title","Total Inv. Amt.",3,"value"],["valueTemplate",""],["target","_blank",3,"href","click"],["href","https://www.kenangainvestors.com.my/privacy-policy","target","_blank",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngIf","ngIfElse"],[1,"h5"],["nzBlock","","nz-button","","nzType","primary",1,"font-weight-bold",3,"nzLoading","click"],[3,"refno","requestKey","actionKey","width","emitCancel","onApprove"],[3,"show","closeEvent"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.rc(1,"div",0),h.Ec(2,"async"),h.od(3,Ae,1,1,"app-campaign-code-input-box",1),h.Ec(4,"async"),h.qc(),h.qc(),h.rc(5,"div",0),h.Ec(6,"async"),h.rc(7,"div",0),h.Ec(8,"async"),h.rc(9,"p",2),h.qd(10,"Total Investment Amt."),h.qc(),h.rc(11,"div",3),h.od(12,Fe,5,5,"b2c-order-cart",4),h.qc(),h.rc(13,"p",5),h.Ec(14,"async"),h.qd(15," By clicking "),h.rc(16,"strong"),h.qd(17,"\u201cI Agree & Check Out\u201d"),h.qc(),h.qd(18," button: "),h.qc(),h.rc(19,"div",6),h.rc(20,"p",5),h.Ec(21,"async"),h.qd(22," I confirm my trades and agree to the "),h.rc(23,"a",7),h.zc("click",(function(){return t.fireTncModal()})),h.qd(24,"Terms and Conditions"),h.qc(),h.qd(25," on FSMOne. "),h.qc(),h.rc(26,"app-web-scaffold"),h.od(27,Ue,9,6,"p",8),h.od(28,Ve,3,2,"ng-container",9),h.od(29,He,4,0,"p",10),h.od(30,$e,2,0,"p",10),h.qc(),h.od(31,Je,4,3,"app-mobile-scaffold",11),h.Ec(32,"async"),h.od(33,et,5,1,"ng-template",null,12,h.pd),h.od(35,tt,2,0,"ng-template",null,13,h.pd),h.od(37,nt,2,0,"ng-template",null,14,h.pd),h.qc(),h.qc(),h.rc(39,"app-web-scaffold"),h.rc(40,"button",15),h.zc("click",(function(){return t.proceedOrderPlaced()})),h.qd(41,"I Agree & Check Out "),h.qc(),h.qc(),h.qc(),h.rc(42,"app-mobile-scaffold"),h.od(43,it,3,1,"b2c-floating-bar",10),h.qc(),h.rc(44,"app-proceed-order-placed-modal",16),h.zc("cancel",(function(){return t.onCancel()}))("proceed",(function(){return t.validateBuyCart()})),h.qc(),h.rc(45,"buy-tnc-modal",17),h.zc("onCloseModal",(function(){return t.onCloseBuyTncModal()})),h.qc(),h.rc(46,"fep-breached-modal",18),h.zc("showModalChange",(function(e){return t.fepBreached=e}))("proceedTransaction",(function(){return t.onProceed()})),h.qc(),h.rc(47,"checkout-error-message-modal",19),h.zc("closeErrorMessageModal",(function(){return t.onCloseErrorMessage()})),h.qc(),h.od(48,ct,2,4,"ng-container",10),h.od(49,ot,10,9,"app-mobile-scaffold",10),h.Ec(50,"async"),h.rc(51,"app-epf-min-notice-modal",20),h.zc("onClose",(function(){return t.onCloseEpfNotice()})),h.qc()),2&e&&(h.Ub(1),h.Mc("ngClass",h.Sc(40,st,h.Fc(2,24,t.isMobile$))),h.Ub(2),h.Mc("ngIf",!h.Fc(4,26,t.isMobile$)),h.Ub(2),h.Mc("ngClass",h.Sc(42,at,h.Fc(6,28,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(44,lt,h.Fc(8,30,t.isMobile$))),h.Ub(5),h.Mc("ngForOf",t.cartDisplayListModel),h.Ub(1),h.Mc("ngClass",h.Sc(46,Oe,h.Fc(14,32,t.isMobile$))),h.Ub(7),h.Mc("ngClass",h.Sc(48,Oe,h.Fc(21,34,t.isMobile$))),h.Ub(7),h.Mc("ngIf",t.isEPFPaymentMethod&&t.isKIBFund&&!t.containOtherPayMethod),h.Ub(1),h.Mc("ngForOf",t.prsList),h.Ub(1),h.Mc("ngIf",t.isPrsExist&&t.isFirstBuyPrs),h.Ub(1),h.Mc("ngIf",t.isPrsExist&&t.isFirstBuyPrs),h.Ub(1),h.Mc("ngIf",h.Fc(32,36,t.isMobile$)),h.Ub(9),h.Mc("nzLoading",t.isLoading||t.approv
1ing),h.Ub(3),h.Mc("ngIf",!(t.showBuyTnc||t.showProceedModal||t.showErrorMessageModal||t.prsList[0].showAnnexure||t.prsList[1].showAnnexure||t.prsList[2].showAnnexure||t.prsList[0].showTnc||t.prsList[1].showTnc||t.prsList[2].showTnc)),h.Ub(1),h.Mc("isLoading",t.isLoading||t.approving)("show",t.showProceedModal),h.Ub(1),h.Mc("isModalVisible",t.showBuyTnc),h.Ub(1),h.Mc("showModal",t.fepBreached)("refno",t.refno),h.Ub(1),h.Mc("errorMessage",t.errorMessage)("showErrorMessageModal",t.showErrorMessageModal),h.Ub(1),h.Mc("ngIf",t.approving),h.Ub(1),h.Mc("ngIf",h.Fc(50,38,t.isMobile$)),h.Ub(2),h.Mc("show",t.showEpfNotice))},directives:[B.a,p.q,p.t,p.s,_.a,z.a,V.a,H.a,$.a,ne,ie,fe,ge.a,P.c,be.c,p.A,Se.a,ye.a,Me,Ce,qe,Te,we,ze,De,Pe,Ie],pipes:[p.b,ke.a],styles:['.checkout-modal{display:flex;align-items:center;justify-content:center}.numbered-paragraphs[_ngcontent-%COMP%]{counter-reset:paragraph-counter}.numbered-paragraphs[_ngcontent-%COMP%] p[_ngcontent-%COMP%]:before{counter-increment:paragraph-counter;content:counter(paragraph-counter) ". "}']}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();var dt=n("/spw"),ut=n("W1dw"),ht=n("cp0P"),pt=n("ildK"),mt=n("Zk2z"),ft=n("30Lk"),gt=n("k+8e"),bt=n("HMML"),St=n("O4UG"),yt=n("1W/n"),vt=n("URyx"),Mt=n("UYE6"),Ct=n("iel7"),qt=n("IzEk");function Tt(e,t){1&e&&(h.pc(0),h.rc(1,"nz-row",15),h.rc(2,"nz-col",19),h.mc(3,"i",20),h.qc(),h.rc(4,"nz-col",21),h.rc(5,"span"),h.qd(6,"*Subject to 8% SST, applicable to the Sales Charge."),h.qc(),h.qc(),h.qc(),h.oc())}let wt=(()=>{class e{constructor(e){this.utilityRestService=e,this.closeSalesChargeInfo=new h.s,this.systemSstRate=0}ngOnInit(){this.getSystemSstRate()}onCloseSalesChargeInfo(){this.closeSalesChargeInfo.emit()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["sales-charge-modal"]],inputs:{showSalesChargeInfo:"showSalesChargeInfo"},outputs:{closeSalesChargeInfo:"closeSalesChargeInfo"},decls:66,vars:4,consts:[["nzWrapClassName","vertical-center-modal","nzWidth","700",3,"nzFooter","nzClosable","nzVisible","nzOnCancel"],[1,"p-2"],[1,"mt-2"],[1,"w-100"],[1,"pb-2"],[1,"pb-2","text-right"],[1,"py-2"],[1,"mr-2","rounded-circle","d-inline-flex","bg-black-5"],[1,"h6","px-4","py-1","font-weight-bold","text-white"],[1,"py-2","text-right"],[1,"mr-2","rounded-circle","d-inline-flex","bg-bond"],[1,"text-right","py-2"],[1,"mr-2","rounded-circle","d-inline-flex",2,"background-color","#B0AFCC"],[1,"h6","px-3","py-1","font-weight-bold","text-white"],[1,"px-2","py-2"],[1,"pt-2"],["nzSpan","12"],["nzSpan","12",1,"pt-2"],[4,"ngIf"],["nzSpan","1"],["nz-icon","","nzTheme","outline","nzType","info-circle",1,"text-danger","text-md"],["nzSpan","23"],[1,"text-right"],["nz-button","","nzType","primary",1,"mt-4",3,"click"]],template:function(e,t){1&e&&(h.rc(0,"nz-modal",0),h.zc("nzOnCancel",(function(){return t.onCloseSalesChargeInfo()})),h.rc(1,"div",1),h.rc(2,"h3",2),h.qd(3,"Sales Charge Information"),h.qc(),h.rc(4,"table",3),h.rc(5,"tr",4),h.rc(6,"th",4),h.qd(7,"Status"),h.qc(),h.rc(8,"th",4),h.qd(9,"Investment Holdings"),h.qc(),h.rc(10,"th",5),h.qd(11,"UT Max Sales Charge"),h.qc(),h.qc(),h.rc(12,"tr",6),h.rc(13,"td",6),h.rc(14,"div",7),h.rc(15,"span",8),h.qd(16," Silver "),h.qc(),h.qc(),h.qc(),h.rc(17,"td",6),h.qd(18,"Below MYR 250,000"),h.qc(),h.rc(19,"td",9),h.qd(20,"1.50%*"),h.qc(),h.qc(),h.rc(21,"tr",6),h.rc(22,"td",6),h.rc(23,"div",10),h.rc(24,"span",8),h.qd(25," Gold "),h.qc(),h.qc(),h.qc(),h.rc(26,"td",6),h.qd(27,"MYR 250,000 to < MYR 750,000"),h.qc(),h.rc(28,"td",11),h.qd(29,"1.25%*"),h.qc(),h.qc(),h.rc(30,"tr",6),h.rc(31,"td",6),h.rc(32,"div",12),h.rc(33,"span",13),h.qd(34," Platinum "),h.qc(),h.qc(),h.qc(),h.rc(35,"td",6),h.qd(36,"MYR 750,000 and above"),h.qc(),h.rc(37,"td",9),h.qd(38,"1.00%*"),h.qc(),h.qc(),h.qc(),h.mc(39,"hr",14),h.rc(40,"nz-row",15),h.rc(41,"nz-col",16),h.rc(42,"p"),h.qd(43,"Additional 0.25% discount for PLUS status "),h.rc(44,"strong"),h.qd(45,"(Insurance policy holder with FSMOne)"),h.qc(),h.qc(),h.qc(),h.rc(46,"nz-col",17),h.rc(47,"div",7),h.rc(48,"span",8),h.qd(49," Silver+ "),h.qc(),h.qc(),h.rc(50,"div",10),h.rc(51,"span",8),h.qd(52," Gold+ "),h.qc(),h.qc(),h.rc(53,"div",12),h.rc(54,"span",13),h.qd(55," Platinum+ "),h.qc(),h.qc(),h.qc(),h.qc(),h.od(56,Tt,7,0,"ng-container",18),h.rc(57,"nz-row",15),h.rc(58,"nz-col",19),h.mc(59,"i",20),h.qc(),h.rc(60,"nz-col",21),h.rc(61,"span"),h.qd(62,"Either FSMOne Rewards Program or promotional sales charge (whichever is lower, where applicable) will be reflected at the confirmation page."),h.qc(),h.qc(),h.qc(),h.rc(63,"div",22),h.rc(64,"button",23),h.zc("click",(function(){return t.onCloseSalesChargeInfo()})),h.qd(65,"Done"),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&(h.Mc("nzFooter",null)("nzClosable",!0)("nzVisible",t.showSalesChargeInfo),h.Ub(56),h.Mc("ngIf",t.systemSstRate>0))},directives:[j.a,ve.g,ve.e,ve.d,P.c,P.a,p.t,k.b,_.a],styles:[""]}),e})(),zt=(()=>{class e{constructor(){this.onOk=new h.s}ngOnInit(){}onOkPressed(){this.onOk.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-epf-important-notice-modal"]],inputs:{show:"show"},outputs:{onOk:"onOk"},decls:11,vars:2,consts:[["nzWrapClassName","vertical-center-modal",3,"nz
1Visible","nzFooter","nzOnCancel"],[1,"px-3"],["nz-icon","","nzType","info-circle","nzTheme","fill",1,"text-accent-1","d-inline-block","text-lg"],[1,"d-inline-block","pt-1","pl-2"],["nzType","flex",1,"py-3"],[1,"text-right"],["nz-button","","nzType","primary",1,"mx-1",3,"click"]],template:function(e,t){1&e&&(h.rc(0,"nz-modal",0),h.zc("nzOnCancel",(function(){return t.onOkPressed()})),h.rc(1,"div",1),h.mc(2,"i",2),h.rc(3,"h3",3),h.qd(4,"Important Notices"),h.qc(),h.rc(5,"nz-row",4),h.rc(6,"p"),h.qd(7," You will not be able to proceed as only one Fund manager may withdraw your savings from EPF Account 1 for investment at one time. Kindly select funds within the same Fund Manager if you wish to purchase more. "),h.qc(),h.qc(),h.rc(8,"div",5),h.rc(9,"button",6),h.zc("click",(function(){return t.onOkPressed()})),h.qd(10,"OK"),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&h.Mc("nzVisible",t.show)("nzFooter",null)},directives:[j.a,k.b,P.c,_.a],styles:[""]}),e})();var Dt=n("5zlO");function Pt(e,t){if(1&e&&h.nc(0,6),2&e){const e=h.Dc(2);h.Mc("ngTemplateOutlet",e.tooltipTemplate)}}function It(e,t){if(1&e&&(h.rc(0,"p",5),h.qd(1),h.od(2,Pt,1,1,"ng-container",4),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.ud("",e.valuePrefix?e.valuePrefix:null," ",e.value,"",e.valueSuffix?e.valueSuffix:null," "),h.Ub(1),h.Mc("ngIf",e.tooltipTemplate)}}function kt(e,t){if(1&e&&h.nc(0,6),2&e){const e=h.Dc(2);h.Mc("ngTemplateOutlet",e.tooltipTemplate)}}function At(e,t){if(1&e&&(h.rc(0,"p",5),h.qd(1),h.Ec(2,"number"),h.od(3,kt,1,1,"ng-container",4),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.ud("",e.valuePrefix?e.valuePrefix:null," ",h.Gc(2,4,e.value,"1.2-2"),"",e.valueSuffix?e.valueSuffix:null," "),h.Ub(2),h.Mc("ngIf",e.tooltipTemplate)}}function Et(e,t){if(1&e&&h.nc(0,6),2&e){const e=h.Dc();h.Mc("ngTemplateOutlet",e.documentTemplate)}}const Ft=function(e){return{"border-bottom":e}};let Ot=(()=>{class e{constructor(){this.showBorder=!0}ngOnInit(){}isNumber(e){return"number"==typeof e}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["buy-fund-detail-info"]],inputs:{title:"title",value:"value",valuePrefix:"valuePrefix",valueSuffix:"valueSuffix",showBorder:"showBorder",tooltipTemplate:"tooltipTemplate",documentTemplate:"documentTemplate"},decls:7,vars:7,consts:[[1,"row","pt-2","pb-1",3,"ngClass"],[1,"col-8","text-sm","text-left"],[1,"col-4","text-sm","text-right"],["class","m-0",4,"ngIf"],[3,"ngTemplateOutlet",4,"ngIf"],[1,"m-0"],[3,"ngTemplateOutlet"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.qd(2),h.qc(),h.rc(3,"div",2),h.od(4,It,3,4,"p",3),h.od(5,At,4,7,"p",3),h.od(6,Et,1,1,"ng-container",4),h.qc(),h.qc()),2&e&&(h.Mc("ngClass",h.Sc(5,Ft,t.showBorder)),h.Ub(2),h.sd(" ",t.title," "),h.Ub(2),h.Mc("ngIf",!t.isNumber(t.value)&&t.value),h.Ub(1),h.Mc("ngIf",t.isNumber(t.value)&&t.value),h.Ub(1),h.Mc("ngIf",t.documentTemplate))},directives:[p.q,p.t,p.A],pipes:[p.g],styles:[""]}),e})();var Ut=n("bE2y"),xt=n("nJia"),Lt=n("PpG7");let Rt=(()=>{class e{}return e.EMPLOYMENT_STATUS="EMPLOYMENT_STATUS",e.CRS_TIN_REASON="CRS_TIN_REASON",e.CRS_TIN_REASON_OTHERS="CRS_TIN_REASON_OTHERS",e.EMPLOYER_ADDR1="EMPLOYER_ADDR1",e.EMPLOYER_ADDR2="EMPLOYER_ADDR2",e.EMPLOYER_ZIP="EMPLOYER_ZIP",e.EMPLOYER_STATE="EMPLOYER_STATE",e.EMPLOYER_COUNTRY="EMPLOYER_COUNTRY",e.TAX_RESIDENCY_COUNTRY="TAX_RESIDENCY_COUNTRY",e.TIN_NUM="TIN_NUM",e.BUMIPUTRA="BUMIPUTRA",e.SOURCE_OF_FUND="SOURCE_OF_FUND",e})();var Nt=n("P+IN"),Bt=n("xI//"); 2/*! 3 * Signature Pad v3.0.0-beta.3 | https://github.com/szimek/signature_pad 4 * (c) 2018 Szymon Nowak | Released under the MIT license 5 */class _t{constructor(e,t,n){this.x=e,this.y=t,this.time=n||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}}class Vt{constructor(e,t,n,i,c,o){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=i,this.startWidth=c,this.endWidth=o}static fromPoints(e,t){const n=this.calculateControlPoints(e[0],e[1],e[2]).c2,i=this.calculateControlPoints(e[1],e[2],e[3]).c1;return new Vt(e[1],n,i,e[2],t.start,t.end)}
vendor: 8,055 bytes, line 5
5static calculateControlPoints(e,t,n){const i=e.x-t.x,c=e.y-t.y,o=t.x-n.x,s=t.y-n.y,a=(e.x+t.x)/2,l=(e.y+t.y)/2,r=(t.x+n.x)/2,d=(t.y+n.y)/2,u=Math.sqrt(i*i+c*c),h=Math.sqrt(o*o+s*s),p=h/(u+h),m=t.x-(r+(a-r)*p),f=t.y-(d+(l-d)*p);return{c1:new _t(a+m,l+f),c2:new _t(r+m,d+f)}}length(){let e,t,n=0;for(let i=0;i<=10;i+=1){const c=i/10,o=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),s=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(i>0){const i=o-e,c=s-t;n+=Math.sqrt(i*i+c*c)}e=o,t=s}return n}point(e,t,n,i,c){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*i*(1-e)*e*e+c*e*e*e}}class Ht{constructor(e,t={}){this.canvas=e,this.options=t,this._handleMouseDown=e=>{1===e.which&&(this._mouseButtonDown=!0,this._strokeBegin(e))},this._handleMouseMove=e=>{this._mouseButtonDown&&this._strokeMoveUpdate(e)},this._handleMouseUp=e=>{1===e.which&&this._mouseButtonDown&&(this._mouseButtonDown=!1,this._strokeEnd(e))},this._handleTouchStart=e=>{e.preventDefault(),1===e.targetTouches.length&&this._strokeBegin(e.changedTouches[0])},this._handleTouchMove=e=>{e.preventDefault(),this._strokeMoveUpdate(e.targetTouches[0])},this._handleTouchEnd=e=>{e.target===this.canvas&&(e.preventDefault(),this._strokeEnd(e.changedTouches[0]))},this.velocityFilterWeight=t.velocityFilterWeight||.7,this.minWidth=t.minWidth||.5,this.maxWidth=t.maxWidth||2.5,this.throttle="throttle"in t?t.throttle:16,this.minDistance="minDistance"in t?t.minDistance:5,this._strokeMoveUpdate=this.throttle?function(e,t=250){let n,i,c,o=0,s=null;const a=()=>{o=Date.now(),s=null,n=e.apply(i,c),s||(i=null,c=[])};return function(...l){const r=Date.now(),d=t-(r-o);return i=this,c=l,d<=0||d>t?(s&&(clearTimeout(s),s=null),o=r,n=e.apply(i,c),s||(i=null,c=[])):s||(s=window.setTimeout(a,d)),n}}(Ht.prototype._strokeUpdate,this.throttle):Ht.prototype._strokeUpdate,this.dotSize=t.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=t.penColor||"black",this.backgroundColor=t.backgroundColor||"rgba(0,0,0,0)",this.onBegin=t.onBegin,this.onEnd=t.onEnd,this._ctx=e.getContext("2d"),this.clear(),this.on()}clear(){const e=this._ctx,t=this.canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0}fromDataURL(e,t={},n){const i=new Image,c=t.ratio||window.devicePixelRatio||1,o=t.width||this.canvas.width/c,s=t.height||this.canvas.height/c;this._reset(),i.onload=()=>{this._ctx.drawImage(i,0,0,o,s),n&&n()},i.onerror=e=>{n&&n(e)},i.src=e,this._isEmpty=!1}toDataURL(e="image/png",t){switch(e){case"image/svg+xml":return this._toSVG();default:return this.canvas.toDataURL(e,t)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",window.PointerEvent?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.removeEventListener("pointerdown",this._handleMouseDown),this.canvas.removeEventListener("pointermove",this._handleMouseMove),document.removeEventListener("pointerup",this._handleMouseUp),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this.canvas.removeEventListener("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(e){this.clear(),this._fromData(e,({color:e,curve:t})=>this._drawCurve({color:e,curve:t}),({color:e,point:t})=>this._drawDot({color:e,point:t})),this._data=e}toData(){return this._data}_strokeBegin(e){this._data.push({color:this.penColor,points:[]}),this._reset(),this._strokeUpdate(e),"function"==typeof this.onBegin&&this.onBegin(e)}_strokeUpdate(e){const t=this._createPoint(e.clientX,e.clientY),n=this._data[this._data.length-1],i=n.points,c=i.length>0&&i[i.length-1],o=!!c&&t.distanceTo(c)<=this.minDistance,s=n.color;if(!c||!c||!o){const e=this._addPoint(t);c?e&&this._drawCurve({color:s,curve:e}):this._drawDot({color:s,point:t}),i.push({time:t.time,x:t.x,y:t.y})}}_strokeEnd(e){this._strokeUpdate(e),"function"==typeof this.onEnd&&this.onEnd(e)}_handlePointerEvents(){this._mouseButtonDown=!1,this.canvas.addEventListener("pointerdown",this._handleMouseDown),this.canvas.addEventListener("pointermove",this._handleMouseMove),document.addEventListener("pointerup",this._handleMouseUp)}_handleMouseEvents(){this._mouseButtonDown=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown),this.canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart),this.canvas.addEventListener("touchmove",this._handleTouchMove),this.canvas.addEventListener("touchend",this._handleTouchEnd)}_reset(){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor}_createPoint(e,t){const n=this.canvas.getBoundingClientRect();return new _t(e-n.left,t-n.top,(new Date).getTime())}_addPoint(e){const{_lastPoints:t}=this;if(t.push(e),t.length>2){3===t.length&&t.unshift(t[0]);const e=this._calculateCurveWidths(t[1],t[2]),n=Vt.fromPoints(t,e);return t.shift(),n}return null}_calculateCurveWidths(e,t){const n=this.velocityFilterWeight*t.velocityFrom(e)+(1-this.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(n),c={end:i,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=i,c}_strokeWidth(e){return Math.max(this.maxWidth/(e+1),this.minWidth)}_drawCurveSegment(e,t,n){const i=this._ctx;i.moveTo(e,t),i.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve({color:e,curve:t}){const n=this._ctx,i=t.endWidth-t.startWidth,c=2*Math.floor(t.length());n.beginPath(),n.fillStyle=e;for(let o=0;o<c;o+=1){const e=o/c,n=e*e,s=n*e,a=1-e,l=a*a,r=l*a;let d=r*t.startPoint.x;d+=3*l*e*t.control1.x,d+=3*a*n*t.control2.x,d+=s*t.endPoint.x;let u=r*t.startPoint.y;u+=3*l*e*t.control1.y,u+=3*a*n*t.control2.y,u+=s*t.endPoint.y,this._drawCurveSegment(d,u,t.startWidth+s*i)}n.closePath(),n.fill()}_drawDot({color:e,point:t}){const n=this._ctx,i="function"==typeof this.dotSize?this.dotSize():this.dotSize;n.beginPath(),this._drawCurveSegment(t.x,t.y,i),n.closePath(),n.fillStyle=e,n.fill()}_fromData(e,t,n){for(const i of e){const{color:e,points:c}=i;if(c.length>1)for(let n=0;n<c.length;n+=1){const i=c[n],o=new _t(i.x,i.y,i.time);this.penColor=e,0===n&&this._reset();const s=this._addPoint(o);s&&t({color:e,curve:s})}else this._reset(),n({color:e,point:c[0]})}}_toSVG(){const e=this._data,t=Math.max(window.devicePixelRatio||1,1),n=this.canvas.width/t,i=this.canvas.height/t,c=document.createElementNS("http://www.w3.org/2000/svg","svg");c.setAttribute("width",this.canvas.width.toString()),c.setAttribute("height",this.canvas.height.toString()),this._fromData(e,({color:e,curve:t})=>{const n=document.createElement("path");if(!(isNaN(t.control1.x)||isNaN(t.control1.y)||isNaN(t.control2.x)||isNaN(t.control2.y))){const i=`M ${t.startPoint.x.toFixed(3)},${t.startPoint.y.toFixed(3)} C ${t.control1.x.toFixed(3)},${t.control1.y.toFixed(3)} ${t.control2.x.toFixed(3)},${t.control2.y.toFixed(3)} ${t.endPoint.x.toFixed(3)},${t.endPoint.y.toFixed(3)}`;n.setAttribute("d",i),n.setAttribute("stroke-width",(2.25*t.endWidth).toFixed(3)),n.setAttribute("stroke",e),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),c.appendChild(n)}},({color:e,point:t})=>{const n=document.createElement("circle"),i="function"==typeof this.dotSize?this.dotSize():this.dotSize;n.setAttribute("r",i.toString()),n.setAttribute("cx",t.x.toString()),n.setAttribute("cy",t.y.toString()),n.setAttribute("fill",e),c.appendChild(n)});const o=`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewB
5ox="0 0 ${n} ${i}" width="${n}" height="${i}">`;let s=c.innerHTML;if(void 0===s){const e=document.createElement("dummy"),t=c.childNodes;e.innerHTML="";for(let n=0;n<t.length;n+=1)e.appendChild(t[n].cloneNode(!0));s=e.innerHTML}return"data:image/svg+xml;base64,"+btoa(o+s+"</svg>")}}var $t=Ht,jt=n("XNiG"),Gt=n("F70u");const Wt=["canvas"];let Yt=(()=>{class e{constructor(){this.joint=!1,this.empty=!0,this.signatureEndSubject=new jt.a}ngAfterViewInit(){if(this.canvas){this.signaturePad=new $t(this.canvas.nativeElement),this.signaturePad.onEnd=this.onSignatureEnd.bind(this),this.empty=this.signaturePad.isEmpty();const e=Math.min(window.innerWidth,800);this.signaturePad.canvas.width=.8*e}this.signatureEndSubject.pipe(Object(y.a)(e=>{this.onChangeFn&&(this.onChangeFn(e),this.empty=this.signaturePad.isEmpty())})).subscribe()}ngOnDestroy(){this.signaturePad&&this.signaturePad.off()}registerOnChange(e){this.onChangeFn=e}registerOnTouched(e){this.onTouchFn=e}writeValue(e){this.signaturePad?this.signaturePad.fromDataURL(e):this.storedSignature=e}setDisabledState(e){}clear(){this.signaturePad&&(this.signaturePad.clear(),this.signatureEndSubject.next(""),this.empty=this.signaturePad.isEmpty())}onSignatureEnd(){this.signatureEndSubject.next(this.signaturePad.toDataURL(Gt.a.PNG,1))}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["signature-pad"]],viewQuery:function(e,t){var n;1&e&&h.yd(Wt,!0),2&e&&h.Zc(n=h.Ac())&&(t.canvas=n.first)},inputs:{joint:"joint"},features:[h.Tb([{provide:oe.r,useExisting:e,multi:!0}])],decls:6,vars:0,consts:[[1,"signature-pad"],[1,"bg-white","border","mb-2"],["canvas",""],["nzSize","small","nz-button","","nzType","outline",3,"click"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.mc(2,"canvas",null,2),h.qc(),h.rc(4,"button",3),h.zc("click",(function(){return t.clear()})),h.qd(5,"Clear"),h.qc(),h.qc())},directives:[_.a],styles:[""]}),e})();function Kt(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function Xt(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function Qt(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",24),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.bumiputraFlag=t})),h.od(1,Xt,1,2,"ui-option",9),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("ngModel",e.prsAddInfoModel.bumiputraFlag),h.Ub(1),h.Mc("ngForOf",e.bumiputraList)}}function Zt(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function Jt(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function en(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",25),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.sourceOfFund=t})),h.od(1,Jt,1,2,"ui-option",9),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("ngModel",e.prsAddInfoModel.sourceOfFund),h.Ub(1),h.Mc("ngForOf",e.sourceOfFundList)}}function tn(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function nn(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function cn(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-input-group",26),h.rc(1,"input",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.occupNatureOther=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.occupNatureOther)}}function on(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-input-group",27),h.rc(1,"input",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.employerAddress1=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.employerAddress1)}}function sn(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-input-group",28),h.rc(1,"input",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.employerAddress2=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.employerAddress2)}}function an(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-input-group",29),h.rc(1,"input",30),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.employerZip=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.employerZip)}}function ln(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function rn(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",31),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.employerState=t})),h.od(1,ln,1,2,"ui-option",9),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("ngModel",e.prsAddInfoModel.employerState),h.Ub(1),h.Mc("ngForOf",e.stateList)}}function dn(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function un(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",32),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).prsAddInfoModel.employerCountry=t})),h.od(1,dn,1,2,"ui-option",9),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("ngModel",e.prsAddInfoModel.employerCountry),h.Ub(1),h.Mc("ngForOf",e.countriesOptions)}}function hn(e,t){if(1&e&&(h.rc(0,"label",36),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function pn(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function mn(e,t){if(1&e&&(h.rc(0,"label",36),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function fn(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-input-group",41),h.rc(1,"input",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(4).prsAddInfoModel.tinNum=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(4);h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.tinNum)}}function gn(e,t){if(1&e&&h.mc(0,"ui-option",23),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function bn(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",42),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(4).prsAddInfoModel.crsTinReason=t})),h.od(1,gn,1,2,"ui-option",9),h.qc()}if(2&e){const e=h.Dc(4);h.Mc("ngModel",e.prsAddInfoModel.crsTinReason),h.Ub(1),h.Mc("ngForOf",e.crsTinReasonList)}}function Sn(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-input-group",43),h.rc(1,"input",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(4).prsAddInfoModel.crsTinReasonOthers=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(4);h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.crsTinReasonOthers)}}function yn(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"ui-select",37),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).prsAddInfoModel.taxResidencyCountry=t})),h.od(2,pn,1,2,"ui-option",9),h.qc(),h.rc(3,"p",33),h.Ec(4,"async"),h.qd(5,"Select YES if TIN number is unavailable"),h.qc(),h.rc(6,"nz-radio-group",34),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).isTinNumberUnavailable=t}))("ngModelChange",(function(){return h.dd(e),h.Dc(3).onIsTinNumberUnavailableChange()})),h.od(7,mn,2,2,"label",35),h.qc(),h.od(8,fn,2,1,"ui-input-group",38),h.od(9,bn,2,2,"ui-select",39),h.od(10,Sn,2,1,"ui-input-group",40),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.taxResidencyCountry),h.Ub(1),h.Mc("ngForOf",e.taxResidencyCountryOptions),h.Ub(1),h.Mc("ngClass",h.Fc(4,10,e.isMobile$)?"h5":"text-base"),h.Ub(3),h.Mc("ngModel",e.isTinNumberUnavailable)("nzButtonStyle","solid")("nzSize","small"),h.Ub(1),h.Mc("ngForOf",e.yesNoBooleanOptions),h.Ub(1),h.Mc("ngIf",!e.isTinNumberUnavailable),h.Ub(1),h.Mc("ngIf",e.isTinNumberUnavailable),h.Ub(1),h.Mc("ngIf","3"===e.prsAddInfoModel.crsTinReason&&e.isTinNumberUnavailable)}}function vn(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"p",5),h.qd(2,"Tax Residency Details"),h.qc(),h.rc(3,"p",33),h.Ec(4,"async"),h.qd(5,"Are you a tax resident in any jurisdiction(s) outside of Malaysia?"),h.qc(),h.rc(6,"nz-radio-group",34),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).isTaxResidentOutsideMy=t}))("ngModelChange",(function(){return h.dd(e),h.Dc(2).onIsTaxResidentOutsideMyChange()})),h.od(7,hn,2,2,"label",35),h.qc(),h.od(8,yn,11,12,"ng-container",21),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.Mc("ngClass",h.Fc(4,6,e.isMobile$)?"h5":"text-base"),h.Ub(3),h.Mc("ngModel",e.isTaxResidentOutsideMy)("nzButtonStyle","solid")("nzSize","small"),h.Ub(1),h.Mc("ngForOf",e.yesNoBooleanOptions),h.Ub(1),h.Mc("ngIf",e.isTaxResidentOutsideMy)}}function Mn(e,t){if(1&e){const e=h.sc();h.rc(0,"div",4),h.rc(1,"p",5),h.qd(2,"PRS Additional Information"),h.qc(),h.rc(3,"ui-input-group",6),h.rc(4,"input",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().prsAdd
5InfoModel.motherMaidenName=t})),h.qc(),h.qc(),h.rc(5,"ui-select",8),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().prsAddInfoModel.maritalStatus=t})),h.od(6,Kt,1,2,"ui-option",9),h.qc(),h.od(7,Qt,2,2,"ui-select",10),h.rc(8,"ui-select",11),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().prsAddInfoModel.monthlyHouseholdIncome=t})),h.od(9,Zt,1,2,"ui-option",9),h.qc(),h.od(10,en,2,2,"ui-select",12),h.rc(11,"p",5),h.qd(12,"Employment Details"),h.qc(),h.rc(13,"ui-select",13),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().prsAddInfoModel.employmentStatus=t})),h.od(14,tn,1,2,"ui-option",9),h.qc(),h.rc(15,"ui-select",14),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().prsAddInfoModel.natureOccupation=t})),h.od(16,nn,1,2,"ui-option",9),h.qc(),h.od(17,cn,2,1,"ui-input-group",15),h.od(18,on,2,1,"ui-input-group",16),h.od(19,sn,2,1,"ui-input-group",17),h.od(20,an,2,1,"ui-input-group",18),h.od(21,rn,2,2,"ui-select",19),h.od(22,un,2,2,"ui-select",20),h.od(23,vn,9,8,"ng-container",21),h.rc(24,"p",5),h.qd(25,"Main Applicant's Signature"),h.qc(),h.rc(26,"signature-pad",22),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().prsAddInfoModel.documentSignatureData=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(4),h.Mc("ngModel",e.prsAddInfoModel.motherMaidenName),h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.maritalStatus),h.Ub(1),h.Mc("ngForOf",e.maritalStatusList),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.BUMIPUTRA)),h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.monthlyHouseholdIncome),h.Ub(1),h.Mc("ngForOf",e.monthyIncomeList),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.SOURCE_OF_FUND)),h.Ub(3),h.Mc("ngModel",e.prsAddInfoModel.employmentStatus),h.Ub(1),h.Mc("ngForOf",e.employStatusList),h.Ub(1),h.Mc("ngModel",e.prsAddInfoModel.natureOccupation),h.Ub(1),h.Mc("ngForOf",e.occupNatureList),h.Ub(1),h.Mc("ngIf","other"===e.prsAddInfoModel.natureOccupation),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.EMPLOYER_ADDR1)),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.EMPLOYER_ADDR2)),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.EMPLOYER_ZIP)),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.EMPLOYER_STATE)),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.EMPLOYER_COUNTRY)),h.Ub(1),h.Mc("ngIf",e.requiredField.includes(e.prsAdditionalInfoConstant.TAX_RESIDENCY_COUNTRY)),h.Ub(3),h.Mc("ngModel",e.prsAddInfoModel.documentSignatureData)}}function Cn(e,t){if(1&e&&(h.rc(0,"div",44),h.mc(1,"nz-skeleton",45),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("nzLoading",e.isLoading)("nzActive",!0)}}let qn=(()=>{class e{constructor(e,t){this.subHandlingService=e,this.utilityService=t,this.requiredField=[],this.closePrsAddInfo=new h.s,this.onProceedPrsAddInfo=new h.s,this.prsAddInfoModel={maritalStatus:"single",bumiputraFlag:"N",monthlyHouseholdIncome:"3000to5000",employmentStatus:"self",natureOccupation:"finance/insurance/property",occupNatureOther:null,motherMaidenName:null,documentSignatureData:null,documentSignatureFilename:this.refno+"_signature.png",crsTinReason:null,crsTinReasonOthers:null,employerAddress1:null,employerAddress2:null,employerZip:null,employerState:null,employerCountry:null,taxResidencyCountry:null,tinNum:null,sourceOfFund:"business"},this.isTaxResidentOutsideMy=!1,this.yesNoBooleanOptions=Nt.a.YES_NO_BOOLEAN_OPTIONS,this.isTinNumberUnavailable=!1,this.maritalStatusList=[{label:"Single",value:"single"},{label:"Married",value:"married"},{label:"Widowed",value:"widowed"},{label:"Other",value:"other"}],this.bumiputraList=[{label:"Yes",value:"Y"},{label:"No",value:"N"}],this.monthyIncomeList=[{label:"Not Applicable",value:"notApplicable"},{label:"Below RM1,500",value:"below1500"},{label:"RM1,500 - RM3,000",value:"1500to3000"},{label:"RM3,001 - RM5,000",value:"3000to5000"},{label:"RM5,001 - RM8,000",value:"5000to8000"},{label:"RM8,001 - RM15,000",value:"8000to15000"},{label:"RM15,001 - RM20,000",value:"15000to20000"},{label:"RM20,001 - RM50,000",value:"20000to50000"},{label:"RM50,001 - RM100,000",value:"50000to100000"},{label:"RM100,001 - RM200,000",value:"100000to200000"},{label:"Above RM200,00",value:"above200000"}
5],this.employStatusList=[{label:"Self-Employed",value:"self"},{label:"Employed",value:"employed"},{label:"Not Applicable",value:"notapplicable"}],this.occupNatureList=[{label:"Agriculture/Forestry",value:"agriculture/forestry"},{label:"Construction",value:"construction"},{label:"Education/Health",value:"education/health"},{label:"Electricity/Gas/Water",value:"electricity/gas/water"},{label:"Finance/Insurance/Property",value:"finance/insurance/property"},{label:"Manufacturing",value:"manufacturing"},{label:"Mining/Quarrying",value:"mining/quarrying"},{label:"Social/Personal Service",value:"social/personalService"},{label:"Trading/Restaurant/Hotel",value:"trading/restaurant/hotel"},{label:"Transport/Storage/Communication",value:"transport/storage/communication"},{label:"Other",value:"other"}],this.sourceOfFundList=Nt.a.SOURCE_FUNDS_OPTIONS,this.crsTinReasonList=[{label:"The country/jurisdiction of tax residence does not issue TINs to its residents",value:"1"},{label:"No TIN is required. (Note: Only select this reason if the domestic law of the relevant jurisdiction does not require the collection of TIN issued by such jurisdiction)",value:"2"},{label:"No TIN because of other reasons",value:"3"}],this.prsAdditionalInfoConstant=Rt,this.countriesOptions=[],this.taxResidencyCountryOptions=[],this.stateList=[{value:"Johor",label:"Johor"},{value:"Kedah",label:"Kedah"},{value:"Kelantan",label:"Kelantan"},{value:"Melaka",label:"Melaka"},{value:"Negeri Sembilan",label:"Negeri Sembilan"},{value:"Pahang",label:"Pahang"},{value:"Perak",label:"Perak"},{value:"Perlis",label:"Perlis"},{value:"Pulau Pinang",label:"Pulau Pinang"},{value:"Sabah",label:"Sabah"},{value:"Sarawak",label:"Sarawak"},{value:"Selangor",label:"Selangor"},{value:"Terengganu",label:"Terengganu"},{value:"W.P Kuala Lumpur",label:"W.P Kuala Lumpur"},{value:"W.P Labuan",label:"W.P Labuan"},{value:"W.P Putrajaya",label:"W.P Putrajaya"}]}ngOnInit(){this.isLoading=!0,this.subHandlingService.subscribe(this.utilityService.findCountries().pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.countriesOptions=e.data.map(e=>({label:e.countryName,value:e.countryId})),this.taxResidencyCountryOptions=this.countriesOptions.filter(e=>e.value!==M.a.MY&&"US"!==e.value))})))}onClosePrsAddInfo(){this.closePrsAddInfo.emit()}addToCart(){this.showPrsAddInfo=!1,this.onProceedPrsAddInfo.emit(this.prsAddInfoModel)}onIsTaxResidentOutsideMyChange(){this.isTaxResidentOutsideMy||(this.prsAddInfoModel.crsTinReasonOthers=null,this.prsAddInfoModel.crsTinReason=null,this.prsAddInfoModel.taxResidencyCountry=null,this.prsAddInfoModel.tinNum=null)}onIsTinNumberUnavailableChange(){this.isTinNumberUnavailable?this.prsAddInfoModel.tinNum=null:(this.prsAddInfoModel.crsTinReason=null,this.prsAddInfoModel.crsTinReasonOthers=null)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["prs-add-info"]],inputs:{showPrsAddInfo:"showPrsAddInfo",isSupportingDocNeed:"isSupportingDocNeed",refno:"refno",requiredField:"requiredField"},outputs:{closePrsAddInfo:"closePrsAddInfo",onProceedPrsAddInfo:"onProceedPrsAddInfo"},decls:7,vars:5,consts:[[3,"title","back"],["class","py-3 px-2 bg-white w-100 mb-6 shadow",4,"ngIf","ngIfElse"],["nz-button","","nzType","primary","nzBlock","",3,"disabled","click"],["loadingTemplate",""],[1,"py-3","px-2","bg-white","w-100","mb-6","shadow"],[1,"font-weight-bold","mb-2"],["nzLabelPlaceholder","Mother Maiden's Name",1,"w-100","mb-4"],["type","text","ui-input","",3,"ngModel","ngModelChange"],["nzPlaceHolder","Marital Status",1,"w-100","mb-4",3,"ngModel","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["class","w-100 mb-4","nzPlaceHolder","Bumiputra",3,"ngModel","ngModelChange",4,"ngIf"],["nzPlaceHolder","Monthly Income",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["class","w-100 mb-4","nzPlaceHolder","Investment Source of Fund",3,"ngModel","ngModelChange",4,"ngIf"],["nzPlaceHolder","Employment Status",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["nzPlaceHolder","Occupation Nature",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["nzLabelPlaceholder","Other","class","w-100 mb-2",4,"ngIf"],["class","w-100 mb-4","nzLabelPlaceholder","Employment Address",4,"ngIf"],["class","w-100 mb-4","nzLabelPlaceholder","Employment Address 2",4,"ngIf"],["class","w-100 mb-4","nzLabelPlaceholder","Postal Code",4,"ngIf"],["class","w-100 mb-4","nzPlaceHolder","State",3,"ngModel","ngModelChange",4,"ngIf"],["class","w-100 mb-4","nzPlaceHolder","Country/Region",3,"ngModel","ngModelChange",4,"ngIf"],[4,"ngIf"],[3,"ngModel","ngModelChange"],[3,"nzLabel","nzValue"],["nzPlaceHolder","Bumiputra",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["nzPlaceHolder","Investment Source of Fund",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["nzLabelPlaceholder","Other",1,"w-100","mb-2"],["nzLabelPlaceholder","Employment Address",1,"w-100","mb-4"],["nzLabelPlaceholder","Employment Address 2",1,"w-100","mb-4"],["nzLabelPlaceholder","Postal Code",1,"w-100","mb-4"],["type","number","ui-input","",3,"ngModel","ngModelChange"],["nzPlaceHolder","State",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["nzPlaceHolder","Country/Region",1,"w-100","mb-4",3,"ngModel","ngModelChange"],[1,"font-weight-bold",3,"ngClass"],[1,"mb-3",3,"ngModel","nzButtonStyle","nzSize","ngModelChange"],["nz-radio-button","",3,"nz
5Value",4,"ngFor","ngForOf"],["nz-radio-button","",3,"nzValue"],["nzPlaceHolder","Tax Country/Region",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["class","w-100 mb-4","nzLabelPlaceholder","Tax Identification No.(TIN)",4,"ngIf"],["class","w-100 mb-4","nzPlaceHolder","Reason",3,"ngModel","ngModelChange",4,"ngIf"],["class","w-100 mb-4","nzLabelPlaceholder","Other Reason",4,"ngIf"],["nzLabelPlaceholder","Tax Identification No.(TIN)",1,"w-100","mb-4"],["nzPlaceHolder","Reason",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["nzLabelPlaceholder","Other Reason",1,"w-100","mb-4"],[1,"container"],[3,"nzLoading","nzActive"]],template:function(e,t){if(1&e&&(h.rc(0,"b2c-app-bar",0),h.zc("back",(function(){return t.onClosePrsAddInfo()})),h.qc(),h.od(1,Mn,27,19,"div",1),h.rc(2,"b2c-floating-bar"),h.rc(3,"button",2),h.zc("click",(function(){return t.addToCart()})),h.qd(4),h.qc(),h.qc(),h.od(5,Cn,2,2,"ng-template",null,3,h.pd)),2&e){const e=h.ad(6);h.Mc("title","Order Cart"),h.Ub(1),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(2),h.Mc("disabled",!t.prsAddInfoModel.motherMaidenName||!t.prsAddInfoModel.documentSignatureData||t.requiredField.includes(t.prsAdditionalInfoConstant.EMPLOYER_ADDR1)&&!t.prsAddInfoModel.employerAddress1||t.requiredField.includes(t.prsAdditionalInfoConstant.EMPLOYER_ADDR2)&&!t.prsAddInfoModel.employerAddress2||t.requiredField.includes(t.prsAdditionalInfoConstant.EMPLOYER_ZIP)&&!t.prsAddInfoModel.employerZip||t.requiredField.includes(t.prsAdditionalInfoConstant.EMPLOYER_STATE)&&!t.prsAddInfoModel.employerState||t.requiredField.includes(t.prsAdditionalInfoConstant.EMPLOYER_COUNTRY)&&!t.prsAddInfoModel.employerCountry||t.requiredField.includes(t.prsAdditionalInfoConstant.TAX_RESIDENCY_COUNTRY)&&(t.isTaxResidentOutsideMy&&!t.prsAddInfoModel.taxResidencyCountry||t.isTaxResidentOutsideMy&&t.prsAddInfoModel.taxResidencyCountry&&(t.isTinNumberUnavailable&&!t.prsAddInfoModel.crsTinReason||t.isTinNumberUnavailable&&"3"===t.prsAddInfoModel.crsTinReason&&!t.prsAddInfoModel.crsTinReasonOthers||!t.isTinNumberUnavailable&&!t.prsAddInfoModel.tinNum))),h.Ub(1),h.sd(" ",t.isSupportingDocNeed?"Next":"Add To Cart"," ")}},directives:[Bt.a,p.t,Se.a,_.a,ae.c,oe.c,ae.b,oe.t,oe.w,Lt.d,p.s,Yt,Lt.a,oe.z,p.q,Ut.c,Ut.a,W.a],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var Tn=n("4fHl"),wn=n("jsRV"),zn=n("Q1wu"),Dn=n("9HhE"),Pn=n("PTRe");function In(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.qd(1," Please make sure to upload this document "),h.qc())}function kn(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.qd(1," Please make sure to upload this document "),h.qc())}function An(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",11),h.rc(2,"upload-box",12),h.zc("fileRemove",(function(){return h.dd(e),h.Dc().onRemoveFrontNric()}))("fileUpload",(function(t){return h.dd(e),h.Dc().onFrontNricFileUpload(t)})),h.rc(3,"p",13),h.qd(4,"NRIC (Front)"),h.qc(),h.qc(),h.qc(),h.rc(5,"nz-form-item",14),h.rc(6,"nz-form-control"),h.mc(7,"input",15),h.od(8,In,2,0,"nz-form-explain",16),h.qc(),h.qc(),h.rc(9,"div",11),h.rc(10,"upload-box",12),h.zc("fileRemove",(function(){return h.dd(e),h.Dc().onRemoveBackNric()}))("fileUpload",(function(t){return h.dd(e),h.Dc().onBackNricFileUpload(t)})),h.rc(11,"p",13),h.qd(12,"NRIC (Back)"),h.qc(),h.qc(),h.qc(),h.rc(13,"nz-form-item",14),h.rc(14,"nz-form-control"),h.mc(15,"input",15),h.od(16,kn,2,0,"nz-form-explain",16),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(),t=h.ad(17);h.Ub(2),h.Mc("fileList",e.frontNricFileList)("placeholderTemplate",t),h.Ub(5),h.Mc("formControl",e.documentNricFrontData),h.Ub(1),h.Mc("ngIf",e.documentNricFrontData.dirty&&e.documentNricFrontData.hasError("required")),h.Ub(2),h.Mc("fileList",e.backNricFileList)("placeholderTemplate",t),h.Ub(5),h.Mc("formControl",e.documentNricBackData),h.Ub(1),h.Mc("ngIf",e.documentNricBackData.dirty&&e.documentNricBackData.hasError("required"))}}function En(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",19),h.qd(2," Please make sure to upload this document. "),h.qc())}function Fn(e,t){if(1&e){const e=h.sc();h.rc(0,"div",11),h.rc(1,"upload-box",17),h.zc("fileRemove",(function(){return h.dd(e),h.Dc().onRemovePassport()}))("fileUpload",(function(t){return h.dd(e),h.Dc().onPassportFileUpload(t)})),h.rc(2,"div",18),h.Ec(3,"async"),h.rc(4,"span"),h.qd(5,"Passport"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(6,"nz-form-item",14),h.rc(7,"nz-form-control"),h.mc(8,"input",15),h.od(9,En,3,0,"nz-form-explain",16),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(17);h.Ub(1),h.Mc("fileList",e.passportFileList)("placeholderTemplate",t),h.Ub(1),h.Mc("ngClass",h.Fc(3,5,e.isMobile$)?"text-center mb-3 mt-2":"text-left"),h.Ub(6),h.Mc("formControl",e.documentPassportData),h.Ub(1),h.Mc("ngIf",e.documentPassportData.dirty&&e.documentPassportData.hasError("required"))}}function On(e,t){if(1&e&&h.mc(0,"img",20),2&e){const e=h.Dc();h.Mc("src",e.TRANSACTION_IMG_PATH+"upload-nric-icon.svg",h.gd)}}let Un=(()=>{class e{constructor(e,t,n){this.accountOpeningService=e,this.fb=t,this.store=n,this.back=new h.s,this.proceed=new h.s,this.TRANSACTION_IMG_PATH=M.g.TRANSACTION_IMG_PATH,this.frontNricFileList=[],this.backNricFileList=[],this.passportFileList=[],this.isNricId=!0,this.isLoading=!1}ngOnInit(){this.form=this.initForm(),this.checkIdType(),this.patchDocumentFile()}convertDocumentFormDataToFile(e,t,n){if(!n)return null;const i=n.toString().substring(n.toString().indexOf(",")+1);let c=this.accountOpeningService.b64toBlob(i,t);return c.name=e,c.lastModifiedDate=new Date,c}get documentNricFrontData(){return this.form.get("documentNricFrontData")}get documentNricFrontFilename(){return this.form.get("documentNricFrontFilename")}get documentNricFrontFileType(){return this.form.get("documentNricFrontFileType")}get documentNricBackData(){return this.form.get("documentNricBackData")}get documentNricBackFilename(){return this.form.get("documentNricBackFilename")}get documentNricBackFileType(){return this.form.get("documentNricBackFileType")}get documentPassportData(){return this.form.get("documentPassportData")}get documentPassportFilename(){return this.form.get("documentPassportFilename")}get documentPassportFileType(){return this.form.get("documentPassportFileType")}onFrontNricFileUpload(e){this.frontNricFileList=e,Object(Tn.a)(this.frontNricFileList[0]).subscribe(e=>{e&&(e.startsWith("/9j/")?this.documentNricFrontData.patchValue("data:image/jpeg;base64,"+e):this.documentNricFrontData.patchValue(e),this.documentNricFrontFilename.patchValue(this.frontNricFileList[0].name),this.documentNricFrontFileType.patchValue(this.frontNricFileList[0].type))})}onBackNricFileUpload(e){this.backNricFileList=e,Object(Tn.a)(this.backNricFileList[0]).subscribe(e=>{e&&(e.startsWith("/9j/")?this.documentNricBackData.patchValue("data:image/jpeg;base64,"+e):this.documentNricBackData.patchValue(e),this.documentNricBackFilename.patchValue(this.backNricFileList[0].name),this.documentNricBackFileType.patchValue(this.backNricFileList[0].type))})}onPassportFileUpload(e){this.passportFileList=e,Object(Tn.a)(this.passportFileList[0]).subscribe(e=>{e&&(e.startsWith("/9j/")?this.documentPassportData.patchValue("data:image/jpeg;base64,"+e):this.documentPassportData.patchValue(e),this.documentPassportFilename.patchValue(this.passportFileList[0].name),this.documentPassportFileType.patchValue(this.passportFileList[0].type))})}onRemoveFrontNric(){this.documentNricFrontData.reset(),this.documentNricFrontFilename.reset()}onRemoveBackNric(){this.documentNricBackData.reset(),this.documentNricBackFilename.reset()}onRemovePassport(){this.documentPassportData.reset(),this.documentPassportFilename.reset()}checkIdType(){this.isNricId=12===this.store.selectSnapshot(f.a.getAccounts).find(e=>e.refno===this.refno).nric.length,this.isNricId?(this.isNricId=!0,Object(zn.d)([this.documentPassportData]),this.documentNricFrontData.enable(),this.documentNricBackData.enable()):(Object(zn.d)([this.documentNricFrontData,this.documentNricBackData]),this.documentPassportData.enable())}onProceed(){this.isLoading=!0,Object(zn.c)(this.form),Object(zn.b)(this.form),this.form.valid?this.proceed.emit(this.form.value):this.isLoading=!1}onBackPrsAddInfo(){this.back.emit()}patchDocumentFile(){const e=this.convertDocumentFormDataToFile(this.documentNricFrontFilename.value,this.documentNricFrontFileType.value,this.documentNricFrontData.value),t=this.convertDocumentFormDataToFile(this.documentNricBackFilename.value,this.documentNricBackFileType.value,this.documentNricBackData.value),n=this.convertDocumentFormDataToFile(this.documentPassportFilename.value,this.documentPassportFileType.value,this.documentPassportData.value);e&&this.frontNricFileList.push(e),t&&this.backNricFileList.push(t),n&&this.passportFileList.push(n)}initForm(){return this.fb.group({documentNricFrontData:["",[oe.H.required]],documentNricFrontFilename:[""],documentNricFrontFileType:[""],documentNricBackData:["",[oe.H.required]],documentNricBackFilename:[""],documentNricBackFileType:[""],documentPassportData:["",[oe.H.required]],documentPassportFilename:[""],documentPassportFileType:[""]})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(wn.a),h.lc(oe.g),h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["app-supporting-document"]],inputs:{refno:"refno"},outputs:{back:"back",proceed:"proceed"},features:[h.Tb([wn.a])],decls:18,vars:5,consts:[[3,"title","back"],[1,"bg-white","shadow","mb-6"],[1,"py-3","px-2"],[1,"font-weight-bold"],[1,"mb-4"],[1,"text-center","px-2","pb-3"],[4,"ngIf","ngIfElse"],["passportFormTemplate",""],[1,"text-sm","text-muted"],["nz-button","","nzType","primary","nzBlock","",3,"disabled","nzLoading","click"],["nricPlaceholderTemplate",""],[1,"px-6"],[1,"support-doc-img",3,"fileList","placeholderTemplate","fileRemove","fileUpload"],[1,"mt-2","mb-4"],[1,"mb-0"],["nz-input","","type","hidden",3,"formControl"],[4,"ngIf"],[3,"fileList","placeholderTemplate","fileRemove","fileUpload"],[3,"ngClass"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"mr-1"],["alt","NRIC",1,"document-placeholder",3,"src"]],template:function(e,t){if(1&e&&(h.rc(0,"b2c-app-bar",0),h.zc("back",(function(){return t.onBackPrsAddInfo()})),h.qc(),h.rc(1,"div",1),h.rc(2,"div",2),h.rc(3,"p",3),h.qd(4,"Upload Applicant's NRIC"),h.qc(),h.rc(5,"p",4),h.qd(6,"Upload your supporting document so that we can confirm your identity."),h.qc(),h.qc(),h.rc(7,"div",5),h.od(8,An,17,8,"ng-container",6),h.od(9,Fn,10,7,"ng-template",null,7,h.pd),h.rc(11,"div",8),h.qd(12,"We Support JPG, JPEG PNG and PDF format only."),h.qc(),h.qc(),h.rc(13,"b2c-floating-bar"),h.rc(14,"button",9),h.zc("click",(function(){return t.onProceed()})),h.qd(15," Upload & Continue "),h.qc(),h.qc(),h.qc(),h.od(16,On,1,1,"ng-template",null,10,h.pd)),2&e){const e=h.ad(10);h.Mc("title","Order Cart"),h.Ub(8),h.Mc("ngIf",t.isNricId)("ngIfElse",e),h.Ub(6),h.Mc("disabled",!1)("nzLoading",t.isLoading)}},directives:[Bt.a,p.t,Se.a,_.a,Dn.a,se.e,se.a,oe.c,Pn.b,oe.t,oe.i,se.c,p.q,k.b],pi
5pes:[p.b],styles:[".support-doc-img[_ngcontent-%COMP%]{max-width:300px;width:100%;display:inline-block}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var xn=n("sMpQ");function Ln(e,t){1&e&&h.nc(0)}function Rn(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",15),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseModalDialog()})),h.od(1,Ln,1,0,"ng-container",16),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(7);h.Mc("nzClosable",!0)("nzFooter",null)("nzTitle",null)("nzVisible",e.showAddFundDetailsModal),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function Nn(e,t){1&e&&h.nc(0)}function Bn(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"b2c-app-bar-2",17),h.zc("back",(function(){return h.dd(e),h.Dc().onCloseFund()})),h.qc(),h.od(2,Nn,1,0,"ng-container",16),h.oc()}if(2&e){const e=h.Dc(),t=h.ad(7);h.Ub(1),h.Mc("title",e.fromEdit?"Edit Order":"Order Cart"),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function _n(e,t){1&e&&(h.rc(0,"div",43),h.rc(1,"h5"),h.qd(2,"Platform Fee"),h.qc(),h.qc())}function Vn(e,t){1&e&&(h.rc(0,"div",43),h.rc(1,"h5"),h.qd(2,"Redemption Fee"),h.qc(),h.qc())}function Hn(e,t){if(1&e&&(h.rc(0,"div",43),h.rc(1,"p",26),h.qd(2),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.sd("",(null==e.selectedFund?null:e.selectedFund.platformFeeRate)/4," % per quarter")}}function $n(e,t){1&e&&h.nc(0)}function jn(e,t){if(1&e&&(h.rc(0,"div",43),h.rc(1,"p",26),h.qd(2),h.mc(3,"i",44),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.sd("",null!=e.selectedFund&&e.selectedFund.redemptionFee?null==e.selectedFund?null:e.selectedFund.redemptionFee:null==e.selectedFund?null:e.selectedFund.redemptionCharge," % ")}}function Gn(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",22),h.rc(2,"div",23),h.rc(3,"h5"),h.qd(4,"Redemption Fee"),h.qc(),h.qc(),h.qc(),h.rc(5,"p",26),h.qd(6),h.mc(7,"i",44),h.qc(),h.oc()),2&e){const e=h.Dc(2);h.Ub(6),h.sd("",null!=e.selectedFund&&e.selectedFund.redemptionFee?null==e.selectedFund?null:e.selectedFund.redemptionFee:null==e.selectedFund?null:e.selectedFund.redemptionCharge," % ")}}function Wn(e,t){if(1&e){const e=h.sc();h.rc(0,"i",27),h.zc("click",(function(){return h.dd(e),h.Dc(2).onShowSalesChargeInfo()})),h.qc()}}function Yn(e,t){if(1&e&&h.mc(0,"buy-fund-detail-info",45),2&e){const e=h.Dc(2);h.Mc("showBorder",!0)("title","Platform Fee")("value",(null==e.selectedFund?null:e.selectedFund.platformFeeRate)/4)("valueSuffix","% per quarter")}}function Kn(e,t){1&e&&h.mc(0,"i",44)}function Xn(e,t){if(1&e&&(h.rc(0,"buy-fund-detail-info",29),h.od(1,Kn,1,0,"ng-template",null,46,h.pd),h.qc()),2&e){const e=h.ad(2),t=h.Dc(2);h.Mc("showBorder",!0)("title","Redemption Fee")("value",null!=t.selectedFund&&t.selectedFund.redemptionFee?(null==t.selectedFund?null:t.selectedFund.redemptionFee)||"0":(null==t.selectedFund?null:t.selectedFund.redemptionCharge)||"0")("valueSuffix","%")("tooltipTemplate",e)}}function Qn(e,t){if(1&e&&(h.rc(0,"label",47),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.sd(" ",e.label," ")}}function Zn(e,t){1&e&&(h.rc(0,"p",50),h.qd(1,"This fund is currently closed for EPF subscription. For more information please contact our client services."),h.qc())}function Jn(e,t){if(1&e&&h.mc(0,"ui-option",65),2&e){const e=t.$implicit;h.Mc("nzLabel",e)("nzValue",e)}}function ei(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"ui-select",64),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(4).onCurrencyChange(t)}))("ngModelChange",(function(t){return h.dd(e),h.Dc(4).selectedCurrency=t})),h.od(2,Jn,1,2,"ui-option",61),h.qc(),h.oc()}if(2&e){const e=h.Dc(4);h.Ub(1),h.Mc("ngModel",e.selectedCurrency)("nzDisabled",1==e.currencyList.length||(null==e.paymentMethod?null:e.paymentMethod.value.includes(e.transactionConstant.AUTO_SWEEP))||"Cash Fund"===(null==e.paymentMethod?null:e.paymentMethod.value)||"Trust Account"===(null==e.paymentMethod?null:e.paymentMethod.value)||(null==e.paymentMethod?null:e.paymentMethod.value)===e.transactionConstant.GOPAYZ),h.Ub(1),h.Mc("ngForOf",e.currencyList)}}function ti(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",66),h.qd(2," Investment Amt. must be filled. "),h.qc())}function ni(e,t){if(1&e&&(h.pc(0),h.mc(1,"i",66),h.qd(2),h.Ec(3,"currencyFormat"),h.oc()),2&e){const e=h.Dc(5);h.Ub(2),h.sd(" The minimum subsequence investment amt of this fund is ",h.Gc(3,1,e.minSubsequenceAmount,e.currency.value)," ")}}function ii(e,t){if(1&e&&(h.mc(0,"i",66),h.qd(1),h.Ec(2,"currencyFormat")),2&e){const e=h.Dc(5);h.Ub(1),h.sd(" The minimum investment amt of this fund is ",h.Gc(2,1,e.minInitialAmount,e.currency.value)," ")}}function ci(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.od(1,ni,4,4,"ng-container",49),h.od(2,ii,3,4,"ng-template",null,67,h.pd),h.qc()),2&e){const e=h.ad(3),t=h.Dc(4);h.Ub(1),h.Mc("ngIf",t.selectedFund.userExistingFund)("ngIfElse",e)}}function oi(e,t){if(1&e&&(h.rc(0,"div",68),h.mc(1,"i",69),h.qd(2),h.qc()),2&e){const e=h.Dc(4);h.Ub(2),h.sd(" ",e.amount.getError("invalidBuy")," ")}}function si(e,t){if(1&e&&h.mc(0,"ui-option",65),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function ai(e,t){if(1&e&&(h.rc(0,"ui-option",70),h.rc(1,"label"),h.rc(2,"
5span",71),h.qd(3),h.qc(),h.mc(4,"br"),h.rc(5,"span",72),h.qd(6),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value),h.Ub(3),h.rd(null==e?null:e.label),h.Ub(3),h.rd(null==e?null:e.desc)}}const li=function(e){return{"mb-2":e}},ri=function(e){return{"pl-2":e}},di=function(e,t){return{"mb-4":e,"mt-2":t}};function ui(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",51),h.rc(2,"div",36),h.rc(3,"p",52),h.qd(4," Enter Investment Details "),h.qc(),h.qc(),h.rc(5,"div",53),h.Ec(6,"async"),h.Ec(7,"async"),h.od(8,ei,3,3,"ng-container",1),h.qc(),h.rc(9,"div",54),h.Ec(10,"async"),h.Ec(11,"async"),h.rc(12,"form",55),h.rc(13,"nz-form-item",56),h.rc(14,"nz-form-control"),h.rc(15,"ui-input-group",57),h.Ec(16,"currencyFormat"),h.mc(17,"input",58),h.qc(),h.od(18,ti,3,0,"nz-form-explain",1),h.od(19,ci,4,2,"nz-form-explain",1),h.qc(),h.qc(),h.qc(),h.qc(),h.od(20,oi,3,1,"div",59),h.rc(21,"div",54),h.Ec(22,"async"),h.rc(23,"ui-select",60),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).onPaymentMethodChange(t)}
5))("ngModelChange",(function(t){return h.dd(e),h.Dc(3).selectedPaymentMethod=t})),h.od(24,si,1,2,"ui-option",61),h.qc(),h.qc(),h.rc(25,"div",54),h.Ec(26,"async"),h.Ec(27,"async"),h.rc(28,"ui-select",62),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).onDividendInstructionChange(t)}))("ngModelChange",(function(t){return h.dd(e),h.Dc(3).selectedDividendInstruction=t})),h.od(29,ai,7,4,"ui-option",63),h.qc(),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(2),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzSpan",h.Fc(6,21,e.isMobile$)?24:9)("ngClass",h.Sc(38,li,h.Fc(7,23,e.isMobile$))),h.Ub(3),h.Mc("ngIf",e.selectedFund),h.Ub(1),h.Mc("ngClass",h.Sc(40,ri,!h.Fc(10,25,e.isMobile$)))("nzSpan",h.Fc(11,27,e.isMobile$)?24:15),h.Ub(3),h.Mc("formGroup",e.form),h.Ub(3),h.Mc("nzLabelPlaceholder","Investment Amt. (Min. "+h.Gc(16,29,e.selectedFund.userExistingFund?e.minSubsequenceAmount:e.minInitialAmount,e.currency.value)+")"),h.Ub(2),h.Mc("formControl",e.amount),h.Ub(1),h.Mc("ngIf",e.amount.dirty&&e.amount.hasError("required")),h.Ub(1),h.Mc("ngIf",e.amount.dirty&&e.amount.hasError("min")),h.Ub(1),h.Mc("ngIf",e.amount.hasError("invalidBuy")),h.Ub(1),h.Mc("ngClass",h.Sc(42,li,h.Fc(22,32,e.isMobile$)))("nzSpan",24),h.Ub(2),h.Mc("ngModel",e.selectedPaymentMethod),h.Ub(1),h.Mc("ngForOf",e.paymentMethods),h.Ub(1),h.Mc("ngClass",h.Tc(44,di,h.Fc(26,34,e.isMobile$),!h.Fc(27,36,e.isMobile$)))("nzSpan",24),h.Ub(3),h.Mc("ngModel",e.selectedDividendInstruction)("nzDisabled",e.dividendInstructionEditDisabled),h.Ub(1),h.Mc("ngForOf",e.dividendInstructionList)}}function hi(e,t){if(1&e&&(h.pc(0),h.od(1,Zn,2,0,"p",48),h.od(2,ui,30,47,"ng-container",49),h.oc()),2&e){const e=h.Dc(2),t=h.ad(26);h.Ub(1),h.Mc("ngIf",e.isUnsubscribed),h.Ub(1),h.Mc("ngIf",!e.isLoading)("ngIfElse",t)}}function pi(e,t){if(1&e&&h.mc(0,"ui-option",65),2&e){const e=t.$implicit;h.Mc("nzLabel",e)("nzValue",e)}}function mi(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"ui-select",64),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).selectedFund.fundCurrencyCode=t}))("ngModelChange",(function(t){return h.dd(e),h.Dc(3).onCurrencyChange(t)})),h.od(2,pi,1,2,"ui-option",61),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngModel",e.selectedFund.fundCurrencyCode)("nzDisabled",1==e.currencyList.length),h.Ub(1),h.Mc("ngForOf",e.currencyList)}}function fi(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",66),h.qd(2," Investment Amt. must be filled. "),h.qc())}function gi(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(5);h.Ub(1),h.rd(h.Gc(2,1,e.selectedFund.minSubseqNonCash,e.currency.value))}}function bi(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(5);h.Ub(1),h.rd(h.Gc(2,1,e.selectedFund.minSubseqNonCash/e.fixRate,e.currency.value))}}function Si(e,t){if(1&e&&(h.pc(0),h.mc(1,"i",66),h.qd(2," The minimum subsequence investment amt of this fund is "),h.od(3,gi,3,4,"span",1),h.od(4,bi,3,4,"span",1),h.oc()),2&e){const e=h.Dc(4);h.Ub(3),h.Mc("ngIf",e.currency.value===e.transactionConstant.PAYMENT_CURRENCY_MYR),h.Ub(1),h.Mc("ngIf",e.currency.value!==e.transactionConstant.PAYMENT_CURRENCY_MYR)}}function yi(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(5);h.Ub(1),h.rd(h.Gc(2,1,e.selectedFund.minInitialNonCash,e.currency.value))}}function vi(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(5);h.Ub(1),h.rd(h.Gc(2,1,e.selectedFund.minInitialNonCash/e.fixRate,e.currency.value))}}function Mi(e,t){if(1&e&&(h.mc(0,"i",66),h.qd(1," The minimum investment amt of this fund is "),h.od(2,yi,3,4,"p",1),h.od(3,vi,3,4,"p",1)),2&e){const e=h.Dc(4);h.Ub(2),h.Mc("ngIf",e.currency.value===e.transactionConstant.PAYMENT_CURRENCY_MYR),h.Ub(1),h.Mc("ngIf",e.currency.value!==e.transactionConstant.PAYMENT_CURRENCY_MYR)}}function Ci(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.od(1,Si,5,2,"ng-container",49),h.od(2,Mi,4,2,"ng-template",null,67,h.pd),h.qc()),2&e){const e=h.ad(3),t=h.Dc(3);h.Ub(1),h.Mc("ngIf",t.selectedFund.userExistingFundEpf)("ngIfElse",e)}}function qi(e,t){if(1&e&&(h.rc(0,"div",68),h.qd(1),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" ",e.amount.getError("invalidBuy")," ")}}function Ti(e,t){if(1&e&&(h.rc(0,"ui-option",70),h.rc(1,"label"),h.rc(2,"
5span",71),h.qd(3),h.qc(),h.mc(4,"br"),h.rc(5,"span",72),h.qd(6),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value),h.Ub(3),h.rd(null==e?null:e.label),h.Ub(3),h.rd(null==e?null:e.desc)}}const wi=function(e){return{"mb-6 pb-6":e}};function zi(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"p",73),h.qd(2,"Enjoy 0% sales charge when you invest via EPF i-Akaun. Kindly login to your "),h.rc(3,"a",74),h.qd(4,"i-Akaun"),h.qc(),h.qd(5," now to check funds eligibility. "),h.rc(6,"a",75),h.qd(7,"Click here"),h.qc(),h.qd(8," for step by step guide."),h.qc(),h.rc(9,"div",51),h.rc(10,"div",76),h.rc(11,"p",52),h.qd(12," Enter Investment Details "),h.qc(),h.qc(),h.rc(13,"div",53),h.Ec(14,"async"),h.Ec(15,"async"),h.od(16,mi,3,3,"ng-container",1),h.qc(),h.rc(17,"div",54),h.Ec(18,"async"),h.Ec(19,"async"),h.rc(20,"form",55),h.rc(21,"nz-form-item",56),h.rc(22,"nz-form-control"),h.rc(23,"ui-input-group",57),h.mc(24,"input",58),h.qc(),h.od(25,fi,3,0,"nz-form-explain",1),h.od(26,Ci,4,2,"nz-form-explain",1),h.qc(),h.qc(),h.qc(),h.qc(),h.od(27,qi,2,1,"div",59),h.rc(28,"div",77),h.rc(29,"ui-select",78),h.mc(30,"ui-option",79),h.qc(),h.qc(),h.rc(31,"div",54),h.Ec(32,"async"),h.rc(33,"ui-select",62),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).onDividendInstructionChange(t)}))("ngModelChange",(function(t){return h.dd(e),h.Dc(2).selectedDividendInstruction=t})),h.od(34,Ti,7,4,"ui-option",63),h.qc(),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(6),h.Mc("href",e.epfUrl,h.gd),h.Ub(7),h.Mc("nzSpan",h.Fc(14,17,e.isMobile$)?24:9)("ngClass",h.Sc(27,li,h.Fc(15,19,e.isMobile$))),h.Ub(3),h.Mc("ngIf",e.selectedFund),h.Ub(1),h.Mc("ngClass",h.Sc(29,ri,!h.Fc(18,21,e.isMobile$)))("nzSpan",h.Fc(19,23,e.isMobile$)?24:15),h.Ub(3),h.Mc("formGroup",e.form),h.Ub(3),h.Mc("nzLabelPlaceholder","Investment Amt."),h.Ub(1),h.Mc("formControl",e.amount),h.Ub(1),h.Mc("ngIf",e.amount.dirty&&e.amount.hasError("required")),h.Ub(1),h.Mc("ngIf",e.amount.dirty&&e.amount.hasError("min")),h.Ub(1),h.Mc("ngIf",e.amount.hasError("invalidBuy")),h.Ub(4),h.Mc("ngClass",h.Sc(31,wi,h.Fc(32,25,e.isMobile$)))("nzSpan",24),h.Ub(2),h.Mc("ngModel",e.selectedDividendInstruction)("nzDisabled",e.dividendInstructionEditDisabled),h.Ub(1),h.Mc("ngForOf",e.dividendInstructionList)}}function Di(e,t){if(1&e){const e=h.sc();h.rc(0,"div",80),h.rc(1,"button",81),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCloseFund()})),h.qd(2,"Cancel"),h.qc(),h.rc(3,"button",82),h.zc("click",(function(){h.dd(e);const t=h.Dc(2);return t.onAddtoCart(t.transactionConstant.ADD)})),h.qd(4,"Add To Cart "),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.Mc("nzLoading",e.buttonLoading)("disabled",!e.form.valid||e.isLoading)}}function Pi(e,t){if(1&e){const e=h.sc();h.rc(0,"div",80),h.rc(1,"button",81),h.zc("click",(function(){return h.dd(e),h.Dc(2).removeFundFromCart()})),h.qd(2,"Remove Fund"),h.qc(),h.rc(3,"button",83),h.zc("click",(function(){h.dd(e);const t=h.Dc(2);return t.onAddtoCart(t.transactionConstant.UPDATE)})),h.qd(4," Update To Cart "),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.Mc("disabled",!e.amount.valid||e.isLoading)("nzLoading",e.buttonLoading)}}const Ii=function(e){return{"shadow pt-3 px-2 mb-6 border-top":e}},ki=function(e){return{"pt-3":e}};function Ai(e,t){if(1&e){const e=h.sc();h.rc(0,"div",18),h.Ec(1,"async"),h.rc(2,"div",19),h.rc(3,"h3",20),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.redirectToFactsheetPage(null==t.selectedFund?null:t.selectedFund.sedolnumber,null==t.selectedFund?null:t.selectedFund.fundName)})),h.qd(4),h.qc(),h.rc(5,"div",21),h.Ec(6,"async"),h.rc(7,"app-web-scaffold"),h.rc(8,"div",22),h.rc(9,"div",23),h.rc(10,"h5"),h.qd(11,"Sales Charge"),h.qc(),h.qc(),h.od(12,_n,3,0,"div",24),h.rc(13,"div",25),h.rc(14,"h5"),h.qd(15,"Documents"),h.qc(),h.qc(),h.od(16,Vn,3,0,"div",24),h.qc(),h.rc(17,"div",22),h.rc(18,"div",23),h.rc(19,"p",26),h.qd(20),h.rc(21,"i",27),h.zc("click",(function(){return h.dd(e),h.Dc().onShowSalesChargeInfo()})),h.qc(),h.qc(),h.qc(),h.od(22,Hn,3,1,"div",24),h.rc(23,"div",28),h.od(24,$n,1,0,"ng-container",16),h.qc(),h.od(25,jn,4,1,"div",24),h.qc(),h.od(26,Gn,8,1,"ng-container",1),h.qc(),h.rc(27,"app-mobile-scaffold"),h.rc(28,"buy-fund-detail-info",29),h.od(29,Wn,1,0,"ng-template",null,30,h.pd),h.qc(),h.od(31,Yn,1,4,"buy-fund-detail-info",31),h.od(32,Xn,3,5,"buy-fund-detail-info",32),h.mc(33,"buy-fund-detail-info",33),h.mc(34,"buy-fund-detail-info",33),h.mc(35,"buy-fund-detail-info",34),h.qc(),h.qc(),h.rc(36,"div",35),h.rc(37,"div",36),h.rc(38,"p",26),h.qd(39,"Select Investment Account"),h.qc(),h.rc(40,"div",37),h.rc(41,"investment-account-selector",38),h.zc("onSwitchInvestmentAcct",(function(t){return h.dd(e),h.Dc().onChangeInvestmentAccount(t)})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(42,"div",35),h.rc(43,"div",36),h.rc(44,"p",26),h.qd(45,"Select Investment Method"),h.qc(),h.rc(46,"div",37),h.rc(47,"nz-radio-group",39),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedFundForCart.selectedInvestmentMethod=t}))("ngModelChange",(function(t){return h.dd(e),h.Dc().onTabChange(t)}
5)),h.od(48,Qn,2,2,"label",40),h.qc(),h.qc(),h.qc(),h.qc(),h.od(49,hi,3,3,"ng-container",1),h.od(50,zi,35,33,"ng-container",1),h.qc(),h.rc(51,"div",41),h.rc(52,"app-web-scaffold"),h.od(53,Di,5,2,"div",42),h.od(54,Pi,5,2,"div",42),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.ad(30),t=h.Dc(),n=h.ad(10),i=h.ad(12),c=h.ad(14),o=h.ad(16);h.Mc("ngClass",h.Sc(41,Ii,h.Fc(1,37,t.isMobile$))),h.Ub(4),h.sd("",null==t.selectedFund?null:t.selectedFund.fundName," "),h.Ub(1),h.Mc("ngClass",h.Sc(43,ki,!h.Fc(6,39,t.isMobile$))),h.Ub(7),h.Mc("ngIf",0!==(null==t.selectedFund?null:t.selectedFund.platformFeeRate)),h.Ub(4),h.Mc("ngIf",0==(null==t.selectedFund?null:t.selectedFund.platformFeeRate)&&((null==t.selectedFund?null:t.selectedFund.redemptionFee)>0||(null==t.selectedFund?null:t.selectedFund.redemptionCharge)>0)),h.Ub(4),h.sd("",null==t.selectedFund?null:t.selectedFund.initialSalesCharge," % "),h.Ub(2),h.Mc("ngIf",0!==(null==t.selectedFund?null:t.selectedFund.platformFeeRate)),h.Ub(2),h.Mc("ngTemplateOutlet",n),h.Ub(1),h.Mc("ngIf",0==(null==t.selectedFund?null:t.selectedFund.platformFeeRate)&&((null==t.selectedFund?null:t.selectedFund.redemptionFee)>0||(null==t.selectedFund?null:t.selectedFund.redemptionCharge)>0)),h.Ub(1),h.Mc("ngIf",((null==t.selectedFund?null:t.selectedFund.redemptionFee)>0||(null==t.selectedFund?null:t.selectedFund.redemptionCharge)>0)&&0!==(null==t.selectedFund?null:t.selectedFund.platformFeeRate)),h.Ub(2),h.Mc("showBorder",!0)("title","Sales Charge")("value",null==t.selectedFund?null:t.selectedFund.initialSalesCharge)("valueSuffix","%")("tooltipTemplate",e),h.Ub(3),h.Mc("ngIf",0!==(null==t.selectedFund?null:t.selectedFund.platformFeeRate)),h.Ub(1),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.redemptionFee)>0||(null==t.selectedFund?null:t.selectedFund.redemptionCharge)>0),h.Ub(1),h.Mc("title","Prospectus Document")("documentTemplate",i
5),h.Ub(1),h.Mc("title","Product Highlightsheet Document")("documentTemplate",c),h.Ub(1),h.Mc("documentTemplate",o)("showBorder",!1)("title","Factsheet Document"),h.Ub(2),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("inFillDetail",!0)("isUpdate",t.fromEdit)("onlyPersonal",t.onlyPersonal),h.Ub(2),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("ngModel",t.selectedFundForCart.selectedInvestmentMethod),h.Ub(1),h.Mc("ngForOf",t.investmentMethodList),h.Ub(1),h.Mc("ngIf","cash"==t.selectedFundForCart.selectedInvestmentMethod),h.Ub(1),h.Mc("ngIf","epf"===t.selectedFundForCart.selectedInvestmentMethod),h.Ub(3),h.Mc("ngIf",!t.fromEdit),h.Ub(1),h.Mc("ngIf",t.fromEdit)}}function Ei(e,t){1&e&&h.nc(0)}const Fi=function(e){return{name:"Prospectus",svg:"prospectus",link:e}};function Oi(e,t){if(1&e&&(h.pc(0),h.od(1,Ei,1,0,"ng-container",84),h.oc()),2&e){const e=h.Dc(2),t=h.ad(18);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Fi,null==e.selectedFund?null:e.selectedFund.prospectusPath))}}function Ui(e,t){1&e&&h.nc(0)}const xi=function(e){return{name:"Product Highlights Sheet",svg:"phs",link:e}};function Li(e,t){if(1&e&&(h.pc(0),h.od(1,Ui,1,0,"ng-container",84),h.oc()),2&e){const e=h.Dc(2),t=h.ad(18);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,xi,null==e.selectedFund?null:e.selectedFund.performancePath))}}function Ri(e,t){1&e&&h.nc(0)}const Ni=function(e){return{name:"Factsheet",svg:"factsheet",link:e}};function Bi(e,t){if(1&e&&(h.pc(0),h.od(1,Ri,1,0,"ng-container",84),h.oc()),2&e){const e=h.Dc(2),t=h.ad(18);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Ni,null==e.selectedFund?null:e.selectedFund.factsheetPath))}}function _i(e,t){if(1&e&&(h.od(0,Oi,2,4,"ng-container",1),h.od(1,Li,2,4,"ng-container",1),h.od(2,Bi,2,4,"ng-container",1)),2&e){const e=h.Dc();h.Mc("ngIf",null==e.selectedFund?null:e.selectedFund.prospectusPath),h.Ub(1),h.Mc("ngIf",null==e.selectedFund?null:e.selectedFund.performancePath),h.Ub(1),h.Mc("ngIf",null==e.selectedFund?null:e.selectedFund.factsheetPath)}}function Vi(e,t){1&e&&h.nc(0)}function Hi(e,t){if(1&e&&(h.pc(0),h.od(1,Vi,1,0,"ng-container",84),h.oc()),2&e){const e=h.Dc(2),t=h.ad(18);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Fi,null==e.selectedFund?null:e.selectedFund.prospectusPath))}}function $i(e,t){if(1&e&&h.od(0,Hi,2,4,"ng-container",1),2&e){const e=h.Dc();h.Mc("ngIf",null==e.selectedFund?null:e.selectedFund.prospectusPath)}}function ji(e,t){1&e&&h.nc(0)}function Gi(e,t){if(1&e&&(h.pc(0),h.od(1,ji,1,0,"ng-container",84),h.oc()),2&e){const e=h.Dc(2),t=h.ad(18);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,xi,null==e.selectedFund?null:e.selectedFund.performancePath))}}function Wi(e,t){if(1&e&&h.od(0,Gi,2,4,"ng-container",1),2&e){const e=h.Dc();h.Mc("ngIf",null==e.selectedFund?null:e.selectedFund.performancePath)}}function Yi(e,t){1&e&&h.nc(0)}function Ki(e,t){if(1&e&&(h.pc(0),h.od(1,Yi,1,0,"ng-container",84),h.oc()),2&e){const e=h.Dc(2),t=h.ad(18);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Ni,null==e.selectedFund?null:e.selectedFund.factsheetPath))}}function Xi(e,t){if(1&e&&h.od(0,Ki,2,4,"ng-container",1),2&e){const e=h.Dc();h.Mc("ngIf",null==e.selectedFund?null:e.selectedFund.factsheetPath)}}const Qi=function(e){return{"mb-3":e}},Zi=function(e){return{"mr-2":e}};function Ji(e,t){if(1&e&&(h.pc(0),h.rc(1,"a",85),h.Ec(2,"async"),h.mc(3,"img",86),h.Ec(4,"async"),h.qc(),h.oc()),2&e){const e=t.link,n=t.name,i=t.svg,c=h.Dc();h.Ub(1),h.Mc("href",c.docPath+"/"+e,h.gd)("ngClass",h.Sc(10,Qi,!h.Fc(2,6,c.isMobile$)))("nzTooltipTitle",n),h.Ub(2),h.Oc("src","assets/images/factsheet/",i,".svg",h.gd),h.Mc("alt",n+" for documents")("ngClass",h.Sc(12,Zi,!h.Fc(4,8,c.isMobile$)))}}function ec(e,t){if(1&e){const e=h.sc();h.rc(0,"button",89),h.zc("click",(function(){h.dd(e);const t=h.Dc(3);return t.onAddtoCart(t.transactionConstant.ADD)})),h.qd(1,"Add To Cart "),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("disabled",!e.amount.valid||e.isLoading)("nzLoading",e.buttonLoading)}}function tc(e,t){if(1&e){const e=h.sc();h.rc(0,"button",90),h.zc("click",(function(){return h.dd(e),h.Dc(3).onShowPrsAddInfo()})),h.qd(1," Next "),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("disabled",!e.form.valid||e.isLoading)}}function nc(e,t){if(1&e&&(h.rc(0,"b2c-floating-bar"),h.od(1,ec,2,2,"button",87),h.od(2,tc,2,1,"button",88),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf","PRS"!==(null==e.selectedFund?null:e.selectedFund.fundType)||!e.isNewPrsApplication),h.Ub(1),h.Mc("ngIf","PRS"===(null==e.selectedFund?null:e.selectedFund.fundType)&&e.isNewPrsApplication)}}function ic(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",91),h.zc("click",(function(){return h.dd(e),h.Dc(2).removeFundFromCart()})),h.qd(2,"Remove Fund"),h.qc(),h.rc(3,"button",92),h.zc("click",(function(){h.dd(e);const t=h.Dc(2);return t.onAddtoCart(t.transactionConstant.UPDATE)})),h.qd(4," Update To Cart "),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.Mc("disabled",!e.amount.valid||e.isLoading)("nzLoading",e.buttonLoading)}}function cc(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,nc,3,2,"b2c-floating-bar",1),h.od(2,ic,5,2,"b2c-floating-bar",1),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",!e.fromEdit),h.Ub(1),h.Mc("ngIf",e.fromEdit)}}function oc(e,t){if(1&e){const e=h.sc();h.rc(0,"prs-add-info",93),h.zc("closePrsAddInfo",(function(){return h.dd(e),h.Dc().onClosePrsAddInfo()}))("onProceedPrsAddInfo",(function(t){return h.dd(e),h.Dc().onProceedPrsAddInfo(t)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("showPrsAddInfo",e.showPrsAddInfo)("isSupportingDocNeed",e.isSupportingDocNeed)("refno",e.refno)("requiredField",e.requiredField)}}function sc(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-supporting-document",94),h.zc("back",(function(){return h.dd(e),h.Dc().onSupportingDocBack()}))("proceed",(function(t){return h.dd(e),h.Dc().onProceedSupportingDoc(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("refno",e.refno)}}function ac(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bank-account-required-modal",97),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()}))("create",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("disableCurrencySelection",!1)("otpRequired",!0)("refno",e.refno)("show",e.showBankAccountRequiredModal)("selectedCurrency",null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)}}const lc=function(){return{}},rc=function(){return{position:"fixed",top:"0",left:"0",width:"100%","z-index":"1050","padding-top":"80px"}};function dc(e,t){if(1&e&&(h.rc(0,"div",95),h.Ec(1,"async"),h.od(2,ac,
51,5,"app-bank-account-required-modal",96),h.qc()),2&e){const e=h.Dc();h.Mc("ngStyle",h.Fc(1,2,e.isMobile$)?h.Rc(4,lc):h.Rc(5,rc)),h.Ub(2),h.Mc("ngIf",e.showBankAccountRequiredModal)}}function uc(e,t){if(1&e&&h.mc(0,"nz-skeleton",98),2&e){const e=h.Dc();h.Mc("nzActive",!0)("nzLoading",e.isLoading)}}let hc=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l,r,d){this.subHandlingService=e,this.transactionRestService=t,this.transactionService=n,this.accountRestService=i,this.prsRestService=c,this.store=o,this.utilityRestService=s,this.siDeclarationService=a,this.passportExpiryNotificationService=l,this.mdfRestService=r,this.currencyFormatService=d,this.fepBreached=!1,this.show=!1,this.currentCartList=[],this.requiredField=[],this.closeFundFillDetails=new h.s,this.closeFundFillDetailsAsPassportExpiry=new h.s,this.paymentMethods=[],this.paymentMethodsCopy=[],this.showSalesChargeInfo=!1,this.currencyList=[],this.currencyListCopy=[],this.dividendInstructionListOri=[],this.dividendInstructionList=[],this.dividendInstructionEditDisabled=!1,this.autoSweepFxRate={},this.docPath=M.a.LIVE_URL,this.selectedFundForCart={selectedInvestmentMethod:"cash",investAmount:0,paymentMethod:null,paymentMethodSelected:null,fixRate:null,dividendInstruction:null},this.investmentMethodList=[{label:"Cash",value:"cash",active:!0}],this.showPrsAddInfo=!1,this.showSupportingDocument=!1,this.transactionConstant=U.a,this.epfUrl="https://www.fsmone.com.my/ext/article/pdf/getting_started_mar_2023/Guide_for_i-Invest_Buy.pdf",this.openSiNotice=new h.s,this.closeSiNotice=new h.s,this.isUnsubscribed=!1,this.onlyPersonal=!1,this.minSubsequenceAmount=0,this.minInitialAmount=0,this.isMobile$.subscribe(e=>this.isMobile=e)}set selectedCart(e){var t,n;void 0!==e&&(this._selectedCartValue=e,this.checkAccountEpf(),this.selectedFundForCart.paymentMethod=e.paymentMethod,this.selectedFundForCart.paymentMethodSelected=e.paymentMethod,this.selectedPaymentMethod=this.selectedFundForCart.paymentMethod,this.selectedCurrency=e.currencyCode?null===(t=this.selectedCart)||void 0===t?void 0:t.currencyCode:null===(n=this.selectedFund)||void 0===n?void 0:n.fundCurrencyCode,this.selectedFundForCart.selectedInvestmentMethod="EPF"==e.paymentMethod?"epf":"cash",this.selectedFundForCart.dividendInstruction=null==e?void 0:e.dividendInstruction,this.selectedDividendInstruction=this.selectedFundForCart.dividendInstruction)}get selectedCart(){return this._selectedCartValue}ngOnInit(){var e,t;this.selectedFund=Object(g.a)(this.selectedFund),"PRS"===this.selectedFund.fundType&&(this.onlyPersonal=!0),this.checkAiFlag(this.refno),this.form=new oe.k({amount:new oe.h("",[oe.H.required]),bankCode:new oe.h(null),sedolNumber:new oe.h(null===(e=this.selectedFund)||void 0===e?void 0:e.sedolnumber),paymentMethod:new oe.h(this.selectedFundForCart.paymentMethod.split("|")[0]),paymentMode:new oe.h(this.selectedFundForCart.paymentMethod.split("|")[0]),currency:new oe.h(this.selectedFund.fundCurrencyCode),campaignCode:new oe.h(""),paymentId:new oe.h,investmentType:new oe.h(this.selectedFundForCart.selectedInvestmentMethod),dividendInstruction:new oe.h(this.selectedFundForCart.dividendInstruction,[oe.H.required])}),this.fromEdit&&this.updateForm(),this.amountTo2DecimalSubscription(),this.getFxIndicativeRateForAutoSweep(null===(t=this.selectedFund)||void 0===t?void 0:t.fundCurrencyCode),this.getCashPaymentMethod()}amountTo2DecimalSubscription(){this.amountToTwoDecimalSubscription=this.amount.valueChanges.pipe(Object(ce.a)(500)).subscribe(e=>{var t,n;if(e&&!Number.isInteger(e)){const i=this.selectedCurrency||(null===(t=this.selectedFund)||void 0===t?void 0:t.fundCurrencyCode);null===(n=this.amount)||void 0===n||n.patchValue(+this.currencyFormatService.formatInputValue(e,i),{emitEvent:!1})}})}onDividendInstructionChange(e){this.selectedFundForCart.dividendInstruction=e,this.dividendInstruction.patchValue(e),this.selectedDividendInstruction=e}onPaymentMethodChange(e){var t,n,i,c,o;if(this.selectedFundForCart.paymentMethod=e,e.includes(U.a.AUTO_SWEEP)){const n=null===(t=e.split(U.a.AUTO_SWEEP))||void 0===t?void 0:t[0].trim();this.currencyList.some(e=>e===n)||this.currencyList.push(n),this.onCurrencyChange(n)}else this.selectedPaymentMethod===U.a.AUTO_SWEEP&&(this.currencyList=Object(g.a)(this.currencyListCopy),this.onCurrencyChange(this.selectedFund.fundCurrencyCode));if(this.patchPaymentMethod(e),(null===(n=this.paymentMethod)||void 0===n?void 0:n.value)!==U.a.CA
5SH_FUND&&(null===(i=this.paymentMethod)||void 0===i?void 0:i.value)!==U.a.GOPAYZ||this.onCurrencyChange(U.a.PAYMENT_CURRENCY_MYR),null===(c=this.selectedFundForCart.paymentMethod)||void 0===c?void 0:c.includes(U.a.TRUST_ACCOUNT)){const e=null===(o=this.selectedFundForCart.paymentMethod)||void 0===o?void 0:o.split("|")[2];this.onCurrencyChange(e)}this.isDividendInstructionDisabled()}get amount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("amount")}get amountValue(){var e;return null===(e=this.form.get("amount"))||void 0===e?void 0:e.value}get paymentMethod(){return this.form.get("paymentMethod")}get paymentMode(){return this.form.get("paymentMode")}get paymentId(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("paymentId")}get dividendInstruction(){return this.form.get("dividendInstruction")}onShowSalesChargeInfo(){this.showSalesChargeInfo=!0,this.showAddFundDetailsModal=!1}onCloseSalesChargeInfo(){this.showSalesChargeInfo=!1,this.showAddFundDetailsModal=!0}onCloseModalDialog(){this.closeFundFillDetails.emit(!1)}onCloseFund(){this.closeFundFillDetails.emit(!1)}onCurrencyChange(e){this.selectedFund=Object(g.a)(this.selectedFund),this.selectedCurrency=e,this.currency.patchValue(e),this.setAmountValidators(e)}onTabChange(e){var t;this.form.get("investmentType").patchValue(e),e==U.a.CASH?(this.paymentMethods=Object(g.a)(null===(t=this.paymentMethods)||void 0===t?void 0:t.filter(e=>e.value!==U.a.EPF_FUNDS.toUpperCase())),this.setAmountValidators(this.selectedCurrency)):(this.selectedFundForCart.paymentMethod=U.a.EPF_FUNDS.toUpperCase(),this.setAmountEpfValidators(this.selectedCurrency)),this.amount.updateValueAndValidity(),this.onPaymentMethodChange(this.selectedFundForCart.paymentMethod)}removeFundFromCart(){this.transactionService.removeBuyCartInfo(this.selectedSedol,this.refno),this.closeFundFillDetails.emit(!1)}onAddtoCart(e){var t,n,i,c,o,s,a,l,r,d,h,p,m,f,b,y,v,C,q;let T=this.passportExpiryNotificationService.isPersonalAccountPassportExpired();const w=this.refno;let z=!1;if(w&&(z=this.passportExpiryNotificationService.checkPassportExpiredByAccount(w)),T||z)return void this.closeFundFillDetailsAsPassportExpiry.emit();let D="";if(this.buttonLoading=!0,"epf"===this.selectedFundForCart.selectedInvestmentMethod&&(this.selectedFundForCart.paymentMethod="EPF",this.differentManagerEpfFundAdded()))return this.showEpfImportantNotice=!0,this.buttonLoading=!1,void(this.showAddFundDetailsModal=!1);let P=Object(g.a)(this.form.value);console.log("selectedFundForCart.paymentMethod: ",this.selectedFundForCart.paymentMethod);for(const u of this.paymentMethods)u.value==this.selectedFundForCart.paymentMethod&&(-1!=u.value.indexOf("Cash Fund")&&-1!=u.value.indexOf("|")?(D=null===(t=u.value)||void 0===t?void 0:t.split("|")[2],P.cashFundSedol=D,this.selectedFund.paymentMethod=null===(n=u.label)||void 0===n?void 0:n.split("(MYR",1)):-1!=u.value.indexOf(U.a.AUTO_SWEEP)?(P.paymentMethod=U.a.AUTO_SWEEP,P.paymentMode=U.a.AUTO_SWEEP,this.selectedFund.paymentMethod=null===(i=u.label)||void 0===i?void 0:i.split("=")[0]):this.selectedFund.paymentMethod=null===(c=u.label)||void 0===c?void 0:c.split("(",1));console.log("this.selectedFund.paymentMethod: "+this.selectedFund.paymentMethod);let I=this.store.selectSnapshot(u.l.getPrsFundManager).filter(e=>e.refno===this.refno);const k={refno:this.refno,sedolNumber:this.selectedFund.sedolnumber,paymentCategory:(this.selectedFund.paymentMethod||"")+(-1!==(null===(o=this.selectedFund.paymentMethod)||void 0===o?void 0:o.indexOf(U.a.AUTO_SWEEP))?"":" - "+(this.selectedCurrency||"")),fundName:this.selectedFund.fundName,paymentMethod:this.selectedFundForCart.paymentMethod,currencyCode:this.selectedCurrency,investAmount:+this.amountValue,orderStatus:U.a.ADDED_TO_CART,defaultSalesCharge:this.selectedFund.initialSalesCharge,promoApplied:!!(null===(s=this.selectedCart)||void 0===s?void 0:s.promoApplied)&&(null===(a=this.selectedCart)||void 0===a?void 0:a.promoApplied),managerCode:this.selectedFund.managercode,fixRate:this.fixRate,investmentType:this.selectedFundForCart.selectedInvestmentMethod,buyInfoModel:{amount:+this.amountValue,bankCode:null,campaignCode:null,currency:this.selectedCurrency,investmentType:this.selectedFundForCart.selectedInvestmentMethod,paymentMethod:this.selectedFundForCart.paymentMethod,paymentMode:this.selectedFundForCart.paymentMethod,sedolNumber:this.selectedFund.sedolnumber,fundT
5ype:this.selectedFund.fundType,managerCode:this.selectedFund.managercode,dividendInstruction:null!==(r=null===(l=this.selectedFundForCart)||void 0===l?void 0:l.dividendInstruction)&&void 0!==r?r:"",cashFundSedol:D},selectedToken:"None",fundType:this.selectedFund.fundType,userExistingFund:null===(d=I[0])||void 0===d?void 0:d.holdingFundManagerList.includes(this.selectedFund.managercode),dividendInstruction:null!==(p=null===(h=this.selectedFundForCart)||void 0===h?void 0:h.dividendInstruction)&&void 0!==p?p:""};this.selectedFund.fundType===U.a.PRS_FUND.toUpperCase()&&(k.isAdditionalInfoReady=this.isAdditionalInfoReady,k.isSupportingDocReady=this.isSupportingDocReady),(null===(m=this.selectedFundForCart)||void 0===m?void 0:m.selectedInvestmentMethod)===U.a.EPF_FUNDS?(k.paymentCategory="EPF Account 1",k.orderCartType=O.a.REQUEST_EPF_FORM):k.orderCartType=(null===(b=null===(f=this.selectedFundForCart)||void 0===f?void 0:f.paymentMethod)||void 0===b?void 0:b.includes(U.a.TRUST_ACCOUNT))||(null===(v=null===(y=this.selectedFundForCart)||void 0===y?void 0:y.paymentMethod)||void 0===v?void 0:v.includes(U.a.CASH_FUND))||(null===(q=null===(C=this.selectedFundForCart)||void 0===C?void 0:C.paymentMethod)||void 0===q?void 0:q.includes(U.a.AUTO_SWEEP))?O.a.PAYMENT_RECEIVED:O.a.PAYMENT,this.subHandlingService.once(this.transactionRestService.validateBuy([P],this.refno).pipe(Object(E.a)(e=>e.status===M.a.RESPONSE_FAILED?(e.errorMessage.includes("foreign.exchange.policy.breached")?this.fepBreached=!0:(this.amountToTwoDecimalSubscription&&this.amountToTwoDecimalSubscription.unsubscribe(),this.amount.setErrors({invalidBuy:e.errorMessage}),this.amountTo2DecimalSubscription()),void(this.buttonLoading=!1)):this.accountRestService.checkGotBankDetails(this.refno)),Object(S.a)(t=>{if(this.buttonLoading=!1,M.a.RESPONSE_FAILED!==t.status){if(!(null==t?void 0:t.data)&&this.store.selectSnapshot(u.X.getBankAccountToCreate).length<=0)return this.showBankAccountRequiredModal=!0,void(this.isMobile||(this.showAddFundDetailsModal=!1));this.addBuyCartInfo(e,k),this.closeFundFillDetails.emit()}})))}getCashPaymentMethod(){this.isLoading=!0,this.selectedFund&&this.subHandlingService.once(this.transactionRestService.getCashPaymentMethods(this.refno,this.selectedFund.sedolnumber).pipe(Object(y.a)(e=>{var t;if(this.paymentMethods=[],e.status===M.a.RESPONSE_SUCCESS&&(this.fromEdit||(e.data.paymentMethod.EPF||this.holdingPaymentMethod!==U.a.EPF_FUNDS.toUpperCase()?this.holdingPaymentMethod===U.a.EPF_FUNDS.toUpperCase()?(this.selectedFundForCart.selectedInvestmentMethod=U.a.EPF_FUNDS,this.setAmountEpfValidators(this.selectedCurrency)):(this.selectedFundForCart.selectedInvestmentMethod=U.a.CASH,this.setAmountValidators(this.selectedCurrency)):(this.isUnsubscribed=!0,this.selectedFundForCart.selectedInvestmentMethod=U.a.CASH,this.setAmountValidators(this.selectedCurrency))),e&&(Object.keys(e.data.paymentMethodWithParkingFacilityFund).forEach(t=>{if(t===U.a.AUTO_SWEEP){const n=gt.a.getSortedASList(e.data.paymentMethodWithParkingFacilityFund[t]);(null==n?void 0:n.length)>0&&n.forEach(e=>{const t=`${e.currency} ${U.a.AUTO_SWEEP}`,n=" = "+(e.availableBalance?this.currencyFormatService.formatCurrency(e.availableBalance,null==e?void 0:e.currency):"-");this.paymentMethods.push({label:t+n,value:t})})}else{let n=e.data.paymentMethodWithParkingFacilityFund[t];if(t===U.a.CHEQUE_FPX&&(n="Cheque / FPX"),t&&-1!==t.indexOf("|")){const e=t.split("|"),i=e[0];i===U.a.TRUST_ACCOUNT?n="Cash Account ("+this.currencyFormatService.formatCurrency(+e[3],e[2])+")":"Cash Fund"===i&&(n=n+" ("+this.currencyFormatService.formatCurrency(+e[1],U.a.PAYMENT_CURRENCY_MYR)+")")}this.paymentMethods.push({label:n,value:t})}}),this.paymentMethodsCopy=Object(g.a)(this.paymentMethods),this.currencyList=e.data.currList,console.log(this.currencyList),console.log("this.currencyList"),this.currencyListCopy=Object(g.a)(e.data.currList),this.fixRate=Object(g.a)(e.data.fxRate),this.onPaymentMethodChange("epf"==this.selectedFundForCart.selectedInvestmentMethod?"EPF":this.selectedFundForCart.paymentMethod),this.paymentMethods=Object(g.a)(this.paymentMethods.filter(e=>"EPF"!==e.value)),(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.incomeDistributionOptions)&&(this.dividendInstructionListOri=this.getIncomeDistributionOption(e.data.incomeDistributionOptions),this.dividendInstructionList=Object(g.a)(this.dividendInstructionListOri),this.dividendInstructionList.length>0&&!this.fromEdit)))){const e=this.dividendInstructionList[0].value;this.dividendInstruction.patchValue(e),this.selectedFundForCart.dividendInstruction=e,this.selectedDividendInstruction=e,this.dividendInstructionEditDisabled=this.dividendInstructionList.length<=1}},e=>console.log(e)),Object(y.a)(()=>{this.isLoading=!1,this.fromEdit&&this.updateForm()})))}isDividendInstructionDisabled(e){var t,n;this.dividendInstructionEditDisabled=this.dividendInstructionList.length<=1,(null===(t=this.dividendInstructionList)||void 0===t?void 0:t.length)>1&&(this.selectedFund.fundType===U.a.PRS_FUND.toUpperCase()||(null===(n=this.selectedFundForCart)||void 0===n?void 0:n.selectedInvestmentMethod)!==U.a.CA
5SH)&&(this.dividendInstruction.patchValue(U.a.DIVIDEND_OPTION_REINVEST),this.selectedDividendInstruction=U.a.DIVIDEND_OPTION_REINVEST,this.dividendInstructionEditDisabled=!0,this.selectedFundForCart.dividendInstruction=U.a.DIVIDEND_OPTION_REINVEST)}getIncomeDistributionOption(e){let t=[];if(null==e?void 0:e.length){const n=Object.values(U.a.DIVIDEND_OPTIONS);for(const i of e){const e=n.find(e=>e.value===i);e&&t.push(e)}}else t.push(U.a.DIVIDEND_OPTIONS.Reinvest);return t}checkAccountEpf(){this.subHandlingService.once(this.accountRestService.checkAccountEpfStatus(this.refno).pipe(Object(y.a)(e=>{var t,n,i,c,o;this.accountOtherInfo=e.data;let s=!1;(null===(t=this.accountOtherInfo)||void 0===t?void 0:t.cpfAcc)&&(null===(n=this.selectedFund)||void 0===n?void 0:n.cpfapproved)==M.a.YES_FLAG&&(s=!0,(null===(i=this.accountOtherInfo)||void 0===i?void 0:i.epfShariahFlag)===M.a.YES_FLAG&&(null===(c=this.selectedFund)||void 0===c?void 0:c.syariahFlag)===M.a.NO_FLAG&&(s=!1),(null===(o=this.selectedFund)||void 0===o?void 0:o.epfBlockPureBuy)===M.a.YES_FLAG&&(s=!1)),this.investmentMethodList=s?[{label:"Cash",value:"cash",active:!0},{label:"EPF",value:"epf"}]:[{label:"Cash",value:"cash",active:!0}]},e=>console.log(e))))}onShowPrsAddInfo(){this.isAdditionalInfoNeed?(this.showPrsAddInfo=!0,this.showAddFundDetailsModal=!1):(this.showSupportingDocument=!0,this.showAddFundDetailsModal=!1)}onClosePrsAddInfo(){this.showPrsAddInfo=!1,this.showAddFundDetailsModal=!0}onProceedPrsAddInfo(e){this.prsAddInfoModel=e,this.prsAddInfoModel.managercode=this.selectedFund.managercode,this.isSupportingDocNeed?(this.showPrsAddInfo=!1,this.showSupportingDocument=!0):this.updateAccountPrsAdditionalInfo(this.prsAddInfoModel)}onSupportingDocBack(){this.isAdditionalInfoNeed?(this.showPrsAddInfo=!0,this.showSupportingDocument=!1):(this.showSupportingDocument=!1,this.showAddFundDetailsModal=!0)}onProceedSupportingDoc(e){let t=Object.assign(Object.assign({},this.prsAddInfoModel),e);this.subHandlingService.once(this.prsRestService.updatePrsAdditionalInfoAndSupportingDoc(this.refno,t).pipe(Object(S.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.showSupportingDocument=!1,this.onAddtoCart(this.transactionConstant.ADD))})))}differentManagerEpfFundAdded(){var e,t;let n=null===(t=null===(e=this.currentCartList)||void 0===e?void 0:e.find(e=>"epf"===e.investmentType))||void 0===t?void 0:t.managerCode;return!!n&&this.selectedFund.managercode!==n}onEpfImportantNoticeOkPressed(){this.showEpfImportantNotice=!1,this.closeFundFillDetails.emit()}updateAccountPrsAdditionalInfo(e){this.subHandlingService.once(this.prsRestService.updatePrsAdditionalInfoAndSupportingDoc(this.refno,e).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.showPrsAddInfo=!1,this.onAddtoCart(this.transactionConstant.ADD))})))}onBankAccountModalClosed(){this.showAddFundDetailsModal=!0,this.showBankAccountRequiredModal=!1}addBuyCartInfo(e,t){this.form.enable(),e===this.transactionConstant.ADD?(this.transactionService.storeBuyCart(t),this.showPrsAddInfo=!1):this.transactionService.updateBuyCartInfo(t)}get holdingExist(){var e,t;return 0!==(null===(t=Object.keys(null===(e=this.selectedFund)||void 0===e?void 0:e.holdingAvailable))||void 0===t?void 0:t.length)}get currency(){return this.form.get("currency")}handleAiAccept(e){this.closeAiNotice(),this.showAddFundDetailsModal=!0}handleAiDecline(){this.closeAiNotice(),this.onCloseFund()}closeAiNotice(){this.showAiNotice=!1,this.closeSiNotice.emit()}updateForm(){const e=this.currentCartList.find(e=>e.sedolNumber===this.selectedFund.sedolnumber);this.amount.patchValue(null==e?void 0:e.investAmount),this.onCurrencyChange(e.currencyCode),this.onTabChange(e.investmentType),this.patchPaymentMethod(null==e?void 0:e.paymentMethod)}setAmountValidators(e){var t,n,i,c,o,s,a,l,r,d,u,h,p,m,f,g,b;(null===(t=this.selectedFundForCart)||void 0===t?void 0:t.paymentMethod.includes(U.a.AUTO_SWEEP))?e===(null===(d=this.selectedFund)||void 0===d?void 0:d.fundCurrencyCode)?(this.minSubsequenceAmount=null===(u=this.selectedFund)||void 0===u?void 0:u.minimumsubsequence,this.minInitialAmount=null===(h=this.selectedFund)||void 0===h?void 0:h.minimuminitialinvest):e!==U.a.PAYMENT_CURRENCY_MYR?(this.minSubsequenceAmount=Object(ft.b)((null===(p=this.selectedFund)||void 0===p?void 0:p.minimumsubsequence)/this.autoSweepFxRate[e],2),this.minInitialAmount=Object(ft.b)((null===(m=this.selectedFund)||void 0===m?void 0:m.minimuminitialinvest)/this.autoSweepFxRate[e],2)):(this.minSubsequenceAmount=(null===(f=this.selectedFund)||void 0===f?void 0:f.minimumsubsequence)*this.fixRate,this.minInitialAmount=(null===(g=this.selectedFund)||void 0===g?void 0:g.minimuminitialinvest)*this.fixRate):e===(null===(n=this.selectedFund)||void 0===n?void 0:n.fundCurrencyCode)?(this.minSubsequenceAmount=null===(i=this.selectedFund)||void 0===i?void 0:i.minimumsubsequence,this.minInitialAmount=null===(c=this.selectedFund)||void 0===c?void 0:c.minimuminitialinvest):(null===(o=this.selectedFund)||void 0===o?void 0:o.fundCurrencyCode)!==U.a.PAYMENT_CURRENCY_MYR?(this.minSubsequenceAmount=(null===(s=this.selectedFund)||void 0===s?void 0:s.minimumsubsequence)*this.fixRate,this.minInitialAmount=(null===(a=this.selectedFund)||void 0===a?void 0:a.minimuminitialinvest)*this.fixRate):(this.minSubsequenceAmount=(null===(l=this.selectedFund)||void 0===l?void 0:l.minimumsubsequence)/this.fixRate,this.minInitialAmount=(null===(r=this.selectedFund)||void 0===r?void 0:r.minimuminitialinvest)/this.fixRate),this.amount.setValidators([oe.H.required,oe.H.min((null===(b=this.selectedFund)||void 0===b?void 0:b.userExistingFund)?this.minSubsequenceAmount:this.minInitialAmount)]),this.amount.updateValueAndValidity()}setAmountEpfValidators(e){var t,n,i,c,o,s,a,l,r,d,u;e==(null===(t=this.selectedFund)||void 0===t?void 0:t.fundCurrencyCode)?this.amount.setValidators([oe.H.required,oe.H.min((null===(n=this.selectedFund)||void 0===n?void 0:n.userExistingFundEpf)?null===(i=this.selectedFund)||void 0===i?void 0:i.minSubseqNonCash:null===(c=this.selectedFund)||void 0===c?void 0:c.minimuminitialinvest)]):(null===(o=this.selectedFund)||void 0===o?void 0:o.fundCurrencyCode)!==U.a.PAYMENT_CURRENCY_MYR?this.amount.setValidators([oe.H.required,oe.H.min((null===(s=this.selectedFund)||void 0===s?void 0:s.userExistingFundEpf)?(null===(a=this.selectedFund)||void 0===a?void 0:a.minSubseqNonCash)*this.fixRate:(null===(l=this.selectedFund)||void 0===l?void 0:l.minimuminitialinvest)*this.fixRate)]):this.amount.setValidators([oe.H.required,oe.H.min((null===(r=this.selectedFund)||void 0===r?void 0:r.userExistingFundEpf)?(null===(d=this.selectedFund)||void 0===d?void 0:d.minSubseqNonCash)/this.fixRate:(null===(u=this.selectedFund)||void 0===u?void 0:u.minimuminitialinvest)/this.fixRate)]),this.amount.updateValueAndValidity(),this.amount.markAsDirty()}patchPaymentMethod(e){var t;this.paymentMethod.patchValue(e.split("|")[0]),this.paymentMode.patchValue(e.split("|")[0]),this.paymentId.patchValue((null===(t=this.paymentMethod)||void 0===t?void 0:t.value)===U.a.TRUST_ACCOUNT?e.split("|")[1]:"")}onChangeInvestmentAccount(e){this.refno=e,console.log("REFNO FROM onChangeInvestmentAccount:",e),this.checkAccountEpf(),this.getCashPaymentMethod(),this.checkAiFlag(e)}checkAiFlag(e){"restricted"!==this.selectedFund.fundType||this.siDeclarationService.hasDeclaredTransaction(e)||(this.showAiNotice=!0,this.showAddFundDetailsModal=!1,this.openSiNotice.emit())}redirectToFactsheetPage(e,t){e&&Object(pt.a)(["/"+M.o.FUNDS,M.o.TOOLS,M.o.FACTSHEET,Object(mt.e)(t)],{fund:e})}getFxIndicativeRateForAutoSweep(e){const t=[];gt.a.AUTO_SWEEP_CURRENCY.forEach(n=>
5{n!==e?t.push(this.utilityRestService.getFxIndicativeRate(n,e,!1,"ut").pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===(null==e?void 0:e.status)&&null!=(null==e?void 0:e.data)&&(this.autoSweepFxRate[n]=null==e?void 0:e.data)}))):this.autoSweepFxRate[n]=1}),this.subHandlingService.once(Object(ht.a)(t))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(T.a),h.lc(C.a),h.lc(bt.a),h.lc(St.a),h.lc(s.i),h.lc(w.a),h.lc(yt.a),h.lc(vt.a),h.lc(Mt.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["buy-fund-fill-detail"]],inputs:{showAddFundDetailsModal:"showAddFundDetailsModal",selectedFund:"selectedFund",refno:"refno",selectedCart:"selectedCart",fromEdit:"fromEdit",show:"show",isNewPrsApplication:"isNewPrsApplication",isSupportingDocNeed:"isSupportingDocNeed",isAdditionalInfoNeed:"isAdditionalInfoNeed",currentCartList:"currentCartList",selectedSedol:"selectedSedol",holdingPaymentMethod:"holdingPaymentMethod",isAdditionalInfoReady:"isAdditionalInfoReady",isSupportingDocReady:"isSupportingDocReady",requiredField:"requiredField"},outputs:{closeFundFillDetails:"closeFundFillDetails",closeFundFillDetailsAsPassportExpiry:"closeFundFillDetailsAsPassportExpiry",openSiNotice:"openSiNotice",closeSiNotice:"closeSiNotice"},features:[h.Tb([l.a])],decls:29,vars:17,consts:[["nzWidth","600","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzTitle","nzVisible","nzOnCancel",4,"ngIf"],[4,"ngIf"],["fundFill",""],[3,"showSalesChargeInfo","closeSalesChargeInfo"],["documents",""],["prospectusDocument",""],["highlightSheetDocument",""],["factSheetDocument",""],["portfolioDocumentTemplate",""],[3,"showPrsAddInfo","isSupportingDocNeed","refno","requiredField","closePrsAddInfo","onProceedPrsAddInfo",4,"ngIf"],[3,"show","onOk"],[3,"ngStyle",4,"ngIf"],["loadingTemplate",""],[3,"check","show","stayOnCurrentPage","onAccepted","onDecline"],[3,"showModal","refno","showModalChange"],["nzWidth","600","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzTitle","nzVisible","nzOnCancel"],[4,"ngTemplateOutlet"],[3,"title","back"],[1,"bg-white",3,"ngClass"],[1,""],[1,"header-line","pr-4","text-link","pointer",3,"click"],[1,"bg-black-2","px-3","pb-1",3,"ngClass"],["nz-row",""],["nz-col","","nzSpan","8"],["nz-col","","nzSpan","10",4,"ngIf"],["nz-col","","nzSpan","6"],[1,"font-weight-bold"],["nz-icon","","nzTheme","outline","nzType","info-circle",1,"text-info","pointer",3,"click"],["nz-col","","nzSpan","6",1,"d-inline-flex","text-right"],[3,"showBorder","title","value","valueSuffix","tooltipTemplate"],["saleChargeTooltip",""],[3,"showBorder","title","value","valueSuffix",4,"ngIf"],[3,"showBorder","title","value","valueSuffix","tooltipTemplate",4,"ngIf"],[3,"title","documentTemplate"],[3,"documentTemplate","showBorder","title"],["nz-row","",1,"pt-3"],["nz-col","",3,"nzSpan"],["nz-col","",2,"margin-top","-5px",3,"nzSpan"],[3,"inFillDetail","isUpdate","onlyPersonal","onSwitchInvestmentAcct"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["class","px-4","nz-radio-button","",3,"nzValue",4,"ngFor","ngForOf"],[1,"text-right"],["class","d-flex w-100 justify-content-end",4,"ngIf"],["nz-col","","nzSpan","10"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzTooltipTitle","This fee is charged by the respective fund house and borne by investor","nzType","info-circle",1,"text-info","pointer"],[3,"showBorder","title","value","valueSuffix"],["redemptionFeeTooltip",""],["nz-radio-button","",1,"px-4",3,"nzValue"],["class","mt-2 text-sm m-0",4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"mt-2","text-sm","m-0"],["nz-row","",1,"pt-4"],[1,"font-weight-bold","mb-2"],["nz-col","",3,"nzSpan","ngClass"],["nz-col","",3,"ngClass","nzSpan"],["nz-form","",3,"formGroup"],[1,"mb-2"],[3,"nzLabelPlaceholder"],["type","number","ui-input","",3,"formControl"],["nz-col","","nzSpan","24","class","text-warning text-sm",4,"ngIf"],["nzPlaceHolder","Payment Method",1,"w-100",3,"ngModel","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzPlaceHolder","Income Distribution Option",1,"w-100",3,"ngModel","nzDisabled","ngModelChange"],["nzCustomContent","",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzPlaceHolder","Investment Currency",1,"w-100",3,"ngModel","nzDisabled","ngModelChange"],[3,"nzLabel","nzValue"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],["minWithoutHolding",""],["nz-col","","nzSpan","24",1,"text-warning","text-sm"],["nz-icon","","nzType","info-circle","nzTheme","fill"],["nzCustomContent","",3,"nzLabel","nzValue"],[1,"text-sm","font-weight-bold"],[1,"text-xs","font-weight-normal"],[1,"mt-2","text-sm","m-0","font-weight-bold"],["href","https://iakaun.kwsp.gov.my/portal/member/login","target","_blank"],["target","_blank",3,"href"],["nz-col",""],["nz-col","","nzSpan","24",1,"mb-2"],["ngModel","epfAccount","nzPlaceHolder","Payment Method","nzDisabled","",1,"w-100"],["nzLabel","EPF Account 1","nzValue","epfAccount"],[1,"d-flex","w-100","justify-content-end"],["nz-button","","nzType","outline",1,"mr-3","mt-4",3,"click"],["nz-button","","nzType","primary",1,"mt-4",3,"nzLoading","disabled","click"],["nz-button","","nzType","primary",1,"mt-4",3,"disabled","nzLoading","click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["rel","noopener noreferrer","target","_blank","nzTooltipPlacement","top","nz-tooltip","",1,"pointer","d-block",3,"href","ngClass","nzTooltipTitle"],[3,"alt","ngClass","src"],["nz-button","","nzBlock","","nzType","primary",3,"disabled","nzLoading","click",4,"ngIf"],["nz-button","","nzBlock","","nzType","primary",3,"disabled","click",4,"ngIf"],["nz-button","","nzBlock","","nzType","primary",3,"disabled","nzLoading","click"],["nz-button","","nzBlock","","nzType","primary",3,"disabled","click"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"disabled","nzLoading","click"],[3,"showPrsAddInfo","isSupportingDocNeed","refno","requiredField","closePrsAddInfo","onProceedPrsAddInfo"],[3,"refno","back","proceed"],[3,"ngStyle"],[3,"disableCurrencySelection","otpRequired","refno","show","selectedCurrency","closed","create",4,"ngIf"],[3,"disableCurrencySelection","otpRequired","refno","show","selectedCurrency","closed","create"],[3,"nzActive","nzLoading"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,Rn,2,5,"nz-modal",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,Bn,3,2,"ng-container",1),h.Ec(5,"async"),h.qc(),h.od(6,Ai,55,45,"ng-template",null,2,h.pd),h.rc(8,"sales-charge-modal",3),h.zc("closeSalesChargeInfo",(function(){return t.onCloseSalesChargeInfo()})),h.qc(),h.od(9,_i,3,3,"ng-template",null,4,h.pd),h.od(11,$i,1,1,"ng-template",null,5,h.pd),h.od(13,Wi,1,1,"ng-template",null,6,h.pd),h.od(15,Xi,1,1,"ng-template",null,7,h.pd),h.od(17,Ji,5,14,"ng-template",null,8,h.pd),h.od(19,cc,3,2,"app-mobile-scaffold",1),h.rc(20,"app-mobile-scaffold"),h.od(21,oc,1,4,"prs-add-info",9),h.od(22,sc,2,1,"ng-container",1),h.qc(),h.rc(23,"app-epf-important-notice-modal",10),h.zc("onOk",(function(){return t.onEpfImportantNoticeOkPressed()})),h.qc(),h.od(24,dc,3,6,"div",11),h.od(25,uc,1,2,"ng-template",null,12,h.pd),h.rc(27,"shared-si-declaration-revamp-modal",13),h.zc("onAccepted",(function(e){return t.handleAiAccept(e)}
5))("onDecline",(function(){return t.handleAiDecline()})),h.qc(),h.rc(28,"fep-breached-modal",14),h.zc("showModalChange",(function(e){return t.fepBreached=e})),h.qc()),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,13,t.isMobile$)),h.Ub(3),h.Mc("ngIf",t.showAddFundDetailsModal&&h.Fc(5,15,t.isMobile$)),h.Ub(4),h.Mc("showSalesChargeInfo",t.showSalesChargeInfo),h.Ub(11),h.Mc("ngIf",t.showAddFundDetailsModal),h.Ub(2),h.Mc("ngIf",t.showPrsAddInfo),h.Ub(1),h.Mc("ngIf",t.showSupportingDocument&&t.isSupportingDocNeed),h.Ub(1),h.Mc("show",t.showEpfImportantNotice),h.Ub(1),h.Mc("ngIf",t.showBankAccountRequiredModal),h.Ub(3),h.Mc("check",!1)("show",t.showAiNotice)("stayOnCurrentPage",!0),h.Ub(1),h.Mc("showModal",t.fepBreached)("refno",t.refno))},directives:[B.a,p.t,z.a,wt,zt,Dt.a,$.a,j.a,p.A,D.a,p.q,P.c,P.a,k.b,Ot,ut.a,Ut.c,oe.t,oe.w,p.s,xt.e,Ut.a,oe.J,oe.u,se.b,oe.l,se.e,se.a,ae.c,oe.z,oe.c,ae.b,oe.i,Lt.d,Lt.a,se.c,_.a,Se.a,qn,Un,p.w,xn.a,W.a],pipes:[p.b,ke.a],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function pc(e,t){1&e&&h.mc(0,"investment-account-selector")}function mc(e,t){if(1&e){const e=h.sc();h.rc(0,"buy-fund-fill-detail",14),h.zc("closeFundFillDetails",(function(){return h.dd(e),h.Dc().closeFundEditModel()}))("closeFundFillDetailsAsPassportExpiry",(function(){return h.dd(e),h.Dc().showPassportExpiryNotice()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("currentCartList",e.buyCartModelList)("fromEdit",!0)("refno",e.refno)("selectedCart",e.selectedCart)("selectedFund",e.selectedFund)("selectedSedol",e.selectedSedol)("showAddFundDetailsModal",e.showEditCartModal)}}const fc=function(e,t){return{"container mt-5":e,"w-100 mb-6 pb-6 border-top":t}};let gc=(()=>{class e{constructor(e,t,n,i,c,o,s,a){this.store=e,this.route=t,this.subHandlingService=n,this.transactionService=i,this.fundRestService=c,this.cdRef=o,this.transactionRestService=s,this.utilityRestService=a,this.promoApplied=!1,this.buyCartModelList=[],this.tradeProductInfoList=[],this.showEditCartModal=!1,this.passportNoticeVisible=!1,this.systemSstRate=0}ngOnInit(){this.subscribeReloadListener(),this.getSystemSstRate(),this.cdRef.markForCheck()}subscribeReloadListener(){const e=this.store.select(u.X.getSelectedRefno).pipe(Object(b.a)()),t=this.store.select(u.l.getCartList),n=Object(m.a)([e,t]).pipe(Object(S.a)(([e,t])=>({refno:e,cartList:t(e)})),Object(y.a)(({refno:e,cartList:t})=>this.reloadCheckOut(e,t)));this.subHandlingService.subscribe(n)}reloadCheckOut(e,t){if(0===(null==t?void 0:t.length))return void this.route.navigate([M.o.APP,M.o.TRADE,M.o.FUNDS]);const n=this.store.selectSnapshot(f.a.getAccounts);this.refno=e,this.selectedAccTypeDisplay=null==n?void 0:n.find(e=>e.refno===this.refno),this.buyCartModelList=Object(g.a)(t),this.tradeProductInfoList=t.map(e=>bc(this.promoApplied,e))}getSystemSstRate(){const e=this.utilityRestService.getSstRate().pipe(Object(y.a)(e=>e.status===M.a.RESPONSE_SUCCESS&&(this.systemSstRate=e.data)));this.subHandlingService.once(e)}closeFundEditModel(){this.showEditCartModal=!1,this.getReferralToken()}displayFundEditModel(e){const t=this.buyCartModelList.find(t=>t.sedolNumber===e),n=this.fundRestService.getFundBuyDetailInfo(this.refno,t.sedolNumber).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data&&(this.selectedFund=e.data,this.selectedCart=t,this.selectedSedol=t.sedolNumber,this.showEditCartModal=!0)}));this.subHandlingService.once(n)}onBackPress(){this.route.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.FUNDS,M.o.BUY)])}onPromoCodeApplied(e){this.promoApplied=e}selectToken(e){var t;const n=null===(t=this.buyCartModelList)||void 0===t?void 0:t.find(t=>t.sedolNumber===e.sedolnumber);if(n){switch(e.token){case"1":n.buyInfoModel.onePercentReferralToken=!0,""==n.campaignCode&&(n.promoSalesCharge=1);break;case"0.8":n.buyInfoModel.zeroPointEightReferralToken=!0,""==n.campaignCode&&(n.promoSalesCharge=.8);break;case"0.5":n.buyInfoModel.zeroPointFiveReferralToken=!0,""==n.campaignCode&&(n.promoSalesCharge=.5);break;default:n.buyInfoModel.zeroPointFiveReferralToken=null,n.buyInfoModel.zeroPointEightReferralToken=null,n.buyInfoModel.onePercentReferralToken=null,""==n.campaignCode&&(n.promoSalesCharge=n.tierSalesCharge)}this.transactionService.updateBuyCartInfo(Object(g.a)(n)),this.transactionService.updateToken(e.sedolnumber,e.token,this.refno)}}getReferralToken(){var e;const t=this.refno,n=null===(e=this.buyCartModelList)||void 0===e?void 0:e.map(e=>e.buyInfoModel),i=this.transactionRestService.validateCampaignCode("",n,t).pi
5pe(Object(y.a)(e=>{if(e.status!==M.a.RESPONSE_SUCCESS)return;const n=Object(g.a)(e.data.summary);this.transactionService.updateBuyFundsSalesCharge(n.buyInfo,t),this.store.dispatch(new u.J(!0,t))}));this.subHandlingService.subscribe(i)}showPassportExpiryNotice(){this.passportNoticeVisible=!0}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(C.a),h.lc(q.a),h.lc(h.j),h.lc(T.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-fund-buy-check-out"]],features:[h.Tb([l.a])],decls:27,vars:32,consts:[[1,"bg-lighter","mb-6"],[3,"title","back"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],[1,"text-xs"],["nz-icon","","nzTheme","outline","nzType","arrow-left",1,"pointer","pr-2",3,"click"],[1,"infinite-container","mt-2"],[3,"header1","header3","tooltip3","showEditBtn","showHeader3","campaignCodeApplied","showProfitLoss","tradeProductInfoList","selectedSedolnumberEdit","selectedToken"],[4,"ngIf"],[3,"promoCodeApplied"],[3,"currentCartList","fromEdit","refno","selectedCart","selectedFund","selectedSedol","showAddFundDetailsModal","closeFundFillDetails","closeFundFillDetailsAsPassportExpiry",4,"ngIf"],[3,"modalVisible","isPopUp","footerFunc","onOkEmit","onUpdateEmit"],[3,"currentCartList","fromEdit","refno","selectedCart","selectedFund","selectedSedol","showAddFundDetailsModal","closeFundFillDetails","closeFundFillDetailsAsPassportExpiry"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"app-mobile-scaffold"),h.rc(2,"b2c-app-bar-2",1),h.zc("back",(function(){return t.onBackPress()})),h.qc(),h.qc(),h.rc(3,"div",2),h.Ec(4,"async"),h.Ec(5,"async"),h.rc(6,"nz-row",3),h.Ec(7,"async"),h.rc(8,"div",4),h.Ec(9,"async"),h.rc(10,"nz-card",5),h.rc(11,"p",6),h.qd(12,"Home / Trade"),h.qc(),h.rc(13,"h3"),h.rc(14,"i",7),h.zc("click",(function(){return t.onBackPress()})),h.qc(),h.qd(15," Check Out"),h.qc(),h.rc(16,"h4"),h.qd(17),h.qc(),h.rc(18,"div",8),h.rc(19,"app-trade-product-info",9),h.zc("selectedSedolnumberEdit",(function(e){return t.displayFundEditModel(e.sedolnumber)}))("selectedToken",(function(e){return t.selectToken(e)})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(20,"div",4),h.Ec(21,"async"),h.od(22,pc,1,0,"investment-account-selector",10),h.rc(23,"buy-checkout-cart-sider",11),h.zc("promoCodeApplied",(function(e){return t.onPromoCodeApplied(e)})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(24,"app-web-scaffold"),h.od(25,mc,1,7,"buy-fund-fill-detail",12),h.rc(26,"passport-expiry-notification",13),h.zc("onOkEmit",(function(){return t.passportNoticeVisible=!1}))("onUpdateEmit",(function(){return t.passportNoticeVisible=!1})),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(2),h.Mc("title","Check Out"),h.Ub(1),h.Mc("ngClass",h.Tc(29,fc,!h.Fc(4,19,t.isMobile$),h.Fc(5,21,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(7,23,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(9,25,t.isMobile$)?0:18),h.Ub(9),h.rd(null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("header1","Investment Amt.")("header3","Sales Charge")("tooltip3",t.systemSstRate>0?"8% SST, applicable to the Sales Charge":null)("showEditBtn",!0)("showHeader3",!0)("campaignCodeApplied",t.promoApplied)("showProfitLoss",!1)("tradeProductInfoList",t.tradeProductInfoList),h.Ub(1),h.Mc("nzSpan",h.Fc(21,27,t.isMobile$)?24:6),h.Ub(2),h.Mc("ngIf",t.refno),h.Ub(3),h.Mc("ngIf",t.selectedFund&&t.selectedCart&&t.selectedSedol&&t.showEditCartModal),h.Ub(1),h.Mc("modalVisible",t.passportNoticeVisible)("isPopUp",!1)("footerFunc",!0))},directives:[z.a,D.a,p.q,P.c,P.a,I.a,k.b,A.a,p.t,rt,B.a,dt.a,ut.a,hc],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const bc=(e,t)=>{var n,i;const{selectedToken:c,promoSalesCharge:o,tierSalesCharge:s,fundName:a,investAmount:l,currencyCode:r,paymentCategory:d,sedolNumber:u,referralTokenOnePercent:h,referralTokenZeroPointEight:m,referralTokenZeroPointFive:f}=t;let g;return g="None"===c?o?Object(p.L)(parseFloat(null===(n=null==t?void 0:t.promoSalesCharge)||void 0===n?void 0:n.toString()),M.a.LOCALE_EN,"1.2-2")+" %":s+"%":Number(c)<o?Object(p.L)(parseFloat(c),M.a.LOCALE_EN,"1.2-2")+" %":Object(p.L)(parseFloat(null===(i=null==t?void 0:t.promoSalesCharge)||void 0===i?void 0:i.toString()),M.a.LOCALE_EN,"1.2-2")+" %",{additionalInfo:g,appliedPromoCode:e,fundInfoName:a,minInvestmentAmount:l,minInvestmentAmountCurrency:r,paymentMethod:d,profitLossAmount:null,profitLossCurrency:null,profitLossPercentage:null,sedolnumber:u,addedToCart:!0,referralTokenOnePercent:h,referralTokenZeroPointEight:m,referralTokenZeroPointFive:f,selectedToken:c||"None"}};var Sc=n("bNXi"),yc=n("oyiF");function vc(e,t){if(1&e){const e=h.sc();h.rc(0,"app-web-scaffold"),h.rc(1,"nz-modal",3),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onClose()})),h.nc(2,4),h.qc(),h.rc(3,"ut-disclosure-statement-modal",2),h.zc("onCloseModal",(function(){return h.dd(e),h.Dc().onCloseUTDisclosureStatementModal()})),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(5);h.Ub(1),h.Mc("nzClosable",!0)("nzVisible",e.isModalVisible)("nzFooter",null)("nzTitle",null),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("isModalVisible",e.showUTDisclosureStatement)}}function Mc(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",6),h.zc("click",(function(){return h.dd(e),h.Dc(2).onClose()})),h.qd(2,"Close"),h.qc(),h.rc(3,"button",7),h.zc("click",(function(){return h.dd(e),h.Dc(2).onClose()})),h.qd(4,"Accept and Continue"),h.qc(),h.qc()}}function Cc(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"b2c-mobile-drawer",5),h.zc("showChange",(function(t){return h.dd(e),h.Dc().isModalVisible=t}))("showChange",(function(){return h.dd(e),h.Dc().onClose()})),h.nc(2,4),h.qc(),h.od(3,Mc,5,0,"b2c-floating-bar",0),h.oc()}if(2&e){const e=h.Dc(),t=h.ad(5);h.Ub(1),h.Mc("show",e.isModalVisible)("hideButtons",!0),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngIf",e.isModalVisible)}}function qc(e,t){if(1&e){const e=h.sc();h.rc(0,"div",8),h.rc(1,"h3"),h.qd(2,"Terms and Conditions"),h.qc(),h.rc(3,"p",9),h.qd(4," You are above 18 years of age and eligible to apply for unit trust. You confirm that you have read, understood and accepted the terms and conditions in the relevant prospectus, product highlight sheets, and FSMOne website. You have also read and understood the "),h.rc(5,"span",10),h.zc("click",(function(){return h.dd(e),h.Dc().onShowUTDisclosureStatementModal()})),h.qd(6," Unit Trust Loan Financing Risk Disclosure Statement"),h.qc(),h.qd(7," . You agree to be bound by the terms and conditions of the prospectus and FSMOne website. You hereby instruct and authorize iFAST Capital to carry out your instructions as indicated. You agree that iFAST Capital may transfer and disclose any information relating to you and your account, which is necessary for carrying out these services and/ or for compliance, to relevant entities involved in unit trust(s), Private Retirement Scheme fund(s) and the Securities Commission. You agree and acknowledge that the value of the Investment(s) may go down and up and by instructing iFAST Capital to apply for any Investments on your behalf, this risk which you are prepared to accept. iFAST Capital shall have no Liability whatsoever to you for any losses you may suffer as a result of the performance of any Investment(s). "),h.qc(),h.qc()}}let Tc=(()=>{class e{constructor(){this.onCloseModal=new h.s,this.showUTDisclosureStatement=!1}ngOnInit(){}onClose(){this.onCloseModal.emit()}onShowUTDisclosureStatementModal(){this.showUTDisclosureStatement=!0,this.isModalVisible=!1}onCloseUTDisclosureStatementModal(){this.showUTDisclosureStatement=!1,this.isModalVisible=!0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-sell-switch-tnc-modal"]],inputs:{isModalVisible:"isModalVisible"},outputs:{onCloseModal:"onCloseModal"},decls:7,vars:7,consts:[[4,"ngIf"],["modalContent",""],[3,"isModalVisible","onCloseModal"],["nzWidth","720","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzVisible","nzFooter","nzTitle","nzOnCancel"],[3,"ngTemplateOutlet"],[3,"show","hideButtons","showChange"],["nzBlock","","nz-button","","nzType","default",1,"my-1",3,"click"],["nzBlock","","nz-button","","nzType","primary",1,"my-1",3,"click"],[1,"p-2"],[1,"h5","text-black-7"],[1,"text-info","pointer",3,"click"]],template:function(e,t){1&e&&(h.od(0,vc,4,6,"app-web-scaffold",0),h.Ec(1,"async"),h.od(2,Cc,4,4,"ng-container",0),h.Ec(3,"async"),h.od(4,qc,8,0,"ng-template",null,1,h.pd),h.rc(6,"ut-disclosure-statement-modal",2),h.zc("onCloseModal",(function(){return t.onCloseUTDisclosureStatementModal()})),h.qc()),2&e&&(h.Mc("ngIf",!h.Fc(1,3,t.isMobile$)),h.Ub(2),h.Mc("ngIf",t.isModalVisible&&h.Fc(3,5,t.isMobile$)),h.Ub(4),h.Mc("isModalVisible",t.showUTDisclosureStatement))},directives:[p.t,yc.a,B.a,j.a,p.A,G.a,Se.a,_.a],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var wc=n("C2NP");function zc(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.value,e.currencyCode)," ")}}function Dc(e,t){if(1&e&&(h.rc(0,"div",10),h.rc(1,"b2c-order-cart",11),h.rc(2,"nz-row"),h.mc(3,"b2b-statistic",12),h.od(4,zc,2,4,"ng-template",null,13,h.pd),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.ad(5),i=h.Dc();h.Ub(1),h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",i.orderCartConstant.PENDING)("paymentTitle",e.title),h.Ub(2),h.Mc("value",n)}}function Pc(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",14),h.zc("click",(function(){return h.dd(e),h.Dc().checkAndShowBankInformationModal()})),h.qd(2,"I Agree & Check Out "),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("nzLoading",e.isLoading||e.approving)}}function Ic(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"shared-approve-action",15),h.zc("emitCancel",(function(){return h.dd(e),h.Dc().onHandleCancel()}))("onApprove",(function(t){return h.dd(e),h.Dc().onClickApprove(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("refno",e.refno)("requestKey",e.APPROVE_TRADE_REQUEST_KEY)("actionKey",e.UT_SELL_ACTION_KEY)("width",600)}}function kc(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bank-account-information-modal",16),h.zc("closed",(function(){return h.dd(e),h.Dc().onBankAccountInformationModalClosed()}))("continue",(function(){return h.dd(e),h.Dc().onBankAccountInformationModalContinue()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("bankModelList",e.bankModelToShowList)("refno",e.refno)("show",e.showBankAccountInformationModal)}}const Ac=function(e){return{"py-3 bg-white shadow mb-6":e}},Ec=function(e){return{"px-2":e}}
5;let Fc=(()=>{class e{constructor(e,t,n,i,c,o,s,a){this.store=e,this.subHandlingService=t,this.transactionRestService=n,this.router=i,this.transactionService=c,this.accountRestService=o,this.nzNotification=s,this.twoFaService=a,this.promoCodeApplied=new h.s,this.sellCartModel=[],this.fundVoidTransactionModels=[],this.orderCartConstant=O.a,this.cartDisplayListModel=[],this.sellInfoModel=[],this.showProceedModal=!1,this.showErrorMessageModal=!1,this.showSellTnc=!1,this.isLoading=!1,this.bankModelToShowList=[],this.showBankAccountInformationModal=!1,this.approving=!1,this.APPROVE_TRADE_REQUEST_KEY=R.a.APPROVE_TRADE,this.UT_SELL_ACTION_KEY=L.a.UT_SELL,this.getSelectedInvestmentAcctTradeData()}ngOnInit(){this.store.dispatch(new N.b)}ngOnChanges(e){this.getSelectedInvestmentAcctTradeData()}getCheckOutCartData(){this.cartDisplayListModel=[],this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.checkOutCartData=this.groupByPaymentMethod(e,"cartRedemptionMethod"),this.cartDisplayListModel=Object.keys(this.checkOutCartData).map(e=>({title:(null==e?void 0:e.indexOf(U.a.CASH_MANAGEMENT_FUND))>1?U.a.CASH_MANAGEMENT_FUND+" - "+e.split(U.a.CASH_MANAGEMENT_FUND)[0]:e,value:parseFloat(this.checkOutCartData[e].value),currencyCode:this.checkOutCartData[e].currencyCode}))})))}groupByPaymentMethod(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.currencyCode},n.push(e[i[t]])),e[i[t]].value+=i.redemptionAmount,e),{})}onHandleCancel(){this.showProceedModal=!1,this.approving=!1,this.isLoading=!1}onClickApprove(e){var t;this.onHandleCancel();const n=[],i=[],c=[];this.isLoading=!0;const o=null===(t=Object(g.a)(this.sellInfoModel))||void 0===t?void 0:t.map(e=>{var t,n;return(null===(n=null===(t=null==e?void 0:e.redemptionMethod)||void 0===t?void 0:t.toString())||void 0===n?void 0:n.includes(U.a.AUTO_SWEEP))?Object.assign(Object.assign({},e),{redemptionMethod:U.a.AUTO_SWEEP}):e});this.subHandlingService.once(e.pipe(Object(E.a)(e=>{const t=Object(g.a)(this.store.selectSnapshot(u.X.getBankAccountToCreate));return t.length>0&&null!==e?this.createBankAndOrder(t,e,o,n,i,c):this.createOrder(o,e,n,i,c)}),Object(F.a)(()=>this.store.dispatch(new N.e(!1,!0)))))}fireTncModal(){this.showSellTnc=!0}onCloseSellTncModal(){this.showSellTnc=!1}onCloseErrorMessage(){this.showErrorMessageModal=!1}getSellInfoModel(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.sellInfoModel=[];for(const t of e)this.sellInfoModel.push(t.sellInfoModel)})))}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.I.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.cartLength$=this.store.select(u.I.getUserCartLength).pipe(Object(S.a)(e=>
5e(this.refno))),this.getCheckOutCartData(),this.getSellInfoModel(),this.getTerminateRspSellCartModel()}check2FaMethod(){this.approving=!0}getRspInfoAndTerminate(){this.subHandlingService.subscribe(this.transactionRestService.findRspTransaction(this.refno,U.a.ACTIVE).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS?this.filterTerminateRspInfo(e.data.result.activersp):this.nzNotification.error("Error",e.errorMessage)}),Object(y.a)(()=>{this.terminateRsp()})))}terminateRsp(){this.subHandlingService.subscribe(this.transactionRestService.terminateRspTransaction(this.fundVoidTransactionModels,this.refno).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS?this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.ORDER_PLACED)],{queryParams:{poNumber:this.salesOrderNo,refno:this.refno}}):this.nzNotification.error("Error",e.errorMessage)})))}getTerminateRspSellCartModel(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.sellCartModel=[];for(const t of e)t.isNormalRsp&&!t.continueRsp&&this.sellCartModel.push(t)})))}filterTerminateRspInfo(e){this.fundVoidTransactionModels=[];for(const t of this.sellCartModel)for(const n of e)n.sedolnumber===t.sedolNumber&&this.fundVoidTransactionModels.push(this.mapFundVoidTransactionModelData(n))}mapFundVoidTransactionModelData(e){return{amount:null==e?void 0:e.amount,contractNo:null==e?void 0:e.contractNo,fundName:null==e?void 0:e.fundName,paymentMethod:null==e?void 0:e.paymentMethod}}createOrder(e,t,n,i,c){return this.transactionRestService.confirmOrderSell(this.refno,e,t).pipe(this.twoFaService.intercept(),Object(y.a)(e=>{if(e.status!==M.a.RESPONSE_SUCCESS)return this.errorMessage=e.errorMessage,this.showErrorMessageModal=!0,void(this.isLoading=!1);this.salesOrderNo=e.data.summary.orderNo,this.transactionService.updateSellOrderStatusToOrderPlaced(this.refno),e.data.summary.sellList.forEach(e=>{e.paymentMethod===U.a.EPF_FUNDS.toUpperCase()?(e.transactionStatus===O.a.PENDING&&(n.push(e.sedolnumber),this.transactionService.updateSellUtOrderCartType(this.refno,n,e.paymentMethod.toUpperCase(),O.a.REQUEST_EPF_FORM),this.transactionService.updateSellCartRedemptionMethod(this.refno,e.sedolnumber,"
5EPF Account 1 - Form")),e.transactionStatus===U.a.RECEIVED&&(c.push(e.sedolnumber),this.transactionService.updateSellUtOrderCartType(this.refno,c,e.paymentMethod.toUpperCase(),O.a.ORDER_RECEIVED))):(i.push(e.sedolnumber),this.transactionService.updateSellUtOrderCartType(this.refno,i,e.paymentMethod.toUpperCase(),O.a.ORDER_RECEIVED))}),this.transactionService.updateSellOrderStatusToOrderPlaced(this.refno),this.isLoading=!1,this.store.dispatch(new u.r),this.transactionService.removeBankModelsToShow(this.refno),0!==this.sellCartModel.length?this.getRspInfoAndTerminate():this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.ORDER_PLACED)],{queryParams:{poNumber:this.salesOrderNo,refno:this.refno}})}))}createBankAndOrder(e,t,n,i,c,o){const s=[];for(const a of e){const e=Object.assign(Object.assign({},a),t);a.refno===this.refno&&s.push(this.accountRestService.createBankDetails(this.refno,e))}return Object(ht.a)(s).pipe(Object(E.a)(()=>this.createOrder(n,t,i,c,o)))}checkAndShowBankInformationModal(){this.isLoading=!0;const e=Object(g.a)(this.store.selectSnapshot(u.X.getBankAccountToCreate));let t=[];const n=Object(g.a)(this.sellInfoModel);this.subHandlingService.once(this.store.select(u.I.getBankModelsToShow).pipe(Object(S.a)(e=>e(this.refno))).pipe(Object(y.a)(i=>{if(this.bankModelToShowList=[],(null==i?void 0:i.length)>0){t=Object(g.a)(i);const c=t[0].bankAcctName;if((null==e?void 0:e.length)>0)for(const n of e)n.refno===this.refno&&(n.canEdit=!1,n.bankAcctName=c,t.push(n));if((null==n?void 0:n.length)>0)for(const e of n)if(e.redemptionMethod===U.a.CHEQUE_FPX){const n=this.bankModelToShowList.find(t=>t.currency===e.currency),i=t.find(t=>t.currency===e.currency);!n&&i&&this.bankModelToShowList.push(i)}this.showBankAccountInformationModal=!1,this.bankModelToShowList&&this.bankModelToShowList.length>0&&this.bankModelToShowList.find(e=>"MYR"!==e.currency&&!0===e.canEdit)?this.showBankAccountInformationModal=!0:this.check2FaMethod()}else this.check2FaMethod()})))}onBankAccountInformationModalClosed(){this.showBankAccountInformationModal=!1}onBankAccountInformationModalContinue(){this.showBankAccountInformationModal=!1,this.check2FaMethod()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(T.a),h.lc(c.e),h.lc(C.a),h.lc(bt.a),h.lc(Sc.b),h.lc(x.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-sell-checkout-cart-sider"]],inputs:{refno:"refno"},outputs:{promoCodeApplied:"promoCodeApplied"},features:[h.Tb([l.a,x.a]),h.Sb],decls:27,vars:21,consts:[[3,"ngClass"],[1,"font-weight-bold"],["class","mb-3",4,"ngFor","ngForOf"],[1,"h5"],[3,"click"],["nz-button","","nzType","primary",1,"font-weight-bold","mb-2","mt-3","w-100",3,"disabled","nzLoading","click"],[4,"ngIf"],[3,"isModalVisible","onCloseModal"],[3,"errorMessage","showErrorMessageModal","closeErrorMessageModal"],[3,"bankModelList","refno","show","closed","continue",4,"ngIf"],[1,"mb-3"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle"],["horizontal","true","title","Total Indicative Amt.",3,"value"],["valueTemplate",""],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"nzLoading","click"],[3,"refno","requestKey","actionKey","width","emitCancel","onApprove"],[3,"bankModelList","refno","show","closed","continue"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.Ec(1,"async"),h.rc(2,"div",0),h.Ec(3,"async"),h.rc(4,"p",1),h.qd(5," Total Indicative Redemption Amt."),h.qc(),h.od(6,Dc,6,5,"div",2),h.rc(7,"p",3),h.qd(8," All orders received are irrevocable. By clicking "),h.rc(9,"strong"),h.qd(10,"\u201c Agree & Check \u201d"),h.qc(),h.qd(11," button, you confirm your trades and agreed to the "),h.rc(12,"a",4),h.zc("click",(function(){return t.fireTncModal()})),h.qd(13,"terms and conditions"),h.qc(),h.qd(14," on FSMOne. "),h.qc(),h.rc(15,"p",3),h.qd(16," And accepted the terms and conditions in the Cash Management Fund Prospectus. "),h.qc(),h.qc(),h.rc(17,"app-web-scaffold"),h.rc(18,"button",5),h.zc("click",(function(){return t.checkAndShowBankInformationModal()})),h.Ec(19,"async"),h.qd(20," I Agree & Check Out "),h.qc(),h.qc(),h.qc(),h.rc(21,"app-mobile-scaffold"),h.od(22,Pc,3,1,"b2c-floating-bar",6),h.qc(),h.od(23,Ic,2,4,"ng-container",6),h.rc(24,"app-sell-switch-tnc-modal",7),h.zc("onCloseModal",(function(){return t.onCloseSellTncModal()})),h.qc(),h.rc(25,"checkout-error-message-modal",8),h.zc("closeErrorMessageModal",(function(){return t.onCloseErrorMessage()})),h.qc(),h.od(26,kc,1,3,"app-bank-account-information-modal",9)),2&e&&(h.Mc("ngClass",h.Sc(17,Ac,h.Fc(1,11,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(19,Ec,h.Fc(3,13,t.isMobile$))),h.Ub(4),h.Mc("ngForOf",t.cartDisplayListModel),h.Ub(12),h.Mc("disabled",0===h.Fc(19,15,t.cartLength$))("nzLoading",t.isLoading||t.approv
5ing),h.Ub(4),h.Mc("ngIf",!t.showSellTnc),h.Ub(1),h.Mc("ngIf",t.approving),h.Ub(1),h.Mc("isModalVisible",t.showSellTnc),h.Ub(1),h.Mc("errorMessage",t.errorMessage)("showErrorMessageModal",t.showErrorMessageModal),h.Ub(1),h.Mc("ngIf",t.showBankAccountInformationModal))},directives:[p.q,p.s,B.a,_.a,z.a,p.t,Tc,ne,ge.a,P.c,be.c,Se.a,ye.a,wc.a],pipes:[p.b,ke.a],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();var Oc=n("iFlv"),Uc=n("mV2b"),xc=n("H2Td");function Lc(e,t){if(1&e&&(h.pc(0),h.qd(1),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.rd(e.prefix)}}function Rc(e,t){if(1&e&&h.nc(0,4),2&e){const e=h.Dc(2);h.Mc("ngTemplateOutlet",e.suffix)}}function Nc(e,t){if(1&e&&(h.od(0,Lc,2,1,"ng-container",2),h.qd(1),h.Ec(2,"number"),h.od(3,Rc,1,1,"ng-container",3)),2&e){const e=h.Dc();h.Mc("ngIf",e.prefix),h.Ub(1),h.sd(" ",h.Gc(2,3,e.value,"1.2-"+e.decimalPlaces)," "),h.Ub(2),h.Mc("ngIf",e.suffix)}}let Bc=(()=>{class e{constructor(){this.prefix=null,this.decimalPlaces=2}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-fund-detail-info-statistic"]],inputs:{title:"title",value:"value",prefix:"prefix",suffix:"suffix",tooltip:"tooltip",decimalPlaces:"decimalPlaces"},decls:4,vars:6,consts:[[3,"horizontal","title","value","tooltip"],["valueTemplate",""],[4,"ngIf"],[3,"ngTemplateOutlet",4,"ngIf"],[3,"ngTemplateOutlet"]],template:function(e,t){if(1&e&&(h.mc(0,"b2b-statistic",0),h.Ec(1,"async"),h.od(2,Nc,4,6,"ng-template",null,1,h.pd)),2&e){const e=h.ad(3);h.Mc("horizontal",h.Fc(1,4,t.isMobile$))("title",t.title)("value",e)("tooltip",t.tooltip)}},directives:[be.c,p.t,p.A],pipes:[p.b,p.g],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var _c=n("45Og");function Vc(e,t){if(1&e&&h.mc(0,"app-fund-detail-info-statistic",13),2&e){const e=h.Dc();h.Mc("title","Min. Redemption")("value",null==e.selectedFund?null:e.selectedFund.minRedemptionNum)("prefix",e.transactionConstant.PAYMENT_CURRENCY_MYR)}}function Hc(e,t){if(1&e&&h.mc(0,"app-fund-detail-info-statistic",14),2&e){const e=h.Dc(),t=h.ad(34);h.Mc("title","Min. Redemption")("value",null==e.selectedFund?null:e.selectedFund.minRedemptionNum)("suffix",t)}}function $c(e,t){if(1&e&&h.mc(0,"app-fund-detail-info-statistic",13),2&e){const e=h.Dc();h.Mc("title","Min. Holding")("value",null==e.selectedFund?null:e.selectedFund.minRetainNum)("prefix",e.transactionConstant.PAYMENT_CURRENCY_MYR)}}function jc(e,t){if(1&e&&h.mc(0,"app-fund-detail-info-statistic",14),2&e){const e=h.Dc(),t=h.ad(34);h.Mc("title","Min. Holding")("value",null==e.selectedFund?null:e.selectedFund.minRetainNum)("suffix",t)}}const Gc=function(e){return{"py-2":e}},Wc=function(e){return{"border-bottom":e}};function Yc(e,t){if(1&e&&(h.rc(0,"nz-row",4),h.Ec(1,"async"),h.rc(2,"nz-col",2),h.Ec(3,"async"),h.Ec(4,"async"),h.mc(5,"b2b-statistic",15),h.Ec(6,"async"),h.qc(),h.rc(7,"nz-col",2),h.Ec(8,"async"),h.Ec(9,"async"),h.mc(10,"app-fund-detail-info-statistic",14),h.qc(),h.rc(11,"nz-col",2),h.Ec(12,"async"),h.Ec(13,"async"),h.mc(14,"app-fund-detail-info-statistic",14),h.qc(),h.qc()),2&e){const e=h.Dc(),t=h.ad(38),n=h.ad(34);h.Mc("ngClass",h.Sc(32,Gc,!h.Fc(1,16,e.isMobile$))),h.Ub(2),h.Mc("nzSpan",h.Fc(3,18,e.isMobile$)?24:8)("ngClass",h.Sc(34,Wc,h.Fc(4,20,e.isMobile$))),h.Ub(3),h.Mc("horizontal",h.Fc(6,22,e.isMobile$))("title","Redemption Fee")("value",t),h.Ub(2),h.Mc("nzSpan",h.Fc(8,24,e.isMobile$)?24:8)("ngClass",h.Sc(36,Wc,h.Fc(9,26,e.isMobile$))),h.Ub(3),h.Mc("title","Subject to Redemption Fee")("value",null==e.selectedFund?null:e.selectedFund.unitRedemptionFee)("suffix",n),h.Ub(1),h.Mc("nzSpan",h.Fc(12,28,e.isMobile$)?24:8)("ngClass",h.Sc(38,Wc,h.Fc(13,30,e.isMobile$))),h.Ub(3),h.Mc("title","Not Subject To Redemption Fee")("value",null==e.selectedFund?null:e.selectedFund.unitNonRedemptionFee)("suffix",n)}}function Kc(e,t){if(1&e&&(h.rc(0,"nz-row",1),h.Ec(1,"async"),h.rc(2,"nz-col",2),h.Ec(3,"async"),h.Ec(4,"async"),h.mc(5,"app-fund-detail-info-statistic",14),h.qc(),h.rc(6,"nz-col",2),h.Ec(7,"async"),h.Ec(8,"async"),h.mc(9,"app-fund-detail-info-statistic",14),h.qc(),h.qc()),2&e){const e=h.Dc(),t=h.ad(34);h.Mc("ngClass",h.Sc(21,Gc,!h.Fc(1,11,e.isMobile$))),h.Ub(2),h.Mc("nzSpan",h.Fc(3,13,e.isMobile$)?24:8)("ngClass",h.Sc(23,Wc,h.Fc(4,15,e.isMobile$))),h.Ub(3),h.Mc("title","Available Units Acc A")("value","PRS_GOV"==e.selectedFund.paymentMethod?null==e.selectedFund?null:e.selectedFund.availableQuantity:(null==e.selectedFund?null:e.selectedFund.availableQuantity)/100*70)("suffix",t),h.Ub(1),h.Mc("nzSpan",h.Fc(7,17,e.isMobile$)?24:8)("ngClass",h.Sc(25,Wc,h.Fc(8,19,e.isMobile$))),h.Ub(3),h.Mc("title","Available Units Acc B")("value","PRS_GOV"==e.selectedFund.paymentMethod?0:(null==e.selectedFund?null:e.selectedFund.availableQuantity)/100*30)("suffix",t)}}function Xc(e,t){1&e&&h.qd(0," units\n")}
5function Qc(e,t){if(1&e&&(h.qd(0),h.Ec(1,"sdate")),2&e){const e=h.Dc(2);h.sd(" As of ",h.Fc(1,1,null==e.selectedFund?null:e.selectedFund.priceDate)," ")}}function Zc(e,t){if(1&e&&(h.mc(0,"i",16),h.od(1,Qc,2,3,"ng-template",null,17,h.pd)),2&e){const e=h.ad(2);h.Mc("nzTooltipTitle",e)}}function Jc(e,t){1&e&&h.qd(0," This fee is charged by the respective fund house and borne by investor. ")}function eo(e,t){if(1&e&&(h.qd(0),h.mc(1,"i",16),h.od(2,Jc,1,0,"ng-template",null,18,h.pd)),2&e){const e=h.ad(3),t=h.Dc();h.sd(" ",null==t.selectedFund?null:t.selectedFund.redemptionCharge," "),h.Ub(1),h.Mc("nzTooltipTitle",e)}}let to=(()=>{class e{constructor(){this.isSwitchPrs=!1,this.transactionConstant=U.a}ngOnInit(){var e,t,n;(null===(t=null===(e=this.selectedFund)||void 0===e?void 0:e.redemptionCharge)||void 0===t?void 0:t.includes("%"))||(this.selectedFund.redemptionCharge=Object(p.L)(+(null===(n=this.selectedFund)||void 0===n?void 0:n.redemptionCharge),M.a.LOCALE_EN,"1.2-2")+"%")}onCancel(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["sell-fund-detail-info"]],inputs:{selectedFund:"selectedFund",isSwitchPrs:"isSwitchPrs"},decls:39,vars:75,consts:[[1,"bg-black-2","px-2"],["nzType","flex","nzAlign","middle",3,"ngClass"],[3,"nzSpan","ngClass"],[3,"title","value"],["nzType","flex","nzAlign","middle","nzJustify","center",3,"ngClass"],[3,"title","value","prefix",4,"ngIf"],[3,"title","value","suffix",4,"ngIf"],[3,"title","prefix","value","decimalPlaces","suffix"],["nzType","flex","nzAlign","middle","nzJustify","center",3,"ngClass",4,"ngIf"],["nzType","flex","nzAlign","middle",3,"ngClass",4,"ngIf"],["unitSuffix",""],["latestNavSuffix",""],["redemptionFeeValueTemplate",""],[3,"title","value","prefix"],[3,"title","value","suffix"],[3,"horizontal","title","value"],["nz-icon","","nz-tooltip","","nzType","info-circle","nzTheme","outline",1,"text-info",3,"nzTooltipTitle"],["dateTooltipTitle",""],["redemptionFeeTooltip",""]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.rc(1,"nz-row",1),h.Ec(2,"async"),h.rc(3,"nz-col",2),h.Ec(4,"async"),h.Ec(5,"async"),h.mc(6,"app-fund-detail-info-statistic",3),h.qc(),h.rc(7,"nz-col",2),h.Ec(8,"async"),h.Ec(9,"async"),h.mc(10,"app-fund-detail-info-statistic",3),h.qc(),h.rc(11,"nz-col",2),h.Ec(12,"async"),h.Ec(13,"async"),h.mc(14,"app-fund-detail-info-statistic",3),h.qc(),h.qc(),h.rc(15,"nz-row",4),h.Ec(16,"async"),h.rc(17,"nz-col",2),h.Ec(18,"async"),h.Ec(19,"async"),h.od(20,Vc,1,3,"app-fund-detail-info-statistic",5),h.od(21,Hc,1,3,"app-fund-detail-info-statistic",6),h.qc(),h.rc(22,"nz-col",2),h.Ec(23,"async"),h.Ec(24,"async"),h.od(25,$c,1,3,"app-fund-detail-info-statistic",5),h.od(26,jc,1,3,"app-fund-detail-info-statistic",6),h.qc(),h.rc(27,"nz-col",2),h.Ec(28,"async"),h.Ec(29,"async"),h.mc(30,"app-fund-detail-info-statistic",7),h.qc(),h.qc(),h.od(31,Yc,15,40,"nz-row",8),h.od(32,Kc,10,27,"nz-row",9),h.qc(),h.od(33,Xc,1,0,"ng-template",null,10,h.pd),h.od(35,Zc,3,1,"ng-template",null,11,h.pd),h.od(37,eo,4,2,"ng-template",null,12,h.pd)),2&e){const e=h.ad(36);h.Ub(1),h.Mc("ngClass",h.Sc(59,Gc,!h.Fc(2,31,t.isMobile$))),h.Ub(2),h.Mc("nzSpan",h.Fc(4,33,t.isMobile$)?24:8)("ngClass",h.Sc(61,Wc,h.Fc(5,35,t.isMobile$))),h.Ub(3),h.Mc("title","Total Units")("value",null==t.selectedFund?null:t.selectedFund.currentUnits),h.Ub(1),h.Mc("nzSpan",h.Fc(8,37,t.isMobile$)?24:8)("ngClass",h.Sc(63,Wc,h.Fc(9,39,t.isMobile$))),h.Ub(3),h.Mc("title","Pending Units")("value",null==t.selectedFund?null:t.selectedFund.pendingSellQuantity),h.Ub(1),h.Mc("nzSpan",h.Fc(12,41,t.isMobile$)?24:8)("ngClass",h.Sc(65,Wc,h.Fc(13,43,t.isMobile$))),h.Ub(3),h.Mc("title","Available Units")("value",null==t.selectedFund?null:t.selectedFund.availableQuantity),h.Ub(1),h.Mc("ngClass",h.Sc(67,Gc,!h.Fc(16,45,t.isMobile$))),h.Ub(2),h.Mc("nzSpan",h.Fc(18,47,t.isMobile$)?24:8)("ngClass",h.Sc(69,Wc,h.Fc(19,49,t.isMobile$))),h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.AMOUNT),h.Ub(1),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.UNIT),h.Ub(1),h.Mc("nzSpan",h.Fc(23,51,t.isMobile$)?24:8)("ngClass",h.Sc(71,Wc,h.Fc(24,53,t.isMobile$))),h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.AMOUNT),h.Ub(1),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.UNIT),h.Ub(1),h.Mc("nzSpan",h.Fc(28,55,t.isMobile$)?24:8)("ngClass",h.Sc(73,Wc,h.Fc(29,57,t.isMobile$)&&"-"!==(null==t.selectedFund?null:t.selectedFund.redemptionFee))),h.Ub(3),h.Mc("title","Latest NAV Price")("prefix",null==t.selectedFund?null:t.selectedFund.fundCurrencyCode)("value",null==t.selectedFund?null:t.selectedFund.lastestPrice)("decimalPlaces",4)("suffix",e),h.Ub(1),h.Mc("ngIf","-"!==(null==t.selectedFund?null:t.selectedFund.redemptionFee)&&"0.0%"!==(null==t.selectedFund?null:t.selectedFund.redemptionFee)),h.Ub(1),h.Mc("ngIf",t.isSwitchPrs)}}
5,directives:[P.c,p.q,P.a,Bc,p.t,be.c,k.b,xt.e],pipes:[p.b,_c.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function no(e,t){1&e&&(h.rc(0,"h4"),h.qd(1,"Please take note full sell this fund will terminate your RSP."),h.qc())}function io(e,t){1&e&&(h.rc(0,"h4"),h.qd(1,"Please take note full switch this fund will terminate your RSP."),h.qc())}function co(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",1),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseTerminateRspMsgModal()})),h.rc(1,"div",2),h.rc(2,"nz-col",3),h.rc(3,"h4"),h.mc(4,"i",4),h.qc(),h.qc(),h.rc(5,"nz-col",5),h.od(6,no,2,0,"h4",6),h.od(7,io,2,0,"h4",6),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzClosable",!0)("nzWrapClassName","vertical-center-modal")("nzFooter",null)("nzTitle",null)("nzWidth",450)("nzVisible",e.showTerminateRspMsgModal),h.Ub(6),h.Mc("ngIf",!e.isSwitch),h.Ub(1),h.Mc("ngIf",e.isSwitch)}}let oo=(()=>{class e{constructor(){this.closeTerminateRspMsgModal=new h.s}ngOnInit(){}onCloseTerminateRspMsgModal(){this.showTerminateRspMsgModal=!1,this.closeTerminateRspMsgModal.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["terminate-rsp-msg-modal"]],inputs:{showTerminateRspMsgModal:"showTerminateRspMsgModal",isSwitch:"isSwitch"},outputs:{closeTerminateRspMsgModal:"closeTerminateRspMsgModal"},decls:2,vars:3,consts:[[3,"nzClosable","nzWrapClassName","nzFooter","nzTitle","nzWidth","nzVisible","nzOnCancel",4,"ngIf"],[3,"nzClosable","nzWrapClassName","nzFooter","nzTitle","nzWidth","nzVisible","nzOnCancel"],["nz-row","",1,"p-2"],["nzSpan","2"],["nz-icon","","nzType","info-circle","nzTheme","outline",1,"text-accent-1"],["nzSpan","22"],[4,"ngIf"]],template:function(e,t){1&e&&(h.od(0,co,8,8,"nz-modal",0),h.Ec(1,"async")),2&e&&h.Mc("ngIf",!h.Fc(1,1,t.isMobile$))},directives:[p.t,j.a,P.c,P.a,k.b],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var so=n("/ai0"),ao=n("4we5"),lo=n("TaO5"),ro=n("HtrM");function uo(e,t){if(1&e&&h.mc(0,"ui-option",18),2&e){const e=t.$implicit;h.Mc("nzLabel",e)("nzValue",e)}}function ho(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",33),h.qd(2," Please Enter Amount With 2 Decimal Places. "),h.qc())}function po(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The min. redemption is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRedemptionNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function mo(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd("The min. redemption is ",null==e.selectedFund?null:e.selectedFund.minRedemptionNum," units.")}}function fo(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",33),h.od(3,po,3,4,"span",34),h.qc(),h.od(4,mo,2,1,"ng-template",null,35,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(2);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function go(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The min. retain is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRetainNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function bo(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The min. retain is ",null==e.selectedFund?null:e.selectedFund.minRetainNum," units.")}}function So(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",33),h.od(3,go,3,4,"span",34),h.qc(),h.od(4,bo,2,1,"ng-template",null,36,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(2);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function yo(e,t){if(1&e&&(h.rc(0,"nz-col",15),h.rc(1,"nz-form-item",22),h.rc(2,"nz-form-control"),h.rc(3,"ui-input-group",37),h.mc(4,"input",24),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",16),h.Ub(3),h.Mc("nzLabelPlaceholder","Indicative Redemption Amt.")("nzPrefix",e.indicativeRedemptionAmt.value?null==e.redemptionCurrency?null:e.redemptionCurrency.value:""),h.Ub(1),h.Mc("formControl",e.indicativeRedemptionAmt)}}const vo=function(e){return{"m-0":e}};function Mo(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",15),h.rc(2,"nz-form-item",27),h.rc(3,"nz-form-control"),h.rc(4,"ui-input-group",37),h.mc(5,"input",24),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("nzSpan",24),h.Ub(1),h.Mc("ngClass",h.Sc(5,vo,null==e.redemptionUnits?null:e.redemptionUnits.hasError("invalidSell"))),h.Ub(2),h.Mc("nzLabelPlaceholder","Indicative Redemption Amt.")("nzPrefix",e.indicativeRedemptionAmt.value?null==e.redemptionCurrency?null:e.redemptionCurrency.value:""),h.Ub(1),h.Mc("formControl",e.indicativeRedemptionAmt)}}function Co(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span",38),h.mc(2,"i",33),h.rc(3,"span"),h.qd(4),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(4),h.sd(" ",null==e.redemptionUnits?null:e.redemptionUnits.getError("invalidSell")," ")}}function qo(e,t){if(1&e&&h.mc(0,"ui-option",18),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function To(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",33),h.qd(2," Please make sure this field is not blank. "),h.qc())}function wo(e,t){1&e&&h.nc(0)}const zo=function(e){return{"mb-6 pb-6":e}};function Do(e,t){if(1&e){const e=h.sc();h.rc(0,"form",13),h.rc(1,"nz-row",14),h.rc(2,"nz-col",15),h.Ec(3,"async"),h.rc(4,"nz-form-item",16),h.rc(5,"nz-form-control"),h.rc(6,"ui-select",17),h.mc(7,"ui-option",18),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(8,"nz-col",15),h.rc(9,"nz-form-item",16),h.rc(10,"nz-form-control"),h.rc(11,"ui-select",19),h.od(12,uo,1,2,"ui-option",20),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(13,"nz-row",21),h.rc(14,"nz-col",15),h.Ec(15,"async"),h.rc(16,"nz-form-item",16),h.rc(17,"nz-form-control",22),h.rc(18,"ui-input-group",23),h.mc(19,"input",24),h.qc(),h.od(20,ho,3,0,"nz-form-explain",25),h.od(21,fo,6,2,"nz-form-explain",25),h.od(22,So,6,2,"nz-form-explain",25),h.qc(),h.qc(),h.qc(),h.od(23,yo,5,4,"nz-col",26),h.Ec(24,"async"),h.qc(),h.od(25,Mo,6,7,"nz-row",25),h.Ec(26,"async"),h.od(27,Co,5,1,"nz-form-explain",25),h.rc(28,"nz-form-item",27),h.Ec(29,"async"),h.rc(30,"nz-form-control",28),h.rc(31,"label",29),h.zc("nzCheckedChange",(function(t){return h.dd(e),h.Dc().onSellAllCheckChange(t)}
5)),h.qd(32,"Sell All"),h.qc(),h.qc(),h.qc(),h.rc(33,"nz-row",30),h.Ec(34,"async"),h.rc(35,"nz-col",15),h.Ec(36,"async"),h.rc(37,"nz-form-item"),h.rc(38,"nz-form-control"),h.rc(39,"ui-select",31),h.od(40,qo,1,2,"ui-option",20),h.qc(),h.od(41,To,3,0,"nz-form-explain",25),h.qc(),h.qc(),h.od(42,wo,1,0,"ng-container",32),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(23);var n=null;const i=(null==e.redemptionMethod||null==e.redemptionMethod.value||null==(n=e.redemptionMethod.value.toString())?null:n.includes(e.transactionConstant.AUTO_SWEEP))||1===(null==e.selectedFund||null==e.selectedFund.availableCurrency?null:e.selectedFund.availableCurrency.length);h.Mc("formGroup",e.form),h.Ub(2),h.Mc("nzSpan",h.Fc(3,26,e.isMobile$)?24:8),h.Ub(4),h.Mc("formControl",e.redemptionType),h.Ub(1),h.Mc("nzLabel","Cash")("nzValue","cheque"),h.Ub(1),h.Mc("nzSpan",e.isMobile?24:16),h.Ub(3),h.Mc("formControl",e.redemptionCurrency)("nzDisabled",i),h.Ub(1),h.Mc("ngForOf",null==e.selectedFund?null:e.selectedFund.availableCurrency),h.Ub(2),h.Mc("nzSpan",h.Fc(15,28,e.isMobile$)?24:8),h.Ub(4),h.Mc("nzLabelPlaceholder","Units To Sell"),h.Ub(1),h.Mc("formControl",e.redemptionUnits),h.Ub(1),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("pattern")),h.Ub(1),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("invalidMinRedemption")),h.Ub(1),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("invalidMinHolding")),h.Ub(1),h.Mc("ngIf",!h.Fc(24,30,e.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(26,32,e.isMobile$)),h.Ub(2),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("invalidSell")),h.Ub(1),h.Mc("ngClass",h.Sc(40,vo,h.Fc(29,34,e.isMobile$))),h.Ub(3),h.Mc("nzChecked",e.isSellAll.value),h.Ub(2),h.Mc("ngClass",h.Sc(42,zo,h.Fc(34,36,e.isMobile$))),h.Ub(2),h.Mc("nzSpan",(h.Fc(36,38,e.isMobile$),24)),h.Ub(4),h.Mc("formControl",e.redemptionMethod),h.Ub(1),h.Mc("ngForOf",e.availableRedemptionMethod),h.Ub(1),h.Mc("ngIf",e.redemptionMethod.dirty&&e.redemptionMethod.hasError("required")),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function Po(e,t){if(1&e&&h.mc(0,"nz-skeleton",39),2&e){const e=h.Dc();h.Mc("nzLoading",e.formLoading)("nzActive",!0)}}function Io(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",40),h.rc(2,"div",41),h.mc(3,"uic-icon",42),h.qc(),h.rc(4,"div",43),h.rc(5,"h5",44),h.qd(6,"Disclaimer"),h.qc(),h.rc(7,"p",45),h.qd(8,"By selecting Auto-Sweep as your redemption method, FSMOne will automatically opt you in. I confirm that I have read, agree to, and understand all the relevant "),h.rc(9,"a",46),h.zc("click",(function(){return h.dd(e),h.Dc(2).triggerDisclaimerModal()})),h.qd(10,"clauses and terms"),h.qc(),h.qd(11,"."),h.qc(),h.qc(),h.qc(),h.oc()}}function ko(e,t){if(1&e&&h.od(0,Io,12,0,"ng-container",25),2&e){const e=h.Dc();h.Mc("ngIf",e.isAutoOptInASDisclaimerVisible)}}let Ao=(()=>{class e{constructor(e,t,n,i,c,o,s,l,r){this.fb=e,this.store=t,this.subHandlingService=n,this.cdRef=i,this.transactionService=c,this.holdingRestService=o,this.accountRestService=s,this.transactionRestService=l,this.currencyFormatService=r,this.addedFund=[],this.closed=new h.s,this.bankRequired=new h.s,this.availableRedemptionMethod=[],this.localBanks=[],this.overseaBanks=[],this.transactionConstant=U.a,this.twoDecimalPlacesRegex=/^-?\d*[.,]?\d{0,2}$/,this.isMobile=!1,this.showTerminateRspMsgModal=!1,this.showedTerminateRspMsgModal=!1,this.isLoading=!1,this.formLoading=!1,this.availableRedemptionMethodTemp=[],this.disclaimerModalVisible=!1,this.isAutoOptInASDisclaimerVisible=!1,this.isMobile=this.store.selectSnapshot(a.a.isMobile),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno)}ngOnInit(){this.form=this.initForm(),this.getBankDetailsAndInitFormValue(),this.subscribeUnitsToSell(),this.subscribeRedemptionCurrency(),this.redemptionMethod.valueChanges.subscribe(e=>{if(null==e?void 0:e.includes(U.a.AUTO_SWEEP)){const t=e.split(U.a.AUTO_SWEEP)[0].trim();this.redemptionCurrency.patchValue(t);const n=this.availableRedemptionMethod.find(t=>(null==t?void 0:t.value)===e);this.isAutoOptInASDisclaimerVisible=!(null==n?void 0:n.hasOptedIn)}else this.isAutoOptInASDisclaimerVisible=!1})}initForm(){var e,t,n,i,c,o,s,a,l,r;return this.fb.group({redemptionType:[{value:"Cash",disabled:!0},[oe.H.required]],redemptionCurrency:["",[oe.H.required]],redemptionUnits:[{value:"",updateOn:"change"},[oe.H.pattern(this.twoDecimalPlacesRegex),Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)]],indicativeRedemptionAmt:[{value:"",disabled:!0}],isSellAll:[!1],redemptionMethod:[{value:U.a.TRUST_ACCOUNT,updateOn:"change"},[oe.H.required]]})}setFormInitValue(){var e,t,n,i,c;const o=null===(e=this.selectedFund)||void 0===e?void 0:e.productC
5ode,s=null===(t=this.addedFund)||void 0===t?void 0:t.find(e=>{var t;return e.sedolNumber===o&&e.sellInfoModel.paymentMethod.toLowerCase()===(null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod.toLowerCase())});this.isSellAll.reset(),this.redemptionType.patchValue(U.a.CHEQUE.toLowerCase()),this.isSellAll.patchValue(!!this.isUpdate&&(null==s?void 0:s.redemptionUnits)===(null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity)),this.redemptionCurrency.patchValue(this.isUpdate?null==s?void 0:s.currencyCode:null===(i=this.selectedFund)||void 0===i?void 0:i.fundCurrencyCode),this.redemptionUnits.patchValue(this.isUpdate?null==s?void 0:s.sellInfoModel.redemptionUnits:"");let a=s.redemptionMethod;"Cash Fund"===s.redemptionMethod&&(a=s.redemptionMethod+"|"+s.sellInfoModel.cashFundSedol),this.redemptionMethod.patchValue(this.isUpdate?a:""),this.indicativeRedemptionAmt.patchValue(this.isUpdate?this.currencyFormatService.formatInputNumber(null===(c=null==s?void 0:s.sellInfoModel)||void 0===c?void 0:c.redemptionAmount,null==s?void 0:s.currencyCode):"")}onCancel(){this.closed.emit()}getAvailableRedemptionMethod(){var e,t,n;let i=this.store.selectSnapshot(u.X.getBankAccountToCreate),c=(null===(e=this.localBanks)||void 0===e?void 0:e.find(e=>{var t;return e.currency===(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value)}))||(null===(t=this.overseaBanks)||void 0===t?void 0:t.find(e=>{var t;return e.currency===(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value)}))||i.find(e=>{var t;return e.currency===(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value)});this.availableRedemptionMethod=[],null===(n=this.selectedFund)||void 0===n||n.availableRedemptionMethodWithParkingFacilityFund.forEach(e=>{var t,n,i,o,s;let a=e.displayName,l=e.hasOptedIn;if(e.paymentMode===U.a.TRUST_ACCOUNT&&(a=((null===(t=this.form)||void 0===t?void 0:t.get("redemptionCurrency"))?null===(n=this.redemptionCurrency)||void 0===n?void 0:n.value:null===(i=this.selectedFund)||void 0===i?void 0:i.fundCurrencyCode)+" Cash Account"),e.paymentMode===U.a.AUTO_SWEEP&&(a=e.redemptionCurrency+" Auto-Sweep"),c&&e.paymentMode===U.a.CHEQUE_FPX){let e=Object(Uc.a)("*",c.bankAcctNo);null===e&&(e=null===(o=this.selectedFund)||void 0===o?void 0:o.fundCurrencyCode),a="Credit to Bank Acc ["+e+"]",this.bankModel=c}(e.paymentMode!==U.a.AUTO_SWEEP||gt.a.AUTO_SWEEP_CURRENCY.includes(null===(s=this.selectedFund)||void 0===s?void 0:s.fundCurrencyCode))&&this.availableRedemptionMethod.push({label:a,value:this.getAvailableRedemptionMethodValue(e),hasOptedIn:l})}),console.log("availableRedemptionMethod: ",this.availableRedemptionMethod),this.availableRedemptionMethodTemp=Object(g.a)(this.availableRedemptionMethod)}getAvailableRedemptionMethodValue(e){return U.a.CASH_FUND===(null==e?void 0:e.paymentMode)?U.a.CASH_FUND+"|"+e.sedolnumber:U.a.AUTO_SWEEP===(null==e?void 0:e.paymentMode)?(null==e?void 0:e.redemptionCurrency)+" Auto-Sweep":null==e?void 0:e.paymentMode}subscribeUnitsToSell(){this.subHandlingService.subscribe(this.redemptionUnits.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t,n,i,c;this.indicativeRedemptionAmt.patchValue(this.currencyFormatService.formatInputNumber(this.redemptionCurrency.value===this.selectedFund.fundCurrencyCode?e*this.selectedFund.lastestPrice:e*this.selectedFund.lastestPrice*this.selectedFund.fxRate,this.redemptionCurrency.value)),e>=(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)?(this.setRedemptionUnitNoDpValidators(),this.redemptionUnits.patchValue(null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity,{emitEvent:!1}),null===(i=this.isSellAll)||void 0===i||i.patchValue(!0)):(this.setRedemptionUnitWithDpValidators(),null===(c=this.isSellAll)||void 0===c||c.patchValue(!1))})))}subscribeRedemptionCurrency(){this.subHandlingService.subscribe(this.redemptionCurrency.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{let t;this.getAvailableRedemptionMethod(),"MYR"===e?(t=this.redemptionUnits.value*this.selectedFund.lastestPrice*this.selectedFund.fxRate,this.availableRedemptionMethod=this.availableRedemptionMethodTemp):(t=this.redemptionUnits.value*this.selectedFund.lastestPrice,this.availableRedemptionMethod=this.availableRedemptionMethodTemp.filter(e=>
5e.value!==U.a.CASH_FUND)),this.indicativeRedemptionAmt.patchValue(this.currencyFormatService.formatInputNumber(t,e))})))}onSellAllCheckChange(e){var t;this.isSellAll.patchValue(e),e?(this.setRedemptionUnitNoDpValidators(),this.redemptionUnits.patchValue(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)):(this.setRedemptionUnitWithDpValidators(),this.redemptionUnits.patchValue(""))}addOrUpdateCart(){var e,t,n,i;if(Object(zn.c)(this.form),this.form.updateValueAndValidity(),this.form.invalid)return;if((null===(e=this.selectedFund)||void 0===e?void 0:e.normalRspFund)&&(null===(t=this.isSellAll)||void 0===t?void 0:t.value)&&!this.showedTerminateRspMsgModal&&(null===(n=this.selectedFund)||void 0===n?void 0:n.hasActiveRsp))return this.showTerminateRspMsgModal=!0,void(this.showedTerminateRspMsgModal=!0);if((null===(i=this.redemptionMethod)||void 0===i?void 0:i.value)===U.a.CHEQUE_FPX)return void this.checkUserBankExistAndValidateCart();this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1);const c=this.mapSellInfoData();this.validateSellInfoAndAddCart(c)}getBankDetailsAndInitFormValue(){this.formLoading=!0,this.subHandlingService.once(this.accountRestService.getBankDetails(this.refno).pipe(Object(y.a)(e=>{this.formLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.bankDetails=e.data,this.localBanks=e.data.Local,this.overseaBanks=e.data.Overseas)}),Object(y.a)(()=>{this.getAvailableRedemptionMethod(),this.setFormInitValue()})))}checkUserBankExistAndValidateCart(){var e;this.isLoading=!0,this.subHandlingService.once(this.accountRestService.getRedemptionBankDetails(this.refno,null===(e=this.redemptionCurrency)||void 0===e?void 0:e.value).pipe(Object(E.a)(e=>{var t,n;const i=!!this.store.selectSnapshot(u.X.getBankAccountToCreate).find(e=>{var t;return e.currency===(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value)});if(this.existBank=e.data||i,!this.existBank)return this.bankRequired.emit(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value),void(this.isLoading=!1);this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1);const c=this.mapSellInfoData();return(null===(n=this.redemptionCurrency)||void 0===n?void 0:n.value)&&e.data&&(this.bankModel.canEdit=!0,this.addBankModel(this.bankModel)),this.transactionRestService.validateSellCart(this.refno,c)}),Object(y.a)(e=>{var t;if(this.isLoading=!1,e.status===M.a.RESPONSE_FAILED)return this.errorMessage=e.errorMessage,void(null===(t=this.redemptionUnits)||void 0===t||t.setErrors({invalidSell:this.errorMessage}));this.form.enable(),this.isUpdate?this.transactionService.updateSellCartInfo(this.form,this.selectedFund,this.availableRedemptionMethod):this.transactionService.storeSellCart(this.form,this.selectedFund,this.availableRedemptionMethod),this.closed.emit()})))}cancelOrRemoveFund(e){this.isUpdate&&this.transactionService.removeSellCartInfo(this.refno,e.productCode,e.paymentMethod),this.closed.emit()}get redemptionType(){return this.form.get("redemptionType")}get redemptionCurrency(){return this.form.get("redemptionCurrency")}get redemptionUnits(){return this.form.get("redemptionUnits")}get indicativeRedemptionAmt(){return this.form.get("indicativeRedemptionAmt")}get isSellAll(){return this.form.get("isSellAll")}get redemptionMethod(){return this.form.get("redemptionMethod")}closeTerminateRspMsgModal(){this.showTerminateRspMsgModal=!1}mapSellInfoData(){var e,t,n,i,c,o=null===(e=this.redemptionMethod)||void 0===e?void 0:e.value,s="";if(-1!=o.indexOf(U.a.CASH_FUND)){const e=o.split("|");o=e[0],s=e[1]}return(null==o?void 0:o.toString().includes(U.a.AUTO_SWEEP))&&(o=U.a.AUTO_SWEEP),{sedolNumber:null===(t=this.selectedFund)||void 0===t?void 0:t.productCode,redemptionMethod:o,currency:null===(n=this.redemptionCurrency)||void 0===n?void 0:n.value,redemptionUnits:null===(i=this.redemptionUnits)||void 0===i?void 0:i.value,ifastStatus:"NA",paymentMethod:null===(c=this.redemptionType)||void 0===c?void 0:c.value,cashFundSedol:s}}validateSellInfoAndAddCart(e){this.isLoading=!0,this.subHandlingService.once(this.transactionRestService.validateSellCart(this.refno,e).pipe(Object(y.a)(e=>{var t;if(this.isLoading=!1,e.status===M.a.RESPONSE_FAILED)return this.errorMessage=e.errorMessage,void(null===(t=this.redemptionUnits)||void 0===t||t.setErrors({invalidSell:this.errorMessage}));this.form.enable(),this.isUpdate?this.transactionService.updateSellCartInfo(this.form,this.selectedFund,this.availableRedemptionMethod):this.transactionService.storeSellCart(this.form,this.selectedFund,this.availableRedemptionMethod),this.closed.emit
5()})))}setRedemptionUnitNoDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.redemptionUnits.setValidators([Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}setRedemptionUnitWithDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.redemptionUnits.setValidators([oe.H.pattern(this.twoDecimalPlacesRegex),Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}addBankModel(e){if(!e)return;let t=!1;this.subHandlingService.once(this.store.select(u.I.getBankModelsToShow).pipe(Object(S.a)(e=>e(this.refno))).pipe(Object(y.a)(n=>{if((null==n?void 0:n.length)>0)for(let i of n)i.currency===e.currency&&(t=!0);t||this.transactionService.addBankModelToShow(e)})))}triggerDisclaimerModal(){this.disclaimerModalVisible=!this.disclaimerModalVisible}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(s.i),h.lc(l.a),h.lc(h.j),h.lc(C.a),h.lc(xc.a),h.lc(bt.a),h.lc(T.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-sell-fund-fill-detail-form"]],inputs:{selectedFund:"selectedFund",addedFund:"addedFund",isUpdate:"isUpdate"},outputs:{closed:"closed",bankRequired:"bankRequired"},features:[h.Tb([l.a])],decls:24,vars:16,consts:[[1,"mb-4"],[3,"selectedFund"],[1,"font-weight-bold","mt-4","mb-2"],["nz-form","",3,"formGroup",4,"ngIf","ngIfElse"],[1,"text-right"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",3,"nzLoading","click"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzType","primary","nzBlock","",1,"my-1",3,"nzLoading","click"],["formLoadingTemplate",""],[3,"showTerminateRspMsgModal","closeTerminateRspMsgModal"],["nzTitle","Disclaimer","nzClassName","modal-title-border",3,"nzVisible","nzClosable","nzMaskClosable","nzWidth","nzFooter","isMobileFullScreen","nzOnCancel"],["autoSweepAutoOptInDisclaimerTpl",""],["nz-form","",3,"formGroup"],["nzType","flex","nzAlign","middle","nzGutter","16"],[3,"nzSpan"],[1,"mb-2"],["nzPlaceHolder","Redemption Type","nzDisabled","",3,"formControl"],[3,"nzLabel","nzValue"],["nzPlaceHolder","Redemption Currency",3,"formControl","nzDisabled"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzType","flex","nzGutter","16"],[1,"m-0"],[3,"nzLabelPlaceholder"],["ui-input","","type","number",3,"formControl"],[4,"ngIf"],[3,"nzSpan",4,"ngIf"],[1,"mb-2",3,"ngClass"],[1,"form-control-line-height-base"],["nz-checkbox","",3,"nzChecked","nzCheckedChange"],["nzType","flex","nzGutter","16",3,"ngClass"],["nzPlaceHolder","Redemption Method",3,"formControl"],[4,"ngTemplateOutlet"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],[4,"ngIf","ngIfElse"],["unitMinRedempError",""],["unitMinRetainError",""],[3,"nzLabelPlaceholder","nzPrefix"],[1,"text-danger"],[3,"nzLoading","nzActive"],[1,"d-flex","bg-black-2","p-3","rounded","mb-4"],[1,"flex-shrink-0","mr-2"],["type","colored-icons/colored-hand-wave","width","22px","height","22px"],[1,"flex-grow-1"],[1,"font-weight-bold","text-12px","mb-2"],[1,"text-12px","text-black-6","mb-0"],[1,"text-12px","link-underline-none","font-weight-bold",3,"click"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.mc(1,"sell-fund-detail-info",1),h.qc(),h.rc(2,"p",2),h.qd(3,"Enter Redemption Details"),h.qc(),h.od(4,Do,43,44,"form",3),h.rc(5,"app-web-scaffold"),h.rc(6,"div",4),h.rc(7,"button",5),h.zc("click",(function(){return t.cancelOrRemoveFund(t.selectedFund)})),h.qd(8),h.qc(),h.rc(9,"button",6),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(10),h.qc(),h.qc(),h.qc(),h.rc(11,"app-mobile-scaffold"),h.rc(12,"b2c-floating-bar"),h.rc(13,"button",7),h.zc("click",(function(){return t.cancelOrRemoveFund(t.selectedFund)})),h.qd(14),h.qc(),h.rc(15,"button",8),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(16),h.qc(),h.qc(),h.qc(),h.od(17,Po,1,2,"ng-template",null,9,h.pd),h.rc(19,"terminate-rsp-msg-modal",10),h.zc("closeTerminateRspMsgModal",(function(){return t.closeTerminateRspMsgModal()})),h.qc(),h.rc(20,"ui-modal-pc-drawer-mobile",11),h.zc("nzOnCancel",(function(){return t.triggerDisclaimerModal()})),h.mc(21,"auto-sweep-disclaimer-content"),h.qc(),h.od(22,ko,1,1,"ng-template",null,12,h.pd)),2&e){const e=h.ad(18);h.Ub(1),h.Mc("selectedFund",t.selectedFund),h.Ub(3),h.Mc("ngIf",!t.formLoading)("ngIfElse",e),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoading),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoading),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(3),h.Mc("showTerminateRspMsgModal",t.showTerminateRspMsgModal),h.Ub(1),h.Mc("nzVisible",t.disclaimerModalVisible)("nzClosable",!0)("nzMaskClosable",!1)("nzWidth",630)("nzFooter",null)("isMobileFullScreen",!0)}},directives:[to,p.t,B.a,_.a,z.a,Se.a,oo,so.a,ao.a,oe.J,oe.u,se.b,oe.l,P.c,P.a,se.e,se.a,Lt.d,oe.t,oe.i,Lt.a,p.s,ae.c,oe.z,oe.c,ae.b,p.q,lo.a,p.A,se.c,k.b,W.a,ro.a],pipes:[p.b,ke.a],styles:[".link-underline-none[_ngcontent-%COMP%]{color:#0073cf!important;text-decoration:none!important}
5.link-underline-none[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Eo(e,t){if(1&e){const e=h.sc();h.rc(0,"app-sell-fund-fill-detail-form",12),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onCancel()}))("bankRequired",(function(t){return h.dd(e),h.Dc(2).onBankRequired(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)}}function Fo(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",4),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.rc(1,"div",5),h.rc(2,"nz-row",6),h.rc(3,"nz-col",7),h.rc(4,"h3",8),h.qd(5),h.qc(),h.qc(),h.rc(6,"nz-col",9),h.rc(7,"i",10),h.zc("click",(function(){return h.dd(e),h.Dc().onCancel()})),h.qc(),h.qc(),h.qc(),h.od(8,Eo,1,3,"app-sell-fund-fill-detail-form",11),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzClosable",!1)("nzMaskClosable",!0)("nzWrapClassName","vertical-center-modal")("nzFooter",null)("nzWidth",600)("nzVisible",e.show),h.Ub(5),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," "),h.Ub(3),h.Mc("ngIf",e.show)}}function Oo(e,t){if(1&e){const e=h.sc();h.rc(0,"app-sell-fund-fill-detail-form",12),h.zc("closed",(function(){return h.dd(e),h.Dc(3).onCancel()}))("bankRequired",(function(t){return h.dd(e),h.Dc(3).onBankRequired(t)})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)}}function Uo(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",14),h.rc(2,"b2c-app-bar-2",15),h.zc("back",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.qc(),h.rc(3,"div",16),h.rc(4,"div",17),h.rc(5,"h3"),h.qd(6),h.qc(),h.od(7,Oo,1,3,"app-sell-fund-fill-detail-form",11),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(2),h.Mc("title","Edit Order"),h.Ub(4),h.rd(null==e.selectedFund?null:e.selectedFund.productName),h.Ub(1),h.Mc("ngIf",e.show)}}function xo(e,t){if(1&e&&(h.pc(0),h.od(1,Uo,8,3,"ng-container",13),h.Ec(2,"async"),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",h.Fc(2,1,e.isMobile$)&&e.show&&e.selectedFund)}}function Lo(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bank-account-required-modal",20),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()}))("create",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("refno",h.Fc(1,4,e.refno$))("otpRequired",!1)("show",e.showBankAccountRequiredModal)("selectedCurrency",e.selectedCurrency)}}const Ro=function(){return{}},No=function(){return{position:"fixed",top:"0",left:"0",width:"100%","z-index":"1050","padding-top":"80px"}};function Bo(e,t){if(1&e&&(h.rc(0,"div",18),h.Ec(1,"async"),h.od(2,Lo,2,6,"app-bank-account-required-modal",19),h.qc()),2&e){const e=h.Dc();h.Mc("ngStyle",h.Fc(1,2,e.isMobile$)?h.Rc(4,Ro):h.Rc(5,No)),h.Ub(2),h.Mc("ngIf",e.showBankAccountRequiredModal)}}function _o(e,t){if(1&e&&h.mc(0,"nz-skeleton",21),2&e){const e=h.Dc();h.Mc("nzLoading",e.isLoading)("nzActive",!0)}}let Vo=(()=>{class e{constructor(){this.addedFund=[],this.closed=new h.s,this.transactionConstant=U.a,this.isMobile=!1,this.showTerminateRspMsgModal=!1,this.showBankAccountRequiredModal=!1}ngOnInit(){this.isMobile$.subscribe(e=>this.isMobile=e)}onCancel(){this.closed.emit()}onBankRequired(e){this.selectedCurrency=e,this.showBankAccountRequiredModal=!0,this.isMobile||(this.show=!1)}onBankAccountModalClosed(){this.showBankAccountRequiredModal=!1,this.show=!0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-sell-fund-fill-detail"]],inputs:{show:"show",selectedFund:"selectedFund",isLoading:"isLoading",addedFund:"addedFund",isUpdate:"isUpdate"},outputs:{closed:"closed"},features:[h.Tb([l.a])],decls:8,vars:6,consts:[[3,"nzClosable","nzMaskClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel",4,"ngIf"],[4,"ngIf","ngIfElse"],[3,"ngStyle",4,"ngIf"],["loadingTemplate",""],[3,"nzClosable","nzMaskClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel"],[1,"p-2"],["nzType","flex","nzAlign","middle"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[3,"selectedFund","addedFund","isUpdate","closed","bankRequired",4,"ngIf"],[3,"selectedFund","addedFund","isUpdate","closed","bankRequired"],[4,"ngIf"],[1,"border-bottom"],[3,"title","back"],[1,"bg-white","shadow"],[1,"p-3"],[3,"ngStyle"],[3,"refno","otpRequired","show","selectedCurrency","closed","create",4,"ngIf"],[3,"refno","otpRequired","show","selectedCurrency","closed","create"],[3,"nzLoading","nzActive"]],template:function(e,t){if(1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,Fo,9,8,"nz-modal",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,xo,3,3,"ng-container",1),h.qc(),h.od(5,Bo,3,6,"div",2),h.od(6,_o,1,2,"ng-template",null,3,h.pd)),2&e){const e=h.ad(7);h.Ub(1),h.Mc("ngIf",!h.Fc(2,4,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(1),h.Mc("ngIf",t.showBankAccountRequiredModal)}},directives:[B.a,p.t,z.a,j.a,P.c,P.a,k.b,Ao,D.a,p.w,xn.a,W.a],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function Ho(e,t){if(1&e&&h.mc(0,"ui-option",18),2&e){const e=t.$implicit;h.Mc("nzLabel",e)("nzValue",e)}}function $o(e,t){if(1&e&&h.mc(0,"ui-option",18),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function jo(e,t){if(1&e&&(h.rc(0,"nz-col",15),h.rc(1,"nz-form-item",16),h.rc(2,"nz-form-control"),h.rc(3,"ui-select",29),h.od(4,$o,1,2,"ui-option",20),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",12),h.Ub(3),h.Mc("formControl",e.sellBy),h.Ub(1),h.Mc("ngForOf",e.sellByOption)}}function Go(e,t){if(1&e&&(h.rc(0,"label",33),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function Wo(e,t){if(1&e&&(h.rc(0,"nz-col",15),h.rc(1,"p",30),h.qd(2,"Sell By"),h.qc(),h.rc(3,"nz-radio-group",31),h.od(4,Go,2,2,"label",32),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",24),h.Ub(3),h.Mc("formControl",e.sellBy),h.Ub(1),h.Mc("ngForOf",e.sellByOption)}}function Yo(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2," Please Enter Unit With 2 Decimal Places. "),h.qc())}function Ko(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2," Please make sure this field is not blank. "),h.qc())}function Xo(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2),h.Ec(3,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd(" The minimum sell amount for this fund is ",h.Gc(3,1,e.selectedFund.minRedemptionNum,e.transactionConstant.PAYMENT_CURRENCY_MYR)," worth of units. ")}}function Qo(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2),h.Ec(3,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd(" The minimum retain amount for this fund is ",h.Gc(3,1,e.selectedFund.minRetainNum,e.transactionConstant.PAYMENT_CURRENCY_MYR)," worth of units. ")}}const Zo=function(e){return{"m-0":e}};function Jo(e,t){if(1&e&&(h.rc(0,"nz-col",15),h.Ec(1,"async"),h.rc(2,"nz-form-item",24),h.rc(3,"nz-form-control",34),h.rc(4,"nz-col",35),h.rc(5,"ui-input-group",36),h.mc(6,"input",37),h.qc(),h.qc(),h.od(7,Yo,3,0,"nz-form-explain",23),h.od(8,Ko,3,0,"nz-form-explain",23),h.od(9,Xo,4,4,"nz-form-explain",23),h.od(10,Qo,4,4,"nz-form-explain",23),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",h.Fc(1,9,e.isMobile$)?24:12),h.Ub(2),h.Mc("ngClass",h.Sc(11,Zo,null==e.redemptionUnits?null:e.redemptionUnits.hasError("invalidSell"))),h.Ub(2),h.Mc("nzSpan",24),h.Ub(1),h.Mc("nzLabelPlaceholder","Units To Sell"),h.Ub(1),h.Mc("formControl",e.redemptionUnits),h.Ub(1),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("pattern")),h.Ub(1),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("required")),h.Ub(1),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("invalidMinRedemption")),h.Ub(1),h.Mc("ngIf",e.redemptionUnits.dirty&&e.redemptionUnits.hasError("invalidMinHolding")||e.redemptionUnits.pristine&&e.redemptionUnits.hasError("noReachMinimum"))}}function es(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd(" Please Enter Amount With ",e.redemptionAmountDecimalPlaces," Decimal Places. ")}}function ts(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2," Please make sure this field is not blank. "),h.qc())}function ns(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2),h.Ec(3,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd(" The minimum sell amount for this fund is ",h.Gc(3,1,e.selectedFund.minRedemptionNum,e.transactionConstant.PAYMENT_CURRENCY_MYR),". ")}}function is(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2),h.Ec(3,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd(" The minimum retain amount for this fund is ",h.Gc(3,1,e.selectedFund.minRetainNum,e.transactionConstant.PAYMENT_CURRENCY_MYR),". ")}}function cs(e,t){if(1&e&&(h.rc(0,"nz-col",15),h.Ec(1,"async"),h.rc(2,"nz-form-item",24),h.rc(3,"nz-form-control",34),h.rc(4,"nz-col",35),h.rc(5,"ui-input-group",36),h.mc(6,"input",37),h.qc(),h.qc(),h.od(7,es,3,1,"nz-form-explain",23),h.od(8,ts,3,0,"nz-form-explain",23),h.od(9,ns,4,4,"nz-form-explain",23),h.od(10,is,4,4,"nz-form-explain",23),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",h.Fc(1,9,e.isMobile$)?24:12),h.Ub(2),h.Mc("ngClass",h.Sc(11,Zo,null==e.redemptionAmount?null:e.redemptionAmount.hasError("invalidSell"))),h.Ub(2),h.Mc("nzSpan",24),h.Ub(1),h.Mc("nzLabelPlaceholder","Amt. To Sell"),h.Ub(1),h.Mc("formControl",e.redemptionAmount),h.Ub(1),h.Mc("ngIf",e.redemptionAmount.dirty&&e.redemptionAmount.hasError("pattern")),h.Ub(1),h.Mc("ngIf",e.redemptionAmount.dirty&&e.redemptionAmount.hasError("required")),h.Ub(1),h.Mc("ngIf",e.redemptionAmount.dirty&&e.redemptionAmount.hasError("invalidMinRedemption")),h.Ub(1),h.Mc("ngIf",e.redemptionAmount.dirty&&e.redemptionAmount.hasError("invalidMinHolding"))}}function os(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span",39),h.mc(2,"i",38),h.rc(3,"span"),h.qd(4),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(4),h.sd(" ",null!=e.redemptionUnits&&e.redemptionUnits.hasError("invalidSell")?null==e.redemptionUnits?null:e.redemptionUnits.getError("invalidSell"):null==e.redemptionAmount?null:e.redemptionAmount.getError("invalidSell")," ")}}function ss(e,t){if(1&e&&h.mc(0,"ui-option",18),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function as(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",38),h.qd(2," Please make sure this field is not blank. "),h.qc())}const ls=function(e){return{"mb-6 pb-6":e}};function rs(e,t){if(1&e){const e=h.sc();h.rc(0,"form",13),h.rc(1,"nz-row",14),h.rc(2,"nz-col",15),h.Ec(3,"async"),h.rc(4,"nz-form-item",16),h.rc(5,"nz-form-control"),h.rc(6,"ui-select",17),h.mc(7,"ui-option",18),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(8,"nz-col",15),h.Ec(9,"async"),h.rc(10,"nz-form-item",16),h.rc(11,"nz-form-control"),h.rc(12,"ui-select",19),h.od(13,Ho,1,2,"ui-option",20),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(14,"nz-row",21),h.od(15,jo,5,3,"nz-col",22),h.Ec(16,"async"),h.od(17,Wo,5,3,"nz-col",22),h.Ec(18,"async"),h.od(19,Jo,11,13,"nz-col",22),h.od(20,cs,11,13,"nz-col",22),h.qc(),h.od(21,os,5,1,"nz-form-explain",23),h.rc(22,"nz-form-item",24),h.Ec(23,"async"),h.rc(24,"nz-form-control",25),h.rc(25,"label",26),h.zc("nzCheckedChange",(function(t){return h.dd(e),h.Dc().onSellAllCheckChange(t)}
5)),h.qd(26,"Sell All"),h.qc(),h.qc(),h.qc(),h.rc(27,"nz-row",27),h.Ec(28,"async"),h.rc(29,"nz-col",15),h.Ec(30,"async"),h.rc(31,"nz-form-item"),h.rc(32,"nz-form-control"),h.rc(33,"ui-select",28),h.od(34,ss,1,2,"ui-option",20),h.qc(),h.od(35,as,3,0,"nz-form-explain",23),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("formGroup",e.form),h.Ub(2),h.Mc("nzSpan",h.Fc(3,20,e.isMobile$)?24:12),h.Ub(4),h.Mc("formControl",e.redemptionType),h.Ub(1),h.Mc("nzLabel","Cash")("nzValue","cheque"),h.Ub(1),h.Mc("nzSpan",h.Fc(9,22,e.isMobile$)?24:12),h.Ub(4),h.Mc("formControl",e.redemptionCurrency),h.Ub(1),h.Mc("ngForOf",null==e.selectedFund?null:e.selectedFund.availableCurrency),h.Ub(2),h.Mc("ngIf",!h.Fc(16,24,e.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(18,26,e.isMobile$)),h.Ub(2),h.Mc("ngIf",(null==e.sellBy?null:e.sellBy.value)===e.transactionConstant.UNITS),h.Ub(1),h.Mc("ngIf",(null==e.sellBy?null:e.sellBy.value)===e.transactionConstant.AMOUNT),h.Ub(1),h.Mc("ngIf",(e.redemptionUnits.dirty||e.redemptionAmount.dirty)&&e.redemptionUnits.hasError("invalidSell")||(null==e.redemptionAmount?null:e.redemptionAmount.hasError("invalidSell"))),h.Ub(1),h.Mc("ngClass",h.Sc(34,Zo,h.Fc(23,28,e.isMobile$))),h.Ub(3),h.Mc("nzChecked",e.isSellAll.value),h.Ub(2),h.Mc("ngClass",h.Sc(36,ls,h.Fc(28,30,e.isMobile$))),h.Ub(2),h.Mc("nzSpan",(h.Fc(30,32,e.isMobile$),24)),h.Ub(4),h.Mc("formControl",e.redemptionMethod),h.Ub(1),h.Mc("ngForOf",e.redemptionMethodOption),h.Ub(1),h.Mc("ngIf",e.redemptionMethod.dirty&&e.redemptionMethod.hasError("required"))}}function ds(e,t){if(1&e&&h.mc(0,"nz-skeleton",40),2&e){const e=h.Dc();h.Mc("nzLoading",e.isFormLoading)("nzActive",!0)}}function us(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",41),h.rc(2,"div",42),h.mc(3,"img",43),h.qc(),h.rc(4,"div",44),h.rc(5,"h5",45),h.qd(6,"Disclaimer"),h.qc(),h.rc(7,"p",46),h.qd(8,"By selecting Auto-Sweep as your redemption method, FSMOne will automatically opt you in. I confirm that I have read, agree to, and understand all the relevant "),h.rc(9,"a",47),h.zc("click",(function(){return h.dd(e),h.Dc(2).triggerDisclaimerModal()})),h.qd(10,"clauses and terms"),h.qc(),h.qd(11,"."),h.qc(),h.qc(),h.qc(),h.oc()}2&e&&(h.Ub(3),h.Mc("src","/assets/images/rsp/handshake.svg",h.gd))}function hs(e,t){if(1&e&&h.od(0,us,12,1,"ng-container",23),2&e){const e=h.Dc();h.Mc("ngIf",e.isAutoOptInASDisclaimerVisible)}}let ps=(()=>{class e{constructor(e,t,n,i,c,o,s){this.fb=e,this.store=t,this.subHandlingService=n,this.transactionService=i,this.accountRestService=c,this.transactionRestService=o,this.currencyFormatService=s,this.addedFund=[],this.closed=new h.s,this.bankRequired=new h.s,this.transactionConstant=U.a,this.localBanks=[],this.overseaBanks=[],this.redemptionMethodOption=[],this.sellByOption=[{label:"Amount",value:U.a.AMOUNT},{label:"Units",value:U.a.UNITS}],this.twoDecimalPlacesRegex=/^-?\d*[.,]?\d{0,2}$/,this.showTerminateRspMsgModal=!1,this.showedTerminateRspMsgModal=!1,this.isFormLoading=!1,this.showDrawer=!1,this.disclaimerModalVisible=!1,this.isAutoOptInASDisclaimerVisible=!1,this.refno=this.store.selectSnapshot(u.X.getSelectedRefno)}ngOnInit(){var e,t,n,i,c,o,s,a,l,r,d,u,h,p,m,f,g,b,S,y,v,M,C,q,T,w,z,D;this.getRedemptionMethod(),this.redemptionAmountDecimalPlaces=this.currencyFormatService.getDecimalPlaces(null===(e=this.selectedFund)||void 0===e?void 0:e.fundCurrencyCode),this.maxRedemptionAmount=this.currencyFormatService.formatInputNumber((null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)*(null===(n=this.selectedFund)||void 0===n?void 0:n.lastestPrice),null===(i=this.selectedFund)||void 0===i?void 0:i.fundCurrencyCode),this.form=this.fb.group({redemptionType:[{value:U.a.CHEQUE.toLowerCase(),disabled:!0},[oe.H.required]],redemptionCurrency:[{value:null===(c=this.selectedFund)||void 0===c?void 0:c.fundCurrencyCode,disabled:!0},[oe.H.required]],sellBy:[U.a.AMOUNT,[oe.H.required]],redemptionUnits:["",[oe.H.required,oe.H.pattern(this.twoDecimalPlacesRegex),Object(Oc.q)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRedemptionNum,null===(s=this.selectedFund)||void 0===s?void 0:s.lastestPrice,null===(a=this.selectedFund)||void 0===a?void 0:a.minRedemptionType,null===(l=this.selectedFund)||void 0===l?void 0:l.availableQuantity,null===(r=this.selectedFund)||void 0===r?void 0:r.availableValue),Object(Oc.l)(null===(d=this.selectedFund)||void 0===d?void 0:d.minRetainNum,null===(u=this.selectedFund)||void 0===u?void 0:u.availableValue,null===(h=this.selectedFund)||void 0===h?void 0:h.availableQuantity,null===(p=this.selectedFund)||void 0===p?void 0:p.lastestPrice,null===(m=this.selectedFund)||void 0===m?void 0:m.minRetainType)]],redemptionAmount:["",[oe.H.required,oe.H.pattern(this.currencyFormatService.getInputPattern(null===(f=this.selectedFund)||void 0===f?void 0:f.fundCurrencyCode)),Object(Oc.o)(null===(g=this.selectedFund)||void 0===g?void 0:g.minRedemptionNum,null===(b=this.selectedFund)||void 0===b?void 0:b.lastestPrice,null===(S=this.selectedFund)||void 0===S?void 0:S.availableValue,null===(y=this.selectedFund)||void 0===y?void 0:y.availableQuantity),Object(Oc.l)(null===(v=this.selectedFund)||void 0===v?void 0:v.minRetainNum,null===(M=this.selectedFund)||void 0===M?void 0:M.availableValue,null===(C=this.selectedFund)||void 0===C?void 0:C.availableQuantity,null===(q=this.selectedFund)||void 0===q?void 0:q.lastestPrice,null===(T=this.selectedFund)||void 0===T?void 0:T.minRetainType)]],indicativeRedemptionAmt:[this.currencyFormatService.formatInputNumber((null===(w=this.selectedFund)||void 0===w?void 0:w.minRedemptionNum)*(null===(z=this.selectedFund)||void 0===z?void 0:z.lastestPrice),null===(D=this.selectedFund)||void 0===D?void 0:D.fundCurrencyCode)],isSellAll:[!1],redemptionMethod:["",[oe.H.required]]}),this.isUpdate&&this.updateForm(),this.subscribeSellBy(),this.subscribeAmountToSell(),this.subscribeUnitsToSell(),this.subscribeRedemptionMethod(),this.getUserBankDetail
5sAndCheckBankExist()}cancelOrRemoveCart(){this.isUpdate&&this.transactionService.removeSellCartInfo(this.refno,this.selectedFund.productCode,this.selectedFund.paymentMethod),this.closed.emit()}onCancel(){this.closed.emit()}subscribeSellBy(){this.subHandlingService.subscribe(this.sellBy.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t,n,i;e===U.a.AMOUNT?(null===(t=this.redemptionAmount)||void 0===t||t.enable(),Object(zn.d)([this.redemptionUnits]),this.isSellAll.patchValue(this.redemptionAmount.value>=this.maxRedemptionAmount)):(null===(n=this.redemptionUnits)||void 0===n||n.enable(),Object(zn.d)([this.redemptionAmount]),this.isSellAll.patchValue(this.redemptionUnits.value>=(null===(i=this.selectedFund)||void 0===i?void 0:i.availableQuantity))),this.form.updateValueAndValidity()})))}subscribeUnitsToSell(){this.subHandlingService.subscribe(this.redemptionUnits.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t,n,i;this.isSellAll.patchValue(e===(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)),e>=(null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity)?(this.setRedemptionUnitNoDpValidators(),this.redemptionUnits.patchValue(null===(i=this.selectedFund)||void 0===i?void 0:i.availableQuantity,{emitEvent:!1})):this.setRedemptionUnitWithDpValidators()})))}subscribeRedemptionMethod(){this.redemptionMethod.valueChanges.subscribe(e=>{if(null==e?void 0:e.includes(U.a.AUTO_SWEEP)){const t=e.split(U.a.AUTO_SWEEP)[0].trim();this.redemptionCurrency.patchValue(t);const n=this.redemptionMethodOption.find(t=>(null==t?void 0:t.value)===e);this.isAutoOptInASDisclaimerVisible=!(null==n?void 0:n.hasOptedIn)}else this.isAutoOptInASDisclaimerVisible=!1})}subscribeAmountToSell(){this.subHandlingService.subscribe(this.redemptionAmount.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{this.isSellAll.patchValue(!1),e>=this.maxRedemptionAmount&&(this.redemptionAmount.patchValue(this.maxRedemptionAmount,{emitEvent:!1}),this.isSellAll.patchValue(!0))})))}onSellAllCheckChange(e){var t;this.isSellAll.patchValue(e),e?this.sellBy.value===U.a.AMOUNT?this.redemptionAmount.patchValue(this.maxRedemptionAmount):(console.log("asd"),this.setRedemptionUnitNoDpValidators(),this.redemptionUnits.patchValue(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)):(this.setRedemptionUnitWithDpValidators(),this.redemptionUnits.patchValue(""),this.redemptionAmount.patchValue("")),Object(zn.c)(this.form)}get redemptionType(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redemptionType")}get redemptionCurrency(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redemptionCurrency")}get sellBy(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("sellBy")}get redemptionUnits(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redemptionUnits")}get redemptionAmount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redemptionAmount")}get indicativeRedemptionAmt(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("indicativeRedemptionAmt")}get isSellAll(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isSellAll")}get redemptionMethod(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redemptionMethod")}getRedemptionMethod(){var e,t,n;const i=(null===(e=this.localBanks)||void 0===e?void 0:e.find(e=>{var t;return e.currency===(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value)}))||(null===(t=this.overseaBanks)||void 0===t?void 0:t.find(e=>{var t;return e.currency===(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value)}));this.redemptionMethodOption=[],null===(n=this.selectedFund)||void 0===n||n.availableRedemptionMethodWithParkingFacilityFund.forEach(e=>{var t,n,c,o,s;let a=e.displayName,l=e.hasOptedIn;if(e.paymentMode===U.a.TRUST_ACCOUNT&&(a=((null===(t=this.form)||void 0===t?void 0:t.get("redemptionCurrency"))?null===(n=this.redemptionCurrency)||void 0===n?void 0:n.value:null===(c=this.selectedFund)||void 0===c?void 0:c.fundCurrencyCode)+" Cash Account"),e.paymentMode===U.a.AUTO_SWEEP&&(a=e.redemptionCurrency+" Auto-Sweep"),i&&e.paymentMode===U.a.CHEQUE_FPX){let e=Object(Uc.a)("*",i.bankAcctNo);null===e&&(e=null===(o=this.selectedFund)||void 0===o?void 0:o.fundCurrencyCode),a="Credit to Bank Acc ["+e+"]",this.bankModel=i}(e.paymentMode!==U.a.AUTO_SWEEP||gt.a.AUTO_SWEEP_CURRENCY.includes(null===(s=this.selectedFund)||void 0===s?void 0:s.fundCurrencyCode))&&this.redemptionMethodOption.push({label:a,value:this.getAvailableRedemptionMethodValue(e),hasOptedIn:l})})}getAvailableRedemptionMethodValue(e){return U.a.CASH_FUND===(null==e?void 0:e.paymentMode)?U.a.CASH_FUND+"|"+e.sedolnumber:U.a.AUTO_SWEEP===(null==e?void 0:e.paymentMode)?(null==e?void 0:e.redemptionCurrency)+" Auto-Sweep":null==e?void 0:e.paymentMode}addOrUpdateCart(){var e,t,n,i;if(this.indicativeRedemptionAmt.patchValue(this.sellBy.value===U.a.AMOUNT?this.currencyFormatService.formatInputNumber(this.redemptionAmount.value,null===(e=this.selectedFund)||void 0===e?void 0:e.fundCurrencyCode):this.currencyFormatService.formatInputNumber(this.redemptionUnits.value*this.selectedFund.lastestPrice,null===(t=this.selectedFund)||void 0===t?void 0:t.fundCurrencyCode)),Object(zn.c)(this.form),this.form.updateValueAndValidity(),this.form.invali
5d)return;if(this.selectedFund.normalRspFund&&this.isSellAll.value&&!this.showedTerminateRspMsgModal&&(null===(n=this.selectedFund)||void 0===n?void 0:n.hasActiveRsp))return this.showTerminateRspMsgModal=!0,void(this.showedTerminateRspMsgModal=!0);if((null===(i=this.redemptionMethod)||void 0===i?void 0:i.value)===U.a.CHEQUE_FPX)return void this.checkUserBankExistAndValidateCart();this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1);const c=this.mapSellInfoData();this.validateSellInfoAndAddCart(c)}updateForm(){var e;const t=null===(e=this.addedFund)||void 0===e?void 0:e.find(e=>{var t,n;return e.sedolNumber===(null===(t=this.selectedFund)||void 0===t?void 0:t.productCode)&&e.sellInfoModel.paymentMethod.toLowerCase()===(null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod.toLowerCase())});this.redemptionType.patchValue(U.a.CHEQUE.toLowerCase()),this.redemptionUnits.patchValue(null==t?void 0:t.sellInfoModel.redemptionUnits),this.redemptionAmount.patchValue(null==t?void 0:t.sellInfoModel.redemptionAmount),this.indicativeRedemptionAmt.patchValue(null==t?void 0:t.sellInfoModel.redemptionAmount),this.sellBy.patchValue((null==t?void 0:t.sellInfoModel.isRedeemByAmount)?U.a.AMOUNT:U.a.UNITS);let n=null==t?void 0:t.redemptionCategory;"Cash Fund"===(null==t?void 0:t.redemptionCategory)&&(n=(null==t?void 0:t.redemptionCategory)+"|"+(null==t?void 0:t.sellInfoModel.cashFundSedol)),this.redemptionMethod.patchValue(n),this.isSellAll.patchValue(this.isCartSellAll(t))}isCartSellAll(e){var t;return(null==e?void 0:e.sellInfoModel.redemptionAmount)===this.maxRedemptionAmount||(null==e?void 0:e.sellInfoModel.redemptionUnits)===(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)}closeTerminateRspMsgModal(){this.showTerminateRspMsgModal=!1}checkUserBankExistAndValidateCart(){var e;this.isValidating=!0,this.subHandlingService.once(this.accountRestService.getRedemptionBankDetails(this.refno,null===(e=this.redemptionCurrency)||void 0===e?void 0:e.value).pipe(Object(E.a)(e=>{var t,n;const i=!!this.store.selectSnapshot(u.X.getBankAccountToCreate).find(e=>{var t;return e.currency===(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value)});if(this.existBank=e.data||i,!this.existBank)return this.bankRequired.emit(null===(t=this.redemptionCurrency)||void 0===t?void 0:t.value),void(this.isValidating=!1);this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1);const c=this.mapSellInfoData();return(null===(n=this.redemptionCurrency)||void 0===n?void 0:n.value)&&e.data&&(this.bankModel.canEdit=!0,this.addBankModel(this.bankModel)),this.transactionRestService.validateSellCart(this.refno,c)}),Object(y.a)(e=>{var t,n,i;if(this.isValidating=!1,e.status===M.a.RESPONSE_FAILED)return this.errorMessage=e.errorMessage,void((null===(t=this.sellBy)||void 0===t?void 0:t.value)===U.a.AMOUNT?null===(n=this.redemptionAmount)||void 0===n||n.setErrors({invalidSell:this.errorMessage}):null===(i=this.redemptionUnits)||void 0===i||i.setErrors({invalidSell:this.errorMessage}));this.form.enable(),this.isUpdate?this.transactionService.updateSellCartInfo(this.form,this.selectedFund,this.redemptionMethodOption):this.transactionService.storeSellCart(this.form,this.selectedFund,this.redemptionMethodOption),this.closed.emit()})))}getUserBankDetailsAndCheckBankExist(){this.isFormLoading=!0,this.subHandlingService.once(this.accountRestService.getBankDetails(this.refno).pipe(Object(y.a)(e=>{this.isFormLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.bankDetails=e.data,this.localBanks=e.data.Local,this.overseaBanks=e.data.Overseas)}),Object(y.a)(()=>{this.getRedemptionMethod()})))}mapSellInfoData(){var e,t,n,i,c,o,s,a,l=null===(e=this.redemptionMethod)||void 0===e?void 0:e.value,r="";if(-1!=l.indexOf(U.a.CASH_FUND)){const e=l.split("|");l=e[0],r=e[1]}(null==l?void 0:l.toString().includes(U.a.AUTO_SWEEP))&&(l=U.a.AUTO_SWEEP);const d={sedolNumber:null===(t=this.selectedFund)||void 0===t?void 0:t.productCode,isRedeemByAmount:(null===(n=this.sellBy)||void 0===n?void 0:n.value)===U.a.AMOUNT,redemptionMethod:l,currency:null===(i=this.redemptionCurrency)||void 0===i?void 0:i.value,ifastStatus:"NA",paymentMethod:null===(c=this.redemptionType)||void 0===c?void 0:c.value,cashFundSedol:r};return(null===(o=this.sellBy)||void 0===o?void 0:o.value)===U.a.AMOUNT?d.redemptionAmount=null===(s=this.redemptionAmount)||void 0===s?void 0:s.value:d.redemptionUnits=null===(a=this.redemptionUnits)||void 0===a?void 0:a.value,d}validateSellInfoAndAddCart(e){this.isValidating=!0,this.subHandlingService.once(this.transactionRestService.validateSellCart(this.refno,e).pipe(Object(y.a)(e=>{var t,n,i;if(this.isValidating=!1,e.status===M.a.RESPONSE_FAILED)return this.errorMessage=e.errorMessage,void((null===(t=this.sellBy)||void 0===t?void 0:t.value)===U.a.AMOUNT?null===(n=this.redemptionAmount)||void 0===n||n.setErrors({invalidSell:this.errorMessage}):null===(i=this.redemptionUnits)||void 0===i||i.setErrors({invalidSell:this.errorMessage}));this.form.enable(),this.isUpdate?this.transactionService.updateSellCartInfo(this.form,this.selectedFund,this.redemptionMethodOption):this.transactionService.storeSellCart(this.form,this.selectedFund,this.redemptionMethodOption),this.closed.emit
5()})))}onClickRedemptionMethod(){this.showDrawer=!0}onViewChange(e){this.showDrawer=e}onRedemptionMethodChange(e){this.redemptionMethod.patchValue(e)}setRedemptionUnitNoDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.redemptionUnits.setValidators([Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.l)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}setRedemptionUnitWithDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.redemptionUnits.setValidators([oe.H.pattern(this.twoDecimalPlacesRegex),Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.l)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}addBankModel(e){if(!e)return;let t=!1;this.subHandlingService.once(this.store.select(u.I.getBankModelsToShow).pipe(Object(S.a)(e=>e(this.refno))).pipe(Object(y.a)(n=>{if((null==n?void 0:n.length)>0)for(let i of n)i.currency===e.currency&&(t=!0);t||this.transactionService.addBankModelToShow(e)})))}triggerDisclaimerModal(){this.disclaimerModalVisible=!this.disclaimerModalVisible}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(s.i),h.lc(l.a),h.lc(C.a),h.lc(bt.a),h.lc(T.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["sell-cmf-fund-fill-detail-form"]],inputs:{selectedFund:"selectedFund",isUpdate:"isUpdate",isLoading:"isLoading",addedFund:"addedFund"},outputs:{closed:"closed",bankRequired:"bankRequired"},features:[h.Tb([l.a])],decls:24,vars:16,consts:[[1,""],[3,"selectedFund"],[1,"font-weight-bold","mt-4","mb-2"],["nz-form","",3,"formGroup",4,"ngIf","ngIfElse"],[1,"text-right"],["nz-button","","nzType","outline",1,"mx-1",3,"click"],["nz-button","","nzType","primary",1,"mx-1",3,"nzLoading","click"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzType","primary","nzBlock","",1,"my-1",3,"nzLoading","click"],[3,"showTerminateRspMsgModal","closeTerminateRspMsgModal"],["formLoadingTemplate",""],["nzTitle","Disclaimer","nzClassName","modal-title-border",3,"nzVisible","nzClosable","nzMaskClosable","nzWidth","nzFooter","isMobileFullScreen","nzOnCancel"],["autoSweepAutoOptInDisclaimerTpl",""],["nz-form","",3,"formGroup"],["nzType","flex","nzGutter","16","nzAlign","middle"],[3,"nzSpan"],[1,"mb-2"],["nzPlaceHolder","Redemption Type",3,"formControl"],[3,"nzLabel","nzValue"],["nzPlaceHolder","Redemption Currency",3,"formControl"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzType","flex","nzGutter","16"],[3,"nzSpan",4,"ngIf"],[4,"ngIf"],[1,"mb-2",3,"ngClass"],[1,"form-control-line-height-base"],["nz-checkbox","",3,"nzChecked","nzCheckedChange"],["nzType","flex","nzGutter","16",3,"ngClass"],["nzPlaceHolder","Redemption Method",3,"formControl"],["nzPlaceHolder","Sell By",3,"formControl"],[1,"font-weight-bold","text-md","mt-3","mb-2"],["nzButtonStyle","solid","nzSize","small",1,"mb-3",3,"formControl"],["nz-radio-button","","class","px-4",3,"nzValue",4,"ngFor","ngForOf"],["nz-radio-button","",1,"px-4",3,"nzValue"],[1,"m-0"],[1,"px-0",3,"nzSpan"],[3,"nzLabelPlaceholder"],["ui-input","","type","number",3,"formControl"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],[1,"text-danger"],[3,"nzLoading","nzActive"],[1,"d-flex","bg-black-2","p-3","rounded","mb-4"],[1,"flex-shrink-0"],["alt","FSMOne Auto Disclaimer",1,"mr-2",3,"src"],[1,"flex-grow-1"],[1,"font-weight-bold","text-12px","mb-2"],[1,"text-12px","text-black-6","mb-0"],[1,"text-12px","link-underline-none","font-weight-bold",3,"click"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.mc(1,"sell-fund-detail-info",1),h.qc(),h.rc(2,"p",2),h.qd(3,"Enter Redemption Details"),h.qc(),h.od(4,rs,36,38,"form",3),h.rc(5,"app-web-scaffold"),h.rc(6,"div",4),h.rc(7,"button",5),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(8),h.qc(),h.rc(9,"button",6),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(10),h.qc(),h.qc(),h.qc(),h.rc(11,"app-mobile-scaffold"),h.rc(12,"b2c-floating-bar"),h.rc(13,"button",7),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(14),h.qc(),h.rc(15,"button",8),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(16),h.qc(),h.qc(),h.qc(),h.rc(17,"terminate-rsp-msg-modal",9),h.zc("closeTerminateRspMsgModal",(function(){return t.closeTerminateRspMsgModal()})),h.qc(),h.od(18,ds,1,2,"ng-template",null,10,h.pd),h.rc(20,"ui-modal-pc-drawer-mobile",11),h.zc("nzOnCancel",(function(){return t.triggerDisclaimerModal()})),h.mc(21,"auto-sweep-disclaimer-content"),h.qc(),h.od(22,hs,1,1,"ng-template",null,12,h.pd)),2&e){const e=h.ad(19);h.Ub(1),h.Mc("selectedFund",t.selectedFund),h.Ub(3),h.Mc("ngIf",!t.isFormLoading)("ngIfElse",e),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isValidating||t.isLoading),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isValidating||t.isLoading),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(1),h.Mc("showTerminateRspMsgModal",t.showTerminateRspMsgModal),h.Ub(3),h.Mc("nzVisible",t.disclaimerModalVisible)("nzClosable",!0)("nzMaskClosable",!1)("nzWidth",630)("nzFooter",null)("isMobileFullScreen",!0)}},directives:[to,p.t,B.a,_.a,z.a,Se.a,oo,so.a,ao.a,oe.J,oe.u,se.b,oe.l,P.c,P.a,se.e,se.a,Lt.d,oe.t,oe.i,Lt.a,p.s,p.q,lo.a,Ut.c,Ut.a,ae.c,oe.z,oe.c,ae.b,se.c,k.b,W.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function ms(e,t){if(1&e){const e=h.sc();h.rc(0,"sell-cmf-fund-fill-detail-form",14),h.zc("closed",(function(){return h.dd(e),h.Dc(3).onCancel()}))("bankRequired",(function(t){return h.dd(e),h.Dc(3).onBankRequired(t)})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("isUpdate",e.isUpdate)("selectedFund",e.selectedFund)("addedFund",e.addedFund)}}function fs(e,t){if(1&e){const e=h.sc();h.rc(0,"div",6),h.rc(1,"nz-row",7),h.rc(2,"nz-col",8),h.rc(3,"h3",9),h.qd(4),h.qc(),h.qc(),h.rc(5,"nz-col",10),h.rc(6,"i",11),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.qc(),h.qc(),h.od(7,ms,1,3,"sell-cmf-fund-fill-detail-form",12),h.mc(8,"div",13),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(4),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," "),h.Ub(3),h.Mc("ngIf",e.show)}}function gs(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",4),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.od(1,fs,9,2,"div",5),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzMaskClosable",!0)("nzClosable",!1)("nzWrapClassName","vertical-center-modal")("nzFooter",null)("nzWidth",600)("nzVisible",e.show),h.Ub(1),h.Mc("ngIf",e.selectedFund)}}function bs(e,t){if(1&e){const e=h.sc();h.rc(0,"sell-cmf-fund-fill-detail-form",14),h.zc("closed",(function(){return h.dd(e),h.Dc(3).onCancel()}))("bankRequired",(function(t){return h.dd(e),h.Dc(3).onBankRequired(t)})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("isUpdate",e.isUpdate)("selectedFund",e.selectedFund)("addedFund",e.addedFund)}}function Ss(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"b2c-app-bar",16),h.zc("back",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.rc(2,"div",17),h.rc(3,"div",18),h.rc(4,"h3"),h.qd(5),h.qc(),h.od(6,bs,1,3,"sell-cmf-fund-fill-detail-form",12),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("title","Edit Order"),h.Ub(4),h.rd(null==e.selectedFund?null:e.selectedFund.productName),h.Ub(1),h.Mc("ngIf",e.show)}}function ys(e,t){if(1&e&&(h.pc(0),h.od(1,Ss,7,3,"ng-container",15),h.Ec(2,"async"),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",h.Fc(2,1,e.isMobile$)&&e.show&&e.selectedFund)}}function vs(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bank-account-required-modal",21),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()}))("create",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("refno",h.Fc(1,4,e.refno$))("otpRequired",!1)("show",e.showBankAccountRequiredModal)("selectedCurrency",e.selectedCurrency)}}const Ms=function(){return{}},Cs=function(){return{position:"fixed",top:"0",left:"0",width:"100%","z-index":"1050","padding-top":"80px"}};function qs(e,t){if(1&e&&(h.rc(0,"div",19),h.Ec(1,"async"),h.od(2,vs,2,6,"app-bank-account-required-modal",20),h.qc()),2&e){const e=h.Dc();h.Mc("ngStyle",h.Fc(1,2,e.isMobile$)?h.Rc(4,Ms):h.Rc(5,Cs)),h.Ub(2),h.Mc("ngIf",e.showBankAccountRequiredModal)}}function Ts(e,t){if(1&e&&h.mc(0,"nz-skeleton",22),2&e){const e=h.Dc();h.Mc("nzLoading",e.isLoading)("nzActive",!0)}}let ws=(()=>{class e{constructor(){this.addedFund=[],this.closed=new h.s,this.transactionConstant=U.a,this.showTerminateRspMsgModal=!1}ngOnInit(){this.isMobile$.subscribe(e=>this.isMobile=e)}
5onCancel(){this.closed.emit()}onBankRequired(e){this.selectedCurrency=e,this.showBankAccountRequiredModal=!0,this.isMobile||(this.show=!1)}onBankAccountModalClosed(){this.showBankAccountRequiredModal=!1,this.show=!0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["sell-cmf-fund-fill-detail"]],inputs:{show:"show",selectedFund:"selectedFund",isUpdate:"isUpdate",isLoading:"isLoading",addedFund:"addedFund"},outputs:{closed:"closed"},features:[h.Tb([l.a])],decls:7,vars:6,consts:[[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel",4,"ngIf"],[4,"ngIf","ngIfElse"],[3,"ngStyle",4,"ngIf"],["loadingTemplate",""],[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel"],["class","p-2",4,"ngIf"],[1,"p-2"],["nzType","flex","nzAlign","middle"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[3,"isUpdate","selectedFund","addedFund","closed","bankRequired",4,"ngIf"],[1,"text-right"],[3,"isUpdate","selectedFund","addedFund","closed","bankRequired"],[4,"ngIf"],[3,"title","back"],[1,"bg-white"],[1,"p-3"],[3,"ngStyle"],[3,"refno","otpRequired","show","selectedCurrency","closed","create",4,"ngIf"],[3,"refno","otpRequired","show","selectedCurrency","closed","create"],[3,"nzLoading","nzActive"]],template:function(e,t){if(1&e&&(h.od(0,gs,2,7,"nz-modal",0),h.Ec(1,"async"),h.rc(2,"app-mobile-scaffold"),h.od(3,ys,3,3,"ng-container",1),h.qc(),h.od(4,qs,3,6,"div",2),h.od(5,Ts,1,2,"ng-template",null,3,h.pd)),2&e){const e=h.ad(6);h.Mc("ngIf",!h.Fc(1,4,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(1),h.Mc("ngIf",t.showBankAccountRequiredModal)}},directives:[p.t,z.a,j.a,P.c,P.a,k.b,ps,Bt.a,p.w,xn.a,W.a],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function zs(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",27),h.qd(2," Please Enter Amount With 2 Decimal Places. "),h.qc())}function Ds(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.sd(" The Min. Redemption is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRedemptionNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function Ps(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.sd("The Min. Redemption is ",null==e.selectedFund?null:e.selectedFund.minRedemptionNum," units.")}}function Is(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",27),h.od(3,Ds,3,4,"span",28),h.qc(),h.od(4,Ps,2,1,"ng-template",null,29,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc();h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function ks(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.sd(" The Min. Retain is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRetainNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function As(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.sd(" The Min. Retain is ",null==e.selectedFund?null:e.selectedFund.minRetainNum," units.")}}function Es(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",27),h.od(3,ks,3,4,"span",28),h.qc(),h.od(4,As,2,1,"ng-template",null,30,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc();h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function Fs(e,t){if(1&e&&(h.rc(0,"nz-col",5),h.rc(1,"nz-form-item",31),h.rc(2,"nz-form-control"),h.rc(3,"ui-input-group",32),h.mc(4,"input",13),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpan",16),h.Ub(3),h.Mc("nzPrefix",e.indicativeRedemptionAmt.value?null==e.redemptionCurrency?null:e.redemptionCurrency.value:""),h.Ub(1),h.Mc("formControl",e.indicativeRedemptionAmt)}}function Os(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",5),h.rc(2,"nz-form-item",6),h.rc(3,"nz-form-control"),h.rc(4,"ui-input-group",32),h.mc(5,"input",13),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzPrefix",e.indicativeRedemptionAmt.value?null==e.redemptionCurrency?null:e.redemptionCurrency.value:""),h.Ub(1),h.Mc("formControl",e.indicativeRedemptionAmt)}}function Us(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span",33),h.mc(2,"i",27),h.rc(3,"span"),h.qd(4),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(4),h.sd(" ",null==e.redemptionUnits?null:e.redemptionUnits.getError("invalidSell")," ")}}const xs=function(e){return{"m-0":e}},Ls=function(e){return{"pb-6 mb-6":e}},Rs=/^-?\d*[.,]?\d{0,2}$/;let Ns=(()=>{class e{constructor(e,t,n,i,c,o){this.fb=e,this.store=t,this.transactionService=n,this.transactionRestService=i,this.subHandlingService=c,this.currencyFormatService=o,this.addedFund=[],this.closed=new h.s,this.transactionConstant=U.a,this.currency=U.a.PAYMENT_CURRENCY_MYR,this.showErrorModal=!1,this.showedTerminateRspMsgModal=!1,this.showTerminateRspMsgModal=!1,this.availableRedemptionMethod={label:"EPF Account 1",value:"EPF"},this.refno=this.store.selectSnapshot(u.X.getSelectedRefno)}ngOnInit(){this.form=this.initForm(),this.subscribeUnitsToSell(),this.setFormInitValue()}initForm(){var e,t,n,i,c,o,s,a,l,r;return this.fb.group({redemptionType:[{value:"EPF",disabled:!0},[oe.H.required]],redemptionCurrency:["",[oe.H.required]],redemptionUnits:[{value:"",updateOn:"change"},[oe.H.pattern(Rs),Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)]],indicativeRedemptionAmt:[{value:"",disabled:!0}],isSellAll:[!1],redemptionMethod:[{value:"EPF Account 1"},[oe.H.required]]})}setFormInitValue(){var e,t,n,i;const c=null===(e=this.selectedFund)||void 0===e?void 0:e.productC
5ode,o=null===(t=this.addedFund)||void 0===t?void 0:t.find(e=>{var t;return e.sedolNumber===c&&e.sellInfoModel.paymentMethod===(null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod)});this.isSellAll.reset(),this.redemptionType.patchValue("EPF"),this.redemptionCurrency.patchValue(this.isUpdate?null==o?void 0:o.currencyCode:null===(n=this.selectedFund)||void 0===n?void 0:n.fundCurrencyCode),this.redemptionUnits.patchValue(this.isUpdate?null==o?void 0:o.sellInfoModel.redemptionUnits:""),this.indicativeRedemptionAmt.patchValue(this.isUpdate?this.currencyFormatService.formatInputNumber(null==o?void 0:o.sellInfoModel.redemptionAmount,null==o?void 0:o.currencyCode):""),this.redemptionMethod.patchValue(this.isUpdate?null==o?void 0:o.redemptionCategory:"EPF"),this.isSellAll.patchValue(!!this.isUpdate&&(null==o?void 0:o.redemptionUnits)===(null===(i=this.selectedFund)||void 0===i?void 0:i.availableQuantity))}addOrUpdateCart(){var e,t,n;if(Object(zn.c)(this.form),this.form.updateValueAndValidity(),!this.form.invalid){if((null===(e=this.selectedFund)||void 0===e?void 0:e.normalRspFund)&&(null===(t=this.isSellAll)||void 0===t?void 0:t.value)&&!this.showedTerminateRspMsgModal&&(null===(n=this.selectedFund)||void 0===n?void 0:n.hasActiveRsp))return this.showTerminateRspMsgModal=!0,void(this.showedTerminateRspMsgModal=!0);this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1),this.validateSellInfoAndAddCart()}}onSellAllCheckChange(e){var t;this.isSellAll.patchValue(e),e?(this.setRedemptionUnitNoDpValidators(),this.redemptionUnits.patchValue(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)):(this.setRedemptionUnitWithDpValidators(),this.redemptionUnits.patchValue(""))}subscribeUnitsToSell(){this.subHandlingService.subscribe(this.redemptionUnits.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t,n,i,c,o;const s=e*(null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice);this.indicativeRedemptionAmt.patchValue(this.currencyFormatService.formatInputNumber(s,this.redemptionCurrency.value)),e>=(null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity)?(this.setRedemptionUnitNoDpValidators(),this.redemptionUnits.patchValue(null===(i=this.selectedFund)||void 0===i?void 0:i.availableQuantity,{emitEvent:!1}),null===(c=this.isSellAll)||void 0===c||c.patchValue(!0)):(this.setRedemptionUnitWithDpValidators(),null===(o=this.isSellAll)||void 0===o||o.patchValue(!1))})))}cancelOrRemoveFund(e){this.isUpdate&&this.transactionService.removeSellCartInfo(this.refno,e.productCode,e.paymentMethod),this.closed.emit()}onCancel(){this.closed.emit()}closeTerminateRspMsgModal(){this.showTerminateRspMsgModal=!1}get redemptionType(){return this.form.get("redemptionType")}get redemptionCurrency(){return this.form.get("redemptionCurrency")}get redemptionUnits(){return this.form.get("redemptionUnits")}get indicativeRedemptionAmt(){return this.form.get("indicativeRedemptionAmt")}get isSellAll(){return this.form.get("isSellAll")}get redemptionMethod(){return this.form.get("redemptionMethod")}validateSellInfoAndAddCart(){var e,t,n,i,c;this.isValidating=!0;const o={sedolNumber:null===(e=this.selectedFund)||void 0===e?void 0:e.productCode,redemptionMethod:null===(t=this.redemptionMethod)||void 0===t?void 0:t.value,currency:null===(n=this.redemptionCurrency)||void 0===n?void 0:n.value,redemptionUnits:null===(i=this.redemptionUnits)||void 0===i?void 0:i.value,ifastStatus:"NA",paymentMethod:null===(c=this.redemptionType)||void 0===c?void 0:c.value};this.subHandlingService.once(this.transactionRestService.validateSellCart(this.refno,o).pipe(Object(y.a)(e=>{if(this.isValidating=!1,e.status===M.a.RESPONSE_FAILED)return this.errorMessage=e.errorMessage,void this.redemptionUnits.setErrors({invalidSell:this.errorMessage});this.form.enable(),this.isUpdate?this.transactionService.updateSellCartInfo(this.form,this.selectedFund,[this.availableRedemptionMethod]):this.transactionService.storeSellCart(this.form,this.selectedFund,[this.availableRedemptionMethod]),this.closed.emit()})))}onErrorModalClosed(){this.isVisible=!0,this.showErrorModal=!1}setRedemptionUnitNoDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.redemptionUnits.setValidators([Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}setRedemptionUnitWithDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.redemptionUnits.setValidators([oe.H.pattern(Rs),Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(s.i),h.lc(C.a),h.lc(T.a),h.lc(l.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-sell-epf-fund-fill-detail-form"]],inputs:{isVisible:"isVisible",selectedFund:"selectedFund",
5isUpdate:"isUpdate",isLoading:"isLoading",addedFund:"addedFund"},outputs:{closed:"closed"},features:[h.Tb([l.a])],decls:59,vars:50,consts:[[1,"py-3"],[3,"selectedFund"],[1,"font-weight-bold","mt-3","mb-2"],["nz-form","",3,"formGroup"],["nzType","flex","nzAlign","middle","nzGutter","16"],[3,"nzSpan"],[1,"mb-2"],["nzLabelPlaceholder","Redemption Type"],["ui-input","",3,"formControl"],["nzDisabled","","nzPlaceHolder","Redemption Currency",3,"formControl"],[3,"nzLabel","nzValue"],["nzType","flex","nzGutter","16"],["nzLabelPlaceholder","Units To Sell"],["ui-input","","type","number",3,"formControl"],[4,"ngIf"],[3,"nzSpan",4,"ngIf"],[1,"mb-2",3,"ngClass"],[1,"form-control-line-height-base"],["nz-checkbox","",3,"nzChecked","nzCheckedChange"],["nzType","flex","nzGutter","16",3,"ngClass"],["nzDisabled","","nzPlaceHolder","Redemption Method",3,"formControl"],[1,"text-right"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",1,"mx-2",3,"nzLoading","click"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzType","primary","nzBlock","",1,"my-1",3,"nzLoading","click"],[3,"showTerminateRspMsgModal","closeTerminateRspMsgModal"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],[4,"ngIf","ngIfElse"],["unitMinRedempError",""],["unitMinRetainError",""],[1,"m-0"],["nzLabelPlaceholder","Indicative Redemption Amt.",3,"nzPrefix"],[1,"text-danger"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.mc(1,"sell-fund-detail-info",1),h.qc(),h.rc(2,"p",2),h.qd(3,"Enter Redemption Details"),h.qc(),h.rc(4,"form",3),h.rc(5,"nz-row",4),h.rc(6,"nz-col",5),h.Ec(7,"async"),h.rc(8,"nz-form-item",6),h.rc(9,"nz-form-control"),h.rc(10,"ui-input-group",7),h.mc(11,"input",8),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(12,"nz-col",5),h.Ec(13,"async"),h.rc(14,"nz-form-item",6),h.rc(15,"nz-form-control"),h.rc(16,"ui-select",9),h.mc(17,"ui-option",10),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(18,"nz-row",11),h.rc(19,"nz-col",5),h.Ec(20,"async"),h.rc(21,"nz-form-item",6),h.rc(22,"nz-form-control"),h.rc(23,"ui-input-group",12),h.mc(24,"input",13),h.qc(),h.od(25,zs,3,0,"nz-form-explain",14),h.od(26,Is,6,2,"nz-form-explain",14),h.od(27,Es,6,2,"nz-form-explain",14),h.qc(),h.qc(),h.qc(),h.od(28,Fs,5,3,"nz-col",15),h.Ec(29,"async"),h.qc(),h.od(30,Os,6,3,"nz-row",14),h.Ec(31,"async"),h.od(32,Us,5,1,"nz-form-explain",14),h.rc(33,"nz-form-item",16),h.Ec(34,"async"),h.rc(35,"nz-form-control",17),h.rc(36,"label",18),h.zc("nzCheckedChange",(function(e){return t.onSellAllCheckChange(e)})),h.qd(37," Sell All "),h.qc(),h.qc(),h.qc(),h.rc(38,"nz-row",19),h.Ec(39,"async"),h.rc(40,"nz-col",5),h.Ec(41,"async"),h.rc(42,"nz-form-item"),h.rc(43,"nz-form-control"),h.rc(44,"ui-select",20),h.mc(45,"ui-option",10),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(46,"app-web-scaffold"),h.rc(47,"div",21),h.rc(48,"button",22),h.zc("click",(function(){return t.cancelOrRemoveFund(t.selectedFund)})),h.qd(49),h.qc(),h.rc(50,"button",23),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(51),h.qc(),h.qc(),h.qc(),h.rc(52,"app-mobile-scaffold"),h.rc(53,"b2c-floating-bar"),h.rc(54,"button",24),h.zc("click",(function(){return t.cancelOrRemoveFund(t.selectedFund)})),h.qd(55),h.qc(),h.rc(56,"button",25),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(57),h.qc(),h.qc(),h.qc(),h.rc(58,"terminate-rsp-msg-modal",26),h.zc("closeTerminateRspMsgModal",(function(){return t.closeTerminateRspMsgModal()})),h.qc()),2&e&&(h.Ub(1),h.Mc("selectedFund",t.selectedFund),h.Ub(3),h.Mc("formGroup",t.form),h.Ub(2),h.Mc("nzSpan",h.Fc(7,30,t.isMobile$)?24:8),h.Ub(5),h.Mc("formControl",t.redemptionType),h.Ub(1),h.Mc("nzSpan",h.Fc(13,32,t.isMobile$)?24:16),h.Ub(4),h.Mc("formControl",t.redemptionCurrency),h.Ub(1),h.Mc("nzLabel",t.currency)("nzValue",t.currency),h.Ub(2),h.Mc("nzSpan",h.Fc(20,34,t.isMobile$)?24:8),h.Ub(5),h.Mc("formControl",t.redemptionUnits),h.Ub(1),h.Mc("ngIf",t.redemptionUnits.dirty&&t.redemptionUnits.hasError("pattern")),h.Ub(1),h.Mc("ngIf",t.redemptionUnits.dirty&&t.redemptionUnits.hasError("invalidMinRedemption")),h.Ub(1),h.Mc("ngIf",t.redemptionUnits.dirty&&t.redemptionUnits.hasError("invalidMinHolding")),h.Ub(1),h.Mc("ngIf",!h.Fc(29,36,t.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(31,38,t.isMobile$)),h.Ub(2),h.Mc("ngIf",t.redemptionUnits.dirty&&t.redemptionUnits.hasError("invalidSell")),h.Ub(1),h.Mc("ngClass",h.Sc(46,xs,h.Fc(34,40,t.isMobile$))),h.Ub(3),h.Mc("nzChecked",t.isSellAll.value),h.Ub(2),h.Mc("ngClass",h.Sc(48,Ls,h.Fc(39,42,t.isMobile$))),h.Ub(2),h.Mc("nzSpan",(h.Fc(41,44,t.isMobile$),24)),h.Ub(4),h.Mc("formControl",t.redemptionMethod),h.Ub(1),h.Mc("nzLabel",t.availableRedemptionMethod.label)("nzValue",t.availableRedemptionMethod.value),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoading||t.isValidating),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoading||t.isValidating),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(1),h.Mc("showTerminateRspMsgModal",t.showTerminateRspMsgModal))},directives:[to,oe.J,oe.u,se.b,oe.l,P.c,P.a,se.e,se.a,ae.c,oe.c,ae.b,oe.t,oe.i,Lt.d,Lt.a,oe.z,p.t,p.q,lo.a,B.a,_.a,z.a,Se.a,oo,se.c,k.b],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Bs(e,t){if(1&e){const e=h.sc();h.rc(0,"app-sell-epf-fund-fill-detail-form",11),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("isUpdate",e.isUpdate)("addedFund",e.addedFund)("selectedFund",e.selectedFund)("isVisible",e.isVisible)}}function _s(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",3),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.rc(1,"div",4),h.rc(2,"nz-row",5),h.rc(3,"nz-col",6),h.rc(4,"h3",7),h.qd(5),h.qc(),h.qc(),h.rc(6,"nz-col",8),h.rc(7,"i",9),h.zc("click",(function(){return h.dd(e),h.Dc().onCancel()})),h.qc(),h.qc(),h.qc(),h.od(8,Bs,1,4,"app-sell-epf-fund-fill-detail-form",10),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzClosable",!1)("nzMaskClosable",!0)("nzFooter",null)("nzVisible",e.isVisible)("nzWidth",600)("nzWrapClassName","vertical-center-modal"),h.Ub(5),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," "),h.Ub(3),h.Mc("ngIf",e.isVisible)}}function Vs(e,t){if(1&e){const e=h.sc();h.rc(0,"app-sell-epf-fund-fill-detail-form",11),h.zc("closed",(function(){return h.dd(e),h.Dc(3).onCancel()})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("isUpdate",e.isUpdate)("addedFund",e.addedFund)("selectedFund",e.selectedFund)("isVisible",e.isVisible)}}function Hs(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"b2c-app-bar",13),h.zc("back",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.rc(2,"div",14),h.rc(3,"div",15),h.rc(4,"h3"),h.qd(5),h.qc(),h.od(6,Vs,1,4,"app-sell-epf-fund-fill-detail-form",10),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("title","Edit Order"),h.Ub(4),h.rd(null==e.selectedFund?null:e.selectedFund.productName),h.Ub(1),h.Mc("ngIf",e.isVisible)}}function $s(e,t){if(1&e&&(h.pc(0),h.od(1,Hs,7,3,"ng-container",12),h.Ec(2,"async"),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",h.Fc(2,1,e.isMobile$)&&e.isVisible&&e.selectedFund)}}function js(e,t){if(1&e&&h.mc(0,"nz-skeleton",16),2&e){const e=h.Dc();h.Mc("nzLoading",e.isLoading)("nzActive",!0)}}let Gs=(()=>{class e{constructor(e){this.store=e,this.addedFund=[],this.closed=new h.s,this.currency=U.a.PAYMENT_CURRENCY_MYR,this.showTerminateRspMsgModal=!1,this.refno=this.store.selectSnapshot(u.X.getSelectedRefno)}ngOnInit(){}
5onCancel(){this.closed.emit()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["sell-epf-fund-fill-detail"]],inputs:{isVisible:"isVisible",selectedFund:"selectedFund",isUpdate:"isUpdate",isLoading:"isLoading",addedFund:"addedFund"},outputs:{closed:"closed"},features:[h.Tb([l.a])],decls:6,vars:5,consts:[[3,"nzClosable","nzMaskClosable","nzFooter","nzVisible","nzWidth","nzWrapClassName","nzOnCancel",4,"ngIf"],[4,"ngIf","ngIfElse"],["loadingTemplate",""],[3,"nzClosable","nzMaskClosable","nzFooter","nzVisible","nzWidth","nzWrapClassName","nzOnCancel"],[1,"p-2"],["nzType","flex","nzAlign","middle"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[3,"isUpdate","addedFund","selectedFund","isVisible","closed",4,"ngIf"],[3,"isUpdate","addedFund","selectedFund","isVisible","closed"],[4,"ngIf"],[3,"title","back"],[1,"bg-white"],[1,"p-3"],[3,"nzLoading","nzActive"]],template:function(e,t){if(1&e&&(h.od(0,_s,9,8,"nz-modal",0),h.Ec(1,"async"),h.rc(2,"app-mobile-scaffold"),h.od(3,$s,3,3,"ng-container",1),h.qc(),h.od(4,js,1,2,"ng-template",null,2,h.pd)),2&e){const e=h.ad(5);h.Mc("ngIf",!h.Fc(1,3,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!t.isLoading)("ngIfElse",e)}},directives:[p.t,z.a,j.a,P.c,P.a,k.b,Ns,Bt.a,W.a],pipes:[p.b],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Ws(e,t){if(1&e){const e=h.sc();h.rc(0,"app-trade-product-info",17),h.zc("selectedSedolnumberEdit",(function(t){return h.dd(e),h.Dc().onClickEdit(t.sedolnumber,t.paymentMethod)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("fromSellCheckOut",!0)("header1","Redemption Units")("header2","Indicative Amt.*")("header3","Redemption Fee")("showEditBtn",!0)("showHeader3",!0)("showProfitLoss",!1)("isLoading",e.isLoading)("tradeProductInfoList",e.tradeProductInfoList)}}function Ys(e,t){if(1&e&&h.mc(0,"nz-skeleton",18),2&e){const e=h.Dc();h.Mc("nzActive",!0)("nzLoading",e.isLoading)}}const Ks=function(e,t){return{"container mt-5":e,"w-100":t}};let Xs=(()=>{class e{constructor(e,t,n,i,c,o){this.store=e,this.route=t,this.subHandlingService=n,this.transactionService=i,this.fundRestService=c,this.transactionRestService=o,this.tradeProductInfoList=[],this.showSellFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.showEpfFundFillDetail=!1,this.promoApplied=!1,this.isLoading=!1}filterData(e){return{fundInfoName:e.fundName,paymentMethod:e.cartRedemptionMethod.indexOf(U.a.CASH_MANAGEMENT_FUND)>1?U.a.CASH_MANAGEMENT_FUND+" - "+e.cartRedemptionMethod.split(U.a.CASH_MANAGEMENT_FUND)[0]:e.cartRedemptionMethod,sedolnumber:e.sedolNumber,redemptionFee:e.redemptionFee,redemptionUnit:e.redemptionUnits,isRedeemByAmount:e.sellInfoModel.isRedeemByAmount,redemptionAmount:e.redemptionAmount,redemptionCurrency:e.currencyCode,cashFund:e.cashFund,paymentMethodForCheck:e.sellInfoModel.paymentMethod}}ngOnInit(){this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)}),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartLength$=this.store.select(u.I.getUserCartLength).pipe(Object(S.a)(e=>
5e(this.refno))),this.checkCartLength(),this.getSelectedAccTypeDisplay(),this.getSelectedInvestmentAcctTradeData(),this.getHoldingList()}onClickEdit(e,t){var n,i,c;if(this.fundList){for(let n of this.fundList)e===n.productCode&&t===n.paymentMethod&&(this.selectedFund=n);(null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod)===U.a.CHEQUE.toLowerCase()&&((null===(i=this.selectedFund)||void 0===i?void 0:i.cashFund)?this.showCmfFundFillDetail=!0:this.showSellFundFillDetail=!0),(null===(c=this.selectedFund)||void 0===c?void 0:c.paymentMethod)===U.a.EPF_FUNDS.toUpperCase()&&(this.showEpfFundFillDetail=!0)}}onBackPress(){this.route.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.FUNDS,M.o.SELL)])}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>this.filterData(e))})))}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e})))}getSelectedAccTypeDisplay(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno)}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.I.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getTradeProductInfoData(),this.getCartData()}onFundFillDetailClosed(){this.selectedFund=null,this.showSellFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.showEpfFundFillDetail=!1}checkCartLength(){this.subHandlingService.subscribe(this.cartLength$.pipe(Object(y.a)(e=>{0===e&&this.route.navigate([M.o.APP,M.o.TRADE,M.o.FUNDS])})))}
5getHoldingList(){this.isLoading=!0,this.subHandlingService.once(this.transactionRestService.getSellHoldingList(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fundList=e.data.sort((e,t)=>e.productName>t.productName?1:t.productName>e.productName?-1:0))},e=>console.log(e))))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(C.a),h.lc(q.a),h.lc(T.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-fund-sell-check-out"]],features:[h.Tb([l.a])],decls:35,vars:43,consts:[[1,"bg-lighter","mb-6"],[1,"border-bottom"],[3,"title","back"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],["nz-icon","","nzTheme","outline","nzType","arrow-left",1,"pointer","pr-2",3,"click"],[1,"text-md","font-weight-normal"],[1,"infinite-container","mt-2"],[3,"fromSellCheckOut","header1","header2","header3","showEditBtn","showHeader3","showProfitLoss","isLoading","tradeProductInfoList","selectedSedolnumberEdit",4,"ngIf","ngIfElse"],[1,"text-xs","text-black-6"],[3,"refno"],[3,"addedFund","isUpdate","isLoading","selectedFund","show","closed"],[3,"isUpdate","isLoading","selectedFund","show","addedFund","closed"],[3,"selectedFund","isVisible","addedFund","isUpdate","isLoading","closed"],["loadingTemplate",""],[3,"fromSellCheckOut","header1","header2","header3","showEditBtn","showHeader3","showProfitLoss","isLoading","tradeProductInfoList","selectedSedolnumberEdit"],[3,"nzActive","nzLoading"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.rc(1,"app-mobile-scaffold"),h.rc(2,"div",1),h.rc(3,"b2c-app-bar-2",2),h.zc("back",(function(){return t.onBackPress()})),h.qc(),h.qc(),h.qc(),h.rc(4,"div",3),h.Ec(5,"async"),h.Ec(6,"async"),h.rc(7,"nz-row",4),h.Ec(8,"async"),h.rc(9,"div",5),h.Ec(10,"async"),h.rc(11,"nz-card",6),h.rc(12,"p"),h.qd(13,"Home / Trade"),h.qc(),h.rc(14,"h3"),h.rc(15,"i",7),h.zc("click",(function(){return t.onBackPress()})),h.qc(),h.qd(16," Check Out "),h.qc(),h.rc(17,"p",8),h.qd(18),h.qc(),h.rc(19,"div",9),h.od(20,Ws,1,9,"app-trade-product-info",10),h.qc(),h.rc(21,"p",11),h.qd(22,"*Amount calculated by the latest available NAV price."),h.qc(),h.qc(),h.qc(),h.rc(23,"div",5),h.Ec(24,"async"),h.mc(25,"app-sell-checkout-cart-sider",12),h.qc(),h.qc(),h.qc(),h.rc(26,"app-web-scaffold"),h.rc(27,"app-sell-fund-fill-detail",13),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(28,"async"),h.qc(),h.rc(29,"sell-cmf-fund-fill-detail",14),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(30,"async"),h.qc(),h.rc(31,"sell-epf-fund-fill-detail",15),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(32,"async"),h.qc(),h.qc(),h.qc(),h.od(33,Ys,1,2,"ng-template",null,16,h.pd)),2&e){const e=h.ad(34);h.Ub(3),h.Mc("title","Check Out"),h.Ub(1),h.Mc("ngClass",h.Tc(40,Ks,!h.Fc(5,24,t.isMobile$),h.Fc(6,26,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(8,28,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(10,30,t.isMobile$)?0:18),h.Ub(9),h.sd(" ",null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay,""),h.Ub(2),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(3),h.Mc("nzSpan",h.Fc(24,32,t.isMobile$)?24:6),h.Ub(2),h.Mc("refno",t.refno),h.Ub(2),h.Mc("addedFund",h.Fc(28,34,t.cartList$))("isUpdate",!0)("isLoading",t.isLoading)("selectedFund",t.selectedFund)("show",t.showSellFundFillDetail),h.Ub(2),h.Mc("isUpdate",!0)("isLoading",t.isLoading)("selectedFund",t.selectedFund)("show",t.showCmfFundFillDetail)("addedFund",h.Fc(30,36,t.cartList$)),h.Ub(2),h.Mc("selectedFund",t.selectedFund)("isVisible",t.showEpfFundFillDetail)("addedFund",h.Fc(32,38,t.cartList$))("isUpdate",!0)("isLoading",t.isLoading)}},directives:[z.a,D.a,p.q,P.c,P.a,I.a,k.b,p.t,Fc,B.a,Vo,ws,Gs,A.a,W.a],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Qs(e,t){if(1&e){const e=h.sc();h.rc(0,"app-campaign-code-input-box",11),h.zc("promoCodeApplied",(function(t){return h.dd(e),h.Dc().promoApplied(t)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("refno",e.refno)}}function Zs(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.value,e.currencyCode)," ")}}function Js(e,t){if(1&e&&(h.rc(0,"div",12),h.rc(1,"b2c-order-cart",13),h.rc(2,"nz-row"),h.mc(3,"b2b-statistic",14),h.od(4,Zs,2,4,"ng-template",null,15,h.pd),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.ad(5),i=h.Dc();h.Ub(1),h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",i.orderCartConstant.PENDING)("paymentTitle",e.title),h.Ub(2),h.Mc("value",n)}}function ea(e,t){1&e&&(h.rc(0,"p"),h.qd(1," I am aware that foreign conversion is required for the above transaction(s) and will agree to the foreign exchange rates contracted by FSMOne and/or his custodian. "),h.qc())}function ta(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",16),h.zc("click",(function(){return h.dd(e),h.Dc().onConfirm()})),h.qd(2,"I Agree & Check Out "),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("nzLoading",e.isLoading||e.approving)}}function na(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"shared-approve-action",17),h.zc("emitCancel",(function(){return h.dd(e),h.Dc().onHandleCancel()}))("onApprove",(function(t){return h.dd(e),h.Dc().onClickApprove(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("refno",e.refno)("requestKey",e.APPROVE_TRADE_REQUEST_KEY)("actionKey",e.UT_SWITCH_ACTION_KEY)("width",600)}}const ia=function(e){return{"py-3 bg-white shadow":e}},ca=function(e){return{"py-3 bg-white":e}}
5,oa=function(e){return{"px-2":e}};let sa=(()=>{class e{constructor(e,t,n,i,c,o){this.store=e,this.subHandlingService=t,this.transactionRestService=n,this.router=i,this.twoFaService=c,this.transactionService=o,this.promoCodeApplied=new h.s,this.fundSwitchModel=[],this.orderCartConstant=O.a,this.cartDisplayListModel=[],this.showErrorMessageModal=!1,this.showSwitchTnc=!1,this.isLoading=!1,this.fundVoidTransactionModels=[],this.switchCartModel=[],this.orderNo=[],this.approving=!1,this.APPROVE_TRADE_REQUEST_KEY=R.a.APPROVE_TRADE,this.UT_SWITCH_ACTION_KEY=L.a.UT_SWITCH}ngOnInit(){this.store.dispatch(new N.b)}ngOnChanges(e){this.getSelectedInvestmentAcctTradeData()}getCheckOutCartData(){this.cartDisplayListModel=[],this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.checkOutCartData=this.groupByPaymentMethod(e,"productCategory"),this.cartDisplayListModel=Object.keys(this.checkOutCartData).map(e=>({title:e,value:parseFloat(this.checkOutCartData[e].value),currencyCode:this.checkOutCartData[e].currencyCode}))})))}groupByPaymentMethod(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.currencyCode},n.push(e[i[t]])),e[i[t]].value+=i.indicativeAmount,e),{})}onHandleCancel(){this.approving=!1}fireTncModal(){this.showSwitchTnc=!0}onCloseSwitchTncModal(){this.showSwitchTnc=!1}onCloseErrorMessage(){this.showErrorMessageModal=!1}getSwitchInfoModel(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.includeInterOrder=!1,this.fundSwitchModel=[];for(const t of e)!0===t.fundSwitchTransactionModel.interOrder&&(this.includeInterOrder=!0),this.fundSwitchModel.push(t.fundSwitchTransactionModel);this.withForeignCurrency=e.filter(e=>e.currencyCode!==U.a.PAYMENT_CURRENCY_MYR).length>0})))}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.cartLength$=this.store.select(u.W.getUserCartLength).pipe(Object(S.a)(e=>
5e(this.refno))),this.getCheckOutCartData(),this.getSwitchInfoModel(),this.getTerminateRspSwitchCartModel()}updateSwitchCartBuySellContractNo(e,t){if(e)for(const n of e)n.buyBean&&n.sellBean?this.transactionService.updateSwitchBuySellContractNo(this.refno,n.buyBean.contractNo,n.sellBean.contractNo,n.buyBean.fundName,n.sellBean.fundName):this.transactionService.updateSwitchBuySellContractNo(this.refno,n.orderNo,n.sellOrderNo,n.switchBuyFundName,n.switchSellFundName);if(t)for(const n of t)n.buyBean&&n.sellBean&&this.transactionService.updateSwitchBuySellContractNo(this.refno,n.buyBean.contractNo,n.sellBean.contractNo,n.buyBean.fundName,n.sellBean.fundName)}getRspInfoAndTerminate(){this.subHandlingService.subscribe(this.transactionRestService.findRspTransaction(this.refno,U.a.ACTIVE).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&this.filterTerminateRspInfo(e.data.result.activersp)}),Object(y.a)(()=>{this.terminateRsp()})))}terminateRsp(){this.subHandlingService.subscribe(this.transactionRestService.terminateRspTransaction(this.fundVoidTransactionModels,this.refno).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.ORDER_PLACED)],{queryParams:{poNumber:this.orderNo,refno:this.refno}})})))}getTerminateRspSwitchCartModel(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.switchCartModel=[];for(const t of e)t.isNormalRsp&&!t.continueRsp&&this.switchCartModel.push(t)})))}filterTerminateRspInfo(e){this.fundVoidTransactionModels=[];for(const t of this.switchCartModel)for(const n of e)n.sedolnumber===t.sedolNumber&&this.fundVoidTransactionModels.push(this.mapFundVoidTransactionModelData(n))}mapFundVoidTransactionModelData(e){return{amount:null==e?void 0:e.amount,contractNo:null==e?void 0:e.contractNo,fundName:null==e?void 0:e.fundName,paymentMethod:null==e?void 0:e.paymentMethod}}onClickApprove(e){const t=[],n=[],i=[];this.subHandlingService.once(e.pipe(Object(E.a)(e=>this.transactionRestService.confirmOrderSwitch(this.refno,this.fundSwitchModel,e).pipe(this.twoFaService.intercept())),Object(y.a)(e=>{var c,o,s,a,l,r,d,u;if(e.status===M.a.RESPONSE_FAILED)return this.errorMessage=e.errorMessage,this.showErrorMessageModal=!0,void this.onHandleCancel();this.intersellOrderNo=null===(o=null===(c=e.data.summary)||void 0===c?void 0:c.interResult)||void 0===o?void 0:o.sellOrderNo,this.intrasellOrderNo=null===(a=null===(s=e.data.summary)||void 0===s?void 0:s.intraResult)||void 0===a?void 0:a.sellOrderNo;const h=null===(r=null===(l=e.data.summary)||void 0===l?void 0:l.intraResult)||void 0===r?void 0:r.intraSwitchResultList,p=null===(u=null===(d=e.data.summary)||void 0===d?void 0:d.interResult)||void 0===u?void 0:u.interSwitchList;null==h||h.forEach(e=>{var c,o,s;(null==e?void 0:e.switchSellRedemptionMethod)===U.a.EPF_FUNDS.toUpperCase()?((null==e?void 0:e.switchSellStatus)===O.a.PENDING&&(t.push(null==e?void 0:e.switchSellSedol),this.transactionService.updateSwitchUtOrderCartType(this.refno,t,null===(c=null==e?void 0:e.switchSellRedemptionMethod)||void 0===c?void 0:c.toUpperCase(),O.a.REQUEST_EPF_FORM),this.transactionService.updateSwitchCartProductCategory(this.refno,null==e?void 0:e.sedolnumber,"
5EPF Account 1 - Form")),(null==e?void 0:e.switchSellStatus)===U.a.RECEIVED&&(i.push(null==e?void 0:e.switchSellSedol),this.transactionService.updateSwitchUtOrderCartType(this.refno,i,null===(o=null==e?void 0:e.switchSellRedemptionMethod)||void 0===o?void 0:o.toUpperCase(),O.a.ORDER_RECEIVED))):(n.push(null==e?void 0:e.switchSellSedol),this.transactionService.updateSwitchUtOrderCartType(this.refno,n,null===(s=null==e?void 0:e.switchSellRedemptionMethod)||void 0===s?void 0:s.toUpperCase(),O.a.ORDER_RECEIVED))}),this.intersellOrderNo&&this.orderNo.push(this.intersellOrderNo),this.intrasellOrderNo&&this.orderNo.push(this.intrasellOrderNo),this.transactionService.updateSwitchOrderStatusToOrderPlaced(this.refno),this.updateSwitchCartBuySellContractNo(h,p)}),Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.onHandleCancel(),0!==this.switchCartModel.length?this.getRspInfoAndTerminate():this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.ORDER_PLACED)],{queryParams:{orderNum:this.orderNo,refno:this.refno}}))}),Object(F.a)(()=>this.store.dispatch(new N.e(!1,!0)))))}onConfirm(){this.approving=!0}promoApplied(e){this.promoCodeApplied.emit(e)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(T.a),h.lc(c.e),h.lc(x.a),h.lc(C.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-switch-checkout-cart-sider"]],inputs:{refno:"refno"},outputs:{promoCodeApplied:"promoCodeApplied"},features:[h.Tb([l.a,x.a]),h.Sb],decls:34,vars:29,consts:[[3,"ngClass"],[3,"refno","promoCodeApplied",4,"ngIf"],[1,"font-weight-bold"],["class","mb-3",4,"ngFor","ngForOf"],[1,"h5"],[3,"click"],[4,"ngIf"],[1,"mb-2","mt-3"],["nz-button","","nzType","primary",1,"font-weight-bold","w-100",3,"disabled","nzLoading","click"],[3,"isModalVisible","onCloseModal"],[3,"errorMessage","showErrorMessageModal","closeErrorMessageModal"],[3,"refno","promoCodeApplied"],[1,"mb-3"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle"],["horizontal","true","title","Total Indicative Amt.",3,"value"],["valueTemplate",""],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"nzLoading","click"],[3,"refno","requestKey","actionKey","width","emitCancel","onApprove"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.rc(1,"div",0),h.Ec(2,"async"),h.od(3,Qs,1,1,"app-campaign-code-input-box",1),h.Ec(4,"async"),h.qc(),h.qc(),h.rc(5,"div",0),h.Ec(6,"async"),h.rc(7,"div",0),h.Ec(8,"async"),h.rc(9,"p",2),h.qd(10,"Total Indicative Switching Amt."),h.qc(),h.od(11,Js,6,5,"div",3),h.rc(12,"p",4),h.qd(13," All orders received are irrevocable. By clicking "),h.rc(14,"strong"),h.qd(15,"\u201cI Agree & Check Out\u201d"),h.qc(),h.qd(16," button, you confirm your trades and agreed to the "),h.rc(17,"a",5),h.zc("click",(function(){return t.fireTncModal()})),h.qd(18,"terms and conditions"),h.qc(),h.qd(19," on FSMOne. "),h.qc(),h.od(20,ea,2,0,"p",6),h.mc(21,"br"),h.rc(22,"p",4),h.qd(23," And accepted the terms and conditions in the Cash Management Fund Prospectus. "),h.qc(),h.qc(),h.rc(24,"app-web-scaffold"),h.rc(25,"div",7),h.rc(26,"button",8),h.zc("click",(function(){return t.onConfirm()})),h.Ec(27,"async"),h.qd(28," I Agree & Check Out "),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(29,"app-mobile-scaffold"),h.od(30,ta,3,1,"b2c-floating-bar",6),h.qc(),h.rc(31,"app-sell-switch-tnc-modal",9),h.zc("onCloseModal",(function(){return t.onCloseSwitchTncModal()})),h.qc(),h.rc(32,"checkout-error-message-modal",10),h.zc("closeErrorMessageModal",(function(){return t.onCloseErrorMessage()})),h.qc(),h.od(33,na,2,4,"ng-container",6)),2&e&&(h.Ub(1),h.Mc("ngClass",h.Sc(23,ia,h.Fc(2,13,t.isMobile$))),h.Ub(2),h.Mc("ngIf",!h.Fc(4,15,t.isMobile$)&&t.includeInterOrder),h.Ub(2),h.Mc("ngClass",h.Sc(25,ca,h.Fc(6,17,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(27,oa,h.Fc(8,19,t.isMobile$))),h.Ub(4),h.Mc("ngForOf",t.cartDisplayListModel),h.Ub(9),h.Mc("ngIf",t.withForeignCurrency),h.Ub(6),h.Mc("disabled",0===h.Fc(27,21,t.cartLength$))("nzLoading",t.isLoading||t.approving),h.Ub(4),h.Mc("ngIf",!t.showSwitchTnc&&!t.showErrorMessageModal),h.Ub(1),h.Mc("isModalVisible",t.showSwitchTnc),h.Ub(1),h.Mc("errorMessage",t.errorMessage)("showErrorMessageModal",t.showErrorMessageModal),h.Ub(1),h.Mc("ngIf",t.approv
5ing))},directives:[B.a,p.q,p.t,p.s,_.a,z.a,Tc,ne,fe,ge.a,P.c,be.c,Se.a,ye.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var aa=n("pLZG");function la(e,t){1&e&&h.nc(0)}function ra(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-mobile-drawer",3),h.zc("showChange",(function(t){return h.dd(e),h.Dc().showInsufficientCreditModal=t}))("showChange",(function(){return h.dd(e),h.Dc().onInsufficientCreditModalClosed()})),h.od(1,la,1,0,"ng-container",4),h.rc(2,"div",5),h.rc(3,"button",6),h.zc("click",(function(){return h.dd(e),h.Dc().onInsufficientCreditModalClosed()})),h.qd(4,"Confirm"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(5);h.Mc("show",e.showInsufficientCreditModal)("hideButtons",!0),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function da(e,t){1&e&&h.nc(0)}function ua(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",7),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onInsufficientCreditModalClosed()})),h.rc(1,"div",8),h.od(2,da,1,0,"ng-container",4),h.qc(),h.rc(3,"div",9),h.rc(4,"button",10),h.zc("click",(function(){return h.dd(e),h.Dc().onInsufficientCreditModalClosed()})),h.qd(5,"Confirm"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(5);h.Mc("nzFooter",null)("nzTitle",null)("nzVisible",e.showInsufficientCreditModal),h.Ub(2),h.Mc("ngTemplateOutlet",t)}}function ha(e,t){1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",11),h.mc(2,"em",12),h.qc(),h.rc(3,"nz-col",13),h.rc(4,"span",14),h.qd(5,"Important Notice"),h.qc(),h.qc(),h.qc(),h.rc(6,"nz-row",15),h.rc(7,"nz-col",16),h.qd(8," There is insufficient credit point to waive the tier charge, the prevailing sales charge will be applicable. "),h.qc(),h.qc())}let pa=(()=>{class e{constructor(){this.closeInsufficientCreditModal=new h.s}ngOnInit(){}onInsufficientCreditModalClosed(){this.closeInsufficientCreditModal.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-insufficient-credit-modal"]],inputs:{showInsufficientCreditModal:"showInsufficientCreditModal"},outputs:{closeInsufficientCreditModal:"closeInsufficientCreditModal"},decls:6,vars:6,consts:[[3,"show","hideButtons","showChange",4,"ngIf"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel",4,"ngIf"],["insufficientCreditModal",""],[3,"show","hideButtons","showChange"],[4,"ngTemplateOutlet"],[1,"fixed-bottom","bg-white","shadow","p-2","mt-3"],["nz-button","","nzType","primary",1,"w-100","my-1",3,"click"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel"],[1,"p-2"],[1,"d-flex","justify-content-end","align-items-center","p-2","mt-3"],["nz-button","","nzType","primary",3,"click"],["nzSpan","2"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-warning","mr-2","text-xl"],["nzSpan","22"],[1,"font-weight-bold","text-lg"],[1,"pt-3"],["nzOffset","2","nzSpan","22"]],template:function(e,t){1&e&&(h.od(0,ra,5,3,"b2c-mobile-drawer",0),h.Ec(1,"async"),h.od(2,ua,6,4,"nz-modal",1),h.Ec(3,"async"),h.od(4,ha,9,0,"ng-template",null,2,h.pd)),2&e&&(h.Mc("ngIf",h.Fc(1,2,t.isMobile$)),h.Ub(2),h.Mc("ngIf",!h.Fc(3,4,t.isMobile$)))},directives:[p.t,G.a,p.A,_.a,j.a,P.c,P.a,k.b],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var ma=n("bKUB");function fa(e,t){1&e&&h.nc(0)}const ga=function(e){return{"border-bottom":e}};function ba(e,t){if(1&e&&(h.rc(0,"nz-col",2),h.Ec(1,"async"),h.Ec(2,"async"),h.mc(3,"b2b-statistic",3),h.Ec(4,"async"),h.qc()),2&e){const e=h.Dc(),t=h.ad(69);h.Mc("nzSpan",h.Fc(1,5,e.isMobile$)?24:8)("ngClass",h.Sc(11,ga,h.Fc(2,7,e.isMobile$))),h.Ub(3),h.Mc("title","Platform Fee")("horizontal",h.Fc(4,9,e.isMobile$))("value",t)}}function Sa(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",24),h.mc(2,"b2b-statistic",3),h.qc(),h.qc()),2&e){h.Dc();const e=h.ad(83);h.Ub(1),h.Mc("nzSpan",24),h.Ub(1),h.Mc("title","Prospectus Document")("horizontal",!0)("value",e)}}function ya(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",24),h.mc(2,"b2b-statistic",3),h.qc(),h.qc()),2&e){h.Dc();const e=h.ad(85);h.Ub(1),h.Mc("nzSpan",24),h.Ub(1),h.Mc("title","Product Highlightsheet Document")("horizontal",!0)("value",e)}}function va(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",24),h.mc(2,"b2b-statistic",3),h.qc(),h.qc()),2&e){h.Dc();const e=h.ad(87);h.Ub(1),h.Mc("nzSpan",24),h.Ub(1),h.Mc("title","Factsheet")("horizontal",!0)("value",e)}}function Ma(e,t){if(1&e&&(h.rc(0,"nz-col",2),h.Ec(1,"async"),h.Ec(2,"async"),h.mc(3,"b2b-statistic",3),h.Ec(4,"async"),h.qc()),2&e){const e=h.Dc(),t=h.ad(69);h.Mc("nzSpan",h.Fc(1,5,e.isMobile$)?24:8)("ngClass",h.Sc(11,ga,h.Fc(2,7,e.isMobile$))),h.Ub(3),h.Mc("title","Platform Fee")("horizontal",h.Fc(4,9,e.isMobile$))("value",t)}}function Ca(e,t){1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2,"8% SST, applicable to the Switch Buy Sales Charge"),h.qc(),h.oc())}function qa(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1,"Either FSMOne Rewards Program or promotional sales charge (whichever is lower, where applicable) will be reflected here."),h.qc(),h.mc(2,"br"),h.mc(3,"br"),h.od(4,Ca,3,0,"ng-container",10)),2&e){const e=h.Dc(2);h.Ub(4),h.Mc("ngIf",e.systemSstRate>0)}}function Ta(e,t){if(1&e&&(h.qd(0),h.mc(1,"i",25),h.od(2,qa,5,1,"ng-template",null,26,h.pd)),2&e){const e=h.ad(3),t=h.Dc();h.sd(" ",null==t.switchingCalculatorModel?null:t.switchingCalculatorModel.salesChargeStr," "),h.Ub(1),h.Mc("nzTooltipTitle",e)}}function wa(e,t){1&e&&h.qd(0," -\n")}function za(e,t){if(1&e&&h.qd(0),2&e){const e=h.Dc();h.sd(" ",(null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.platformFeeRate)/4,"\xa0% per quarter\n")}}function Da(e,t){if(1&e&&h.qd(0),2&e){const e=h.Dc();h.sd(" ",null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.userAvailableCredits,"\n")}}function Pa(e,t){1&e&&h.qd(0," -\n")}function Ia(e,t){1&e&&h.qd(0," -\n")}function ka(e,t){if(1&e&&h.qd(0),2&e){const e=h.Dc();h.sd(" ",e.switchingCalculatorModel.intraSwitchBuyLag,"\n")}}function Aa(e,t){if(1&e&&h.qd(0),2&e){const e=h.Dc();h.sd(" ",null==e.switchingCalculatorModel?null:e.switchingCalculatorModel.interSwitchSellLag,"\n")}}function Ea(e,t){1&e&&h.nc(0)}const Fa=function(e){return{name:"Prospectus",svg:"prospectus",link:e}};function Oa(e,t){if(1&e&&(h.pc(0),h.od(1,Ea,1,0,"ng-container",27),h.oc()),2&e){const e=h.Dc(2),t=h.ad(89);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Fa,null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.prospectusPath))}}function Ua(e,t){1&e&&h.nc(0)}const xa=function(e){return{name:"Product Highlights Sheet",svg:"phs",link:e}};function La(e,t){if(1&e&&(h.pc(0),h.od(1,Ua,1,0,"ng-container",27),h.oc()),2&e){const e=h.Dc(2),t=h.ad(89);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,xa,null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.performancePath))}}function Ra(e,t){1&e&&h.nc(0)}const Na=function(e){return{name:"Factsheet",svg:"factsheet",link:e}};function Ba(e,t){if(1&e&&(h.pc(0),h.od(1,Ra,1,0,"ng-container",27),h.oc()),2&e){const e=h.Dc(2),t=h.ad(89);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Na,null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.factsheetPath))}}function _a(e,t){if(1&e&&(h.od(0,Oa,2,4,"ng-container",10),h.od(1,La,2,4,"ng-container",10),h.od(2,Ba,2,4,"ng-container",10)),2&e){const e=h.Dc();h.Mc("ngIf",null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.prospectusPath),h.Ub(1),h.Mc("ngIf",null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.performancePath),h.Ub(1),h.Mc("ngIf",null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.factsheetPath)}}function Va(e,t){1&e&&h.nc(0)}function Ha(e,t){if(1&e&&h.od(0,Va,1,0,"ng-container",27),2&e){const e=h.Dc(),t=h.ad(89);h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Fa,null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.prospectusPath))}}function $a(e,t){1&e&&h.nc(0)}function ja(e,t){if(1&e&&h.od(0,$a,1,0,"ng-container",27),2&e){const e=h.Dc(),t=h.ad(89);h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,xa,null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.performancePath))}}function Ga(e,t){1&e&&h.nc(0)}function Wa(e,t){if(1&e&&h.od(0,Ga,1,0,"ng-container",27),2&e){const e=h.Dc(),t=h.ad(89);h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(2,Na,null==e.selectedSwitchBuyFund?null:e.selectedSwitchBuyFund.factsheetPath))}}const Ya=function(e){return{"mb-3":e}},Ka=function(e){return{"mr-2":e}};function Xa(e,t){if(1&e&&(h.pc(0),h.rc(1,"a",28),h.Ec(2,"async"),h.mc(3,"img",29),h.Ec(4,"async"),h.qc(),h.oc()),2&e){const e=t.link,n=t.name,i=t.svg,c=h.Dc();h.Ub(1),h.Mc("nzTooltipTitle",n)("href",c.docPath+"/"+e,h.gd)("ngClass",h.Sc(10,Ya,!h.Fc(2,6,c.isMobile$))),h.Ub(2),h.Oc("src","assets/images/factsheet/",i,".svg",h.gd),h.Mc("alt",n+" for documents")("ngClass",h.Sc(12,Ka,!h.Fc(4,8,c.isMobile$)))}}const Qa=function(e){return{"py-2":e}};let Za=(()=>{class e{constructor(e,t){this.store=e,this.utilityRestService=t,this.transactionConstant=U.a,this.docPath=M.a.LIVE_URL,this.systemSstRate=0}
5ngOnInit(){this.getSystemSstRate(),this.getCartSalesCharge()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}ngOnChanges(e){this.switchingCalculatorModel.salesChargeStr&&this.switchingCalculatorModel.salesChargeStr.substring(2).length<3&&(this.switchingCalculatorModel.salesChargeStr=this.switchingCalculatorModel.salesChargeStr.replace("%","0%"))}getCartSalesCharge(){this.cartList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.selectedSwitchBuyFund.refno))),this.cartList$.pipe(Object(y.a)(e=>{for(let t=0;t<e.length;t++)e[t].sedolNumber==this.selectedSwitchBuyFund.sedolnumber&&e[t].refno==this.selectedSwitchBuyFund.refno&&(this.switchingCalculatorModel.salesChargeStr="-"==e[t].switchSalesCharge?e[t].switchSalesCharge:e[t].switchSalesCharge+"%")})).subscribe()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["switch-fund-detail-info"]],inputs:{selectedSwitchBuyFund:"selectedSwitchBuyFund",switchingCalculatorModel:"switchingCalculatorModel",isInterSwitch:"isInterSwitch"},features:[h.Sb],decls:90,vars:134,consts:[[1,"bg-black-2","pb-2","px-2","mb-2"],["nzType","flex","nzAlign","middle"],[3,"nzSpan","ngClass"],[3,"title","horizontal","value"],[1,"pl-2",3,"nzSpan","ngClass"],[1,"mt-3"],[1,"d-inline-flex","text-right"],[4,"ngTemplateOutlet"],[3,"nzSpan","ngClass",4,"ngIf"],["nzType","flex","nzAlign","middle",3,"ngClass"],[4,"ngIf"],["salesChargeValueTemplate",""],["salesChargeDefaultValueTemplate",""],["platformFeeValueTemplate",""],["availableCreditValueTemplate",""],["availableCreditDefaultValueTemplate",""],["interSwitchValueTemplate",""],["intraSwitchValueTemplate",""],["interSwitchSellValueTemplate",""],["documents",""],["prospectusDocument",""],["highlightSheetDocument",""],["fundFactSheetDocument",""],["portfolioDocumentTemplate",""],[1,"border-bottom",3,"nzSpan"],["nz-icon","","nz-tooltip","","nzType","info-circle","nzTheme","outline",1,"text-info",3,"nzTooltipTitle"],["switchingFeeTooltipTpl",""],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nz-tooltip","","rel","noopener noreferrer","target","_blank",1,"pointer","d-block",3,"nzTooltipTitle","href","ngClass"],[3,"alt","ngClass","src"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.rc(1,"app-web-scaffold"),h.rc(2,"nz-row",1),h.rc(3,"nz-col",2),h.Ec(4,"async"),h.Ec(5,"async"),h.mc(6,"b2b-statistic",3),h.Ec(7,"async"),h.qc(),h.rc(8,"nz-col",2),h.Ec(9,"async"),h.Ec(10,"async"),h.mc(11,"b2b-statistic",3),h.Ec(12,"async"),h.qc(),h.rc(13,"nz-col",4),h.Ec(14,"async"),h.rc(15,"h5",5),h.qd(16,"Documents"),h.qc(),h.rc(17,"div",6),h.od(18,fa,1,0,"ng-container",7),h.qc(),h.qc(),h.rc(19,"nz-col",2),h.Ec(20,"async"),h.Ec(21,"async"),h.mc(22,"b2b-statistic",3),h.Ec(23,"async"),h.qc(),h.rc(24,"nz-col",2),h.Ec(25,"async"),h.Ec(26,"async"),h.mc(27,"b2b-statistic",3),h.Ec(28,"async"),h.qc(),h.od(29,ba,5,13,"nz-col",8),h.qc(),h.qc(),h.rc(30,"app-mobile-scaffold"),h.rc(31,"nz-row",9),h.Ec(32,"async"),h.rc(33,"nz-col",2),h.Ec(34,"async"),h.Ec(35,"async"),h.mc(36,"b2b-statistic",3),h.Ec(37,"async"),h.qc(),h.rc(38,"nz-col",2),h.Ec(39,"async"),h.Ec(40,"async"),h.mc(41,"b2b-statistic",3),h.Ec(42,"async"),h.qc(),h.qc(),h.od(43,Sa,3,4,"nz-row",10),h.od(44,ya,3,4,"nz-row",10),h.od(45,va,3,4,"nz-row",10),h.rc(46,"nz-row"),h.rc(47,"nz-col",2),h.Ec(48,"async"),h.Ec(49,"async"),h.mc(50,"b2b-statistic",3),h.Ec(51,"async"),h.qc(),h.qc(),h.rc(52,"nz-row"),h.rc(53,"nz-col",2),h.Ec(54,"async"),h.Ec(55,"async"),h.mc(56,"b2b-statistic",3),h.Ec(57,"async"),h.qc(),h.rc(58,"nz-col",2),h.Ec(59,"async"),h.Ec(60,"async"),h.mc(61,"b2b-statistic",3),h.Ec(62,"async"),h.qc(),h.od(63,Ma,5,13,"nz-col",8),h.qc(),h.qc(),h.qc(),h.od(64,Ta,4,2,"ng-template",null,11,h.pd),h.od(66,wa,1,0,"ng-template",null,12,h.pd),h.od(68,za,1,1,"ng-template",null,13,h.pd),h.od(70,Da,1,1,"ng-template",null,14,h.pd),h.od(72,Pa,1,0,"ng-template",null,15,h.pd),h.od(74,Ia,1,0,"ng-template",null,16,h.pd),h.od(76,ka,1,1,"ng-template",null,17,h.pd),h.od(78,Aa,1,1,"ng-template",null,18,h.pd),h.od(80,_a,3,3,"ng-template",null,19,h.pd),h.od(82,Ha,1,4,"ng-template",null,20,h.pd),h.od(84,ja,1,4,"ng-template",null,21,h.pd),h.od(86,Wa,1,4,"ng-template",null,22,h.pd),h.od(88,Xa,5,14,"ng-template",null,23,h.pd)),2&e){const e=h.ad(65),n=h.ad(67),i=h.ad(71),c=h.ad(73),o=h.ad(75),s=h.ad(77),a=h.ad(79),l=h.ad(81);h.Ub(3),h.Mc("nzSpan",h.Fc(4,54,t.isMobile$)?24:8)("ngClass",h.Sc(112,ga,h.Fc(5,56,t.isMobile$))),h.Ub(3),h.Mc("title","Available Credits")("horizontal",h.Fc(7,58,t.isMobile$))("value",t.selectedSwitchBuyFund.userAvailableCredits?i:c),h.Ub(2),h.Mc("nzSpan",h.Fc(9,60,t.isMobile$)?24:8)("ngClass",h.Sc(114,ga,h.Fc(10,62,t.isMobile$))),h.Ub(3),h.Mc("title","Switch Sell Lag Time")("horizontal",h.Fc(12,64,t.isMobile$))("value",t.isInterSwitch?a:"-"),h.Ub(2),h.Mc("nzSpan",8)("ngClass",h.Sc(116,ga,h.Fc(14,66,t.isMobile$))),h.Ub(5),h.Mc("ngTemplateOutlet",l),h.Ub(1),h.Mc("nzSpan",h.Fc(20,68,t.isMobile$)?24:8)("ngClass",h.Sc(118,ga,h.Fc(21,70,t.isMobile$))),h.Ub(3),h.Mc("title","Switching Fee")("horizontal",h.Fc(23,72,t.isMobile$))("value",null!=t.switchingCalculatorModel&&t.switchingCalculatorModel.salesChargeStr?e:n),h.Ub(2),h.Mc("nzSpan",h.Fc(25,74,t.isMobile$)?24:8)("ngClass",h.Sc(120,ga,h.Fc(26,76,t.isMobile$))),h.Ub(3),h.Mc("title","Switch Buy Lag Time")("horizontal",h.Fc(28,78,t.isMobile$))("value",t.isInterSwitch?o:s),h.Ub(2),h.Mc("ngIf",0!==(null==t.selectedSwitchBuyFund?null:t.selectedSwitchBuyFund.platformFeeRate)),h.Ub(2),h.Mc("ngClass",h.Sc(122,Qa,!h.Fc(32,80,t.isMobile$))),h.Ub(2),h.Mc("nzSpan",h.Fc(34,82,t.isMobile$)?24:8)("ngClass",h.Sc(124,ga,h.Fc(35,84,t.isMobile$))),h.Ub(3),h.Mc("title","Available Credits")("horizontal",h.Fc(37,86,t.isMobile$))("value",t.selectedSwitchBuyFund.userAvailableCredits?i:c),h.Ub(2),h.Mc("nzSpan",h.Fc(39,88,t.isMobile$)?24:8)("ngClass",h.Sc(126,ga,h.Fc(40,90,t.isMobile$))),h.Ub(3),h.Mc("title","Switch Sell Lag Time")("horizontal",h.Fc(42,92,t.isMobile$))("value",t.isInterSwitch?a:"-"),h.Ub(2),h.Mc("ngIf",t.selectedSwitchBuyFund.prospectusPath),h.Ub(1),h.Mc("ngIf",t.selectedSwitchBuyFund.performancePath),h.Ub(1),h.Mc("ngIf",t.selectedSwitchBuyFund.factsheetPath),h.Ub(2),h.Mc("nzSpan",h.Fc(48,94,t.isMobile$)?24:8)("ngClass",h.Sc(128,ga,h.Fc(49,96,t.isMobile$))),h.Ub(3),h.Mc("title","Switch Buy Lag Time")("horizontal",h.Fc(51,98,t.isMobile$))("value",t.isInterSwitch?o:s),h.Ub(3),h.Mc("nzSpan",h.Fc(54,100,t.isMobile$)?24:8)("ngClass",h.Sc(130,ga,h.Fc(55,102,t.isMobile$))),h.Ub(3),h.Mc("title","Switching Fee")("horizontal",h.Fc(57,104,t.isMobile$))("value",null!=t.switchingCalculatorModel&&t.switchingCalculatorModel.salesChargeStr?e:n),h.Ub(2),h.Mc("nzSpan",h.Fc(59,106,t.isMobile$)?24:8)("ngClass",h.Sc(132,ga,h.Fc(60,108,t.isMobile$))),h.Ub(3),h.Mc("title","Switch Buy Lag Time")("horizontal",h.Fc(62,110,t.isMobile$))("value",t.isInterSwitch?o:s),h.Ub(2),h.Mc("ngIf",0!==(null==t.selectedSwitchBuyFund?null:t.selectedSwitchBuyFund.platformFeeRate))}},directives:[B.a,P.c,P.a,p.q,be.c,p.A,p.t,z.a,k.b,xt.e],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Ja(e,t){if(1&e&&h.mc(0,"ui-option",39),2&e){const e=t.$implicit;h.Mc("nzLabel",e.fundName)("nzValue",e.sedolnumber)}}function el(e,t){1&e&&(h.mc(0,"i",40),h.qd(1," Please Select a Fund for switch buy. "))}function tl(e,t){if(1&e&&(h.rc(0,"div",18),h.mc(1,"switch-fund-detail-info",41),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("switchingCalculatorModel",e.switchingCalculatorModel)("selectedSwitchBuyFund",e.selectedSwitchBuyFund)("isInterSwitch",e.isInterSwitch)}}function nl(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",40),h.qd(2," Please Enter Amount With 2 Decimal Places. "),h.qc())}function il(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The Min Redemption is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRedemptionNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function cl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd("The Min Redemption is ",null==e.selectedFund?null:e.selectedFund.minRedemptionNum," units.")}}function ol(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",40),h.od(3,il,3,4,"span",3),h.qc(),h.od(4,cl,2,1,"ng-template",null,42,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(2);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function sl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The Min Retain is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRetainNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function al(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The Min Retain is ",null==e.selectedFund?null:e.selectedFund.minRetainNum," units.")}}function ll(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",40),h.od(3,sl,3,4,"span",3),h.qc(),h.od(4,al,2,1,"ng-template",null,43,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(2);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function rl(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span",44),h.mc(2,"i",40),h.qd(3),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd(" ",null==e.switchUnits?null:e.switchUnits.getError("invalidSwitch")," ")}}function dl(e,t){if(1&e&&(h.rc(0,"ui-option",45),h.rc(1,"label"),h.rc(2,"
5span",46),h.qd(3),h.qc(),h.mc(4,"br"),h.rc(5,"span",47),h.qd(6),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value),h.Ub(3),h.rd(null==e?null:e.label),h.Ub(3),h.rd(null==e?null:e.desc)}}function ul(e,t){1&e&&(h.rc(0,"span"),h.mc(1,"i",40),h.qd(2,"Please Select a income distribution option for switch buy."),h.qc())}function hl(e,t){if(1&e&&(h.rc(0,"span",44),h.mc(1,"i",40),h.qd(2),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.rd(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.getError("invalidSwitch"))}}function pl(e,t){if(1&e&&(h.od(0,ul,3,0,"span",30),h.od(1,hl,3,1,"span",48)),2&e){const e=h.Dc(2);h.Mc("ngIf",(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.dirty)&&(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.hasError("required"))),h.Ub(1),h.Mc("ngIf",(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.dirty)&&(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.hasError("invalidSwitch")))}}const ml=function(e){return{"m-0":e}},fl=function(e){return{"mb-2":e}},gl=function(e){return{"mt-3":e}},bl=function(e,t){return{"pb-3":e,"mb-2":t}};function Sl(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"form",15),h.rc(2,"nz-row",16),h.rc(3,"nz-col",17),h.Ec(4,"async"),h.rc(5,"nz-form-item",18),h.rc(6,"nz-form-control"),h.rc(7,"ui-input-group",19),h.mc(8,"input",20),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(9,"nz-col",17),h.Ec(10,"async"),h.rc(11,"nz-form-item",18),h.rc(12,"nz-form-control",21),h.rc(13,"ui-select",22),h.od(14,Ja,1,2,"ui-option",23),h.qc(),h.qc(),h.od(15,el,2,0,"ng-template",null,24,h.pd),h.qc(),h.qc(),h.qc(),h.od(17,tl,2,3,"div",25),h.rc(18,"nz-row",26),h.rc(19,"nz-col",17),h.Ec(20,"async"),h.rc(21,"nz-form-item",27),h.rc(22,"nz-form-control"),h.rc(23,"ui-input-group",28),h.mc(24,"input",29),h.qc(),h.od(25,nl,3,0,"nz-form-explain",30),h.od(26,ol,6,2,"nz-form-explain",30),h.od(27,ll,6,2,"nz-form-explain",30),h.qc(),h.qc(),h.qc(),h.rc(28,"nz-col",17),h.Ec(29,"async"),h.rc(30,"nz-form-item",27),h.rc(31,"nz-form-control"),h.rc(32,"ui-input-group",31),h.mc(33,"input",29),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.od(34,rl,4,1,"nz-form-explain",30),h.rc(35,"nz-row"),h.rc(36,"nz-col",32),h.Ec(37,"async"),h.rc(38,"nz-form-item",33),h.Ec(39,"async"),h.rc(40,"nz-form-control"),h.rc(41,"label",34),h.zc("nzCheckedChange",(function(t){return h.dd(e),h.Dc().onSwitchAllCheckChange(t)})),h.qd(42,"Switch All"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(43,"nz-form-item",35),h.Ec(44,"async"),h.Ec(45,"async"),h.rc(46,"nz-form-control",21),h.rc(47,"ui-select",36),h.od(48,dl,7,4,"ui-option",37),h.qc(),h.qc(),h.od(49,pl,2,2,"ng-template",null,38,h.pd),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.ad(16),t=h.ad(50),n=h.Dc();h.Ub(1),h.Mc("formGroup",n.form),h.Ub(2),h.Mc("nzSpan",h.Fc(4,30,n.isMobile$)?24:12),h.Ub(5),h.Mc("formControl",n.investmentType),h.Ub(1),h.Mc("nzSpan",h.Fc(10,32,n.isMobile$)?24:12),h.Ub(3),h.Mc("nzErrorTip",e),h.Ub(1),h.Mc("formControl",n.switchBuySedolnumber),h.Ub(1),h.Mc("ngForOf",n.fundSwitchList),h.Ub(3),h.Mc("ngIf",n.selectedSwitchBuyFund&&n.switchingCalculatorModel),h.Ub(2),h.Mc("nzSpan",h.Fc(20,34,n.isMobile$)?24:12),h.Ub(2),h.Mc("ngClass",h.Sc(46,ml,null==n.switchUnits?null:n.switchUnits.hasError("invalidSwitch"))),h.Ub(2),h.Mc("nzLabelPlaceholder","Units To Switch Sell"),h.Ub(1),h.Mc("formControl",n.switchUnits),h.Ub(1),h.Mc("ngIf",(null==n.switchUnits?null:n.switchUnits.dirty)&&(null==n.switchUnits?null:n.switchUnits.hasError("pattern"))),h.Ub(1),h.Mc("ngIf",(null==n.switchUnits?null:n.switchUnits.dirty)&&(null==n.switchUnits?null:n.switchUnits.hasError("invalidMinRedemption"))),h.Ub(1),h.Mc("ngIf",(null==n.switchUnits?null:n.switchUnits.dirty)&&(null==n.switchUnits?null:n.switchUnits.hasError("invalidMinHolding"))),h.Ub(1),h.Mc("nzSpan",h.Fc(29,36,n.isMobile$)?24:12),h.Ub(2),h.Mc("ngClass",h.Sc(48,ml,null==n.switchUnits?null:n.switchUnits.hasError("invalidSwitch"))),h.Ub(2),h.Mc("nzLabelPlaceholder","Indicative Switch Buy Amt.")("nzPrefix",n.indicativeAmount.value?n.selectedFund.fundCurrencyCode:""),h.Ub(1),h.Mc("formControl",n.indicativeAmount),h.Ub(1),h.Mc("ngIf",(null==n.switchUnits?null:n.switchUnits.dirty)&&(null==n.switchUnits?null:n.switchUnits.hasError("invalidSwitch"))),h.Ub(2),h.Mc("nzSpan",24)("ngClass",h.Sc(50,fl,h.Fc(37,38,n.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(52,gl,h.Fc(39,40,n.isMobile$))),h.Ub(3),h.Mc("nzChecked",null==n.isSwitchAll?null:n.isSwitchAll.value),h.Ub(2),h.Mc("ngClass",h.Tc(54,bl,h.Fc(44,42,n.isMobile$),!h.Fc(45,44,n.isMobile$))),h.Ub(3),h.Mc("nzErrorTip",t),h.Ub(1),h.Mc("formControl",n.switchInDividendInstruction)("nzDisabled",n.dividendInstructionEditDisabled),h.Ub(1),h.Mc("ngForOf",n.dividendInstructionList)}}function yl(e,t){if(1&e&&h.mc(0,"nz-skeleton",49),2&e){const e=h.Dc();h.Mc("nzActive",!0)("nzLoading",e.isLoadingFundFill||e.isLoadingSalesCharge)}}let vl=(()=>{class e{constructor(e,t,n,i,c,o,s){this.fb=e,this.transactionService=t,this.subHandlingService=n,this.transactionRestService=i,this.store=c,this.passportExpiryNotificationService=o,this.currencyFormatService=s,this.addedFund=[],this.selectedFundForSwitchBuyChange=new h.s,this.closed=new h.s,this.noSwitchFunds=new h.s,this.showEpfAutoSell=new h.s,this.twoDecimalPlacesRegex=/^-?\d*[.,]?\d{0,2}$/,this.transactionConstant=U.a,this._fundSwitchList=[],this.showJpyUnavailableModal=!1,this.fepBreached=!1,this.passportNoticeVisible=!1,this.dividendInstructionEditDisabled=!1}set fundSwitchList(e){if(e&&(null==e?void 0:e.length)>0){this._fundSwitchList=e;const t=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno)));this.subHandlingService.once(t.pipe(Object(y.a)(e=>{var t,n;
5this.existingfundSwitchTransactionModelList=[],e.forEach(e=>this.existingfundSwitchTransactionModelList.push(e.fundSwitchTransactionModel)),this.selectedSwitchBuyFundSedolnumber=null===(t=null==e?void 0:e.find(e=>{var t,n,i;return(null==e?void 0:e.sedolNumber)===(null===(t=this.selectedFund)||void 0===t?void 0:t.productCode)&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)}))||void 0===t?void 0:t.fundSwitchTransactionModel.switchBuySedolnumber,this.selectedSwitchBuyFund=null===(n=this.fundSwitchList)||void 0===n?void 0:n.find(e=>e.sedolnumber===this.selectedSwitchBuyFundSedolnumber),this.getDividendInstructionList(!1)})))}0==(null==e?void 0:e.length)&&this.noSwitchFunds.emit()}get fundSwitchList(){return this._fundSwitchList}ngOnInit(){this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.form=this.initForm(),this.subscribeUnitToSwitch(),this.subscribeSwitchBuySedolnumberChange(),this.setFormValue()}initForm(){var e,t,n,i,c,o,s,a,l,r,d;return this.fb.group({investmentType:[{value:"",disabled:!0}],switchUnits:["",[oe.H.required,oe.H.pattern(this.twoDecimalPlacesRegex),Object(Oc.n)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRetainNum,null===(t=this.selectedFund)||void 0===t?void 0:t.availableValue,null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity,null===(i=this.selectedFund)||void 0===i?void 0:i.lastestPrice,null===(c=this.selectedFund)||void 0===c?void 0:c.minRetainType),Object(Oc.q)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRedemptionNum,null===(s=this.selectedFund)||void 0===s?void 0:s.lastestPrice,null===(a=this.selectedFund)||void 0===a?void 0:a.minRedemptionType,null===(l=this.selectedFund)||void 0===l?void 0:l.availableValue,null===(r=this.selectedFund)||void 0===r?void 0:r.availableQuantity)]],isSwitchAll:[!1],indicativeAmount:[{value:"",disabled:!0}],salesCharge:[(null===(d=this.switchingCalculatorModel)||void 0===d?void 0:d.salesChargeStr)?this.switchingCalculatorModel.salesChargeStr:"-"],switchBuySedolnumber:["",oe.H.required],isWaived:[!1],switchBuyTransDate:"",switchSellTransDate:"",switchInDividendInstruction:["",oe.H.required]})}setFormValue(){var e,t,n,i,c,o,s,a,l,r,d,u,h,p,m;const f=null===(e=this.addedFund)||void 0===e?void 0:e.find(e=>{var t,n,i;return e.sedolNumber===(null===(t=this.selectedFund)||void 0===t?void 0:t.productCode)&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)});this.isSwitchAll.reset();let g=this.isUpdate?null==f?void 0:f.fundSwitchTransactionModel.switchBuySedolnumber:"";this.isInterOrder=this.isUpdate?null===(t=null==f?void 0:f.fundSwitchTransactionModel)||void 0===t?void 0:t.interOrder:this.isInterSwitch,(null===(n=this.selectedFund)||void 0===n?void 0:n.targetSwitchBuy)&&(g=null===(i=this.selectedFund)||void 0===i?void 0:i.targetSwitchBuy),null===(c=this.switchBuySedolnumber)||void 0===c||c.patchValue(g),null===(o=this.investmentType)||void 0===o||o.patchValue((null===(s=this.selectedFund)||void 0===s?void 0:s.paymentMethod)===U.a.EPF_FUNDS.toUpperCase()?U.a.EPF_FUNDS.toUpperCase():"Cash"),null===(a=this.switchUnits)||void 0===a||a.patchValue(this.isUpdate?null===(l=null==f?void 0:f.fundSwitchTransactionModel)||void 0===l?void 0:l.switchUnit:""),null===(r=this.indicativeAmount)||void 0===r||r.patchValue(this.isUpdate?this.currencyFormatService.formatInputNumber(null==f?void 0:f.indicativeAmount,null===(d=this.selectedFund)||void 0===d?void 0:d.fundCurrencyCode):""),null===(u=this.salesCharge)||void 0===u||u.patchValue(this.isUpdate?null==f?void 0:f.switchSalesCharge:(null===(h=this.switchingCalculatorModel)||void 0===h?void 0:h.salesChargeStr)?this.switchingCalculatorModel.salesChargeStr:"-"),null===(p=this.switchInDividendInstruction)||void 0===p||p.patchValue(this.isUpdate?null===(m=null==f?void 0:f.fundSwitchTransactionModel)||void 0===m?void 0:m.switchInDividendInstruction:""),this.isUpdate&&this.calculateSwitchingTransactionDate(null==f?void 0:f.fundSwitchTransactionModel)}get investmentType(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("investmentType")}get switchUnits(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchUnits")}get isSwitchAll(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isSwitchAll")}get indicativeAmount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("indicativeAmount")}get salesCharge(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("salesCharge")}get switchBuySedolnumber(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchBuySedolnumber")}get isWaived(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isWaived")}get switchBuyTransDate(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchBuyTransDate")}get switchSellTransDate(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchSellTransDate")}get switchInDividendInstruction(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchInDividendInstruction")}onSwitchAllCheckChange(e){var t;this.isSwitchAll.patchValue(e),e?(this.setSwitchUnitNoDpValidators(),this.switchUnits.patchValue(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)):(this.setSwitchUnitWithDpValidators(),this.switchUnits.patchValue(""))}subscribeUnitToSwitch(){var e;this.subHandlingService.subscribe(null===(e=this.switchUnits)||void 0===e?void 0:e.valueChanges.pipe(Object(ce.a)(300),Object(b.a)(),Object(y.a)(e=>{var t,n,i,c,o,s,a,l;let r=this.selectedFund.fundCurrencyCode===U.a.PAYMENT_CURRENCY_MYR?e*this.selectedFund.lastestPrice*this.selectedFund.fxRate:e*this.selectedFund.lastestPrice;this.indicativeAmount.patchValue(this.currencyFormatService.formatInputNumber(r,null===(t=this.selectedFund)||void 0===t?void 0:t.fundCurrencyCode)),e>=(null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity)?(this.setSwitchUnitNoDpValidators(),this.switchUnits.patchValue(null===(i=this.selectedFund)||void 0===i?void 0:i.availableQuantity,{emitEvent:!1}),null===(c=this.isSwitchAll)||void 0===c||c.patchValue(!0),r=this.selectedFund.fundCurrencyCode===U.a.PAYMENT_CURRENCY_MYR?(null===(o=this.selectedFund)||void 0===o?void 0:o.availableQuantity)*this.selectedFund.lastestPrice*this.selectedFund.fxRate:(null===(s=this.selectedFund)||void 0===s?void 0:s.availableQuantity)*this.selectedFund.lastestPrice,this.indicativeAmount.patchValue(this.currencyFormatService.formatInputNumber(r,null===(a=this.selectedFund)||void 0===a?void 0:a.fundCurrencyCode))):(this.setSwitchUnitWithDpValidators(),null===(l=this.isSwitchAll)||void 0===l||l.patchValue(!1))})))}addOrUpdateCart(){var e,t,n,i;let c=this.passportExpiryNotificationService.isPersonalAccountPassportExpired();const o=this.refno;let s=!1;if(o&&(s=this.passportExpiryNotificationService.checkPassportExpiredByAccount(o)),c||s)this.passportNoticeVisible=!0;else if(this.salesCharge.patchValue((null===(e=this.switchingCalculatorModel)||void 0===e?void 0:e.salesChargeStr)?this.switchingCalculatorModel.salesChargeStr:"-"),Object(zn.c)(this.form),this.form.updateValueAndValidity(),!this.form.invali
5d){if(null===(t=this.investmentType)||void 0===t||t.patchValue((null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod)===U.a.EPF_FUNDS.toUpperCase()?U.a.EPF_FUNDS.toUpperCase():U.a.CASH),this.selectedFund.normalRspFund&&this.isSwitchAll.value&&!this.showedTerminateRspMsgModal&&(null===(i=this.selectedFund)||void 0===i?void 0:i.hasActiveRsp))return this.showTerminateRspMsgModal=!0,void(this.showedTerminateRspMsgModal=!0);this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1),this.validateAndAddOrUpdateCart()}}cancelOrRemoveCart(){this.isUpdate&&this.transactionService.removeSwitchCartInfo(this.refno,this.selectedFund),this.closed.emit()}closeTerminateRspMsgModal(){this.showTerminateRspMsgModal=!1}validateAndAddOrUpdateCart(){this.isCheckingForm=!0;let e=this.initSwitchTransactionModel();this.isInterSwitch||e.paymentMethod!==U.a.CHEQUE.toLowerCase()?this.subHandlingService.once(this.validateSwitch(e)):this.massCheckIntraSwitchWaive(e)}validateSwitch(e){return this.transactionRestService.validateSwitch(e,this.refno).pipe(Object(y.a)(e=>{var t,n,i;if(this.isCheckingForm=!1,e.status!==M.a.RESPONSE_SUCCESS)return e.errorMessage.includes("foreign.exchange.policy.breached")?void(this.fepBreached=!0):void("Invalid Dividend Instruction"===(null==e?void 0:e.errorMessage)?null===(t=this.switchInDividendInstruction)||void 0===t||t.setErrors({invalidSwitch:null==e?void 0:e.errorMessage}):null===(n=this.switchUnits)||void 0===n||n.setErrors({invalidSwitch:null==e?void 0:e.errorMessage}));if(this.form.enable(),this.isUpdate?this.transactionService.updateSwitchCartInfo(this.form,this.selectedFund,this.selectedSwitchBuyFund):this.transactionService.storeSwitchCart(this.form,this.selectedFund,this.selectedSwitchBuyFund),this.isUpdate&&"cheque"===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)){const e=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno)));this.subHandlingService.once(e.pipe(Object(y.a)(e=>{var t,n,i;const c=null===(n=null===(t=null==e?void 0:e.find(e=>{var t,n;return(null===(t=null==e?void 0:e.fundSwitchTransactionModel)||void 0===t?void 0:t.switchBuySedolnumber)===this.selectedSwitchBuyFundSedolnumber&&(null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod)===(null==e?void 0:e.fundSwitchTransactionModel.paymentMethod)}))||void 0===t?void 0:t.fundSwitchTransactionModel)||void 0===n?void 0:n.switchSellSedolnumber,o=null==e?void 0:e.filter(e=>{var t,n,i,c,o;return(null===(t=null==e?void 0:e.fundSwitchTransactionModel)||void 0===t?void 0:t.switchBuySedolnumber)===this.selectedSwitchBuyFundSedolnumber&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.switchSellSedolnumber)!==(null===(i=this.selectedFund)||void 0===i?void 0:i.productCode)&&(null===(c=this.selectedFund)||void 0===c?void 0:c.paymentMethod)===(null===(o=null==e?void 0:e.fundSwitchTransactionModel)||void 0===o?void 0:o.paymentMethod)});c===(null===(i=this.selectedFund)||void 0===i?void 0:i.productCode)&&(null==o?void 0:o.length)>0&&o.forEach(e=>{var t;let n=Object.assign({},e.fundSwitchTransactionModel);n.switchInDividendInstruction=null===(t=this.switchInDividendInstruction)||void 0===t?void 0:t.value;const i=Object.assign(Object.assign({},e),{fundSwitchTransactionModel:n});this.store.dispatch(new u.rb(this.refno,i))})})))}this.closed.emit()}))}massCheckIntraSwitchWaive(e){var t;let n=null===(t=this.existingfundSwitchTransactionModelList)||void 0===t?void 0:t.findIndex(t=>t.switchSellSedolnumber==e.switchSellSedolnumber);-1==n?this.existingfundSwitchTransactionModelList.push(e):this.existingfundSwitchTransactionModelList[n]=e,this.subHandlingService.once(this.transactionRestService.massCheckIntraSwitchWaive(this.refno,this.existingfundSwitchTransactionModelList).pipe(Object(E.a)(t=>{if(t.status===M.a.RESPONSE_SUCCESS){if(t){let n=null==t?void 0:t.data.find(t=>t.switchSellSedolnumber===e.switchSellSedolnumber);if(null==n?void 0:n.notEnoughWaive)return void(this.showInsufficientCreditModal=!0);this.isWaived.patchValue(null==n?void 0:n.waive),this.isWaived.value&&this.salesCharge.patchValue("0.00%")}return this.validateSwitch(e)}})))}initSwitchTransactionModel(){var e,t,n,i;return{interOrder:this.isInterSwitch,intraOrder:!this.isInterSwitch,switchBuySedolnumber:this.selectedSwitchBuyFundSedolnumber,switchSellSedolnumber:null===(e=this.selectedFund)||void 0===e?void 0:e.productC
5ode,ifastStatus:"NA",paymentMethod:null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod,refno:this.refno,switchUnit:null===(n=this.switchUnits)||void 0===n?void 0:n.value,switchChargeDisplay:this.switchingCalculatorModel.salesChargeStr,switchInDividendInstruction:null===(i=this.switchInDividendInstruction)||void 0===i?void 0:i.value}}subscribeSwitchBuySedolnumberChange(){var e;this.subHandlingService.subscribe(null===(e=this.switchBuySedolnumber)||void 0===e?void 0:e.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t;if(e&&!this.isLoadingFundFill){const n=null===(t=this.fundSwitchList)||void 0===t?void 0:t.find(t=>t.sedolnumber===e),i=null==n?void 0:n.fundCurrencyCode;if(i===U.a.PAYMENT_CURRENCY_JPY){if(!this.store.selectSnapshot(a.a.isWhitelistLoaded))return void this.subHandlingService.once(this.store.select(a.a.isWhitelistLoaded).pipe(Object(aa.a)(e=>!!e),Object(y.a)(()=>{this.store.selectSnapshot(a.a.isJpyFundRestricted(i))?this.handleJpyRestricted():this.proceedSwitchBuySelection(e)})));if(this.store.selectSnapshot(a.a.isJpyFundRestricted(i)))return void this.handleJpyRestricted()}this.proceedSwitchBuySelection(e)}})))}handleJpyRestricted(){this.showJpyUnavailableModal=!0,this.switchBuySedolnumber.patchValue("",{emitEvent:!1}),this.selectedSwitchBuyFund=null,this.selectedSwitchBuyFundSedolnumber=""}proceedSwitchBuySelection(e){var t,n,i,c;this.loadingBuyFundValue(e),this.calculateSwitchingTransactionDate();let o=!!(null===(t=this.selectedFund)||void 0===t?void 0:t.reloadSwitchBuy)&&(null===(n=this.selectedFund)||void 0===n?void 0:n.reloadSwitchBuy);!o&&(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)==U.a.EPF_FUNDS.toUpperCase()&&this.selectedSwitchBuyFund.intraSwitch&&"Y"==(null===(c=this.selectedSwitchBuyFund)||void 0===c?void 0:c.epfBlockPureBuy)&&this.showEpfAutoSell.emit(this.selectedSwitchBuyFundSedolnumber),o&&(this.selectedFund.reloadSwitchBuy=!1)}loadingBuyFundValue(e){var t,n;this.selectedSwitchBuyFundSedolnumber=e,this.selectedFundForSwitchBuyChange.emit(this.selectedSwitchBuyFundSedolnumber),this.selectedSwitchBuyFund=null===(t=this.fundSwitchList)||void 0===t?void 0:t.find(t=>t.sedolnumber===e),this.isInterOrder=null===(n=this.selectedSwitchBuyFund)||void 0===n?void 0:n.interList,this.getDividendInstructionList(!0)}getDividendInstructionList(e){var t,n,i,c,o,s,a;if(this.selectedSwitchBuyFund){let l=this.selectedSwitchBuyFund.dividendOption;if("cheque"===(null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod)){const t=null===(n=this.existingfundSwitchTransactionModelList)||void 0===n?void 0:n.find(e=>{var t;return e.switchBuySedolnumber===this.selectedSwitchBuyFundSedolnumber&&e.paymentMethod===(null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod)});let s=(null==t?void 0:t.switchSellSedolnumber)===(null===(i=this.selectedFund)||void 0===i?void 0:i.productCode)&&(null==t?void 0:t.paymentMethod)===(null===(c=this.selectedFund)||void 0===c?void 0:c.paymentMethod);const a=null==t?void 0:t.switchInDividendInstruction;this.isInterOrder||"Both"!==l||(l=null===(o=this.selectedFund)||void 0===o?void 0:o.dividendInstruction),this.dividendInstructionList=this.getDividendInstructionOptions(!s&&a?a:l),!s&&a?this.switchInDividendInstruction.patchValue(a):e&&this.switchInDividendInstruction.patchValue(this.dividendInstructionList[0].value)}else l=U.a.DIVIDEND_OPTIONS.Reinvest.value,this.dividendInstructionList=this.getDividendInstructionOptions(l),e&&this.switchInDividendInstruction.patchValue(this.dividendInstructionList[0].value);this.dividendInstructionEditDisabled=!1,(1===(null===(s=this.dividendInstructionList)||void 0===s?void 0:s.length)||!this.isInterOrder&&"Both"===(null===(a=this.selectedSwitchBuyFund)||void 0===a?void 0:a.dividendOption))&&(this.dividendInstructionEditDisabled=!0)}}getDividendInstructionOptions(e){let t=[];if(e)switch(e){case U.a.DIVIDEND_OPTIONS.Cash.value:t.push(U.a.DIVIDEND_OPTIONS.Cash);break;case U.a.DIVIDEND_OPTIONS.Reinvest.value:t.push(U.a.DIVIDEND_OPTIONS.Reinvest);break;case"Both":t.push(U.a.DIVIDEND_OPTIONS.Reinvest),t.push(U.a.DIVIDEND_OPTIONS.Cash)}else t.push(U.a.DIVIDEND_OPTIONS.Reinvest);return t}onInsufficientCreditModalClosed(){this.showInsufficientCreditModal=!1;let e=this.initSwitchTransactionModel();this.subHandlingService.once(this.validateSwitch(e))}setSwitchUnitNoDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.switchUnits.setValidators([Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}setSwitchUnitWithDpValidators(){var e,t,n,i,c,o,s,a,l,r;this.switchUnits.setValidators([oe.H.pattern(this.twoDecimalPlacesRegex),Object(Oc.q)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRedemptionNum,null===(t=this.selectedFund)||void 0===t?void 0:t.lastestPrice,null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionType,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue,null===(c=this.selectedFund)||void 0===c?void 0:c.availableQuantity),Object(Oc.n)(null===(o=this.selectedFund)||void 0===o?void 0:o.minRetainNum,null===(s=this.selectedFund)||void 0===s?void 0:s.availableValue,null===(a=this.selectedFund)||void 0===a?void 0:a.availableQuantity,null===(l=this.selectedFund)||void 0===l?void 0:l.lastestPrice,null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainType)])}switchModelForTransactionDate(e){var t,n;return{interOrder:e?e.interOrder:this.selectedSwitchBuyFund.managercode!==this.selectedFund.managerCode,switchBuySedolnumber:e?e.switchBuySedolnumber:this.selectedSwitchBuyFundSedolnumber,switchSellSedolnumber:null===(t=this.selectedFund)||void 0===t?void 0:t.productC
5ode,ifastStatus:"NA",paymentMethod:null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod}}calculateSwitchingTransactionDate(e){let t=this.switchModelForTransactionDate(e);console.log("switchModel: ",t),this.transactionRestService.calculateSwitchingTransactionDate(t.switchSellSedolnumber,t.switchBuySedolnumber,t.interOrder,t).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.switchBuyTransDate.patchValue(e.data.SwitchBuyTransactionDate),this.switchSellTransDate.patchValue(e.data.SwitchSellTransactionDate),console.log("[AFTER] Sell Trans Date: "+this.switchSellTransDate.value+" - Buy Trans Date: "+this.switchBuyTransDate.value))},e=>{console.log("calculateSwitchingTransactionDate failed"),this.switchBuyTransDate.patchValue("-"),this.switchSellTransDate.patchValue("-")})}onCloseJpyUnavailableModal(){this.showJpyUnavailableModal=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(C.a),h.lc(l.a),h.lc(T.a),h.lc(s.i),h.lc(vt.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-switch-fund-fill-detail-form"]],inputs:{show:"show",switchingCalculatorModel:"switchingCalculatorModel",selectedFund:"selectedFund",isUpdate:"isUpdate",addedFund:"addedFund",isLoadingFundFill:"isLoadingFundFill",isLoadingSalesCharge:"isLoadingSalesCharge",isInterSwitch:"isInterSwitch",fundSwitchList:"fundSwitchList"},outputs:{selectedFundForSwitchBuyChange:"selectedFundForSwitchBuyChange",closed:"closed",noSwitchFunds:"noSwitchFunds",showEpfAutoSell:"showEpfAutoSell"},features:[h.Tb([l.a])],decls:24,vars:18,consts:[[1,"mb-4"],[3,"selectedFund"],[1,"font-weight-bold","mb-2"],[4,"ngIf","ngIfElse"],[3,"showTerminateRspMsgModal","isSwitch","closeTerminateRspMsgModal"],["loadingTemplate",""],[1,"text-right"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",3,"nzLoading","click"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"nzLoading","click"],[3,"showInsufficientCreditModal","closeInsufficientCreditModal"],[3,"showModal","refno","showModalChange"],[3,"modalVisible","isPopUp","footerFunc","onOkEmit","onUpdateEmit"],[3,"visible","closeModal"],["nz-form","",3,"formGroup"],["nzType","flex","nzAlign","middle","nzGutter","16"],[3,"nzSpan"],[1,"mb-2"],["nzLabelPlaceholder","Investment Type"],["ui-input","",3,"formControl"],[3,"nzErrorTip"],["nzShowSearch","","nzPlaceHolder","Select Fund to Switch Buy",1,"w-100",3,"formControl"],["class","text-wrap",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["buySedolError",""],["class","mb-2",4,"ngIf"],["nzType","flex","nzGutter","16"],[1,"mb-2",3,"ngClass"],["nzSize","small",3,"nzLabelPlaceholder"],["ui-input","","type","number",3,"formControl"],[4,"ngIf"],[3,"nzLabelPlaceholder","nzPrefix"],[3,"nzSpan","ngClass"],[1,"form-line-height-base","mb-2",3,"ngClass"],["nz-checkbox","",3,"nzChecked","nzCheckedChange"],[3,"ngClass"],["nzShowSearch","","nzPlaceHolder","Income Distribution Option",1,"w-100",3,"formControl","nzDisabled"],["nzCustomContent","","class","text-wrap",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["dividendInstructionError",""],[1,"text-wrap",3,"nzLabel","nzValue"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],[1,"py-2","mt-1",3,"switchingCalculatorModel","selectedSwitchBuyFund","isInterSwitch"],["unitMinRedempError",""],["unitMinRetainError",""],[1,"text-danger"],["nzCustomContent","",1,"text-wrap",3,"nzLabel","nzValue"],[1,"text-sm","font-weight-bold"],[1,"text-xs","font-weight-normal"],["class","text-danger",4,"ngIf"],[3,"nzActive","nzLoading"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.mc(1,"sell-fund-detail-info",1),h.qc(),h.rc(2,"p",2),h.qd(3,"Enter Switching Details"),h.qc(),h.od(4,Sl,51,57,"div",3),h.rc(5,"terminate-rsp-msg-modal",4),h.zc("closeTerminateRspMsgModal",(function(){return t.closeTerminateRspMsgModal()})),h.qc(),h.od(6,yl,1,2,"ng-template",null,5,h.pd),h.rc(8,"app-web-scaffold"),h.rc(9,"div",6),h.rc(10,"button",7),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(11),h.qc(),h.rc(12,"button",8),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(13),h.qc(),h.qc(),h.qc(),h.rc(14,"app-mobile-scaffold"),h.rc(15,"b2c-floating-bar"),h.rc(16,"button",9),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(17),h.qc(),h.rc(18,"button",10),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(19),h.qc(),h.qc(),h.qc(),h.rc(20,"app-insufficient-credit-modal",11),h.zc("closeInsufficientCreditModal",(function(){return t.onInsufficientCreditModalClosed()})),h.qc(),h.rc(21,"fep-breached-modal",12),h.zc("showModalChange",(function(e){return t.fepBreached=e})),h.qc(),h.rc(22,"passport-expiry-notification",13),h.zc("onOkEmit",(function(){return t.passportNoticeVisible=!1}))("onUpdateEmit",(function(){return t.passportNoticeVisible=!1})),h.qc(),h.rc(23,"app-jpy-fund-unavailable-modal",14),h.zc("closeModal",(function(){return t.onCloseJpyUnavailableModal()})),h.qc()),2&e){const e=h.ad(7);h.Ub(1),h.Mc("selectedFund",t.selectedFund),h.Ub(3),h.Mc("ngIf",!t.isLoadingFundFill)("ngIfElse",e),h.Ub(1),h.Mc("showTerminateRspMsgModal",t.showTerminateRspMsgModal)("isSwitch",!0),h.Ub(6),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoadingFundFill||t.isLoadingSalesCharge||t.isCheckingForm),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoadingFundFill||t.isLoadingSalesCharge||t.isCheckingForm),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(1),h.Mc("showInsufficientCreditModal",t.showInsufficientCreditModal),h.Ub(1),h.Mc("showModal",t.fepBreached)("refno",t.refno),h.Ub(1),h.Mc("modalVisible",t.passportNoticeVisible)("isPopUp",!1)("footerFunc",!0),h.Ub(1),h.Mc("visible",t.showJpyUnavailableModal)}},directives:[to,p.t,oo,B.a,_.a,z.a,Se.a,pa,$.a,dt.a,ma.a,oe.J,oe.u,se.b,oe.l,P.c,P.a,se.e,se.a,ae.c,oe.c,ae.b,oe.t,oe.i,Lt.d,p.s,p.q,oe.z,lo.a,Lt.a,k.b,Za,se.c,W.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Ml(e,t){if(1&e){const e=h.sc();h.rc(0,"div",10),h.rc(1,"b2c-app-bar-2",11),h.zc("back",(function(){return h.dd(e),h.Dc().onBack()})),h.qc(),h.qc()}2&e&&(h.Ub(1),h.Mc("title","Edit Cart"))}function Cl(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row",15),h.rc(1,"nz-col",16),h.rc(2,"h3",17),h.qd(3),h.qc(),h.qc(),h.rc(4,"nz-col",18),h.rc(5,"i",6),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," ")}}function ql(e,t){if(1&e){const e=h.sc();h.rc(0,"app-switch-fund-fill-detail-form",19),h.zc("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc(2).onFundForSwitchBuyChange(t)}
5))("closed",(function(){return h.dd(e),h.Dc(2).onCancel()}))("showEpfAutoSell",(function(t){return h.dd(e),h.Dc(2).showEpfAutoSellPopup(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("fundSwitchList",e.fundSwitchList)("isInterSwitch",e.isInterSwitch)("switchingCalculatorModel",e.switchingCalculatorModel)}}const Tl=function(e){return{"d-none":e}};function wl(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",12),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.od(1,Cl,6,1,"nz-row",13),h.od(2,ql,1,8,"app-switch-fund-fill-detail-form",14),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",e.show)("nzMaskClosable",!0)("nzFooter",null)("nzWrapClassName","vertical-center-modal")("nzClosable",!1)("nzWidth",600)("ngClass",h.Sc(9,Tl,e.showAiNotice)),h.Ub(1),h.Mc("ngIf",e.selectedFund),h.Ub(1),h.Mc("ngIf",e.show)}}function zl(e,t){if(1&e){const e=h.sc();h.rc(0,"app-switch-fund-fill-detail-form",19),h.zc("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc(2).onFundForSwitchBuyChange(t)}))("closed",(function(){return h.dd(e),h.Dc(2).onCancel()}))("showEpfAutoSell",(function(t){return h.dd(e),h.Dc(2).showEpfAutoSellPopup(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("fundSwitchList",e.fundSwitchList)("isInterSwitch",e.isInterSwitch)("switchingCalculatorModel",e.switchingCalculatorModel)}}function Dl(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",20),h.rc(2,"div",21),h.rc(3,"h3",17),h.qd(4),h.qc(),h.od(5,zl,1,8,"app-switch-fund-fill-detail-form",14),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc();h.Ub(4),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," "),h.Ub(1),h.Mc("ngIf",e.show)}}let Pl=(()=>{class e{constructor(e){this.store=e,this.addedFund=[],this.fundSwitchList=[],this.closed=new h.s,this.selectedFundForSwitchBuyChange=new h.s,this.appBarBack=new h.s,this.noSwitchFundsModal=!1,this.showAutoSellPopup=new h.s}ngOnInit(){}onCancel(){this.closed.emit()}onFundForSwitchBuyChange(e){this.checkAiFlag(e),this.selectedFundForSwitchBuyChange.emit(e)}onBack(){this.appBarBack.emit()}showNoSwitchFundsModal(){this.onCancel(),this.noSwitchFundsModal=!0}onSwitchFundsModalCancel(){this.noSwitchFundsModal=!1}checkAiFlag(e){let t=this.fundSwitchList.find(t=>t.sedolnumber===e);this.store.selectSnapshot(f.a.getAccounts).find(e=>e.refno===this.store.selectSnapshot(u.X.getSelectedRefno)).aiFlag===M.a.NO_FLAG&&"restricted"===(null==t?void 0:t.fundType)&&(this.showAiNotice=!0)}handleAiAccept(e){this.showAiNotice=!1}handleAiDecline(){this.showAiNotice=!1,this.onCancel()}showEpfAutoSellPopup(e){this.showAutoSellPopup.emit(e)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["switch-fund-fill-detail"]],inputs:{show:"show",selectedFund:"selectedFund",isUpdate:"isUpdate",addedFund:"addedFund",fundSwitchList:"fundSwitchList",isLoadingFundFill:"isLoadingFundFill",isLoadingSalesCharge:"isLoadingSalesCharge",switchingCalculatorModel:"switchingCalculatorModel",isInterSwitch:"isInterSwitch"},outputs:{closed:"closed",selectedFundForSwitchBuyChange:"selectedFundForSwitchBuyChange",appBarBack:"appBarBack",showAutoSellPopup:"showAutoSellPopup"},decls:17,vars:14,consts:[["class","border-bottom",4,"ngIf"],[3,"nzVisible","nzMaskClosable","nzFooter","nzWrapClassName","nzClosable","nzWidth","ngClass","nzOnCancel",4,"ngIf"],[4,"ngIf"],[3,"nzClosable","nzMaskClosable","nzFooter","nzVisible","nzOnCancel"],["nzType","flex","nzAlign","middle"],["nzSpan","24",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[1,"text-right","mt-4"],["nz-button","","nzType","outline","nzBlock","",1,"my-1","w-25",3,"click"],[3,"check","show","stayOnCurrentPage","onAccepted","onDecline"],[1,"border-bottom"],[3,"title","back"],[3,"nzVisible","nzMaskClosable","nzFooter","nzWrapClassName","nzClosable","nzWidth","ngClass","nzOnCancel"],["nzType","flex","nzAlign","top","class","p-2",4,"ngIf"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","selectedFundForSwitchBuyChange","closed","showEpfAutoSell",4,"ngIf"],["nzType","flex","nzAlign","top",1,"p-2"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","selectedFundForSwitchBuyChange","closed","showEpfAutoSell"],[1,"bg-white","shadow","pt-3","mb-6"],[1,"px-2","mb-6"]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,Ml,2,1,"div",0),h.qc(),h.od(2,wl,3,11,"nz-modal",1),h.Ec(3,"async"),h.rc(4,"app-mobile-scaffold"),h.od(5,Dl,6,2,"ng-container",2),h.Ec(6,"async"),h.qc(),h.rc(7,"nz-modal",3),h.zc("nzOnCancel",(function(){return t.onSwitchFundsModalCancel()})),h.rc(8,"nz-row",4),h.rc(9,"nz-col",5),h.rc(10,"i",6),h.zc("click",(function(){return t.onSwitchFundsModalCancel()})),h.qc(),h.qc(),h.qc(),h.rc(11,"div"),h.qd(12,"No other funds able to switch from this fund !"),h.qc(),h.rc(13,"div",7),h.rc(14,"button",8),h.zc("click",(function(){return t.onSwitchFundsModalCancel()})),h.qd(15,"OK"),h.qc(),h.qc(),h.qc(),h.rc(16,"shared-si-declaration-revamp-modal",9),h.zc("onAccepted",(function(e){return t.handleAiAccept(e)}
5))("onDecline",(function(){return t.handleAiDecline()})),h.qc()),2&e&&(h.Ub(1),h.Mc("ngIf",t.show),h.Ub(1),h.Mc("ngIf",!h.Fc(3,10,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(6,12,t.isMobile$)&&t.show),h.Ub(2),h.Mc("nzClosable",!1)("nzMaskClosable",!0)("nzFooter",null)("nzVisible",t.noSwitchFundsModal),h.Ub(9),h.Mc("check",!1)("show",t.showAiNotice)("stayOnCurrentPage",!0))},directives:[z.a,p.t,j.a,P.c,P.a,k.b,_.a,Dt.a,D.a,p.q,vl],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var Il=n("qAZ0");function kl(e,t){if(1&e&&h.mc(0,"ui-option",31),2&e){const e=t.$implicit;h.Mc("nzLabel",e.fundName)("nzValue",e.sedolnumber)}}function Al(e,t){1&e&&(h.mc(0,"i",32),h.qd(1," Please Select a Fund for switch buy. "))}function El(e,t){if(1&e&&(h.rc(0,"div",27),h.mc(1,"switch-fund-detail-info",33),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("switchingCalculatorModel",e.switchingCalculatorModel)("selectedSwitchBuyFund",e.selectedSwitchBuyFund)("isInterSwitch",e.isInterSwitch)}}function Fl(e,t){if(1&e&&h.mc(0,"ui-option",31),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function Ol(e,t){if(1&e&&(h.rc(0,"nz-col",16),h.rc(1,"nz-form-item"),h.rc(2,"nz-form-control"),h.rc(3,"ui-select",34),h.od(4,Fl,1,2,"ui-option",21),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",8),h.Ub(3),h.Mc("formControl",e.switchBy),h.Ub(1),h.Mc("ngForOf",e.switchByOption)}}function Ul(e,t){if(1&e&&(h.rc(0,"label",37),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function xl(e,t){if(1&e&&(h.rc(0,"nz-col",16),h.rc(1,"strong"),h.qd(2,"Switch By"),h.qc(),h.mc(3,"br"),h.rc(4,"nz-radio-group",35),h.od(5,Ul,2,2,"label",36),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",24),h.Ub(4),h.Mc("formControl",e.switchBy),h.Ub(1),h.Mc("ngForOf",e.switchByOption)}}function Ll(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",32),h.qd(2," Please Enter Amount With 2 Decimal Places. "),h.qc())}function Rl(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",32),h.qd(2," Please make sure this field is not blank. "),h.qc())}function Nl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Min Redemption is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRedemptionNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function Bl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd("The Min Redemption is ",null==e.selectedFund?null:e.selectedFund.minRedemptionNum," units.")}}function _l(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",32),h.od(3,Nl,3,4,"span",2),h.qc(),h.od(4,Bl,2,1,"ng-template",null,40,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(3);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function Vl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Min Retain is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRetainNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function Hl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Min Retain is ",null==e.selectedFund?null:e.selectedFund.minRetainNum," units.")}}function $l(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",32),h.od(3,Vl,3,4,"span",2),h.qc(),h.od(4,Hl,2,1,"ng-template",null,41,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(3);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function jl(e,t){if(1&e&&(h.rc(0,"nz-col",16),h.Ec(1,"async"),h.rc(2,"nz-form-item"),h.rc(3,"nz-form-control"),h.rc(4,"ui-input-group",38),h.mc(5,"input",39),h.qc(),h.od(6,Ll,3,0,"nz-form-explain",25),h.od(7,Rl,3,0,"nz-form-explain",25),h.od(8,_l,6,2,"nz-form-explain",25),h.od(9,$l,6,2,"nz-form-explain",25),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",h.Fc(1,7,e.isMobile$)?24:16),h.Ub(4),h.Mc("nzLabelPlaceholder","Units To Switch Sell"),h.Ub(1),h.Mc("formControl",e.switchUnits),h.Ub(1),h.Mc("ngIf",e.switchUnits.dirty&&e.switchUnits.hasError("pattern")),h.Ub(1),h.Mc("ngIf",e.switchUnits.dirty&&e.switchUnits.hasError("required")),h.Ub(1),h.Mc("ngIf",(null==e.switchUnits?null:e.switchUnits.dirty)&&(null==e.switchUnits?null:e.switchUnits.hasError("invalidMinRedemption"))),h.Ub(1),h.Mc("ngIf",(null==e.switchUnits?null:e.switchUnits.dirty)&&(null==e.switchUnits?null:e.switchUnits.hasError("invalidMinHolding")))}}function Gl(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",32),h.qd(2),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd(" Please Enter Amount With ",e.switchAmountDecimalPlaces," Decimal Places. ")}}function Wl(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",32),h.qd(2," Please make sure this field is not blank. "),h.qc())}function Yl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Min Redemption is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRedemptionNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function Kl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd("The Min Redemption is ",null==e.selectedFund?null:e.selectedFund.minRedemptionNum," units.")}}function Xl(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",32),h.od(3,Yl,3,4,"span",2),h.qc(),h.od(4,Kl,2,1,"ng-template",null,40,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(3);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function Ql(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Min Retain is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRetainNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function Zl(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Min Retain is ",null==e.selectedFund?null:e.selectedFund.minRetainNum," units.")}}function Jl(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",32),h.od(3,Ql,3,4,"span",2),h.qc(),h.od(4,Zl,2,1,"ng-template",null,41,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(3);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function er(e,t){if(1&e&&(h.rc(0,"nz-col",16),h.Ec(1,"async"),h.rc(2,"nz-form-item"),h.rc(3,"nz-form-control"),h.rc(4,"ui-input-group",38),h.mc(5,"input",39),h.qc(),h.od(6,Gl,3,1,"nz-form-explain",25),h.od(7,Wl,3,0,"nz-form-explain",25),h.od(8,Xl,6,2,"nz-form-explain",25),h.od(9,Jl,6,2,"nz-form-explain",25),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzSpan",h.Fc(1,7,e.isMobile$)?24:16),h.Ub(4),h.Mc("nzLabelPlaceholder","Amount To Switch Sell"),h.Ub(1),h.Mc("formControl",e.switchAmount),h.Ub(1),h.Mc("ngIf",e.switchAmount.dirty&&e.switchAmount.hasError("pattern")),h.Ub(1),h.Mc("ngIf",e.switchAmount.dirty&&e.switchAmount.hasError("required")),h.Ub(1),h.Mc("ngIf",(null==e.switchAmount?null:e.switchAmount.dirty)&&(null==e.switchAmount?null:e.switchAmount.hasError("invalidMinRedemption"))),h.Ub(1),h.Mc("ngIf",(null==e.switchAmount?null:e.switchAmount.dirty)&&(null==e.switchAmount?null:e.switchAmount.hasError("invalidMinHolding")))}}function tr(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span",42),h.mc(2,"i",32),h.qd(3),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd(" ",(null==e.switchBy?null:e.switchBy.value)===e.transactionConstant.AMOUNT?null==e.switchAmount?null:e.switchAmount.getError("invalidSwitch"):null==e.switchUnits?null:e.switchUnits.getError("invalidSwitch")," ")}}function nr(e,t){if(1&e&&(h.rc(0,"ui-option",43),h.rc(1,"label"),h.rc(2,"
5span",44),h.qd(3),h.qc(),h.mc(4,"br"),h.rc(5,"span",45),h.qd(6),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value),h.Ub(3),h.rd(null==e?null:e.label),h.Ub(3),h.rd(null==e?null:e.desc)}}function ir(e,t){1&e&&(h.rc(0,"span"),h.mc(1,"i",47),h.qd(2,"Please Select a income distribution option for switch buy."),h.qc())}function cr(e,t){if(1&e&&(h.rc(0,"span",42),h.mc(1,"i",47),h.qd(2),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.rd(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.getError("invalidSwitch"))}}function or(e,t){if(1&e&&(h.od(0,ir,3,0,"span",25),h.od(1,cr,3,1,"span",46)),2&e){const e=h.Dc(2);h.Mc("ngIf",(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.dirty)&&(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.hasError("required"))),h.Ub(1),h.Mc("ngIf",(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.dirty)&&(null==e.switchInDividendInstruction?null:e.switchInDividendInstruction.hasError("invalidSwitch")))}}function sr(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"form",14),h.rc(2,"nz-row",15),h.rc(3,"nz-col",16),h.Ec(4,"async"),h.rc(5,"nz-form-item"),h.rc(6,"nz-form-control"),h.rc(7,"ui-input-group",17),h.mc(8,"input",18),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(9,"nz-col",16),h.Ec(10,"async"),h.rc(11,"nz-form-item"),h.rc(12,"nz-form-control",19),h.rc(13,"ui-select",20),h.od(14,kl,1,2,"ui-option",21),h.qc(),h.qc(),h.od(15,Al,2,0,"ng-template",null,22,h.pd),h.qc(),h.qc(),h.qc(),h.od(17,El,2,3,"div",23),h.rc(18,"nz-row",15),h.od(19,Ol,5,3,"nz-col",24),h.Ec(20,"async"),h.od(21,xl,6,3,"nz-col",24),h.Ec(22,"async"),h.od(23,jl,10,9,"nz-col",24),h.od(24,er,10,9,"nz-col",24),h.qc(),h.qc(),h.od(25,tr,4,1,"nz-form-explain",25),h.rc(26,"nz-form-item"),h.rc(27,"nz-form-control"),h.rc(28,"label",26),h.zc("nzCheckedChange",(function(t){return h.dd(e),h.Dc().onSwitchAllCheckChange(t)})),h.qd(29,"Switch All"),h.qc(),h.qc(),h.qc(),h.rc(30,"nz-form-item",27),h.rc(31,"nz-form-control",19),h.rc(32,"ui-select",28),h.od(33,nr,7,4,"ui-option",29),h.qc(),h.qc(),h.od(34,or,2,2,"ng-template",null,30,h.pd),h.qc(),h.qc()}if(2&e){const e=h.ad(16),t=h.ad(35),n=h.Dc();h.Ub(3),h.Mc("nzSpan",h.Fc(4,18,n.isMobile$)?24:8),h.Ub(5),h.Mc("formControl",n.investmentType),h.Ub(1),h.Mc("nzSpan",h.Fc(10,20,n.isMobile$)?24:16),h.Ub(3),h.Mc("nzErrorTip",e),h.Ub(1),h.Mc("formControl",n.switchBuySedolnumber)("nzDropdownMatchSelectWidth",!1),h.Ub(1),h.Mc("ngForOf",n.fundSwitchList),h.Ub(3),h.Mc("ngIf",n.selectedSwitchBuyFund&&n.switchingCalculatorModel),h.Ub(2),h.Mc("ngIf",!h.Fc(20,22,n.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(22,24,n.isMobile$)),h.Ub(2),h.Mc("ngIf",(null==n.switchBy?null:n.switchBy.value)===n.transactionConstant.UNITS),h.Ub(1),h.Mc("ngIf",(null==n.switchBy?null:n.switchBy.value)===n.transactionConstant.AMOUNT),h.Ub(1),h.Mc("ngIf",n.switchAmount.dirty&&n.switchAmount.hasError("invalidSwitch")||(null==n.switchUnits?null:n.switchUnits.dirty)&&(null==n.switchUnits?null:n.switchUnits.hasError("invalidSwitch"))),h.Ub(3),h.Mc("nzChecked",null==n.isSwitchAll?null:n.isSwitchAll.value),h.Ub(3),h.Mc("nzErrorTip",t),h.Ub(1),h.Mc("formControl",n.switchInDividendInstruction)("nzDisabled",n.dividendInstructionEditDisabled),h.Ub(1),h.Mc("ngForOf",n.dividendInstructionList)}}function ar(e,t){if(1&e&&(h.rc(0,"nz-spin",48),h.mc(1,"nz-skeleton",49),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoadingFundFill||e.isLoadingSalesCharge),h.Ub(1),h.Mc("nzActive",!0)("nzLoading",e.isLoadingFundFill||e.isLoadingSalesCharge)}}let lr=(()=>{class e{constructor(e,t,n,i,c,o,s){this.fb=e,this.store=t,this.subHandlingService=n,this.transactionService=i,this.transactionRestService=c,this.passportExpiryNotificationService=o,this.currencyFormatService=s,this.addedFund=[],this.closed=new h.s,this.selectedFundForSwitchBuyChange=new h.s,this.transactionConstant=U.a,this.switchByOption=[{label:"Amount",value:U.a.AMOUNT},{label:"Units",value:U.a.UNITS}],this.twoDecimalPlacesRegex=/^-?\d*[.,]?\d{0,2}$/,this.showTerminateRspMsgModal=!1,this.showedTerminateRspMsgModal=!1,this.showJpyUnavailableModal=!1,this.fepBreached=!1,this.passportNoticeVisible=!1,this.dividendInstructionEditDisabled=!1}set fundSwitchList(e){if(e){this._fundSwitchList=e;const t=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno)));this.subHandlingService.once(t.pipe(Object(y.a)(e=>{var t;this.selectedSwitchBuyFundSedolnumber=null===(t=null==e?void 0:e.find(e=>{var t,n,i;return(null==e?void 0:e.sedolNumber)===(null===(t=this.selectedFund)||void 0===t?void 0:t.productC
5ode)&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)}))||void 0===t?void 0:t.fundSwitchTransactionModel.switchBuySedolnumber,this.selectedSwitchBuyFund=this.fundSwitchList.find(e=>e.sedolnumber===this.selectedSwitchBuyFundSedolnumber),this.getDividendInstructionList()})))}}get fundSwitchList(){return this._fundSwitchList}ngOnInit(){var e,t,n,i,c,o,s,a,l,r,d,h,p,m,f,g,b,S,y,v,M,C,q,T;this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.switchAmountDecimalPlaces=this.currencyFormatService.getDecimalPlaces(null===(e=this.selectedFund)||void 0===e?void 0:e.fundCurrencyCode),this.maxRedemptionAmount=this.currencyFormatService.formatInputNumber((null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)*(null===(n=this.selectedFund)||void 0===n?void 0:n.latestPriceFc),null===(i=this.selectedFund)||void 0===i?void 0:i.fundCurrencyCode),this.form=this.fb.group({investmentType:[{value:"Cash",disabled:!0}],switchBy:[U.a.AMOUNT,[oe.H.required]],switchUnits:["",[oe.H.required,oe.H.pattern(this.twoDecimalPlacesRegex),Object(Oc.q)(null===(c=this.selectedFund)||void 0===c?void 0:c.minRedemptionNum,null===(o=this.selectedFund)||void 0===o?void 0:o.latestPriceFc,null===(s=this.selectedFund)||void 0===s?void 0:s.minRedemptionType,null===(a=this.selectedFund)||void 0===a?void 0:a.availableValue,null===(l=this.selectedFund)||void 0===l?void 0:l.availableQuantity),Object(Oc.n)(null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainNum,null===(d=this.selectedFund)||void 0===d?void 0:d.availableValue,null===(h=this.selectedFund)||void 0===h?void 0:h.availableQuantity,null===(p=this.selectedFund)||void 0===p?void 0:p.latestPriceFc,null===(m=this.selectedFund)||void 0===m?void 0:m.minRetainType)]],switchAmount:["",[oe.H.required,oe.H.pattern(this.currencyFormatService.getInputPattern(null===(f=this.selectedFund)||void 0===f?void 0:f.fundCurrencyCode)),Object(Oc.o)(null===(g=this.selectedFund)||void 0===g?void 0:g.minRedemptionNum,null===(b=this.selectedFund)||void 0===b?void 0:b.latestPriceFc,null===(S=this.selectedFund)||void 0===S?void 0:S.availableValue,null===(y=this.selectedFund)||void 0===y?void 0:y.availableQuantity),Object(Oc.n)(null===(v=this.selectedFund)||void 0===v?void 0:v.minRetainNum,null===(M=this.selectedFund)||void 0===M?void 0:M.availableValue,null===(C=this.selectedFund)||void 0===C?void 0:C.availableQuantity,null===(q=this.selectedFund)||void 0===q?void 0:q.latestPriceFc,null===(T=this.selectedFund)||void 0===T?void 0:T.minRetainType)]],isSwitchAll:[!1],indicativeAmount:[""],salesCharge:[""],switchBuySedolnumber:["",oe.H.required],isWaived:[!1],switchInDividendInstruction:["",oe.H.required]}),this.isUpdate&&this.updateForm(),this.subscribeSwitchBuySedolnumberChange(),this.subscribeSwitchBy(),this.subscribeAmountToSwitch(),this.subscribeUnitsToSwitch()}subscribeSwitchBy(){this.subHandlingService.subscribe(this.switchBy.valueChanges.pipe(Object(y.a)(e=>{var t,n,i,c,o;e===U.a.AMOUNT?(null===(t=this.switchAmount)||void 0===t||t.enable(),null===(n=this.switchUnits)||void 0===n||n.disable(),this.isSwitchAll.patchValue(this.switchAmount.value>=this.maxRedemptionAmount)):(null===(i=this.switchUnits)||void 0===i||i.enable(),null===(c=this.switchAmount)||void 0===c||c.disable(),this.isSwitchAll.patchValue(this.switchUnits.value>=(null===(o=this.selectedFund)||void 0===o?void 0:o.availableQuantity)))})))}subscribeUnitsToSwitch(){this.subHandlingService.subscribe(this.switchUnits.valueChanges.pipe(Object(y.a)(e=>{var t,n,i;this.isSwitchAll.patchValue(e===(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)),e>(null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity)&&this.switchUnits.patchValue(null===(i=this.selectedFund)||void 0===i?void 0:i.availableQuantity,{emitEvent:!1})})))}subscribeAmountToSwitch(){this.subHandlingService.subscribe(this.switchAmount.valueChanges.pipe(Object(ce.a)(500),Object(b.a)(),Object(y.a)(e=>{var t,n;this.isSwitchAll.patchValue(!1),this.currencyFormatService.formatInputNumber(e*(null===(t=this.selectedFund)||void 0===t?void 0:t.latestPriceFc),null===(n=this.selectedFund)||void 0===n?void 0:n.fundCurrencyCode)>this.maxRedemptionAmount&&(this.switchAmount.patchValue(this.maxRedemptionAmount,{emitEvent:!1}),this.isSwitchAll.patchValue(!0))})))}cancelOrRemoveCart(){this.isUpdate&&this.transactionService.removeSwitchCartInfo(this.refno,this.selectedFund),this.closed.emit
5()}get investmentType(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("investmentType")}get switchBy(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchBy")}get switchUnits(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchUnits")}get switchAmount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchAmount")}get isSwitchAll(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isSwitchAll")}get indicativeAmount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("indicativeAmount")}get switchBuySedolnumber(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchBuySedolnumber")}get salesCharge(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("salesCharge")}get isWaived(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isWaived")}get switchInDividendInstruction(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchInDividendInstruction")}addOrUpdateCart(){var e,t,n,i;let c=this.passportExpiryNotificationService.isPersonalAccountPassportExpired();const o=this.refno;let s=!1;if(o&&(s=this.passportExpiryNotificationService.checkPassportExpiredByAccount(o)),c||s)this.passportNoticeVisible=!0;else{if(this.salesCharge.patchValue((null===(e=this.switchingCalculatorModel)||void 0===e?void 0:e.salesChargeStr)?this.switchingCalculatorModel.salesChargeStr:"-"),this.selectedFund.normalRspFund&&this.isSwitchAll.value&&!this.showedTerminateRspMsgModal&&(null===(t=this.selectedFund)||void 0===t?void 0:t.hasActiveRsp))return this.showTerminateRspMsgModal=!0,void(this.showedTerminateRspMsgModal=!0);this.indicativeAmount.patchValue(this.switchBy.value===U.a.AMOUNT?this.currencyFormatService.formatInputNumber(this.switchAmount.value,null===(n=this.selectedFund)||void 0===n?void 0:n.fundCurrencyCode):this.currencyFormatService.formatInputNumber(this.switchUnits.value*this.selectedFund.latestPriceFc,null===(i=this.selectedFund)||void 0===i?void 0:i.fundCurrencyCode)),Object(zn.c)(this.form),this.form.updateValueAndValidity(),this.form.invalid||(this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1),this.validateAndAddOrUpdateCart())}}onSwitchAllCheckChange(e){var t;this.isSwitchAll.patchValue(e),e?(this.switchUnits.setValue(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity),this.switchAmount.setValue(this.maxRedemptionAmount)):(this.switchUnits.setValue(""),this.switchAmount.setValue(""))}closeTerminateRspMsgModal(){this.showTerminateRspMsgModal=!1}updateForm(){var e,t,n,i;const c=null===(e=this.addedFund)||void 0===e?void 0:e.find(e=>{var t,n,i;return e.sedolNumber===(null===(t=this.selectedFund)||void 0===t?void 0:t.productCode)&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)});this.switchAmount.patchValue(null==c?void 0:c.fundSwitchTransactionModel.switchAmount),this.switchUnits.patchValue(null==c?void 0:c.fundSwitchTransactionModel.switchUnit),this.indicativeAmount.patchValue(null==c?void 0:c.indicativeAmount),this.switchBy.patchValue((null==c?void 0:c.fundSwitchTransactionModel.isAmount)?U.a.AMOUNT:U.a.UNITS),null===(t=this.switchInDividendInstruction)||void 0===t||t.patchValue((null===(n=null==c?void 0:c.fundSwitchTransactionModel)||void 0===n?void 0:n.switchInDividendInstruction)||""),this.isSwitchAll.patchValue(this.isCartSwitchAll(c)),this.isInterOrder=null===(i=null==c?void 0:c.fundSwitchTransactionModel)||void 0===i?void 0:i.interOrder}isCartSwitchAll(e){var t;return console.log(e,this.maxRedemptionAmount,this.selectedFund.availableQuantity),(null==e?void 0:e.fundSwitchTransactionModel.switchAmount)===this.maxRedemptionAmount||(null==e?void 0:e.fundSwitchTransactionModel.switchUnit)===(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)}validateAndAddOrUpdateCart(){this.isCheckingForm=!0;let e=this.initSwitchTransactionModel();this.isInterSwitch||e.paymentMethod!==U.a.CHEQUE.toLowerCase()?this.subHandlingService.once(this.validateSwitch(e)):this.massCheckIntraSwitchWaive(e)}validateSwitch(e){var t,n,i;return(null===(t=this.switchBy)||void 0===t?void 0:t.value)===U.a.AMOUNT?e.switchAmount=null===(n=this.switchAmount)||void 0===n?void 0:n.value:e.switchUnit=null===(i=this.switchUnits)||void 0===i?void 0:i.value,this.transactionRestService.validateSwitch(e,this.refno).pipe(Object(y.a)(e=>{var t,n,i;if(this.isCheckingForm=!1,e.status!==M.a.RESPONSE_SUCCESS)return e.errorMessage.includes("foreign.exch
5ange.policy.breached")?void(this.fepBreached=!0):void("Invalid Dividend Instruction"===(null==e?void 0:e.errorMessage)?null===(t=this.switchInDividendInstruction)||void 0===t||t.setErrors({invalidSwitch:null==e?void 0:e.errorMessage}):(null===(n=this.switchBy)||void 0===n?void 0:n.value)===U.a.AMOUNT?this.switchAmount.setErrors({invalidSwitch:null==e?void 0:e.errorMessage}):this.switchUnits.setErrors({invalidSwitch:null==e?void 0:e.errorMessage}));if(this.form.enable(),this.investmentType.patchValue(U.a.CASH),this.isUpdate?this.transactionService.updateSwitchCartInfo(this.form,this.selectedFund,this.selectedSwitchBuyFund):this.transactionService.storeSwitchCart(this.form,this.selectedFund,this.selectedSwitchBuyFund),this.isUpdate&&"cheque"===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)){const e=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno)));this.subHandlingService.once(e.pipe(Object(y.a)(e=>{var t,n,i;const c=null===(n=null===(t=null==e?void 0:e.find(e=>{var t,n;return(null===(t=null==e?void 0:e.fundSwitchTransactionModel)||void 0===t?void 0:t.switchBuySedolnumber)===this.selectedSwitchBuyFundSedolnumber&&(null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod)===(null==e?void 0:e.fundSwitchTransactionModel.paymentMethod)}))||void 0===t?void 0:t.fundSwitchTransactionModel)||void 0===n?void 0:n.switchSellSedolnumber,o=null==e?void 0:e.filter(e=>{var t,n,i,c,o;return(null===(t=null==e?void 0:e.fundSwitchTransactionModel)||void 0===t?void 0:t.switchBuySedolnumber)===this.selectedSwitchBuyFundSedolnumber&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.switchSellSedolnumber)!==(null===(i=this.selectedFund)||void 0===i?void 0:i.productCode)&&(null===(c=this.selectedFund)||void 0===c?void 0:c.paymentMethod)===(null===(o=null==e?void 0:e.fundSwitchTransactionModel)||void 0===o?void 0:o.paymentMethod)});c===(null===(i=this.selectedFund)||void 0===i?void 0:i.productCode)&&(null==o?void 0:o.length)>0&&o.forEach(e=>{var t;let n=Object.assign({},e.fundSwitchTransactionModel);n.switchInDividendInstruction=null===(t=this.switchInDividendInstruction)||void 0===t?void 0:t.value;const i=Object.assign(Object.assign({},e),{fundSwitchTransactionModel:n});this.store.dispatch(new u.rb(this.refno,i))})})))}this.closed.emit()}))}massCheckIntraSwitchWaive(e){this.subHandlingService.once(this.transactionRestService.massCheckIntraSwitchWaive(this.refno,[e]).pipe(Object(E.a)(t=>{var n;if(t.status===M.a.RESPONSE_SUCCESS){if(t){if(t.data[0].notEnoughWaive)return void(this.showInsufficientCreditModal=!0);this.isWaived.patchValue(null===(n=null==t?void 0:t.data[0])||void 0===n?void 0:n.waive),this.isWaived.value&&this.salesCharge.patchValue("0.00%")}return this.validateSwitch(e)}})))}initSwitchTransactionModel(){var e,t,n,i;return{interOrder:this.isInterSwitch,intraOrder:!this.isInterSwitch,isAmount:(null===(e=this.switchBy)||void 0===e?void 0:e.value)===U.a.AMOUNT,switchBuySedolnumber:this.selectedSwitchBuyFundSedolnumber,switchSellSedolnumber:null===(t=this.selectedFund)||void 0===t?void 0:t.productCode,ifastStatus:"NA",paymentMethod:null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod,refno:this.refno,switchChargeDisplay:this.switchingCalculatorModel.salesChargeStr,switchInDividendInstruction:null===(i=this.switchInDividendInstruction)||void 0===i?void 0:i.value}}subscribeSwitchBuySedolnumberChange(){var e;this.subHandlingService.subscribe(null===(e=this.switchBuySedolnumber)||void 0===e?void 0:e.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t;if(e){const n=null===(t=this.fundSwitchList)||void 0===t?void 0:t.find(t=>t.sedolnumber===e),i=null==n?void 0:n.fundCurrencyCode;if(i===U.a.PAYMENT_CURRENCY_JPY){if(!this.store.selectSnapshot(a.a.isWhitelistLoaded))return void this.subHandlingService.once(this.store.select(a.a.isWhitelistLoaded).pipe(Object(aa.a)(e=>!!e),Object(y.a)(()=>{this.store.selectSnapshot(a.a.isJpyFundRestricted(i))?this.handleJpyRestricted():this.proceedSwitchBuySelection(e,n)})));if(this.store.selectSnapshot(a.a.isJpyFundRestricted(i)))return void this.handleJpyRestricted()}this.proceedSwitchBuySelection(e,n)}})))}handleJpyRestricted(){this.showJpyUnavailableModal=!0,this.switchBuySedolnumber.patchValue("",{emitEvent:!1}),this.selectedSwitchBuyFund=null,this.selectedSwitchBuyFundSedolnumber=""}proceedSwitchBuySelection(e,t){var n;this.selectedFundForSwitchBuyChange.emit(e),this.selectedSwitchBuyFundSedolnumber=e,this.selectedSwitchBuyFund=t,this.isInterOrder=null===(n=this.selectedSwitchBuyFund)||void 0===n?void 0:n.interList,this.getDividendInstructionList(!0)}getDividendInstructionList(e){var t,n,i;if(this.selectedSwitchBuyFund){let c=this.selectedSwitchBuyFund.dividendOption;if("cheque"===(null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod)){const t=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno)));this.subHandlingService.once(t.pipe(Object(y.a)(t=>{var n,i,o,s,a,l;const r=null==t?void 0:t.find(e=>{var t,n,i;return(null===(t=null==e?void 0:e.fundSwitchTransactionModel)||void 0===t?void 0:t.switchBuySedolnumber)===this.selectedSwitchBuyFundSedolnumber&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)});let d=(null===(n=null==r?void 0:r.fundSwitchTransactionModel)||void 0===n?void 0:n.switchSellSedolnumber)===(null===(i=this.selectedFund)||void 0===i?void 0:i.productC
5ode)&&(null===(o=null==r?void 0:r.fundSwitchTransactionModel)||void 0===o?void 0:o.paymentMethod)===(null===(s=this.selectedFund)||void 0===s?void 0:s.paymentMethod);const u=null===(a=null==r?void 0:r.fundSwitchTransactionModel)||void 0===a?void 0:a.switchInDividendInstruction;this.isInterOrder||"Both"!==c||(c=null===(l=this.selectedFund)||void 0===l?void 0:l.dividendInstruction),this.dividendInstructionList=this.getDividendInstructionOptions(!d&&u?u:c),!d&&u?this.switchInDividendInstruction.patchValue(u):e&&this.switchInDividendInstruction.patchValue(this.dividendInstructionList[0].value)})))}else c=U.a.DIVIDEND_OPTIONS.Reinvest.value,this.dividendInstructionList=this.getDividendInstructionOptions(c),e&&this.switchInDividendInstruction.patchValue(this.dividendInstructionList[0].value);this.dividendInstructionEditDisabled=!1,(1===(null===(n=this.dividendInstructionList)||void 0===n?void 0:n.length)||!this.isInterOrder&&"Both"===(null===(i=this.selectedSwitchBuyFund)||void 0===i?void 0:i.dividendOption))&&(this.dividendInstructionEditDisabled=!0)}}getDividendInstructionOptions(e){let t=[];if(e)switch(e){case U.a.DIVIDEND_OPTIONS.Cash.value:t.push(U.a.DIVIDEND_OPTIONS.Cash);break;case U.a.DIVIDEND_OPTIONS.Reinvest.value:t.push(U.a.DIVIDEND_OPTIONS.Reinvest);break;case"Both":t.push(U.a.DIVIDEND_OPTIONS.Reinvest),t.push(U.a.DIVIDEND_OPTIONS.Cash)}else t.push(U.a.DIVIDEND_OPTIONS.Reinvest);return t}onInsufficientCreditModalClosed(){this.showInsufficientCreditModal=!1;let e=this.initSwitchTransactionModel();this.subHandlingService.once(this.validateSwitch(e))}onCloseJpyUnavailableModal(){this.showJpyUnavailableModal=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(s.i),h.lc(l.a),h.lc(C.a),h.lc(T.a),h.lc(vt.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["switch-cmf-fund-fill-detail-form"]],inputs:{selectedFund:"selectedFund",isUpdate:"isUpdate",addedFund:"addedFund",isLoadingFundFill:"isLoadingFundFill",isLoadingSalesCharge:"isLoadingSalesCharge",switchingCalculatorModel:"switchingCalculatorModel",isInterSwitch:"isInterSwitch",fundSwitchList:"fundSwitchList"},outputs:{closed:"closed",selectedFundForSwitchBuyChange:"selectedFundForSwitchBuyChange"},features:[h.Tb([l.a])],decls:24,vars:18,consts:[[1,"mb-4"],[3,"selectedFund"],[4,"ngIf","ngIfElse"],["loadingTemplate",""],[3,"showTerminateRspMsgModal","isSwitch","closeTerminateRspMsgModal"],[1,"text-right"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",3,"nzLoading","click"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"nzLoading","click"],[3,"showInsufficientCreditModal","closeInsufficientCreditModal"],[3,"showModal","refno","showModalChange"],[3,"modalVisible","isPopUp","footerFunc","onOkEmit","onUpdateEmit"],[3,"visible","closeModal"],["nz-form",""],["nzType","flex","nzGutter","16"],[3,"nzSpan"],["nzLabelPlaceholder","Investment Type","disabled","",1,"w-100"],["ui-input","",3,"formControl"],[3,"nzErrorTip"],["nzShowSearch","","nzPlaceHolder","Select Fund to Switch Buy",1,"w-100",3,"formControl","nzDropdownMatchSelectWidth"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["buySedolError",""],["class","mb-2",4,"ngIf"],[3,"nzSpan",4,"ngIf"],[4,"ngIf"],["nz-checkbox","",3,"nzChecked","nzCheckedChange"],[1,"mb-2"],["nzShowSearch","","nzPlaceHolder","Income Distribution Option",1,"w-100",3,"formControl","nzDisabled"],["nzCustomContent","","class","text-wrap",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["dividendInstructionError",""],[3,"nzLabel","nzValue"],["nz-icon","","nzType","info-circle","nzTheme","fill"],[3,"switchingCalculatorModel","selectedSwitchBuyFund","isInterSwitch"],["nzPlaceHolder","Switch By",1,"w-100",3,"formControl"],["nzButtonStyle","solid","nzSize","small",1,"my-3",3,"formControl"],["nz-radio-button","","class","px-4",3,"nzValue",4,"ngFor","ngForOf"],["nz-radio-button","",1,"px-4",3,"nzValue"],[3,"nzLabelPlaceholder"],["ui-input","","type","number",3,"formControl"],["unitMinRedempError",""],["unitMinRetainError",""],[1,"text-danger"],["nzCustomContent","",1,"text-wrap",3,"nzLabel","nzValue"],[1,"text-sm","font-weight-bold"],[1,"text-xs","font-weight-normal"],["class","text-danger",4,"ngIf"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzActive","nzLoading"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.mc(1,"sell-fund-detail-info",1),h.qc(),h.rc(2,"
5strong"),h.qd(3,"Enter Switching Details"),h.qc(),h.od(4,sr,36,26,"div",2),h.od(5,ar,2,3,"ng-template",null,3,h.pd),h.rc(7,"terminate-rsp-msg-modal",4),h.zc("closeTerminateRspMsgModal",(function(){return t.closeTerminateRspMsgModal()})),h.qc(),h.rc(8,"app-web-scaffold"),h.rc(9,"div",5),h.rc(10,"button",6),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(11),h.qc(),h.rc(12,"button",7),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(13),h.qc(),h.qc(),h.qc(),h.rc(14,"app-mobile-scaffold"),h.rc(15,"b2c-floating-bar"),h.rc(16,"button",8),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(17),h.qc(),h.rc(18,"button",9),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(19),h.qc(),h.qc(),h.qc(),h.rc(20,"app-insufficient-credit-modal",10),h.zc("closeInsufficientCreditModal",(function(){return t.onInsufficientCreditModalClosed()})),h.qc(),h.rc(21,"fep-breached-modal",11),h.zc("showModalChange",(function(e){return t.fepBreached=e})),h.qc(),h.rc(22,"passport-expiry-notification",12),h.zc("onOkEmit",(function(){return t.passportNoticeVisible=!1}))("onUpdateEmit",(function(){return t.passportNoticeVisible=!1})),h.qc(),h.rc(23,"app-jpy-fund-unavailable-modal",13),h.zc("closeModal",(function(){return t.onCloseJpyUnavailableModal()})),h.qc()),2&e){const e=h.ad(6);h.Ub(1),h.Mc("selectedFund",t.selectedFund),h.Ub(3),h.Mc("ngIf",!t.isLoadingFundFill)("ngIfElse",e),h.Ub(3),h.Mc("showTerminateRspMsgModal",t.showTerminateRspMsgModal)("isSwitch",!0),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoadingFundFill||t.isLoadingSalesCharge||t.isCheckingForm),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoadingFundFill||t.isLoadingSalesCharge||t.isCheckingForm),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(1),h.Mc("showInsufficientCreditModal",t.showInsufficientCreditModal),h.Ub(1),h.Mc("showModal",t.fepBreached)("refno",t.refno),h.Ub(1),h.Mc("modalVisible",t.passportNoticeVisible)("isPopUp",!1)("footerFunc",!0),h.Ub(1),h.Mc("visible",t.showJpyUnavailableModal)}},directives:[to,p.t,oo,B.a,_.a,z.a,Se.a,pa,$.a,dt.a,ma.a,oe.J,oe.u,oe.v,se.b,P.c,P.a,se.e,se.a,ae.c,oe.c,ae.b,oe.t,oe.i,Lt.d,p.s,lo.a,Lt.a,k.b,Za,Ut.c,Ut.a,oe.z,se.c,Il.a,W.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function rr(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-app-bar",3),h.zc("back",(function(){return h.dd(e),h.Dc().onBack()})),h.qc()}2&e&&h.Mc("title","Edit Cart")}function dr(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row",7),h.rc(1,"nz-col",8),h.rc(2,"h3",9),h.qd(3),h.qc(),h.qc(),h.rc(4,"nz-col",10),h.rc(5,"i",11),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," ")}}function ur(e,t){if(1&e){const e=h.sc();h.rc(0,"switch-cmf-fund-fill-detail-form",12),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onCancel()}))("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc(2).onSelectedFundForSwitchBuy(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("fundSwitchList",e.fundSwitchList)("isInterSwitch",e.isInterSwitch)("switchingCalculatorModel",e.switchingCalculatorModel)}}function hr(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",4),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.od(1,dr,6,1,"nz-row",5),h.od(2,ur,1,8,"switch-cmf-fund-fill-detail-form",6),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzMaskClosable",!0)("nzClosable",!1)("nzWrapClassName","vertical-center-modal")("nzFooter",null)("nzWidth",600)("nzVisible",e.show),h.Ub(1),h.Mc("ngIf",e.selectedFund),h.Ub(1),h.Mc("ngIf",e.show)}}function pr(e,t){if(1&e){const e=h.sc();h.rc(0,"switch-cmf-fund-fill-detail-form",12),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onCancel()}))("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc(2).onSelectedFundForSwitchBuy(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("fundSwitchList",e.fundSwitchList)("isInterSwitch",e.isInterSwitch)("switchingCalculatorModel",e.switchingCalculatorModel)}}function mr(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",13),h.rc(2,"div",14),h.rc(3,"h3",9),h.qd(4),h.qc(),h.qc(),h.rc(5,"div",15),h.od(6,pr,1,8,"switch-cmf-fund-fill-detail-form",6),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc();h.Ub(4),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," "),h.Ub(2),h.Mc("ngIf",e.show)}}let fr=(()=>{class e{constructor(){this.addedFund=[],this.fundSwitchList=[],this.closed=new h.s,this.bankRequired=new h.s,this.selectedFundForSwitchBuyChange=new h.s,this.appBarBack=new h.s}ngOnInit(){}
5onCancel(){this.closed.emit()}onSelectedFundForSwitchBuy(e){this.selectedFundForSwitchBuyChange.emit(e)}onBack(){this.appBarBack.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["switch-cmf-fund-fill-detail"]],inputs:{show:"show",selectedFund:"selectedFund",isUpdate:"isUpdate",addedFund:"addedFund",fundSwitchList:"fundSwitchList",isLoadingFundFill:"isLoadingFundFill",isLoadingSalesCharge:"isLoadingSalesCharge",switchingCalculatorModel:"switchingCalculatorModel",isInterSwitch:"isInterSwitch"},outputs:{closed:"closed",bankRequired:"bankRequired",selectedFundForSwitchBuyChange:"selectedFundForSwitchBuyChange",appBarBack:"appBarBack"},decls:7,vars:7,consts:[[3,"title","back",4,"ngIf"],[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel",4,"ngIf"],[4,"ngIf"],[3,"title","back"],[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel"],["nzType","flex","nzAlign","top",4,"ngIf"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","closed","selectedFundForSwitchBuyChange",4,"ngIf"],["nzType","flex","nzAlign","top"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","closed","selectedFundForSwitchBuyChange"],[1,"bg-white","shadow","mb-6"],[1,"container"],[1,"p-3","mb-6"]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,rr,1,1,"b2c-app-bar",0),h.qc(),h.od(2,hr,3,8,"nz-modal",1),h.Ec(3,"async"),h.rc(4,"app-mobile-scaffold"),h.od(5,mr,7,2,"ng-container",2),h.Ec(6,"async"),h.qc()),2&e&&(h.Ub(1),h.Mc("ngIf",t.show),h.Ub(1),h.Mc("ngIf",!h.Fc(3,3,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(6,5,t.isMobile$)&&t.show))},directives:[z.a,p.t,Bt.a,j.a,P.c,P.a,k.b,lr],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function gr(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"(PRS_GOV)"),h.qc())}function br(e,t){if(1&e&&(h.rc(0,"nz-row",15),h.rc(1,"nz-col",16),h.mc(2,"i",17),h.qc(),h.rc(3,"nz-col",18),h.qd(4),h.od(5,gr,2,0,"span",19),h.qd(6," with equivalent percentage in this transaction. "),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(4),h.sd(" Please note that switching of the selected fund will also switch ",e.selectedFund.productName," "),h.Ub(1),h.Mc("ngIf","PRS"===e.selectedFund.paymentMethod)}}function Sr(e,t){if(1&e&&h.mc(0,"ui-option",39),2&e){const e=t.$implicit;h.Mc("nzLabel",e.fundName)("nzValue",e.sedolnumber)}}function yr(e,t){1&e&&(h.mc(0,"i",40),h.qd(1," Please Select a Fund for switch buy. "))}function vr(e,t){if(1&e&&(h.rc(0,"div",23),h.mc(1,"switch-fund-detail-info",41),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("switchingCalculatorModel",e.switchingCalculatorModel)("selectedSwitchBuyFund",e.selectedSwitchBuyFund)("isInterSwitch",e.isInterSwitch)}}function Mr(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",40),h.qd(2," Please Enter Value With 2 Decimal Places. "),h.qc())}function Cr(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The Min Redemption is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRedemptionNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function qr(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd("The Min Redemption is ",null==e.selectedFund?null:e.selectedFund.minRedemptionNum," units.")}}function Tr(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",40),h.od(3,Cr,3,4,"span",4),h.qc(),h.od(4,qr,2,1,"ng-template",null,42,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(2);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRedemptionType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function wr(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The Min Retain is ",h.Gc(2,1,null==e.selectedFund?null:e.selectedFund.minRetainNum,null==e.selectedFund?null:e.selectedFund.fundCurrencyCode)," ")}}function zr(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.sd(" The Min Retain is ",null==e.selectedFund?null:e.selectedFund.minRetainNum," units.")}}function Dr(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",40),h.od(3,wr,3,4,"span",4),h.qc(),h.od(4,zr,2,1,"ng-template",null,43,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(2);h.Ub(3),h.Mc("ngIf",(null==t.selectedFund?null:t.selectedFund.minRetainType)===t.transactionConstant.AMOUNT)("ngIfElse",e)}}function Pr(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span",44),h.mc(2,"i",40),h.qd(3),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd(" ",null==e.switchUnits?null:e.switchUnits.getError("invalidSwitch")," ")}}function Ir(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"form",20),h.rc(2,"nz-row",21),h.rc(3,"nz-col",22),h.Ec(4,"async"),h.rc(5,"form",20),h.rc(6,"nz-form-item",23),h.rc(7,"nz-form-control"),h.rc(8,"ui-input-group",24),h.mc(9,"input",25),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(10,"nz-col",22),h.Ec(11,"async"),h.rc(12,"nz-form-item",23),h.rc(13,"nz-form-control",26),h.rc(14,"ui-select",27),h.od(15,Sr,1,2,"ui-option",28),h.qc(),h.qc(),h.od(16,yr,2,0,"ng-template",null,29,h.pd),h.qc(),h.qc(),h.qc(),h.od(18,vr,2,3,"div",30),h.rc(19,"nz-row",31),h.rc(20,"nz-col",22),h.Ec(21,"async"),h.rc(22,"nz-form-item",23),h.rc(23,"nz-form-control"),h.rc(24,"ui-input-group",32),h.mc(25,"input",33),h.qc(),h.od(26,Mr,3,0,"nz-form-explain",19),h.od(27,Tr,6,2,"nz-form-explain",19),h.od(28,Dr,6,2,"nz-form-explain",19),h.qc(),h.qc(),h.qc(),h.rc(29,"nz-col",22),h.Ec(30,"async"),h.rc(31,"nz-form-item",23),h.rc(32,"nz-form-control"),h.rc(33,"ui-input-group",34),h.mc(34,"input",25),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.od(35,Pr,4,1,"nz-form-explain",19),h.rc(36,"nz-form-item"),h.rc(37,"nz-form-control",35),h.rc(38,"label",36),h.zc("nzCheckedChange",(function(t){return h.dd(e),h.Dc().onSwitchAllCheckChange(t)}
5)),h.qd(39,"Switch All"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(40,"nz-row"),h.rc(41,"nz-col",22),h.Ec(42,"async"),h.mc(43,"app-fund-detail-info-statistic",37),h.qc(),h.rc(44,"nz-col",22),h.Ec(45,"async"),h.mc(46,"app-fund-detail-info-statistic",38),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.ad(17),t=h.Dc();h.Ub(1),h.Mc("formGroup",t.form),h.Ub(2),h.Mc("nzSpan",h.Fc(4,24,t.isMobile$)?24:8),h.Ub(2),h.Mc("formGroup",t.form),h.Ub(4),h.Mc("formControl",t.investmentType),h.Ub(1),h.Mc("nzSpan",h.Fc(11,26,t.isMobile$)?24:16),h.Ub(3),h.Mc("nzErrorTip",e),h.Ub(1),h.Mc("formControl",t.switchBuySedolnumber)("nzDropdownMatchSelectWidth",!1),h.Ub(1),h.Mc("ngForOf",t.fundSwitchList),h.Ub(3),h.Mc("ngIf",t.selectedSwitchBuyFund&&t.switchingCalculatorModel),h.Ub(2),h.Mc("nzSpan",h.Fc(21,28,t.isMobile$)?24:8),h.Ub(4),h.Mc("nzLabelPlaceholder",t.selectedFund.switchEnablePercent==t.appConstant.YES_FLAG?"Switch Percentage":"Units To Switch Sell"),h.Ub(1),h.Mc("formControl",t.switchUnits),h.Ub(1),h.Mc("ngIf",(null==t.switchUnits?null:t.switchUnits.dirty)&&(null==t.switchUnits?null:t.switchUnits.hasError("pattern"))),h.Ub(1),h.Mc("ngIf",(null==t.switchUnits?null:t.switchUnits.dirty)&&(null==t.switchUnits?null:t.switchUnits.hasError("invalidMinRedemption"))),h.Ub(1),h.Mc("ngIf",(null==t.switchUnits?null:t.switchUnits.dirty)&&(null==t.switchUnits?null:t.switchUnits.hasError("invalidMinHolding"))),h.Ub(1),h.Mc("nzSpan",h.Fc(30,30,t.isMobile$)?24:16),h.Ub(5),h.Mc("formControl",t.indicativeAmount),h.Ub(1),h.Mc("ngIf",(null==t.switchUnits?null:t.switchUnits.dirty)&&(null==t.switchUnits?null:t.switchUnits.hasError("invalidSwitch"))),h.Ub(3),h.Mc("nzChecked",null==t.isSwitchAll?null:t.isSwitchAll.value),h.Ub(3),h.Mc("nzSpan",h.Fc(42,32,t.isMobile$)?24:11),h.Ub(2),h.Mc("value",t.availableUnitsAccA),h.Ub(1),h.Mc("nzSpan",h.Fc(45,34,t.isMobile$)?24:11),h.Ub(2),h.Mc("value",t.availableUnitsAccB)}}function kr(e,t){if(1&e&&h.mc(0,"nz-skeleton",45),2&e){const e=h.Dc();h.Mc("nzActive",!0)("nzLoading",e.isLoadingFundFill||e.isLoadingSalesCharge)}}const Ar=/^-?\d*[.,]?\d{0,2}$/;let Er=(()=>{class e{constructor(e,t,n,i,c,o,s,a){this.fb=e,this.store=t,this.subHandlingService=n,this.transactionService=i,this.transactionRestService=c,this.notificationService=o,this.passportExpiryNotificationService=s,this.currencyFormatService=a,this.isVisible=!1,this.addedFund=[],this.closed=new h.s,this.selectedFundForSwitchBuyChange=new h.s,this.noSwitchFunds=new h.s,this.showTerminateRspMsgModal=!1,this.transactionConstant=U.a,this.isCheckingForm=!1,this.showedTerminateRspMsgModal=!1,this.appConstant=M.a,this.fepBreached=!1,this.passportNoticeVisible=!1}set selectedFund(e){e&&(this._selectedFund=e,this.form=this.initForm(),this.setFormInitValue())}get selectedFund(){return this._selectedFund}set fundSwitchList(e){if(e&&(null==e?void 0:e.length)>0){this._fundSwitchList=e;const t=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno)));this.subHandlingService.once(t.pipe(Object(y.a)(e=>{var t;this.selectedSwitchFund=null===(t=null==e?void 0:e.find(e=>{var t,n,i;return(null==e?void 0:e.sedolNumber)===(null===(t=this.selectedFund)||void 0===t?void 0:t.productCode)&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)}))||void 0===t?void 0:t.fundSwitchTransactionModel.switchBuySedolnumber,this.selectedSwitchBuyFund=this.fundSwitchList.find(e=>e.sedolnumber===this.selectedSwitchFund),this.setFormInitValue()}))),this.subscribeSwitchBuySedolnumberChange(),this.subscribeUnitToSwitch()}0!=(null==e?void 0:e.length)||this.isUpdate||this.noSwitchFunds.emit()}get fundSwitchList(){return this._fundSwitchList}ngOnInit(){this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),console.log(this.selectedFund)}addOrUpdateCart(){var e,t;let n=this.passportExpiryNotificationService.isPersonalAccountPassportExpired();const i=this.store.selectSnapshot(u.X.getSelectedRefno);let c=!1;if(i&&(c=this.passportExpiryNotificationService.checkPassportExpiredByAccount(i)),n||c)this.passportNoticeVisible=!0;else if(this.salesCharge.patchValue((null===(e=this.switchingCalculatorModel)||void 0===e?void 0:e.salesChargeStr)?this.switchingCalculatorModel.salesChargeStr:"-"),Object(zn.c)(this.form),this.form.updateValueAndValidity(),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),!this.form.invali
5d){if(this.selectedFund.normalRspFund&&this.isSwitchAll.value&&!this.showedTerminateRspMsgModal&&(null===(t=this.selectedFund)||void 0===t?void 0:t.hasActiveRsp))return this.showTerminateRspMsgModal=!0,void(this.showedTerminateRspMsgModal=!0);this.selectedFund.continueRsp=!0,this.showedTerminateRspMsgModal&&(this.selectedFund.continueRsp=!1),this.validateAndAddOrUpdateCart()}}validateAndAddOrUpdateCart(){this.isCheckingForm=!0;let e=this.initSwitchTransactionModel();this.isInterSwitch||e.paymentMethod!==U.a.CHEQUE.toLowerCase()?this.subHandlingService.once(this.validateSwitch(e)):this.massCheckIntraSwitchWaive(e)}validateSwitch(e){return this.transactionRestService.validateSwitch(e,this.refno).pipe(Object(y.a)(e=>{var t,n;if(this.isCheckingForm=!1,e.status!==M.a.RESPONSE_SUCCESS){if("Invalid switch type"==(null==e?void 0:e.errorMessage))return;return e.errorMessage.includes("foreign.exchange.policy.breached")?void(this.fepBreached=!0):void(null===(t=this.switchUnits)||void 0===t||t.setErrors({invalidSwitch:null==e?void 0:e.errorMessage}))}this.isUnit.patchValue((null===(n=this.selectedFund)||void 0===n?void 0:n.switchEnablePercent)!=M.a.YES_FLAG),this.form.enable(),this.investmentType.patchValue(U.a.CASH),console.log(this.form),this.isUpdate?this.transactionService.updateSwitchCartInfo(this.form,this.selectedFund,this.selectedSwitchBuyFund):this.transactionService.storeSwitchCart(this.form,this.selectedFund,this.selectedSwitchBuyFund),this.closed.emit()}))}massCheckIntraSwitchWaive(e){this.subHandlingService.once(this.transactionRestService.massCheckIntraSwitchWaive(this.refno,[e]).pipe(Object(E.a)(t=>{var n;if(t.status===M.a.RESPONSE_SUCCESS){if(t){if(t.data[0].notEnoughWaive)return void(this.showInsufficientCreditModal=!0);this.isWaived.patchValue(null===(n=null==t?void 0:t.data[0])||void 0===n?void 0:n.waive),this.isWaived.value&&this.salesCharge.patchValue("0.00%")}return this.validateSwitch(e)}})))}initSwitchTransactionModel(){var e,t,n,i,c,o,s,a;return{interOrder:!1,intraOrder:!0,switchBuySedolnumber:this.selectedSwitchFund,switchSellSedolnumber:null===(e=this.selectedFund)||void 0===e?void 0:e.productCode,ifastStatus:"NA",paymentMethod:null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod,refno:this.refno,switchUnit:null===(n=this.switchUnits)||void 0===n?void 0:n.value,switchPercent:(null===(i=this.selectedFund)||void 0===i?void 0:i.switchEnablePercent)==M.a.YES_FLAG?+(+(null===(c=this.switchUnits)||void 0===c?void 0:c.value)).toFixed():(null===(o=this.switchUnits)||void 0===o?void 0:o.value)/(null===(s=this.selectedFund)||void 0===s?void 0:s.availableQuantity)*100,isUnit:(null===(a=this.selectedFund)||void 0===a?void 0:a.switchEnablePercent)!==M.a.YES_FLAG,switchChargeDisplay:this.switchingCalculatorModel.salesChargeStr}}cancelOrRemoveCart(){this.isUpdate&&this.transactionService.removeSwitchCartInfo(this.refno,this.selectedFund),this.closed.emit()}closeTerminateRspMsgModal(){this.showTerminateRspMsgModal=!1}onCancel(){this.closed.emit()}initForm(){var e,t,n,i,c,o,s,a,l,r,d,u,h,p,m;return this.fb.group({investmentType:[{value:U.a.CASH,disabled:!0},[oe.H.required]],switchUnits:this.selectedFund.switchEnablePercent==M.a.YES_FLAG?["",[oe.H.required,oe.H.pattern(Ar),Object(Oc.m)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRetainNum,null===(t=this.selectedFund)||void 0===t?void 0:t.availableValue),Object(Oc.p)(null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionNum,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue)]]:["",[oe.H.required,oe.H.pattern(Ar),Object(Oc.n)(null===(c=this.selectedFund)||void 0===c?void 0:c.minRetainNum,null===(o=this.selectedFund)||void 0===o?void 0:o.availableValue,null===(s=this.selectedFund)||void 0===s?void 0:s.availableQuantity,null===(a=this.selectedFund)||void 0===a?void 0:a.lastestPrice,null===(l=this.selectedFund)||void 0===l?void 0:l.minRetainType),Object(Oc.q)(null===(r=this.selectedFund)||void 0===r?void 0:r.minRedemptionNum,null===(d=this.selectedFund)||void 0===d?void 0:d.lastestPrice,null===(u=this.selectedFund)||void 0===u?void 0:u.minRedemptionType,null===(h=this.selectedFund)||void 0===h?void 0:h.availableValue,null===(p=this.selectedFund)||void 0===p?void 0:p.availableQuantity)]],indicativeAmount:[{value:0,disabled:!0}],isSwitchAll:[!1],isPrs:[!0,[oe.H.required]],salesCharge:[(null===(m=this.switchingCalculatorModel)||void 0===m?void 0:m.salesChargeStr)?this.switchingCalculatorModel.salesChargeStr:"-"],switchBuySedolnumber:["",oe.H.required],isUnit:[!1],isWaived:[!1],switchBuyTransDate:"",switchSellTransDate:""})}setFormInitValue(){var e,t,n,i,c,o,s,a;const l=null===(e=this.selectedFund)||void 0===e?void 0:e.productC
5ode,r=null===(t=this.switchCarts)||void 0===t?void 0:t.find(e=>{var t,n;return e.sedolNumber===l&&(null===(t=null==e?void 0:e.fundSwitchTransactionModel)||void 0===t?void 0:t.paymentMethod)===(null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod)}),d=null===(n=this.addedFund)||void 0===n?void 0:n.find(e=>{var t,n,i;return e.sedolNumber===(null===(t=this.selectedFund)||void 0===t?void 0:t.productCode)&&(null===(n=null==e?void 0:e.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)});this.isSwitchAll.reset(),this.investmentType.patchValue("Cash"),null===(i=this.switchBuySedolnumber)||void 0===i||i.patchValue(this.isUpdate?null==d?void 0:d.fundSwitchTransactionModel.switchBuySedolnumber:""),this.switchUnits.patchValue(this.isUpdate?null===(c=null==d?void 0:d.fundSwitchTransactionModel)||void 0===c?void 0:c.switchUnit:""),this.indicativeAmount.patchValue(this.isUpdate?this.currencyFormatService.formatInputNumber(null==d?void 0:d.indicativeAmount,null===(o=this.selectedFund)||void 0===o?void 0:o.fundCurrencyCode):""),this.isSwitchAll.patchValue(!!this.isUpdate&&(null==r?void 0:r.fundSwitchTransactionModel.switchUnit)===(null===(s=this.selectedFund)||void 0===s?void 0:s.availableQuantity)),this.setAccountABValue(),(null===(a=this.selectedFund)||void 0===a?void 0:a.switchEnablePercent)==M.a.YES_FLAG&&this.switchUnits.patchValue((+this.switchUnits.value).toFixed())}onSwitchAllCheckChange(e){var t,n;this.isSwitchAll.patchValue(e),e?(this.setSwitchUnitNoDpValidators(),(null===(t=this.selectedFund)||void 0===t?void 0:t.switchEnablePercent)===M.a.YES_FLAG?this.switchUnits.patchValue(100):this.switchUnits.patchValue(null===(n=this.selectedFund)||void 0===n?void 0:n.availableQuantity)):(this.setSwitchUnitWithDpValidators(),this.switchUnits.patchValue(""))}subscribeUnitToSwitch(){var e;this.subHandlingService.subscribe(null===(e=this.switchUnits)||void 0===e?void 0:e.valueChanges.pipe(Object(ce.a)(300),Object(b.a)(),Object(y.a)(e=>{var t,n,i,c,o,s,a,l,r,d,u,h,p,m,f,g,b,S;let y=this.selectedFund.switchEnablePercent==M.a.YES_FLAG?e/100*(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity)*(null===(n=this.selectedFund)||void 0===n?void 0:n.lastestPrice):e*(null===(i=this.selectedFund)||void 0===i?void 0:i.lastestPrice);this.indicativeAmount.patchValue(this.currencyFormatService.formatInputNumber(y,null===(c=this.selectedFund)||void 0===c?void 0:c.fundCurrencyCode)),this.setAccountABValue(),(null===(o=this.selectedFund)||void 0===o?void 0:o.switchEnablePercent)==M.a.YES_FLAG&&this.switchUnits.patchValue((+this.switchUnits.value).toFixed(),{emitEvent:!1}),e>=(null===(s=this.selectedFund)||void 0===s?void 0:s.availableQuantity)&&(null===(a=this.selectedFund)||void 0===a?void 0:a.switchEnablePercent)!==M.a.YES_FLAG?(this.setSwitchUnitNoDpValidators(),this.switchUnits.patchValue(null===(l=this.selectedFund)||void 0===l?void 0:l.availableQuantity,{emitEvent:!1}),null===(r=this.isSwitchAll)||void 0===r||r.patchValue(!0),y=(null===(d=this.selectedFund)||void 0===d?void 0:d.availableQuantity)*(null===(u=this.selectedFund)||void 0===u?void 0:u.lastestPrice),this.indicativeAmount.patchValue(this.currencyFormatService.formatInputNumber(y,null===(h=this.selectedFund)||void 0===h?void 0:h.fundCurrencyCode))):e>=100&&(null===(p=this.selectedFund)||void 0===p?void 0:p.switchEnablePercent)==M.a.YES_FLAG?(this.switchUnits.patchValue(100,{emitEvent:!1}),null===(m=this.isSwitchAll)||void 0===m||m.patchValue(!0),y=(null===(f=this.selectedFund)||void 0===f?void 0:f.availableQuantity)*(null===(g=this.selectedFund)||void 0===g?void 0:g.lastestPrice),this.indicativeAmount.patchValue(this.currencyFormatService.formatInputNumber(y,null===(b=this.selectedFund)||void 0===b?void 0:b.fundCurrencyCode))):(this.setSwitchUnitWithDpValidators(),null===(S=this.isSwitchAll)||void 0===S||S.patchValue(!1))})))}subscribeSwitchBuySedolnumberChange(){var e;this.subHandlingService.subscribe(null===(e=this.switchBuySedolnumber)||void 0===e?void 0:e.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t;e&&(this.selectedSwitchFund=e,this.selectedFundForSwitchBuyChange.emit(this.selectedSwitchFund),this.selectedSwitchBuyFund=null===(t=this.fundSwitchList)||void 0===t?void 0:t.find(t=>t.sedolnumber===e),this.calculateSwitchingTransactionDate())})))}setAccountABValue(){var e,t,n,i,c,o;this.availableUnitsAccA="PRS_GOV"==this.selectedFund.paymentMethod?(null===(e=this.selectedFund)||void 0===e?void 0:e.switchEnablePercent)==M.a.YES_FLAG?this.switchUnits.value/100*(null===(t=this.selectedFund)||void 0===t?void 0:t.availableQuantity):this.switchUnits.value:(null===(n=this.selectedFund)||void 0===n?void 0:n.switchEnablePercent)==M.a.YES_FLAG?Object(Uc.b)(.7*this.switchUnits.value/100*(null===(i=this.selectedFund)||void 0===i?void 0:i.availableQuantity)):Object(Uc.b)(this.switchUnits.value/100*70),this.availableUnitsAccB="PRS_GOV"==this.selectedFund.paymentMethod?0:(null===(c=this.selectedFund)||void 0===c?void 0:c.switchEnablePercent)==M.a.YES_FLAG?Object(Uc.b)(.3*this.switchUnits.value/100*(null===(o=this.selectedFund)||void 0===o?void 0:o.availableQuantity)):Object(Uc.b)(this.switchUnits.value/100*30)}get investmentType(){return this.form.get("investmentType")}get switchUnits(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchUnits")}get indicativeAmount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("indicativeAmount")}get isSwitchAll(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isSwitchAll")}get isPrs(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isPrs")}get salesCharge(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("salesCharge")}get switchBuySedolnumber(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchBuySedolnumber")}get isUnit(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isUnit")}get isWaived(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("isWaived")}get switchBuyTransDate(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchBuyTransDate")}get switchSellTransDate(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("switchSellTransDate")}onInsufficientCreditModalClosed(){this.showInsufficientCreditModal=!1;let e=this.initSwitchTransactionModel();this.subHandlingService.once(this.validateSwitch(e))}setSwitchUnitNoDpValidators(){var e,t,n,i,c,o,s,a,l,r,d,u,h,p;this.switchUnits.setValidators(this.selectedFund.switchEnablePercent==M.a.YES_FLAG?[oe.H.required,oe.H.pattern(Ar),Object(Oc.m)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRetainNum,null===(t=this.selectedFund)||void 0===t?void 0:t.availableValue),Object(Oc.p)(null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionNum,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue)]:[oe.H.required,Object(Oc.q)(null===(c=this.selectedFund)||void 0===c?void 0:c.minRedemptionNum,null===(o=this.selectedFund)||void 0===o?void 0:o.lastestPrice,null===(s=this.selectedFund)||void 0===s?void 0:s.minRedemptionType,null===(a=this.selectedFund)||void 0===a?void 0:a.availableValue,null===(l=this.selectedFund)||void 0===l?void 0:l.availableQuantity),Object(Oc.n)(null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainNum,null===(d=this.selectedFund)||void 0===d?void 0:d.availableValue,null===(u=this.selectedFund)||void 0===u?void 0:u.availableQuantity,null===(h=this.selectedFund)||void 0===h?void 0:h.lastestPrice,null===(p=this.selectedFund)||void 0===p?void 0:p.minRetainType)])}setSwitchUnitWithDpValidators(){var e,t,n,i,c,o,s,a,l,r,d,u,h,p;this.switchUnits.setValidators(this.selectedFund.switchEnablePercent==M.a.YES_FLAG?[oe.H.required,oe.H.pattern(Ar),Object(Oc.m)(null===(e=this.selectedFund)||void 0===e?void 0:e.minRetainNum,null===(t=this.selectedFund)||void 0===t?void 0:t.availableValue),Object(Oc.p)(null===(n=this.selectedFund)||void 0===n?void 0:n.minRedemptionNum,null===(i=this.selectedFund)||void 0===i?void 0:i.availableValue)]:[oe.H.required,oe.H.pattern(Ar),Object(Oc.q)(null===(c=this.selectedFund)||void 0===c?void 0:c.minRedemptionNum,null===(o=this.selectedFund)||void 0===o?void 0:o.lastestPrice,null===(s=this.selectedFund)||void 0===s?void 0:s.minRedemptionType,null===(a=this.selectedFund)||void 0===a?void 0:a.availableValue,null===(l=this.selectedFund)||void 0===l?void 0:l.availableQuantity),Object(Oc.n)(null===(r=this.selectedFund)||void 0===r?void 0:r.minRetainNum,null===(d=this.selectedFund)||void 0===d?void 0:d.availableValue,null===(u=this.selectedFund)||void 0===u?void 0:u.availableQuantity,null===(h=this.selectedFund)||void 0===h?void 0:h.lastestPrice,null===(p=this.selectedFund)||void 0===p?void 0:p.minRetainType)])}switchModelForTransactionDate(){var e,t;return{interOrder:this.selectedSwitchBuyFund.managercode!==this.selectedFund.managerCode,switchBuySedolnumber:this.selectedSwitchFund,switchSellSedolnumber:null===(e=this.selectedFund)||void 0===e?void 0:e.productC
5ode,ifastStatus:"NA",paymentMethod:null===(t=this.selectedFund)||void 0===t?void 0:t.paymentMethod}}calculateSwitchingTransactionDate(){let e=this.switchModelForTransactionDate();console.log("switchModel: ",e),this.transactionRestService.calculateSwitchingTransactionDate(e.switchSellSedolnumber,e.switchBuySedolnumber,e.interOrder,e).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.switchBuyTransDate.patchValue(e.data.SwitchBuyTransactionDate),this.switchSellTransDate.patchValue(e.data.SwitchSellTransactionDate),console.log("[AFTER] "+this.switchBuyTransDate.value+" - "+this.switchSellTransDate.value))},e=>{console.log("calculateSwitchingTransactionDate failed"),this.switchBuyTransDate.patchValue("-"),this.switchSellTransDate.patchValue("-")})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(s.i),h.lc(l.a),h.lc(C.a),h.lc(T.a),h.lc(Sc.b),h.lc(vt.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-switch-prs-fund-fill-detail-form"]],inputs:{isVisible:"isVisible",addedFund:"addedFund",isInterSwitch:"isInterSwitch",isLoadingFundFill:"isLoadingFundFill",isLoadingSalesCharge:"isLoadingSalesCharge",isUpdate:"isUpdate",switchingCalculatorModel:"switchingCalculatorModel",switchCarts:"switchCarts",selectedFund:"selectedFund",fundSwitchList:"fundSwitchList",duplicateRecord:"duplicateRecord"},outputs:{closed:"closed",selectedFundForSwitchBuyChange:"selectedFundForSwitchBuyChange",noSwitchFunds:"noSwitchFunds"},features:[h.Tb([l.a])],decls:25,vars:19,consts:[[1,"mb-4"],[3,"selectedFund","isSwitchPrs"],["class","text-danger mb-3",4,"ngIf"],[1,"font-weight-bold","mb-2"],[4,"ngIf","ngIfElse"],[1,"text-right","mt-4"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",3,"nzLoading","click"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzType","primary","nzBlock","",1,"my-1",3,"nzLoading","click"],[3,"showTerminateRspMsgModal","isSwitch","closeTerminateRspMsgModal"],["loadingTemplate",""],[3,"showInsufficientCreditModal","closeInsufficientCreditModal"],[3,"showModal","refno","showModalChange"],[3,"modalVisible","isPopUp","footerFunc","onOkEmit","onUpdateEmit"],[1,"text-danger","mb-3"],["nzSpan","1"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"text-sm"],["nzSpan","23",1,"text-sm"],[4,"ngIf"],["nz-form","",3,"formGroup"],["nzType","flex","nzAlign","middle","nzGutter","16"],[3,"nzSpan"],[1,"mb-2"],["nzLabelPlaceholder","Investment Type"],["ui-input","",3,"formControl"],[3,"nzErrorTip"],["nzShowSearch","","nzPlaceHolder","Select Fund to Switch Buy",1,"w-100",3,"formControl","nzDropdownMatchSelectWidth"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["buySedolError",""],["class","mb-2",4,"ngIf"],["nzType","flex","nzGutter","16",1,"mb-0"],[3,"nzLabelPlaceholder"],["type","number","ui-input","",3,"formControl"],["nzLabelPlaceholder","Indicative Switch Buy Amt."],[1,"form-control-line-height-base"],["nz-checkbox","",1,"m-t",3,"nzChecked","nzCheckedChange"],["title","No of units to switch for Acc A",3,"value"],["title","No of units to switch for Acc B",3,"value"],[3,"nzLabel","nzValue"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],[3,"switchingCalculatorModel","selectedSwitchBuyFund","isInterSwitch"],["unitMinRedempError",""],["unitMinRetainError",""],[1,"text-danger"],[3,"nzActive","nzLoading"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.mc(1,"sell-fund-detail-info",1),h.qc(),h.od(2,br,7,2,"nz-row",2),h.rc(3,"nz-row"),h.rc(4,"p",3),h.qd(5,"Enter Switching Details"),h.qc(),h.qc(),h.od(6,Ir,47,36,"ng-container",4),h.rc(7,"app-web-scaffold"),h.rc(8,"div",5),h.rc(9,"button",6),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(10),h.qc(),h.rc(11,"button",7),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(12),h.qc(),h.qc(),h.qc(),h.rc(13,"app-mobile-scaffold"),h.rc(14,"b2c-floating-bar"),h.rc(15,"button",8),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(16),h.qc(),h.rc(17,"button",9),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(18),h.qc(),h.qc(),h.qc(),h.rc(19,"terminate-rsp-msg-modal",10),h.zc("closeTerminateRspMsgModal",(function(){return t.closeTerminateRspMsgModal()})),h.qc(),h.od(20,kr,1,2,"ng-template",null,11,h.pd),h.rc(22,"app-insufficient-credit-modal",12),h.zc("closeInsufficientCreditModal",(function(){return t.onInsufficientCreditModalClosed()})),h.qc(),h.rc(23,"fep-breached-modal",13),h.zc("showModalChange",(function(e){return t.fepBreached=e})),h.qc(),h.rc(24,"passport-expiry-notification",14),h.zc("onOkEmit",(function(){return t.passportNoticeVisible=!1}))("onUpdateEmit",(function(){return t.passportNoticeVisible=!1})),h.qc()),2&e){const e=h.ad(21);h.Ub(1),h.Mc("selectedFund",t.selectedFund)("isSwitchPrs",!0),h.Ub(1),h.Mc("ngIf",t.duplicateRecord),h.Ub(4),h.Mc("ngIf",!t.isLoadingFundFill)("ngIfElse",e),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoadingFundFill||t.isLoadingSalesCharge||t.isCheckingForm),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isLoadingFundFill||t.isLoadingSalesCharge||t.isCheckingForm),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(1),h.Mc("showTerminateRspMsgModal",t.showTerminateRspMsgModal)("isSwitch",!0),h.Ub(3),h.Mc("showInsufficientCreditModal",t.showInsufficientCreditModal),h.Ub(1),h.Mc("showModal",t.fepBreached)("refno",t.refno),h.Ub(1),h.Mc("modalVisible",t.passportNoticeVisible)("isPopUp",!1)("footerFunc",!0)}},directives:[to,p.t,P.c,B.a,_.a,z.a,Se.a,oo,pa,$.a,dt.a,P.a,k.b,oe.J,oe.u,se.b,oe.l,se.e,se.a,ae.c,oe.c,ae.b,oe.t,oe.i,Lt.d,p.s,oe.z,lo.a,Bc,Lt.a,Za,se.c,W.a],pipes:[p.b,ke.a],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Fr(e,t){if(1&e){const e=h.sc();h.rc(0,"div",9),h.rc(1,"b2c-app-bar-2",10),h.zc("back",(function(){return h.dd(e),h.Dc().onBack()})),h.qc(),h.qc()}2&e&&(h.Ub(1),h.Mc("title","Edit Cart"))}function Or(e,t){if(1&e){const e=h.sc();h.rc(0,"div",14),h.rc(1,"nz-row",4),h.rc(2,"nz-col",15),h.rc(3,"h3",16),h.qd(4),h.qc(),h.qc(),h.rc(5,"nz-col",17),h.rc(6,"i",6),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(4),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," ")}}function Ur(e,t){if(1&e){const e=h.sc();h.rc(0,"app-switch-prs-fund-fill-detail-form",18),h.zc("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc(2).onFundForSwitchBuyChange(t)}
5))("closed",(function(){return h.dd(e),h.Dc(2).onCancel()}))("noSwitchFunds",(function(){return h.dd(e),h.Dc(2).showNoSwitchFundsModal()})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("fundSwitchList",e.fundSwitchList)("isInterSwitch",e.isInterSwitch)("switchingCalculatorModel",e.switchingCalculatorModel)("duplicateRecord",e.duplicateRecord)}}const xr=function(e){return{"d-none":e}};function Lr(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",11),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.od(1,Or,7,1,"div",12),h.od(2,Ur,1,9,"app-switch-prs-fund-fill-detail-form",13),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzClosable",!1)("nzMaskClosable",!0)("nzFooter",null)("nzVisible",e.isVisible)("nzWidth",600)("nzWrapClassName","vertical-center-modal")("ngClass",h.Sc(9,xr,e.showAiNotice)),h.Ub(1),h.Mc("ngIf",e.selectedFund),h.Ub(1),h.Mc("ngIf",e.isVisible)}}function Rr(e,t){if(1&e){const e=h.sc();h.rc(0,"app-switch-prs-fund-fill-detail-form",22),h.zc("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc(2).onFundForSwitchBuyChange(t)}))("closed",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedFund",e.selectedFund)("addedFund",e.addedFund)("isUpdate",e.isUpdate)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("fundSwitchList",e.fundSwitchList)("isInterSwitch",e.isInterSwitch)("switchingCalculatorModel",e.switchingCalculatorModel)("duplicateRecord",e.duplicateRecord)}}function Nr(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",19),h.rc(2,"div",20),h.rc(3,"h3",16),h.qd(4),h.qc(),h.od(5,Rr,1,9,"app-switch-prs-fund-fill-detail-form",21),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc();h.Ub(4),h.sd("",null==e.selectedFund?null:e.selectedFund.productName," "),h.Ub(1),h.Mc("ngIf",e.isVisible)}}let Br=(()=>{class e{constructor(e){this.store=e,this.isVisible=!1,this.addedFund=[],this.fundSwitchList=[],this.closed=new h.s,this.selectedFundForSwitchBuyChange=new h.s,this.appBarBack=new h.s,this.noSwitchFundsModal=!1,this.transactionConstant=U.a}onCancel(){this.closed.emit()}onFundForSwitchBuyChange(e){this.checkAiFlag(e),this.selectedFundForSwitchBuyChange.emit(e)}onBack(){this.appBarBack.emit()}showNoSwitchFundsModal(){this.onCancel(),this.noSwitchFundsModal=!0}onSwitchFundsModalCancel(){this.noSwitchFundsModal=!1}checkAiFlag(e){let t=this.fundSwitchList.find(t=>t.sedolnumber===e);this.store.selectSnapshot(f.a.getAccounts).find(e=>e.refno===this.store.selectSnapshot(u.X.getSelectedRefno)).aiFlag===M.a.NO_FLAG&&"restricted"===(null==t?void 0:t.fundType)&&(this.showAiNotice=!0)}handleAiAccept(e){this.showAiNotice=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["switch-prs-fund-fill-detail"]],inputs:{isVisible:"isVisible",addedFund:"addedFund",isInterSwitch:"isInterSwitch",isLoadingFundFill:"isLoadingFundFill",isLoadingSalesCharge:"isLoadingSalesCharge",isUpdate:"isUpdate",switchingCalculatorModel:"switchingCalculatorModel",switchCarts:"switchCarts",selectedFund:"selectedFund",fundSwitchList:"fundSwitchList",duplicateRecord:"duplicateRecord"},outputs:{closed:"closed",selectedFundForSwitchBuyChange:"selectedFundForSwitchBuyChange",appBarBack:"appBarBack"},decls:16,vars:11,consts:[["class","border-bottom",4,"ngIf"],[3,"nzClosable","nzMaskClosable","nzFooter","nzVisible","nzWidth","nzWrapClassName","ngClass","nzOnCancel",4,"ngIf"],[4,"ngIf"],[3,"nzClosable","nzMaskClosable","nzFooter","nzVisible","nzOnCancel"],["nzType","flex","nzAlign","middle"],["nzSpan","24",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[1,"text-right","mt-4"],["nz-button","","nzType","outline","nzBlock","",1,"my-1","w-25",3,"click"],[1,"border-bottom"],[3,"title","back"],[3,"nzClosable","nzMaskClosable","nzFooter","nzVisible","nzWidth","nzWrapClassName","ngClass","nzOnCancel"],["class","p-2",4,"ngIf"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","duplicateRecord","selectedFundForSwitchBuyChange","closed","noSwitchFunds",4,"ngIf"],[1,"p-2"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","duplicateRecord","selectedFundForSwitchBuyChange","closed","noSwitchFunds"],[1,"bg-white","shadow","mb-6","pt-3"],[1,"px-2","mb-6"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","duplicateRecord","selectedFundForSwitchBuyChange","closed",4,"ngIf"],[3,"selectedFund","addedFund","isUpdate","isLoadingFundFill","isLoadingSalesCharge","fundSwitchList","isInterSwitch","switchingCalculatorModel","duplicateRecord","selectedFundForSwitchBuyChange","closed"]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,Fr,2,1,"div",0),h.qc(),h.od(2,Lr,3,11,"nz-modal",1),h.Ec(3,"async"),h.rc(4,"app-mobile-scaffold"),h.od(5,Nr,6,2,"ng-container",2),h.Ec(6,"async"),h.qc(),h.rc(7,"nz-modal",3),h.zc("nzOnCancel",(function(){return t.onSwitchFundsModalCancel()})),h.rc(8,"nz-row",4),h.rc(9,"nz-col",5),h.rc(10,"i",6),h.zc("click",(function(){return t.onSwitchFundsModalCancel()})),h.qc(),h.qc(),h.qc(),h.rc(11,"div"),h.qd(12,"No other funds able to switch from this fund !"),h.qc(),h.rc(13,"div",7),h.rc(14,"button",8),h.zc("click",(function(){return t.onSwitchFundsModalCancel()})),h.qd(15,"OK"),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(1),h.Mc("ngIf",t.isVisible),h.Ub(1),h.Mc("ngIf",!h.Fc(3,7,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(6,9,t.isMobile$)&&t.isVisible),h.Ub(2),h.Mc("nzClosable",!1)("nzMaskClosable",!0)("nzFooter",null)("nzVisible",t.noSwitchFundsModal))},directives:[z.a,p.t,j.a,P.c,P.a,k.b,_.a,D.a,p.q,Er],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const _r=function(e,t){return{"container mt-5":e,"w-100":t}};let Vr=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.route=t,this.subHandlingService=n,this.transactionService=i,this.transactionRestService=c,this.notificationService=o,this.utilityRestService=s,this.promoCodeApplied=new h.s,this.tradeProductInfoList=[],this.isInterSwitch=!1,this.isLoadingFundFill=!1,this.isLoadingSalesCharge=!1,this.showSwitchFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.isLoading=!1,this.showPrsFundFillDetail=!1,this.systemSstRate=0}
5ngOnInit(){this.getSystemSstRate(),this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)}),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartLength$=this.store.select(u.W.getUserCartLength).pipe(Object(S.a)(e=>e(this.refno))),this.getSelectedAccTypeDisplay(),this.getSelectedInvestmentAcctTradeData(),this.checkCartLength(),this.getHoldingList()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}onBackPress(){this.route.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.FUNDS,M.o.SWITCH)])}getSelectedAccTypeDisplay(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno)}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getTradeProductInfoData(),this.getCartData()}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>this.filterData(e))})))}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e,this.cartList=Object(g.a)(e)})))}filterData(e){return{switchSellFundName:e.switchSellFundName,switchBuyFundName:e.switchBuyFundName,sedolnumber:e.sedolNumber,redemptionFee:e.redemptionFee,additionalInfo:e.promoSalesCharge?e.promoSalesCharge.toString():e.switchSalesCharge,redemptionUnit:e.fundSwitchTransactionModel.switchUnit,isRedeemByAmount:e.fundSwitchTransactionModel.isAmount,redemptionAmount:e.fundSwitchTransactionModel.switchAmount,redemptionCurrency:e.currencyCode,cashFund:e.cashFund,indicativeAmount:e.indicativeAmount,paymentMethod:e.productCategory,paymentMethodForCheck:e.fundSwitchTransactionModel.paymentMethod,isWaived:e.isWaived,isPercent:e.fundSwitchTransactionModel.isPercent}}onClickEdit(e,t){var n,i;if(this.duplicateRecord=this.fundList.filter(e=>e.productCode==e.productCode).length>1,this.fundList)for(let c of this.fundList)e===(null==c?void 0:c.productCode)&&t===c.paymentMethod&&(this.selectedFund=c);this.sellInfoModel=this.mapSellInfoModel(this.selectedFund),this.getFundSwitchList(),(null===(n=this.selectedFund)||void 0===n?void 0:n.prs)?this.showPrsFundFillDetail=!0:(null===(i=this.selectedFund)||void 0===i?void 0:i.cashFund)?this.showCmfFundFillDetail=!0:this.showSwitchFundFillDetail=!0}checkCartLength(){this.subHandlingService.subscribe(this.cartLength$.pipe(Object(y.a)(e=>{0===e&&this.route.navigate([M.o.APP,M.o.TRADE,M.o.FUNDS,M.o.SWITCH])})))}promoApplied(e){this.promoCodeApplied.emit(e)}onSelectedSwitchBuyFund(e){this.fundSwitchTransactionModel=this.mapSwitchModel(e),this.isInterSwitch=e.interList,this.getSwitchSalesCharge()}onSelectedFundForSwitchBuy(e){let t=this.fundSwitchList.find(t=>t.sedolnumber===e);this.onSelectedSwitchBuyFund(t)}mapSellInfoModel(e){return{sedolNumber:e.productCode,redemptionMethod:null,currency:e.fundCurrencyCode,redemptionUnits:null,redemptionAmount:null,isRedeemByAmount:null,ifastStatus:e.ifastStatus,paymentMethod:e.paymentMethod,agentId:null,createdBy:null,emisOrder:null}}getSwitchSalesCharge(){this.isLoadingSalesCharge=!0,this.subHandlingService.once(this.transactionRestService.getSwitchSalesCharge(this.refno,this.fundSwitchTransactionModel).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.switchingCalculatorModel=e.data,this.isLoadingSalesCharge=!1)},e=>console.log(e))))}mapSwitchModel(e){var t,n,i;return{ifastStatus:null===(t=this.selectedFund)||void 0===t?void 0:t.ifastStatus,interOrder:e.interList,intraOrder:e.intraList,paymentMethod:null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod,refno:this.refno,switchBuySedolnumber:null==e?void 0:e.sedolnumber,switchSellSedolnumber:null===(i=this.selectedFund)||void 0===i?void 0:i.productCode,switchUnit:0}}getFundSwitchList(){this.isLoadingFundFill=!0,this.subHandlingService.once(this.transactionRestService.getSwitchBuyListingList(this.refno,this.sellInfoModel).pipe(Object(y.a)(e=>{var t;e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fundSwitchList=e.data,this.fundSwitchList.forEach(e
5=>{if(this.fundSwitchList.filter(t=>t.sedolnumber===e.sedolnumber).length>1){let t=this.fundSwitchList.filter(t=>t.sedolnumber===e.sedolnumber);this.fundSwitchList=this.fundSwitchList.filter(t=>t.sedolnumber!==e.sedolnumber),this.fundSwitchList.push(t.find(e=>!0===e.interList))}}),this.fundSwitchList=this.fundSwitchList.sort((e,t)=>e.fundName>t.fundName?1:t.fundName>e.fundName?-1:0),this.fundBuySedolNumber=null===(t=this.cartList.find(e=>e.fundSwitchTransactionModel.switchSellSedolnumber===this.sellInfoModel.sedolNumber))||void 0===t?void 0:t.fundSwitchTransactionModel.switchBuySedolnumber,this.onSelectedFundForSwitchBuy(this.fundBuySedolNumber),this.isLoadingFundFill=!1)},e=>console.log(e))))}onFundFillDetailClosed(){this.showSwitchFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.showPrsFundFillDetail=!1}getHoldingList(){this.isLoading=!0,this.subHandlingService.once(this.transactionRestService.getSellHoldingList(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fundList=e.data.sort((e,t)=>e.productName>t.productName?1:t.productName>e.productName?-1:0))},e=>console.log(e))))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(C.a),h.lc(T.a),h.lc(Sc.b),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["fund-switch-checkout"]],outputs:{promoCodeApplied:"promoCodeApplied"},features:[h.Tb([l.a])],decls:30,vars:67,consts:[[1,"bg-lighter","mb-6"],[1,"border-bottom"],[3,"title","back"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],["nz-icon","","nzTheme","outline","nzType","arrow-left",1,"pointer","pr-2",3,"click"],[1,"text-md"],[1,"infinite-container","mt-2"],[3,"fromSwitchCheckOut","header1","header2","header3","header4","tooltip4","header5","header6","showEditBtn","showHeader3","showProfitLoss","isLoading","tradeProductInfoList","selectedSedolnumberEdit"],[3,"refno","promoCodeApplied"],[3,"addedFund","fundSwitchList","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","isUpdate","selectedFund","show","switchingCalculatorModel","closed","selectedFundForSwitchBuyChange"],[3,"addedFund","isUpdate","fundSwitchList","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","selectedFund","show","switchingCalculatorModel","closed","selectedFundForSwitchBuyChange"],[3,"isVisible","addedFund","isUpdate","selectedFund","isInterSwitch","fundSwitchList","isLoadingFundFill","isLoadingSalesCharge","switchingCalculatorModel","duplicateRecord","closed","selectedFundForSwitchBuyChange"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"app-mobile-scaffold"),h.rc(2,"div",1),h.rc(3,"b2c-app-bar-2",2),h.zc("back",(function(){return t.onBackPress()})),h.qc(),h.qc(),h.qc(),h.rc(4,"div",3),h.Ec(5,"async"),h.Ec(6,"async"),h.rc(7,"nz-row",4),h.Ec(8,"async"),h.rc(9,"div",5),h.Ec(10,"async"),h.rc(11,"nz-card",6),h.rc(12,"p"),h.qd(13,"Home / Trade"),h.qc(),h.rc(14,"h3"),h.rc(15,"i",7),h.zc("click",(function(){return t.onBackPress()})),h.qc(),h.qd(16," Check Out "),h.qc(),h.rc(17,"p",8),h.qd(18),h.qc(),h.rc(19,"div",9),h.rc(20,"app-trade-product-info",10),h.zc("selectedSedolnumberEdit",(function(e){return t.onClickEdit(e.sedolnumber,e.paymentMethod)})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(21,"div",5),h.Ec(22,"async"),h.rc(23,"app-switch-checkout-cart-sider",11),h.zc("promoCodeApplied",(function(e){return t.promoApplied(e)})),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(24,"switch-fund-fill-detail",12),h.zc("closed",(function(){return t.onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(e){return t.onSelectedFundForSwitchBuy(e)})),h.Ec(25,"async"),h.qc(),h.rc(26,"switch-cmf-fund-fill-detail",13),h.zc("closed",(function(){return t.onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(e){return t.onSelectedFundForSwitchBuy(e)})),h.Ec(27,"async"),h.qc(),h.rc(28,"switch-prs-fund-fill-detail",14),h.zc("closed",(function(){return t.onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(e){return t.onSelectedFundForSwitchBuy(e)})),h.Ec(29,"async"),h.qc()),2&e&&(h.Ub(3),h.Mc("title","Check Out"),h.Ub(1),h.Mc("ngClass",h.Tc(64,_r,!h.Fc(5,48,t.isMobile$),h.Fc(6,50,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(8,52,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(10,54,t.isMobile$)?0:18),h.Ub(9),h.rd(null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("fromSwitchCheckOut",!0)("header1","Redemption Units")("header2","Redemption Fee")("header3","Indicative Switch Buy Amt*")("header4","Switching Fee")("tooltip4",t.systemSstRate>0?"8% SST, applicable to the Switch Buy Sales Charge":null)("header5","Switch Buy Amt")("header6","Redemption Amt")("showEditBtn",!0)("showHeader3",!0)("showProfitLoss",!1)("isLoading",t.isLoading)("tradeProductInfoList",t.tradeProductInfoList),h.Ub(1),h.Mc("nzSpan",h.Fc(22,56,t.isMobile$)?24:6),h.Ub(2),h.Mc("refno",t.refno),h.Ub(1),h.Mc("addedFund",h.Fc(25,58,t.cartList$))("fundSwitchList",t.fundSwitchList)("isInterSwitch",t.isInterSwitch)("isLoadingFundFill",t.isLoadingFundFill)("isLoadingSalesCharge",t.isLoadingSalesCharge)("isUpdate",!0)("selectedFund",t.selectedFund)("show",t.showSwitchFundFillDetail)("switchingCalculatorModel",t.switchingCalculatorModel),h.Ub(2),h.Mc("addedFund",h.Fc(27,60,t.cartList$))("isUpdate",!0)("fundSwitchList",t.fundSwitchList)("isInterSwitch",t.isInterSwitch)("isLoadingFundFill",t.isLoadingFundFill)("isLoadingSalesCharge",t.isLoadingSalesCharge)("selectedFund",t.selectedFund)("show",t.showCmfFundFillDetail)("switchingCalculatorModel",t.switchingCalculatorModel),h.Ub(2),h.Mc("isVisible",t.showPrsFundFillDetail)("addedFund",h.Fc(29,62,t.cartList$))("isUpdate",!0)("selectedFund",t.selectedFund)("isInterSwitch",t.isInterSwitch)("fundSwitchList",t.fundSwitchList)("isLoadingFundFill",t.isLoadingFundFill)("isLoadingSalesCharge",t.isLoadingSalesCharge)("switchingCalculatorModel",t.switchingCalculatorModel)("duplicateRecord",t.duplicateRecord))},directives:[z.a,D.a,p.q,P.c,P.a,I.a,k.b,A.a,sa,Pl,fr,Br],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var Hr=n("EZek");function $r(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.value,e.currencyCode)," ")}}function jr(e,t){if(1&e&&(h.rc(0,"b2c-order-cart",12),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",13),h.od(3,$r,2,4,"ng-template",null,14,h.pd),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.ad(4),i=h.Dc();h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",i.orderCartConstant.PENDING)("paymentTitle",e.title),h.Ub(2),h.Mc("value",n)}}function Gr(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",15),h.zc("click",(function(){return h.dd(e),h.Dc().proceedOrderPlaced()})),h.qd(2,"I Agree & Check Out "),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("nzLoading",e.isLoading||e.approving)}}function Wr(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"shared-approve-action",16),h.zc("emitCancel",(function(){return h.dd(e),h.Dc().onHandleCancel()}))("onApprove",(function(t){return h.dd(e),h.Dc().onClickApprove(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("refno",e.refno)("requestKey",e.APPROVE_TRADE_REQUEST_KEY)("actionKey",e.DPMS_BUY_ACTION_KEY)("width",600)}}const Yr=function(e){return{"py-3 bg-white shadow mt-3 mb-6 pb-6":e}},Kr=function(e){return{"px-2":e}}
5;let Xr=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.subHandlingService=t,this.transactionDpmsRestService=n,this.router=i,this.transactionService=c,this.twoFaService=o,this.cdRef=s,this.orderCartConstant=O.a,this.cartDisplayListModel=[],this.dpmsBuyModelList=[],this.liveUrl=M.a.LIVE_URL,this.isLoading=!1,this.showProceedModal=!1,this.showErrorMessageModal=!1,this.approving=!1,this.APPROVE_TRADE_REQUEST_KEY=R.a.APPROVE_TRADE,this.DPMS_BUY_ACTION_KEY=L.a.DPMS_BUY}ngOnInit(){this.store.dispatch(new N.b),this.detectRefnoChange()}getCheckOutCartData(){this.cartDisplayListModel=[],this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.checkOutCartData=this.groupByPaymentMethod(e,"cartPaymentMethodDisplay"),this.cartDisplayListModel=Object.keys(this.checkOutCartData).map(e=>({title:e,value:parseInt(this.checkOutCartData[e].value),currencyCode:this.checkOutCartData[e].currencyCode}))})))}groupByPaymentMethod(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.dpmsBuyModel.currency},n.push(e[i[t]])),e[i[t]].value+=i.dpmsBuyModel.amount,e),{})}proceedOrderPlaced(){let e=!1;this.dpmsBuyModelList.forEach(t=>{t.paymentMethod.includes(U.a.CHEQUE_FPX)&&(e=!0)}),e?this.showProceedModal=!0:this.onProceed()}onHandleCancel(){this.showProceedModal=!1,this.approving=!1}onClickApprove(e){this.subHandlingService.once(e.pipe(Object(E.a)(e=>this.transactionDpmsRestService.confirmOrderBuyWithCredential(this.refno,this.dpmsBuyModelList,e).pipe(this.twoFaService.intercept())),Object(y.a)(e=>{this.completeOrder(e)}),Object(F.a)(()=>this.store.dispatch(new N.e(!1,!0)))))}onProceed(){this.dpmsBuyModelList.find(e=>{var t;return e.paymentMode===U.a.TRUST_ACCOUNT||e.paymentMode===U.a.CASH_FUND||(null===(t=e.paymentMode)||void 0===t?void 0:t.includes(U.a.AUTO_SWEEP))})?this.check2FaMethod():this.confirmOrderWithoutCredential()}check2FaMethod(){this.approving=!0}onCloseErrorMessage(){this.showErrorMessageModal=!1}confirmOrderWithoutCredential(){this.isLoading=!0,this.subHandlingService.once(this.transactionDpmsRestService.confirmOrderBuy(this.refno,this.dpmsBuyModelList).pipe(Object(y.a)(e=>{this.isLoading=!1,this.completeOrder(e)},e=>console.log(e))))}getBuyInfoModel(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.dpmsBuyModelList=[];for(let t of e)this.dpmsBuyModelList.push(t.dpmsBuyModel),this.dpmsBuyModelList.forEach((e,t)=>{if(e.paymentMethod.includes(U.a.AUTO_SWEEP)){const n=Object.assign(Object.assign({},e),{autoSweepCurrency:e.currency,paymentMethod:U.a.AUTO_SWEEP,paymentMode:U.a.AUTO_SWEEP});this.dpmsBuyModelList[t]=n}})})))}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.k.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getCheckOutCartData(),this.getBuyInfoModel()}detectRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>
5{this.refno=e,this.cdRef.markForCheck(),this.getSelectedInvestmentAcctTradeData()})))}completeOrder(e){if(e.status!==M.a.RESPONSE_SUCCESS)return this.errorMessage=e.errorMessage,this.showErrorMessageModal=!0,void this.onHandleCancel();this.purchaseOrderNo=e.data.orderNo,this.transactionService.updateBuyDpmsOrderStatusToOrderPlaced(this.refno),this.onHandleCancel(),this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.ORDER_PLACED)],{queryParams:{poNumber:this.purchaseOrderNo,refno:this.refno}})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(Hr.a),h.lc(c.e),h.lc(C.a),h.lc(x.a),h.lc(h.j))},e.\u0275cmp=h.fc({type:e,selectors:[["dpms-buy-checkout-cart-sider"]],features:[h.Tb([l.a,x.a])],decls:46,vars:22,consts:[[3,"ngClass"],[1,"font-weight-bold","mt-3","mb-0"],[1,"py-2"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle",4,"ngFor","ngForOf"],[1,"overflow-auto","mb-3",2,"height","250px"],[1,"text-sm"],["target","_blank",1,"text-link",3,"href"],["target","_blank",1,"text-link","ng-scope",3,"href"],["nz-button","","nzType","primary",1,"font-weight-bold","mb-b","mt-3","w-100",3,"nzLoading","click"],[4,"ngIf"],[3,"isLoading","show","cancel","proceed"],[3,"errorMessage","showErrorMessageModal","closeErrorMessageModal"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle"],["horizontal","true","title","Total Inv. Amt.",3,"value"],["valueTemplate",""],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"nzLoading","click"],[3,"refno","requestKey","actionKey","width","emitCancel","onApprove"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.Ec(1,"async"),h.rc(2,"div",0),h.Ec(3,"async"),h.rc(4,"p",1),h.qd(5," Total Investment Amt."),h.qc(),h.rc(6,"div",2),h.od(7,jr,5,5,"b2c-order-cart",3),h.qc(),h.rc(8,"div",4),h.rc(9,"p",5),h.qd(10," I/we have received, read and understood and agreed the relevant Mandate, "),h.rc(11,"b"),h.rc(12,"a",6),h.qd(13," Risk Disclosure Statement "),h.qc(),h.qd(14,", "),h.rc(15,"a",6),h.qd(16," Loan Financing Risk Disclosure Statement "),h.qc(),h.qd(17,", "),h.rc(18,"a",6),h.qd(19," Investment Account Terms and Conditions "),h.qc(),h.qd(20,", "),h.rc(21,"a",7),h.qd(22," Managed Portfolios Terms and Conditions "),h.qc(),h.qc(),h.qd(23," and hereby authorize iFAST with the discretionary authority (including but not limited to the frequency, scope and methodology of rebalancing) to execute transactions on my/our behalf for the purpose of managing my/our investment under the selected portfolio(s). "),h.qc(),h.rc(24,"p",5),h.qd(25," All investment involves risk and I/we are solely responsible for the decision made on the investment. In acting upon my/our investment instructions, I/we fully understand the consequences of my/our investment choice, and hereby irrevocably indemnify FSM from and against all losses, damages, costs and expenses whatsoever legal or otherwise, which I may sustain, suffer or incur as a result of the performance of any investment(s) and/or currency conversion connected with any transaction(s) for the account. "),h.qc(),h.rc(26,"p",5),h.qd(27," I/we agree that you may transfer and disclose any information relating to me and my/our account, which is necessary for carrying out these services and/or for compliance, to relevant entities and regulators. "),h.qc(),h.rc(28,"p",5),h.qd(29," I/we declare that I/we am/are the ultimate Beneficial Owner of this account and that no person other than myself/ourselves have or will have any interest in, influence or control over this account, whatsoever. "),h.qc(),h.rc(30,"p",5),h.qd(31," I/we declare that I/we am/are not a U.S person and in the event of a change in my/our status that I/we become a U.S person, I shall notify FSM of the change. "),h.qc(),h.rc(32,"p",5),h.qd(33," I/we am/are aware that FSM (iFAST) has appointed Malayan Banking Berhad (Reg No 787435-M) as the custodian for FSM Managed Portfolio. "),h.qc(),h.rc(34,"p",5),h.qd(35," I/we am/are aware that I/we may receive reports, statements or any other documents in relation to the portfolio investment from Malayan Banking Berhad by mail, courier, fax transmission or by such other means as the Custodian may designate from time to time. "),h.qc(),h.rc(36,"p",5),h.qd(37," Corporate account transactions (if applicable): By submitting the transactions, the above declarations would have deemed to be made by the authorized signatories on behalf of the entity/body/business. "),h.qc(),h.qc(),h.qc(),h.rc(38,"app-web-scaffold"),h.rc(39,"button",8),h.zc("click",(function(){return t.proceedOrderPlaced()})),h.qd(40,"Submit Transaction "),h.qc(),h.qc(),h.qc(),h.rc(41,"app-mobile-scaffold"),h.od(42,Gr,3,1,"b2c-floating-bar",9),h.qc(),h.rc(43,"app-proceed-order-placed-modal",10),h.zc("cancel",(function(){return t.onHandleCancel()}))("proceed",(function(){return t.onProceed()})),h.qc(),h.rc(44,"checkout-error-message-modal",11),h.zc("closeErrorMessageModal",(function(){return t.onCloseErrorMessage()})),h.qc(),h.od(45,Wr,2,4,"ng-container",9)),2&e&&(h.Mc("ngClass",h.Sc(18,Yr,h.Fc(1,14,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(20,Kr,h.Fc(3,16,t.isMobile$))),h.Ub(5),h.Mc("ngForOf",t.cartDisplayListModel),h.Ub(5),h.Mc("href",t.liveUrl+"/download/B2C_DPMS_Risk_Disclosure_Statement.pdf",h.gd),h.Ub(3),h.Mc("href",t.liveUrl+"/download/B2C_DPMS_Loan_Risk_Disclosure_Statement.pdf",h.gd),h.Ub(3),h.Mc("href",t.liveUrl+"/download/B2C_Investment_Terms_And_Conditions.pdf",h.gd),h.Ub(3),h.Mc("href",t.liveUrl+"/download/B2C_Managed_Portfolios_Terms_And_Conditions.pdf",h.gd),h.Ub(18),h.Mc("nzLoading",t.isLoading||t.approv
5ing),h.Ub(3),h.Mc("ngIf",!t.showProceedModal),h.Ub(1),h.Mc("isLoading",t.isLoading)("show",t.showProceedModal),h.Ub(1),h.Mc("errorMessage",t.errorMessage)("showErrorMessageModal",t.showErrorMessageModal),h.Ub(1),h.Mc("ngIf",t.approving))},directives:[p.q,p.s,B.a,_.a,z.a,p.t,V.a,ne,ge.a,P.c,be.c,Se.a,ye.a],pipes:[p.b,ke.a],styles:[".checkout-modal{display:flex;align-items:center;justify-content:center}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();var Qr=n("LRne"),Zr=n("JIr8"),Jr=n("LhuC"),ed=n("3WOW");function td(e,t){if(1&e&&(h.pc(0),h.qd(1),h.Ec(2,"currencyFormat"),h.Ec(3,"currencyFormat"),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.sd(" (Min. ",e.selectedDpmsDetail.existingPortofolioUser?h.Gc(2,1,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.minSubsequenceSubscribeAmt,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.currencyCode):h.Gc(3,4,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.minSubscribeAmt,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.currencyCode),") ")}}function nd(e,t){if(1&e&&(h.pc(0),h.qd(1),h.Ec(2,"currencyFormat"),h.Ec(3,"currencyFormat"),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.sd(" (Min. ",e.selectedDpmsDetail.existingPortofolioUser?e.minSubsequenceSubscribeAutoSweepAmt?h.Gc(2,1,e.minSubsequenceSubscribeAutoSweepAmt,null==e.currency?null:e.currency.value):"-":e.minSubscribeAutoSweepAmt?h.Gc(3,4,e.minSubscribeAutoSweepAmt,null==e.currency?null:e.currency.value):"-",") ")}}function id(e,t){if(1&e&&(h.qd(0," Investment Amt. "),h.od(1,td,4,7,"ng-container",16),h.od(2,nd,4,7,"ng-container",16)),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",!(null!=e.paymentMethod&&null!=e.paymentMethod.value&&e.paymentMethod.value.toString().includes(e.transactionConstant.AUTO_SWEEP))),h.Ub(1),h.Mc("ngIf",null==e.paymentMethod||null==e.paymentMethod.value?null:e.paymentMethod.value.toString().includes(e.transactionConstant.AUTO_SWEEP))}}function cd(e,t){if(1&e&&(h.rc(0,"p",20),h.mc(1,"i",21),h.qd(2),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.sd(" Please Enter Amount With ",e.amountDecimalPlaces," Decimal Places. ")}}function od(e,t){1&e&&(h.rc(0,"p",20),h.mc(1,"i",21),h.qd(2," Please make sure this field is not blank. "),h.qc())}function sd(e,t){if(1&e&&(h.rc(0,"p",20),h.mc(1,"i",21),h.qd(2),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.sd(" ",null==e.amount?null:e.amount.getError("invalidDpmsBuy")," ")}}function ad(e,t){if(1&e&&(h.rc(0,"p",20),h.mc(1,"i",21),h.qd(2),h.Ec(3,"currencyFormat"),h.qc()),2&e){const e=h.Dc(2);var n=null;h.Ub(2),h.sd(" The Minimum Incremental Amount is ",h.Gc(3,1,100,null!=e.paymentMethod&&null!=e.paymentMethod.value&&null!=(n=e.paymentMethod.value.toString())&&n.includes(e.transactionConstant.AUTO_SWEEP)?null==e.currency?null:e.currency.value:e.transactionConstant.PAYMENT_CURRENCY_MYR),". ")}}function ld(e,t){if(1&e&&(h.rc(0,"span"),h.mc(1,"i",21),h.qd(2),h.Ec(3,"currencyFormat"),h.qc()),2&e){const e=h.Dc(4);h.Ub(2),h.sd(" The Minimum Subsequence Subscription Amount of this portfolio is ",h.Gc(3,1,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.minSubsequenceSubscribeAmt,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.currencyCode)," . ")}}function rd(e,t){if(1&e&&(h.mc(0,"i",21),h.qd(1),h.Ec(2,"currencyFormat")),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Minimum Subscription Amount of this portfolio is ",h.Gc(2,1,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.minSubscribeAmt,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.currencyCode),". ")}}function dd(e,t){if(1&e&&(h.pc(0),h.od(1,ld,4,4,"span",22),h.od(2,rd,3,4,"ng-template",null,23,h.pd),h.oc()),2&e){const e=h.ad(3),t=h.Dc(3);h.Ub(1),h.Mc("ngIf",t.selectedDpmsDetail.existingPortofolioUser)("ngIfElse",e)}}function ud(e,t){if(1&e&&(h.rc(0,"span"),h.mc(1,"i",21),h.qd(2),h.Ec(3,"currencyFormat"),h.qc()),2&e){const e=h.Dc(4);h.Ub(2),h.sd(" The Minimum Subsequence Subscription Amount of this portfolio is ",e.minSubsequenceSubscribeAutoSweepAmt?h.Gc(3,1,e.minSubsequenceSubscribeAutoSweepAmt,null==e.currency?null:e.currency.value):"-",". ")}}function hd(e,t){if(1&e&&(h.mc(0,"i",21),h.qd(1),h.Ec(2,"currencyFormat")),2&e){const e=h.Dc(4);h.Ub(1),h.sd(" The Minimum Subscription Amount of this portfolio is ",e.minSubscribeAutoSweepAmt?h.Gc(2,1,e.minSubscribeAutoSweepAmt,null==e.currency?null:e.currency.value):"-",". ")}}function pd(e,t){if(1&e&&(h.pc(0),h.od(1,ud,4,4,"span",22),h.od(2,hd,3,4,"ng-template",null,24,h.pd),h.oc()),2&e){const e=h.ad(3),t=h.Dc(3);h.Ub(1),h.Mc("ngIf",t.selectedDpmsDetail.existingPortofolioUser)("ngIfElse",e)}}function md(e,t){if(1&e&&(h.rc(0,"p",20),h.od(1,dd,4,2,"ng-container",16),h.od(2,pd,4,2,"ng-container",16),h.qc()),2&e){const e=h.Dc(2);var n=null;const t=!(null!=e.paymentMethod&&null!=e.paymentMethod.value&&null!=(n=e.paymentMethod.value.toString())&&n.includes(e.transactionConstant.AUTO_SWEEP));var i=null;const c=null==e.paymentMethod||null==e.paymentMethod.value||null==(i=e.paymentMethod.value.toString())?null:i.includes(e.transactionConstant.AUTO_SWEEP);h.Ub(1),h.Mc("ngIf",t),h.Ub(1),h.Mc("ngIf",c)}}
5function fd(e,t){if(1&e&&(h.od(0,cd,3,1,"p",19),h.od(1,od,3,0,"p",19),h.od(2,sd,3,1,"p",19),h.od(3,ad,4,4,"p",19),h.od(4,md,3,2,"p",19)),2&e){const e=h.Dc();h.Mc("ngIf",null==e.amount?null:e.amount.hasError("pattern")),h.Ub(1),h.Mc("ngIf",null==e.amount?null:e.amount.hasError("required")),h.Ub(1),h.Mc("ngIf",null==e.amount?null:e.amount.hasError("invalidDpmsBuy")),h.Ub(1),h.Mc("ngIf",null==e.amount?null:e.amount.hasError("invalidIncremental")),h.Ub(1),h.Mc("ngIf",null==e.amount?null:e.amount.hasError("min"))}}function gd(e,t){if(1&e&&h.mc(0,"ui-option",25),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function bd(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",26),h.zc("click",(function(){return h.dd(e),h.Dc().cancelOrRemoveCart()})),h.qd(2),h.qc(),h.rc(3,"button",27),h.zc("click",(function(){return h.dd(e),h.Dc().onAddOrUpdate()})),h.qd(4),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(2),h.rd(e.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",e.isValidating),h.Ub(1),h.rd(e.isUpdate?"Update":"Add To Cart")}}function Sd(e,t){if(1&e&&(h.rc(0,"strong",28),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Ub(1),h.rd(e.nzLabel)}}const yd=function(e){return{"mr-2":e}};let vd=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l){this.fb=e,this.store=t,this.subHandlingService=n,this.changeDetectorRef=i,this.transactionDpmsRestService=c,this.transactionService=o,this.utilityRestService=s,this.passportExpiryNotificationService=a,this.currencyFormatService=l,this.addedDpms=[],this.closed=new h.s,this.paymentMethodOption=[],this.transactionConstant=U.a,this.fepBreached=!1,this.fxRateError=!1,this.autoSweepFxRate={},this.minSubsequenceSubscribeAutoSweepAmt=0,this.minSubscribeAutoSweepAmt=0,this.passportNoticeVisible=!1}ngOnInit(){var e,t;this.getPaymentMethod(),this.getFxIndicativeRateForAutoSweep(U.a.PAYMENT_CURRENCY_MYR),this.form=new oe.k({amount:new oe.h("",[oe.H.required,oe.H.pattern(this.currencyFormatService.getInputPattern(U.a.PAYMENT_CURRENCY_MYR)),Object(Oc.i)(100),oe.H.min(this.selectedDpmsDetail.existingPortofolioUser?this.selectedDpmsDetail.minSubsequenceSubscribeAmt:this.selectedDpmsDetail.minSubscribeAmt)]),paymentMethod:new oe.h(U.a.CHEQUE_FPX,[oe.H.required]),dpmsPortfolioId:new oe.h(null===(e=this.selectedDpmsDetail)||void 0===e?void 0:e.dpmsPortfolioId),dpmsPortfolioName:new oe.h(this.selectedDpmsName),currency:new oe.h(U.a.PAYMENT_CURRENCY_MYR),paymentId:new oe.h,paymentMode:new oe.h(""),dpmsManagementFee:new oe.h(this.platformFeeRate),salesCharge:new oe.h(null===(t=this.selectedDpmsDetail)||void 0===t?void 0:t.salesCharge),paymentRefno:new oe.h(this.refno)}),this.isUpdate&&this.updateForm(),this.subscribePaymentMethod()}ngOnChanges(e){e.selectedDpmsDetail&&(this.getPaymentMethod(),this.getFxIndicativeRateForAutoSweep(U.a.PAYMENT_CURRENCY_MYR),this.setNewDpmsData(),this.subscribePaymentMethod())}getPaymentMethod(){var e,t;this.paymentMethodOption=[],console.log("selectedDpmsDetail",this.selectedDpmsDetail),null===(t=null==Object?void 0:Object.keys(null===(e=this.selectedDpmsDetail)||void 0===e?void 0:e.paymentMethodListWithParkingFacilityFund))||void 0===t||t.map(e=>{var t,n,i,c,o;let s=null===(t=this.selectedDpmsDetail)||void 0===t?void 0:t.paymentMethodListWithParkingFacilityFund[e];e===U.a.TRUST_ACCOUNT&&(s=(null===(n=this.selectedDpmsDetail)||void 0===n?void 0:n.currencyCode)+" Cash Account - "+this.currencyFormatService.formatCurrency(null===(i=this.selectedDpmsDetail)||void 0===i?void 0:i.paymentMethodListWithParkingFacilityFund[U.a.TRUST_ACCOUNT][0].availableBalance,U.a.PAYMENT_CURRENCY_MYR)),e===U.a.CHEQUE_FPX&&(s="Cheque / FPX"),e!==U.a.CASH_FUND&&e!==U.a.AUTO_SWEEP&&this.paymentMethodOption.push({label:s,value:e}),e===U.a.CASH_FUND&&(null===(c=this.selectedDpmsDetail)||void 0===c||c.paymentMethodListWithParkingFacilityFund[U.a.CASH_FUND].forEac
5h(e=>{this.paymentMethodOption.push({label:e.cashFundName+" ("+this.currencyFormatService.formatCurrency(e.availableBalance,U.a.PAYMENT_CURRENCY_MYR)+")",value:U.a.CASH_FUND+"|"+e.cashFundSedol+"|"+e.cashFundName})})),e===U.a.AUTO_SWEEP&&(null===(o=this.selectedDpmsDetail)||void 0===o||o.paymentMethodListWithParkingFacilityFund[U.a.AUTO_SWEEP].forEach(t=>{gt.a.AUTO_SWEEP_CURRENCY.includes(null==t?void 0:t.currency)&&this.paymentMethodOption.push({label:(null==t?void 0:t.currency)+" "+e+" - "+this.currencyFormatService.formatCurrency(null==t?void 0:t.availableBalance,null==t?void 0:t.currency),value:`${null==t?void 0:t.currency} ${U.a.AUTO_SWEEP}`})}))})}get amount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("amount")}get paymentMethod(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("paymentMethod")}get paymentId(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("paymentId")}get paymentMode(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("paymentMode")}get dpmsManagementFee(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("dpmsManagementFee")}get paymentRefno(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("paymentRefno")}get salesCharge(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("salesCharge")}get dpmsPortfolioId(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("dpmsPortfolioId")}get dpmsPortfolioName(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("dpmsPortfolioName")}get currency(){var e;
5return null===(e=this.form)||void 0===e?void 0:e.get("currency")}get amountDecimalPlaces(){var e;return this.currencyFormatService.getDecimalPlaces((null===(e=this.currency)||void 0===e?void 0:e.value)||U.a.PAYMENT_CURRENCY_MYR)}onAddOrUpdate(){let e=this.passportExpiryNotificationService.isPersonalAccountPassportExpired();const t=this.refno;let n=!1;if(t&&(n=this.passportExpiryNotificationService.checkPassportExpiredByAccount(t)),e||n)return void(this.passportNoticeVisible=!0);if(Object(zn.c)(this.form),this.form.updateValueAndValidity(),this.form.invalid)return;this.isValidating=!0;let i=Object(g.a)(this.form.value);if(-1!==this.paymentMode.value.indexOf(U.a.CASH_FUND)){const e=this.paymentMode.value.split("|");i.cashFundSedol=e[1],i.paymentMode=U.a.CASH_FUND,i.paymentMethod=U.a.CASH_FUND}else-1!==this.paymentMode.value.indexOf(U.a.AUTO_SWEEP)&&(i.paymentMethod=U.a.AUTO_SWEEP,i.paymentMode=U.a.AUTO_SWEEP);this.subHandlingService.once(this.transactionDpmsRestService.validateBuyCart(this.refno,i).pipe(Object(E.a)(e=>{if(this.isValidating=!1,e.status!==Jr.a.RESPONSE_FAILED)return console.log(this.form.value),this.transactionDpmsRestService.getPromoSalesCharge(this.refno,[this.form.value]);e.errorMessage.includes("foreign.exchange.policy.breached")?this.fepBreached=!0:this.amount.setErrors({invalidDpmsBuy:e.errorMessage})}),Object(y.a)(e=>{e&&(this.selectedDpmsDetail.salesChargeDisplay=e.data[0].salesCharge,this.addOrUpdateCart())})))}addOrUpdateCart(){this.selectedDpmsDetail.investmentAmount=this.amount.value,this.selectedDpmsDetail.paymentMethod=this.paymentMethod.value,this.selectedDpmsDetail.dpmsPortfolioName=this.selectedDpmsName,this.selectedDpmsDetail.platformFeeRate=this.platformFeeRate,this.isUpdate?this.transactionService.updateBuyDpmsCartInfo(this.form,this.selectedDpmsDetail):this.transactionService.storeBuyDpmsCart(this.form,this.selectedDpmsDetail),this.closed.emit()}cancelOrRemoveCart(){this.isUpdate&&this.transactionService.removeBuyDpmsCartInfo(this.selectedDpmsDetail.dpmsPortfolioId,this.refno),this.closed.emit()}onCancel(){this.closed.emit()}updateForm(){var e,t,n;const i=null===(e=this.addedDpms)||void 0===e?void 0:e.find(e=>{var t;return e.dpmsBuyModel.dpmsPortfolioId===(null===(t=this.selectedDpmsDetail)||void 0===t?void 0:t.dpmsPortfolioId)});this.amount.patchValue(null==i?void 0:i.dpmsBuyModel.amount),this.paymentMethod.patchValue(null==i?void 0:i.dpmsBuyModel.paymentMethod),this.paymentMode.patchValue(null==i?void 0:i.dpmsBuyModel.paymentMode),this.paymentId.patchValue((null==i?void 0:i.dpmsBuyModel.paymentId)?null===(t=i.dpmsBuyModel)||void 0===t?void 0:t.paymentId:""),this.dpmsManagementFee.patchValue(null===(n=null==i?void 0:i.dpmsBuyModel)||void 0===n?void 0:n.dpmsManagementFee),Object(zn.c)(this.form)}subscribePaymentMethod(){this.subHandlingService.subscribe(this.paymentMethod.valueChanges.pipe(Object(b.a)(),Object(y.a)(e=>{var t,n;if(this.paymentId.patchValue(""),this.paymentMode.patchValue(e),e===U.a.TRUST_ACCOUNT&&this.paymentId.patchValue(null===(t=this.selectedDpmsDetail)||void 0===t?void 0:t.paymentMethodList[U.a.TRUST_ACCOUNT][0].trustId),null==e?void 0:e.toString().includes(U.a.AUTO_SWEEP)){const t=null===(n=e.split(U.a.AUTO_SWEEP)[0])||void 0===n?void 0:n.trim();this.currency.patchValue(t);const i=[oe.H.required,oe.H.pattern(this.currencyFormatService.getInputPattern(t)),Object(Oc.i)(100)];if(!this.fxRateError){const e=this.currencyFormatService.getDecimalPlaces(t);this.minSubsequenceSubscribeAutoSweepAmt=Object(ft.c)(this.selectedDpmsDetail.minSubsequenceSubscribeAmt/this.autoSweepFxRate[t],e),this.minSubscribeAutoSweepAmt=Object(ft.c)(this.selectedDpmsDetail.minSubscribeAmt/this.autoSweepFxRate[t],e),this.minSubsequenceSubscribeAutoSweepAmt=this.roundUpToIncrement(this.minSubsequenceSubscribeAutoSweepAmt,100),this.minSubscribeAutoSweepAmt=this.roundUpToIncrement(this.minSubscribeAutoSweepAmt,100),i.push(oe.H.min(this.selectedDpmsDetail.existingPortofolioUser?this.minSubsequenceSubscribeAutoSweepAmt:this.minSubscribeAutoSweepAmt))}this.amount.setValidators(i),this.amount.updateValueAndValidity()}else this.currency.patchValue(U.a.PAYMENT_CURRENCY_MYR);this.amount.updateValueAndValidity()})))}roundUpToIncrement(e,t){const n=Math.ceil(e/t)*t;return n>=e?n:n+t}getFxIndicativeRateForAutoSweep(e){this.fxRateError=!1;const t=[];gt.a.AUTO_SWEEP_CURRENCY.forEach(n=>
5{n!==e?t.push(this.utilityRestService.getFxIndicativeRate(n,e,!1,"ut").pipe(Object(y.a)(e=>{Jr.a.RESPONSE_SUCCESS===(null==e?void 0:e.status)&&null!=(null==e?void 0:e.data)&&(this.autoSweepFxRate[n]=null==e?void 0:e.data)}))):this.autoSweepFxRate[n]=1}),this.subHandlingService.once(Object(ht.a)(t).pipe(Object(Zr.a)(e=>(this.fxRateError=!0,Object(Qr.a)(!1)))))}setNewDpmsData(){var e,t,n;if(this.form){this.amount.setValidators([oe.H.required,oe.H.pattern(this.currencyFormatService.getInputPattern(U.a.PAYMENT_CURRENCY_MYR)),Object(Oc.i)(100),oe.H.min(this.selectedDpmsDetail.existingPortofolioUser?this.selectedDpmsDetail.minSubsequenceSubscribeAmt:this.selectedDpmsDetail.minSubscribeAmt)]),this.paymentRefno.setValue(this.refno);const i=null===(e=this.addedDpms)||void 0===e?void 0:e.find(e=>{var t;return e.dpmsBuyModel.dpmsPortfolioId===(null===(t=this.selectedDpmsDetail)||void 0===t?void 0:t.dpmsPortfolioId)});this.paymentMethod.setValue((null==i?void 0:i.dpmsBuyModel.paymentMethod)||U.a.CHEQUE_FPX),this.dpmsManagementFee.setValue(this.platformFeeRate),this.salesCharge.setValue(null===(t=this.selectedDpmsDetail)||void 0===t?void 0:t.salesCharge),this.paymentMode.setValue(""),this.dpmsPortfolioId.setValue(null===(n=this.selectedDpmsDetail)||void 0===n?void 0:n.dpmsPortfolioId),this.dpmsPortfolioName.setValue(this.selectedDpmsName)}}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(s.i),h.lc(l.a),h.lc(h.j),h.lc(Hr.a),h.lc(C.a),h.lc(w.a),h.lc(vt.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["dpms-buy-fill-detail-form"]],inputs:{selectedDpmsName:"selectedDpmsName",selectedDpmsDetail:"selectedDpmsDetail",isUpdate:"isUpdate",addedDpms:"addedDpms",platformFeeRate:"platformFeeRate",refno:"refno"},outputs:{closed:"closed"},features:[h.Tb([l.a]),h.Sb],decls:37,vars:30,consts:[[1,"font-weight-bold","mb-2"],[1,"mb-4"],["nz-form","",3,"formGroup"],[3,"nzSpan"],[1,"mb-2",3,"ngClass"],[3,"nzLabelPlaceholder"],["type","text","ui-input","","disabled","",3,"formControl"],[1,"mb-2"],[3,"nzErrorTip"],["step","100","type","number","ui-input","",3,"formControl"],["placeholderAmountTpl",""],["errorTip",""],["nzPlaceHolder","Payment Method",3,"formControl"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],[3,"riskAppetite","isCashPortfolio"],[3,"showModal","refno","showModalChange"],[4,"ngIf"],["custom",""],[3,"modalVisible","isPopUp","footerFunc","onOkEmit","onUpdateEmit"],["class","mb-1",4,"ngIf"],[1,"mb-1"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],[4,"ngIf","ngIfElse"],["notExistingMin",""],["notExistingMinForAutoSweep",""],[3,"nzLabel","nzValue"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"nzLoading","click"],[1,"text-black-7"]],template:function(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"p",0),h.qd(2,"Enter Investment Details"),h.qc(),h.qc(),h.rc(3,"div",1),h.rc(4,"form",2),h.rc(5,"nz-row"),h.rc(6,"nz-col",3),h.Ec(7,"async"),h.rc(8,"nz-form-item",4),h.Ec(9,"async"),h.rc(10,"nz-form-control"),h.rc(11,"ui-input-group",5),h.mc(12,"input",6),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(13,"nz-col",3),h.Ec(14,"async"),h.rc(15,"nz-form-item",7),h.rc(16,"nz-form-control",8),h.rc(17,"ui-input-group",5),h.mc(18,"input",9),h.qc(),h.od(19,id,3,2,"ng-template",null,10,h.pd),h.od(21,fd,5,5,"ng-template",null,11,h.pd),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(23,"nz-row"),h.rc(24,"nz-col",3),h.rc(25,"nz-form-item",7),h.rc(26,"nz-form-control"),h.rc(27,"ui-select",12),h.od(28,gd,1,2,"ui-option",13),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(29,"div"),h.mc(30,"related-info-collapse",14),h.qc(),h.rc(31,"fep-breached-modal",15),h.zc("showModalChange",(function(e){return t.fepBreached=e})),h.qc(),h.od(32,bd,5,3,"b2c-floating-bar",16),h.Ec(33,"async"),h.od(34,Sd,2,1,"ng-template",null,17,h.pd),h.rc(36,"passport-expiry-notification",18),h.zc("onOkEmit",(function(){return t.passportNoticeVisible=!1}))("onUpdateEmit",(function(){return t.passportNoticeVisible=!1})),h.qc()),2&e){const e=h.ad(20),n=h.ad(22);h.Ub(4),h.Mc("formGroup",t.form),h.Ub(2),h.Mc("nzSpan",h.Fc(7,20,t.isMobile$)?24:9),h.Ub(2),h.Mc("ngClass",h.Sc(28,yd,!h.Fc(9,22,t.isMobile$))),h.Ub(3),h.Mc("nzLabelPlaceholder","Investment Currency"),h.Ub(1),h.Mc("formControl",t.currency),h.Ub(1),h.Mc("nzSpan",h.Fc(14,24,t.isMobile$)?24:15),h.Ub(3),h.Mc("nzErrorTip",n),h.Ub(1),h.Mc("nzLabelPlaceholder",e),h.Ub(1),h.Mc("formControl",t.amount),h.Ub(6),h.Mc("nzSpan",24),h.Ub(3),h.Mc("formControl",t.paymentMethod),h.Ub(1),h.Mc("ngForOf",t.paymentMethodOption),h.Ub(2),h.Mc("riskAppetite",t.selectedDpmsDetail.riskLevel)("isCashPortfolio",t.selectedDpmsDetail.isCashPortfolio),h.Ub(1),h.Mc("showModal",t.fepBreached)("refno",t.refno),h.Ub(1),h.Mc("ngIf",h.Fc(33,26,t.isMobile$)),h.Ub(4),h.Mc("modalVisible",t.passportNoticeVisible)("isPopUp",!1)("footerFunc",!0)}},directives:[oe.J,oe.u,se.b,oe.l,P.c,P.a,se.e,p.q,se.a,ae.c,oe.c,ae.b,oe.t,oe.i,oe.z,Lt.d,p.s,ed.a,$.a,p.t,dt.a,k.b,Lt.a,Se.a,_.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Md(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-app-bar-2",4),h.zc("back",(function(){return h.dd(e),h.Dc().onCancel()})),h.qc()}2&e&&h.Mc("title","Edit Cart")}function Cd(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row",12),h.rc(1,"nz-col",13),h.rc(2,"h3",14),h.qd(3),h.qc(),h.qc(),h.rc(4,"nz-col",15),h.rc(5,"i",16),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.sd("",e.selectedDpmsName," ")}}function qd(e,t){1&e&&h.mc(0,"i",25)}function Td(e,t){1&e&&h.mc(0,"i",26)}function wd(e,t){if(1&e&&(h.rc(0,"div",17),h.rc(1,"div",18),h.rc(2,"div",19),h.rc(3,"h5",20),h.qd(4," Subscription Fee "),h.od(5,qd,1,0,"i",21),h.qc(),h.qc(),h.rc(6,"div",22),h.rc(7,"h5",20),h.qd(8," Portfolio Management Fee* "),h.od(9,Td,1,0,"i",23),h.qc(),h.qc(),h.qc(),h.rc(10,"div",18),h.rc(11,"div",19),h.rc(12,"p",24),h.qd(13),h.Ec(14,"number"),h.Ec(15,"number"),h.qc(),h.qc(),h.rc(16,"div",22),h.rc(17,"p",24),h.qd(18),h.Ec(19,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(5),h.Mc("ngIf",e.systemSstRate>0),h.Ub(4),h.Mc("ngIf",e.systemSstRate>0),h.Ub(4),h.sd("",null!=e.selectedDpmsDetail&&null!=e.selectedDpmsDetail.salesChargeDisplay&&e.selectedDpmsDetail.salesChargeDisplay.toString()?h.Gc(14,4,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.salesChargeDisplay,"1.2-2"):h.Gc(15,7,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.salesCharge,"1.2-2")," % "),h.Ub(5),h.sd("",h.Gc(19,10,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.platformFeeRate,"1.2-2")," % p.a. ")}}function zd(e,t){if(1&e){const e=h.sc();h.rc(0,"investment-account-selector",31),h.zc("onSwitchInvestmentAcct",(function(t){return h.dd(e),h.Dc(3).onChangeInvestmentAccount(t)})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("inFillDetail",!0)("isUpdate",e.isUpdate)}}function Dd(e,t){if(1&e&&(h.rc(0,"div",27),h.rc(1,"div",28),h.rc(2,"p",24),h.qd(3,"Select Investment Account"),h.qc(),h.rc(4,"div",29),h.od(5,zd,1,2,"investment-account-selector",30),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("ngIf",e.show)}}function Pd(e,t){if(1&e){const e=h.sc();h.rc(0,"dpms-buy-fill-detail-form",32),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("addedDpms",e.addedDpms)("isUpdate",e.isUpdate)("selectedDpmsName",e.selectedDpmsName)("selectedDpmsDetail",e.selectedDpmsDetail)("platformFeeRate",e.platformFeeRate)("refno",e.refno)}}function Id(e,t){if(1&e){const e=h.sc();h.rc(0,"div",33),h.rc(1,"button",34),h.zc("click",(function(){return h.dd(e),h.Dc(2).dpmsBuyFillDetailFormComponent.cancelOrRemoveCart()})),h.qd(2),h.qc(),h.rc(3,"button",35),h.zc("click",(function(){return h.dd(e),h.Dc(2).dpmsBuyFillDetailFormComponent.onAddOrUpdate()})),h.qd(4),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(2),h.rd(e.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",null==e.dpmsBuyFillDetailFormComponent?null:e.dpmsBuyFillDetailFormComponent.isValidating),h.Ub(1),h.rd(e.isUpdate?"Update":"Add To Cart")}}function kd(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",5),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.od(1,Cd,6,1,"nz-row",6),h.rc(2,"div",7),h.od(3,wd,20,13,"div",8),h.od(4,Dd,6,3,"div",9),h.od(5,Pd,1,6,"dpms-buy-fill-detail-form",10),h.qc(),h.rc(6,"app-web-scaffold"),h.od(7,Id,5,3,"div",11),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(8);h.Mc("nzMaskClosable",!0)("nzClosable",!1)("nzWrapClassName","vertical-center-modal")("nzFooter",null)("nzWidth",600)("nzVisible",e.show),h.Ub(1),h.Mc("ngIf",e.selectedDpmsName),h.Ub(2),h.Mc("ngIf",!e.isLoading),h.Ub(1),h.Mc("ngIf",!e.isLoading),h.Ub(1),h.Mc("ngIf",e.show&&!e.isLoading)("ngIfElse",t),h.Ub(2),h.Mc("ngIf",!e.isLoading)}}function Ad(e,t){if(1&e&&(h.rc(0,"div",39),h.rc(1,"div",18),h.rc(2,"div",22),h.rc(3,"h5",20),h.qd(4," Subscription Fee "),h.mc(5,"i",25),h.qc(),h.qc(),h.rc(6,"div",40),h.rc(7,"h5",20),h.qd(8," Portfolio Management Fee* "),h.mc(9,"i",26),h.qc(),h.qc(),h.qc(),h.rc(10,"div",18),h.rc(11,"div",22),h.rc(12,"p",24),h.qd(13),h.Ec(14,"number"),h.Ec(15,"number"),h.qc(),h.qc(),h.rc(16,"div",40),h.rc(17,"p",24),h.qd(18),h.Ec(19,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(5),h.Mc("nzOverlayClassName",""),h.Ub(8),h.sd("",null!=e.selectedDpmsDetail&&null!=e.selectedDpmsDetail.salesChargeDisplay&&e.selectedDpmsDetail.salesChargeDisplay.toString()?h.Gc(14,3,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.salesChargeDisplay,"1.2-2"):h.Gc(15,6,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.salesCharge,"1.2-2")," % "),h.Ub(5),h.sd("",h.Gc(19,9,null==e.selectedDpmsDetail?null:e.selectedDpmsDetail.platformFeeRate,"1.2-2")," % p.a. ")}}function Ed(e,t){if(1&e){const e=h.sc();h.rc(0,"investment-account-selector",31),h.zc("onSwitchInvestmentAcct",(function(t){return h.dd(e),h.Dc(3).onChangeInvestmentAccount(t)})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("inFillDetail",!0)("isUpdate",e.isUpdate)}}function Fd(e,t){if(1&e&&(h.rc(0,"div",27),h.rc(1,"div",28),h.rc(2,"p",24),h.qd(3,"Select Investment Account"),h.qc(),h.rc(4,"div",29),h.od(5,Ed,1,2,"investment-account-selector",30),h.Ec(6,"async"),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("ngIf",h.Fc(6,3,e.isMobile$))}}function Od(e,t){if(1&e){const e=h.sc();h.rc(0,"dpms-buy-fill-detail-form",32),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("addedDpms",e.addedDpms)("isUpdate",e.isUpdate)("selectedDpmsName",e.selectedDpmsName)("selectedDpmsDetail",e.selectedDpmsDetail)("platformFeeRate",e.platformFeeRate)("refno",e.refno)}}function Ud(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",36),h.rc(2,"div",37),h.rc(3,"h3",14),h.qd(4),h.qc(),h.od(5,Ad,20,12,"div",38),h.od(6,Fd,7,5,"div",9),h.od(7,Od,1,6,"dpms-buy-fill-detail-form",10),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(),t=h.ad(8);h.Ub(4),h.rd(e.selectedDpmsName),h.Ub(1),h.Mc("ngIf",!e.isLoading),h.Ub(1),h.Mc("ngIf",!e.isLoading),h.Ub(1),h.Mc("ngIf",e.show&&!e.isLoading)("ngIfElse",t)}}function xd(e,t){if(1&e&&(h.rc(0,"nz-spin",41),h.mc(1,"nz-skeleton",42),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzActive",!0)("nzLoading",e.isLoading)}}let Ld=(()=>{class e{constructor(e,t,n,i){this.store=e,this.subHandlingService=t,this.transactionDpmsRestService=n,this.utilityRestService=i,this.addedDpms=[],this.closed=new h.s,this.systemSstRate=0}
5ngOnInit(){this.getSystemSstRate()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}onCancel(){this.closed.emit()}onChangeInvestmentAccount(e){this.refno=e,this.getDpmsPortfolioDetails(this.selectedDpmsDetail.dpmsPortfolioId)}getDpmsPortfolioDetails(e){this.subHandlingService.once(this.transactionDpmsRestService.getDpmsBuyDetails(e,this.refno).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.selectedDpmsDetail=e.data)})))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(Hr.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["dpms-buy-fill-detail"]],viewQuery:function(e,t){var n;1&e&&h.yd(vd,!0),2&e&&h.Zc(n=h.Ac())&&(t.dpmsBuyFillDetailFormComponent=n.first)},inputs:{show:"show",selectedDpmsName:"selectedDpmsName",selectedDpmsDetail:"selectedDpmsDetail",isUpdate:"isUpdate",isLoading:"isLoading",addedDpms:"addedDpms",platformFeeRate:"platformFeeRate",refno:"refno"},outputs:{closed:"closed"},decls:9,vars:7,consts:[[3,"title","back",4,"ngIf"],[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel",4,"ngIf"],[4,"ngIf"],["loadingTemplate",""],[3,"title","back"],[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel"],["nzType","flex","nzAlign","top",4,"ngIf"],[1,"overflow-auto",2,"max-height","550px"],["class","bg-black-2 px-3 pb-1 pt-3 mt-2 mb-2",4,"ngIf"],["class","pt-3 pb-2","nz-row","",4,"ngIf"],[3,"addedDpms","isUpdate","selectedDpmsName","selectedDpmsDetail","platformFeeRate","refno","closed",4,"ngIf","ngIfElse"],["class","text-right mt-5",4,"ngIf"],["nzType","flex","nzAlign","top"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[1,"bg-black-2","px-3","pb-1","pt-3","mt-2","mb-2"],["nz-row",""],["nz-col","","nzSpan","8"],[1,"d-flex","align-item-center","gap-2px"],["class","d-flex align-item-center pointer","nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzTooltipTitle","8% SST, applicable to the Subscription Fee","nzType","info-circle",3,"nzOverlayClassName",4,"ngIf"],["nz-col","","nzSpan","10"],["class","d-flex align-item-center pointer","nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzTooltipTitle","8% SST, applicable to the Portfolio Management Fee","nzType","info-circle",3,"nzOverlayClassName",4,"ngIf"],[1,"font-weight-bold"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzTooltipTitle","8% SST, applicable to the Subscription Fee","nzType","info-circle",1,"d-flex","align-item-center","pointer",3,"nzOverlayClassName"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzTooltipTitle","8% SST, applicable to the Portfolio Management Fee","nzType","info-circle",1,"d-flex","align-item-center","pointer",3,"nzOverlayClassName"],["nz-row","",1,"pt-3","pb-2"],["nz-col","",3,"nzSpan"],["nz-col","",2,"margin-top","-5px",3,"nzSpan"],[3,"inFillDetail","isUpdate","onSwitchInvestmentAcct",4,"ngIf"],[3,"inFillDetail","isUpdate","onSwitchInvestmentAcct"],[3,"addedDpms","isUpdate","selectedDpmsName","selectedDpmsDetail","platformFeeRate","refno","closed"],[1,"text-right","mt-5"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",3,"nzLoading","click"],[1,"bg-white","shadow","mb-6","border-top"],[1,"py-3","px-2","mb-6"],["class","bg-black-2 px-3 py-3 mb-4",4,"ngIf"],[1,"bg-black-2","px-3","py-3","mb-4"],["nz-col","","nzSpan","12"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzActive","nzLoading"]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,Md,1,1,"b2c-app-bar-2",0),h.qc(),h.od(2,kd,8,12,"nz-modal",1),h.Ec(3,"async"),h.rc(4,"app-mobile-scaffold"),h.od(5,Ud,8,5,"ng-container",2),h.Ec(6,"async"),h.qc(),h.od(7,xd,2,3,"ng-template",null,3,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",t.show),h.Ub(1),h.Mc("ngIf",!h.Fc(3,3,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(6,5,t.isMobile$)&&t.show))},directives:[z.a,p.t,D.a,j.a,B.a,P.c,P.a,k.b,xt.e,ut.a,vd,_.a,Il.a,W.a],pipes:[p.b,p.g],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Rd(e,t){1&e&&h.mc(0,"investment-account-selector")}const Nd=function(e,t){return{"container mt-5":e,"w-100 border-top":t}};let Bd=(()=>{class e{constructor(e,t,n,i,c,o){this.store=e,this.subHandlingService=t,this.route=n,this.cdRef=i,this.transactionDpmsRestService=c,this.utilityRestService=o,this.tradeProductInfoList=[],this.systemSstRate=0}ngOnInit(){this.authenticatedDisplay=this.store.selectSnapshot(f.a.getAccounts),this.subscribeRefnoChange(),this.getCartData(),this.get
5SystemSstRate()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}onBackPress(){this.route.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.DPMS,M.o.BUY)])}getSelectedAccTypeDisplay(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno)}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>(console.log(e),this.filterData(e)))})))}filterData(e){return{paymentMethod:e.cartPaymentMethodDisplay,dpmsPortfolioId:e.dpmsBuyModel.dpmsPortfolioId,dpmsPortfolioName:e.dpmsBuyModel.dpmsPortfolioName,investmentAmount:e.dpmsBuyModel.amount,investmentCurrency:e.dpmsBuyModel.currency,additionalInfo:e.salesChargeDisplay.toFixed(2).toString()+"%"}}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e})))}checkCartLength(){this.subHandlingService.subscribe(this.cartLength$.pipe(Object(y.a)(e=>{0===e&&this.route.navigate([M.o.APP,M.o.TRADE,M.o.DPMS,M.o.BUY])})))}onClickEdit(e){this.showDpmsFillDetail=!0,this.isUpdate=!0,this.isLoadingFillDetail=!0,this.subHandlingService.once(this.transactionDpmsRestService.getDpmsBuyDetails(e,this.refno).pipe(Object(y.a)(t=>{this.isLoadingFillDetail=!1,t.status===M.a.RESPONSE_SUCCESS&&(this.selectedDpmsDetail=t.data,this.cartItemData.forEach(t=>{t.dpmsBuyModel.dpmsPortfolioId===e&&(this.selectedDpmsDetail.salesChargeDisplay=t.salesChargeDisplay)}),this.selectedDpmsName=this.selectedDpmsDetail.dpmsPortfolioName.replace("FSM","").trim())})))}onDpmsFillDetailClosed(){this.showDpmsFillDetail=!1,this.isUpdate=!1}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.refno=e,this.cdRef.markForCheck(),this.cartList$=this.store.select(u.k.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.cartLength$=this.store.select(u.k.getCartLength).pipe(Object(S.a)(e=>e(this.refno))),this.getSelectedAccTypeDisplay(),this.getTradeProductInfoData(),this.checkCartLength()})))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(c.e),h.lc(h.j),h.lc(Hr.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-buy-checkout"]],features:[h.Tb([l.a])],decls:26,vars:37,consts:[[1,"bg-lighter","mb-6"],[3,"title","back"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],["nz-icon","","nzTheme","outline","nzType","arrow-left",1,"pointer","pr-2",3,"click"],[1,"text-md"],[1,"infinite-container","mt-2"],[3,"isDpms","isDpmsSubsequentPage","header1","header3","tooltip3","showEditBtn","showHeader3","tradeProductInfoList","editDpmsAction"],[4,"ngIf"],[3,"addedDpms","selectedDpmsName","selectedDpmsDetail","show","refno","isLoading","isUpdate","closed"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"app-mobile-scaffold"),h.rc(2,"b2c-app-bar-2",1),h.zc("back",(function(){return t.onBackPress()})),h.qc(),h.qc(),h.rc(3,"div",2),h.Ec(4,"async"),h.Ec(5,"async"),h.rc(6,"nz-row",3),h.Ec(7,"async"),h.rc(8,"div",4),h.Ec(9,"async"),h.rc(10,"nz-card",5),h.rc(11,"p"),h.qd(12,"Home / Trade"),h.qc(),h.rc(13,"h3"),h.rc(14,"i",6),h.zc("click",(function(){return t.onBackPress()})),h.qc(),h.qd(15," Check Out "),h.qc(),h.rc(16,"p",7),h.qd(17),h.qc(),h.rc(18,"div",8),h.rc(19,"app-trade-product-info",9),h.zc("editDpmsAction",(function(e){return t.onClickEdit(e)})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(20,"div",4),h.Ec(21,"async"),h.od(22,Rd,1,0,"investment-account-selector",10),h.mc(23,"dpms-buy-checkout-cart-sider"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(24,"dpms-buy-fill-detail",11),h.zc("closed",(function(){return t.onDpmsFillDetailClosed()})),h.Ec(25,"async"),h.qc()),2&e&&(h.Ub(2),h.Mc("title","Check Out"),h.Ub(1),h.Mc("ngClass",h.Tc(34,Nd,!h.Fc(4,22,t.isMobile$),h.Fc(5,24,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(7,26,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(9,28,t.isMobile$)?0:18),h.Ub(9),h.rd(null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("isDpms",!0)("isDpmsSubsequentPage",!0)("header1","Investment Amt.")("header3","Subscription Fee")("tooltip3",t.systemSstRate>0?"8% SST, applicable to the Subscription Fee":null)("showEditBtn",!0)("showHeader3",!0)("tradeProductInfoList",t.tradeProductInfoList),h.Ub(1),h.Mc("nzSpan",h.Fc(21,30,t.isMobile$)?24:6),h.Ub(2),h.Mc("ngIf",t.refno),h.Ub(2),h.Mc("addedDpms",h.Fc(25,32,t.cartList$))("selectedDpmsName",t.selectedDpmsName)("selectedDpmsDetail",t.selectedDpmsDetail)("show",t.showDpmsFillDetail)("refno",t.refno)("isLoading",t.isLoadingFillDetail)("isUpdate",t.isUpdate))}
5,directives:[z.a,D.a,p.q,P.c,P.a,I.a,k.b,A.a,p.t,Xr,Ld,ut.a],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function _d(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.value,e.currencyCode)," ")}}function Vd(e,t){if(1&e&&(h.rc(0,"div",11),h.rc(1,"b2c-order-cart",12),h.rc(2,"nz-row"),h.mc(3,"b2b-statistic",13),h.od(4,_d,2,4,"ng-template",null,14,h.pd),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.ad(5),i=h.Dc();h.Ub(1),h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",i.orderCartConstant.PENDING)("paymentTitle",e.title),h.Ub(2),h.Mc("value",n)}}function Hd(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"shared-approve-action",15),h.zc("emitCancel",(function(){return h.dd(e),h.Dc().onHandleCancel()}))("onApprove",(function(t){return h.dd(e),h.Dc().onClickApprove(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("refno",e.refno)("requestKey",e.APPROVE_TRADE_REQUEST_KEY)("actionKey",e.DPMS_SELL_ACTION_KEY)("width",600)}}const $d=function(e){return{"py-3 bg-white shadow mb-6":e}},jd=function(e){return{"px-2":e}};let Gd=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.subHandlingService=t,this.transactionDpmsRestService=n,this.router=i,this.transactionService=c,this.accountRestService=o,this.twoFaService=s,this.orderCartConstant=O.a,this.liveUrl=M.a.LIVE_URL,this.cartDisplayListModel=[],this.dpmsSellModels=[],this.showErrorMessageModal=!1,this.isLoading=!1,this.orderNo=[],this.salesOrderNo="SALES ORDER NUMBER XXXX",this.approving=!1,this.APPROVE_TRADE_REQUEST_KEY=R.a.APPROVE_TRADE,this.DPMS_SELL_ACTION_KEY=L.a.DPMS_SELL}ngOnInit(){this.store.dispatch(new N.b),this.cartList$=this.store.select(u.H.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.cartLength$=this.store.select(u.H.getCartLength).pipe(Object(S.a)(e=>
5e(this.refno))),this.getCheckOutCartData(),this.getSellInfoModel()}getCheckOutCartData(){this.cartDisplayListModel=[],this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.checkOutCartData=this.groupByPaymentMethod(e,"cartRedemptionMethodDisplay"),this.cartDisplayListModel=Object.keys(this.checkOutCartData).map(e=>({title:e,value:parseFloat(this.checkOutCartData[e].value),currencyCode:this.checkOutCartData[e].currencyCode})),console.log(this.checkOutCartData)})))}groupByPaymentMethod(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.dpmsSellModel.currency},n.push(e[i[t]])),e[i[t]].value+=i.indicativeRedemptionAmount,e),{})}proceedOrderPlaced(){this.approving=!0}onHandleCancel(){this.approving=!1}onClickApprove(e){this.onHandleCancel(),this.isLoading=!0;const t=Object(g.a)(this.dpmsSellModels);this.subHandlingService.once(e.pipe(Object(E.a)(e=>{let n=Object(g.a)(this.store.selectSnapshot(u.X.getBankAccountToCreate));return n.length>0&&null!==e?this.createBankAndOrder(n,e,t):this.createOrder(t,e)}),Object(F.a)(()=>this.store.dispatch(new N.e(!1,!0)))))}onCloseErrorMessage(){this.showErrorMessageModal=!1}getSellInfoModel(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.dpmsSellModels=[];for(let t of e)this.dpmsSellModels.push(t.dpmsSellModel)})))}createOrder(e,t){return this.transactionDpmsRestService.confirmOrderSell(this.refno,e,t).pipe(this.twoFaService.intercept(),Object(y.a)(e=>{if(e.status!==M.a.RESPONSE_SUCCESS)return this.errorMessage=e.errorMessage,this.showErrorMessageModal=!0,void(this.isLoading=!1);this.salesOrderNo=e.data.orderNo,this.transactionService.updateSellDpmsOrderStatusToOrderPlaced(),this.isLoading=!1,this.store.dispatch(new u.r),this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.ORDER_PLACED)],{queryParams:{poNumber:this.salesOrderNo,refno:this.refno}})}))}createBankAndOrder(e,t,n){let i=[];for(let c of e){const e=Object.assign(Object.assign({},c),t);c.refno===this.refno&&i.push(this.accountRestService.createBankDetails(this.refno,e))}return Object(ht.a)(i).pipe(Object(E.a)(()=>this.createOrder(n,t)))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(Hr.a),h.lc(c.e),h.lc(C.a),h.lc(bt.a),h.lc(x.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-sell-checkout-cart-sider"]],inputs:{refno:"refno"},features:[h.Tb([l.a,x.a])],decls:47,vars:23,consts:[[3,"ngClass"],[1,"font-weight-bold"],["class","mb-3 pb-3",4,"ngFor","ngForOf"],[1,"overflow-auto","mb-3",2,"height","250px"],[1,"text-sm"],["target","_blank",1,"text-link",3,"href"],["target","_blank",1,"text-link","ng-scope",3,"href"],["nz-button","","nzType","primary",1,"font-weight-bold","mb-2","mt-4","w-100",3,"disabled","nzLoading","click"],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"nzLoading","click"],[4,"ngIf"],[3,"errorMessage","showErrorMessageModal","closeErrorMessageModal"],[1,"mb-3","pb-3"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle"],["horizontal","true","title","Total Indicative Amt.",3,"value"],["valueTemplate",""],[3,"refno","requestKey","actionKey","width","emitCancel","onApprove"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.Ec(1,"async"),h.rc(2,"div",0),h.Ec(3,"async"),h.rc(4,"p",1),h.qd(5," Total Indicative Redemption Amt."),h.qc(),h.od(6,Vd,6,5,"div",2),h.rc(7,"div",3),h.rc(8,"p",4),h.qd(9," I/we have received, read and understood and agreed the relevant Mandate, "),h.rc(10,"b"),h.rc(11,"a",5),h.qd(12," Risk Disclosure Statement "),h.qc(),h.qd(13,", "),h.rc(14,"a",5),h.qd(15," Loan Financing Risk Disclosure Statement "),h.qc(),h.qd(16,", "),h.rc(17,"a",5),h.qd(18," Investment Account Terms and Conditions "),h.qc(),h.qd(19,", "),h.rc(20,"a",6),h.qd(21," Managed Portfolios Terms and Conditions "),h.qc(),h.qc(),h.qd(22," and hereby authorize iFAST with the discretionary authority (including but not limited to the frequency, scope and methodology of rebalancing) to execute transactions on my/our behalf for the purpose of managing my/our investment under the selected portfolio(s). "),h.qc(),h.rc(23,"p",4),h.qd(24," All investment involves risk and I/we are solely responsible for the decision made on the investment. In acting upon my/our investment instructions, I/we fully understand the consequences of my/our investment choice, and hereby irrevocably indemnify FSM from and against all losses, damages, costs and expenses whatsoever legal or otherwise, which I may sustain, suffer or incur as a result of the performance of any investment(s) and/or currency conversion connected with any transaction(s) for the account. "),h.qc(),h.rc(25,"p",4),h.qd(26," I/we agree that you may transfer and disclose any information relating to me and my/our account, which is necessary for carrying out these services and/or for compliance, to relevant entities and regulators. "),h.qc(),h.rc(27,"p",4),h.qd(28," I/we declare that I/we am/are the ultimate Beneficial Owner of this account and that no person other than myself/ourselves have or will have any interest in, influence or control over this account, whatsoever. "),h.qc(),h.rc(29,"p",4),h.qd(30," I/we declare that I/we am/are not a U.S person and in the event of a change in my/our status that I/we become a U.S person, I shall notify FSM of the change. "),h.qc(),h.rc(31,"p",4),h.qd(32," I/we am/are aware that FSM (iFAST) has appointed Malayan Banking Berhad (Reg No 787435-M) as the custodian for FSM Managed Portfolio. "),h.qc(),h.rc(33,"p",4),h.qd(34," I/we am/are aware that I/we may receive reports, statements or any other documents in relation to the portfolio investment from Malayan Banking Berhad by mail, courier, fax transmission or by such other means as the Custodian may designate from time to time. "),h.qc(),h.rc(35,"p",4),h.qd(36," Corporate account transactions (if applicable): By submitting the transactions, the above declarations would have deemed to be made by the authorized signatories on behalf of the entity/body/business. "),h.qc(),h.qc(),h.qc(),h.rc(37,"app-web-scaffold"),h.rc(38,"button",7),h.zc("click",(function(){return t.proceedOrderPlaced()})),h.Ec(39,"async"),h.qd(40," Submit Transaction "),h.qc(),h.qc(),h.rc(41,"app-mobile-scaffold"),h.rc(42,"b2c-floating-bar"),h.rc(43,"button",8),h.zc("click",(function(){return t.proceedOrderPlaced()})),h.qd(44," Submit Transaction "),h.qc(),h.qc(),h.qc(),h.qc(),h.od(45,Hd,2,4,"ng-container",9),h.rc(46,"checkout-error-message-modal",10),h.zc("closeErrorMessageModal",(function(){return t.onCloseErrorMessage()})),h.qc()),2&e&&(h.Mc("ngClass",h.Sc(19,$d,h.Fc(1,13,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(21,jd,h.Fc(3,15,t.isMobile$))),h.Ub(4),h.Mc("ngForOf",t.cartDisplayListModel),h.Ub(5),h.Mc("href",t.liveUrl+"/download/B2C_DPMS_Risk_Disclosure_Statement.pdf",h.gd),h.Ub(3),h.Mc("href",t.liveUrl+"/download/B2C_DPMS_Loan_Risk_Disclosure_Statement.pdf",h.gd),h.Ub(3),h.Mc("href",t.liveUrl+"/download/B2C_Investment_Terms_And_Conditions.pdf",h.gd),h.Ub(3),h.Mc("href",t.liveUrl+"/download/B2C_Managed_Portfolios_Terms_And_Conditions.pdf",h.gd),h.Ub(18),h.Mc("disabled",0===h.Fc(39,17,t.cartLength$))("nzLoading",t.isLoading||t.approv
5ing),h.Ub(5),h.Mc("nzLoading",t.isLoading||t.approving),h.Ub(2),h.Mc("ngIf",t.approving),h.Ub(1),h.Mc("errorMessage",t.errorMessage)("showErrorMessageModal",t.showErrorMessageModal))},directives:[p.q,p.s,B.a,_.a,z.a,Se.a,p.t,ne,ge.a,P.c,be.c,ye.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Wd(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",23),h.qd(2," Please make sure this field is not blank. "),h.qc())}function Yd(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",23),h.qd(3),h.Ec(4,"currencyFormat"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd(" The Min. Redemption is ",h.Gc(4,1,null==e.selectedDpms?null:e.selectedDpms.minRedemptionNum,null==e.selectedDpms?null:e.selectedDpms.dpmsCurrencyCode)," ")}}function Kd(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",23),h.qd(3),h.Ec(4,"currencyFormat"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd(" The Min. Holdings is ",h.Gc(4,1,null==e.selectedDpms?null:e.selectedDpms.minRetainNum,null==e.selectedDpms?null:e.selectedDpms.dpmsCurrencyCode)," ")}}function Xd(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"span"),h.mc(2,"i",23),h.qd(3," The Max. Percentage is 100%. "),h.qc(),h.qc())}function Qd(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",24),h.qd(2),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.sd(" ",null==e.redemptionPercentage?null:e.redemptionPercentage.getError("invalidDpmsSell")," ")}}function Zd(e,t){if(1&e&&h.mc(0,"ui-option",25),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function Jd(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.mc(1,"i",23),h.qd(2," Please make sure this field is not blank. "),h.qc())}function eu(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"div",26),h.mc(2,"i",23),h.qd(3," Please note that your selected redemption method is Non Syariah Compliance parking facility. "),h.qc(),h.qc())}function tu(e,t){if(1&e){const e=h.sc();h.rc(0,"form",9),h.rc(1,"nz-row",10),h.rc(2,"nz-col",11),h.Ec(3,"async"),h.rc(4,"nz-form-item",12),h.rc(5,"nz-form-control"),h.rc(6,"ui-input-group",13),h.mc(7,"input",14),h.qc(),h.od(8,Wd,3,0,"nz-form-explain",15),h.od(9,Yd,5,4,"nz-form-explain",15),h.od(10,Kd,5,4,"nz-form-explain",15),h.od(11,Xd,4,0,"nz-form-explain",15),h.od(12,Qd,3,1,"nz-form-explain",15),h.qc(),h.qc(),h.qc(),h.rc(13,"nz-col",11),h.Ec(14,"async"),h.rc(15,"nz-form-item",12),h.rc(16,"nz-form-control"),h.rc(17,"ui-input-group",16),h.mc(18,"input",17),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(19,"label",18),h.zc("nzCheckedChange",(function(t){return h.dd(e),h.Dc().onSellAllCheckChange(t)})),h.qd(20," Sell All "),h.qc(),h.qc(),h.rc(21,"nz-row",19),h.rc(22,"nz-col",11),h.Ec(23,"async"),h.rc(24,"nz-form-item",20),h.rc(25,"nz-form-control"),h.rc(26,"ui-select",21),h.zc("ngModelChange",(function(){return h.dd(e),h.Dc().checkSyariah()})),h.od(27,Zd,1,2,"ui-option",22),h.qc(),h.od(28,Jd,3,0,"nz-form-explain",15),h.od(29,eu,4,0,"nz-form-explain",15),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(2),h.Mc("nzSpan",h.Fc(3,16,e.isMobile$)?24:10),h.Ub(5),h.Mc("formControl",e.redemptionPercentage),h.Ub(1),h.Mc("ngIf",(null==e.redemptionPercentage?null:e.redemptionPercentage.dirty)&&(null==e.redemptionPercentage?null:e.redemptionPercentage.hasError("required"))),h.Ub(1),h.Mc("ngIf",e.redemptionPercentage.dirty&&e.redemptionPercentage.hasError("invalidMinRedemption")),h.Ub(1),h.Mc("ngIf",e.redemptionPercentage.dirty&&e.redemptionPercentage.hasError("invalidMinHolding")),h.Ub(1),h.Mc("ngIf",e.redemptionPercentage.dirty&&e.redemptionPercentage.hasError("max")),h.Ub(1),h.Mc("ngIf",e.redemptionPercentage.dirty&&(null==e.redemptionPercentage?null:e.redemptionPercentage.hasError("invalidDpmsSell"))),h.Ub(1),h.Mc("nzSpan",h.Fc(14,18,e.isMobile$)?24:14),h.Ub(4),h.Mc("nzSuffix",null==e.selectedDpms?null:e.selectedDpms.dpmsCurrencyCode),h.Ub(1),h.Mc("formControl",e.indicativeRedemptionAmount),h.Ub(1),h.Mc("nzChecked",null==e.redeemAll?null:e.redeemAll.value),h.Ub(3),h.Mc("nzSpan",(h.Fc(23,20,e.isMobile$),24)),h.Ub(4),h.Mc("formControl",e.redemptionMethod),h.Ub(1),h.Mc("ngForOf",e.availableRedemptionMethod),h.Ub(1),h.Mc("ngIf",(null==e.redemptionMethod?null:e.redemptionMethod.dirty)&&(null==e.redemptionMethod?null:e.redemptionMethod.hasError("required"))),h.Ub(1),h.Mc("ngIf",e.showNonSyariah)}}function nu(e,t){if(1&e&&(h.rc(0,"nz-spin",27),h.mc(1,"nz-skeleton",28),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzActive",!0)("nzLoading",e.isLoading)}}function iu(e,t){if(1&e&&(h.rc(0,"strong",29),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Ub(1),h.rd(e.nzLabel)}}let cu=(()=>{class e{constructor(e,t,n,i,c,o,s){this.fb=e,this.store=t,this.subHandlingService=n,this.accountRestService=i,this.transactionDpmsRestService=c,this.transactionService=o,this.currencyFormatService=s,this.addedDpms=[],this.closed=new h.s,this.bankRequired=new h.s,this.availableRedemptionMethod=[],this.localBanks=[],this.overseaBanks=[],this.isLoading=!1,this.transactionConstant=U.a,this.showNonSyariah=!1}ngOnInit(){this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.getBankDetail
5sAndRedemptionMethod(),this.form=this.fb.group({redemptionPercentage:["",[oe.H.required,Object(Oc.p)(this.selectedDpms.minRedemptionNum,this.selectedDpms.availableValue),Object(Oc.m)(this.selectedDpms.minRetainNum,this.selectedDpms.availableValue),oe.H.max(100)]],indicativeRedemptionAmount:[{value:"",disabled:!0}],redeemAll:[!1],redemptionMethod:["",[oe.H.required]],dpmsPortfolioId:[this.selectedDpms.productCode]}),this.isUpdate&&this.updateForm(),this.subscribeRedemptionPercentage()}get redemptionPercentage(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redemptionPercentage")}get indicativeRedemptionAmount(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("indicativeRedemptionAmount")}get redeemAll(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redeemAll")}get redemptionMethod(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("redemptionMethod")}onSellAllCheckChange(e){this.redeemAll.patchValue(e),this.redemptionPercentage.patchValue(e?100:"")}getBankDetailsAndRedemptionMethod(){this.isLoading=!0,this.subHandlingService.once(this.accountRestService.getBankDetails(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.bankDetails=e.data,this.localBanks=e.data.Local,this.overseaBanks=e.data.Overseas,this.getAvailableRedemptionMethod())})))}get existingBank(){var e,t;const n=this.store.selectSnapshot(u.X.getBankAccountToCreate);return(null===(e=this.localBanks)||void 0===e?void 0:e.find(e=>{var t;return e.currency===(null===(t=this.selectedDpms)||void 0===t?void 0:t.dpmsCurrencyCode)}))||(null===(t=this.overseaBanks)||void 0===t?void 0:t.find(e=>{var t;return e.currency===(null===(t=this.selectedDpms)||void 0===t?void 0:t.dpmsCurrencyCode)}))||(null==n?void 0:n.find(e=>e.currency===this.selectedDpms.dpmsCurrencyCode))}getAvailableRedemptionMethod(){var e,t;this.availableRedemptionMethod=null===(t=null==Object?void 0:Object.keys(null===(e=this.selectedDpms)||void 0===e?void 0:e.availableRedemptionMethodWithParkingFacilityFund))||void 0===t?void 0:t.map(e=>{var t,n,i,c,o,s,a;console.log("come in : "),console.log(this.selectedDpms);let l=null===(t=this.selectedDpms)||void 0===t?void 0:t.availableRedemptionMethodWithParkingFacilityFund[e].displayName,r=null===(n=this.selectedDpms)||void 0===n?void 0:n.availableRedemptionMethodWithParkingFacilityFund[e].paymentMode,d=null===(i=this.selectedDpms)||void 0===i?void 0:i.availableRedemptionMethodWithParkingFacilityFund[e].sedolnumber;if(r===U.a.TRUST_ACCOUNT&&(l=(null===(c=this.selectedDpms)||void 0===c?void 0:c.dpmsCurrencyCode)+" Cash Account"),r===U.a.CHEQUE.toLowerCase())if(this.existingBank){let e=Object(Uc.a)("*",this.existingBank.bankAcctNo);null===e&&(e=null===(o=this.selectedDpms)||void 0===o?void 0:o.dpmsCurrencyCode),l="Credit to Bank Acc ["+e+"]"}else l="Direct Credit (GIRO)";return r===U.a.AUTO_SWEEP&>.a.AUTO_SWEEP_CURRENCY.includes(null===(s=this.selectedDpms)||void 0===s?void 0:s.dpmsCurrencyCode)&&"MYR"===(null===(a=this.selectedDpms)||void 0===a?void 0:a.dpmsCurrencyCode)&&(l="MYR Auto-Sweep"),{label:l,value:this.getAvailableRedemptionMethodValue(r,d)}})}getAvailableRedemptionMethodValue(e,t){var n,i;return e===U.a.CASH_FUND?U.a.CASH_FUND+"|"+t:e===U.a.AUTO_SWEEP&>.a.AUTO_SWEEP_CURRENCY.includes(null===(n=this.selectedDpms)||void 0===n?void 0:n.dpmsCurrencyCode)&&"MYR"===(null===(i=this.selectedDpms)||void 0===i?void 0:i.dpmsCurrencyCode)?U.a.AUTO_SWEEP:e}subscribeRedemptionPercentage(){this.subHandlingService.subscribe(this.redemptionPercentage.valueChanges.pipe(Object(ce.a)(100),Object(b.a)(),Object(y.a)(e=>{if(this.getDecimalLength(e)>2&&this.redemptionPercentage.patchValue(Object(Uc.b)(e),{emitEvent:!1}),e>=100)return this.redeemAll.patchValue(!0),this.redemptionPercentage.patchValue(100,{emitEvent:!1}),this.indicativeRedemptionAmount.patchValue(this.currencyFormatService.formatNumber(this.selectedDpms.availableValue,this.selectedDpms.dpmsCurrencyCode)),this.redemptionPercentage.setValidators([oe.H.required,oe.H.max(100)]),void this.redemptionPercentage.updateValueAndValidity();this.redeemAll.patchValue(!1),this.indicativeRedemptionAmount.patchValue(this.currencyFormatService.formatNumber(this.selectedDpms.availableValue*this.redemptionPercentage.value/100,this.selectedDpms.dpmsCurrencyCode)),this.redemptionPercentage.setValidators([oe.H.required,Object(Oc.p)(this.selectedDpms.minRedemptionNum,this.selectedDpms.availableValue),Object(Oc.m)(this.selectedDpms.minRetainNum,this.selectedDpms.availableValue),oe.H.max(100)]),this.redemptionPercentage.updateValueAndValidity()})))}getDecimalLength(e){var t;return Math.floor(e)===e?0:(null===(t=null==e?void 0:e.toString().split(".")[1])||void 0===t?void 0:t.length)||0}updateForm(){var e;const t=null===(e=this.addedDpms)||void 0===e?void 0:e.find(e=>{var t;
5return e.dpmsSellModel.dpmsPortfolioId===(null===(t=this.selectedDpms)||void 0===t?void 0:t.productCode)});this.redemptionPercentage.patchValue(null==t?void 0:t.dpmsSellModel.redemptionPercentage),this.redeemAll.patchValue((null==t?void 0:t.indicativeRedemptionAmount)===this.currencyFormatService.formatInputNumber(this.selectedDpms.availableValue,this.selectedDpms.dpmsCurrencyCode)),this.redemptionMethod.patchValue(null==t?void 0:t.redemptionMethod),this.indicativeRedemptionAmount.patchValue(this.currencyFormatService.formatNumber(null==t?void 0:t.indicativeRedemptionAmount,this.selectedDpms.dpmsCurrencyCode)),this.checkSyariah()}addOrUpdateCart(){var e;if(Object(zn.c)(this.form),this.form.invalid)return;if((null===(e=this.redemptionMethod)||void 0===e?void 0:e.value)===U.a.CHEQUE.toLowerCase())return void this.checkUserBankExistAndValidateCart();const t=this.mapDpmsSellData();this.validateDpmsSellCart(t)}mapDpmsSellData(){var e,t=null===(e=this.redemptionMethod)||void 0===e?void 0:e.value,n="";if(-1!=t.indexOf(U.a.CASH_FUND)){const e=t.split("|");t=e[0],n=e[1]}return{paymentMode:t,currency:this.selectedDpms.dpmsCurrencyCode,redemptionPercentage:this.redemptionPercentage.value,redeemAll:this.redeemAll.value?"Y":null,dpmsPortfolioId:this.selectedDpms.productCode,cashFundSedol:n}}cancelOrRemoveCart(){this.isUpdate&&this.transactionService.removeSellDpmsCartInfo(this.selectedDpms.productCode),this.closed.emit()}checkUserBankExistAndValidateCart(){this.isValidating=!0,this.subHandlingService.once(this.accountRestService.getRedemptionBankDetails(this.refno,this.selectedDpms.dpmsCurrencyCode).pipe(Object(E.a)(e=>{var t;const n=!!this.store.selectSnapshot(u.X.getBankAccountToCreate).find(e=>{var t;return e.currency===(null===(t=this.selectedDpms)||void 0===t?void 0:t.dpmsCurrencyCode)});if(!e.data&&!n)return this.bankRequired.emit(null===(t=this.selectedDpms)||void 0===t?void 0:t.dpmsCurrencyCode),void(this.isValidating=!1);const i=this.mapDpmsSellData();return this.transactionDpmsRestService.validateSellCart(this.refno,i)}),Object(y.a)(e=>{var t;this.isValidating=!1,e.status!==M.a.RESPONSE_FAILED?(this.isUpdate?this.transactionService.updateSellDpmsCartInfo(this.form,this.selectedDpms,this.availableRedemptionMethod):this.transactionService.storeSellDpmsCart(this.form,this.selectedDpms,this.availableRedemptionMethod),this.closed.emit()):null===(t=this.redemptionPercentage)||void 0===t||t.setErrors({invalidDpmsSell:null==e?void 0:e.errorMessage})})))}validateDpmsSellCart(e){this.isValidating=!0,this.subHandlingService.once(this.transactionDpmsRestService.validateSellCart(this.refno,e).pipe(Object(y.a)(e=>{var t;this.isValidating=!1,e.status!==M.a.RESPONSE_FAILED?(this.isUpdate?this.transactionService.updateSellDpmsCartInfo(this.form,this.selectedDpms,this.availableRedemptionMethod):this.transactionService.storeSellDpmsCart(this.form,this.selectedDpms,this.availableRedemptionMethod),this.closed.emit()):null===(t=this.redemptionPercentage)||void 0===t||t.setErrors({invalidDpmsSell:null==e?void 0:e.errorMessage})})))}checkSyariah(){this.showNonSyariah=!1;let e=this.selectedDpms.syariahFlag;e&&"Y"==e&&(this.redemptionMethod.value!=U.a.TRUST_ACCOUNT&&this.redemptionMethod.value!=U.a.CASH_FUND||(this.showNonSyariah=!0))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(oe.g),h.lc(s.i),h.lc(l.a),h.lc(bt.a),h.lc(Hr.a),h.lc(C.a),h.lc(Ct.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-sell-fill-detail-form"]],inputs:{selectedDpms:"selectedDpms",addedDpms:"addedDpms",isUpdate:"isUpdate"},outputs:{closed:"closed",bankRequired:"bankRequired"},features:[h.Tb([l.a])],decls:19,vars:8,consts:[[1,"font-weight-bold","pt-3","mb-2"],["nz-form","",4,"ngIf","ngIfElse"],[1,"text-right","mt-3"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",3,"nzLoading","click"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"nzLoading","click"],["loadingTemplate",""],["custom",""],["nz-form",""],["nzType","flex","nzGutter","16",1,"mb-2"],[3,"nzSpan"],[1,"mb-2"],["nzLabelPlaceholder","Sell Percentage (%)",1,"w-100"],["ui-input","","type","number","min","1","max","100",3,"formControl"],[4,"ngIf"],["nzLabelPlaceholder","Indicative Redemption Amount",1,"w-100",3,"nzSuffix"],["ui-input","",3,"formControl"],["nz-checkbox","",1,"ml-2",3,"nzChecked","nzCheckedChange"],["nzType","flex","nzGutter","16"],[1,"mb-0"],["nzPlaceHolder","Redemption Method",3,"formControl","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"inline-block"],[3,"nzLabel","nzValue"],[1,"text-warning","mt-2"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzActive","nzLoading"],[1,"text-black-7"]],template:function(e,t){if(1&e&&(h.rc(0,"p",0),h.qd(1,"Enter Redemption Details"),h.qc(),h.od(2,tu,30,22,"form",1),h.rc(3,"app-web-scaffold"),h.rc(4,"div",2),h.rc(5,"button",3),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(6),h.qc(),h.rc(7,"button",4),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(8),h.qc(),h.qc(),h.qc(),h.rc(9,"app-mobile-scaffold"),h.rc(10,"b2c-floating-bar"),h.rc(11,"button",5),h.zc("click",(function(){return t.cancelOrRemoveCart()})),h.qd(12),h.qc(),h.rc(13,"button",6),h.zc("click",(function(){return t.addOrUpdateCart()})),h.qd(14),h.qc(),h.qc(),h.qc(),h.od(15,nu,2,3,"ng-template",null,7,h.pd),h.od(17,iu,2,1,"ng-template",null,8,h.pd)),2&e){const e=h.ad(16);h.Ub(2),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isValidating),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart"),h.Ub(4),h.rd(t.isUpdate?"Remove":"Cancel"),h.Ub(1),h.Mc("nzLoading",t.isValidating),h.Ub(1),h.rd(t.isUpdate?"Update":"Add To Cart")}},directives:[p.t,B.a,_.a,z.a,Se.a,oe.J,oe.u,oe.v,se.b,P.c,P.a,se.e,se.a,ae.c,oe.z,oe.c,ae.b,oe.t,oe.i,lo.a,Lt.d,p.s,se.c,k.b,Lt.a,Il.a,W.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function ou(e,t){if(1&e){const e=h.sc();h.rc(0,"div",5),h.rc(1,"b2c-app-bar-2",6),h.zc("back",(function(){return h.dd(e),h.Dc().onBack()})),h.qc(),h.qc()}2&e&&(h.Ub(1),h.Mc("title","Edit Cart"))}function su(e,t){1&e&&h.nc(0)}function au(e,t){if(1&e){const e=h.sc();h.rc(0,"app-dpms-sell-fill-detail-form",18),h.zc("closed",(function(){return h.dd(e),h.Dc(3).onCancel()}))("bankRequired",(function(t){return h.dd(e),h.Dc(3).onBankRequired(t)})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("selectedDpms",e.selectedDpms)("addedDpms",e.addedDpms)("isUpdate",e.isUpdate)}}function lu(e,t){if(1&e){const e=h.sc();h.rc(0,"div",9),h.rc(1,"nz-row",10),h.rc(2,"nz-col",11),h.rc(3,"h3",12),h.qd(4),h.qc(),h.qc(),h.rc(5,"nz-col",13),h.rc(6,"i",14),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qc(),h.qc(),h.qc(),h.od(7,su,1,0,"ng-container",15),h.rc(8,"div",16),h.od(9,au,1,3,"app-dpms-sell-fill-detail-form",17),h.qc(),h.qc()}if(2&e){const e=h.Dc(2),t=h.ad(8);h.Ub(4),h.rd(null==e.selectedDpms?null:e.selectedDpms.productName),h.Ub(3),h.Mc("ngTemplateOutlet",t),h.Ub(2),h.Mc("ngIf",e.show)}}function ru(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",7),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.od(1,lu,10,3,"div",8),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzMaskClosable",!0)("nzClosable",!1)("nzWrapClassName","vertical-center-modal")("nzFooter",null)("nzWidth",600)("nzVisible",e.show),h.Ub(1),h.Mc("ngIf",e.selectedDpms)}}function du(e,t){1&e&&h.nc(0)}function uu(e,t){if(1&e){const e=h.sc();h.rc(0,"app-dpms-sell-fill-detail-form",18),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onCancel()}))("bankRequired",(function(t){return h.dd(e),h.Dc(2).onBankRequired(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedDpms",e.selectedDpms)("addedDpms",e.addedDpms)("isUpdate",e.isUpdate)}}function hu(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",19),h.rc(2,"div",20),h.rc(3,"h3",12),h.qd(4),h.qc(),h.rc(5,"div",21),h.od(6,du,1,0,"ng-container",15),h.qc(),h.rc(7,"div"),h.od(8,uu,1,3,"app-dpms-sell-fill-detail-form",17),h.qc(),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(),t=h.ad(8);h.Ub(4),h.rd(null==e.selectedDpms?null:e.selectedDpms.productName),h.Ub(2),h.Mc("ngTemplateOutlet",t),h.Ub(2),h.Mc("ngIf",e.show)}}const pu=function(e){return{"py-2":e}},mu=function(e){return{"border-bottom":e}};function fu(e,t){if(1&e&&(h.rc(0,"div",22),h.rc(1,"nz-row",23),h.Ec(2,"async"),h.rc(3,"nz-col",24),h.Ec(4,"async"),h.mc(5,"b2b-statistic",25),h.Ec(6,"async"),h.Ec(7,"currencyFormat"),h.qc(),h.qc(),h.rc(8,"nz-row",26),h.Ec(9,"async"),h.rc(10,"nz-col",24),h.Ec(11,"async"),h.Ec(12,"async"),h.mc(13,"b2b-statistic",25),h.Ec(14,"async"),h.Ec(15,"currencyFormat"),h.qc(),h.rc(16,"nz-col",24),h.Ec(17,"async"),h.Ec(18,"async"),h.mc(19,"b2b-statistic",25),h.Ec(20,"async"),h.Ec(21,"currencyFormat"),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Sc(46,pu,!h.Fc(2,17,e.isMobile$))),h.Ub(2),h.Mc("nzSpan",24)("ngClass",h.Sc(48,mu,h.Fc(4,19,e.isMobile$))),h.Ub(2),h.Mc("title","Indicated Net Managed Portfolios Value")("horizontal",h.Fc(6,21,e.isMobile$))("value",h.Gc(7,23,e.selectedDpms.availableValue,e.selectedDpms.dpmsCurrencyCode)),h.Ub(3),h.Mc("ngClass",h.Sc(50,pu,!h.Fc(9,26,e.isMobile$))),h.Ub(2),h.Mc("nzSpan",h.Fc(11,28,e.isMobile$)?24:10)("ngClass",h.Sc(52,mu,h.Fc(12,30,e.isMobile$))),h.Ub(3),h.Mc("title","Min. Redemption")("horizontal",h.Fc(14,32,e.isMobile$))("value",h.Gc(1
55,34,e.selectedDpms.minRedemptionNum,e.selectedDpms.dpmsCurrencyCode)),h.Ub(3),h.Mc("nzSpan",h.Fc(17,37,e.isMobile$)?24:10)("ngClass",h.Sc(54,mu,h.Fc(18,39,e.isMobile$))),h.Ub(3),h.Mc("title","Min. Holdings")("horizontal",h.Fc(20,41,e.isMobile$))("value",h.Gc(21,43,e.selectedDpms.minRetainNum,e.selectedDpms.dpmsCurrencyCode))}}function gu(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bank-account-required-modal",29),h.zc("closed",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()}))("create",(function(){return h.dd(e),h.Dc(2).onBankAccountModalClosed()})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("refno",h.Fc(1,4,e.refno$))("otpRequired",!1)("show",e.showBankAccountRequiredModal)("selectedCurrency",e.selectedCurrency)}}const bu=function(){return{}},Su=function(){return{position:"fixed",top:"0",left:"0",width:"100%","z-index":"1050","padding-top":"80px"}};function yu(e,t){if(1&e&&(h.rc(0,"div",27),h.Ec(1,"async"),h.od(2,gu,2,6,"app-bank-account-required-modal",28),h.qc()),2&e){const e=h.Dc();h.Mc("ngStyle",h.Fc(1,2,e.isMobile$)?h.Rc(4,bu):h.Rc(5,Su)),h.Ub(2),h.Mc("ngIf",e.showBankAccountRequiredModal)}}let vu=(()=>{class e{constructor(){this.addedDpms=[],this.appBarBack=new h.s,this.closed=new h.s,this.showBankAccountRequiredModal=!1}ngOnInit(){this.isMobile$.subscribe(e=>this.isMobile=e)}onCancel(){this.closed.emit()}onBack(){this.appBarBack.emit()}onBankRequired(e){this.selectedCurrency=e,this.showBankAccountRequiredModal=!0,this.isMobile||(this.show=!1)}onBankAccountModalClosed(){this.showBankAccountRequiredModal=!1,this.show=!0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-sell-fill-detail"]],inputs:{selectedDpms:"selectedDpms",addedDpms:"addedDpms",isUpdate:"isUpdate",show:"show"},outputs:{appBarBack:"appBarBack",closed:"closed"},decls:10,vars:8,consts:[["class","border-bottom",4,"ngIf"],[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel",4,"ngIf"],[4,"ngIf"],["sellDpmsDetailInfo",""],[3,"ngStyle",4,"ngIf"],[1,"border-bottom"],[3,"title","back"],[3,"nzMaskClosable","nzClosable","nzWrapClassName","nzFooter","nzWidth","nzVisible","nzOnCancel"],["class","p-2",4,"ngIf"],[1,"p-2"],["nzType","flex","nzAlign","top"],["nzSpan","22",1,"text-left"],[1,"header-line"],["nzSpan","2",1,"text-right"],["nz-icon","","nzType","close","nzTheme","outline",1,"h3","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"mt-2"],[3,"selectedDpms","addedDpms","isUpdate","closed","bankRequired",4,"ngIf"],[3,"selectedDpms","addedDpms","isUpdate","closed","bankRequired"],[1,"bg-white","shadow","mb-6","py-3"],[1,"px-2"],[1,"mb-4"],[1,"bg-black-2","px-2","py-3"],["nzType","flex","nzAlign","middle",3,"ngClass"],[3,"nzSpan","ngClass"],[3,"title","horizontal","value"],["nzType","flex","nzAlign","left",3,"ngClass"],[3,"ngStyle"],[3,"refno","otpRequired","show","selectedCurrency","closed","create",4,"ngIf"],[3,"refno","otpRequired","show","selectedCurrency","closed","create"]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,ou,2,1,"div",0),h.qc(),h.od(2,ru,2,7,"nz-modal",1),h.Ec(3,"async"),h.rc(4,"app-mobile-scaffold"),h.od(5,hu,9,3,"ng-container",2),h.Ec(6,"async"),h.qc(),h.od(7,fu,22,56,"ng-template",null,3,h.pd),h.od(9,yu,3,6,"div",4)),2&e&&(h.Ub(1),h.Mc("ngIf",t.show),h.Ub(1),h.Mc("ngIf",!h.Fc(3,4,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(6,6,t.isMobile$)&&t.show),h.Ub(4),h.Mc("ngIf",t.showBankAccountRequiredModal))},directives:[z.a,p.t,D.a,j.a,P.c,P.a,k.b,p.A,cu,p.q,be.c,p.w,xn.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const Mu=function(e,t){return{"container mt-5":e,"w-100":t}};let Cu=(()=>{class e{constructor(e,t,n,i){this.store=e,this.subHandlingService=t,this.route=n,this.transactionDpmsRestService=i,this.tradeProductInfoList=[],this.dpmsHoldingList=[]}ngOnInit(){this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)}),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartLength$=this.store.select(u.H.getCartLength).pipe(Object(S.a)(e=>
5e(this.refno))),this.checkCartLength(),this.getSelectedInvestmentAcctData()}checkCartLength(){this.subHandlingService.subscribe(this.cartLength$.pipe(Object(y.a)(e=>{0===e&&this.route.navigate([M.o.APP,M.o.TRADE,M.o.DPMS,M.o.SELL])})))}getSelectedInvestmentAcctData(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno),this.getDpmsHoldingList(),this.cartList$=this.store.select(u.H.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getTradeProductInfoData(),this.getCartData()}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>this.filterData(e))})))}filterData(e){return{paymentMethod:e.cartRedemptionMethodDisplay,dpmsPortfolioName:e.dpmsPortfolioName,dpmsPortfolioId:e.dpmsSellModel.dpmsPortfolioId,redemptionCurrency:e.dpmsSellModel.currency,indicativeAmount:e.indicativeRedemptionAmount,redemptionPercentage:e.dpmsSellModel.redemptionPercentage}}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e})))}getDpmsHoldingList(){this.isLoading=!0,this.subHandlingService.once(this.transactionDpmsRestService.getDpmsHoldingList(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.holdingDisplayModel=e.data,this.dpmsHoldingList=this.holdingDisplayModel.map(e=>Object.assign(Object.assign({},e),{productName:e.productName.replace("FSM","").trim()})))})))}onBackPress(){this.route.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.DPMS,M.o.SELL)])}onClickEdit(e){this.selectedDpms=this.dpmsHoldingList.find(t=>t.productCode===e),this.showDpmsFillDetail=!0}onDpmsFillDetailClosed(){this.showDpmsFillDetail=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(c.e),h.lc(Hr.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-sell-checkout"]],features:[h.Tb([l.a])],decls:28,vars:34,consts:[[1,"bg-lighter","mb-6"],[1,"border-bottom"],[3,"title","back"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],["nz-icon","","nzTheme","outline","nzType","arrow-left",1,"pointer","pr-2",3,"click"],[1,"text-md"],[1,"infinite-container","mt-2"],[3,"isDpms","isDpmsSubsequentPage","header1","header2","showEditBtn","tradeProductInfoList","fromSellCheckOut","isLoading","editDpmsAction"],[1,"text-xs","text-black-6"],[3,"refno"],[3,"selectedDpms","isUpdate","show","addedDpms","closed","appBarBack"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"app-mobile-scaffold"),h.rc(2,"div",1),h.rc(3,"b2c-app-bar-2",2),h.zc("back",(function(){return t.onBackPress()})),h.qc(),h.qc(),h.qc(),h.rc(4,"div",3),h.Ec(5,"async"),h.Ec(6,"async"),h.rc(7,"nz-row",4),h.Ec(8,"async"),h.rc(9,"div",5),h.Ec(10,"async"),h.rc(11,"nz-card",6),h.rc(12,"p"),h.qd(13,"Home / Trade"),h.qc(),h.rc(14,"h3"),h.rc(15,"i",7),h.zc("click",(function(){return t.onBackPress()})),h.qc(),h.qd(16," Check Out "),h.qc(),h.rc(17,"p",8),h.qd(18),h.qc(),h.rc(19,"div",9),h.rc(20,"app-trade-product-info",10),h.zc("editDpmsAction",(function(e){return t.onClickEdit(e)})),h.qc(),h.qc(),h.rc(21,"p",11),h.qd(22,"*Amount calculated by the latest available NAV price."),h.qc(),h.qc(),h.qc(),h.rc(23,"div",5),h.Ec(24,"async"),h.mc(25,"app-dpms-sell-checkout-cart-sider",12),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(26,"app-dpms-sell-fill-detail",13),h.zc("closed",(function(){return t.onDpmsFillDetailClosed()}))("appBarBack",(function(){return t.onDpmsFillDetailClosed()})),h.Ec(27,"async"),h.qc()),2&e&&(h.Ub(3),h.Mc("title","Check Out"),h.Ub(1),h.Mc("ngClass",h.Tc(31,Mu,!h.Fc(5,19,t.isMobile$),h.Fc(6,21,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(8,23,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(10,25,t.isMobile$)?0:18),h.Ub(9),h.sd(" ",null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay,""),h.Ub(2),h.Mc("isDpms",!0)("isDpmsSubsequentPage",!0)("header1","Redemption Percentage")("header2","Indicative Amt.*")("showEditBtn",!0)("tradeProductInfoList",t.tradeProductInfoList)("fromSellCheckOut",!0)("isLoading",t.isLoading),h.Ub(3),h.Mc("nzSpan",h.Fc(24,27,t.isMobile$)?24:6),h.Ub(2),h.Mc("refno",t.refno),h.Ub(1),h.Mc("selectedDpms",t.selectedDpms)("isUpdate",!0)("show",t.showDpmsFillDetail)("addedDpms",h.Fc(27,29,t.cartList$)))},directives:[z.a,D.a,p.q,P.c,P.a,I.a,k.b,A.a,Gd,vu],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function qu(e,t){1&e&&h.mc(0,"app-fund-buy-check-out")}function Tu(e,t){1&e&&h.mc(0,"app-fund-sell-check-out")}function wu(e,t){1&e&&h.mc(0,"fund-switch-checkout")}function zu(e,t){if(1&e&&(h.pc(0),h.pc(1,0),h.od(2,qu,1,0,"app-fund-buy-check-out",1),h.od(3,Tu,1,0,"app-fund-sell-check-out",1),h.od(4,wu,1,0,"fund-switch-checkout",1),h.oc(),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngSwitch",e.selectedTransactionType),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.BUY),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.SELL),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.SWITCH)}}function Du(e,t){1&e&&h.mc(0,"app-dpms-buy-checkout")}function Pu(e,t){1&e&&h.mc(0,"app-dpms-sell-checkout")}function Iu(e,t){if(1&e&&(h.pc(0),h.pc(1,0),h.od(2,Du,1,0,"app-dpms-buy-checkout",1),h.od(3,Pu,1,0,"app-dpms-sell-checkout",1),h.oc(),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngSwitch",e.selectedTransactionType),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.BUY),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.SELL)}}let ku=(()=>{class e{constructor(e){this.store=e,this.ITransactionTypeEnum=d.d,this.IProductEnum=r.b,this.selectedTransactionType=this.store.selectSnapshot(u.X.getSelectedTransactionType),this.selectedTradeProduct=this.store.selectSnapshot(u.X.getTradeProduct)}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["app-check-out"]],features:[h.Tb([l.a])],decls:3,vars:3,consts:[[3,"ngSwitch"],[4,"ngSwitchCase"]],template:function(e,t){1&e&&(h.pc(0,0),h.od(1,zu,5,4,"ng-container",1),h.od(2,Iu,4,3,"ng-container",1),h.oc()),2&e&&(h.Mc("ngSwitch",t.selectedTradeProduct),h.Ub(1),h.Mc("ngSwitchCase",t.IProductEnum.UNIT_TRUST),h.Ub(1),h.Mc("ngSwitchCase",t.IProductEnum.DPMS))},directives:[p.x,p.y,gc,Xs,Vr,Bd,Cu],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var Au=n("tqmv"),Eu=n("FP3H"),Fu=n("8/jC"),Ou=n("5+07"),Uu=n("IBvL"),xu=n("JEAp"),Lu=n("xeZY"),Ru=n("AytR"),Nu=n("5vDB");function Bu(e,t){1&e&&h.nc(0)}function _u(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.od(1,Bu,1,0,"ng-container",8),h.rc(2,"div",9),h.rc(3,"button",10),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qd(4,"Cancel"),h.qc(),h.rc(5,"button",11),h.zc("click",(function(){return h.dd(e),h.Dc(2).onRequest()})),h.qd(6,"Submit"),h.qc(),h.qc(),h.qc()}if(2&e){h.Dc(2);const e=h.ad(6);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function Vu(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",6),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.rc(1,"h3"),h.qd(2,"EPF Form Request"),h.qc(),h.od(3,_u,7,1,"div",7),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(8);h.Mc("nzVisible",e.isModalVisible)("nzFooter",null),h.Ub(3),h.Mc("ngIf",!e.loading)("ngIfElse",t)}}function Hu(e,t){if(1&e&&h.nc(0,15),2&e){h.Dc(2);const e=h.ad(6);h.Mc("ngTemplateOutlet",e)}}function $u(e,t){if(1&e){const e=h.sc();h.rc(0,"div",12),h.rc(1,"b2c-app-bar",13),h.zc("back",(function(){return h.dd(e),h.Dc().onCancel()})),h.qc(),h.od(2,Hu,1,1,"ng-container",14),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(8);h.Ub(1),h.Mc("title","EPF Form Request"),h.Ub(1),h.Mc("ngIf",!e.loading)("ngIfElse",t)}}function ju(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",16),h.zc("click",(function(){return h.dd(e),h.Dc().onCancel()})),h.qd(2,"Cancel"),h.qc(),h.rc(3,"button",17),h.zc("click",(function(){return h.dd(e),h.Dc().onRequest()})),h.qd(4,"Submit"),h.qc(),h.qc()}}function Gu(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"a",32),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit,n=h.Dc(3);return n.openSampleDocument(t.sampleFileName?n.liveUrl+t.sampleFileName:n.liveUrl+t.fileName)})),h.qd(2,"Sample"),h.qc(),h.oc()}}function Wu(e,t){if(1&e){const e=h.sc();h.rc(0,"a",32),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit,n=h.Dc().$implicit,i=h.Dc(2);return i.openSampleDocument(t.sampleFileName?i.liveUrl+n.formCode+"/"+t.sampleFileName:i.liveUrl+n.formCode+"/"+t.fileName)})),h.qd(1,"Sample"),h.qc()}}function Yu(e,t){if(1&e&&(h.rc(0,"div"),h.mc(1,"p",30),h.od(2,Gu,3,0,"ng-container",7),h.od(3,Wu,2,0,"ng-template",null,31,h.pd),h.qc()),2&e){const e=t.$implicit,n=h.ad(4);h.Ub(1),h.Mc("innerHTML",e.displayName,h.ed),h.Ub(1),h.Mc("ngIf",e.displayName.includes("KWSP"))("ngIfElse",n)}}function Ku(e,t){if(1&e&&(h.rc(0,"div",27),h.rc(1,"p",28),h.qd(2),h.qc(),h.od(3,Yu,5,3,"div",29),h.qc()),2&e){const e=t.$implicit;h.Ub(2),h.rd(e.formId),h.Ub(1),h.Mc("ngForOf",null==e?null:e.fileModelList)}}function Xu(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.qd(1," Recipient Name cannot be blank. "),h.qc())}function Qu(e,t){1&e&&(h.rc(0,"nz-form-explain"),h.qd(1," Mailing Address cannot be blank. "),h.qc())}function Zu(e,t){if(1&e&&(h.rc(0,"div",18),h.rc(1,"span",19),h.qd(2,"Document Required"),h.qc(),h.mc(3,"nz-divider",20),h.od(4,Ku,4,2,"div",21),h.qc(),h.rc(5,"p",22),h.qd(6,"Document Request"),h.qc(),h.rc(7,"form",23),h.rc(8,"nz-form-item",24),h.rc(9,"nz-form-control"),h.rc(10,"ui-input-group",25),h.mc(11,"input",26),h.qc(),h.od(12,Xu,2,0,"nz-form-explain",2),h.qc(),h.qc(),h.rc(13,"nz-form-item",24),h.rc(14,"nz-form-control"),h.rc(15,"ui-input-group",25),h.mc(16,"input",26),h.qc(),h.od(17,Qu,2,0,"nz-form-explain",2),h.qc(),h.qc(),h.rc(18,"nz-form-item",24),h.rc(19,"nz-form-control"),h.rc(20,"ui-input-group",25),h.mc(21,"input",26),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(4),h.Mc("ngForOf",e.selectedList),h.Ub(3),h.Mc("formGroup",e.form),h.Ub(3),h.Mc("nzLabelPlaceholder","Recipient Name"),h.Ub(1),h.Mc("formControl",e.recipientName),h.Ub(1),h.Mc("ngIf",e.re
5cipientName.hasError("required")&&(e.submitted||e.recipientName.dirty)),h.Ub(3),h.Mc("nzLabelPlaceholder","Mailling Address"),h.Ub(1),h.Mc("formControl",e.maillingAddress),h.Ub(1),h.Mc("ngIf",e.maillingAddress.hasError("required")&&(e.submitted||e.maillingAddress.dirty)),h.Ub(3),h.Mc("nzLabelPlaceholder","Remarks"),h.Ub(1),h.Mc("formControl",e.remarks)}}function Ju(e,t){if(1&e&&h.mc(0,"nz-skeleton",33),2&e){const e=h.Dc();h.Mc("nzLoading",e.loading)("nzActive",!0)}}function eh(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",34),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().showRequestSuccessModal=t}))("nzOnCancel",(function(){return h.dd(e),h.Dc().doneRequest()})),h.rc(1,"h4"),h.qd(2,"EPF Form Request"),h.qc(),h.rc(3,"div",35),h.rc(4,"div",36),h.mc(5,"img",37),h.qc(),h.rc(6,"h3",38),h.qd(7,"Successful"),h.qc(),h.rc(8,"div",39),h.qd(9," Your details have been submitted."),h.mc(10,"br"),h.qd(11,"Thank you for filling out your "),h.mc(12,"br"),h.qd(13," Information. "),h.qc(),h.rc(14,"button",40),h.zc("click",(function(){return h.dd(e),h.Dc().doneRequest()})),h.Ec(15,"async"),h.qd(16,"Done "),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",e.showRequestSuccessModal)("nzFooter",null),h.Ub(5),h.Mc("src",e.transactionImgPath+"successful.svg",h.gd),h.Ub(9),h.Mc("ngClass",h.Fc(15,5,e.isMobile$)?"w-100":"")("nzLoading",e.loading)}}let th=(()=>{class e{constructor(e,t,n,i,c,o,s){this.transactionRestService=e,this.transactionService=t,this.subHandlingService=n,this.accountRestService=i,this.notiService=c,this.fb=o,this.store=s,this.handleCancel=new h.s,this.handleDownload=new h.s,this.selectedList=[],this.liveUrl="/epfForm/",this.formResponses=[],this.submitted=!1,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH}get isModalVisible(){return this._isModalVisible}set isModalVisible(e){this._isModalVisible=e,this.form=this.fb.group({recipientName:["",[oe.H.required]],maillingAddress:["",[oe.H.required]],email:[""],contactNo:[""],remarks:[""]});let t=Object(g.a)(this.store.selectSnapshot(f.a.getAccounts)).find(e=>e.refno==this.refno);t&&this.form.setValue({recipientName:null==t?void 0:t.nricName,maillingAddress:null==t?void 0:t.mailingAddress,remarks:"",email:null==t?void 0:t.emailAddress,contactNo:null==t?void 0:t.contactNo})}get recipientName(){return this.form.get("recipientName")}get recipientNameValue(){return this.form.get("recipientName").value}get maillingAddress(){return this.form.get("maillingAddress")}get maillingAddressValue(){return this.form.get("maillingAddress").value}get email(){return this.form.get("email")}get emailValue(){return this.form.get("email").value}get contactNo(){return this.form.get("contactNo")}get contactNoValue(){return this.form.get("contactNo").value}get remarks(){return this.form.get("remarks")}get remarksValue(){return this.form.get("remarks").value}ngOnInit(){this.account$=this.store.select(f.a.getAccounts),this.transactionType=this.store.selectSnapshot(u.X.getSelectedTransactionType)}ngOnChanges(e){e.selectedKey&&e.selectedKey.currentValue&&this.getEpfFormData()}onCancel(){this.handleCancel.emit(!1)}onRequest(){if(this.submitted=!0,this.form.updateValueAndValidity(),this.form.invalid)this.form.markAsUntouched();else{for(let e of this.selectedList)this.formResponses.push(e.formResponse);this.subHandlingService.once(this.accountRestService.sendDocumentRequest(U.a.EPF_FUNDS,this.recipientNameValue,this.maillingAddressValue,this.emailValue,this.contactNoValue,this.formResponses).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS?(this.transactionService.updateBuyUtOrderCartType(this.sedolnumberList,O.a.EPF_FORM_REQUESTED,this.refno),this.transactionService.updateSellUtOrderCartType(this.refno,this.sedolnumberList,U.a.EPF_FUNDS.toUpperCase(),O.a.EPF_FORM_REQUESTED),this.transactionService.updateSwitchUtOrderCartType(this.refno,this.sedolnumberList,U.a.EPF_FUNDS.toUpperCase(),O.a.EPF_FORM_REQUESTED),this.showRequestSuccessModal=!0):this.notiService.error("Something went wrong",e.errorMessage||"An unknown error has occured."),this.handleDownload.emit(!1),this.submitted=!1})))}}getEpfFormData(){this.selectedList=[],this.subHandlingService.once(this.transactionRestService.getFormSample(U.a.EPF_FUNDS).pipe(Object(y.a)(e=>{var t,n,i,c;if(e.status===M.a.RESPONSE_SUCCESS&&e){if(this.transactionType===d.d.BUY){for(let i of e.data)(null===(t=this.categorizedFundInfo[this.selectedKey])||void 0===t?void 0:t.managerCode)===i.formId&&this.selectedList.push({formCode:i.formId,formId:i.formName,formResponse:i,formModelList:i.formModelList,fileModelList:null===(n=i.formModelList)||void 0===n?void 0:n.find(e=>e.investmentType===U.a.FIRST_TIME_APPLICATION).fileModelList});for(let e of this.userHoldings)for(let t of this.selectedList)e.managerCode===t.formCode&&(t.fileModelList=null==t?void 0:t.find(e=>e.investmentType===U.a.SUBSCRIPTION).fileModelList)}if(this.transactionType===d.d.SELL)for(let t of e.data)this.categorizedFundInfo[this.selectedKey].managerCode===t.formId&&this.selectedList.push({formCode:t.formId,formId:t.formName,formResponse:t,formModelList:t.formModelList,fileModelList:null===(i=t.formModelList)||void 0===i?void 0:i.find(e=>e.investmentType===U.a.REDEMPTION).fileModelList});if(this.transactionType===d.d.SWITCH)for(let t of e.data)this.categorizedFundInfo[this.selectedKey].managerCode===t.formId&&this.selectedList.push({formCode:t.formId,formId:t.formName,formResponse:t,formModelList:t.formModelList,fileModelList:null===(c=t.formModelList)||void 0===c?void 0:c.find(e=>e.investmentType===U.a.SWITCHING).fileModelList})}})))}openSampleDocument(e){window.open(e,"_blank")}
5doneRequest(){this.showRequestSuccessModal=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(T.a),h.lc(C.a),h.lc(l.a),h.lc(bt.a),h.lc(Sc.b),h.lc(oe.g),h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["app-request-epf-form-modal"]],inputs:{categorizedFundInfo:"categorizedFundInfo",userHoldings:"userHoldings",selectedKey:"selectedKey",refno:"refno",sedolnumberList:"sedolnumberList",loading:"loading",isModalVisible:"isModalVisible"},outputs:{handleCancel:"handleCancel",handleDownload:"handleDownload"},features:[h.Tb([l.a]),h.Sb],decls:11,vars:8,consts:[["nzWrapClassName","modal-center",3,"nzVisible","nzFooter","nzOnCancel",4,"ngIf"],["class","bg-white container shadow mb-6 pb-3",4,"ngIf"],[4,"ngIf"],["requestEpfFormContentTemplate",""],["loadingTemplate",""],[3,"nzVisible","nzFooter","nzVisibleChange","nzOnCancel",4,"ngIf"],["nzWrapClassName","modal-center",3,"nzVisible","nzFooter","nzOnCancel"],[4,"ngIf","ngIfElse"],[4,"ngTemplateOutlet"],[1,"text-right","py-3"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",1,"ml-2",3,"click"],[1,"bg-white","container","shadow","mb-6","pb-3"],[3,"title","back"],[3,"ngTemplateOutlet",4,"ngIf","ngIfElse"],[3,"ngTemplateOutlet"],["nzBlock","","nz-button","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"click"],[1,"bg-lightest","p-3","overflow-y-auto"],[1,"font-weight-bold"],["nzType","horizontal",1,"mx-0","my-2","text-black-7"],["class","pt-2",4,"ngFor","ngForOf"],[1,"font-weight-bold","mt-4","mb-2"],["nz-form","",3,"formGroup"],[1,"mb-2"],[3,"nzLabelPlaceholder"],["ui-input","",3,"formControl"],[1,"pt-2"],[1,"p-0","mb-0"],[4,"ngFor","ngForOf"],[1,"p-0","m-0",3,"innerHTML"],["fundManagerFile",""],[3,"click"],[3,"nzLoading","nzActive"],[3,"nzVisible","nzFooter","nzVisibleChange","nzOnCancel"],[1,"text-center"],[1,"text-center","mt-3"],["alt","transaction successful image",3,"src"],[1,"text-center","pb-2","pt-4"],[1,"m-auto","text-center","font-weight-bold","w-70","py-2"],["nz-button","","nzType","primary",3,"ngClass","nzLoading","click"]],template:function(e,t){1&e&&(h.od(0,Vu,4,4,"nz-modal",0),h.Ec(1,"async"),h.rc(2,"app-mobile-scaffold"),h.od(3,$u,3,3,"div",1),h.od(4,ju,5,0,"b2c-floating-bar",2),h.qc(),h.od(5,Zu,22,10,"ng-template",null,3,h.pd),h.od(7,Ju,1,2,"ng-template",null,4,h.pd),h.od(9,eh,17,7,"nz-modal",5),h.Ec(10,"async")),2&e&&(h.Mc("ngIf",!h.Fc(1,4,t.isMobile$)),h.Ub(3),h.Mc("ngIf",t.isModalVisible),h.Ub(1),h.Mc("ngIf",t.isModalVisible&&!t.loading),h.Ub(5),h.Mc("ngIf",!h.Fc(10,6,t.isMobile$)))},directives:[p.t,z.a,j.a,p.A,_.a,Bt.a,Se.a,Nu.a,p.s,oe.J,oe.u,se.b,oe.l,se.e,se.a,ae.c,oe.c,ae.b,oe.t,oe.i,se.c,W.a,p.q],pipes:[p.b],styles:[".modal-center{display:flex;align-items:center;justify-content:center}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var nh=n("FQWw"),ih=n("ffUl"),ch=n("aRhN"),oh=n("Qw10"),sh=n("cEyi"),ah=n("UhF/");function lh(e,t){1&e&&h.nc(0)}function rh(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",3),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCancel()})),h.rc(1,"h4"),h.qd(2,"PRS Form Request"),h.qc(),h.od(3,lh,1,0,"ng-container",4),h.rc(4,"nz-row",5),h.rc(5,"nz-col",6),h.rc(6,"div",7),h.rc(7,"p",8),h.qd(8," Kindly mail the "),h.rc(9,"strong"),h.qd(10,"completed original form"),h.qc(),h.qd(11," to the address below: "),h.qc(),h.rc(12,"p",9),h.qd(13," Attn: FSMOne Ops Dept "),h.qc(),h.rc(14,"p",9),h.qd(15," Level 28, Menara AIA Sentral, "),h.qc(),h.rc(16,"p",9),h.qd(17," No.30, Jalan Sultan Ismail, 50250, Kuala Lumpur. "),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(18,"div",10),h.rc(19,"button",11),h.zc("click",(function(){return h.dd(e),h.Dc().onCancel()})),h.qd(20,"Cancel"),h.qc(),h.rc(21,"button",12),h.zc("click",(function(){return h.dd(e),h.Dc().onDownload()})),h.qd(22,"Download Form"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Mc("nzVisible",e.isModalVisible)("nzFooter",null),h.Ub(3),h.Mc("ngTemplateOutlet",t)}}function dh(e,t){1&e&&h.nc(0)}function uh(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",15),h.zc("click",(function(){return h.dd(e),h.Dc(2).onCancel()})),h.qd(2,"Cancel"),h.qc(),h.rc(3,"button",16),h.zc("click",(function(){return h.dd(e),h.Dc(2).onDownload()})),h.qd(4,"Download Form"),h.qc(),h.qc()}}const hh=function(e){return{container:e}};function ph(e,t){if(1&e&&(h.rc(0,"b2c-mobile-drawer",13),h.Ec(1,"async"),h.od(2,dh,1,0,"ng-container",4),h.od(3,uh,5,0,"b2c-floating-bar",14),h.Ec(4,"async"),h.qc()),2&e){const e=h.Dc(),t=h.ad(6);h.Mc("title","PRS Form Request")("show",e.isModalVisible)("height",600)("ngClass",h.Sc(10,hh,h.Fc(1,6,e.isMobile$))),h.Ub(2),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngIf",e.isModalVisible&&h.Fc(4,8,e.isMobile$))}}function mh(e,t){1&e&&h.mc(0,"nz-divider",30)}function fh(e,t){if(1&e&&(h.rc(0,"div"),h.mc(1,"p",33),h.rc(2,"a",34),h.qd(3,"Sample"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(1),h.Mc("innerHTML",e.displayName,h.ed),h.Ub(1),h.Mc("href",e.sampleFileName?n.liveUrl+e.sampleFileName:n.liveUrl+e.fileName,h.gd)}}function gh(e,t){if(1&e&&(h.rc(0,"div",31),h.rc(1,"p",8),h.qd(2),h.qc(),h.od(3,fh,4,2,"div",32),h.qc()),2&e){const e=t.$implicit;h.Ub(2),h.rd(e.formId),h.Ub(1),h.Mc("ngForOf",null==e?null:e.fileModelList)}}const bh=function(e){return{"pl-2":e}};function Sh(e,t){if(1&e&&(h.rc(0,"nz-row",27),h.rc(1,"nz-col",35),h.Ec(2,"async"),h.rc(3,"nz-row",7),h.rc(4,"nz-col",22),h.qd(5,"\u2022"),h.qc(),h.rc(6,"nz-col",29),h.qd(7,"If you are switching your PRS funds to a new PRS provider as a new investor, kindly submit PPA Transfer form along with the relevant First Time Application form with a copy of NRIC (front and back). "),h.qc(),h.rc(8,"nz-col",36),h.qd(9,"Example:"),h.qc(),h.rc(10,"nz-col",36),h.qd(11,"During an inter-switch PRS transaction, if investors are switching from Provider A to Provider B as a new investor( e.g. without any PRS fund of that Provider B prior to this), they are required to submit the PPA Transfer form with First Time Application forms of Provider B as well. "),h.qc(),h.qc(),h.rc(12,"nz-row",7),h.rc(13,"nz-col",36),h.qd(14,"Special Case:"),h.qc(),h.rc(15,"nz-col",36),h.qd(16,"To switch buy into Kenanga PRS funds, you are required to submit an additional Kenanga Transfer-in form if you are an existing client with Kenanga PRS at FSM. "),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Sc(4,bh,h.Fc(2,2,e.isMobile$)))("nzPush",1)}}function yh(e,t){if(1&e&&(h.rc(0,"div",17),h.rc(1,"span",18),h.qd(2,"Document Required"),h.qc(),h.od(3,mh,1,0,"nz-divider",19),h.Ec(4,"async"),h.od(5,gh,4,2,"div",20),h.qc(),h.rc(6,"div",21),h.rc(7,"nz-col",22),h.mc(8,"i",23),h.qc(),h.rc(9,"nz-col",24),h.Ec(10,"async"),h.rc(11,"h6",25),h.qd(12,"Important Remarks:"),h.qc(),h.qc(),h.qc(),h.od(13,Sh,17,6,"nz-row",26),h.rc(14,"nz-row",27),h.rc(15,"nz-col",28),h.Ec(16,"async"),h.rc(17,"nz-row",7),h.rc(18,"nz-col",22),h.qd(19,"\u2022"),h.qc(),h.rc(20,"nz-col",29),h.qd(21,"Please print the documents on "),h.rc(22,"strong"),h.qd(23,"both sides of a new A4 paper"),h.qc(),h.qc(),h.qc(),h.rc(24,"nz-row",7),h.rc(25,"nz-col",22),h.qd(26,"\u2022"),h.qc(),h.rc(27,"nz-col",29),h.qd(28,"Please fill up the form with "),h.rc(29,"strong"),h.qd(30,"capital letters"),h.qc(),h.qd(31," and a "),h.rc(32,"strong"),h.qd(33,"black
5ink pen."),h.qc(),h.qc(),h.qc(),h.rc(34,"nz-row",7),h.rc(35,"nz-col",22),h.qd(36,"\u2022"),h.qc(),h.rc(37,"nz-col",29),h.qd(38,"Strictly "),h.rc(39,"strong"),h.qd(40,"no amendments"),h.qc(),h.qd(41," (correction fluids, tapes, crossing etc.) on the form. "),h.qc(),h.qc(),h.rc(42,"nz-row",7),h.rc(43,"nz-col",22),h.qd(44,"\u2022"),h.qc(),h.rc(45,"nz-col",29),h.rc(46,"strong"),h.qd(47,'Please cross "For PPA use only"'),h.qc(),h.qd(48," on the NRIC photocopy"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.Mc("ngIf",!h.Fc(4,6,e.isMobile$)),h.Ub(2),h.Mc("ngForOf",e.selectedList),h.Ub(4),h.Mc("ngClass",h.Sc(12,bh,h.Fc(10,8,e.isMobile$))),h.Ub(4),h.Mc("ngIf",e.isFromSwitching),h.Ub(2),h.Mc("nzPush",1)("ngClass",h.Sc(14,bh,h.Fc(16,10,e.isMobile$)))}}let vh=(()=>{class e{constructor(e,t,n,i){this.subHandlingService=e,this.transactionRestService=t,this.accountRestService=n,this.store=i,this.handleCancel=new h.s,this.handleDownload=new h.s,this.selectedList=[],this.formResponses=[],this.liveUrl=M.a.TEST_URL+"/buysell/forms/",this.isFromSwitching=!1}ngOnInit(){this.transactionType=this.store.selectSnapshot(u.X.getSelectedTransactionType),this.isFromSwitching=this.transactionType===d.d.SWITCH}ngOnChanges(e){e.selectedKey&&e.selectedKey.currentValue&&this.getPrsFormData()}getPrsFormData(){this.selectedList=[],this.subHandlingService.once(this.transactionRestService.getFormSample(U.a.PRS_FUND).pipe(Object(y.a)(e=>{var t,n,i;if(e.status===M.a.RESPONSE_SUCCESS&&e){this.mapFormId(e.data);for(let c of this.categorizedFundInfo[this.selectedKey].prsFundInfo)for(let o of e.data)c.managercode===o.formCode&&c.fundType===U.a.PRS_FUND.toUpperCase()&&((null===(t=this.selectedList)||void 0===t?void 0:t.find(e=>e.formCode===c.managercode))||this.selectedList.push({formCode:o.formCode,formId:o.formName,formResponse:o,formModelList:o.formModelList,fileModelList:this.transactionType===d.d.BUY?null===(n=o.formModelList)||void 0===n?void 0:n.find(e=>e.investmentType===U.a.FIRST_TIME_APPLICATION).fileModelList:null===(i=o.formModelList)||void 0===i?void 0:i.find(e=>e.investmentType===U.a.SWITCHING).fileModelList}));this.selectedList.filter(e=>{for(let t of this.userHoldings)if(t.managerCode!==e.formCode&&t.prs)return e})}},e=>console.log(e))))}onCancel(){this.handleCancel.emit(!1)}onDownload(){var e,t;for(let n of this.selectedList)this.formResponses.push(n.formResponse);for(let n of this.formResponses){let i=this.transactionType===d.d.BUY?null===(e=n.formModelList)||void 0===e?void 0:e.find(e=>e.investmentType===U.a.FIRST_TIME_APPLICATION):null===(t=n.formModelList)||void 0===t?void 0:t.find(e=>e.investmentType===U.a.SWITCHING);n.formModelList=[],n.formModelList.push(i)}this.subHandlingService.once(this.accountRestService.downloadForm(U.a.PRS_FUND,this.formResponses).pipe(Object(y.a)(e=>{e&&this.zipDownload(e)}))),this.handleDownload.emit(!1)}zipDownload(e){let t=new DataView(e).getUint32(0,!1).toString(16);if("pdf"===this.determineFileType(t)){const t=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(t,"ApplyForm.pdf")}else if("zip"===this.determineFileType(t)){const t=new Blob([e],{type:"application/zip"});Object(xu.saveAs)(t,"PRS_Forms.zip")}}mapFormId(e){for(let t of e)t.formId===M.c.AFFIN_MANAGER_NAME&&(t.formCode=M.c.AFFIN_HWANG_MANAGER_CODE),t.formId===M.c.AIA_FORM_NAME&&(t.formCode=M.c.AIA_MANAGER_CODE),t.formId===M.c.AM_MANAGER_NAME&&(t.formCode=M.c.AM_MANAGER_CODE),t.formId===M.c.KENANGA_MANAGER_NAME&&(t.formCode=M.c.KENANGA_MANAGER_CODE),t.formId===M.c.RHB_MANAGER_NAME&&(t.formCode=M.c.RHB_MANAGER_CODE),t.formId===M.c.PRINCIPAL_MANAGER_NAME&&(t.formCode=M.c.PRINCIPAL_MANAGER_CODE),t.formId===M.c.MANULIFE_MANAGER_NAME&&(t.formCode=M.c.MANULIFE_MANGER_CODE)}determineFileType(e){switch(e){case"25504446":return"pdf";case"504b0304":return"zip"}}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(T.a),h.lc(bt.a),h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["app-download-prs-form-modal"]],inputs:{userHoldings:"userHoldings",isModalVisible:"isModalVisible",selectedKey:"selectedKey",categorizedFundInfo:"categorizedFundInfo"},outputs:{handleCancel:"handleCancel",handleDownload:"handleDownload"}
5,features:[h.Tb([l.a]),h.Sb],decls:7,vars:6,consts:[[3,"nzVisible","nzFooter","nzOnCancel",4,"ngIf"],[3,"title","show","height","ngClass",4,"ngIf"],["documentTemplate",""],[3,"nzVisible","nzFooter","nzOnCancel"],[4,"ngTemplateOutlet"],[1,"py-3"],["nzPush","1","nzSpan","23"],[1,"text-xs"],[1,"p-0","m-0"],[1,"p-0","m-0","text-success"],[1,"text-right","py-3"],["nz-button","","nzType","outline",1,"mx-2",3,"click"],["nz-button","","nzType","primary",1,"mx-2",3,"click"],[3,"title","show","height","ngClass"],[4,"ngIf"],["nz-button","","nzType","outline","nzBlock","",1,"my-1",3,"click"],["nz-button","","nzType","primary","nzBlock","",1,"my-1",3,"click"],[1,"bg-lightest","p-2","overflow-y-auto"],[1,"font-weight-bold"],["nzType","horizontal","class","mx-0 my-2 text-black-7",4,"ngIf"],["class","pt-2",4,"ngFor","ngForOf"],["nz-row","","nzType","flex","nzAlign","middle",1,"pt-3"],["nzSpan","1"],["nz-icon","","nzTheme","outline","type","info-circle",1,"text-danger"],["nzSpan","23",3,"ngClass"],[1,"pt-1","font-weight-bold"],["nzType","flex",4,"ngIf"],["nzType","flex"],["nzSpan","12",3,"nzPush","ngClass"],["nzSpan","23"],["nzType","horizontal",1,"mx-0","my-2","text-black-7"],[1,"pt-2"],[4,"ngFor","ngForOf"],[1,"p-0","m-0",3,"innerHTML"],["target","_blank",3,"href"],["nzSpan","24",3,"ngClass","nzPush"],["nzSpan","24"]],template:function(e,t){1&e&&(h.od(0,rh,23,3,"nz-modal",0),h.Ec(1,"async"),h.rc(2,"app-mobile-scaffold"),h.od(3,ph,5,12,"b2c-mobile-drawer",1),h.Ec(4,"async"),h.qc(),h.od(5,yh,49,16,"ng-template",null,2,h.pd)),2&e&&(h.Mc("ngIf",!h.Fc(1,2,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(4,4,t.isMobile$)&&t.isModalVisible))},directives:[p.t,z.a,j.a,p.A,P.c,P.a,_.a,G.a,p.q,Se.a,p.s,k.b,Nu.a],pipes:[p.b],styles:[".modal-center{display:flex;align-items:center;justify-content:center}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var Mh=n("gp8a");function Ch(e,t){1&e&&h.mc(0,"b2c-app-bar-2",20),2&e&&h.Mc("title","Order Placed")}function qh(e,t){1&e&&h.nc(0)}function Th(e,t){1&e&&(h.rc(0,"span"),h.qd(1,'"Pay Now"'),h.qc())}function wh(e,t){1&e&&(h.rc(0,"span"),h.qd(1," / "),h.qc())}function zh(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"download forms(EPF/PRS)"),h.qc())}function Dh(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-card",30),h.rc(2,"nz-col",31),h.Ec(3,"async"),h.mc(4,"i",32),h.qc(),h.rc(5,"nz-col",31),h.Ec(6,"async"),h.rc(7,"p",33),h.qd(8,"Please proceed to "),h.od(9,Th,2,0,"span",28),h.od(10,wh,2,0,"span",28),h.od(11,zh,2,0,"span",28),h.qd(12," to complete your transaction. "),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("nzSpan",h.Fc(3,5,e.isMobile$)?2:4),h.Ub(3),h.Mc("nzSpan",h.Fc(6,7,e.isMobile$)?22:20),h.Ub(4),h.Mc("ngIf",!e.paymentReceived),h.Ub(1),h.Mc("ngIf",!e.paymentReceived&&!e.formDownloaded&&e.isPrsOrEpf),h.Ub(1),h.Mc("ngIf",!e.formDownloaded&&!e.formRequested&&e.isPrsOrEpf)}}function Ph(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,null==e?null:e.value,null==e?null:e.currencyCode)," ")}}function Ih(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-order-cart",35),h.zc("downloadForm",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).showDownloadPrs(null==n?null:n.title)}))("payNow",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).payNowClick(null==n?null:n.title)}))("requestEpfForm",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).showRequestEpf(null==n?null:n.title,null==n?null:n.sedolNumber)})),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",36),h.od(3,Ph,2,4,"ng-template",null,37,h.pd),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(4),i=h.Dc(3);h.Mc("isDownloadForm",null==e?null:e.showPrsButton)("isEditOrder",!1)("isShowContent",!0)("isShowPayButtonOnFailed",!(null!=e&&null!=e.title&&e.title.includes(i.transactionConstant.GOPAYZ)))("orderCartType",null==e?null:e.orderCartType)("paymentTitle",null==e?null:e.title),h.Ub(2),h.Mc("value",n)}}function kh(e,t){if(1&e&&(h.pc(0),h.od(1,Ih,5,7,"b2c-order-cart",34),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.orderPlacedCartDisplayModel)}}const Ah=function(e){return{"bg-white w-100 shadow":e}},Eh=function(e){return{"px-2":e}}
5,Fh=function(e){return{"pt-3":e}};function Oh(e,t){if(1&e){const e=h.sc();h.rc(0,"div",21),h.Ec(1,"async"),h.rc(2,"div",21),h.Ec(3,"async"),h.rc(4,"nz-row",21),h.Ec(5,"async"),h.rc(6,"div",22),h.rc(7,"h4",23),h.qd(8,"Purchase Order No."),h.qc(),h.rc(9,"h4",24),h.qd(10),h.qc(),h.qc(),h.rc(11,"div",25),h.rc(12,"button",26),h.zc("click",(function(){return h.dd(e),h.Dc().downloadPurchaseOrderNoForm()})),h.mc(13,"em",27),h.qc(),h.qc(),h.qc(),h.od(14,Dh,13,9,"nz-row",28),h.rc(15,"div",29),h.od(16,kh,2,1,"ng-container",28),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(12,Ah,h.Fc(1,6,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(14,Eh,h.Fc(3,8,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(16,Fh,h.Fc(5,10,e.isMobile$))),h.Ub(6),h.rd(e.purchaseOrderNo),h.Ub(4),h.Mc("ngIf",!e.cartCompleted),h.Ub(2),h.Mc("ngIf",e.orderPlacedCartDisplayModel)}}function Uh(e,t){if(1&e){const e=h.sc();h.rc(0,"app-download-prs-form-modal",38),h.zc("handleCancel",(function(){return h.dd(e),h.Dc().onCancel()}))("handleDownload",(function(){return h.dd(e),h.Dc().onDownloadForm()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("categorizedFundInfo",e.orderPlacedCartData)("isModalVisible",e.showDownloadPrsModal)("selectedKey",e.selectedKey)("userHoldings",e.userHoldings)}}const xh=function(){return{}},Lh=function(){return{position:"fixed",top:"0",left:"0",width:"100%","z-index":"1050","padding-top":"80px"}};function Rh(e,t){if(1&e){const e=h.sc();h.rc(0,"div",39),h.Ec(1,"async"),h.rc(2,"foreign-payment-modal",40),h.zc("cancel",(function(){return h.dd(e),h.Dc().onCancel()}))("submit",(function(){return h.dd(e),h.Dc().onSubmitProof()})),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngStyle",h.Fc(1,7,e.isMobile$)?h.Rc(9,xh):h.Rc(10,Lh)),h.Ub(2),h.Mc("show",e.showForeignPaymentModal)("paymentMethod",e.modalPaymentMethod)("currency",e.modalCurrency)("totalAmount",e.modalPaymentAmount)("product",e.product)("refno",e.refno)}}let Nh=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l){this.store=e,this.router=t,this.transactionRestService=n,this.subHandlingService=i,this.fundRestService=c,this.paymentRestService=o,this.transactionService=s,this.fpxRestService=a,this.route=l,this._isFromFpxDone=!1,this.userHoldings=[],this.orderPlacedCartDisplayModel=[],this.isPrsOrEpf=!1,this.showLocalPaymentModal=!1,this.showSuccessModal=!1,this.cartCompleted=!0,this.isLoading=!1,this.formDownloaded=!1,this.showReferralChannelPaymentModal=!1,this.paymentReceived=!0,this.paymentAllowed=!0,this.transactionConstant=U.a,this.product=r.b.UNIT_TRUST,this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartList$=this.store.select(u.l.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subHandlingService.once(this.route.queryParams.pipe(Object(y.a)(e=>{this.fpxPurchaseOrderNo=e.poNumber}))),this.subscribeIsMobile()}set isFromFpxDone(e){this._isFromFpxDone=e,e&&this.subHandlingService.subscribe(this.fpxRestService.getFpxInfo(this.fpxPurchaseOrderNo).pipe(Object(y.a)(e=>{if(e.status!==M.a.RESPONSE_SUCCESS||"00"!==e.data.debitStatusCode)return this.transactionService.updateBuyFpxCartType(this.refno,"failed"),void(this.totalBuyAmountFpx=e.data.transactionAmount);this.transactionService.updateBuyFpxCartType(this.refno,"success")})))}ngOnChanges(e){this.getUserHoldingsList(),this.getCheckOutFund()}getCheckOutFund(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.formRequested=!1,this.paymentReceived=!1,this.prsFormDownloaded=!0,this.cartCompleted=!0,e.forEach(e=>{"PRS"!==e.fundType&&"epf"!==e.investmentType||(this.isPrsOrEpf=!0),e.orderCartType===O.a.EPF_FORM_REQUESTED||e.orderCartType===O.a.PAYMENT_RECEIVED||e.orderCartType===O.a.ORDER_RECEIVED||this.formDownloaded||(this.cartCompleted=!1),e.orderCartType===O.a.EPF_FORM_REQUESTED&&(this.formRequested=!0),e.orderCartType===O.a.PAYMENT&&(this.paymentReceived=!1),this.formDownloaded||(this.prsFormDownloaded=!1)})}),Object(y.a)(e=>{this.orderPlacedCartData=this.getOrderPlacedCartData(e,"paymentCategory")})))}getOrderPlacedCartData(e,t){const n=[];return e.reduce((e,i)=>{let c;return this.subHandlingService.subscribe(this.fundRestService.getFundInfo(i.sedolNumber).pipe(Object(y.a)(o=>{o.status===M.a.RESPONSE_SUCCESS&&o.data&&(c=o.data,e[i[t]]||(e[i[t]]={value:0,currencyCode:i.currencyCode,orderCartType:i.orderCartType,isPrs:!1,totalAmount:0,sedolNumber:[],fundInfo:[],managerCode:i.managerCode,showPrsButton:!1,prsFundInfo:[]},n.push(e[i[t]])),c.fundType===U.a.PRS_FUND.toUpperCase()&&(e[i[t]].isPrs=!0),e[i[t]].value+=i.investAmount,e[i[t]].sedolNumber.push(i.sedolNumber),e[i[t]].fundInfo.push(c),this.checkShowPrsFormDownloadButton(c.fundType===U.a.PRS_FUND.toUpperCase(),c.managerCode,i.userExistingFund)&&
5(e[i[t]].prsFundInfo.push(c),e[i[t]].showPrsButton||(e[i[t]].showPrsButton=!0)),this.getOrderPlacedCartList(e,i,t))}))),e},{})}getOrderPlacedCartList(e,t,n){if(this.orderPlacedCartDisplayModel.find(e=>e.title===t.paymentCategory)){const i=this.orderPlacedCartDisplayModel.findIndex(e=>e.title===t.paymentCategory);this.orderPlacedCartDisplayModel.splice(i,1,{title:t.paymentCategory,value:e[t[n]].value,fundInfo:e[t[n]].fundInfo,isPrs:e[t[n]].isPrs,orderCartType:e[t[n]].orderCartType,sedolNumber:e[t[n]].sedolNumber,currencyCode:e[t[n]].currencyCode,userExistingFund:t.userExistingFund,showPrsButton:e[t[n]].showPrsButton})}else this.orderPlacedCartDisplayModel.push({title:t.paymentCategory,value:e[t[n]].value,fundInfo:e[t[n]].fundInfo,isPrs:e[t[n]].isPrs,orderCartType:e[t[n]].orderCartType,sedolNumber:e[t[n]].sedolNumber,currencyCode:e[t[n]].currencyCode,userExistingFund:t.userExistingFund,showPrsButton:e[t[n]].showPrsButton});console.log(this.orderPlacedCartDisplayModel)}proceedViewPendingTransaction(){this.router.navigate([M.o.APP,M.o.TRANSACTION_RECORD],{queryParams:{refno:this.refno}})}payNowClick(e){var t;this.mobileModalFired=!0;const n=null===(t=this.orderPlacedCartDisplayModel)||void 0===t?void 0:t.find(t=>t.title===e);this.modalCurrency=n.currencyCode,this.modalPaymentAmount=n.value,this.modalPaymentMethod=e,e.includes(U.a.PAYMENT_METHOD_FPX)&&!e.includes(U.a.PAYMENT_CURRENCY_MYR)&&(this.showForeignPaymentModal=!0),e.includes(U.a.PAYMENT_METHOD_FPX)&&e.includes(U.a.PAYMENT_CURRENCY_MYR)&&(this.showLocalPaymentModal=!0),e.includes(U.a.GOPAYZ)&&e.includes(U.a.PAYMENT_CURRENCY_MYR)&&(this.modalTitle=`${U.a.GOPAYZ} - ${n.currencyCode}`,this.showReferralChannelPaymentModal=!0)}onCancel(){this.showDownloadPrsModal=!1,this.showForeignPaymentModal=!1,this.showReferralChannelPaymentModal=!1,this.showRequestEpfModal=!1,this.showSuccessModal=!1,this.mobileModalFired=!1}onDownloadForm(){this.showDownloadPrsModal=!1,this.showRequestEpfModal=!1,this.mobileModalFired=!1,this.formDownloaded=!0}showDownloadPrs(e){this.selectedKey=e,this.showDownloadPrsModal=!0,this.mobileModalFired=!0}showRequestEpf(e,t){this.selectedKey=e,this.showRequestEpfModal=!0,this.mobileModalFired=!0,this.sedolnumberList=t}onCloseLocalPaymentModal(){this.showLocalPaymentModal=!1,this.mobileModalFired=!1}onBackFromSubmitReceipt(e){e!==U.a.PAYMENT_CURRENCY_MYR?(this.showUploadReceiptModal=!1,this.showForeignPaymentModal=!0):(this.showUploadReceiptModal=!1,this.showLocalPaymentModal=!0)}onSubmitProof(){this.showForeignPaymentModal=!1,this.showLocalPaymentModal=!1,this.showUploadReceiptModal=!0}
5onSuccess(e){this.orderListKey=e,this.isMobile||(this.showForeignPaymentModal=!1,this.showUploadReceiptModal=!1,this.showReferralChannelPaymentModal=!1),this.showSuccessModal=!0}onDoneClick(){var e;this.showUploadReceiptModal=!1,this.showForeignPaymentModal=!1,this.showReferralChannelPaymentModal=!1,this.showSuccessModal=!1,this.mobileModalFired=!1;const t=null===(e=this.orderPlacedCartDisplayModel)||void 0===e?void 0:e.find(e=>e.title===this.orderListKey).sedolNumber;this.transactionService.updateBuyOrderCartTypeToOrderReceived(t,this.refno),this.getCheckOutFund()}subscribeIsMobile(){this.subHandlingService.once(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e})))}preSubmitToFPX(e,t){let n={fpxSellerOrderNo:this.purchaseOrderNo,fpxTxnAmount:this.totalBuyAmountFpx,fpxBuyerBankId:e,fpxBuyerEmail:t,redirectUrl:this.router.url.split("?")[0]};this.store.dispatch(new f.p(!0)),this.subHandlingService.once(this.paymentRestService.preSubmit(this.refno,!0,n).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fpxPaymentDetails=Object(g.a)(e.data),this.transactionService.setLastVisitedUrl(this.router.url))},e=>console.log(e))))}onPayNow(e){this.preSubmitToFPX(e.selectedBank,e.email)}onPayNowWithGoPayz(){this.referralChannelAction=Object(g.a)({refno:this.refno,token:this.store.selectSnapshot(f.a.getToken),purchaseOrderNo:this.purchaseOrderNo,callbackUrl:this.router.url.split("?")[0],actionUrl:`${Ru.a.apiUrl}${Lu.a.TRANSACTION+Lu.a.GOPAYZ+Lu.a.PAYMENT+Lu.a.SEND}`}),this.transactionService.setLastVisitedUrl(this.router.url)}onSubmittedToFpx(){}getUserHoldingsList(){this.isLoading=!0,this.subHandlingService.once(this.transactionRestService.getSellHoldingList(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&e&&(this.userHoldings=e.data)},e=>console.log(e))))}downloadPurchaseOrderNoForm(){this.subHandlingService.once(this.transactionRestService.downloadOrderNoForm(this.refno,this.purchaseOrderNo,"buy").pipe(Object(y.a)(e=>{e&&this.downloadForm(e)},e=>console.log(e))))}downloadForm(e){const t=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(t,this.purchaseOrderNo+"_Form.pdf")}checkIsSpecificFundHouse(e){return M.c.NEW_PRS_APPLICATION_ENABLED_MANAGER_CODES.includes(e)}onRequestForm(){this.showDownloadPrsModal=!1,this.showRequestEpfModal=!1,this.mobileModalFired=!1}checkShowPrsFormDownloadButton(e,t,n){return e&&!(this.checkIsSpecificFundHouse(t)&&this.isMobile)&&!n}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(T.a),h.lc(l.a),h.lc(q.a),h.lc(Au.a),h.lc(C.a),h.lc(Eu.a),h.lc(c.a))},e.\u0275cmp=h.fc({type:e,selectors:[["buy-order-placed-sider"]],inputs:{purchaseOrderNo:"purchaseOrderNo",totalBuyAmountFpx:"totalBuyAmountFpx",nricName:"nricName",accountTypeDisplay:"accountTypeDisplay",isFromFpxDone:"isFromFpxDone"},features:[h.Tb([l.a]),h.Sb],decls:29,vars:33,consts:[[3,"title",4,"ngIf"],[4,"ngTemplateOutlet"],["nzBlock","","nz-button","","nzType","primary",1,"font-weight-bold","mb-2","mt-4","text-md-sm","text-xl-base",3,"click"],[1,"w-100","bg-white","shadow","border-top"],[1,"px-2","py-2","mb-3"],[1,"font-weight-bold","mb-2"],[1,"text-sm"],[3,"ngTemplateOutlet"],[1,"px-2"],["nz-button","","nzType","primary","nzBlock","",1,"mt-3",3,"click"],["orderPlacedContentTemplate",""],[3,"categorizedFundInfo","isModalVisible","selectedKey","userHoldings","handleCancel","handleDownload",4,"ngIf"],[3,"categorizedFundInfo","refno","loading","isModalVisible","sedolnumberList","selectedKey","userHoldings","handleCancel","handleDownload"],[3,"ngStyle",4,"ngIf"],[3,"showLocalPaymentModal","paymentMethod","paymentAllowed","totalAmount","closeLocalPaymentModal","upload","payNow"],[3,"refno","nricName","paymentMethod","paymentAmount","fromCurrency","purchaseOrderNo","show","success","backed"],[3,"fpxPaymentDetails","submittedToFpx"],[3,"show","cancel","done"],["investmentType","Lump Sum Investment","channelName","gopayz",3,"visible","refno","purchaseOrderNo","title","currencyCode","totalAmount","handleCancel","handlePrimaryClick"],[3,"referralChannelAction"],[3,"title"],[3,"ngClass"],["nz-col","","nzSpan","18"],[1,"m-0"],[1,"font-weight-normal"],["nz-col","","nzSpan","6",1,"text-right","mt-1"],["nz-button","","nzSize","small","nzType","outline","nzTooltipTitle","Print","nzTooltipPlacement","top","nz-tooltip","",1,"mr-2",3,"click"],["nz-icon","","nzType","printer","nzTheme","outline"],[4,"ngIf"],[1,"py-2"],[1,"border-top-warning"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning","text-lg"],[1,"text-warning"],[3,"isDownloadForm","isEditOrder","isShowContent","isShowPayButtonOnFailed","orderCartType","paymentTitle","downloadForm","payNow","requestEpfForm",4,"ngFor","ngForOf"],[3,"isDownloadForm","isEditOrder","isShowContent","isShowPayButtonOnFailed","orderCartType","paymentTitle","downloadForm","payNow","requestEpfForm"],["horizontal","true","title","Total Inv. Amt.",3,"value"],["valueTemplate",""],[3,"categorizedFundInfo","isModalVisible","selectedKey","userHoldings","handleCancel","handleDownload"],[3,"ngStyle"],[3,"show","paymentMethod","currency","totalAmount","product","refno","cancel","submit"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,Ch,1,1,"b2c-app-bar-2",0),h.qc(),h.rc(2,"app-web-scaffold"),h.od(3,qh,1,0,"ng-container",1),h.rc(4,"button",2),h.zc("click",(function(){return t.proceedViewPendingTransaction()})),h.qd(5," View Pending Transaction "),h.qc(),h.qc(),h.rc(6,"app-mobile-scaffold"),h.pc(7),h.rc(8,"div",3),h.rc(9,"div",4),h.rc(10,"p",5),h.qd(11,"Your order has been successfully placed."),h.qc(),h.rc(12,"p",6),h.qd(13),h.qc(),h.qc(),h.qc(),h.nc(14,7),h.rc(15,"div",8),h.rc(16,"button",9),h.zc("click",(function(){return t.proceedViewPendingTransaction()})),h.qd(17," View Pending Transaction "),h.qc(),h.qc(),h.oc(),h.qc(),h.od(18,Oh,17,18,"ng-template",null,10,h.pd),h.od(20,Uh,1,4,"app-download-prs-form-modal",11),h.rc(21,"app-request-epf-form-modal",12),h.zc("handleCancel",(function(){return t.onCancel()}
5))("handleDownload",(function(){return t.onRequestForm()})),h.qc(),h.od(22,Rh,3,11,"div",13),h.rc(23,"cheque-fpx-local-modal",14),h.zc("closeLocalPaymentModal",(function(){return t.onCloseLocalPaymentModal()}))("upload",(function(){return t.onSubmitProof()}))("payNow",(function(e){return t.onPayNow(e)})),h.qc(),h.rc(24,"app-upload-deposit-receipt-modal",15),h.zc("success",(function(e){return t.onSuccess(e)}))("backed",(function(e){return t.onBackFromSubmitReceipt(e)})),h.qc(),h.rc(25,"fpx-submit-form",16),h.zc("submittedToFpx",(function(){return t.onSubmittedToFpx()})),h.qc(),h.rc(26,"app-success-payment-modal",17),h.zc("cancel",(function(){return t.onCancel()}))("done",(function(){return t.onDoneClick()})),h.qc(),h.rc(27,"app-referral-channel-payment-modal",18),h.zc("handleCancel",(function(){return t.onCancel()}))("handlePrimaryClick",(function(){return t.onPayNowWithGoPayz()})),h.qc(),h.mc(28,"app-referral-channel-submit-form",19)),2&e){const e=h.ad(19);h.Ub(1),h.Mc("ngIf",!t.mobileModalFired),h.Ub(2),h.Mc("ngTemplateOutlet",e),h.Ub(10),h.rd(t.accountTypeDisplay),h.Ub(1),h.Mc("ngTemplateOutlet",e),h.Ub(6),h.Mc("ngIf",t.userHoldings),h.Ub(1),h.Mc("categorizedFundInfo",t.orderPlacedCartData)("refno",t.refno)("loading",t.isLoading)("isModalVisible",t.showRequestEpfModal)("sedolnumberList",t.sedolnumberList)("selectedKey",t.selectedKey)("userHoldings",t.userHoldings),h.Ub(1),h.Mc("ngIf",t.showForeignPaymentModal),h.Ub(1),h.Mc("showLocalPaymentModal",t.showLocalPaymentModal)("paymentMethod",t.modalPaymentMethod)("paymentAllowed",t.paymentAllowed)("totalAmount",t.modalPaymentAmount),h.Ub(1),h.Mc("refno",t.refno)("nricName",t.nricName)("paymentMethod",t.modalPaymentMethod)("paymentAmount",t.modalPaymentAmount)("fromCurrency",t.modalCurrency)("purchaseOrderNo",t.purchaseOrderNo)("show",t.showUploadReceiptModal),h.Ub(1),h.Mc("fpxPaymentDetails",t.fpxPaymentDetails),h.Ub(1),h.Mc("show",t.showSuccessModal),h.Ub(1),h.Mc("visible",t.showReferralChannelPaymentModal)("refno",t.refno)("purchaseOrderNo",t.purchaseOrderNo)("title",t.modalTitle)("currencyCode",t.modalCurrency)("totalAmount",t.modalPaymentAmount),h.Ub(1),h.Mc("referralChannelAction",t.referralChannelAction)}},directives:[z.a,p.t,B.a,p.A,_.a,th,nh.a,ih.a,ch.a,oh.a,sh.a,ah.a,D.a,p.q,P.c,P.a,xt.e,k.b,I.a,p.s,ge.a,be.c,vh,p.w,Mh.a],pipes:[p.b,ke.a],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Bh(e,t){if(1&e&&h.mc(0,"buy-order-placed-sider",12),2&e){const e=h.Dc(2);h.Mc("nricName",null==e.selectedAccTypeDisplay?null:e.selectedAccTypeDisplay.nricName)("accountTypeDisplay",null==e.selectedAccTypeDisplay?null:e.selectedAccTypeDisplay.accountTypeDisplay)("purchaseOrderNo",e.purchaseOrderNo)("totalBuyAmountFpx",e.totalBuyAmountFpx)("isFromFpxDone",e.isFromFpxDone)}}const _h=function(e,t){return{container:e,"w-100 mb-6 pb-6":t}};function Vh(e,t){if(1&e&&(h.rc(0,"div",4),h.rc(1,"div",5),h.Ec(2,"async"),h.Ec(3,"async"),h.rc(4,"nz-row",6),h.Ec(5,"async"),h.rc(6,"div",7),h.Ec(7,"async"),h.rc(8,"nz-card",8),h.rc(9,"p"),h.qd(10,"Home / Trade"),h.qc(),h.rc(11,"h3"),h.qd(12,"Your order has been successfully placed"),h.qc(),h.rc(13,"h4"),h.qd(14),h.qc(),h.rc(15,"div",9),h.mc(16,"app-trade-product-info",10),h.qc(),h.qc(),h.qc(),h.rc(17,"div",7),h.Ec(18,"async"),h.od(19,Bh,1,5,"buy-order-placed-sider",11),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(23,_h,!h.Fc(2,13,e.isMobile$),h.Fc(3,15,e.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(5,17,e.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(7,19,e.isMobile$)?0:18),h.Ub(8),h.rd(null==e.selectedAccTypeDisplay?null:e.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("header1","Investment Amt.")("header2","Sales Charge")("tooltip2",e.systemSstRate>0?"8% SST, applicable to the Sales Charge":null)("showEditBtn",!1)("showProfitLoss",!1)("tradeProductInfoList",e.tradeProductInfoList)("isOrderPlacedPage",!0),h.Ub(1),h.Mc("nzSpan",h.Fc(18,21,e.isMobile$)?24:6),h.Ub(2),h.Mc("ngIf",e.purchaseOrderNo&&e.refno)}}let Hh=(()=>{class e{constructor(e,t,n,i,c,o,s,a){this.store=e,this.subHandlingService=t,this.activatedRoute=n,this.paymentRestService=i,this.fpxRestService=c,this.router=o,this.transactionService=s,this.utilityRestService=a,this.authenticatedDisplay=Object(g.a)(this.store.selectSnapshot(f.a.getAccounts)),this.selectedTransactionType=this.store.selectSnapshot(u.X.getSelectedTransactionType),this.refno=this.store.selectSnapshot(u.X.getSelectedTransactionType),this.tradeProductInfoList=[],this.buyInfoModel=[],this.isLoading=!1,this.iTransactionTypeEnum=d.d,this.show
5FpxPaymentSuccessModal=!1,this.showFpxPaymentErrorModal=!1,this.isFromFpxDone=!1,this.showPaymentResultModal=!1,this.paymentResultModalSuccess=!1,this.paymentDetails=[],this.systemSstRate=0,history.state.transactionData&&(this.fpxPaymentContent=[],this.resetPaymentResultModel())}filterData(e){var t,n;let i;return i="None"===e.selectedToken?e.promoSalesCharge?Object(p.L)(parseFloat(null===(t=null==e?void 0:e.promoSalesCharge)||void 0===t?void 0:t.toString()),M.a.LOCALE_EN,"1.2-2")+" %":e.tierSalesCharge+"%":Number(e.selectedToken)<e.promoSalesCharge?Object(p.L)(parseFloat(e.selectedToken),M.a.LOCALE_EN,"1.2-2")+" %":Object(p.L)(parseFloat(null===(n=null==e?void 0:e.promoSalesCharge)||void 0===n?void 0:n.toString()),M.a.LOCALE_EN,"1.2-2")+" %",{additionalInfo:i,appliedPromoCode:e.promoApplied,fundInfoName:e.fundName,minInvestmentAmount:e.investAmount,minInvestmentAmountCurrency:e.currencyCode,paymentMethod:e.paymentCategory,profitLossAmount:null,profitLossCurrency:null,profitLossPercentage:null,riskRating:i,sedolnumber:e.sedolNumber,addedToCart:!0}}ngOnInit(){this.getSystemSstRate(),this.subscribeParam()}getSystemSstRate(){const e=this.utilityRestService.getSstRate().pipe(Object(y.a)(e=>e.status===M.a.RESPONSE_SUCCESS&&(this.systemSstRate=e.data)));this.subHandlingService.once(e)}getTotalBuyFpxAmountByPo(){this.subHandlingService.once(this.paymentRestService.getTotalBuyTransactionAmount(this.refno,this.purchaseOrderNo).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&e&&(this.totalBuyAmountFpx=e.data)},e=>console.log(e))))}subscribeParam(){const e=this.activatedRoute.queryParams.pipe(Object(aa.a)(e=>e||e.refno||e.poNumber),Object(y.a)(e=>{var t,n;const{refno:i,poNumber:c,paymentId:o,channel:s}=e;if(s){switch(this.refno=i,this.purchaseOrderNo=c,this.selectedAccTypeDisplay=null===(t=this.authenticatedDisplay)||void 0===t?void 0:t.find(e=>e.refno===i),s){case M.n.CHANNEL_ID_GOPAYZ:this.getGoPayzPaymentInfo(o)}this.showPaymentResultModal=!0}else!i&&c?(this.store.dispatch(new f.p(!1)),this.getFpxInfo(c),this.isFromFpxDone=!0):(this.refno=i,this.purchaseOrderNo=c,this.selectedAccTypeDisplay=null===(n=this.authenticatedDisplay)||void 0===n?void 0:n.find(e=>e.refno===i),this.getTotalBuyFpxAmountByPo())}),Object(y.a)(()=>this.getSelectedInvestmentAcctTradeData()));this.subHandlingService.once(e)}getFpxInfo(e){this.subHandlingService.once(this.fpxRestService.getFpxInfo(e).pipe(Object(y.a)(e=>{var t;e.status===M.a.RESPONSE_SUCCESS?(e&&(this.refno=e.data.buyerRefno,this.purchaseOrderNo=e.data.purchaseOrderNo,this.selectedAccTypeDisplay=null===(t=this.authenticatedDisplay)||void 0===t?void 0:t.find(e=>e.refno===this.refno),this.fpxPaymentContent=$h(e.data)),"00"===e.data.debitStatusCode?(this.getTotalBuyFpxAmountByPo(),this.showFpxPaymentSuccessModal=!0):this.showFpxPaymentErrorModal=!0):this.router.navigate([M.o.PAGE_NOT_FOUND])})))}getGoPayzPaymentInfo(e){this.paymentResultModalMessage="We regret to inform that GoPayz is no longer in service.",this.paymentResultModalDescription="Please use another payment method.<br>Thank You.",this.paymentResultModalSuccess=!1,this.paymentResultModalPrimaryLabel="Done",this.updateOrderCartType(U.a.GOPAYZ,O.a.PAYMENT_FAILED)}updateOrderCartType(e,t){var n;this.cartList$=this.store.select(u.l.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subHandlingService.once(null===(n=this.cartList$)||void 0===n?void 0:n.pipe(Object(y.a)(n=>{const i=null==n?void 0:n.reduce((t,n)=>((null==n?void 0:n.paymentMethod)===e&&t.push(n.sedolNumber),t),[]);this.transactionService.updateBuyUtOrderCartType(i,t,this.refno)})))}resetPaymentResultModel(){this.showPaymentResultModal=!1,this.paymentResultModalTitle="",this.paymentResultModalMessage="",this.paymentResultModalDescription="",this.paymentResultModalSuccess=!1,this.paymentDetails=[],this.paymentResultModalPrimaryLabel="",this.paymentResultHandlePrimaryClick=null}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.l.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.cartList$.subscribe(e=>{this.tradeProductInfoList=e.map(e=>{const t=this.filterData(e);return this.buyInfoModel.push(e.buyInfoModel),t})})}
5closeFpxModel(){this.showFpxPaymentSuccessModal=!1,this.showFpxPaymentErrorModal=!1,window.scrollTo(0,document.body.scrollHeight)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(c.a),h.lc(Au.a),h.lc(Eu.a),h.lc(c.e),h.lc(C.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-fund-buy-order-placed"]],features:[h.Tb([l.a])],decls:4,vars:13,consts:[["class","bg-lighter mb-6",4,"ngIf"],[3,"isVisible","content","done"],[3,"visible","paymentDetails","title","message","description","success","primaryLabel","handlePrimaryClick"],[3,"isVisible","message","content","ok"],[1,"bg-lighter","mb-6"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],[1,"infinite-container","mt-2"],[3,"header1","header2","tooltip2","showEditBtn","showProfitLoss","tradeProductInfoList","isOrderPlacedPage"],[3,"nricName","accountTypeDisplay","purchaseOrderNo","totalBuyAmountFpx","isFromFpxDone",4,"ngIf"],[3,"nricName","accountTypeDisplay","purchaseOrderNo","totalBuyAmountFpx","isFromFpxDone"]],template:function(e,t){1&e&&(h.od(0,Vh,20,26,"div",0),h.rc(1,"app-fpx-transaction-success-modal",1),h.zc("done",(function(){return t.closeFpxModel()})),h.qc(),h.rc(2,"app-payment-result-modal",2),h.zc("handlePrimaryClick",(function(e){return null==t.paymentResultHandlePrimaryClick?null:t.paymentResultHandlePrimaryClick.call(e)})),h.qc(),h.rc(3,"app-fpx-transaction-error-modal",3),h.zc("ok",(function(){return t.closeFpxModel()})),h.qc()),2&e&&(h.Mc("ngIf",t.selectedTransactionType===t.iTransactionTypeEnum.BUY),h.Ub(1),h.Mc("isVisible",t.showFpxPaymentSuccessModal)("content",t.fpxPaymentContent),h.Ub(1),h.Mc("visible",t.showPaymentResultModal)("paymentDetails",t.paymentDetails)("title",t.paymentResultModalTitle)("message",t.paymentResultModalMessage)("description",t.paymentResultModalDescription)("success",t.paymentResultModalSuccess)("primaryLabel",t.paymentResultModalPrimaryLabel),h.Ub(1),h.Mc("isVisible",t.showFpxPaymentErrorModal)("message","We regret to inform that this FPX payment has failed to proceed. Please make other arrangements for payment.")("content",t.fpxPaymentContent))},directives:[p.t,Fu.a,Ou.a,Uu.a,p.q,P.c,P.a,I.a,A.a,Nh],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const $h=e=>[{label:"Account No",value:e.buyerRefno},{label:"Bank Name",value:e.buyerBankName},{label:"FPX Transaction ID",value:e.fpxTransactionId},{label:"Purchase Order No",value:e.purchaseOrderNo},{label:"Transaction Amount",value:""+e.transactionAmount},{label:"Transaction Date & Time",value:Object(p.K)(e.txDateTime,"dd MMMM yyyy h:mm:ss a",M.a.LOCALE_EN)}];function jh(e,t){1&e&&h.nc(0)}function Gh(e,t){if(1&e){const e=h.sc();h.pc(0),h.od(1,jh,1,0,"ng-container",3),h.rc(2,"button",4),h.zc("click",(function(){return h.dd(e),h.Dc().proceedViewPendingTransaction()})),h.qd(3," View Pending Transaction "),h.qc(),h.oc()}if(2&e){h.Dc();const e=h.ad(6);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function Wh(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",5),h.mc(2,"b2c-app-bar-2",6),h.qc(),h.rc(3,"div",7),h.rc(4,"div",8),h.rc(5,"p",9),h.qd(6,"Your order has been successfully placed."),h.qc(),h.rc(7,"p",10),h.qd(8),h.qc(),h.qc(),h.qc(),h.nc(9,11),h.rc(10,"div",12),h.rc(11,"button",13),h.zc("click",(function(){return h.dd(e),h.Dc().proceedViewPendingTransaction()})),h.qd(12," View Pending Transaction "),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Ub(2),h.Mc("title","Order Placed"),h.Ub(6),h.rd(null==e.selectedAccountTypeDisplay?null:e.selectedAccountTypeDisplay.accountTypeDisplay),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function Yh(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-card",22),h.rc(2,"nz-col",23),h.Ec(3,"async"),h.mc(4,"i",24),h.qc(),h.rc(5,"nz-col",23),h.Ec(6,"async"),h.rc(7,"p",25),h.qd(8,"Please proceed to download form to complete your transaction."),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("nzSpan",h.Fc(3,2,e.isMobile$)?2:3),h.Ub(3),h.Mc("nzSpan",h.Fc(6,4,e.isMobile$)?22:21)}}function Kh(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,null==e?null:e.value,null==e?null:e.currencyCode)," ")}}function Xh(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-order-cart",27),h.zc("requestEpfForm",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(3).showRequestEpf(null==n?null:n.title,null==n?null:n.sedolNumber)})),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",28),h.od(3,Kh,2,4,"ng-template",null,29,h.pd),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(4);h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",null==e?null:e.orderCartType)("paymentTitle",null==e?null:e.title),h.Ub(2),h.Mc("value",n)}}function Qh(e,t){if(1&e&&(h.pc(0),h.od(1,Xh,5,5,"b2c-order-cart",26),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.orderPlacedCartDisplayModel)}}const Zh=function(e){return{"bg-white w-100 shadow":e}},Jh=function(e){return{"px-2":e}},ep=function(e){return{"pt-3":e}};function tp(e,t){if(1&e){const e=h.sc();h.rc(0,"div",14),h.Ec(1,"async"),h.rc(2,"div",14),h.Ec(3,"async"),h.rc(4,"nz-row",14),h.Ec(5,"async"),h.rc(6,"div",15),h.rc(7,"h4",16),h.qd(8,"Sales Order No"),h.qc(),h.rc(9,"h4",17),h.qd(10),h.qc(),h.qc(),h.rc(11,"div",18),h.rc(12,"button",19),h.zc("click",(function(){return h.dd(e),h.Dc().downloadSalesOrderNoForm()})),h.mc(13,"i",20),h.qc(),h.qc(),h.qc(),h.od(14,Yh,9,6,"nz-row",0),h.rc(15,"div",21),h.od(16,Qh,2,1,"ng-container",0),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(12,Zh,h.Fc(1,6,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(14,Jh,h.Fc(3,8,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(16,ep,h.Fc(5,10,e.isMobile$))),h.Ub(6),h.rd(e.salesOrderNo),h.Ub(4),h.Mc("ngIf",!e.cartCompleted),h.Ub(2),h.Mc("ngIf",e.orderPlacedCartDisplayModel)}}function np(e,t){if(1&e){const e=h.sc();h.rc(0,"app-request-epf-form-modal",30),h.zc("handleCancel",(function(){return h.dd(e),h.Dc().onCancel()}))("handleDownload",(function(){return h.dd(e),h.Dc().onRequestForm()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("userHoldings",e.userHoldings)("categorizedFundInfo",e.orderPlacedCartData)("selectedKey",e.selectedKey)("refno",e.refno)("sedolnumberList",e.sedolnumberList)("isModalVisible",e.showRequestEpfModal)}}let ip=(()=>{class e{constructor(e,t,n,i,c){var o;this.store=e,this.router=t,this.transactionRestService=n,this.subHandlingService=i,this.activatedRoute=c,this.orderPlacedCartDisplayModel=[],this.userHoldings=[],this.showRequestEpfModal=!1,this.mobileModalFired=!1,this.isMobile=!1,this.cartCompleted=!1,this.isLoading=!1,this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartList$=this.store.select(u.I.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeIsMobile(),this.selectedAccountTypeDisplay=null===(o=this.store.selectSnapshot(f.a.getAccounts))||void 0===o?void 0:o.find(e=>(null==e?void 0:e.refno)===this.refno)}ngOnInit(){this.subscribeParam(),this.getCheckOutFund()}getCheckOutFund(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.cartCompleted=!0,e.forEach(e=>{e.orderCartType!==O.a.EPF_FORM_REQUESTED&&e.orderCartType!==O.a.ORDER_RECEIVED&&(this.cartCompleted=!1)})}),Object(y.a)(e=>{this.orderPlacedCartData=this.groupBuySellCartBy(e,"cartRedemptionMethod"),this.orderPlacedCartDisplayModel=Object.keys(this.orderPlacedCartData).map(e=>(console.log(this.orderPlacedCartData[e].sedolNumber),{title:e,value:this.orderPlacedCartData[e].value,currencyCode:this.orderPlacedCartData[e].currencyCode,orderCartType:this.orderPlacedCartData[e].orderCartType,managerCode:this.orderPlacedCartData[e].managerCode,sedolNumber:this.orderPlacedCartData[e].sedolNumber}))})))}subscribeParam(){this.subHandlingService.once(this.activatedRoute.queryParams.pipe(Object(aa.a)(e=>e||e.poNumber),Object(S.a)(({poNumber:e})=>e),Object(y.a)(e=>{this.salesOrderNo=e})))}groupBuySellCartBy(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.currencyCode,sedolNumber:[]},n.push(e[i[t]])),e[i[t]].managerCode=i.managerCode,e[i[t]].orderCartType=i.orderCartType,e[i[t]].sedolNumber.push(i.sedolNumber),e[i[t]].value+=i.redemptionAmount,e),{})}proceedViewPendingTransaction(){this.router.navigate([M.o.APP,M.o.TRANSACTION_RECORD])}onCancel(){this.showRequestEpfModal=!1,this.mobileModalFired=!1}onRequestForm(){this.showRequestEpfModal=!1,this.mobileModalFired=!1}showRequestEpf(e,t){this.selectedKey=e,this.mobileModalFired=!0,this.showRequestEpfModal=!0,this.sedolnumberList=t}subscribeIsMobile(){this.subHandlingService.once(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e})))}downloadSalesOrderNoForm(){this.subHandlingService.once(this.transactionRestService.downloadOrderNoForm(this.refno,this.salesOrderNo,"sell").pipe(Object(y.a)(e=>{e&&this.downloadForm(e)},e=>
5console.log(e))))}downloadForm(e){const t=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(t,this.salesOrderNo+"_Form.pdf")}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(T.a),h.lc(l.a),h.lc(c.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-sell-order-placed-sider"]],features:[h.Tb([l.a])],decls:8,vars:5,consts:[[4,"ngIf"],["orderPlacedContentTemplate",""],[3,"userHoldings","categorizedFundInfo","selectedKey","refno","sedolnumberList","isModalVisible","handleCancel","handleDownload",4,"ngIf"],[4,"ngTemplateOutlet"],["nz-button","","nzType","primary",1,"font-weight-bold","mb-2","mt-3","w-100","text-md-sm","text-xl-base",3,"click"],[1,"border-bottom"],[3,"title"],[1,"w-100","bg-white","shadow"],[1,"px-2","py-2","mb-3"],[1,"font-weight-bold","mb-2"],[1,"text-sm"],[3,"ngTemplateOutlet"],[1,"px-2","mt-4"],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold","mb-2","mt-4","text-lg-sm","text-xl-base",3,"click"],[3,"ngClass"],["nz-col","","nzSpan","18"],[1,"m-0"],[1,"font-weight-normal"],["nz-col","","nzSpan","6",1,"text-right","mt-1"],["nz-button","","nzType","default","nzSize","small","nzOutline","",1,"mr-2",3,"click"],["nz-icon","","nzType","printer","nzTheme","outline","nzTooltipTitle","Print","nzTooltipPlacement","top","nz-tooltip",""],[1,"py-2"],[1,"p-0","border-top-warning"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning","text-lg","mt-3"],[1,"text-warning"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle","requestEpfForm",4,"ngFor","ngForOf"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle","requestEpfForm"],["horizontal","true","title","Total Indicative Amt.",3,"value"],["valueTemplate",""],[3,"userHoldings","categorizedFundInfo","selectedKey","refno","sedolnumberList","isModalVisible","handleCancel","handleDownload"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,Gh,4,1,"ng-container",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,Wh,13,3,"ng-container",0),h.qc(),h.od(5,tp,17,18,"ng-template",null,1,h.pd),h.od(7,np,1,6,"app-request-epf-form-modal",2)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,3,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!t.mobileModalFired),h.Ub(3),h.Mc("ngIf",t.userHoldings&&t.showRequestEpfModal))},directives:[B.a,p.t,z.a,p.A,_.a,D.a,p.q,P.c,P.a,k.b,xt.e,I.a,p.s,ge.a,be.c,th],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const cp=function(e,t){return{"container mt-5":e,"w-100 mb-6 pb-6":t}};let op=(()=>{class e{constructor(e,t,n){this.store=e,this.route=t,this.subHandlingService=n,this.tradeProductInfoList=[],this.getSelectedInvestmentAcctTradeData()}filterData(e){return{fundInfoName:e.fundName,paymentMethod:e.cartRedemptionMethod,sedolnumber:e.sedolNumber,redemptionFee:e.redemptionFee,redemptionUnit:e.redemptionUnits,isRedeemByAmount:e.sellInfoModel.isRedeemByAmount,redemptionAmount:e.redemptionAmount,redemptionCurrency:e.currencyCode,cashFund:e.cashFund}}ngOnInit(){this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)}),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.getSelectedAccTypeDisplay(),this.get
5SelectedInvestmentAcctTradeData()}onBackPress(){this.route.navigate([M.o.APP,M.o.TRADE,M.o.FUNDS])}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>this.filterData(e))})))}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e})))}getSelectedAccTypeDisplay(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno)}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.I.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getTradeProductInfoData(),this.getCartData()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-fund-sell-order-placed"]],features:[h.Tb([l.a])],decls:22,vars:25,consts:[[1,"bg-lighter","mb-6"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],[1,"infinite-container","mt-2"],[3,"fromSellOrderPlaced","header1","header2","header3","showHeader3","showProfitLoss","tradeProductInfoList"],[1,"text-xs","text-black-6"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.Ec(2,"async"),h.Ec(3,"async"),h.rc(4,"nz-row",2),h.Ec(5,"async"),h.rc(6,"div",3),h.Ec(7,"async"),h.rc(8,"nz-card",4),h.rc(9,"p"),h.qd(10,"Home / Trade"),h.qc(),h.rc(11,"h3"),h.qd(12," Your order has been successfully placed."),h.qc(),h.rc(13,"h4"),h.qd(14),h.qc(),h.rc(15,"div",5),h.mc(16,"app-trade-product-info",6),h.qc(),h.rc(17,"p",7),h.qd(18," *Amount calculated by the latest available NAV price. "),h.qc(),h.qc(),h.qc(),h.rc(19,"div",3),h.Ec(20,"async"),h.mc(21,"app-sell-order-placed-sider"),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(1),h.Mc("ngClass",h.Tc(22,cp,!h.Fc(2,12,t.isMobile$),h.Fc(3,14,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(5,16,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(7,18,t.isMobile$)?0:18),h.Ub(8),h.rd(null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("fromSellOrderPlaced",!0)("header1","Redemption Units")("header2","Indicative Amt.*")("header3","Redemption Fee")("showHeader3",!0)("showProfitLoss",!1)("tradeProductInfoList",t.tradeProductInfoList),h.Ub(3),h.Mc("nzSpan",h.Fc(20,20,t.isMobile$)?24:6))},directives:[p.q,P.c,P.a,I.a,A.a,ip],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function sp(e,t){if(1&e&&h.mc(0,"app-trade-product-info",3),2&e){const e=h.Dc();h.Mc("fromSwitchOrderPlaced",!0)("header1","Redemption Units")("header2","Redemption Fee")("header3","Indicative Switch Buy Amt*")("header4","Switching Fee")("header5","Switch Buy Amt")("header6","Redemption Amt")("tradeProductInfoList",e.filteredTradeProductInfoList)("showContractNo",!0)("noBgLayout",!0)("showBgColour",!1)}}function ap(e,t){1&e&&h.nc(0)}function lp(e,t){if(1&e){const e=h.sc();h.rc(0,"app-web-scaffold"),h.rc(1,"nz-modal",4),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseContractDetails()})),h.od(2,ap,1,0,"ng-container",5),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(1);h.Ub(1),h.Mc("nzFooter",null)("nzClosable",!0)("nzVisible",e.showContractDetails),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function rp(e,t){1&e&&h.nc(0)}function dp(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-mobile-drawer",6),h.zc("showChange",(function(t){return h.dd(e),h.Dc().showContractDetails=t}))("showChange",(function(){return h.dd(e),h.Dc().onCloseContractDetails()})),h.od(1,rp,1,0,"ng-container",5),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(1);h.Mc("show",e.showContractDetails)("height",580)("actionText","done"),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}let up=(()=>{class e{constructor(){this.closeContractDetails=new h.s}ngOnInit(){}onCloseContractDetails(){this.closeContractDetails.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["contract-detail-modal"]],inputs:{showContractDetails:"showContractDetails",filteredTradeProductInfoList:"filteredTradeProductInfoList"},outputs:{closeContractDetails:"closeContractDetails"},decls:7,vars:6,consts:[["contractDetails",""],[4,"ngIf"],[3,"show","height","actionText","showChange",4,"ngIf"],[3,"fromSwitchOrderPlaced","header1","header2","header3","header4","header5","header6","tradeProductInfoList","showContractNo","noBgLayout","showBgColour"],["nzWrapClassName","vertical-center-modal","nzWidth","920",3,"nzFooter","nzClosable","nzVisible","nzOnCancel"],[4,"ngTemplateOutlet"],[3,"show","height","actionText","showChange"]],template:function(e,t){1&e&&(h.od(0,sp,1,11,"ng-template",null,0,h.pd),h.od(2,lp,3,4,"app-web-scaffold",1),h.Ec(3,"async"),h.rc(4,"app-mobile-scaffold"),h.od(5,dp,2,4,"b2c-mobile-drawer",2),h.Ec(6,"async"),h.qc()),2&e&&(h.Ub(2),h.Mc("ngIf",!h.Fc(3,2,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(6,4,t.isMobile$)))},directives:[p.t,z.a,A.a,B.a,j.a,p.A,G.a],pipes:[p.b],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function hp(e,t){1&e&&h.nc(0)}function pp(e,t){if(1&e){const e=h.sc();h.pc(0),h.od(1,hp,1,0,"ng-container",4),h.rc(2,"button",5),h.zc("click",(function(){return h.dd(e),h.Dc().proceedViewPendingTransaction()})),h.qd(3," View Pending Transaction "),h.qc(),h.oc()}if(2&e){h.Dc();const e=h.ad(6);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function mp(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",6),h.mc(2,"b2c-app-bar-2",7),h.qc(),h.rc(3,"div",8),h.rc(4,"div",9),h.rc(5,"p",10),h.qd(6,"Your order has been successfully placed."),h.qc(),h.rc(7,"p",11),h.qd(8),h.qc(),h.qc(),h.qc(),h.nc(9,12),h.rc(10,"div",13),h.rc(11,"button",14),h.zc("click",(function(){return h.dd(e),h.Dc().proceedViewPendingTransaction()})),h.qd(12," View Pending Transaction "),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Ub(2),h.Mc("title","Order Placed"),h.Ub(6),h.rd(null==e.selectedAccountTypeDisplay?null:e.selectedAccountTypeDisplay.accountTypeDisplay),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function fp(e,t){if(1&e&&(h.pc(0),h.rc(1,"h4",24),h.qd(2),h.qc(),h.oc()),2&e){const e=t.$implicit;h.Ub(2),h.rd(e)}}function gp(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-card",25),h.rc(2,"nz-col",26),h.Ec(3,"async"),h.mc(4,"i",27),h.qc(),h.rc(5,"nz-col",26),h.Ec(6,"async"),h.rc(7,"p",28),h.qd(8,"Please proceed and download form to complete your transaction."),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("nzSpan",h.Fc(3,2,e.isMobile$)?2:4),h.Ub(3),h.Mc("nzSpan",h.Fc(6,4,e.isMobile$)?22:20)}}function bp(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,null==e?null:e.value,null==e?null:e.currencyCode)," ")}}function Sp(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-order-cart",30),h.zc("requestEpfForm",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(3).showRequestEpf(null==n?null:n.title,null==n?null:n.sedolNumber)}))("viewContract",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).onViewContract(n)})),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",31),h.od(3,bp,2,4,"ng-template",null,32,h.pd),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(4);h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",null==e?null:e.orderCartType)("paymentTitle",null==e?null:e.title)("showViewContract",!0),h.Ub(2),h.Mc("value",n)}}function yp(e,t){if(1&e&&(h.pc(0),h.od(1,Sp,5,6,"b2c-order-cart",29),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.orderPlacedCartDisplayModel)}}const vp=function(e){return{"bg-white w-100 shadow":e}},Mp=function(e){return{"px-2":e}},Cp=function(e){return{"pt-3":e}};function qp(e,t){if(1&e){const e=h.sc();h.rc(0,"div",15),h.Ec(1,"async"),h.rc(2,"div",15),h.Ec(3,"async"),h.rc(4,"nz-row",16),h.Ec(5,"async"),h.rc(6,"div",17),h.rc(7,"h4",18),h.qd(8,"Order Details"),h.qc(),h.od(9,fp,3,1,"ng-container",19),h.qc(),h.rc(10,"div",20),h.rc(11,"button",21),h.zc("click",(function(){return h.dd(e),h.Dc().downloadSalesOrderNoForm()})),h.mc(12,"i",22),h.qc(),h.qc(),h.qc(),h.od(13,gp,9,6,"nz-row",0),h.rc(14,"div",23),h.od(15,yp,2,1,"ng-container",0),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(12,vp,h.Fc(1,6,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(14,Mp,h.Fc(3,8,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(16,Cp,h.Fc(5,10,e.isMobile$))),h.Ub(5),h.Mc("ngForOf",e.orderNo),h.Ub(4),h.Mc("ngIf",!e.cartCompleted),h.Ub(2),h.Mc("ngIf",e.orderPlacedCartDisplayModel)}}let Tp=(()=>{class e{constructor(e,t,n,i,c,o){var s;this.store=e,this.router=t,this.transactionRestService=n,this.subHandlingService=i,this.activatedRoute=c,this.fundRestService=o,this.orderNo=[],this.userHoldings=[],this.orderPlacedCartDisplayModel=[],this.cartCompleted=!1,this.isLoading=!1,this.showContractDetails=!1,this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeIsMobile(),this.selectedAccountTypeDisplay=null===(s=this.store.selectSnapshot(f.a.getAccounts))||void 0===s?void 0:s.find(e=>(null==e?void 0:e.refno)===this.refno)}ngOnInit(){this.subscribeParam(),this.getCheckOutFund()}getCheckOutFund(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.cartCompleted=!0,e.forEach(e=>{e.orderCartType!==O.a.EPF_FORM_REQUESTED&&e.orderCartType!==O.a.ORDER_RECEIVED&&(this.cartCompleted=!1)})}),Object(y.a)(e=>{this.orderPlacedCartData=this.groupBuySellCartBy(e,"productCategory")})))}subscribeParam(){this.subHandlingService.once(this.activatedRoute.queryParams.pipe(Object(aa.a)(e=>e||e.poNumber),Object(S.a)(({orderNum:e})=>e),Object(y.a)(e=>{this.orderNo=e,console.log(this.orderNo)})))}groupBuySellCartBy(e,t){const n=[];return e.reduce((e,i)=>{let c;return this.subHandlingService.subscribe(this.fundRestService.getFundInfo(i.sedolNumber).pipe(Object(y.a)(o=>{o.status===M.a.RESPONSE_SUCCESS&&o.data&&(c=o.data,e[i[t]]||(e[i[t]]={value:0,currencyCode:i.currencyCode,fundInfo:[]},n.push(e[i[t]])),e[i[t]].managerCode=i.managerCode,e[i[t]].orderCartType=i.orderCartType,e[i[t]].sedolNumber=i.sedolNumber,e[i[t]].value+=i.indicativeAmount,e[i[t]].isPrs=i.isPrs,e[i[t]].fundInfo.push(c),this.orderPlacedCartDisplayModel=Object.keys(this.orderPlacedCartData).map(e=>{let t=[];return t.push(this.orderPlacedCartData[e].sedolNumber),{title:e,value:this.orderPlacedCartData[e].value,currencyCode:this.orderPlacedCartData[e].currencyCode,orderCartType:this.orderPlacedCartData[e].orderCartType,managerCode:this.orderPlacedCartData[e].managerCode,sedolNumber:t,fundInfo:this.orderPlacedCartData[e].fundInfo,isPrs:this.orderPlacedCartData[e].isPrs}}))}))),e},{})}proceedViewPendingTransaction(){this.router.navigate([M.o.APP,M.o.TRANSACTION_RECORD])}onCancel(){this.showRequestEpfModal=!1,this.mobileModalFired=!1}onRequestForm(){this.showRequestEpfModal=!1,this.mobileModalFired=!1}showRequestEpf(e,t){this.selectedKey=e,this.mobileModalFired=!0,this.showRequestEpfModal=!0,this.sedolnumberList=t}subscribeIsMobile(){this.subHandlingService.once(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e})))}downloadSalesOrderNoForm(){for(let e of this.orderNo)"undefined"!==e&&this.subHandlingService.once(this.transactionRestService.downloadOrderNoForm(this.refno,e,null).pipe(Object(y.a)(t=>{t&&this.downloadForm(t,e)},e=>
5console.log(e))))}downloadForm(e,t){const n=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(n,t+"_Form.pdf")}onViewContract(e){this.filteredTradeProductInfoList=this.tradeProductInfoList.filter(t=>t.paymentMethod===e.title),this.showContractDetails=!0}onCloseContractDetails(){this.showContractDetails=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(T.a),h.lc(l.a),h.lc(c.a),h.lc(q.a))},e.\u0275cmp=h.fc({type:e,selectors:[["switch-order-placed-sider"]],inputs:{totalBuyAmountFpx:"totalBuyAmountFpx",nricName:"nricName",tradeProductInfoList:"tradeProductInfoList"},features:[h.Tb([l.a])],decls:9,vars:12,consts:[[4,"ngIf"],["orderPlacedContentTemplate",""],[3,"isModalVisible","categorizedFundInfo","selectedKey","refno","sedolnumberList","userHoldings","handleCancel","handleDownload"],[3,"showContractDetails","filteredTradeProductInfoList","closeContractDetails"],[4,"ngTemplateOutlet"],["nz-button","","nzType","primary",1,"font-weight-bold","w-100","mb-2","mt-4","text-md-sm","text-xl-base",3,"click"],[1,"border-bottom"],[3,"title"],[1,"w-100","bg-white","shadow"],[1,"px-2","py-2","mb-3"],[1,"font-weight-bold","mb-2"],[1,"text-sm"],[3,"ngTemplateOutlet"],[1,"w-100","p-3"],["nz-button","","nzBlock","","nzType","primary",3,"click"],[3,"ngClass"],[1,"pb-2",3,"ngClass"],["nz-col","","nzSpan","18"],[1,"m-0","mb-2"],[4,"ngFor","ngForOf"],["nz-col","","nzSpan","6",1,"text-right","mt-1"],["nzSize","small","nz-button","","nzType","default","nzOutline","",1,"mr-2",3,"click"],["nz-icon","","nzType","printer","nzTheme","outline","nzTooltipTitle","Print","nzTooltipPlacement","top","nz-tooltip",""],[1,"py-2"],[1,"font-weight-normal","mb-0"],[1,"card-bordered-warning"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning","text-lg","mt-3"],[1,"text-warning","mb-0"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle","showViewContract","requestEpfForm","viewContract",4,"ngFor","ngForOf"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle","showViewContract","requestEpfForm","viewContract"],["horizontal","true","title","Total Inv. Amt.",3,"value"],["valueTemplate",""]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,pp,4,1,"ng-container",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,mp,13,3,"ng-container",0),h.qc(),h.od(5,qp,16,18,"ng-template",null,1,h.pd),h.rc(7,"app-request-epf-form-modal",2),h.zc("handleCancel",(function(){return t.onCancel()}))("handleDownload",(function(){return t.onRequestForm()})),h.qc(),h.rc(8,"contract-detail-modal",3),h.zc("closeContractDetails",(function(){return t.onCloseContractDetails()})),h.qc()),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,10,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!t.mobileModalFired),h.Ub(3),h.Mc("isModalVisible",t.showRequestEpfModal)("categorizedFundInfo",t.orderPlacedCartData)("selectedKey",t.selectedKey)("refno",t.refno)("sedolnumberList",t.sedolnumberList)("userHoldings",t.userHoldings),h.Ub(1),h.Mc("showContractDetails",t.showContractDetails)("filteredTradeProductInfoList",t.filteredTradeProductInfoList))},directives:[B.a,p.t,z.a,th,up,p.A,_.a,D.a,p.q,P.c,P.a,p.s,k.b,xt.e,I.a,ge.a,be.c],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const wp=function(e,t){return{"container mt-5":e,"w-100 mb-6 pb-6":t}};let zp=(()=>{class e{constructor(e,t,n,i){this.store=e,this.route=t,this.subHandlingService=n,this.utilityRestService=i,this.tradeProductInfoList=[],this.systemSstRate=0}filterData(e){return{switchSellFundName:e.switchSellFundName,switchBuyFundName:e.switchBuyFundName,sedolnumber:e.sedolNumber,redemptionFee:e.redemptionFee,additionalInfo:e.promoSalesCharge?e.promoSalesCharge.toString():e.switchSalesCharge,redemptionUnit:e.fundSwitchTransactionModel.switchUnit,isRedeemByAmount:e.fundSwitchTransactionModel.isAmount,redemptionAmount:e.fundSwitchTransactionModel.switchAmount,redemptionCurrency:e.currencyCode,cashFund:e.cashFund,indicativeAmount:e.indicativeAmount,paymentMethod:e.productCategory,buyContractNo:e.fundSwitchTransactionModel.buyContractNo,sellContractNo:e.fundSwitchTransactionModel.sellContractNo,isWaived:e.isWaived,isPercent:e.fundSwitchTransactionModel.isPercent}}
5ngOnInit(){this.getSystemSstRate(),this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)}),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.getSelectedAccTypeDisplay(),this.getSelectedInvestmentAcctTradeData()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}onBackPress(){this.route.navigate([M.o.APP,M.o.TRADE,M.o.FUNDS])}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>this.filterData(e))})))}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e})))}getSelectedAccTypeDisplay(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno)}getSelectedInvestmentAcctTradeData(){this.cartList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getTradeProductInfoData(),this.getCartData()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-fund-switch-order-placed"]],features:[h.Tb([l.a])],decls:22,vars:28,consts:[[1,"bg-lighter","mb-6"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],[1,"text-md","font-weight-normal"],[1,"infinite-container","mt-2"],[3,"fromSwitchOrderPlaced","header1","header2","header3","header4","tooltip4","header5","header6","tradeProductInfoList"],[1,"text-xs","text-black-6"],[3,"tradeProductInfoList"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.Ec(2,"async"),h.Ec(3,"async"),h.rc(4,"nz-row",2),h.Ec(5,"async"),h.rc(6,"div",3),h.Ec(7,"async"),h.rc(8,"nz-card",4),h.rc(9,"p"),h.qd(10,"Home / Trade"),h.qc(),h.rc(11,"h3"),h.qd(12," Your order has been successfully placed."),h.qc(),h.rc(13,"p",5),h.qd(14),h.qc(),h.rc(15,"div",6),h.mc(16,"app-trade-product-info",7),h.qc(),h.rc(17,"p",8),h.qd(18," *Amount calculated by the latest available NAV price. "),h.qc(),h.qc(),h.qc(),h.rc(19,"div",3),h.Ec(20,"async"),h.mc(21,"switch-order-placed-sider",9),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(1),h.Mc("ngClass",h.Tc(25,wp,!h.Fc(2,15,t.isMobile$),h.Fc(3,17,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(5,19,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(7,21,t.isMobile$)?0:18),h.Ub(8),h.rd(null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("fromSwitchOrderPlaced",!0)("header1","Redemption Units")("header2","Redemption Fee")("header3","Indicative Switch Buy Amt*")("header4","Switching Fee")("tooltip4",t.systemSstRate>0?"8% SST, applicable to the Switch Buy Sales Charge":null)("header5","Switch Buy Amt")("header6","Redemption Amt")("tradeProductInfoList",t.tradeProductInfoList),h.Ub(3),h.Mc("nzSpan",h.Fc(20,23,t.isMobile$)?24:6),h.Ub(2),h.Mc("tradeProductInfoList",t.tradeProductInfoList))},directives:[p.q,P.c,P.a,I.a,A.a,Tp],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Dp(e,t){1&e&&h.mc(0,"b2c-app-bar-2",10),2&e&&h.Mc("title","Order Placed")}function Pp(e,t){1&e&&h.nc(0)}function Ip(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",11),h.rc(2,"div",12),h.rc(3,"p",13),h.qd(4,"Your order has been successfully placed."),h.qc(),h.rc(5,"p",14),h.qd(6),h.qc(),h.qc(),h.qc(),h.nc(7,15),h.rc(8,"div",16),h.rc(9,"button",17),h.zc("click",(function(){return h.dd(e),h.Dc().proceedViewPendingTransaction()})),h.qd(10," View Pending Transaction "),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(),t=h.ad(10);h.Ub(6),h.rd(e.accountTypeDisplay),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function kp(e,t){if(1&e&&(h.rc(0,"nz-card",27),h.rc(1,"nz-col",28),h.Ec(2,"async"),h.mc(3,"i",29),h.qc(),h.rc(4,"nz-col",28),h.Ec(5,"async"),h.rc(6,"p",30),h.qd(7,"Please proceed to payment to complete your transaction."),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("nzSpan",h.Fc(2,2,e.isMobile$)?2:4),h.Ub(3),h.Mc("nzSpan",h.Fc(5,4,e.isMobile$)?22:20)}}function Ap(e,t){if(1&e&&(h.rc(0,"nz-row"),h.od(1,kp,8,6,"nz-card",26),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",!e.isFromFpxDone)}}function Ep(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,null==e?null:e.totalAmount,null==e?null:e.currencyCode)," ")}}function Fp(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-order-cart",32),h.zc("payNow",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(3).payNowClick(null==n?null:n.title)})),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",33),h.od(3,Ep,2,4,"ng-template",null,34,h.pd),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(4);h.Mc("isEditOrder",!1)("isShowContent",!0)("orderCartType",e.orderCartType)("paymentTitle",null==e?null:e.title),h.Ub(2),h.Mc("value",n)}}function Op(e,t){if(1&e&&(h.pc(0),h.od(1,Fp,5,5,"b2c-order-cart",31),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.orderPlacedCartDisplayModel)}}const Up=function(e){return{"bg-white w-100 shadow py-3":e}},xp=function(e){return{"px-2":e}};function Lp(e,t){if(1&e){const e=h.sc();h.rc(0,"div",18),h.Ec(1,"async"),h.rc(2,"div",18),h.Ec(3,"async"),h.rc(4,"nz-row"),h.rc(5,"div",19),h.rc(6,"h4",20),h.qd(7,"Purchase Order No."),h.qc(),h.rc(8,"h4",21),h.qd(9),h.qc(),h.qc(),h.rc(10,"div",22),h.rc(11,"button",23),h.zc("click",(function(){return h.dd(e),h.Dc().downloadPurchaseOrderNoForm()})),h.mc(12,"i",24),h.qc(),h.qc(),h.qc(),h.od(13,Ap,2,1,"nz-row",4),h.rc(14,"div",25),h.od(15,Op,2,1,"ng-container",4),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(9,Up,h.Fc(1,5,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(11,xp,h.Fc(3,7,e.isMobile$))),h.Ub(7),h.rd(e.purchaseOrderNo),h.Ub(4),h.Mc("ngIf",!e.cartCompleted),h.Ub(2),h.Mc("ngIf",e.orderPlacedCartDisplayModel)}}let Rp=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l){this.store=e,this.router=t,this.transactionRestService=n,this.subHandlingService=i,this.fundRestService=c,this.paymentRestService=o,this.fpxRestService=s,this.transactionService=a,this.route=l,this._isFromFpxDone=!1,this.userHoldings=[],this.orderPlacedCartDisplayModel=[],this.showLocalPaymentModal=!1,this.showSuccessModal=!1,this.cartCompleted=!0,this.isLoading=!1,this.formDownloaded=!1,this.paymentAllowed=!0,this.gotSyariahPortfolio=!1,this.cartList$=this.store.select(u.k.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeIsMobile(),this.subHandlingService.once(this.route.queryParams.pipe(Object(y.a)(e=>{this.fpxPurchaseOrderNo=e.poNumber})))}set isFromFpxDone(e){e&&(this._isFromFpxDone=e,this.subHandlingService.subscribe(this.fpxRestService.getFpxInfo(this.fpxPurchaseOrderNo).pipe(Object(y.a)(e=>{if(e.status!==M.a.RESPONSE_SUCCESS||"00"!==e.data.debitStatusCode)return this.transactionService.updateBuyDpmsFpxCartType(this.refno,"failed"),void(this.paymentAllowed=!1);this.transactionService.updateBuyDpmsFpxCartType(this.refno,"success")}))))}get isFromFpxDone(){return this._isFromFpxDone}ngOnInit(){const e=this.store.selectSnapshot(f.a.getAccounts);this.nricName=e.find(e=>e.refno===this.refno).nricName,this.accountTypeDisplay=e.find(e=>e.refno===this.refno).accountTypeDisplay,this.getTotalBuyFpxAmountByPo()}ngOnChanges(e){this.getCheckoutFund()}getCheckoutFund(){this.cartCompleted=!0,this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{e.forEach(e=>{e.orderCartType!==O.a.PAYMENT_RECEIVED&&(this.cartCompleted=!1)}),this.orderPlacedCartData=this.getOrderPlacedCartData(e,"cartPaymentMethodDisplay"),this.orderPlacedCartDisplayModel=Object.keys(this.orderPlacedCartData).map(e=>({title:e,dpmsPortfolioIdList:this.orderPlacedCartData[e].dpmsPortfolioIdList,dpmsBuyModelList:this.orderPlacedCartData[e].dpmssBuyModelList,totalAmount:this.orderPlacedCartData[e].value,currencyCode:this.orderPlacedCartData[e].currencyCode,orderCartType:this.orderPlacedCartData[e].orderCartType,gotSyariahPortfolio:this.orderPlacedCartData[e].gotSyariahPortfolio}))})))}getOrderPlacedCartData(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.dpmsBuyModel.currency,orderCartType:i.orderCartType,dpmsPortfolioIdList:[],dpmssBuyModelList:[],gotSyariahPortfolio:!1},n.push(e[i[t]])),e[i[t]].value+=i.dpmsBuyModel.amount,e[i[t]].dpmsPortfolioIdList.push(i.dpmsBuyModel.dpmsPortfolioId),e[i[t]].dpmssBuyModelList.push(i.dpmsBuyModel),-1!==i.dpmsBuyModel.dpmsPortfolioName.indexOf("Islamic")&&(e[i[t]].gotSyariahPortfolio=!0),e),{})}proceedViewPendingTransaction(){this.router.navigate([M.o.APP,M.o.TRANSACTION_RECORD])}payNowClick(e){var t;this.mobileModalFired=!0;const n=null===(t=this.orderPlacedCartDisplayModel)||void 0===t?void 0:t.find(t=>t.title===e);this.modalCurrency=n.currencyCode,this.modalPaymentAmount=n.totalAmount,this.modalPaymentMethod=e,this.gotSyariahPortfolio=n.gotSyariahPortfolio,e.includes(U.a.PAYMENT_METHOD_FPX)&&!e.includes(U.a.PAYMENT_CURRENCY_MYR)&&(this.show
5ForeignPaymentModal=!0),e.includes(U.a.PAYMENT_METHOD_FPX)&&e.includes(U.a.PAYMENT_CURRENCY_MYR)&&(this.showLocalPaymentModal=!0)}onDownloadForm(){this.showDownloadPrsModal=!1,this.showRequestEpfModal=!1,this.mobileModalFired=!1,this.formDownloaded=!0}onCloseLocalPaymentModal(){this.showLocalPaymentModal=!1,this.mobileModalFired=!1}onBackFromSubmitReceipt(e){e!==U.a.PAYMENT_CURRENCY_MYR?(this.showUploadReceiptModal=!1,this.showForeignPaymentModal=!0):(this.showUploadReceiptModal=!1,this.showLocalPaymentModal=!0)}onSubmitProof(){this.showForeignPaymentModal=!1,this.showLocalPaymentModal=!1,this.showUploadReceiptModal=!0}onSuccess(e){this.orderListKey=e,this.isMobile||(this.showForeignPaymentModal=!1,this.showUploadReceiptModal=!1),this.showSuccessModal=!0}onSuccessModalClose(){var e;this.showUploadReceiptModal=!1,this.showForeignPaymentModal=!1,this.showSuccessModal=!1,this.mobileModalFired=!1;let t=null===(e=this.orderPlacedCartDisplayModel)||void 0===e?void 0:e.find(e=>e.title===this.orderListKey).dpmsPortfolioIdList;this.transactionService.updateBuyDpmsOrderCartType(t,O.a.PAYMENT_RECEIVED,this.refno),this.getCheckoutFund()}subscribeIsMobile(){this.subHandlingService.once(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e})))}preSubmitToFPX(e,t){let n={fpxSellerOrderNo:this.purchaseOrderNo,fpxTxnAmount:this.totalBuyAmountFpx,fpxBuyerBankId:e,fpxBuyerEmail:t,redirectUrl:this.router.url.split("?")[0]};this.subHandlingService.once(this.paymentRestService.preSubmit(this.refno,!0,n).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fpxPaymentDetails=Object(g.a)(e.data),this.transactionService.setLastVisitedUrl(this.router.url))},e=>console.log(e))))}onPayNow(e){this.preSubmitToFPX(e.selectedBank,e.email)}onSubmittedToFpx(){}downloadPurchaseOrderNoForm(){this.subHandlingService.once(this.transactionRestService.downloadOrderNoForm(this.refno,this.purchaseOrderNo,null).pipe(Object(y.a)(e=>{e&&this.downloadForm(e)},e=>console.log(e))))}downloadForm(e){const t=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(t,this.purchaseOrderNo+"_Form.pdf")}getTotalBuyFpxAmountByPo(){this.subHandlingService.once(this.paymentRestService.getTotalBuyTransactionAmount(this.refno,this.fpxPurchaseOrderNo).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&e&&(this.totalBuyAmountFpx=e.data)},e=>console.log(e))))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(T.a),h.lc(l.a),h.lc(q.a),h.lc(Au.a),h.lc(Eu.a),h.lc(C.a),h.lc(c.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-buy-order-placed-sider"]],inputs:{purchaseOrderNo:"purchaseOrderNo",refno:"refno",isFromFpxDone:"isFromFpxDone"},features:[h.Tb([l.a]),h.Sb],decls:15,vars:17,consts:[[1,"border-bottom"],[3,"title",4,"ngIf"],[4,"ngTemplateOutlet"],["nzBlock","","nz-button","","nzType","primary",1,"font-weight-bold","mb-2","mt-4","text-md-sm","text-xl-base",3,"click"],[4,"ngIf"],["orderPlacedContentTemplate",""],[3,"showLocalPaymentModal","paymentMethod","totalAmount","paymentAllowed","islamicPortfolio","closeLocalPaymentModal","upload","payNow"],[3,"refno","nricName","paymentMethod","paymentAmount","fromCurrency","purchaseOrderNo","show","success","backed"],[3,"fpxPaymentDetails","submittedToFpx"],[3,"show","cancel","done"],[3,"title"],[1,"w-100","bg-white","shadow"],[1,"p-2","mb-3"],[1,"font-weight-bold","mb-2"],[1,"text-sm"],[3,"ngTemplateOutlet"],[1,"px-2"],["nz-button","","nzType","primary","nzBlock","",1,"mt-3",3,"click"],[3,"ngClass"],["nz-col","","nzSpan","18"],[1,"m-0"],[1,"font-weight-normal"],["nz-col","","nzSpan","6",1,"text-right","mt-1"],["nz-button","","nzSize","small","nzType","outline","nzOutline","",1,"mr-2",3,"click"],["nz-icon","","nzType","printer","nzTheme","outline","nzTooltipTitle","Print","nzTooltipPlacement","top","nz-tooltip",""],[1,"py-2"],["class","border-top-warning",4,"ngIf"],[1,"border-top-warning"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning","text-lg"],[1,"text-warning"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle","payNow",4,"ngFor","ngForOf"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle","payNow"],["horizontal","true","title","Total Inv. Amt.",3,"value"],["valueTemplate",""]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.rc(1,"div",0),h.od(2,Dp,1,1,"b2c-app-bar-2",1),h.qc(),h.qc(),h.rc(3,"app-web-scaffold"),h.od(4,Pp,1,0,"ng-container",2),h.rc(5,"button",3),h.zc("click",(function(){return t.proceedViewPendingTransaction()})),h.qd(6," View Pending Transaction "),h.qc(),h.qc(),h.rc(7,"app-mobile-scaffold"),h.od(8,Ip,11,2,"ng-container",4),h.qc(),h.od(9,Lp,16,13,"ng-template",null,5,h.pd),h.rc(11,"cheque-fpx-local-modal",6),h.zc("closeLocalPaymentModal",(function(){return t.onClose
5LocalPaymentModal()}))("upload",(function(){return t.onSubmitProof()}))("payNow",(function(e){return t.onPayNow(e)})),h.qc(),h.rc(12,"app-upload-deposit-receipt-modal",7),h.zc("success",(function(e){return t.onSuccess(e)}))("backed",(function(e){return t.onBackFromSubmitReceipt(e)})),h.qc(),h.rc(13,"fpx-submit-form",8),h.zc("submittedToFpx",(function(){return t.onSubmittedToFpx()})),h.qc(),h.rc(14,"app-success-payment-modal",9),h.zc("cancel",(function(){return t.onSuccessModalClose()}))("done",(function(){return t.onSuccessModalClose()})),h.qc()),2&e){const e=h.ad(10);h.Ub(2),h.Mc("ngIf",!t.mobileModalFired),h.Ub(2),h.Mc("ngTemplateOutlet",e),h.Ub(4),h.Mc("ngIf",!t.mobileModalFired),h.Ub(3),h.Mc("showLocalPaymentModal",t.showLocalPaymentModal)("paymentMethod",t.modalPaymentMethod)("totalAmount",t.modalPaymentAmount)("paymentAllowed",t.paymentAllowed)("islamicPortfolio",t.gotSyariahPortfolio),h.Ub(1),h.Mc("refno",t.refno)("nricName",t.nricName)("paymentMethod",t.modalPaymentMethod)("paymentAmount",t.modalPaymentAmount)("fromCurrency",t.modalCurrency)("purchaseOrderNo",t.purchaseOrderNo)("show",t.showUploadReceiptModal),h.Ub(1),h.Mc("fpxPaymentDetails",t.fpxPaymentDetails),h.Ub(1),h.Mc("show",t.showSuccessModal)}},directives:[z.a,p.t,B.a,p.A,_.a,nh.a,ih.a,ch.a,oh.a,D.a,p.q,P.c,P.a,k.b,xt.e,I.a,p.s,ge.a,be.c],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const Np=function(e,t){return{container:e,"w-100 mb-6 pb-6":t}};let Bp=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.subHandlingService=t,this.activatedRoute=n,this.fpxRestService=i,this.router=c,this.datePipe=o,this.utilityRestService=s,this.tradeProductInfoList=[],this.isFromFpxDone=!1,this.showFpxPaymentSuccessModal=!1,this.showFpxPaymentErrorModal=!1,this.systemSstRate=0}ngOnInit(){this.subscribeParam(),this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)}),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartList$=this.store.select(u.k.getCartList).pipe(Object(S.a)(e=>
5e(this.refno))),this.getSelectedInvestmentAcctData(),this.getSystemSstRate()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}getSelectedInvestmentAcctData(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno),this.getTradeProductInfoData(),this.getCartData()}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>this.filterData(e))})))}filterData(e){return{paymentMethod:e.cartPaymentMethodDisplay,dpmsPortfolioId:e.dpmsBuyModel.dpmsPortfolioId,dpmsPortfolioName:e.dpmsBuyModel.dpmsPortfolioName,investmentAmount:e.dpmsBuyModel.amount,investmentCurrency:e.dpmsBuyModel.currency,additionalInfo:e.salesChargeDisplay.toFixed(2).toString()+"%"}}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e})))}subscribeParam(){this.subHandlingService.once(this.activatedRoute.queryParams.pipe(Object(aa.a)(e=>e||e.refno||e.poNumber),Object(S.a)(({refno:e,poNumber:t})=>this.orderPlacedParams={refno:e,poNumber:t}),Object(y.a)(e=>{(null==e?void 0:e.refno)?this.purchaseOrderNo=e.poNumber:e.poNumber&&(this.purchaseOrderNo=e.poNumber,this.store.dispatch(new f.p(!1)),this.getFpxInfo(e.poNumber),this.isFromFpxDone=!0)})))}getFpxInfo(e){this.subHandlingService.once(this.fpxRestService.getFpxInfo(e).pipe(Object(y.a)(e=>{var t;e.status===M.a.RESPONSE_SUCCESS?(e&&(this.purchaseOrderNo=e.data.purchaseOrderNo,this.selectedAccTypeDisplay=null===(t=this.authenticatedDisplay)||void 0===t?void 0:t.find(e=>e.refno===this.refno),this.fpxPaymentContent=this.setFpxPaymentModalContent(e.data)),"00"===e.data.debitStatusCode?this.showFpxPaymentSuccessModal=!0:this.showFpxPaymentErrorModal=!0):this.router.navigate([M.o.PAGE_NOT_FOUND])})))}setFpxPaymentModalContent(e){return[{label:"Account No",value:this.refno},{label:"Bank Name",value:e.buyerBankName},{label:"FPX Transaction ID",value:e.fpxTransactionId},{label:"Purchase Order No",value:e.purchaseOrderNo},{label:"Transaction Amount",value:""+e.transactionAmount},{label:"Transaction Date & Time",value:this.datePipe.transform(e.txDateTime,"dd MMMM yyyy h:mm:ss a")}]}closeFpxModel(){this.showFpxPaymentSuccessModal=!1,this.showFpxPaymentErrorModal=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a),h.lc(c.a),h.lc(Eu.a),h.lc(c.e),h.lc(p.f),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-buy-order-placed"]],features:[h.Tb([p.f,l.a])],decls:22,vars:33,consts:[[1,"bg-lighter","mb-6"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],[1,"text-md","font-weight-normal"],[1,"infinite-container","mt-2"],[3,"isDpms","isDpmsSubsequentPage","showHeader3","header3","tooltip3","header1","tradeProductInfoList"],[3,"refno","purchaseOrderNo","isFromFpxDone"],[3,"isVisible","content","done"],[3,"isVisible","message","content","ok"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.Ec(2,"async"),h.Ec(3,"async"),h.rc(4,"nz-row",2),h.Ec(5,"async"),h.rc(6,"div",3),h.Ec(7,"async"),h.rc(8,"nz-card",4),h.rc(9,"p"),h.qd(10,"Home / Trade"),h.qc(),h.rc(11,"h3"),h.qd(12," Your order has been successfully placed."),h.qc(),h.rc(13,"p",5),h.qd(14),h.qc(),h.rc(15,"div",6),h.mc(16,"app-trade-product-info",7),h.qc(),h.qc(),h.qc(),h.rc(17,"div",3),h.Ec(18,"async"),h.mc(19,"app-dpms-buy-order-placed-sider",8),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(20,"app-fpx-transaction-success-modal",9),h.zc("done",(function(){return t.closeFpxModel()})),h.qc(),h.rc(21,"app-fpx-transaction-error-modal",10),h.zc("ok",(function(){return t.closeFpxModel()})),h.qc()),2&e&&(h.Ub(1),h.Mc("ngClass",h.Tc(30,Np,!h.Fc(2,20,t.isMobile$),h.Fc(3,22,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(5,24,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(7,26,t.isMobile$)?0:18),h.Ub(8),h.rd(null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("isDpms",!0)("isDpmsSubsequentPage",!0)("showHeader3",!0)("header3","Subscription Fee")("tooltip3",t.systemSstRate?"8% SST, applicable to the Subscription Fee":null)("header1","Investment Amt.")("tradeProductInfoList",t.tradeProductInfoList),h.Ub(1),h.Mc("nzSpan",h.Fc(18,28,t.isMobile$)?24:6),h.Ub(2),h.Mc("refno",t.refno)("purchaseOrderNo",t.purchaseOrderNo)("isFromFpxDone",t.isFromFpxDone),h.Ub(1),h.Mc("isVisible",t.showFpxPaymentSuccessModal)("content",t.fpxPaymentContent),h.Ub(1),h.Mc("isVisible",t.showFpxPaymentErrorModal)("message","We regret to inform that this FPX payment has failed to proceed. Please make other arrangements for payment.")("content",t.fpxPaymentContent))},directives:[p.q,P.c,P.a,I.a,A.a,Rp,Fu.a,Uu.a],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function _p(e,t){1&e&&h.nc(0)}function Vp(e,t){if(1&e){const e=h.sc();h.pc(0),h.od(1,_p,1,0,"ng-container",2),h.rc(2,"button",3),h.zc("click",(function(){return h.dd(e),h.Dc().proceedViewPendingTransaction()})),h.qd(3," View Pending Transaction "),h.qc(),h.oc()}if(2&e){h.Dc();const e=h.ad(6);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function Hp(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",4),h.mc(2,"b2c-app-bar-2",5),h.qc(),h.rc(3,"div",6),h.rc(4,"div",7),h.rc(5,"p",8),h.qd(6,"Your order has been successfully placed."),h.qc(),h.rc(7,"p",9),h.qd(8),h.qc(),h.qc(),h.qc(),h.nc(9,10),h.rc(10,"div",11),h.rc(11,"button",12),h.zc("click",(function(){return h.dd(e),h.Dc().proceedViewPendingTransaction()})),h.qd(12," View Pending Transaction "),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Ub(2),h.Mc("title","Order Placed"),h.Ub(6),h.rd(e.selectedAccountTypeDisplay.accountTypeDisplay),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function $p(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-card",21),h.rc(2,"nz-col",22),h.Ec(3,"async"),h.mc(4,"i",23),h.qc(),h.rc(5,"nz-col",22),h.Ec(6,"async"),h.rc(7,"p",24),h.qd(8,"Please proceed and download form to complete your transaction."),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("nzSpan",h.Fc(3,2,e.isMobile$)?2:4),h.Ub(3),h.Mc("nzSpan",h.Fc(6,4,e.isMobile$)?22:20)}}function jp(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,null==e?null:e.value,null==e?null:e.currencyCode)," ")}}function Gp(e,t){if(1&e&&(h.rc(0,"b2c-order-cart",26),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",27),h.od(3,jp,2,4,"ng-template",null,28,h.pd),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.ad(4);h.Mc("isEditOrder",!1)("isShowContent",!0)("paymentTitle",null==e?null:e.title),h.Ub(2),h.Mc("value",n)}}function Wp(e,t){if(1&e&&(h.pc(0),h.od(1,Gp,5,4,"b2c-order-cart",25),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.orderPlacedCartDisplayModel)}}const Yp=function(e){return{"bg-white w-100 shadow mb-6":e}},Kp=function(e){return{"px-2":e}}
5,Xp=function(e){return{"pt-3":e}};function Qp(e,t){if(1&e){const e=h.sc();h.rc(0,"div",13),h.Ec(1,"async"),h.rc(2,"div",13),h.Ec(3,"async"),h.rc(4,"nz-row",13),h.Ec(5,"async"),h.rc(6,"div",14),h.rc(7,"h4",15),h.qd(8,"Sales Order No"),h.qc(),h.rc(9,"h4",16),h.qd(10),h.qc(),h.qc(),h.rc(11,"div",17),h.rc(12,"button",18),h.zc("click",(function(){return h.dd(e),h.Dc().downloadSalesOrderNoForm()})),h.mc(13,"i",19),h.qc(),h.qc(),h.qc(),h.od(14,$p,9,6,"nz-row",0),h.rc(15,"div",20),h.od(16,Wp,2,1,"ng-container",0),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(12,Yp,h.Fc(1,6,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(14,Kp,h.Fc(3,8,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(16,Xp,h.Fc(5,10,e.isMobile$))),h.Ub(6),h.rd(e.salesOrderNo),h.Ub(4),h.Mc("ngIf",!e.cartCompleted),h.Ub(2),h.Mc("ngIf",e.orderPlacedCartDisplayModel)}}let Zp=(()=>{class e{constructor(e,t,n,i,c){var o;this.store=e,this.router=t,this.transactionRestService=n,this.subHandlingService=i,this.activatedRoute=c,this.orderPlacedCartDisplayModel=[],this.userHoldings=[],this.showRequestEpfModal=!1,this.mobileModalFired=!1,this.isMobile=!1,this.cartCompleted=!1,this.isLoading=!1,this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartList$=this.store.select(u.H.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeIsMobile(),this.selectedAccountTypeDisplay=null===(o=this.store.selectSnapshot(f.a.getAccounts))||void 0===o?void 0:o.find(e=>(null==e?void 0:e.refno)===this.refno)}ngOnInit(){this.subscribeParam(),this.getCheckOutFund()}getCheckOutFund(){this.cartCompleted=!0,this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{e.forEach(e=>{e.orderCartType!==O.a.ORDER_RECEIVED&&(this.cartCompleted=!1)}),this.orderPlacedCartData=this.groupOrderPlacedDataBy(e,"cartRedemptionMethodDisplay"),this.orderPlacedCartDisplayModel=Object.keys(this.orderPlacedCartData).map(e=>{let t=[];return t.push(this.orderPlacedCartData[e].dpmsPortfolioIdList),{title:e,value:this.orderPlacedCartData[e].value,currencyCode:this.orderPlacedCartData[e].currencyCode,orderCartType:this.orderPlacedCartData[e].orderCartType,dpmsPortfolioIdList:t,totalAmount:this.orderPlacedCartData[e].value}})})))}subscribeParam(){this.subHandlingService.once(this.activatedRoute.queryParams.pipe(Object(aa.a)(e=>e||e.poNumber),Object(S.a)(({poNumber:e})=>e),Object(y.a)(e=>{this.salesOrderNo=e})))}groupOrderPlacedDataBy(e,t){const n=[];return e.reduce((e,i)=>(e[i[t]]||(e[i[t]]={value:0,currencyCode:i.dpmsSellModel.currency},n.push(e[i[t]])),e[i[t]].orderCartType=i.orderCartType,e[i[t]].dpmsPortfolioIdList=i.dpmsSellModel.dpmsPortfolioId,e[i[t]].value+=i.indicativeRedemptionAmount,e),{})}proceedViewPendingTransaction(){this.router.navigate([M.o.APP,M.o.TRANSACTION_RECORD],{queryParams:{refno:this.refno}})}onCancel(){this.showRequestEpfModal=!1,this.mobileModalFired=!1}subscribeIsMobile(){this.subHandlingService.once(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e})))}downloadSalesOrderNoForm(){this.subHandlingService.once(this.transactionRestService.downloadOrderNoForm(this.refno,this.salesOrderNo,null).pipe(Object(y.a)(e=>{e&&this.downloadForm(e)},e=>console.log(e))))}downloadForm(e){const t=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(t,this.salesOrderNo+"_Form.pdf")}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(T.a),h.lc(l.a),h.lc(c.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-sell-order-placed-sider"]],features:[h.Tb([l.a])],decls:7,vars:4,consts:[[4,"ngIf"],["orderPlacedContentTemplate",""],[4,"ngTemplateOutlet"],["nz-button","","nzType","primary",1,"font-weight-bold","mb-2","mt-3","w-100","text-md-sm","text-xl-base",3,"click"],[1,"border-bottom"],[3,"title"],[1,"w-100","bg-white","shadow"],[1,"p-2","mb-3"],[1,"font-weight-bold","mb-2"],[1,"text-sm"],[3,"ngTemplateOutlet"],[1,"px-2"],["nz-button","","nzBlock","","nzType","primary","nzBlock","",3,"click"],[3,"ngClass"],["nz-col","","nzSpan","18"],[1,"m-0"],[1,"font-weight-normal"],["nz-col","","nzSpan","6",1,"text-right","mt-1"],["nz-button","","nzSize","small","nzType","outline","nzOutline","",1,"mr-2",3,"click"],["nz-icon","","nzType","printer","nzTheme","outline","nzTooltipTitle","Print","nzTooltipPlacement","top","nz-tooltip",""],[1,"pt-2","pb-4"],[1,"border-top-warning"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning","text-lg","mt-3"],[1,"text-warning"],["orderCartType","orderReceived",3,"isEditOrder","isShowContent","paymentTitle",4,"ngFor","ngForOf"],["orderCartType","orderReceived",3,"isEditOrder","isShowContent","paymentTitle"],["horizontal","true","title","Total Indicative Amt.",3,"value"],["valueTemplate",""]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,Vp,4,1,"ng-container",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,Hp,13,3,"ng-container",0),h.qc(),h.od(5,Qp,17,18,"ng-template",null,1,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,2,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!t.mobileModalFired))},directives:[B.a,p.t,z.a,p.A,_.a,D.a,p.q,P.c,P.a,k.b,xt.e,I.a,p.s,ge.a,be.c],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const Jp=function(e,t){return{"container mt-5":e,"w-100 mb-6 pb-6":t}};let em=(()=>{class e{constructor(e,t){this.store=e,this.subHandlingService=t,this.tradeProductInfoList=[]}ngOnInit(){this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)}),this.refno=this.store.selectSnapshot(u.X.getSelectedRefno),this.cartList$=this.store.select(u.H.getCartList).pipe(Object(S.a)(e=>
5e(this.refno))),this.getSelectedInvestmentAcctData()}getSelectedInvestmentAcctData(){var e;this.selectedAccTypeDisplay=null===(e=this.authenticatedDisplay)||void 0===e?void 0:e.find(e=>e.refno===this.refno),this.getTradeProductInfoData(),this.getCartData()}getTradeProductInfoData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.tradeProductInfoList=e.map(e=>this.filterData(e))})))}filterData(e){return{paymentMethod:e.cartRedemptionMethodDisplay,dpmsPortfolioName:e.dpmsPortfolioName,dpmsPortfolioId:e.dpmsSellModel.dpmsPortfolioId,redemptionCurrency:e.dpmsSellModel.currency,indicativeAmount:e.indicativeRedemptionAmount,redemptionPercentage:e.dpmsSellModel.redemptionPercentage}}getCartData(){var e;this.subHandlingService.once(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=e})))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(l.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-sell-order-placed"]],features:[h.Tb([l.a])],decls:20,vars:24,consts:[[1,"bg-lighter","mb-6"],[3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","",3,"nzSpan"],[1,"h-100"],[1,"text-md","font-weight-normal"],[1,"infinite-container","mt-2"],[3,"isDpms","isDpmsSubsequentPage","header1","header2","tradeProductInfoList","fromSellOrderPlaced"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.Ec(2,"async"),h.Ec(3,"async"),h.rc(4,"nz-row",2),h.Ec(5,"async"),h.rc(6,"div",3),h.Ec(7,"async"),h.rc(8,"nz-card",4),h.rc(9,"p"),h.qd(10,"Home / Trade"),h.qc(),h.rc(11,"h3"),h.qd(12," Your order has been successfully placed."),h.qc(),h.rc(13,"p",5),h.qd(14),h.qc(),h.rc(15,"div",6),h.mc(16,"app-trade-product-info",7),h.qc(),h.qc(),h.qc(),h.rc(17,"div",3),h.Ec(18,"async"),h.mc(19,"app-dpms-sell-order-placed-sider"),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(1),h.Mc("ngClass",h.Tc(21,Jp,!h.Fc(2,11,t.isMobile$),h.Fc(3,13,t.isMobile$))),h.Ub(3),h.Mc("nzGutter",h.Fc(5,15,t.isMobile$)?0:16),h.Ub(2),h.Mc("nzSpan",h.Fc(7,17,t.isMobile$)?0:18),h.Ub(8),h.rd(null==t.selectedAccTypeDisplay?null:t.selectedAccTypeDisplay.accountTypeDisplay),h.Ub(2),h.Mc("isDpms",!0)("isDpmsSubsequentPage",!0)("header1","Redemption Percentage")("header2","Indicative Amt*")("tradeProductInfoList",t.tradeProductInfoList)("fromSellOrderPlaced",!0),h.Ub(1),h.Mc("nzSpan",h.Fc(18,19,t.isMobile$)?24:6))},directives:[p.q,P.c,P.a,I.a,A.a,Zp],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function tm(e,t){1&e&&h.mc(0,"app-fund-buy-order-placed")}function nm(e,t){1&e&&h.mc(0,"app-fund-sell-order-placed")}function im(e,t){1&e&&h.mc(0,"app-fund-switch-order-placed")}function cm(e,t){1&e&&h.mc(0,"app-dpms-buy-order-placed")}function om(e,t){1&e&&h.mc(0,"app-dpms-sell-order-placed")}let sm=(()=>{class e{constructor(e){this.store=e,this.iTransactionTypeEnum=d.d,this.iProductEnum=r.b,this.refno=this.store.selectSnapshot(u.X.getSelectedTransactionType),this.selectedTransactionType=this.store.selectSnapshot(u.X.getSelectedTransactionType),this.selectedTradeProduct=this.store.selectSnapshot(u.X.getTradeProduct),window.onpopstate=e=>window.history.forward()}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["app-order-placed"]],features:[h.Tb([l.a])],decls:5,vars:5,consts:[[4,"ngIf"]],template:function(e,t){1&e&&(h.od(0,tm,1,0,"app-fund-buy-order-placed",0),h.od(1,nm,1,0,"app-fund-sell-order-placed",0),h.od(2,im,1,0,"app-fund-switch-order-placed",0),h.od(3,cm,1,0,"app-dpms-buy-order-placed",0),h.od(4,om,1,0,"app-dpms-sell-order-placed",0)),2&e&&(h.Mc("ngIf",t.selectedTransactionType===t.iTransactionTypeEnum.BUY&&t.selectedTradeProduct===t.iProductEnum.UNIT_TRUST),h.Ub(1),h.Mc("ngIf",t.selectedTransactionType===t.iTransactionTypeEnum.SELL&&t.selectedTradeProduct===t.iProductEnum.UNIT_TRUST),h.Ub(1),h.Mc("ngIf",t.selectedTransactionType===t.iTransactionTypeEnum.SWITCH&&t.selectedTradeProduct===t.iProductEnum.UNIT_TRUST),h.Ub(1),h.Mc("ngIf",t.selectedTransactionType===t.iTransactionTypeEnum.BUY&&t.selectedTradeProduct===t.iProductEnum.DPMS),h.Ub(1),h.Mc("ngIf",t.selectedTransactionType===t.iTransactionTypeEnum.SELL&&t.selectedTradeProduct===t.iProductEnum.DPMS))},directives:[p.t,Hh,op,zp,Bp,em],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})(),am=(()=>{class e{constructor(e,t){this.router=e,this.store=t}canActivate(e,t){return!(!this.store.snapshot().trade.lastVisitedUrl||-1===this.store.snapshot().trade.lastVisitedUrl.indexOf(M.o.ORDER_PLACED))||!(!this.store.snapshot().trade.lastVisitedUrl||-1===this.store.snapshot().trade.lastVisitedUrl.indexOf(M.o.BOND_CHECK_OUT))||this.router.navigated||this.router.parseUrl("/")}}return e.\u0275fac=function(t){return new(t||e)(h.vc(c.e),h.vc(s.i))},e.\u0275prov=h.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();
5var lm=n("HDdC"),rm=n("5CBK"),dm=n("7b0G"),um=n("qHSR"),hm=n("xzdC"),pm=n("6l6k"),mm=n("jhN1"),fm=n("+Lsq"),gm=n("W7Oe"),bm=n("k4d9"),Sm=n("z8gd");function ym(e,t){if(1&e&&(h.rc(0,"div",9),h.rc(1,"div",10),h.rc(2,"h5",11),h.qd(3,"You haven\u2019t added anything to your cart yet!"),h.qc(),h.qc(),h.rc(4,"div",9),h.rc(5,"div",12),h.rc(6,"div",13),h.mc(7,"img",14),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(7),h.Mc("src",e.transactionImgPath+"emptyCart.svg",h.gd)("alt","empty cart")}}function vm(e,t){1&e&&h.mc(0,"investment-account-selector")}function Mm(e,t){1&e&&(h.rc(0,"nz-row",22),h.rc(1,"nz-col",23),h.mc(2,"i",24),h.qc(),h.rc(3,"nz-col",23),h.qd(4," Applicable promotional sales charge will be reflected at Check Out page "),h.qc(),h.qc()),2&e&&(h.Ub(1),h.Mc("nzSpan",2),h.Ub(2),h.Mc("nzSpan",22))}function Cm(e,t){if(1&e){const e=h.sc();h.rc(0,"app-campaign-code-input-box",25),h.zc("promoCodeApplied",(function(t){return h.dd(e),h.Dc(2).promoApplied(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("refno",e.refno)}}function qm(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.investAmount,e.currencyCode)," ")}}function Tm(e,t){if(1&e&&(h.rc(0,"span",36),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd(" ",h.Gc(2,1,e.promoSalesCharge,"1.2-2"),"% ")}}function wm(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd(" ",h.Gc(2,1,e.defaultSalesCharge,"1.2-2"),"% ")}}function zm(e,t){if(1&e&&(h.rc(0,"app-web-scaffold"),h.qd(1),h.Ec(2,"number"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,Tm,3,4,"span",35),h.od(5,wm,3,4,"span",4),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.sd(" ",h.Gc(2,3,e.defaultSalesCharge,"1.2-2"),"% "),h.Ub(3),h.Mc("ngIf",e.promoApplied),h.Ub(1),h.Mc("ngIf",!e.promoApplied)}}function Dm(e,t){if(1&e&&(h.rc(0,"label",43),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.sd(" ",e.label," ")}}function Pm(e,t){if(1&e){const e=h.sc();h.rc(0,"div",37),h.rc(1,"div",38),h.rc(2,"p",39),h.qd(3," Utilize Your Referral Token? "),h.qc(),h.qc(),h.rc(4,"div",40),h.rc(5,"nz-radio-group",41),h.zc("ngModelChange",(function(t){h.dd(e);const n=h.Dc().$implicit;return h.Dc(2).onTabChange(t,n)}))("ngModelChange",(function(t){return h.dd(e),h.Dc().$implicit.selectedToken=t})),h.od(6,Dm,2,2,"label",42),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Mc("nzSpan",24),h.Ub(1),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("ngModel",e.selectedToken),h.Ub(1),h.Mc("ngForOf",t.tokenList)}}function Im(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",26),h.rc(2,"b2c-order-cart",27),h.zc("editOrder",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onClickEdit(n)})),h.rc(3,"nz-row"),h.mc(4,"b2b-statistic",28),h.Ec(5,"titlecase"),h.qc(),h.rc(6,"nz-row"),h.mc(7,"b2b-statistic",29),h.od(8,qm,2,4,"ng-template",null,30,h.pd),h.qc(),h.rc(10,"nz-row"),h.mc(11,"b2b-statistic",31),h.od(12,zm,6,6,"ng-template",null,32,h.pd),h.qc(),h.rc(14,"nz-row"),h.mc(15,"b2b-statistic",33),h.qc(),h.od(16,Pm,7,5,"div",34),h.Ec(17,"async"),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(9),i=h.ad(13),c=h.Dc(2);h.Ub(2),h.Mc("isEditOrder",!0)("isShowContent",!0)("paymentTitle",null==e?null:e.fundName)("orderCartType",c.orderCartConstant.PENDING),h.Ub(2),h.Mc("value","epf"===e.investmentType?e.investmentType.toUpperCase():h.Fc(5,10,e.investmentType)),h.Ub(3),h.Mc("value",n),h.Ub(4),h.Mc("value",i)("tooltip",c.systemSstRate>0?"8% SST, applicable to the Sales Charge":null),h.Ub(4),h.Mc("value",e.paymentCategory),h.Ub(1),h.Mc("ngIf",h.Fc(17,12,c.tokenList.length>1&&c.isMobile$))}}const km=function(e){return{"bg-white shadow mt-3 mb-6 pt-3 pb-2":e}},Am=function(e){return{"px-2":e}},Em=function(e){return{"mt-4":e}};function Fm(e,t){if(1&e){const e=h.sc();h.rc(0,"div",15),h.Ec(1,"async"),h.rc(2,"div",15),h.Ec(3,"async"),h.rc(4,"p",16),h.Ec(5,"async"),h.qd(6,"Order Cart Details"),h.qc(),h.od(7,Mm,5,2,"nz-row",17),h.Ec(8,"async"),h.rc(9,"app-mobile-scaffold"),h.od(10,Cm,1,1,"app-campaign-code-input-box",18),h.Ec(11,"async"),h.qc(),h.od(12,Im,18,14,"div",19),h.Ec(13,"async"),h.rc(14,"app-web-scaffold"),h.rc(15,"div",20),h.rc(16,"button",21),h.zc("click",(function(){return h.dd(e),h.Dc().proceedCheckOut()})),h.qd(17," Proceed "),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(18,km,h.Fc(1,6,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(20,Am,h.Fc(3,8,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(22,Em,!h.Fc(5,10,e.isMobile$))),h.Ub(3),h.Mc("ngIf",!h.Fc(8,12,e.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(11,14,e.isMobile$)&&e.mobilePreviewCart),h.Ub(2),h.Mc("ngForOf",h.Fc(13,16,e.cartList$))}}
5function Om(e,t){if(1&e){const e=h.sc();h.rc(0,"buy-fund-fill-detail",44),h.zc("closeFundFillDetails",(function(){return h.dd(e),h.Dc().closeFundFillDetails()}))("closeFundFillDetailsAsPassportExpiry",(function(){return h.dd(e),h.Dc().showPassportExpiryNotice()})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc();h.Mc("currentCartList",h.Fc(1,7,e.cartList$))("fromEdit",e.isUpdate)("refno",e.refno)("selectedCart",e.selectedCart)("selectedFund",e.selectedFund)("selectedSedol",null==e.selectedFund?null:e.selectedFund.sedolnumber)("showAddFundDetailsModal",e.showAddFundDetailsModal)}}let Um=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.router=t,this.subHandlingService=n,this.cdRef=i,this.transactionService=c,this.fundRestService=o,this.utilityRestService=s,this.selectedList=[],this.checkoutList=[],this.promoCodeApplied=new h.s,this.mobileBack=new h.s,this.proceedEdit=new h.s,this.cartItemData=[],this.isUpdate=!1,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.orderCartConstant=O.a,this.showAddFundDetailsModal=!1,this.tokenList=[],this.passportNoticeVisible=!1,this.systemSstRate=0}ngOnInit(){this.subscribeRefnoChange(),this.transactionService.removeBuyOrderPlacedFund(),this.getSystemSstRate()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}proceedCheckOut(){this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.CHECK_OUT)],{queryParams:{refno:this.refno}})}onClickEdit(e){this.subHandlingService.once(this.fundRestService.getFundBuyDetailInfo(this.refno,e.sedolNumber).pipe(Object(y.a)(t=>{t.status===M.a.RESPONSE_SUCCESS&&t.data&&(this.proceedEdit.emit({fundInfo:t.data,sedolNumber:e.sedolNumber,investmentType:e.investmentType,investAmount:e.investAmount,paymentMethod:e.paymentMethod,dividendInstruction:null==e?void 0:e.dividendInstruction}),this.selectedFund=t.data,this.cartList$.subscribe(e=>{for(let t of e)this.selectedFund.sedolnumber==t.sedolNumber&&(this.selectedCart=t)}),this.isUpdate=!0)}),Object(y.a)(()=>{this.showAddFundDetailsModal=!0})))}promoApplied(e){this.promoCodeApplied.emit(e)}closeFundFillDetails(){this.showAddFundDetailsModal=!1,this.isUpdate=!1}onAppBarBack(){this.mobileBack.emit()}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.refno=e,this.cdRef.markForCheck(),this.cartList$=this.store.select(u.l.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.getCartData(),this.checkTokens()})))}checkTokens(){for(let e of this.cartItemData)this.tokenList=[{label:"None",value:"None",active:!0},{label:"1%",value:"1",active:null==e?void 0:e.referralTokenOnePercent},{label:"0.8%",value:"0.8",active:null==e?void 0:e.referralTokenZeroPointEight},{label:"0.5%",value:"0.5",active:null==e?void 0:e.referralTokenZeroPointFive}],this.tokenList=this.tokenList.filter(e=>e.active)}onTabChange(e,t){this.cartItemData.forEach(n=>{if(n.sedolNumber===t.sedolNumber){switch(console.log(n.sedolNumber,t.sedolNumber),e){case"1":n.buyInfoModel.onePercentReferralToken=!0,""==n.campaignCode&&(n.promoSalesCharge=1);break;case"0.8":n.buyInfoModel.zeroPointEightReferralToken=!0,""==n.campaignCode&&(n.promoSalesCharge=.8);break;case"0.5":n.buyInfoModel.zeroPointFiveReferralToken=!0,""==n.campaignCode&&(n.promoSalesCharge=.5);break;default:n.buyInfoModel.zeroPointFiveReferralToken=null,n.buyInfoModel.zeroPointEightReferralToken=null,n.buyInfoModel.onePercentReferralToken=null,""==n.campaignCode&&(n.promoSalesCharge=n.tierSalesCharge)}this.transactionService.updateBuyCartInfo(Object(g.a)(n)),this.transactionService.updateToken(n.sedolNumber,e,this.refno)}})}getCartData(){var e;this.subHandlingService.subscribe(null===(e=this.cartList$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.cartItemData=Object(g.a)(e),this.checkTokens()})))}showPassportExpiryNotice(){this.passportNoticeVisible=!0}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(h.j),h.lc(C.a),h.lc(q.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["buy-order-cart-sider"]],inputs:{selectedList:"selectedList",orderCartSedolnumber:"orderCartSedolnumber",checkoutList:"checkoutList",mobilePreviewCart:"mobilePreviewCart"},outputs:{promoCodeApplied:"promoCodeApplied",mobileBack:"mobileBack",proceedEdit:"proceedEdit"},features:[h.Tb([l.a])],decls:17,vars:16,consts:[[1,"h-100"],["class","text-center mt-3 pt-3",4,"ngIf"],[3,"title","back"],[1,"border-top"],[4,"ngIf"],[3,"ngClass",4,"ngIf"],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"click"],[3,"currentCartList","fromEdit","refno","selectedCart","selectedFund","selectedSedol","showAddFundDetailsModal","closeFundFillDetails","closeFundFillDetailsAsPassportExpiry",4,"ngIf"],[3,"modalVisible","isPopUp","footerFunc","onOkEmit","onUpdateEmit"],[1,"text-center","mt-3","pt-3"],[1,"mx-5"],[1,"text-black-5"],[1,"mt-3","pt-3"],[1,"mt-3"],[1,"img-fluid",3,"src","alt"],[3,"ngClass"],[1,"font-weight-bold","mb-2",3,"ngClass"],["class","text-sm text-info pb-3",4,"ngIf"],[3,"refno","promoCodeApplied",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"mb-2","mt-3"],["nz-button","","nzSize","default","nzType","primary",1,"font-weight-bold","w-100",3,"click"],[1,"text-sm","text-info","pb-3"],[3,"nzSpan"],["nz-icon","","nzType","info-circle","nzTheme","fill"],[3,"refno","promoCodeApplied"],[1,"mb-3"],[3,"isEditOrder","isShowContent","paymentTitle","orderCartType","editOrder"],["title","Type","horizontal","true",3,"value"],["title","Amt.","horizontal","true",3,"value"],["investmentAmountTemplate",""],["t
5itle","Sales Charge","horizontal","true",3,"value","tooltip"],["salesChargeTemplate",""],["horizontal","true","title","Payment Method",3,"value"],["class","pt-4","nz-col","",3,"nzSpan",4,"ngIf"],["class","font-weight-bold text-info",4,"ngIf"],[1,"font-weight-bold","text-info"],["nz-col","",1,"pt-4",3,"nzSpan"],["nz-col","",3,"nzSpan"],[1,"font-weight-bold"],["nz-col","",2,"z-index","1",3,"nzSpan"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["class","px-4","nz-radio-button","",3,"nzValue",4,"ngFor","ngForOf"],["nz-radio-button","",1,"px-4",3,"nzValue"],[3,"currentCartList","fromEdit","refno","selectedCart","selectedFund","selectedSedol","showAddFundDetailsModal","closeFundFillDetails","closeFundFillDetailsAsPassportExpiry"]],template:function(e,t){if(1&e&&(h.rc(0,"div",0),h.od(1,ym,8,2,"div",1),h.Ec(2,"async"),h.Ec(3,"async"),h.rc(4,"app-mobile-scaffold"),h.rc(5,"b2c-app-bar-2",2),h.zc("back",(function(){return t.onAppBarBack()})),h.qc(),h.rc(6,"div",3),h.od(7,vm,1,0,"investment-account-selector",4),h.Ec(8,"async"),h.qc(),h.qc(),h.od(9,Fm,18,24,"div",5),h.Ec(10,"async"),h.qc(),h.rc(11,"app-mobile-scaffold"),h.rc(12,"b2c-floating-bar"),h.rc(13,"button",6),h.zc("click",(function(){return t.proceedCheckOut()})),h.qd(14," Proceed "),h.qc(),h.qc(),h.qc(),h.od(15,Om,2,9,"buy-fund-fill-detail",7),h.rc(16,"passport-expiry-notification",8),h.zc("onOkEmit",(function(){return t.passportNoticeVisible=!1}))("onUpdateEmit",(function(){return t.passportNoticeVisible=!1})),h.qc()),2&e){var n=null;const e=0===(null==(n=h.Fc(2,8,t.cartList$))?null:n.length)||null===(null==(n=h.Fc(3,10,t.cartList$))?null:n.length);var i;const c=(null==(i=h.Fc(10,14,t.cartList$))?null:i.length)>0;h.Ub(1),h.Mc("ngIf",e),h.Ub(4),h.Mc("title","Order Cart"),h.Ub(2),h.Mc("ngIf",h.Fc(8,12,t.isMobile$)),h.Ub(2),h.Mc("ngIf",c),h.Ub(6),h.Mc("ngIf",t.selectedFund&&t.selectedCart&&t.showAddFundDetailsModal),h.Ub(1),h.Mc("modalVisible",t.passportNoticeVisible)("isPopUp",!1)("footerFunc",!0)}},directives:[p.t,z.a,D.a,Se.a,_.a,dt.a,ut.a,p.q,p.s,B.a,P.c,P.a,k.b,fe,ge.a,be.c,Ut.c,oe.t,oe.w,Ut.a,hc],pipes:[p.b,p.G,ke.a,p.g],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function xm(e,t){if(1&e){const e=h.sc();h.rc(0,"div",7),h.rc(1,"b2c-app-bar-2",8),h.zc("back",(function(){return h.dd(e),h.Dc().onAppBarBack()})),h.qc(),h.qc()}2&e&&(h.Ub(1),h.Mc("title","Order Cart"))}function Lm(e,t){if(1&e&&(h.rc(0,"div",12),h.rc(1,"div",13),h.rc(2,"h5",14),h.qd(3,"You haven\u2019t added anything to your cart yet!"),h.qc(),h.qc(),h.rc(4,"div",15),h.rc(5,"div",16),h.rc(6,"div",17),h.mc(7,"img",18),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(7),h.Mc("src",e.transactionImgPath+"emptyCart.svg",h.gd)}}function Rm(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.rd(h.Gc(2,1,e.redemptionAmount,e.currencyCode))}}function Nm(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.rd(h.Gc(2,1,e.redemptionUnits,"1.2-2"))}}function Bm(e,t){if(1&e&&(h.od(0,Rm,3,4,"span",2),h.od(1,Nm,3,4,"span",2)),2&e){const e=h.Dc().$implicit;h.Mc("ngIf",null==e?null:e.sellInfoModel.isRedeemByAmount),h.Ub(1),h.Mc("ngIf",!(null!=e&&e.sellInfoModel.isRedeemByAmount))}}function _m(e,t){if(1&e&&(h.rc(0,"span",34),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd(" ",h.Gc(2,1,e.redemptionAmount,e.currencyCode)," ")}}function Vm(e,t){if(1&e&&(h.rc(0,"nz-row"),h.mc(1,"b2b-statistic",32),h.od(2,_m,3,4,"ng-template",null,33,h.pd),h.qc()),2&e){const e=h.ad(3);h.Ub(1),h.Mc("value",e)}}function Hm(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"0.00%"),h.qc())}function $m(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.rd(e.redemptionFee)}}function jm(e,t){if(1&e&&(h.od(0,Hm,2,0,"span",35),h.od(1,$m,2,1,"ng-template",null,36,h.pd)),2&e){const e=h.ad(2),t=h.Dc().$implicit;h.Mc("ngIf","-"===t.redemptionFee)("ngIfElse",e)}}function Gm(e,t){if(1&e&&h.mc(0,"i",39),2&e){h.Dc();const e=h.ad(4);h.Mc("nzTooltipTitle",e)}}function Wm(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1,"Subject to Redemption Fee"),h.qc(),h.rc(2,"p",34),h.qd(3),h.Ec(4,"number"),h.qc(),h.rc(5,"p"),h.qd(6,"Not Subject to Redemption Fee"),h.qc(),h.rc(7,"p",34),h.qd(8),h.Ec(9,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(3),h.sd("",h.Gc(4,2,e.unitRedemptionFee,"1.2-2")," units"),h.Ub(5),h.sd("",h.Gc(9,5,e.unitNonRedemptionFee,"1.2-2")," units")}}function Ym(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1,"Redemption Fee "),h.od(2,Gm,1,1,"i",37),h.qc(),h.od(3,Wm,10,8,"
5ng-template",null,38,h.pd)),2&e){const e=h.Dc().$implicit;h.Ub(2),h.Mc("ngIf","-"!==e.redemptionFee&&"0.0%"!==e.redemptionFee)}}function Km(e,t){1&e&&(h.rc(0,"p"),h.qd(1,"Yes"),h.qc())}function Xm(e,t){1&e&&(h.rc(0,"p"),h.qd(1,"No"),h.qc())}function Qm(e,t){if(1&e&&(h.od(0,Km,2,0,"p",2),h.od(1,Xm,2,0,"p",2)),2&e){const e=h.Dc(2).$implicit;h.Mc("ngIf",e.continueRsp),h.Ub(1),h.Mc("ngIf",!e.continueRsp)}}function Zm(e,t){if(1&e&&(h.rc(0,"nz-row"),h.mc(1,"b2b-statistic",40),h.od(2,Qm,2,2,"ng-template",null,41,h.pd),h.qc()),2&e){const e=h.ad(3);h.Ub(1),h.Mc("value",e)}}function Jm(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",24),h.rc(2,"b2c-order-cart",25),h.zc("editOrder",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).onClickEdit(n)})),h.rc(3,"nz-row"),h.mc(4,"b2b-statistic",26),h.qc(),h.rc(5,"nz-row"),h.mc(6,"b2b-statistic",27),h.od(7,Bm,2,2,"ng-template",null,28,h.pd),h.qc(),h.od(9,Vm,4,1,"nz-row",2),h.rc(10,"nz-row"),h.mc(11,"b2b-statistic",27),h.od(12,jm,3,2,"ng-template",null,29,h.pd),h.od(14,Ym,5,1,"ng-template",null,30,h.pd),h.qc(),h.rc(16,"nz-row"),h.mc(17,"b2b-statistic",31),h.qc(),h.od(18,Zm,4,1,"nz-row",2),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(8),i=h.ad(13),c=h.ad(15),o=h.Dc(3);h.Ub(2),h.Mc("isEditOrder",!0)("isShowContent",!0)("orderCartType",o.orderCartConstant.PENDING)("paymentTitle",null==e?null:e.fundName),h.Ub(2),h.Mc("value",e.sellInfoModel.paymentMethod===o.transactionConstant.CHEQUE.toLowerCase()?"Cash":e.sellInfoModel.paymentMethod),h.Ub(2),h.Mc("title",null!=e&&e.sellInfoModel.isRedeemByAmount?"Amounts":"Units")("value",n),h.Ub(3),h.Mc("ngIf",!e.cashFund),h.Ub(2),h.Mc("title",c)("value",i),h.Ub(6),h.Mc("value",e.cartRedemptionMethod),h.Ub(1),h.Mc("ngIf",e.isNormalRsp&&e.hasActiveRsp)}}const ef=function(e){return{"bg-white shadow":e}},tf=function(e){return{"px-2 mb-6 pb-2":e}};function nf(e,t){if(1&e){const e=h.sc();h.rc(0,"div",19),h.Ec(1,"async"),h.rc(2,"div",19),h.Ec(3,"async"),h.rc(4,"p",20),h.qd(5,"Order Cart Details"),h.qc(),h.od(6,Jm,19,12,"div",21),h.Ec(7,"async"),h.rc(8,"app-web-scaffold"),h.rc(9,"div",22),h.rc(10,"button",23),h.zc("click",(function(){return h.dd(e),h.Dc(2).proceedCheckOut()})),h.qd(11," Proceed To Check Out "),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("ngClass",h.Sc(9,ef,h.Fc(1,3,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(11,tf,h.Fc(3,5,e.isMobile$))),h.Ub(4),h.Mc("ngForOf",h.Fc(7,7,e.cartList$))}}function cf(e,t){if(1&e&&(h.rc(0,"div",9),h.od(1,Lm,8,1,"div",10),h.Ec(2,"async"),h.Ec(3,"async"),h.od(4,nf,12,13,"div",11),h.Ec(5,"async"),h.qc()),2&e){const e=h.Dc();var n=null;const t=0===(null==(n=h.Fc(2,2,e.cartList$))?null:n.length)||null===(null==(n=h.Fc(3,4,e.cartList$))?null:n.length);var i;const c=(null==(i=h.Fc(5,6,e.cartList$))?null:i.length)>0&&!e.mobileFillDetail;h.Ub(1),h.Mc("ngIf",t),h.Ub(3),h.Mc("ngIf",c)}}function of(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"b2c-floating-bar"),h.rc(2,"button",42),h.zc("click",(function(){return h.dd(e),h.Dc().proceedCheckOut()})),h.qd(3," Proceed To Check Out "),h.qc(),h.qc(),h.oc()}}function sf(e,t){if(1&e&&h.mc(0,"nz-skeleton",43),2&e){const e=h.Dc();h.Mc("nzActive",!0)("nzLoading",e.isLoading)}}let af=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.router=t,this.subHandlingService=n,this.transactionService=i,this.cdRef=c,this.transactionRestService=o,this.accountRestService=s,this.mobileBack=new h.s,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.transactionConstant=U.a,this.orderCartConstant=O.a,this.isUpdate=!1,this.isLoading=!1,this.showSellFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.showEpfFundFillDetail=!1,this.sellInfoModel=[]}ngOnInit(){this.subscribeRefnoChange()}removeOrderPlacedFund(){this.subHandlingService.once(this.cartList$.pipe(Object(y.a)(e=>{if((null==e?void 0:e.length)>0){this.sellInfoModel=[];for(let t of e)t.orderStatus===U.a.ORDER_PLACED?this.transactionService.removeSellOrderPlacedFund(this.refno):this.sellInfoModel.push(t)}})))}proceedCheckOut(){this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.CHECK_OUT)],{queryParams:{refno:this.refno}})}onClickEdit(e){if(this.isMobile=this.store.selectSnapshot(a.a.isMobile),this.isMobile&&(this.mobileFillDetail=!0),this.fundList){for(let t of this.fundList)e.sedolNumber===t.productC
5ode&&e.sellInfoModel.paymentMethod===t.paymentMethod&&(this.selectedFund=t,this.isUpdate=!0);if(e.cashFund)return void(this.showCmfFundFillDetail=!0);if(e.sellInfoModel.paymentMethod===U.a.CHEQUE.toLowerCase())return void(this.showSellFundFillDetail=!0);if(e.sellInfoModel.paymentMethod===U.a.EPF_FUNDS.toUpperCase())return void(this.showEpfFundFillDetail=!0)}}onAppBarBack(){this.mobileBack.emit()}onFundFillDetailClosed(){this.isUpdate=!1,this.showSellFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.showEpfFundFillDetail=!1,this.mobileFillDetail=!1}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.refno=e,this.cdRef.markForCheck(),this.cartList$=this.store.select(u.I.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.removeOrderPlacedFund(),this.isLoading=!0,Object(ht.a)([this.getHoldingList(),this.getBankDetails()]).pipe(Object(y.a)(()=>{this.isLoading=!1})).subscribe()})))}getHoldingList(){return this.transactionRestService.getSellHoldingList(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fundList=e.data.sort((e,t)=>e.productName>t.productName?1:t.productName>e.productName?-1:0))},e=>console.log(e)))}getBankDetails(){return this.accountRestService.getBankDetails(this.refno).pipe(Object(y.a)(e=>{var t;if(e.status!==M.a.RESPONSE_SUCCESS)return;let n=e.data.Local,i=e.data.Overseas;if((null===(t=this.sellInfoModel)||void 0===t?void 0:t.length)>0)for(let c of this.sellInfoModel)if(c.redemptionMethod===U.a.CHEQUE_FPX){let e=(null==n?void 0:n.find(e=>e.currency===c.sellInfoModel.currency))||(null==i?void 0:i.find(e=>e.currency===c.sellInfoModel.currency));if(e){const t="Credit to Bank Acc ["+Object(Uc.a)("*",e.bankAcctNo)+"]";c.cartRedemptionMethod!==t&&this.transactionService.updateSellCartRedemptionMethod(this.refno,c.sellInfoModel.sedolNumber,t),this.transactionService.updateBankModelToShow(this.refno,e.currency,e.bankAcctNo)}}}))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(C.a),h.lc(h.j),h.lc(T.a),h.lc(bt.a))},e.\u0275cmp=h.fc({type:e,selectors:[["sell-order-cart-sider"]],inputs:{mobilePreviewCart:"mobilePreviewCart"},outputs:{mobileBack:"mobileBack"},features:[h.Tb([l.a])],decls:13,vars:25,consts:[["class","border-bottom",4,"ngIf"],["class","h-100",4,"ngIf","ngIfElse"],[4,"ngIf"],[3,"addedFund","isUpdate","isLoading","selectedFund","show","closed"],[3,"selectedFund","show","addedFund","isLoading","isUpdate","closed"],[3,"selectedFund","isVisible","addedFund","isUpdate","isLoading","closed"],["loadingTemplate",""],[1,"border-bottom"],[3,"title","back"],[1,"h-100"],["class","text-center mt-5 pt-5",4,"ngIf"],[3,"ngClass",4,"ngIf"],[1,"text-center","mt-5","pt-5"],[1,"mx-5"],[1,"text-black-5"],[1,"text-center","mt-3","pt-3"],[1,"mt-3","pt-3"],[1,"mt-3"],[1,"img-fluid",3,"src"],[3,"ngClass"],[1,"font-weight-bold","pt-3"],[4,"ngFor","ngForOf"],[1,"mb-2","mt-3"],["nz-button","","nzSize","default","nzType","primary",1,"font-weight-bold","w-100",3,"click"],[1,"mb-3"],[3,"isEditOrder","isShowContent","orderCartType","paymentTitle","editOrder"],["horizontal","true","title","Type",3,"value"],["horizontal","true",3,"title","value"],["unitTemplate",""],["redemptionFeeTemplate",""],["redemptionFeeTitle",""],["horizontal","true","title","Method",3,"value"],["horizontal","true","title","Indicative Amt.",3,"value"],["redemptionAmountTemplate",""],[1,"font-weight-bold"],[4,"ngIf","ngIfElse"],["showRedemptionFee",""],["class","text-accent-1 pointer","nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",3,"nzTooltipTitle",4,"ngIf"],["tooltip",""],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",1,"text-accent-1","pointer",3,"nzTooltipTitle"],["horizontal","true","title","Continue RSP?",3,"value"],["rspTemplate",""],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"click"],[3,"nzActive","nzLoading"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,xm,2,1,"div",0),h.qc(),h.od(2,cf,6,8,"div",1),h.rc(3,"app-mobile-scaffold"),h.od(4,of,4,0,"ng-container",2),h.qc(),h.rc(5,"app-sell-fund-fill-detail",3),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(6,"async"),h.qc(),h.rc(7,"sell-cmf-fund-fill-detail",4),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(8,"async"),h.qc(),h.rc(9,"sell-epf-fund-fill-detail",5),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(10,"async"),h.qc(),h.od(11,sf,1,2,"ng-template",null,6,h.pd)),2&e){const e=h.ad(12);h.Ub(1),h.Mc("ngIf",!t.mobileFillDetail&&t.mobilePreviewCart),h.Ub(1),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(2),h.Mc("ngIf",t.mobilePreviewCart&&!t.mobileFillDetail),h.Ub(1),h.Mc("addedFund",h.Fc(6,19,t.cartList$))("isUpdate",t.isUpdate)("isLoading",t.isLoading)("selectedFund",t.selectedFund)("show",t.showSellFundFillDetail),h.Ub(2),h.Mc("selectedFund",t.selectedFund)("show",t.showCmfFundFillDetail)("addedFund",h.Fc(8,21,t.cartList$))("isLoading",t.isLoading)("isUpdate",t.isUpdate),h.Ub(2),h.Mc("selectedFund",t.selectedFund)("isVisible",t.showEpfFundFillDetail)("addedFund",h.Fc(10,23,t.cartList$))("isUpdate",t.isUpdate)("isLoading",t.isLoading)}},directives:[z.a,p.t,Vo,ws,Gs,D.a,p.q,p.s,B.a,_.a,ge.a,P.c,be.c,k.b,xt.e,Se.a,W.a],pipes:[p.b,ke.a,p.g],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();var lf=n("SImc");function rf(e,t){if(1&e){const e=h.sc();h.rc(0,"div",1),h.rc(1,"nz-modal",2),h.rc(2,"nz-row",3),h.rc(3,"nz-col",4),h.rc(4,"h3"),h.qd(5," New EPF Guidelines For Money Market Fund "),h.qc(),h.rc(6,"p"),h.qd(7,' Further to the revised Guidelines of the Fund Management Institution issued by Employees Provident Fund ("EPF"), the following items pertaining to Money Market Fund (MMF) take effect from '),h.rc(8,"b"),h.qd(9,"1 January 2022"),h.qc(),h.qd(10,": "),h.qc(),h.rc(11,"ol"),h.rc(12,"li"),h.qd(13,"No initial investment from EPF Account 1 is allowed to invest into any EPF's approved MMF."),h.qc(),h.rc(14,"li"),h.qd(15,"Switching from other EPF's approved non-MMF into EPF's approved MMF is allowed but subject to the following conditions: "),h.rc(16,"ol",5),h.rc(17,"li"),h.qd(18,"The investment holdings must not be retained for more than 6 consecutive months, calculated on first-in-first-out basis."),h.qc(),h.rc(19,"li"),h.qd(20,"Prior to the expiry of time limit mentioned in item 2(a), EPF Member may liquidate the investment and credit back to EPF A
5ccount 1 or switch the investment into non-MMF."),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(21,"p"),h.rc(22,"b"),h.qd(23,"In the event EPF member do not liquidate or switch the MMF into non-MMF(s) within the stipulated time (before the end of 6-months), fund house will fully liquidate the investment and the redemption proceeds will be returned to the member's EPF Account 1."),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(24,"div",6),h.rc(25,"nz-col",4),h.rc(26,"button",7),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseEpfAutoSellMsgModal()})),h.qd(27,"I understand"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("nzVisible",e.showModel)("nzFooter",null)("nzClosable",!1)}}let df=(()=>{class e{constructor(){this.closeModal=new h.s}ngOnInit(){}onCloseEpfAutoSellMsgModal(){this.showModel=!1,this.closeModal.emit(this.targetFund)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["epf-auto-sell-msg-modal"]],inputs:{showModel:"showModel",targetFund:"targetFund"},outputs:{closeModal:"closeModal"},decls:1,vars:1,consts:[["modalContentWrapper","",4,"ngIf"],["modalContentWrapper",""],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzClosable"],[1,"mt-2"],["nzXl","24","nzSm","24","nzXs","24"],[2,"list-style-type","lower-alpha"],["nz-row","",1,"text-base","mt-4"],["nz-button","","nzType","primary",1,"float-right",3,"click"]],template:function(e,t){1&e&&h.od(0,rf,28,3,"div",0),2&e&&h.Mc("ngIf",t.showModel)},directives:[p.t,lf.a,j.a,P.c,P.a,_.a],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function uf(e,t){if(1&e){const e=h.sc();h.rc(0,"i",13),h.zc("click",(function(){return h.dd(e),h.Dc().onClickEdit()})),h.qc()}}function hf(e,t){1&e&&h.mc(0,"i",16)}function pf(e,t){if(1&e&&(h.od(0,hf,1,0,"ng-template",null,14,h.pd),h.mc(2,"nz-spin",15)),2&e){const e=h.ad(1);h.Ub(2),h.Mc("nzIndicator",e)}}let mf=(()=>{class e{constructor(){this.edit=new h.s}ngOnInit(){}onClickEdit(){this.edit.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-trade-switch-order-cart"]],inputs:{switchBuyContent:"switchBuyContent",switchSellContent:"switchSellContent",buyFundName:"buyFundName",sellFundName:"sellFundName",isLoading:"isLoading"},outputs:{edit:"edit"},decls:28,vars:11,consts:[[1,"position-relative","switch-order-cart-container"],[1,"tag-container","d-inline-block","position-absolute","pr-2","py-1"],[1,"tag-text","align-text-top","font-weight-bold","pl-2"],[1,"pt-4"],["nzType","flex",1,"pt-2",3,"nzAlign"],[3,"nzSpan"],[1,"mb-0","font-weight-bold"],["nzType","flex","nzJustify","end"],["class","pointer","nz-icon","","nzTheme","outline","nzType","edit",3,"click",4,"ngIf","ngIfElse"],[1,"my-2"],[1,"mb-2"],[3,"ngTemplateOutlet"],["loadingTemplate",""],["nz-icon","","nzTheme","outline","nzType","edit",1,"pointer",3,"click"],["indicatorTemplate",""],["nzSimple","",3,"nzIndicator"],["nz-icon","","nzType","loading",1,"pointer","text-dark"]],template:function(e,t){if(1&e&&(h.rc(0,"nz-card",0),h.rc(1,"div",1),h.rc(2,"span",2),h.qd(3,"Switch Sell"),h.qc(),h.qc(),h.rc(4,"div",3),h.rc(5,"nz-row",4),h.rc(6,"nz-col",5),h.rc(7,"p",6),h.qd(8),h.qc(),h.qc(),h.rc(9,"nz-col",5),h.rc(10,"nz-row",7),h.od(11,uf,1,0,"i",8),h.qc(),h.qc(),h.qc(),h.qc(),h.mc(12,"nz-divider",9),h.rc(13,"div",10),h.nc(14,11),h.qc(),h.rc(15,"div",1),h.rc(16,"span",2),h.qd(17,"Switch Buy"),h.qc(),h.qc(),h.rc(18,"div",3),h.rc(19,"nz-row",4),h.rc(20,"nz-col",5),h.rc(21,"p",6),h.qd(22),h.qc(),h.qc(),h.qc(),h.qc(),h.mc(23,"nz-divider",9),h.rc(24,"div"),h.nc(25,11),h.qc(),h.qc(),h.od(26,pf,3,1,"ng-template",null,12,h.pd)),2&e){const e=h.ad(27);h.Ub(5),h.Mc("nzAlign","middle"),h.Ub(1),h.Mc("nzSpan",22),h.Ub(2),h.rd(t.sellFundName),h.Ub(1),h.Mc("nzSpan",2),h.Ub(2),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(3),h.Mc("ngTemplateOutlet",t.switchSellContent),h.Ub(5),h.Mc("nzAlign","middle"),h.Ub(1),h.Mc("nzSpan",24),h.Ub(2),h.rd(t.buyFundName),h.Ub(3),h.Mc("ngTemplateOutlet",t.switchBuyContent)}},directives:[I.a,P.c,P.a,p.t,Nu.a,p.A,k.b,Il.a],styles:[".switch-order-cart-container[_ngcontent-%COMP%] .tag-container[_ngcontent-%COMP%]{height:20px;background-color:#3a3a3a;display:inline-block;border-radius:0 10px 10px 0;left:0}.switch-order-cart-container[_ngcontent-%COMP%] .tag-container[_ngcontent-%COMP%] .tag-text[_ngcontent-%COMP%]{color:#fff;font-size:11px}"]}),e})();var ff=n("bMUq");function gf(e,t){if(1&e&&(h.pc(0),h.qd(1),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.rd(e.title)}}function bf(e,t){if(1&e&&(h.pc(0),h.qd(1),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.rd(e.value)}}let Sf=(()=>{class e{constructor(){this.titleSpan=12,this.valueSpan=12}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["switch-order-cart-statistic"]],inputs:{title:"title",value:"value",titleSpan:"titleSpan",valueSpan:"valueSpan"},decls:7,vars:4,consts:[["nz-row","","nzType","flex","nzAlign","middle",1,"py-1"],["nz-col","",1,"text-left",3,"nzSpan"],[1,"mb-0"],[4,"nzStringTemplateOutlet"],["nz-col","",1,"text-right",3,"nzSpan"],[1,"mb-0","font-weight-bold"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.rc(2,"p",2),h.od(3,gf,2,1,"ng-container",3),h.qc(),h.qc(),h.rc(4,"div",4),h.rc(5,"p",5),h.od(6,bf,2,1,"ng-container",3),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(1),h.Mc("nzSpan",t.titleSpan),h.Ub(2),h.Mc("nzStr
5ingTemplateOutlet",t.title),h.Ub(1),h.Mc("nzSpan",t.valueSpan),h.Ub(2),h.Mc("nzStringTemplateOutlet",t.value))},directives:[P.c,P.a,ff.C],styles:[""]}),e})();function yf(e,t){1&e&&h.mc(0,"investment-account-selector")}function vf(e,t){if(1&e&&(h.rc(0,"div",11),h.rc(1,"div",12),h.rc(2,"h5",13),h.qd(3,"You haven\u2019t added anything to your cart yet!"),h.qc(),h.qc(),h.rc(4,"div",14),h.rc(5,"div",15),h.rc(6,"div",16),h.mc(7,"img",17),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(7),h.Mc("src",e.transactionImgPath+"emptyCart.svg",h.gd)}}function Mf(e,t){if(1&e){const e=h.sc();h.rc(0,"app-campaign-code-input-box",24),h.zc("promoCodeApplied",(function(t){return h.dd(e),h.Dc(2).promoApplied(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("refno",e.refno)}}function Cf(e,t){if(1&e&&(h.rc(0,"nz-row"),h.mc(1,"switch-order-cart-statistic",36),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.Mc("value",null==e?null:e.switchSellTransDate)}}function qf(e,t){if(1&e&&(h.qd(0),h.Ec(1,"titlecase")),2&e){const e=h.Dc(2).$implicit;h.sd(" ","EPF"==(null==e?null:e.investmentType)?null==e?null:e.investmentType:h.Fc(1,1,null==e?null:e.investmentType)," ")}}function Tf(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.rd(h.Gc(2,1,e.fundSwitchTransactionModel.switchAmount,e.currencyCode))}}function wf(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.sd("",h.Gc(2,1,e.fundSwitchTransactionModel.switchPercent,"1.2-2"),"%")}}function zf(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.rd(h.Gc(2,1,e.fundSwitchTransactionModel.switchUnit,"1.2-2"))}}function Df(e,t){if(1&e&&(h.od(0,Tf,3,4,"span",2),h.od(1,wf,3,4,"span",37),h.od(2,zf,3,4,"ng-template",null,38,h.pd)),2&e){const e=h.ad(3),t=h.Dc(2).$implicit;h.Mc("ngIf",null==t?null:t.fundSwitchTransactionModel.isAmount),h.Ub(1),h.Mc("ngIf",null==t?null:t.fundSwitchTransactionModel.isPercent)("ngIfElse",e)}}function Pf(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"0.00%"),h.qc())}function If(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.rd(e.redemptionFee)}}function kf(e,t){if(1&e&&(h.od(0,Pf,2,0,"span",37),h.od(1,If,2,1,"ng-template",null,39,h.pd)),2&e){const e=h.ad(2),t=h.Dc(2).$implicit;h.Mc("ngIf","-"===t.redemptionFee)("ngIfElse",e)}}function Af(e,t){if(1&e&&h.mc(0,"i",43),2&e){h.Dc();const e=h.ad(4);h.Mc("nzTooltipTitle",e)}}function Ef(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1,"Subject to Redemption Fee"),h.qc(),h.rc(2,"span",19),h.qd(3),h.Ec(4,"number"),h.qc(),h.mc(5,"br"),h.mc(6,"br"),h.rc(7,"span"),h.qd(8,"Not Subject to Redemption Fee"),h.qc(),h.rc(9,"span",19),h.qd(10),h.Ec(11,"number"),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Ub(3),h.sd(" ",h.Gc(4,2,e.unitRedemptionFee,"1.2-2")," units"),h.Ub(7),h.sd(" ",h.Gc(11,5,e.unitNonRedemptionFee,"1.2-2")," units")}}function Ff(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1,"Redemption Fee "),h.od(2,Af,1,1,"i",40),h.qc(),h.od(3,Ef,12,8,"ng-template",41,42,h.pd)),2&e){const e=h.Dc(2).$implicit;h.Ub(2),h.Mc("ngIf","-"!==e.redemptionFee&&"0.0%"!==e.redemptionFee)}}function Of(e,t){if(1&e&&(h.od(0,Cf,2,1,"nz-row",2),h.rc(1,"nz-row"),h.mc(2,"switch-order-cart-statistic",29),h.od(3,qf,2,3,"ng-template",null,30,h.pd),h.qc(),h.rc(5,"nz-row"),h.mc(6,"switch-order-cart-statistic",31),h.od(7,Df,4,3,"ng-template",null,32,h.pd),h.qc(),h.rc(9,"nz-row",33),h.mc(10,"switch-order-cart-statistic",31),h.od(11,kf,3,2,"ng-template",null,34,h.pd),h.od(13,Ff,5,1,"ng-template",null,35,h.pd),h.qc()),2&e){const e=h.ad(4),t=h.ad(8),n=h.ad(12),i=h.ad(14),c=h.Dc().$implicit;h.Mc("ngIf",c.switchSellTransDate&&"-"!==c.switchSellTransDate),h.Ub(2),h.Mc("value",e),h.Ub(4),h.Mc("title",null!=c&&c.fundSwitchTransactionModel.isAmount?"Amounts":null!=c&&null!=c.fundSwitchTransactionModel&&c.fundSwitchTransactionModel.isPercent?"Percent":"Units")("value",t),h.Ub(4),h.Mc("title",i)("value",n)}}function Uf(e,t){if(1&e&&(h.rc(0,"nz-row"),h.mc(1,"switch-order-cart-statistic",36),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.Mc("value",null==e?null:e.switchBuyTransDate)}}function xf(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"currencyFormat"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.rd(h.Gc(2,1,e.indicativeAmount,e.currencyCode))}}function Lf(e,t){if(1&e&&h.mc(0,"i",43),2&e){h.Dc();const e=h.ad(4);h.Mc("nzTooltipTitle",e)}}function Rf(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"8% SST, applicable to the Switch Buy Sales Charge"),h.qc())}function Nf(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1," Switching Fee "),h.od(2,Lf,1,1,"i",40),h.qc(),h.od(3,Rf,2,0,"ng-template",41,42,h.pd)),2&e){const e=h.Dc(4);h.Ub(2),h.Mc("ngIf",e.systemSstRate>0)}}function Bf(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"0.00%"),h.qc())}function _f(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.rd(e.promoSalesCharge?e.promoSalesCharge:e.switchSalesCharge)}}function Vf(e,t){1&e&&(h.rc(0,"span"),h.qd(1," (Waived By Credit)"),h.qc())}function Hf(e,t){if(1&e&&(h.od(0,Bf,2,0,"span",2),h.od(1,_f,2,1,"span",2),h.od(2,Vf,2,0,"span",2)),2&e){const e=h.Dc(2).$implicit;
5h.Mc("ngIf","-"==e.switchSalesCharge||e.isWaived),h.Ub(1),h.Mc("ngIf","-"!==e.switchSalesCharge&&!e.isWaived),h.Ub(1),h.Mc("ngIf",e.isWaived)}}function $f(e,t){if(1&e&&(h.od(0,Uf,2,1,"nz-row",2),h.rc(1,"nz-row"),h.mc(2,"switch-order-cart-statistic",44),h.od(3,xf,3,4,"ng-template",null,45,h.pd),h.qc(),h.rc(5,"nz-row"),h.mc(6,"switch-order-cart-statistic",46),h.od(7,Nf,5,1,"ng-template",null,47,h.pd),h.od(9,Hf,3,3,"ng-template",null,48,h.pd),h.qc()),2&e){const e=h.ad(4),t=h.ad(8),n=h.ad(10),i=h.Dc().$implicit;h.Mc("ngIf",i.switchSellTransDate&&"-"!==i.switchSellTransDate),h.Ub(2),h.Mc("value",e),h.Ub(4),h.Mc("value",n)("titleSpan",8)("valueSpan",16)("title",t)}}function jf(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",25),h.rc(2,"app-trade-switch-order-cart",26),h.zc("edit",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onClickEdit(n)})),h.od(3,Of,15,6,"ng-template",null,27,h.pd),h.od(5,$f,11,6,"ng-template",null,28,h.pd),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(4),i=h.ad(6);h.Ub(2),h.Mc("buyFundName",null==e?null:e.switchBuyFundName)("sellFundName",null==e?null:e.switchSellFundName)("switchBuyContent",i)("switchSellContent",n)}}const Gf=function(e,t){return{"bg-white px-2 py-3 mt-4":e,"d-none":t}};function Wf(e,t){if(1&e){const e=h.sc();h.rc(0,"div",18),h.Ec(1,"async"),h.Ec(2,"async"),h.rc(3,"h4",19),h.qd(4,"Order Cart Details"),h.qc(),h.rc(5,"app-mobile-scaffold"),h.od(6,Mf,1,1,"app-campaign-code-input-box",20),h.Ec(7,"async"),h.qc(),h.od(8,jf,7,4,"div",21),h.Ec(9,"async"),h.rc(10,"app-web-scaffold"),h.rc(11,"div",22),h.rc(12,"button",23),h.zc("click",(function(){return h.dd(e),h.Dc().proceedCheckOut()})),h.qd(13," Proceed To Check Out "),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Tc(11,Gf,h.Fc(1,3,e.isMobile$),h.Fc(2,5,e.isMobile$)&&e.hideCart)),h.Ub(6),h.Mc("ngIf",h.Fc(7,7,e.isMobile$)&&e.mobilePreviewCart&&e.includeInterOrder),h.Ub(2),h.Mc("ngForOf",h.Fc(9,9,e.cartList$))}}function Yf(e,t){if(1&e){const e=h.sc();h.rc(0,"button",49),h.zc("click",(function(){return h.dd(e),h.Dc().proceedCheckOut()})),h.qd(1," Proceed To Check Out "),h.qc()}}function Kf(e,t){if(1&e){const e=h.sc();h.rc(0,"switch-prs-fund-fill-detail",50),h.zc("closed",(function(){return h.dd(e),h.Dc().onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc().onSelectedFundForSwitchBuy(t)})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc();h.Mc("fundSwitchList",e.fundSwitchList)("addedFund",h.Fc(1,10,e.cartList$))("isInterSwitch",e.isInterSwitch)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("isUpdate",!0)("isVisible",e.showPrsFundFillDetail)("selectedFund",e.selectedFund)("switchingCalculatorModel",e.switchingCalculatorModel)("duplicateRecord",e.duplicateRecord)}}function Xf(e,t){if(1&e){const e=h.sc();h.rc(0,"switch-cmf-fund-fill-detail",51),h.zc("closed",(function(){return h.dd(e),h.Dc().onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(t){return h.dd(e),h.Dc().onSelectedFundForSwitchBuy(t)})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc();h.Mc("addedFund",h.Fc(1,9,e.cartList$))("fundSwitchList",e.fundSwitchList)("isInterSwitch",e.isInterSwitch)("isLoadingFundFill",e.isLoadingFundFill)("isLoadingSalesCharge",e.isLoadingSalesCharge)("isUpdate",!0)("selectedFund",e.selectedFund)("show",e.showCmfFundFillDetail)("switchingCalculatorModel",e.switchingCalculatorModel)}}let Qf=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.router=t,this.subHandlingService=n,this.transactionService=i,this.cdRef=c,this.transactionRestService=o,this.utilityRestService=s,this.mobileBack=new h.s,this.promoCodeApplied=new h.s,this.isUpdate=!1,this.showSwitchFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.showPrsFundFillDetail=!1,this.isLoadingFundFill=!1,this.isLoadingSalesCharge=!1,this.isInterSwitch=!1,this.hideCart=!1,this.showEpfAutoSellMsgModal=!1,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.systemSstRate=0}ngOnInit(){this.subscribeRefnoChange(),this.getSystemSstRate()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}removeOrderPlacedFund(){this.subHandlingService.once(this.cartList$.pipe(Object(y.a)(e=>{if(this.cartList=Object(g.a)(e),(null==e?void 0:e.length)>0)for(let t of e)this.getFundSwitchList(),t.orderStatus===U.a.ORDER_PLACED&&this.transactionService.removeSwitchOrderPlacedFund(this.refno)})))}proceedCheckOut(){this.showProceedModal=!0,this.router.navigate([Object(v.a)(M.o.APP,M.o.TRADE,M.o.CHECK_OUT)],{queryParams:{refno:this.refno}})}onClickEdit(e){var t,n;const i=this.store.selectSnapshot(a.a.isMobile);if(this.duplicateRecord=(null===(t=this.fundList)||void 0===t?void 0:t.filter(e=>
5e.productCode==e.productCode).length)>1,this.fundList){for(let t of this.fundList)e.sedolNumber===t.productCode&&e.fundSwitchTransactionModel.paymentMethod===t.paymentMethod&&(this.selectedFund=t,this.isUpdate=!0);if(this.sellInfoModel=this.mapSellInfoModel(this.selectedFund),this.fundBuySedolNumber=e.fundSwitchTransactionModel.switchBuySedolnumber,this.getFundSwitchList(),i&&(this.hideCart=!0),this.selectedFund.reloadSwitchBuy=!1,(null===(n=this.selectedFund)||void 0===n?void 0:n.targetSwitchBuy)&&(this.selectedFund.targetSwitchBuy=""),e.cashFund)return void(this.showCmfFundFillDetail=!0);if(this.selectedFund.prs)return void(this.showPrsFundFillDetail=!0);this.showSwitchFundFillDetail=!0}}getHoldingList(){this.subHandlingService.once(this.transactionRestService.getSellHoldingList(this.refno).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fundList=e.data.sort((e,t)=>e.productName>t.productName?1:t.productName>e.productName?-1:0))},e=>console.log(e))))}onAppBarBack(){this.mobileBack.emit()}onFundFillDetailClosed(){this.isUpdate=!1,this.hideCart=!1,this.showSwitchFundFillDetail=!1,this.showCmfFundFillDetail=!1,this.showPrsFundFillDetail=!1}mapSellInfoModel(e){return{sedolNumber:e.productCode,redemptionMethod:null,currency:e.fundCurrencyCode,redemptionUnits:null,redemptionAmount:null,isRedeemByAmount:null,ifastStatus:e.ifastStatus,paymentMethod:e.paymentMethod,agentId:null,createdBy:null,emisOrder:null}}getSwitchSalesCharge(){this.isLoadingSalesCharge=!0,this.subHandlingService.once(this.transactionRestService.getSwitchSalesCharge(this.refno,this.fundSwitchTransactionModel).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.switchingCalculatorModel=e.data,this.isLoadingSalesCharge=!1)},e=>console.log(e))))}mapSwitchModel(e){var t,n,i;return{ifastStatus:null===(t=this.selectedFund)||void 0===t?void 0:t.ifastStatus,interOrder:e.interList,intraOrder:e.intraList,paymentMethod:null===(n=this.selectedFund)||void 0===n?void 0:n.paymentMethod,refno:this.refno,switchBuySedolnumber:null==e?void 0:e.sedolnumber,switchSellSedolnumber:null===(i=this.selectedFund)||void 0===i?void 0:i.productCode,switchUnit:0}}onSelectedSwitchBuyFund(e){this.fundSwitchTransactionModel=this.mapSwitchModel(e),this.isInterSwitch=e.interList,this.getSwitchSalesCharge()}onSelectedFundForSwitchBuy(e){let t=this.fundSwitchList.find(t=>t.sedolnumber===e);this.onSelectedSwitchBuyFund(t)}getFundSwitchList(){this.fundSwitchList=[],this.isLoadingFundFill=!0,this.subHandlingService.once(this.transactionRestService.getSwitchBuyListingList(this.refno,this.sellInfoModel).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fundSwitchList=e.data,this.fundSwitchList.forEach(e=>{if(this.fundSwitchList.filter(t=>t.sedolnumber===e.sedolnumber).length>1){let t=this.fundSwitchList.filter(t=>t.sedolnumber===e.sedolnumber);this.fundSwitchList=this.fundSwitchList.filter(t=>t.sedolnumber!==e.sedolnumber),this.fundSwitchList.push(t.find(e=>!0===e.interList))}}),this.fundSwitchList=this.fundSwitchList.sort((e,t)=>e.fundName>t.fundName?1:t.fundName>e.fundName?-1:0),this.onSelectedFundForSwitchBuy(this.fundBuySedolNumber),this.isLoadingFundFill=!1)},e=>console.log(e))))}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.refno=e,this.cdRef.markForCheck(),this.cartList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>
5e(this.refno))),this.subscribeCart(),this.getHoldingList()})))}promoApplied(e){this.promoCodeApplied.emit(e)}subscribeCart(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.includeInterOrder=!1;for(let t of e)!0===t.fundSwitchTransactionModel.interOrder&&(this.includeInterOrder=!0),this.getFundSwitchList(),t.orderStatus===U.a.ORDER_PLACED&&this.transactionService.removeSwitchOrderPlacedFund(this.refno)})))}showEpfAutoSellMsgPopup(e){this.showSwitchFundFillDetail=!1,this.showEpfAutoSellSedol=e,this.showEpfAutoSellMsgModal=!0}closeEpfAutoSellMsgModal(e){this.showEpfAutoSellMsgModal=!1,this.showSwitchFundFillDetail=!0,this.selectedFund.targetSwitchBuy=e,this.selectedFund.reloadSwitchBuy=!0}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(C.a),h.lc(h.j),h.lc(T.a),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["switch-order-cart-sider"]],inputs:{mobilePreviewCart:"mobilePreviewCart"},outputs:{mobileBack:"mobileBack",promoCodeApplied:"promoCodeApplied"},features:[h.Tb([l.a])],decls:19,vars:28,consts:[[1,"border-bottom"],[3,"title","back"],[4,"ngIf"],[1,"h-100"],["class","text-center mt-5 pt-5",4,"ngIf"],[3,"ngClass",4,"ngIf"],["class","font-weight-bold","nz-button","","nzBlock","","nzType","primary",3,"click",4,"ngIf"],[3,"addedFund","fundSwitchList","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","isUpdate","selectedFund","show","switchingCalculatorModel","closed","selectedFundForSwitchBuyChange","showAutoSellPopup"],[3,"fundSwitchList","addedFund","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","isUpdate","isVisible","selectedFund","switchingCalculatorModel","duplicateRecord","closed","selectedFundForSwitchBuyChange",4,"ngIf"],[3,"addedFund","fundSwitchList","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","isUpdate","selectedFund","show","switchingCalculatorModel","closed","selectedFundForSwitchBuyChange",4,"ngIf"],[3,"showModel","targetFund","closeModal"],[1,"text-center","mt-5","pt-5"],[1,"mx-5"],[1,"text-black-5"],[1,"text-center","mt-3","pt-3"],[1,"mt-3","pt-3"],[1,"mt-3"],[1,"img-fluid",3,"src"],[3,"ngClass"],[1,"font-weight-bold"],[3,"refno","promoCodeApplied",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"mb-2"],["nz-button","","nzSize","default","nzType","primary",1,"font-weight-bold","w-100",3,"click"],[3,"refno","promoCodeApplied"],[1,"mb-4"],[3,"buyFundName","sellFundName","switchBuyContent","switchSellContent","edit"],["switchSell",""],["switchBuy",""],["title","Type",3,"value"],["investmentTypeTemplate",""],[3,"title","value"],["unitTemplate",""],[1,"pb-2"],["redemptionFeeTemplate",""],["redemptionFeeTitle",""],["title","Transaction Date",3,"value"],[4,"ngIf","ngIfElse"],["elseBlock",""],["showActualRedemptionFee",""],["class","text-accent-1 pointer","nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",3,"nzTooltipTitle",4,"ngIf"],["class","text-sm"],["tooltip",""],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",1,"text-accent-1","pointer",3,"nzTooltipTitle"],["title","Indicative Amt",3,"value"],["indicativeAmountTemplate",""],[3,"value","titleSpan","valueSpan","title"],["salesChargeTitle",""],["salesChargeTemplate",""],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"click"],[3,"fundSwitchList","addedFund","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","isUpdate","isVisible","selectedFund","switchingCalculatorModel","duplicateRecord","closed","selectedFundForSwitchBuyChange"],[3,"addedFund","fundSwitchList","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","isUpdate","selectedFund","show","switchingCalculatorModel","closed","selectedFundForSwitchBuyChange"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.rc(1,"div",0),h.rc(2,"b2c-app-bar-2",1),h.zc("back",(function(){return t.onAppBarBack()})),h.qc(),h.qc(),h.od(3,yf,1,0,"investment-account-selector",2),h.Ec(4,"async"),h.qc(),h.rc(5,"div",3),h.od(6,vf,8,1,"div",4),h.Ec(7,"async"),h.Ec(8,"async"),h.od(9,Wf,14,14,"div",5),h.Ec(10,"async"),h.qc(),h.rc(11,"app-mobile-scaffold"),h.rc(12,"b2c-floating-bar"),h.od(13,Yf,2,0,"button",6),h.qc(),h.qc(),h.rc(14,"switch-fund-fill-detail",7),h.zc("closed",(function(){return t.onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(e){return t.onSelectedFundForSwitchBuy(e)}))("showAutoSellPopup",(function(e){return t.showEpfAutoSellMsgPopup(e)})),h.Ec(15,"async"),h.qc(),h.od(16,Kf,2,12,"switch-prs-fund-fill-detail",8),h.od(17,Xf,2,11,"switch-cmf-fund-fill-detail",9),h.rc(18,"epf-auto-sell-msg-modal",10),h.zc("closeModal",(function(e){return t.closeEpfAutoSellMsgModal(e)})),h.qc()),2&e){var n=null;const e=0===(null==(n=h.Fc(7,20,t.cartList$))?null:n.length)||null===(null==(n=h.Fc(8,22,t.cartList$))?null:n.length);var i;const c=(null==(i=h.Fc(10,24,t.cartList$))?null:i.length)>0;h.Ub(2),h.Mc("title","Order Cart"),h.Ub(1),h.Mc("ngIf",h.Fc(4,18,t.isMobile$)),h.Ub(3),h.Mc("ngIf",e),h.Ub(3),h.Mc("ngIf",c),h.Ub(4),h.Mc("ngIf",t.mobilePreviewCart),h.Ub(1),h.Mc("addedFund",h.Fc(15,26,t.cartList$))("fundSwitchList",t.fundSwitchList)("isInterSwitch",t.isInterSwitch)("isLoadingFundFill",t.isLoadingFundFill)("isLoadingSalesCharge",t.isLoadingSalesCharge)("isUpdate",!0)("selectedFund",t.selectedFund)("show",t.showSwitchFundFillDetail)("switchingCalculatorModel",t.switchingCalculatorModel),h.Ub(2),h.Mc("ngIf",t.selectedFund&&t.fundList),h.Ub(1),h.Mc("ngIf",t.selectedFund&&t.fundList),h.Ub(1),h.Mc("showModel",t.showEpfAutoSellMsgModal)("targetFund",t.showEpfAutoSellSedol)}},directives:[z.a,D.a,p.t,Se.a,Pl,df,ut.a,p.q,p.s,B.a,_.a,fe,mf,P.c,Sf,k.b,xt.e,Br,fr],pipes:[p.b,p.G,ke.a,p.g],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function Zf(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",5),h.rc(2,"b2c-app-bar-2",6),h.zc("back",(function(){return h.dd(e),h.Dc().onAppBarBack()})),h.qc(),h.qc(),h.mc(3,"investment-account-selector"),h.oc()}2&e&&(h.Ub(2),h.Mc("title","Order Cart"))}function Jf(e,t){if(1&e&&(h.rc(0,"div",7),h.rc(1,"div",8),h.rc(2,"h5",9),h.qd(3,"You haven\u2019t added anything to your cart yet!"),h.qc(),h.qc(),h.rc(4,"div",10),h.rc(5,"div",11),h.rc(6,"div",12),h.mc(7,"img",13),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(7),h.Mc("src",e.transactionImgPath+"emptyCart.svg",h.gd)("alt","empty cart")}}function eg(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,null==e||null==e.dpmsBuyModel?null:e.dpmsBuyModel.amount,null==e||null==e.dpmsBuyModel?null:e.dpmsBuyModel.currency)," ")}}function tg(e,t){if(1&e&&(h.qd(0),h.Ec(1,"number")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.dpmsBuyModel.salesCharge,"1.2-2"),"% ")}}const ng=function(e){return{"mb-2":e}};function ig(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",19),h.Ec(2,"async"),h.rc(3,"b2c-order-cart",20),h.zc("editOrder",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(2).onClickEdit(n)})),h.rc(4,"nz-row"),h.mc(5,"b2b-statistic",21),h.od(6,eg,2,4,"ng-template",null,22,h.pd),h.qc(),h.rc(8,"nz-row"),h.mc(9,"b2b-statistic",23),h.od(10,tg,2,4,"ng-template",null,24,h.pd),h.qc(),h.rc(12,"nz-row"),h.mc(13,"b2b-statistic",25),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,i=t.index,c=h.ad(7),o=h.ad(11),s=h.Dc(2);var n;const a=h.Sc(11,ng,i!==(null==(n=h.Fc(2,9,s.cartList$))?null:n.length)-1);h.Ub(1),h.Mc("ngClass",a),h.Ub(2),h.Mc("isEditOrder",!0)("isShowContent",!0)("paymentTitle",null==e||null==e.dpmsBuyModel?null:e.dpmsBuyModel.dpmsPortfolioName)("orderCartType",s.orderCartConstant.PENDING),h.Ub(2),h.Mc("value",c),h.Ub(4),h.Mc("value",o)("tooltip",s.systemSstRate>0?"8% SST, applicable to the Subscription Fee":null),h.Ub(4),h.Mc("value",null==e?null:e.cartPaymentMethodDisplay)}}const cg=function(e){return{"py-3 bg-white shadow mt-3":e}},og=function(e){return{"px-2":e}};function sg(e,t){if(1&e){const e=h.sc();h.rc(0,"div",14),h.Ec(1,"async"),h.rc(2,"div",14),h.Ec(3,"async"),h.rc(4,"p",15),h.qd(5," Order Cart Details"),h.qc(),h.od(6,ig,14,13,"div",16),h.Ec(7,"async"),h.rc(8,"app-web-scaffold"),h.rc(9,"div",17),h.rc(10,"button",18),h.zc("click",(function(){return h.dd(e),h.Dc().proceedCheckOut()})),h.qd(11," Proceed To Check Out "),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngClass",h.Sc(9,cg,h.Fc(1,3,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(11,og,h.Fc(3,5,e.isMobile$))),h.Ub(4),h.Mc("ngForOf",h.Fc(7,7,e.cartList$))}}function ag(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"button",26),h.zc("click",(function(){return h.dd(e),h.Dc().proceedCheckOut()})),h.qd(2," Proceed To Check Out "),h.qc(),h.qc()}}let lg=(()=>{class e{constructor(e,t,n,i,c,o){this.subHandlingService=e,this.cdRef=t,this.transactionDpmsRestService=n,this.store=i,this.router=c,this.utilityRestService=o,this.appBarBack=new h.s,this.orderCartConstant=O.a,this.systemSstRate=0}ngOnInit(){this.subscribeRefnoChange(),this.getSystemSstRate()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}proceedCheckOut(){this.router.navigate([M.o.APP,M.o.TRADE,M.o.CHECK_OUT])}onDpmsFillDetailClosed(){this.showDpmsFillDetail=!1,this.mobileFillDetail=!1}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.refno=e,this.cdRef.markForCheck(),this.cartList$=this.store.select(u.k.getCartList).pipe(Object(S.a)(e=>e(this.refno)))})))}onClickEdit(e){var t,n;this.selectedDpmsPortfolioId=null===(t=null==e?void 0:e.dpmsBuyModel)||void 0===t?void 0:t.dpmsPortfolioId,this.store.selectSnapshot(a.a.isMobile)&&(this.mobileFillDetail=!0),this.selectedDpmsName=null===(n=null==e?void 0:e.dpmsBuyModel)||void 0===n?void 0:n.dpmsPortfolioName,this.showDpmsFillDetail=!0,this.getDpmsPortfolioDetails(this.selectedDpmsPortfolioId)}getDpmsPortfolioDetails(e){this.isLoadingFillDetail=!0,this.subHandlingService.once(this.transactionDpmsRestService.getDpmsBuyDetails(e,this.refno).pipe(Object(y.a)(e=>{this.isLoadingFillDetail=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.selectedDpmsDetail=e.data)})))}get transactionImgPath(){return M.g.TRANSACTION_IMG_PATH}onAppBarBack(){this.appBarBack.emit()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(h.j),h.lc(Hr.a),h.lc(s.i),h.lc(c.e),h.lc(w.a))},e.\u0275cmp=h.fc({type:e,selectors:[["dpms-buy-order-cart-sider"]],outputs:{appBarBack:"appBarBack"},features:[h.Tb([l.a])],decls:14,vars:23,consts:[[4,"ngIf"],[1,"h-100"],["class","text-center mt-5 pt-5",4,"ngIf"],[3,"ngClass",4,"ngIf"],[3,"addedDpms","selectedDpmsName","selectedDpmsDetail","show","refno","isLoading","isUpdate","closed"],[1,"border-bottom"],[3,"title","back"],[1,"text-center","mt-5","pt-5"],[1,"mx-5"],[1,"text-black-5"],[1,"text-center","mt-3","pt-3"],[1,"mt-3","pt-3"],[1,"mt-3"],[1,"img-fluid",3,"src","alt"],[3,"ngClass"],[1,"font-weight-bold"],[4,"ngFor","ngForOf"],[1,"mb-2","mt-3"],["nz-button","","nzSize","default","nzType","primary",1,"font-weight-bold","w-100",3,"click"],[1,"mb-2",3,"ngClass"],[3,"isEditOrder","isShowContent","paymentTitle","orderCartType","editOrder"],["title","Amt.","horizontal","true",3,"value"],["investmentAmountTemplate",""],["t
5itle","Subscription Fee","horizontal","true",3,"value","tooltip"],["salesChargeTemplate",""],["title","Payment Method","horizontal","true",3,"value"],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"click"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,Zf,4,1,"ng-container",0),h.Ec(2,"async"),h.qc(),h.rc(3,"div",1),h.od(4,Jf,8,2,"div",2),h.Ec(5,"async"),h.Ec(6,"async"),h.od(7,sg,12,13,"div",3),h.Ec(8,"async"),h.qc(),h.rc(9,"app-mobile-scaffold"),h.od(10,ag,3,0,"b2c-floating-bar",0),h.Ec(11,"async"),h.qc(),h.rc(12,"dpms-buy-fill-detail",4),h.zc("closed",(function(){return t.onDpmsFillDetailClosed()})),h.Ec(13,"async"),h.qc()),2&e){var n=null;const e=0===(null==(n=h.Fc(5,13,t.cartList$))?null:n.length)||null===(null==(n=h.Fc(6,15,t.cartList$))?null:n.length);var i;const o=(null==(i=h.Fc(8,17,t.cartList$))?null:i.length)>0&&!t.mobileFillDetail;var c=null;const s=!t.mobileFillDetail&&(null==(c=h.Fc(11,19,t.cartList$))?null:c.length)>0;h.Ub(1),h.Mc("ngIf",h.Fc(2,11,t.isMobile$)&&!t.mobileFillDetail),h.Ub(3),h.Mc("ngIf",e),h.Ub(3),h.Mc("ngIf",o),h.Ub(3),h.Mc("ngIf",s),h.Ub(2),h.Mc("addedDpms",h.Fc(13,21,t.cartList$))("selectedDpmsName",t.selectedDpmsName)("selectedDpmsDetail",t.selectedDpmsDetail)("show",t.showDpmsFillDetail)("refno",t.refno)("isLoading",t.isLoadingFillDetail)("isUpdate",!0)}},directives:[z.a,p.t,Ld,D.a,ut.a,p.q,p.s,B.a,_.a,ge.a,P.c,be.c,Se.a],pipes:[p.b,ke.a,p.g],styles:[""]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function rg(e,t){if(1&e){const e=h.sc();h.rc(0,"div",7),h.rc(1,"b2c-app-bar-2",8),h.zc("back",(function(){return h.dd(e),h.Dc().onAppBarBack()})),h.qc(),h.qc()}2&e&&(h.Ub(1),h.Mc("title","Order Cart"))}function dg(e,t){1&e&&h.mc(0,"investment-account-selector")}function ug(e,t){if(1&e&&(h.rc(0,"div",9),h.rc(1,"div",10),h.rc(2,"h5",11),h.qd(3,"You haven\u2019t added anything to your cart yet!"),h.qc(),h.qc(),h.rc(4,"div",12),h.rc(5,"div",13),h.rc(6,"div",14),h.mc(7,"img",15),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(7),h.Mc("src",e.transactionImgPath+"emptyCart.svg",h.gd)("alt","empty cart")}}function hg(e,t){if(1&e&&(h.qd(0),h.Ec(1,"currencyFormat")),2&e){const e=h.Dc().$implicit;h.sd(" ",h.Gc(1,1,e.indicativeRedemptionAmount,e.dpmsSellModel.currency)," ")}}function pg(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",22),h.rc(2,"b2c-order-cart",23),h.zc("editOrder",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).onClickEdit(n)})),h.rc(3,"nz-row",24),h.rc(4,"nz-col",25),h.Ec(5,"async"),h.qd(6," Redemption Percentage "),h.qc(),h.rc(7,"nz-col",26),h.Ec(8,"async"),h.qd(9),h.qc(),h.qc(),h.rc(10,"nz-row"),h.mc(11,"b2b-statistic",27),h.od(12,hg,2,4,"ng-template",null,28,h.pd),h.qc(),h.rc(14,"nz-row"),h.mc(15,"b2b-statistic",29),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(13),i=h.Dc(3);h.Ub(2),h.Mc("isEditOrder",!0)("isShowContent",!0)("paymentTitle",null==e?null:e.dpmsPortfolioName)("orderCartType",i.orderCartConstant.PENDING),h.Ub(2),h.Mc("ngClass",h.Fc(5,9,i.isMobile$)?"text-base":"text-sm"),h.Ub(3),h.Mc("ngClass",h.Fc(8,11,i.isMobile$)?"text-base":"text-sm"),h.Ub(2),h.sd(" ",null==e||null==e.dpmsSellModel?null:e.dpmsSellModel.redemptionPercentage,"% "),h.Ub(2),h.Mc("value",n),h.Ub(4),h.Mc("value",null==e?null:e.cartRedemptionMethodDisplay)}}const mg=function(e){return{"px-2":e}};function fg(e,t){if(1&e){const e=h.sc();h.rc(0,"div",16),h.Ec(1,"async"),h.rc(2,"p",18),h.qd(3," Order Cart Details"),h.qc(),h.od(4,pg,16,13,"div",19),h.Ec(5,"async"),h.rc(6,"app-web-scaffold"),h.rc(7,"div",20),h.rc(8,"button",21),h.zc("click",(function(){return h.dd(e),h.Dc(2).proceedCheckOut()})),h.qd(9," Proceed To Check Out "),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("ngClass",h.Sc(6,mg,h.Fc(1,2,e.isMobile$))),h.Ub(4),h.Mc("ngForOf",h.Fc(5,4,e.cartList$))}}const gg=function(e,t){return{"py-3 bg-white shadow mt-3 mb-6":e,"d-none":t}};function bg(e,t){if(1&e&&(h.rc(0,"div",16),h.Ec(1,"async"),h.Ec(2,"async"),h.od(3,fg,10,8,"div",17),h.qc()),2&e){const e=h.Dc(),t=h.ad(16);h.Mc("ngClass",h.Tc(7,gg,h.Fc(1,3,e.isMobile$),h.Fc(2,5,e.isMobile$)&&e.hideCart)),h.Ub(3),h.Mc("ngIf",!e.isLoading)("ngIfElse",t)}}function Sg(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"b2c-floating-bar"),h.rc(2,"button",30),h.zc("click",(function(){return h.dd(e),h.Dc().proceedCheckOut()})),h.qd(3," Proceed To Check Out "),h.qc(),h.qc(),h.oc()}}function yg(e,t){if(1&e&&(h.rc(0,"nz-spin",31),h.mc(1,"nz-skeleton",32),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzActive",!0)("nzLoading",e.isLoading)}}let vg=(()=>{class e{constructor(e,t,n,i,c,o){this.subHandlingService=e,this.cdRef=t,this.transactionDpmsRestService=n,this.router=i,this.transactionService=c,this.store=o,this.mobileBack=new h.s,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.orderCartConstant=O.a,this.dpmsHoldingList=[],this.selectedDpms={}}ngOnInit(){this.subscribeRefnoChange(),this.removeOrderPlacedFund()}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.refno=e,this.cdRef.markForCheck(),this.getDpmsHoldingList(
5),this.cartList$=this.store.select(u.H.getCartList).pipe(Object(S.a)(e=>e(this.refno)))})))}removeOrderPlacedFund(){this.subHandlingService.once(this.cartList$.pipe(Object(y.a)(e=>{if((null==e?void 0:e.length)>0)for(let t of e)t.orderStatus===U.a.ORDER_PLACED&&this.transactionService.removeSellDpmsOrderPlaced()})))}getDpmsHoldingList(){this.isLoading=!0,this.subHandlingService.once(this.transactionDpmsRestService.getDpmsHoldingList(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.holdingDisplayModel=e.data,this.dpmsHoldingList=this.holdingDisplayModel.map(e=>Object.assign(Object.assign({},e),{productName:e.productName.replace("FSM","").trim()})))})))}onClickEdit(e){var t;this.showDpmsFillDetail=!0,this.isMobile$&&(this.hideCart=!0),this.selectedDpmsPortfolioId=null===(t=null==e?void 0:e.dpmsSellModel)||void 0===t?void 0:t.dpmsPortfolioId,this.selectedDpms=this.dpmsHoldingList.find(e=>e.productCode===this.selectedDpmsPortfolioId)}proceedCheckOut(){this.router.navigate([M.o.APP,M.o.TRADE,M.o.CHECK_OUT])}onDpmsFillDetailClosed(){this.showDpmsFillDetail=!1,this.hideCart=!1}onAppBarBack(){this.mobileBack.emit()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(h.j),h.lc(Hr.a),h.lc(c.e),h.lc(C.a),h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["dpms-sell-order-cart-sider"]],inputs:{mobilePreviewCart:"mobilePreviewCart"},outputs:{mobileBack:"mobileBack"},features:[h.Tb([l.a])],decls:17,vars:21,consts:[["class","border-bottom",4,"ngIf"],[4,"ngIf"],[1,"h-100"],["class","text-center mt-5 pt-5",4,"ngIf"],[3,"ngClass",4,"ngIf"],[3,"selectedDpms","isUpdate","show","addedDpms","closed","appBarBack"],["loadingTemplate",""],[1,"border-bottom"],[3,"title","back"],[1,"text-center","mt-5","pt-5"],[1,"mx-5"],[1,"text-black-5"],[1,"text-center","mt-3","pt-3"],[1,"mt-3","pt-3"],[1,"mt-3"],[1,"img-fluid",3,"src","alt"],[3,"ngClass"],[3,"ngClass",4,"ngIf","ngIfElse"],[1,"font-weight-bold"],[4,"ngFor","ngForOf"],[1,"mb-2","mt-3"],["nz-button","","nzSize","default","nzType","primary",1,"font-weight-bold","w-100",3,"click"],[1,"mb-3"],[3,"isEditOrder","isShowContent","paymentTitle","orderCartType","editOrder"],["nzType","flex","nzAlign","middle",1,"pb-2"],["nzSpan","12",3,"ngClass"],["nzSpan","12",1,"pl-2","font-weight-bold",3,"ngClass"],["title","Indicative Amt.","horizontal","true",3,"value"],["indicativeAmtTemplate",""],["title","Method","horizontal","true",3,"value"],["nz-button","","nzBlock","","nzType","primary",1,"font-weight-bold",3,"click"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzActive","nzLoading"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,rg,2,1,"div",0),h.od(2,dg,1,0,"investment-account-selector",1),h.Ec(3,"async"),h.qc(),h.rc(4,"div",2),h.od(5,ug,8,2,"div",3),h.Ec(6,"async"),h.Ec(7,"async"),h.od(8,bg,4,10,"div",4),h.Ec(9,"async"),h.qc(),h.rc(10,"app-mobile-scaffold"),h.od(11,Sg,4,0,"ng-container",1),h.Ec(12,"async"),h.qc(),h.rc(13,"app-dpms-sell-fill-detail",5),h.zc("closed",(function(){return t.onDpmsFillDetailClosed()}))("appBarBack",(function(){return t.onDpmsFillDetailClosed()})),h.Ec(14,"async"),h.qc(),h.od(15,yg,2,3,"ng-template",null,6,h.pd)),2&e){var n=null;const e=0===(null==(n=h.Fc(6,11,t.cartList$))?null:n.length)||null===(null==(n=h.Fc(7,13,t.cartList$))?null:n.length);var i;const o=(null==(i=h.Fc(9,15,t.cartList$))?null:i.length)>0;var c=null;const s=t.mobilePreviewCart&&!t.hideCart&&(null==(c=h.Fc(12,17,t.cartList$))?null:c.length)>0;h.Ub(1),h.Mc("ngIf",!t.hideCart&&t.mobilePreviewCart),h.Ub(1),h.Mc("ngIf",h.Fc(3,9,t.isMobile$)&&!t.hideCart),h.Ub(3),h.Mc("ngIf",e),h.Ub(3),h.Mc("ngIf",o),h.Ub(3),h.Mc("ngIf",s),h.Ub(2),h.Mc("selectedDpms",t.selectedDpms)("isUpdate",!0)("show",t.showDpmsFillDetail)("addedDpms",h.Fc(14,19,t.cartList$))}},directives:[z.a,p.t,vu,D.a,ut.a,p.q,p.s,B.a,_.a,ge.a,P.c,P.a,be.c,Se.a,Il.a,W.a],pipes:[p.b,ke.a],styles:[""]}),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var Mg=n("6n/F"),Cg=n("ZeV2"),qg=n("e1sS"),Tg=n("OBmA"),wg=n("cFye"),zg=n("IP4G"),Dg=n("niWF"),Pg=n("SuVu"),Ig=n("UD+I");let kg=(()=>{class e{constructor(){}ngOnInit(){}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-detail-header"]],inputs:{selectedItem:"selectedItem"},decls:65,vars:45,consts:[[1,"pb-4"],[3,"nzSpan"],[1,"mb-1"],[1,"text-xxs"],[1,"font-weight-bold","text-xs"],["nzAlign","middle","nzType","flex"],[1,"text-sm"],[1,"text-right","text-sm",3,"nzSpan"],[1,"font-weight-bold"],["nzType","vertical",1,"vertical-divider"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.rc(1,"nz-row",0),h.rc(2,"nz-col",1),h.rc(3,"div",2),h.rc(4,"div",3),h.qd(5," High "),h.qc(),h.rc(6,"div",4),h.qd(7),h.Ec(8,"stockPrice"),h.qc(),h.qc(),h.rc(9,"div",3),h.qd(10," Low "),h.qc(),h.rc(11,"div",4),h.qd(12),h.Ec(13,"stockPrice"),h.qc(),h.qc(),h.mc(14,"nz-col",1),h.rc(15,"nz-col",1),h.rc(16,"div",2),h.rc(17,"div",3),h.qd(18," Open "),h.qc(),h.rc(19,"div",4),h.qd(20),h.Ec(21,"stockPrice"),h.qc(),h.qc(),h.rc(22,"div",3),h.qd(23," Prev.Close "),h.qc(),h.rc(24,"div",4),h.qd(25),h.Ec(26,"stockPrice"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(27,"app-mobile-scaffold"),h.rc(28,"nz-row",5),h.rc(29,"nz-col",1),h.rc(30,"nz-row",5),h.rc(31,"nz-col",1),h.rc(32,"div",6),h.qd(33," Volume "),h.qc(),h.qc(),h.rc(34,"nz-col",7),h.rc(35,"span",8),h.qd(36),h.Ec(37,"number"),h.qc(),h.qc(),h.qc(),h.rc(38,"nz-row",5),h.rc(39,"nz-col",1),h.rc(40,"div",6),h.qd(41," Open "),h.qc(),h.qc(),h.rc(42,"nz-col",7),h.rc(43,"span",8),h.qd(44),h.Ec(45,"stockPrice"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(46,"nz-col",1),h.mc(47,"nz-divider",9),h.qc(),h.rc(48,"nz-col",1),h.rc(49,"nz-row",5),h.rc(50,"nz-col",1),h.rc(51,"div",6),h.qd(52," High "),h.qc(),h.qc(),h.rc(53,"nz-col",7),h.rc(54,"span",8),h.qd(55),h.Ec(56,"stockPrice"),h.qc(),h.qc(),h.qc(),h.rc(57,"nz-row",5),h.rc(58,"nz-col",1),h.rc(59,"div",6),h.qd(60," Low "),h.qc(),h.qc(),h.rc(61,"nz-col",7),h.rc(62,"span",8),h.qd(63),h.Ec(64,"stockPrice"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(2),h.Mc("nzSpan",11),h.Ub(5),h.sd(" ",null!=t.selectedItem&&t.selectedItem.dayHigh?" "+h.Gc(8,22,null==t.selectedItem?null:t.selectedItem.dayHigh,null==t.selectedItem?null:t.selectedItem.exchange):"-"," "),h.Ub(5),h.sd(" ",null!=t.selectedItem&&t.selectedItem.dayLow?" "+h.Gc(13,25,null==t.selectedItem?null:t.selectedItem.dayLow,null==t.selectedItem?null:t.selectedItem.exchange):"-"," "),h.Ub(2),h.Mc("nzSpan",2),h.Ub(1),h.Mc("nzSpan",11),h.Ub(5),h.sd(" ",null!=t.selectedItem&&t.selectedItem.openPrice?" "+h.Gc(21,28,null==t.selectedItem?null:t.selectedItem.openPrice,null==t.selectedItem?null:t.selectedItem.exchange):"-"," "),h.Ub(5),h.sd(" ",null!=t.selectedItem&&t.selectedItem.closePrice?" "+h.Gc(26,31,null==t.selectedItem?null:t.selectedItem.closePrice,null==t.selectedItem?null:t.selectedItem.exchange):"-"," "),h.Ub(4),h.Mc("nzSpan",11),h.Ub(2),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12),h.Ub(2),h.rd(null!=t.selectedItem&&t.selectedItem.cumulativeVolume?h.Fc(37,34,null==t.selectedItem?null:t.selectedItem.cumulativeVolume):"-"),h.Ub(3),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12),h.Ub(2),h.rd(null!=t.selectedItem&&t.selectedItem.openPrice?(null==t.selectedItem?null:t.selectedItem.currency)+" "+h.Gc(45,36,null==t.selectedItem?null:t.selectedItem.openPrice,null==t.selectedItem?null:t.selectedItem.exchange):"-"),h.Ub(2),h.Mc("nzSpan",2),h.Ub(2),h.Mc("nzSpan",11),h.Ub(2),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12),h.Ub(2),h.rd(null!=t.selectedItem&&t.selectedItem.dayHigh?(null==t.selectedItem?null:t.selectedItem.currency)+" "+h.Gc(56,39,null==t.selectedItem?null:t.selectedItem.dayHigh,null==t.selectedItem?null:t.selectedItem.exchange):"-"),h.Ub(3),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12),h.Ub(2),h.rd(null!=t.selectedItem&&t.selectedItem.dayLow?(null==t.selectedItem?null:t.selectedItem.currency)+" "+h.Gc(64,42,null==t.selectedItem?null:t.selectedItem.dayLow,null==t.selectedItem?null:t.selectedItem.exchange):"-"))},directives:[B.a,P.c,P.a,z.a,Nu.a],pipes:[Ig.a,p.g],styles:[".ant-btn.outline[_ngcontent-%COMP%], .ant-btn[nzOutline].delay-button[_ngcontent-%COMP%]{border-color:#ff333a!important;color:#ff333a!important}.vertical-line[_ngcontent-%COMP%]{height:2.5rem;top:.01rem;position:relative;display:inline-block;width:1px;margin:0 8px;vertical-align:middle;background:#e8e8e8}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();
5var Ag=n("kAVD"),Eg=n("F6ss"),Fg=n("oyxB"),Og=n("81tN");function Ug(e,t){if(1&e){const e=h.sc();h.rc(0,"div",20),h.rc(1,"nz-row",21),h.rc(2,"nz-col",22),h.rc(3,"img",23),h.zc("click",(function(){return h.dd(e),h.Dc(2).snapSelectedStock(!1)})),h.qc(),h.qc(),h.rc(4,"nz-col",24),h.rc(5,"nz-row",25),h.qd(6),h.qc(),h.rc(7,"nz-row",26),h.qd(8,"Press the snap button to get latest data"),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(3),h.Mc("src","assets/images/stocks/snap.svg",h.gd),h.Ub(3),h.sd("Live Snap: ",e.hkexSnapCount,"")}}function xg(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",27),h.rc(2,"span",14),h.qd(3),h.qc(),h.rc(4,"span",28),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",29),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd("",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.rd(h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)),h.Ub(3),h.td("",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(10,11,null==e.subscribedStock?null:e.subscribedStock.changePercentage,"1.3-3"),"%) ")}}function Lg(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",30),h.rc(2,"span",14),h.qd(3),h.qc(),h.rc(4,"span",28),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",31),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd(" ",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.rd(h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)),h.Ub(3),h.td(" +",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (+",h.Gc(10,11,null==e.subscribedStock?null:e.subscribedStock.changePercentage,"1.3-3"),"%) ")}}function Rg(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",32),h.rc(2,"span",14),h.qd(3),h.qc(),h.rc(4,"span",28),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",25),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.sd("",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.rd(h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)),h.Ub(3),h.td(" ",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(10,11,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%) ")}}const Ng=function(e,t,n,i){return{"bg-theme":e,"text-white":t,"bg-lighter":n,"mb-2":i}};function Bg(e,t){if(1&e){const e=h.sc();h.rc(0,"div",34),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).onChangeOption(t.value)})),h.Ec(1,"async"),h.rc(2,"span",35),h.qd(3),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Mc("ngClass",h.Vc(4,Ng,e.active,e.active,!e.active,!h.Fc(1,2,t.isMobile$))),h.Ub(3),h.sd(" ",e.label," ")}}function _g(e,t){if(1&e&&(h.pc(0),h.od(1,Bg,4,9,"div",33),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf",e.show)}}function Vg(e,t){1&e&&h.nc(0)}function Hg(e,t){if(1&e&&(h.rc(0,"div",38),h.od(1,Vg,1,0,"ng-container",39),h.qc()),2&e){h.Dc(3);const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function $g(e,t){}function jg(e,t){if(1&e&&(h.pc(0),h.od(1,$g,0,0,"ng-template",40),h.oc()),2&e){h.Dc(3);const e=h.ad(11);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function Gg(e,t){if(1&e&&(h.rc(0,"nz-row",17),h.rc(1,"div",36),h.od(2,Hg,2,1,"div",37),h.od(3,jg,2,1,"ng-container",15),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("hidden",e.stockLiveFeeHideScroll),h.Ub(1),h.Mc("nzSpan",24),h.Ub(1),h.Mc("ngIf",e.selectedItem.exchange===e.stockConstant.HKEX&&!e.isHkexLivestreaming&&e.isShowingMarketDepthComponent||e.isShowingMarketDepthComponent&&e.isLiveSnapAvailable),h.Ub(1),h.Mc("ngIf",e.supportMarketDepth())}}function Wg(e,t){1&e&&(h.rc(0,"div"),h.mc(1,"app-stocks-streaming-indicator",45),h.qc()),2&e&&(h.Ub(1),h.Mc("isDelayStream",!0))}const Yg=function(e){return{"d-block":e}};function Kg(e,t){if(1&e){const e=h.sc();h.pc(0),h.od(1,Wg,2,1,"div",15),h.rc(2,"div",17),h.rc(3,"div",41),h.rc(4,"span",42),h.qd(5,"Price Chart "),h.qc(),h.qc(),h.rc(6,"div",43),h.rc(7,"highcharts-chart",44),h.zc("updateChange",(function(t){return h.dd(e),h.Dc(2).updateFlag=t})),h.Ec(8,"async"),h.qc(),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf","SGX"==(null==e.selectedItem?null:e.selectedItem.exchange)&&!e.isSGXLiveStreaming),h.Ub(1),h.Mc("hidden",e.stockLiveFeeHideScroll),h.Ub(5),h.Mc("Highcharts",e.Highcharts
5)("options",e.chartOptions)("runOutsideAngular",!0)("ngClass",h.Sc(10,Yg,!h.Fc(8,8,e.isMobile$)))("oneToOne",!0)("update",e.updateFlag)}}function Xg(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-card",5),h.rc(1,"div",6),h.rc(2,"div",7),h.mc(3,"app-stocks-streaming-indicator",8),h.qc(),h.rc(4,"div",7),h.rc(5,"i",9),h.zc("click",(function(){return h.dd(e),h.Dc().close()})),h.qc(),h.qc(),h.qc(),h.od(6,Ug,9,2,"div",10),h.rc(7,"nz-row",11),h.rc(8,"nz-col",12),h.rc(9,"span",13),h.qd(10),h.qc(),h.rc(11,"span",14),h.qd(12),h.qc(),h.mc(13,"br"),h.od(14,xg,11,14,"div",15),h.od(15,Lg,11,14,"div",15),h.od(16,Rg,11,14,"div",15),h.qc(),h.rc(17,"nz-col",12),h.mc(18,"app-stocks-detail-header",16),h.qc(),h.qc(),h.rc(19,"nz-row",17),h.od(20,_g,2,1,"ng-container",18),h.qc(),h.od(21,Gg,4,4,"nz-row",19),h.od(22,Kg,9,12,"ng-container",15),h.qc()}if(2&e){const e=h.Dc();h.Ub(3),h.Mc("exchange",null==e.selectedItem?null:e.selectedItem.exchange)("snapModel",e.selectedItem),h.Ub(3),h.Mc("ngIf",e.selectedItem.exchange===e.stockConstant.HKEX&&!e.isHkexLivestreaming),h.Ub(2),h.Mc("nzSpan",12),h.Ub(2),h.sd("",null==e.selectedItem?null:e.selectedItem.stockName," "),h.Ub(2),h.sd(" (",null==e.selectedItem?null:e.selectedItem.stockCode,")"),h.Ub(2),h.Mc("ngIf",e.subscribedStock&&(null==e.subscribedStock?null:e.subscribedStock.change)<0),h.Ub(1),h.Mc("ngIf",e.subscribedStock&&(null==e.subscribedStock?null:e.subscribedStock.change)>0),h.Ub(1),h.Mc("ngIf",e.subscribedStock&&0==(null==e.subscribedStock?null:e.subscribedStock.change)),h.Ub(1),h.Mc("nzSpan",12),h.Ub(1),h.Mc("selectedItem",e.selectedItem),h.Ub(1),h.Mc("hidden",e.stockLiveFeeHideScroll),h.Ub(1),h.Mc("ngForOf",e.options),h.Ub(1),h.Mc("ngIf",e.selectedItem.exchange===e.stockConstant.KLSE||e.selectedItem.exchange===e.stockConstant.BURSA||e.selectedItem.exchange===e.stockConstant.HKEX||e.selectedItem.exchange===e.stockConstant.SGX&&e.isSGXLiveStreaming),h.Ub(1),h.Mc("ngIf",!e.isPriceChartLoading&&e.isPriceChartSupported(e.selectedItem))}}function Qg(e,t){if(1&e&&h.mc(0,"img",68),2&e){const e=h.Dc(3);h.Mc("src",e.SHARIAH_COMPLAINT_IMG_PATH+"shariah-stock.svg",h.gd)}}function Zg(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",69),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.td(" ",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function Jg(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",70),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.td(" +",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (+",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function eb(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",42),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.td(" ",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function tb(e,t){1&e&&h.nc(0)}function nb(e,t){if(1&e&&(h.rc(0,"div",38),h.od(1,tb,1,0,"ng-container",39),h.qc()),2&e){h.Dc(3);const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function ib(e,t){}function cb(e,t){if(1&e&&(h.pc(0),h.od(1,ib,0,0,"ng-template",40),h.oc()),2&e){h.Dc(3);const e=h.ad(11);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function ob(e,t){1&e&&h.mc(0,"nz-tab",55),2&e&&h.Mc("nzTitle","Summary")}function sb(e,t){if(1&e){const e=h.sc();h.rc(0,"div",7),h.rc(1,"nz-tabset",54),h.zc("nzSelectedIndexChange",(function(t){return h.dd(e),h.Dc(2).emitSelectedTab(t)})),h.rc(2,"nz-tab",55),h.rc(3,"div"),h.rc(4,"nz-row"),h.rc(5,"div",56),h.rc(6,"nz-card",57),h.rc(7,"div",43),h.rc(8,"nz-col",58),h.mc(9,"app-stocks-streaming-indicator",8),h.qc(),h.qc(),h.rc(10,"nz-row",59),h.rc(11,"nz-col",60),h.rc(12,"span"),h.od(13,Qg,1,1,"img",61),h.qc(),h.rc(14,"span",62),h.qd(15),h.qc(),h.qc(),h.rc(16,"nz-col",63),h.rc(17,"span",42),h.qd(18),h.Ec(19,"stockPrice"),h.qc(),h.qc(),h.qc(),h.rc(20,"nz-row",64),h.rc(21,"nz-col",65),h.rc(22,"span"),h.mc(23,"app-stock-exchange-tag",66),h.qd(24),h.qc(),h.qc(),h.rc(25,"nz-col",63),h.od(26,Zg,5,9,"div",15),h.od(27,Jg,5,9,"div",15),h.od(28,eb,5,9,"div",15),h.qc(),h.qc(),h.rc(29,"div",43),h.mc(30,"app-stocks-detail-header",16),h.qc(),h.qc(),h.rc(31,"nz-card"),h.rc(32,"div",36),h.od(33,nb,2,1,"div",37),h.od(34,cb,2,1,"ng-container",15),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.mc(35,"nz-tab",55),h.od(36,ob,1,1,"nz-tab",67),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("nzSelectedIndex",0),h.Ub(1),h.Mc("nzTitle","Market Depth"),h.Ub(3),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("exch
5ange",null==e.selectedItem?null:e.selectedItem.exchange)("snapModel",e.selectedItem),h.Ub(4),h.Mc("ngIf",e.shariahFlag),h.Ub(2),h.rd(null==e.selectedItem?null:e.selectedItem.stockName),h.Ub(3),h.rd(h.Gc(19,20,e.selectedItem.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)),h.Ub(5),h.Mc("exchange",null==e.selectedItem?null:e.selectedItem.exchange),h.Ub(1),h.sd(" ",null==e.selectedItem?null:e.selectedItem.stockCode,""),h.Ub(2),h.Mc("ngIf",e.selectedItem&&e.selectedItem.change<0),h.Ub(1),h.Mc("ngIf",e.selectedItem&&e.selectedItem.change>0),h.Ub(1),h.Mc("ngIf",e.selectedItem&&0===e.selectedItem.change),h.Ub(2),h.Mc("selectedItem",e.selectedItem),h.Ub(2),h.Mc("nzSpan",24),h.Ub(1),h.Mc("ngIf",e.selectedItem.exchange===e.stockConstant.HKEX&&!e.isHkexLivestreaming&&e.isShowingMarketDepthComponent||e.isShowingMarketDepthComponent&&e.isLiveSnapAvailable),h.Ub(1),h.Mc("ngIf",e.supportMarketDepth()),h.Ub(1),h.Mc("nzTitle","Time & Sales"),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE)}}function ab(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",46),h.rc(1,"div",47),h.rc(2,"b2c-app-bar-2",48),h.zc("back",(function(){return h.dd(e),h.Dc().handleMobileVisible()})),h.qc(),h.qc(),h.od(3,sb,37,23,"div",49),h.rc(4,"div",50),h.rc(5,"nz-row"),h.rc(6,"button",51),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.navigateToStocksFactsheet(null==t.selectedItem?null:t.selectedItem.stockName,null==t.selectedItem?null:t.selectedItem.exchange,null==t.selectedItem?null:t.selectedItem.stockCode)})),h.qd(7," View Stocks Factsheet "),h.qc(),h.qc(),h.rc(8,"nz-row"),h.rc(9,"button",52),h.zc("click",(function(){return h.dd(e),h.Dc().tradeNow()})),h.qd(10,"Trade Now"),h.qc(),h.qc(),h.mc(11,"nz-row",53),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",!0)("nzWrapClassName","mobile-drawer-no-padding")("nzPlacement","bottom"),h.Ub(2),h.Mc("title","Stock Information"),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.HKEX||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SGX)}}const lb=function(e,t){return{"text-sm":e,"text-xs":t}};function rb(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",71),h.Ec(2,"async"),h.Ec(3,"async"),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"td",72),h.rc(7,"span",73),h.Ec(8,"async"),h.Ec(9,"async"),h.qd(10),h.Ec(11,"stockPrice"),h.qc(),h.qc(),h.rc(12,"td",74),h.Ec(13,"async"),h.Ec(14,"async"),h.rc(15,"span",27),h.qd(16),h.Ec(17,"stockPrice"),h.qc(),h.qc(),h.rc(18,"td",75),h.Ec(19,"async"),h.Ec(20,"async"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc()),2&e){const e=t.index,n=h.Dc(),i=n.dataBid,c=n.dataAsk,o=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(34,lb,h.Fc(2,8,o.isMobile$),!h.Fc(3,10,o.isMobile$))),h.Ub(3),h.rd((null==i?null:i.length)>0&&i[e]?h.Fc(5,12,i[e][7]):0),h.Ub(3),h.Mc("ngClass",h.Tc(37,lb,h.Fc(8,14,o.isMobile$),!h.Fc(9,16,o.isMobile$))),h.Ub(3),h.rd((null==i?null:i.length)>0&&i[e]?h.Gc(11,18,i[e][8],null==o.selectedItem?null:o.selectedItem.exchange):"-"),h.Ub(2),h.Mc("ngClass",h.Tc(40,lb,h.Fc(13,21,o.isMobile$),!h.Fc(14,23,o.isMobile$))),h.Ub(4),h.rd((null==c?null:c.length)>0&&c[e]?h.Gc(17,25,c[e][8],null==o.selectedItem?null:o.selectedItem.exchange):"-"),h.Ub(2),h.Mc("ngClass",h.Tc(43,lb,h.Fc(19,28,o.isMobile$),!h.Fc(20,30,o.isMobile$))),h.Ub(3),h.rd((null==c?null:c.length)>0&&c[e]?h.Fc(22,32,c[e][7]):0)}}function db(e,t){1&e&&h.od(0,rb,23,46,"tr",18),2&e&&h.Mc("ngForOf",t.maxDataLength)}function ub(e,t){if(1&e){const e=h.sc();h.rc(0,"div",76),h.rc(1,"button",77),h.zc("click",(function(){return h.dd(e),h.Dc().snapSelectedStock(!0)})),h.mc(2,"img",78),h.qd(3," Snap Now "),h.qc(),h.rc(4,"p",79),h.qd(5,"Press the snap now button to get latest market depth data."),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("nzSize","small")("nzLoading",e.snapLoading),h.Ub(1),h.Mc("src","assets/images/stocks/snap.svg",h.gd)}}function hb(e,t){1&e&&h.nc(0)}const pb=function(e,t,n){return{dataBid:e,dataAsk:t,maxDataLength:n}};function mb(e,t){if(1&e&&(h.pc(0),h.od(1,hb,1,0,"ng-container",86),h.oc()),2&e){const e=h.Dc(2),t=h.ad(7);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Uc(2,pb,e.marketDepthDataBid,e.marketDepthDataAsk,(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>=(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)?e.marketDepthDataBid:e.marketDepthDataAsk))}}const fb=function(){return[""]},gb=function(){return{x:"228px"}};function bb(e,t){if(1&e&&(h.rc(0,"div",43),h.rc(1,"nz-table",80),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",81),h.qd(5,"Best Buy"),h.qc(),h.rc(6,"th",81),h.qd(7,"Best Sell"),h.qc(),h.qc(),h.qc(),h.mc(8,"tbody"),h.qc(),h.rc(9,"nz-table",82),h.rc(10,"thead"),h.rc(11,"tr"),h.rc(12,"th",83),h.qd(13,"Qty"),h.qc(),h.rc(14,"th",84),h.qd(15,"Price"),h.qc(),h.rc(16,"th",84),h.qd(17,"Price"),h.qc(),h.rc(18,"th",85),h.qd(19,"Qty"),h.qc(),h.qc(),h.qc(),h.rc(20,"tbody"),h.od(21,mb,2,6,"ng-container",15),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("nzData",h.Rc(7,fb))("nzFrontPagination",!1)("nzShowPagination",!1),h.Ub(8),h.Mc("nzData",(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)>=1?e.marketDepthDataAsk:(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>=1?e.marketDepthDataBid:null)("nzScroll",h.Rc(8,gb))("nzShowPagination",!1),h.Ub(12),h.Mc("ngIf",(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)>=1||(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>=1)}}let Sb=(()=>{class e{constructor(e,t,n,i,c,o,s){this.lightStreamerHelperService=e,this.uiTableService=t,this.notificationService=n,this.stocksInfoRestService=i,this.subHandlingService=c,this.liveFeedService=o,this.store=s,this.closeEmitter=new h.s,this.selectTimeAndSalesEmitter=new h.s,this.selectTradeDetailEmitter=new h.s,this.mobileBack=new h.s,this.mobileShowTimeAndSales=new h.s,this.mobileShowTradeDetails=new h.s,this.refreshHkexSnapCount=new h.s,this.SHARIAH_COMPLAINT_IMG_PATH=M.g.STOCKS_IMG_PATH,this.TIME_AND_SALES_FIELDS=["symbol","exchange","stockCode","level","tradeTime","size","price","side","lastBid","lastAsk","seq"],this.MARKET_DEPTH_FIELDS=["symbol","exchange","stockCode","level","type","volume","price","numberOfTrade","brokerQueue"],this.PRICE_QUOTE_FIELDS=["symbol","exchange","stockCode","stockName","currency","lastPrice","cumulativeVolume","bidPrice","bidQuantity","askPrice","askQuantity","openPrice","closePrice","dayHigh","dayLow","change","changePercentage","tradingStatus"],this.Highcharts=Mg,this.MIN="min",this.MAX="max",this.chartOptions={credits:{enabled:!1},xAxis:{crosshair:{width:1,color:"#dadada"},type:"datetime"},yAxis:{title:null,min:0,max:0,labels:{formatter:function(){return Mg.numberFormat(Number(this.value),3)}}},legend:{enabled:!1},title:{text:""},tooltip:{},chart:{zoomType:"x",panning:{enabled:!0},panKey:"shift",events:{render:function(){setTimeout(()=>{},0)}}},plotOptions:{area:{lineColor:"#004BAD",fillColor:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,"rgba(144, 175, 214, 0.4)"],[1,"rgba(255, 255, 255, 0.5)"]]}},series:{marker:{enabled:!1}}}},this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.tempSubMarketDepth=[],this.timeAndSales=[],this.selectedStockForMarketDepth=[],this.updateFlag=!1,this.isPriceChartLoading=!1,this.isShowingMarketDepthComponent=!0,this.isLiveSnapAvailable=!1,this.shariahFlag=!1,this.subscribedStock={},this.tempSubPriceQuote=[],this.startHours=0,this.startMinutes=0,this.endHours=0,this.endMinutes=0,this.startLunchBreakHour=0,this.startLunchBreakMinutes=0,this.endLunchBreakHour=0,this.endLunchBreakMinutes=0,this.options=[{label:"Market Depth",value:"md",active:!0,show:!0},{label:"Time & Sales",value:"ts",active:!1,show:!0},{label:"Summary",value:"td",active:!1,show:!0}],this.stockConstant=M.q,this.isPriceChartSupported=Tg.b,this.isHkexLivestreaming=!1,this.isSGXLiveStreaming=!1,this.snapLoading=!1,this.marketDepth=0}ngOnInit(){this.isHkexLivestreaming=this.liveFeedService.checkStreaming(M.q.HKEX),this.isSGXLiveStreaming=this.liveFeedService.checkStreaming(M.q.SGX),this.selectedItem&&(this.options=Object(Tg.c)(this.options,this.selectedItem,this.isSGXLiveStreaming,this.isHkexLivestreaming,this.liveFeedService.checkLiveStreamingMarketDepth(this.selectedItem.exchange)),this.selectedItem.exchange!==M.q.HKEX||this.isHkexLivestreaming||(this.patchFromExistingSnap(),this.listenToSnapChange()),Object(Tg.a)(this.selectedItem)||this.onChangeOption("ts"),this.changeMarketDepthTitle())}ngOnChanges(e){const t=this.store.selectSnapshot(u.X.getLsPermission);this.isHkexLivestreaming=this.liveFeedService.checkStreaming(M.q.HKEX),this.isSGXLiveStreaming=this.liveFeedService.checkStreaming(M.q.SGX),e&&e.selectedItem&&(e.selectedItem.currentValue.exchange!==M.q.KLSE&&e.selectedItem.currentValue.exchange!==M.q.SGX&&e.selectedItem.currentValue.exchange!==M.q.LSE||this.getTimeAndSalesForHighChart(),this.handleSelectedStockForMarketDepth(this.selectedItem),this.subscribeLSPriceQuote(e.selectedItem.currentValue),this.options=Object(Tg.c)(this.options,this.selectedItem,this.isSGXLiveStreaming,this.isHkexLivestreaming,this.liveFeedService.checkLiveStreamingMarketDepth(this.selectedItem.exchange)),e.selectedItem.currentValue.exchange!==M.q.HKEX||this.isHkexLivestreaming||(this.patchFromExistingSnap(),this.listenToSnapChange(),this.isShowingMarketDepthComponent=!0),Object(Tg.a)(this.selectedItem)||(console.log("CHANGE OPTION",this.selectedItem),this.onChangeOption("ts")),(null==t?void 0:t.HKEX.streamL1)&&!(null==t?void 0:t.HKEX.streamL2)&&(this.isLiveSnapAvailable=!0))}ngOnDestroy(){this.unsubscribeTimeAndSalesAndMarketDepth(),this.snapStocksSubscription&&this.snapStocksSubscription.unsubscribe()}unsubscribeLightStreamerClient(){this.tempSubPriceQuote.length>
50&&(this.tempSubPriceQuote.forEach(e=>{e&&this.lsClient.unsubscribe(e)}),this.tempSubPriceQuote=[],this.subscribedStock={})}subscribeLSPriceQuote(e){this.unsubscribeLightStreamerClient(),e.sedolnumber=M.q.KLSE+":"+e.stockCode,e.securityType="COMMON_STOCK",this.tempSubPriceQuote=this.liveFeedService.subscribePriceQuote(this.lsClient,this.PRICE_QUOTE_FIELDS,[e]),this.tempSubPriceQuote.forEach(e=>{e&&e.addListener({onItemUpdate:e=>{this.patchFromExistingSnap(e.updateValues[2])&&(this.subscribedStock.lastPrice=parseFloat(e.updateValues[7]),this.subscribedStock.change=parseFloat(e.updateValues[17]),this.subscribedStock.changePercentage=parseFloat(e.updateValues[18]))}})})}unsubscribeTimeAndSalesAndMarketDepth(){this.timeAndSalesSub&&(this.lsClient.unsubscribe(this.timeAndSalesSub),this.timeAndSalesSub=null),this.tempSubMarketDepth.length>0&&(this.tempSubMarketDepth.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubMarketDepth=[]),this.marketDepthDataBid=[],this.marketDepthDataAsk=[]}handleSelectedStockForMarketDepth(e){if(this.unsubscribeTimeAndSalesAndMarketDepth(),this.setShariahFlag(e.stockCode,e.exchange===M.q.BURSA?M.q.KLSE:e.exchange),this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.selectedStockForMarketDepth=e,e.exchange===M.q.BURSA||e.exchange===M.q.KLSE||e.exchange===M.q.SGX&&this.isSGXLiveStreaming||e.exchange===M.q.HKEX&&this.isHkexLivestreaming){const t=this.liveFeedService.checkLiveStreamingMarketDepth(e.exchange);this.marketDepth=parseInt(t);let n=this.liveFeedService.subscribeMarketDepth(this.lsClient,this.MARKET_DEPTH_FIELDS,e,t);if(null==n)return;this.tempSubMarketDepth.push(n),this.tempSubMarketDepth.forEach(t=>{t.addListener({onItemUpdate:t=>{let n=[],i=parseInt(this.liveFeedService.checkLiveStreamingMarketDepth(e.exchange));"bid"===t.updateValues[6]&&"ADD"===t.updateValues[12]?(n=this.marketDepthDataBid.length>=i?[]:Object(g.a)(this.marketDepthDataBid),n.push(t.updateValues),this.marketDepthDataBid=Object(g.a)(n)):"ask"===t.updateValues[6]&&"ADD"===t.updateValues[12]?(n=this.marketDepthDataAsk.length>=i?[]:Object(g.a)(this.marketDepthDataAsk),n.push(t.updateValues),this.marketDepthDataAsk=Object(g.a)(n)):"bid"===t.updateValues[6]&&"UPDATE"===t.updateValues[12]?(console.log("updateObj MD",t),n=Object(g.a)(this.marketDepthDataBid),n[parseInt(t.updateValues[11])]=t.updateValues,this.marketDepthDataBid=Object(g.a)(n)):"ask"===t.updateValues[6]&&"UPDATE"===t.updateValues[12]&&(console.log("updateObj MD",t),n=Object(g.a)(this.marketDepthDataAsk),n[parseInt(t.updateValues[11])-i]=t.updateValues,this.marketDepthDataAsk=Object(g.a)(n))}})})}}patchFromExistingSnap(e=this.selectedItem.symbol){let t=this.liveFeedService.getSnapStocks(e);return t&&t.endSnapDate>(new Date).getTime()?(this.selectedItem=Object(g.a)(t),this.handleSnapMarketDepth(t),this.subscribedStock=Object.assign({},t),!1):(t&&t.endSnapDate<=(new Date).getTime()&&this.liveFeedService.removeSnapStock(e),!0)}listenToSnapChange(){this.snapStocksSubscription=this.liveFeedService.getSnapStocksObservable().subscribe(e=>{if(e&&0!=e.size){let t=e.get(this.selectedItem.symbol);t&&t.endSnapDate>(new Date).getTime()&&(this.selectedItem=Object(g.a)(t),this.handleSnapMarketDepth(t),this.subscribedStock=Object.assign({},t))}})}setShariahFlag(e,t){this.shariahFlag=!1,this.stocksInfoRestService.getStockTickerInfoDetails(e,t).subscribe(e=>{var t;M.a.RESPONSE_SUCCESS===e.status&&e.data&&e.data.length>0&&"Y"===(null===(t=e.data[0])||void 0===t?void 0:t.shariahCompliantIndicator)&&(this.shariahFlag=!0)})}getTimeAndSalesForHighChart(){this.isPriceChartLoading=!0,this.setExchangeTradingAndLunchTime(this.selectedItem.exchange),this.subHandlingService.subscribe(this.stocksInfoRestService.getTimeAndSales(this.selectedItem.symbol).pipe(Object(y.a)(e=>{const t=e.data;if("ok"==(null==t?void 0:t.s)){const e=[],n=[];let i=!1,c=this.findIndexBeforeLunchBreak(t.t);const o=t.c[c];let s=Date.now();const a=60*Math.floor(s/6e4);for(let l=0;l<t.t.length;l++){const e=t.c[l],c=t.t[l];!i&&this.isLunchEnd(c)&&(n.push([this.convertTime(c-60),o]),i=!0),n.push([this.convertTime(c),e])}this.convertTime(a)>this.convertTime(t.t[c])&&this.isLunchBreak(a)&&n.push([this.convertTime(a),o]),this.determineMinMaxTime(n),this.determineMinMaxPrice(n),this.determineLunchBreakPlotBands(n),e.push({type:"area",name:this.selectedItem.stockName,data:n}),this.chartOptions.series=[...e],this.updateFlag=!0,this.isPriceChartLoading=!1}})))}convertTime(e){return e instanceof Date||(e=new Date(1e3*e)),Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}findIndexBeforeLunchBreak(e){let t=0;for(let n=0;n<e.length;n++)this.isBeforeLunchBreak(e[n])&&(t=n);return t}isBeforeLunchBreak(e){let t=new Date(this.convertTime(e));return this.convertTime(e)<=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startLunchBreakHour,this.startLunchBreakMinutes,0,0)}isLunchBreak(e){let t=new Date(this.convertTime(e));return this.convertTime(e)>Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startLunchBreakHour,this.startLunchBreakMinutes,0,0)&&this.convertTime(e)<Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endLunchBreakHour,this.endLunchBreakMinutes,0,0)}isLunchEnd(e){let t=new Date(this.convertTime(e));return this.convertTime(e)>=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endLunchBreakHour,this.endLunchBreakMinutes,0,0)}determineLunchBreakPlotBands(e){if(e[0][0]){let t=new Date(e[0][0]);this.chartOptions.xAxis.plotBands=[{from:Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startLunchBreakHour,this.startLunchBreakMinutes,0,0),to:Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endLunchBreakHour,this.endLunchBreakMinutes,0,0),color:"#FFFFFF",label:{text:"<em>Lunch</em><br> <em>Break</em>",verticalAlign:"top"}}]}}determineMinMaxPrice(e){this.chartOptions.yAxis[this.MIN]=e[0][1],this.chartOptions.yAxis[this.MAX]=e[0][1];for(let t=1;t<e.length;t++)e[t][1]<this.chartOptions.yAxis[this.MIN]&&(this.chartOptions.yAxis[this.MIN]=e[t][1]),e[t][1]>this.chartOptions.yAxis[this.MAX]&&(this.chartOptions.yAxis[this.MAX]=e[t][1]);this.chartOptions.yAxis.min&&this.chartOptions.yAxis.max&&(this.chartOptions.yAxis.tickInterval=(Math.ceil((this.chartOptions.yAxis.max-this.chartOptions.yAxis.min)/5*200)/200).toFixed(3))}determineMinMaxTime(e){if(e[0][0]){let t=new Date(e[0][0]);this.chartOptions.xAxis.min=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startHours,this.startMinutes,0,0),this.chartOptions.xAxis.max=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endHours,this.endMinutes,0,0),this.chartOptions.xAxis.tickInterval=36e5}
5}setExchangeTradingAndLunchTime(e){switch(e){case M.q.KLSE:this.startHours=9,this.endHours=17,this.startLunchBreakHour=12,this.startLunchBreakMinutes=30,this.endLunchBreakHour=14,this.endLunchBreakMinutes=30;break;case M.q.SGX:this.startHours=9,this.endHours=17,this.endMinutes=16,this.startLunchBreakHour=12,this.startLunchBreakMinutes=0,this.endLunchBreakHour=12,this.endLunchBreakMinutes=57;break;case M.q.LSE:this.startHours=15,this.endHours=24,this.endMinutes=30,this.startLunchBreakHour=0,this.startLunchBreakMinutes=0,this.endLunchBreakHour=0,this.endLunchBreakMinutes=0;break;default:this.startHours=0,this.endHours=0,this.startLunchBreakHour=0,this.startLunchBreakMinutes=0,this.endLunchBreakHour=0,this.endLunchBreakMinutes=0}}close(){this.closeEmitter.emit()}handleMobileVisible(){this.mobileBack.emit()}tradeNow(){this.mobileBack.emit(this.selectedItem)}emitSelectedTab(e){1===e?this.mobileShowTimeAndSales.emit():2===e&&this.mobileShowTradeDetails.emit()}standardizeDecimalPlaces(e){return e?parseFloat(e).toFixed(3):""}navigateToStocksFactsheet(e,t,n){let i;"BURSA"===t&&(t="KLSE"),this.stocksInfoRestService.getTickerInfoByExchangeAndStockCode(t,n).subscribe(c=>{c.status===M.a.RESPONSE_SUCCESS&&c.data&&(i="ETF"==c.data.productType?Object(mt.f)(r.b.ETF,n,"",e,t):Object(mt.f)(r.b.STOCK_AND_ETF,n,"",e,t),Object(pt.a)(i.route,i.params))})}onChangeOption(e){e===this.options[1].value&&this.selectTimeAndSalesEmitter.emit(this.selectedItem),e===this.options[2].value&&this.selectTradeDetailEmitter.emit(this.selectedItem)}snapSelectedStock(e){var t,n;const i=this.store.selectSnapshot(u.X.getLsPermission);((null===(t=null==i?void 0:i.HKEX)||void 0===t?void 0:t.snapL3)>0||(null===(n=null==i?void 0:i.HKEX)||void 0===n?void 0:n.snapL2)>0)&&e&&(this.isShowingMarketDepthComponent=!1);let c=this.liveFeedService.constructMessage(wg.a.PRICE,this.liveFeedService.checkPermissionForSnap(this.selectedItem.exchange),this.selectedItem.symbol)+"-TS=20,MD=20",o=new lm.a(e=>{this.liveFeedService.subscribeSnap(this.lsClient,c,e,this.selectedItem.exchange)}).subscribe(e=>{if(o.unsubscribe(),!e)return;const t=JSON.parse(e.updateValues[3]);t[this.selectedItem.symbol]&&(this.selectedItem=Object(g.a)(t[this.selectedItem.symbol]),this.selectedItem.lastSnapDate=this.selectedItem.updateTime,this.selectedItem.endSnapDate=Number(this.selectedItem.updateTime)+9e5,this.liveFeedService.storeSnapStocks(this.selectedItem.symbol,this.selectedItem),this.handleSnapMarketDepth(this.selectedItem),this.refreshHkexSnapCount.emit(),this.isShowingMarketDepthComponent=!1)})}displaySnapInterface(e){return!e.endSnapDate||e.endSnapDate<(new Date).getTime()}handleSnapMarketDepth(e){if(this.clearMarketDepthArr(),e.marketDepth){for(let t of e.marketDepth)t[7]=t.volume,t[8]=t.price,this.marketDepthDataBid.length<10&&t.type===zg.a.BID?this.marketDepthDataBid.push(t):this.marketDepthDataAsk.length<10&&t.type===zg.a.ASK&&this.marketDepthDataAsk.push(t);this.isShowingMarketDepthComponent=!1}else this.isShowingMarketDepthComponent=!0}clearMarketDepthArr(){this.marketDepthDataBid=[],this.marketDepthDataAsk=[]}supportMarketDepth(){var e,t;switch(null===(e=this.selectedItem)||void 0===e?void 0:e.exchange){case M.q.BURSA:case M.q.KLSE:return!0;case M.q.SGX:if(this.isSGXLiveStreaming&&this.marketDepth>1)return this.marketDepthDataAsk.length>1||this.marketDepthDataBid.length>1;break;case M.q.HKEX:if(this.isHkexLivestreaming&&this.marketDepth>1)return this.marketDepthDataAsk.length>1||this.marketDepthDataBid.length>1;if(!this.isHkexLivestreaming&&this.liveFeedService.findSnapMarketDepth(null===(t=this.selectedItem)||void 0===t?void 0:t.exchange)>1)return this.marketDepthDataAsk.length>1||this.marketDepthDataBid.length>1}return!1}changeMarketDepthTitle(){var e,t,n;let i="Market Depth";(null===(e=this.selectedItem)||void 0===e?void 0:e.exchange)!==M.q.LSE&&((null===(t=this.selectedItem)||void 0===t?void 0:t.exchange)!==M.q.SGX||this.isSGXLiveStreaming&&"1"!=this.liveFeedService.checkLiveStreamingMarketDepth(null===(n=this.selectedItem)||void 0===n?void 0:n.exchange))||(i="Price Chart"),this.options[0].label=i}}return e.\u0275fac=function(t){return new(t||e)(h.lc(qg.a),h.lc(Cg.e),h.lc(j.e),h.lc(Dg.a),h.lc(l.a),h.lc(hm.a),h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-live-market"]],inputs:{selectedItem:"selectedItem",lsClient:"lsClient",stockLiveFeeHideScroll:"stockLiveFeeHideScroll",hkexSnapCount:"hkexSnapCount"},outputs:{closeEmitter:"closeEmitter",selectTimeAndSalesEmitter:"selectTimeAndSalesEmitter",selectTradeDetailEmitter:"selectTradeDetailEmitter",mobileBack:"mobileBack",mobileShowTimeAndSales:"mobileShowTimeAndSales",mobileShowTradeDetails:"mobileShowTradeDetails",refreshHkexSnapCount:"refreshHkexSnapCount"},features:[h.Tb([Cg.e,qg.a]),h.Sb],decls:12,vars:6,consts:[["nzSize","small",4,"ngIf"],["nzHeight","100%",3,"nzVisible","nzWrapClassName","nzPlacement",4,"ngIf"],["marketDepthRow",""],["clickLiveSnap",""],["webMarketDepthTable",""],["nzSize","small"],[1,"d-flex","justify-content-between","mb-3"],[1,""],[3,"exchange","snapModel"],["nz-icon","","nzType","close",1,"pointer",3,"click"],["class","pb-2",4,"ngIf"],[1,"pb-2","mt-2"],[3,"nzSpan"],[1,"text-base","font-weight-bold","text-break"],[1,"text-xs"],[4,"ngIf"],[3,"selectedItem"],[3,"hidden"],[4,"ngFor","ngForOf"],[3,"hidden",4,"ngIf"],[1,"pb-2"],["nzType","flex","nzAlign","middle"],["nzSpan","2"],["alt","snap",2,"width","16px","height","auto",3,"src","click"],["nzSpan","22"],[1,"text-xs","font-weight-bold"],[1,"text-xxs","font-weight-light"],[1,"text-loss","font-weight-bold"],[1,"text-md"],[1,"text-xs","text-loss","font-weight-bold"],[1,"text-profit","font-weight-bold"],[1,"text-xs","text-profit","font-weight-bold"],[1,"font-weight-bold"],["class","mb-1 rank-tab mr-2 rounded-circle d-inline-flex pointer",3,"ngClass","click",4,"ngIf"],[1,"mb-1","rank-tab","mr-2","rounded-circle","d-inline-flex","pointer",3,"ngClass","click"],[1,"px-1","py-1","text-xs"],["nz-col","",3,"nzSpan"],["nz-row","","nzJustify","space-around","nzAlign","middle",4,"ngIf"],["nz-row","","nzJustify","space-around","nzAlign","middle"],[4,"ngTemplateOutlet"],[3,"ngTemplateOutlet"],["nz-row","",1,"mt-3","mb-3"],[1,"text-base","font-weight-bold"],["nz-row",""],[2,"height","250px","display","block","width","100%",3,"Highcharts","options","runOutsideAngular","ngClass","oneToOne","update","updateChange"],[3,"isDelayStream"],["nzHeight","100%",3,"nzVisible","nzWrapClassName","nzPlacement"],[1,"border-bottom","h-100"],[3,"title","back"],["class","",4,"ngIf"],[1,"fixed-bottom","bg-white","shadow","py-3","px-2","mb-1"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"click"],[1,"mb-6"],[3,"nzSelectedIndex","nzSelectedIndexChange"],[3,"nzTitle"],["nz-col","",1,"stocks-card",3,"nzSpan"],[1,"card-no-padding","stocks-pa
5dding"],[1,"mb-2",3,"nzSpan"],["nzAlign","middle","nzType","flex"],["nzSpan","12"],["class","pr-1","nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",3,"src",4,"ngIf"],[1,"text-md","font-weight-bold","text-body"],["nzSpan","12",1,"text-right"],["nzAlign","middle","nzType","flex",1,"mb-2"],["nzSpan","12",1,"text-base"],[3,"exchange"],[3,"nzTitle",4,"ngIf"],["nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",1,"pr-1",3,"src"],[1,"text-base","text-loss","font-weight-bold"],[1,"text-base","text-profit","font-weight-bold"],["nzAlign","left",3,"ngClass"],["nzAlign","center",1,"border-right-1"],[1,"text-profit","font-weight-bold",3,"ngClass"],["nzAlign","center",3,"ngClass"],["nzAlign","right",3,"ngClass"],[1,"text-center"],["nz-button","","nzOutline","","nzType","primary",1,"mt-6",3,"nzSize","nzLoading","click"],["alt","snap",2,"width","16px","height","auto",3,"src"],[1,"text-sm","m-4","mt-0"],[3,"nzData","nzFrontPagination","nzShowPagination"],["nzAlign","center","nzWidth","50%",1,"text-xs"],[3,"nzData","nzScroll","nzShowPagination"],["nzAlign","left","nzWidth","25%",1,"text-xs"],["nzAlign","center","nzWidth","25%",1,"text-xs"],["nzAlign","right","nzWidth","25%",1,"text-xs"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,Xg,23,15,"nz-card",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,ab,12,5,"nz-drawer",1),h.Ec(5,"async"),h.qc(),h.od(6,db,1,1,"ng-template",null,2,h.pd),h.od(8,ub,6,3,"ng-template",null,3,h.pd),h.od(10,bb,22,9,"ng-template",null,4,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,2,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(5,4,t.isMobile$)))},directives:[B.a,p.t,z.a,I.a,Pg.a,k.b,P.c,P.a,kg,p.s,p.q,p.A,Ag.a,Eg.a,D.a,_.a,Fg.f,Fg.b,Og.a,xt.e,ve.g,ve.d,ve.a,ve.f,ve.e,ve.c],pipes:[p.b,Ig.a,p.g],styles:[".border-right-1[_ngcontent-%COMP%]{border-right:1px solid #d3d3d3!important}.stocks-card[_ngcontent-%COMP%] .ant-card{box-shadow:0 10px 2px 8px rgba(0,0,0,.15);border-radius:0}
5.stocks-card[_ngcontent-%COMP%] .stocks-padding[_ngcontent-%COMP%]{padding:0 15px 15px}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function yb(e,t){if(1&e){const e=h.sc();h.rc(0,"div",19),h.rc(1,"nz-row",20),h.rc(2,"nz-col",21),h.rc(3,"img",22),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.snapSelectedData(t.selectedItem)})),h.qc(),h.qc(),h.rc(4,"nz-col",23),h.rc(5,"nz-row",24),h.qd(6),h.qc(),h.rc(7,"nz-row",25),h.qd(8,"Press the snap button to get latest data"),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(3),h.Mc("src","assets/images/stocks/snap.svg",h.gd),h.Ub(3),h.sd("Live Snap: ",e.hkexSnapCount,"")}}function vb(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",26),h.rc(2,"span",9),h.qd(3),h.qc(),h.rc(4,"span",27),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",28),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.sd(" ",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.sd(" ",h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)," "),h.Ub(3),h.td(" ",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(10,11,null==e.subscribedStock?null:e.subscribedStock.changePercentage,"1.3-3"),"%) ")}}function Mb(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",29),h.rc(2,"span",9),h.qd(3),h.qc(),h.rc(4,"span",27),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",30),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.sd(" ",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.sd(" ",h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)," "),h.Ub(3),h.td(" +",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (+",h.Gc(10,11,null==e.subscribedStock?null:e.subscribedStock.changePercentage,"1.3-3"),"%) ")}}function Cb(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",31),h.rc(2,"span",9),h.qd(3),h.qc(),h.rc(4,"span",27),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",24),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.sd(" ",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.sd(" ",h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)," "),h.Ub(3),h.td(" ",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(10,11,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%) ")}}const qb=function(e,t,n,i){return{"bg-theme":e,"text-white":t,"bg-lighter":n,"mb-2":i}};function Tb(e,t){if(1&e){const e=h.sc();h.rc(0,"div",33),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().onChangeOption(t.value)})),h.Ec(1,"async"),h.rc(2,"span",34),h.qd(3),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc();h.Mc("ngClass",h.Vc(4,qb,e.active,e.active,!e.active,!h.Fc(1,2,t.isMobile$))),h.Ub(3),h.sd(" ",e.label," ")}}function wb(e,t){if(1&e&&(h.pc(0),h.od(1,Tb,4,9,"div",32),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf",e.show)}}function zb(e,t){1&e&&(h.rc(0,"td",43),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("X"))}function Db(e,t){1&e&&(h.rc(0,"td",44),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("B"))}function Pb(e,t){1&e&&(h.rc(0,"td",45),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("S"))}function Ib(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.rd(h.Gc(2,1,null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.exchange))}}function kb(e,t){if(1&e&&(h.rc(0,"span",47),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.rd(h.Gc(2,1,null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.exchange))}}function Ab(e,t){if(1&e&&(h.rc(0,"span",9),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.rd(h.Gc(2,1,null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.exchange))}}function Eb(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.sd("+",h.Hc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.closePrice),null==t.selectedItem?null:t.selectedItem.exchange,null==e?null:e.price),"")}}function Fb(e,t){if(1&e&&(h.rc(0,"span",47),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.rd(h.Hc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.closePrice),null==t.selectedItem?null:t.selectedItem.exchange,null==e?null:e.price))}}function Ob(e,t){if(1&e&&(h.rc(0,"span",9),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.rd(h.Hc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.closePrice),null==t.selectedItem?null:t.selectedItem.exchange,null==e?null:e.price))}}function Ub(e,t){if(1&e&&(h.rc(0,"tr"),h.od(1,zb,2,1,"td",37),h.od(2,Db,2,1,"td",38),h.od(3,Pb,2,1,"td",39),h.rc(4,"td",9),h.qd(5),h.qc(),h.rc(6,"td"),h.od(7,Ib,3,4,"span",40),h.od(8,kb,3,4,"span",41),h.od(9,Ab,3,4,"span",42),h.qc(),h.rc(10,"td",9),h.od(11,Eb,3,5,"span",40),h.od(12,Fb,3,5,"span",41),h.od(13,Ob,3,5,"span",42),h.qc(),h.rc(14,"td",9),h.qd(15),h.Ec(16,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngIf","2"==(null==e?null:e.side)||"X"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","1"==(null==e?null:e.side)||"Buy"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","0"==(null==e?null:e.side)||"Sell"===(null==e?null:e.side)),h.Ub(2),h.rd(null==e?null:e.tradeTime),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)),h.Ub(2),h.sd(" ",h.Fc(16,11,null==e?null:e.size)," ")}}const xb=function(){return{x:"228px",y:"400px"}};
5function Lb(e,t){if(1&e&&(h.rc(0,"nz-table",35,36),h.rc(2,"thead"),h.rc(3,"tr"),h.mc(4,"th"),h.rc(5,"th",9),h.qd(6,"Time"),h.qc(),h.rc(7,"th",9),h.qd(8,"Price"),h.qc(),h.rc(9,"th",9),h.qd(10,"Chg"),h.qc(),h.rc(11,"th",9),h.qd(12,"Size"),h.qc(),h.qc(),h.qc(),h.rc(13,"tbody"),h.od(14,Ub,17,13,"tr",13),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzData",t.getTimeAndSales())("nzPageSize",t.timeAndSales.length)("nzShowPagination",!1)("nzScroll",h.Rc(5,xb)),h.Ub(14),h.Mc("ngForOf",e.data)}}function Rb(e,t){1&e&&(h.rc(0,"nz-row",48),h.rc(1,"span",49),h.qd(2,"X: Off-market Transaction"),h.qc(),h.qc())}function Nb(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-tab",62),h.zc("nzClick",(function(){return h.dd(e),h.Dc(3).showMobileMarketDepth()})),h.qc()}2&e&&h.Mc("nzTitle","Market Depth")}function Bb(e,t){1&e&&h.nc(0)}function _b(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-tab",62),h.zc("nzClick",(function(){return h.dd(e),h.Dc(3).showMobileTradeDetails()})),h.qc()}2&e&&h.Mc("nzTitle","Summary")}function Vb(e,t){if(1&e&&(h.rc(0,"nz-tabset",58),h.od(1,Nb,1,1,"nz-tab",59),h.rc(2,"nz-tab",60),h.od(3,Bb,1,0,"ng-container",61),h.qc(),h.od(4,_b,1,1,"nz-tab",59),h.qc()),2&e){const e=h.Dc(2),t=h.ad(28);h.Mc("nzSelectedIndex",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SGX||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SZSE?0:1),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.HKEX),h.Ub(1),h.Mc("nzTitle","Time & Sales"),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SGX||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SZSE)}}function Hb(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",50),h.rc(1,"div",51),h.rc(2,"b2c-app-bar-2",52),h.zc("back",(function(){return h.dd(e),h.Dc().handleMobileVisible()})),h.qc(),h.qc(),h.od(3,Vb,5,5,"nz-tabset",53),h.rc(4,"div",54),h.rc(5,"nz-row"),h.rc(6,"button",55),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.navigateToStocksFactsheet(null==t.selectedItem?null:t.selectedItem.stockName,null==t.selectedItem?null:t.selectedItem.exchange,null==t.selectedItem?null:t.selectedItem.stockCode)})),h.qd(7,"View Stocks Factsheet "),h.qc(),h.qc(),h.rc(8,"nz-row"),h.rc(9,"button",56),h.zc("click",(function(){return h.dd(e),h.Dc().tradeNow()})),h.qd(10,"Trade Now"),h.qc(),h.qc(),h.mc(11,"nz-row",57),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",!0)("nzWrapClassName","mobile-drawer-no-padding")("nzPlacement","top"),h.Ub(2),h.Mc("title","Stock Information"),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SGX||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.HKEX||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SZSE)}}function $b(e,t){if(1&e&&h.mc(0,"img",79),2&e){const e=h.Dc(2);h.Mc("src",e.SHARIAH_COMPLAINT_IMG_PATH+"shariah-stock.svg",h.gd)}}function jb(e,t){if(1&e){const e=h.sc();h.pc(0,80),h.rc(1,"img",81),h.zc("click",(function(){h.dd(e);const t=h.Dc(2);return t.snapSelectedData(t.selectedItem)})),h.qc(),h.oc()}2&e&&(h.Ub(1),h.Mc("src","assets/images/stocks/snap.svg",h.gd))}function Gb(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",82),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.td(" ",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function Wb(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",83),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.td(" +",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (+",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function Yb(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",84),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.td(" ",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function Kb(e,t){1&e&&(h.rc(0,"td",93),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("X"))}function Xb(e,t){1&e&&(h.rc(0,"td",94),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("B"))}function Qb(e,t){1&e&&(h.rc(0,"td",95),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("S"))}
5function Zb(e,t){if(1&e&&(h.rc(0,"span",96),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Gc(2,1,null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.exchange))}}function Jb(e,t){if(1&e&&(h.rc(0,"span",97),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Gc(2,1,null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.exchange))}}function eS(e,t){if(1&e&&(h.rc(0,"span",86),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Gc(2,1,null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.exchange))}}function tS(e,t){if(1&e&&(h.rc(0,"span",96),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.sd("+",h.Hc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.closePrice),null==t.selectedItem?null:t.selectedItem.exchange,null==e?null:e.price),"")}}function nS(e,t){if(1&e&&(h.rc(0,"span",97),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Hc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.closePrice),null==t.selectedItem?null:t.selectedItem.exchange,null==e?null:e.price))}}function iS(e,t){if(1&e&&(h.rc(0,"span",86),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Hc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedItem?null:t.selectedItem.closePrice),null==t.selectedItem?null:t.selectedItem.exchange,null==e?null:e.price))}}function cS(e,t){if(1&e&&(h.rc(0,"tr"),h.od(1,Kb,2,1,"td",87),h.od(2,Xb,2,1,"td",88),h.od(3,Qb,2,1,"td",89),h.rc(4,"td",86),h.qd(5),h.qc(),h.rc(6,"td"),h.od(7,Zb,3,4,"span",90),h.od(8,Jb,3,4,"span",91),h.od(9,eS,3,4,"span",92),h.qc(),h.rc(10,"td",86),h.od(11,tS,3,5,"span",90),h.od(12,nS,3,5,"span",91),h.od(13,iS,3,5,"span",92),h.qc(),h.rc(14,"td",86),h.qd(15),h.Ec(16,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(1),h.Mc("ngIf","2"==(null==e?null:e.side)||"X"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","1"==(null==e?null:e.side)||"Buy"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","0"==(null==e?null:e.side)||"Sell"===(null==e?null:e.side)),h.Ub(2),h.rd(null==e?null:e.tradeTime),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.closePrice)),h.Ub(2),h.sd(" ",h.Fc(16,11,null==e?null:e.size)," ")}}function oS(e,t){if(1&e&&(h.rc(0,"nz-table",85,36),h.rc(2,"thead"),h.rc(3,"tr"),h.mc(4,"th"),h.rc(5,"th",86),h.qd(6,"Time"),h.qc(),h.rc(7,"th",86),h.qd(8,"Price"),h.qc(),h.rc(9,"th",86),h.qd(10,"Chg"),h.qc(),h.rc(11,"th",86),h.qd(12,"Size"),h.qc(),h.qc(),h.qc(),h.rc(13,"tbody"),h.od(14,cS,17,13,"tr",13),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc(2);h.Mc("nzShowPagination",t.timeAndSales.length>10)("nzData",t.timeAndSales),h.Ub(14),h.Mc("ngForOf",e.data)}}function sS(e,t){1&e&&(h.rc(0,"nz-row",98),h.rc(1,"span",99),h.qd(2,"X: Off-market Transaction"),h.qc(),h.qc())}function aS(e,t){if(1&e&&(h.rc(0,"div",63),h.rc(1,"nz-card",64),h.rc(2,"nz-row"),h.rc(3,"nz-col",65),h.mc(4,"app-stocks-streaming-indicator",3),h.qc(),h.qc(),h.rc(5,"nz-row"),h.rc(6,"nz-row",66),h.rc(7,"nz-col",67),h.rc(8,"span"),h.od(9,$b,1,1,"img",68),h.qc(),h.rc(10,"span",69),h.qd(11),h.qc(),h.qc(),h.rc(12,"nz-col",70),h.rc(13,"nz-row"),h.rc(14,"span",71),h.qd(15),h.Ec(16,"stockPrice"),h.qc(),h.od(17,jb,2,1,"ng-container",72),h.qc(),h.qc(),h.qc(),h.rc(18,"nz-row",66),h.rc(19,"nz-col",73),h.rc(20,"span"),h.mc(21,"app-stock-exchange-tag",74),h.qd(22),h.qc(),h.qc(),h.rc(23,"nz-col",70),h.od(24,Gb,5,9,"div",10),h.od(25,Wb,5,9,"div",10),h.od(26,Yb,5,9,"div",10),h.qc(),h.qc(),h.qc(),h.rc(27,"nz-row",75),h.mc(28,"app-stocks-detail-header",11),h.qc(),h.qc(),h.rc(29,"nz-card"),h.od(30,oS,15,3,"nz-table",76),h.rc(31,"div"),h.od(32,sS,3,0,"nz-row",77),h.mc(33,"nz-row",78),h.mc(34,"nz-row",78),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();
5h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("exchange",null==e.selectedItem?null:e.selectedItem.exchange)("snapModel",e.selectedItem),h.Ub(5),h.Mc("ngIf",e.shariahFlag),h.Ub(2),h.rd(null==e.selectedItem?null:e.selectedItem.stockName),h.Ub(4),h.rd(h.Gc(16,15,e.selectedItem.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)),h.Ub(2),h.Mc("ngIf","HKEX"===(null==e.selectedItem?null:e.selectedItem.exchange)&&!e.isHkexLivestreaming),h.Ub(4),h.Mc("exchange",null==e.selectedItem?null:e.selectedItem.exchange),h.Ub(1),h.sd(" ",null==e.selectedItem?null:e.selectedItem.stockCode,""),h.Ub(2),h.Mc("ngIf",e.selectedItem&&e.selectedItem.change<0),h.Ub(1),h.Mc("ngIf",e.selectedItem&&e.selectedItem.change>0),h.Ub(1),h.Mc("ngIf",e.selectedItem&&0===e.selectedItem.change),h.Ub(2),h.Mc("selectedItem",e.selectedItem),h.Ub(2),h.Mc("ngIf",e.timeAndSales.length>=1),h.Ub(2),h.Mc("ngIf",e.hasXTrade)}}let lS=(()=>{class e{constructor(e,t,n,i){this.uiTableService=e,this.lightStreamerHelperService=t,this.liveFeedService=n,this.stocksInfoRestService=i,this.selectMarketDepthEmitter=new h.s,this.selectTradeDetailEmitter=new h.s,this.closeEmitter=new h.s,this.mobileShowMarketDepth=new h.s,this.mobileShowTradeDetails=new h.s,this.refreshHkexSnapCount=new h.s,this.mobileBack=new h.s,this.TIME_AND_SALES_FIELDS=["symbol","exchange","stockCode","level","tradeTime","size","price","side","lastBid","lastAsk","seq"],this.tempSubPriceQuote=[],this.subscribedStock={},this.stockConstant=M.q,this.PRICE_QUOTE_FIELDS=["symbol","exchange","stockCode","stockName","currency","lastPrice","cumulativeVolume","bidPrice","bidQuantity","askPrice","askQuantity","openPrice","closePrice","dayHigh","dayLow","change","changePercentage","tradingStatus"],this.options=[{label:"Market Depth",value:"md",active:!1,show:!0},{label:"Time & Sales",value:"ts",active:!0,show:!0},{label:"Summary",value:"td",active:!1,show:!0}],this.hasXTrade=!1,this.SHARIAH_COMPLAINT_IMG_PATH=M.g.STOCKS_IMG_PATH,this.shariahFlag=!1,this.timeAndSales=[],this.timeAndSalesSub=[],this.isHkexLivestreaming=!1,this.isSGXLiveStreaming=!1}ngOnInit(){this.isHkexLivestreaming=this.liveFeedService.checkStreaming(M.q.HKEX),this.isSGXLiveStreaming=this.liveFeedService.checkStreaming(M.q.SGX),this.selectedItem&&(this.options=Object(Tg.c)(this.options,this.selectedItem,this.isSGXLiveStreaming,this.isHkexLivestreaming,this.liveFeedService.checkLiveStreamingMarketDepth(this.selectedItem.exchange)))}ngOnChanges(e){e&&e.selectedItem&&(this.handleTimeAndSales(this.selectedItem),this.subscribeLSPriceQuote(e.selectedItem.currentValue),e.selectedItem.currentValue.exchange!==M.q.HKEX||this.isHkexLivestreaming||(this.patchFromExistingSnap(),this.listenToSnapChange())),e&&this.selectedItem&&(this.options=Object(Tg.c)(this.options,this.selectedItem,this.isSGXLiveStreaming,this.isHkexLivestreaming,this.liveFeedService.checkLiveStreamingMarketDepth(this.selectedItem.exchange)))}patchFromExistingSnap(e=this.selectedItem.symbol){let t=this.liveFeedService.getSnapStocks(e);return t&&t.endSnapDate>(new Date).getTime()?(this.selectedItem=Object(g.a)(t),this.timeAndSales=this.selectedItem.timeAndSale,this.timeAndSales=this.sortTimeAndSales(this.timeAndSales),this.hasXTrade=this.checkHasXTrade(),this.subscribedStock=Object.assign({},this.selectedItem),!1):(t&&t.endSnapDate<=(new Date).getTime()&&this.liveFeedService.removeSnapStock(e),!0)}listenToSnapChange(){this.liveFeedService.getSnapStocksObservable().subscribe(e=>{if(e&&0!=e.size){let t=e.get(this.selectedItem.symbol);t&&t.endSnapDate>(new Date).getTime()&&(this.selectedItem=Object(g.a)(t),this.timeAndSales=this.selectedItem.timeAndSale,this.timeAndSales=this.sortTimeAndSales(this.timeAndSales),this.hasXTrade=this.checkHasXTrade(),this.subscribedStock=Object.assign({},this.selectedItem)),t&&t.endSnapDate<=(new Date).getTime()&&this.liveFeedService.removeSnapStock(this.selectedItem.symbol)}})}snapSelectedData(e){let t=this.liveFeedService.constructMessage(wg.a.PRICE,this.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20",n=new lm.a(n=>{this.liveFeedService.subscribeSnap(this.lsClient,t,n,e.exchange)}).subscribe(t=>
5{if(n.unsubscribe(),!t)return;const i=JSON.parse(t.updateValues[3]);i[e.symbol]&&(this.selectedItem=Object(g.a)(i[e.symbol]),this.selectedItem.lastSnapDate=this.selectedItem.updateTime,this.selectedItem.endSnapDate=Number(this.selectedItem.updateTime)+9e5,this.liveFeedService.storeSnapStocks(this.selectedItem.symbol,this.selectedItem),this.refreshHkexSnapCount.emit())})}ngOnDestroy(){this.unsubscribeTimeAndSales()}unsubscribeLightStreamerClient(){this.tempSubPriceQuote.length>0&&(this.tempSubPriceQuote.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubPriceQuote=[],this.subscribedStock={})}subscribeLSPriceQuote(e){this.unsubscribeLightStreamerClient(),e.sedolnumber=M.q.KLSE+":"+e.stockCode,e.securityType="COMMON_STOCK",this.tempSubPriceQuote=this.liveFeedService.subscribePriceQuote(this.lsClient,this.PRICE_QUOTE_FIELDS,[e]),this.tempSubPriceQuote.forEach(e=>{e&&e.addListener({onItemUpdate:e=>{this.patchFromExistingSnap(e.updateValues[2])&&(this.subscribedStock.lastPrice=parseFloat(e.updateValues[7]),this.subscribedStock.change=parseFloat(e.updateValues[17]),this.subscribedStock.changePercentage=parseFloat(e.updateValues[18]))}})})}unsubscribeTimeAndSales(){this.timeAndSalesSub.length>0&&(this.lsClient.unsubscribe(this.timeAndSalesSub),this.timeAndSalesSub=null)}handleTimeAndSales(e){this.timeAndSales=[],this.setShariahFlag(e.stockCode,e.exchange===M.q.BURSA?M.q.KLSE:e.exchange),this.selectedItem=e,e.exchange!=M.q.BURSA&&e.exchange!=M.q.KLSE&&e.exchange!=M.q.SGX&&e.exchange!=M.q.HKEX&&this.selectedItem.exchange!==M.q.SSE&&this.selectedItem.exchange!==M.q.SZSE&&this.selectedItem.exchange!==M.q.LSE||(this.timeAndSalesSub=this.liveFeedService.subscribeTimeAndSales(this.lsClient,this.TIME_AND_SALES_FIELDS,e),this.timeAndSalesSub.addListener({onItemUpdate:t=>{this.patchFromExistingSnap(t.updateValues[2])&&(e.exchange!==M.q.HKEX||this.isHkexLivestreaming||this.timeAndSales.length>=4&&this.timeAndSales.pop(),this.timeAndSales.push(this.lightStreamerHelperService.mapTimeAndSalesInfo(t,this.TIME_AND_SALES_FIELDS)),this.timeAndSales=this.sortTimeAndSales(this.timeAndSales),this.hasXTrade=this.checkHasXTrade())}}))}checkHasXTrade(){return this.timeAndSales.some(e=>"2"===(null==e?void 0:e.side)||"X"===(null==e?void 0:e.side))}getTimeAndSales(){return this.selectedItem.endSnapDate&&this.selectedItem.endSnapDate<(new Date).getTime()?this.timeAndSales.slice(0,4):this.timeAndSales}setShariahFlag(e,t){this.shariahFlag=!1,this.stocksInfoRestService.getStockTickerInfoDetails(e,t).subscribe(e=>{var t;M.a.RESPONSE_SUCCESS===e.status&&e.data&&e.data.length>0&&"Y"===(null===(t=e.data[0])||void 0===t?void 0:t.shariahCompliantIndicator)&&(this.shariahFlag=!0)})}sortTimeAndSales(e){let t=[];e=this.uiTableService.sort({key:"tradeTime",value:"descend"},e);for(let n=0;n<100&&n<e.length;n++)t.push(e[n]);return t}getTimeAndSalesChgPrice(e,t){return parseFloat(e)-parseFloat(t)}close(){this.closeEmitter.emit()}tradeNow(){this.mobileBack.emit(this.selectedItem)}handleMobileVisible(){this.mobileBack.emit("value")}showMobileMarketDepth(){this.mobileShowMarketDepth.emit()}showMobileTradeDetails(){this.mobileShowTradeDetails.emit()}navigateToStocksFactsheet(e,t,n){let i;t===M.q.BURSA&&(t=M.q.KLSE),this.stocksInfoRestService.getTickerInfoByExchangeAndStockCode(t,n).subscribe(c=>{c.status===M.a.RESPONSE_SUCCESS&&c.data&&(i="ETF"==c.data.productType?Object(mt.f)(r.b.ETF,n,"",e,t):Object(mt.f)(r.b.STOCK_AND_ETF,n,"",e,t),Object(pt.a)(i.route,i.params))})}onChangeOption(e){e===this.options[0].value&&this.selectMarketDepthEmitter.emit(this.selectedItem),e===this.options[2].value&&this.selectTradeDetailEmitter.emit(this.selectedItem)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(Cg.e),h.lc(qg.a),h.lc(hm.a),h.lc(Dg.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-time-and-sales"]],inputs:{selectedItem:"selectedItem",lsClient:"lsClient",stockLiveFeeHideScroll:"stockLiveFeeHideScroll",hkexSnapCount:"hkexSnapCount"},outputs:{selectMarketDepthEmitter:"selectMarketDepthEmitter",selectTradeDetailEmitter:"selectTradeDetailEmitter",closeEmitter:"closeEmitter",mobileShowMarketDepth:"mobileShowMarketDepth",mobileShowTradeDetails:"mobileShowTradeDetails",refreshHkexSnapCount:"refreshHkexSnapCount",mobileBack:"mobileBack"},features:[h.Tb([l.a,qg.a,Cg.e]),h.Sb],decls:29,vars:19,consts:[["nzSize","small"],[1,"d-flex","justify-content-between","mb-3"],[1,""],[3,"exchange","snapModel"],["nz-icon","","nzType","close",1,"pointer",3,"click"],["class","pb-2",4,"ngIf"],[1,"pb-2","mt-2"],[3,"nzSpan"],[1,"text-base","font-weight-bold","text-break"],[1,"text-xs"],[4,"ngIf"],[3,"selectedItem"],[3,"hidden"],[4,"ngFor","ngForOf"],[1,"pb-2",3,"hidden"],[3,"nzData","nzPageSize","nzShowPagination","nzScroll",4,"ngIf"],["class","d-flex flex-column mt-3 ml-2","nzType","flex","nzJustify","start",4,"ngIf"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement",4,"ngIf"],["stocktimesales",""],[1,"pb-2"],["nzType","flex","nzAlign","middle"],["nzSpan","2"],["alt","snap",2,"width","16px","height","auto",3,"src","click"],["nzSpan","22"],[1,"text-xs","font-weight-bold"],[1,"text-xxs","font-weight-light"],[1,"text-loss","font-weight-bold"],[1,"text-md"],[1,"text-xs","text-loss","font-weight-bold"],[1,"text-profit","font-weight-bold"],[1,"text-xs","text-profit","font-weight-bold"],[1,"font-weight-bold"],["class","mb-1 rank-tab mr-2 rounded-circle d-inline-flex pointer",3,"ngClass","click",4,"ngIf"],[1,"mb-1","rank-tab","mr-2","rounded-circle","d-inline-flex","pointer",3,"ngClass","click"],[1,"px-1","py-1","text-xs"],[3,"nzData","nzPageSize","nzShowPagination","nzScroll"],["timeAndSalesTable",""],["class","font-weight-bold text-black text-center text-xs",4,"ngIf"],["class","bg-profit font-weight-bold text-white text-center text-xs",4,"ngIf"],["class","bg-loss font-weight-bold text-white text-center text-xs",4,"ngIf"],["class","text-profit text-xs",4,"ngIf"],["class","text-loss text-xs",4,"ngIf"],["class","text-xs",4,"ngIf"],[1,"font-weight-bold","text-black","text-center","text-xs"],[1,"bg-profit","font-weight-bold","text-white","text-center","text-xs"],[1,"bg-loss","font-weight-bold","text-white","text-center","text-xs"],[1,"text-profit","text-xs"],[1,"text-loss","text-xs"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","mt-3","ml-2"],[1,"text-xs","font-weight-bold","pb-2"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement"],[1,"border-bottom"],[3,"title","back"],[3,"nzSelectedIndex",4,"ngIf"],[1,"fixed-bottom","bg-white","shadow","py-3","px-2","mb-1"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"click"],[1,"mb-6"],[3,"nzSelectedIndex"],[3,"nzTitle","nzClick",4,"ngIf"],[3,"nzTitle"],[4,"ngTemplateOutlet"],[3,"nzTitle","nzClick"],[1,"stocks-card"],[1,"card-no-padding","stocks-pa
5dding"],[1,"mb-2",3,"nzSpan"],["nzAlign","middle","nzType","flex"],["nzSpan","12"],["class","pr-1","nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",3,"src",4,"ngIf"],[1,"text-md","font-weight-bold","text-body"],["nzSpan","12",1,"text-right"],["nz-col","",1,"text-base","font-weight-bold"],["nz-col","",4,"ngIf"],["nzSpan","12",1,"text-base"],[3,"exchange"],[1,"mt-2"],[3,"nzShowPagination","nzData",4,"ngIf"],["class","d-flex flex-column my-3 ml-2","nzType","flex","nzJustify","start",4,"ngIf"],[1,"my-6"],["nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",1,"pr-1",3,"src"],["nz-col",""],["alt","snap",1,"pointer","snap-icon",3,"src","click"],[1,"text-base","text-loss","font-weight-bold"],[1,"text-base","text-profit","font-weight-bold"],[1,"text-base","font-weight-bold"],[3,"nzShowPagination","nzData"],[1,"text-sm"],["class","font-weight-bold text-black text-center text-sm",4,"ngIf"],["class","bg-profit font-weight-bold text-white text-center text-sm",4,"ngIf"],["class","bg-loss font-weight-bold text-white text-center text-sm",4,"ngIf"],["class","text-profit text-sm",4,"ngIf"],["class","text-loss text-sm",4,"ngIf"],["class","text-sm",4,"ngIf"],[1,"font-weight-bold","text-black","text-center","text-sm"],[1,"bg-profit","font-weight-bold","text-white","text-center","text-sm"],[1,"bg-loss","font-weight-bold","text-white","text-center","text-sm"],[1,"text-profit","text-sm"],[1,"text-loss","text-sm"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","my-3","ml-2"],[1,"text-base","font-weight-bold","pb-2"]],template:function(e,t){1&e&&(h.rc(0,"nz-card",0),h.rc(1,"div",1),h.rc(2,"div",2),h.mc(3,"app-stocks-streaming-indicator",3),h.qc(),h.rc(4,"div",2),h.rc(5,"i",4),h.zc("click",(function(){return t.close()})),h.qc(),h.qc(),h.qc(),h.od(6,yb,9,2,"div",5),h.rc(7,"nz-row",6),h.rc(8,"nz-col",7),h.rc(9,"span",8),h.qd(10),h.qc(),h.rc(11,"span",9),h.qd(12),h.qc(),h.mc(13,"br"),h.od(14,vb,11,14,"div",10),h.od(15,Mb,11,14,"div",10),h.od(16,Cb,11,14,"div",10),h.qc(),h.rc(17,"nz-col",7),h.mc(18,"app-stocks-detail-header",11),h.qc(),h.qc(),h.rc(19,"nz-row",12),h.od(20,wb,2,1,"ng-container",13),h.qc(),h.rc(21,"nz-row",14),h.od(22,Lb,15,6,"nz-table",15),h.od(23,Rb,3,0,"nz-row",16),h.qc(),h.qc(),h.rc(24,"app-mobile-scaffold"),h.od(25,Hb,12,5,"nz-drawer",17),h.Ec(26,"async"),h.od(27,aS,35,18,"ng-template",null,18,h.pd),h.qc()),2&e&&(h.Ub(3),h.Mc("exchange",null==t.selectedItem?null:t.selectedItem.exchange)("snapModel",t.selectedItem),h.Ub(3),h.Mc("ngIf",t.selectedItem.exchange===t.stockConstant.HKEX&&!t.isHkexLivestreaming),h.Ub(2),h.Mc("nzSpan",12),h.Ub(2),h.sd("",null==t.selectedItem?null:t.selectedItem.stockName," "),h.Ub(2),h.sd(" (",null==t.selectedItem?null:t.selectedItem.stockCode,")"),h.Ub(2),h.Mc("ngIf",t.subscribedStock&&(null==t.subscribedStock?null:t.subscribedStock.change)<0),h.Ub(1),h.Mc("ngIf",t.subscribedStock&&(null==t.subscribedStock?null:t.subscribedStock.change)>0),h.Ub(1),h.Mc("ngIf",t.subscribedStock&&0==(null==t.subscribedStock?null:t.subscribedStock.change)),h.Ub(1),h.Mc("nzSpan",12),h.Ub(1),h.Mc("selectedItem",t.selectedItem),h.Ub(1),h.Mc("hidden",t.stockLiveFeeHideScroll),h.Ub(1),h.Mc("ngForOf",t.options),h.Ub(1),h.Mc("hidden",t.stockLiveFeeHideScroll),h.Ub(1),h.Mc("ngIf",t.timeAndSales.length>=1),h.Ub(1),h.Mc("ngIf",t.hasXTrade),h.Ub(2),h.Mc("ngIf",h.Fc(26,17,t.isMobile$)))},directives:[I.a,Pg.a,k.b,p.t,P.c,P.a,kg,p.s,z.a,p.q,ve.a,ve.f,ve.g,ve.e,ve.c,ve.d,Eg.a,D.a,_.a,Fg.f,Fg.b,p.A,Og.a,xt.e],pipes:[p.b,Ig.a,p.g],styles:[".ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-profit[_ngcontent-%COMP%]{background-color:#093!important}.ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-loss[_ngcontent-%COMP%]{background-color:#ff333a!important}.ant-btn.outline[_ngcontent-%COMP%], .ant-btn[nzOutline].delay-button[_ngcontent-%COMP%]{border-color:#ff333a!important;color:#ff333a!important}.stocks-card[_ngcontent-%COMP%] .ant-card{box-shadow:0 10px 2px 8px rgba(0,0,0,.15);border-radius:0}
5.stocks-card[_ngcontent-%COMP%] .stocks-padding[_ngcontent-%COMP%]{padding:0 15px 15px}.snap-icon[_ngcontent-%COMP%]{vertical-align:top;margin:2px}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function rS(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",21),h.rc(2,"span",7),h.qd(3),h.qc(),h.rc(4,"span",22),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",23),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.sd(" ",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.sd(" ",h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)," "),h.Ub(3),h.td(" ",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(10,11,null==e.subscribedStock?null:e.subscribedStock.changePercentage,"1.3-3"),"%) ")}}function dS(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",24),h.rc(2,"span",7),h.qd(3),h.qc(),h.rc(4,"span",22),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",25),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.sd(" ",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.sd(" ",h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)," "),h.Ub(3),h.td(" +",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (+",h.Gc(10,11,null==e.subscribedStock?null:e.subscribedStock.changePercentage,"1.3-3"),"%) ")}}function uS(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",26),h.rc(2,"span",7),h.qd(3),h.qc(),h.rc(4,"span",22),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.qc(),h.rc(7,"div",27),h.qd(8),h.Ec(9,"stockPrice"),h.Ec(10,"number"),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.sd(" ",null==e.selectedItem?null:e.selectedItem.currency," "),h.Ub(2),h.sd(" ",h.Gc(6,4,null==e.subscribedStock?null:e.subscribedStock.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)," "),h.Ub(3),h.td(" ",h.Hc(9,7,null==e.subscribedStock?null:e.subscribedStock.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(10,11,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%) ")}}const hS=function(e,t,n,i){return{"bg-theme":e,"text-white":t,"bg-lighter":n,"mb-2":i}};function pS(e,t){if(1&e){const e=h.sc();h.rc(0,"div",29),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().onChangeOption(t.value)})),h.Ec(1,"async"),h.rc(2,"span",30),h.qd(3),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc();h.Mc("ngClass",h.Vc(4,hS,e.active,e.active,!e.active,!h.Fc(1,2,t.isMobile$))),h.Ub(3),h.sd(" ",e.label," ")}}function mS(e,t){if(1&e&&(h.pc(0),h.od(1,pS,4,9,"div",28),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf",e.show)}}function fS(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",7),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"td"),h.rc(5,"span",7),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",7),h.rc(8,"span",7),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",7),h.qd(11),h.qc(),h.rc(12,"td",33),h.qd(13),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(2),h.rd(h.Gc(3,5,null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.exchange)),h.Ub(4),h.rd(null==e?null:e.buyCount),h.Ub(3),h.rd(null==e?null:e.sellCount),h.Ub(2),h.sd(" ",null==e?null:e.unknownCount," "),h.Ub(2),h.sd(" ",n.countTotal(null==e?null:e.unknownCount,null==e?null:e.buyCount,null==e?null:e.sellCount)," ")}}const gS=function(){return{x:"228px"}};function bS(e,t){if(1&e&&(h.rc(0,"nz-table",31,32),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",7),h.qd(5,"Price"),h.qc(),h.rc(6,"th",7),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",7),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",7),h.qd(11,"X"),h.qc(),h.rc(12,"th",33),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,fS,14,8,"tr",11),h.rc(16,"tr"),h.rc(17,"td",34),h.qd(18,"Total"),h.qc(),h.rc(19,"td",34),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",34),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",34),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",35),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzShowPagination",!1)("nzScroll",h.Rc(21,gS))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyCount,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellCount,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownCount,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalCount,"1.0")," ")}}function SS(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",7),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"td"),h.rc(5,"span",7),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",7),h.rc(8,"span",7),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",7),h.qd(11),h.qc(),h.rc(12,"td",33),h.qd(13),h.Ec(14,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(2),h.rd(h.Gc(3,5,null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.exchange)),h.Ub(4),h.rd(null==e?null:e.buyVolume),h.Ub(3),h.rd(null==e?null:e.sellVolume),h.Ub(2),h.sd(" ",null==e?null:e.unknownVolume," "),h.Ub(2),h.sd(" ",h.Gc(14,8,n.countTotal(null==e?null:e.unknownVolume,null==e?null:e.buyVolume,null==e?null:e.sellVolume),"1.0")," ")}}function yS(e,t){if(1&e&&(h.rc(0,"nz-table",31,32),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",7),h.qd(5,"Price"),h.qc(),h.rc(6,"th",7),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",7),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",7),h.qd(11,"X"),h.qc(),h.rc(12,"th",33),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,SS,15,11,"tr",11),h.rc(16,"tr"),h.rc(17,"td",34),h.qd(18,"Total"),h.qc(),h.rc(19,"td",34),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",34),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",34),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",35),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzShowPagination",!1)("nzScroll",h.Rc(21,gS))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyVol,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellVol,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownVol,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalVol,"1.0")," ")}}function vS(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-tab",46),h.zc("nzClick",(function(){return h.dd(e),h.Dc(2).showMobileMarketDepth()})),h.qc()}2&e&&h.Mc("nzTitle","Market Depth")}function MS(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-tab",46),h.zc("nzClick",(function(){return h.dd(e),h.Dc(2).showMobileTimeAndSales()})),h.qc()}2&e&&h.Mc("nzTitle","Time & Sales")}function CS(e,t){if(1&e&&h.mc(0,"img",63),2&e){const e=h.Dc(3);h.Mc("src",e.SHARIAH_COMPLAINT_IMG_PATH+"shariah-stock.svg",h.gd)}}function qS(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",64),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.td(" ",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function TS(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",65),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.td(" +",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (+",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function wS(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",56),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.td(" ",h.Hc(3,2,e.selectedItem.change,null==e.selectedItem?null:e.selectedItem.exchange,null==e.subscribedStock?null:e.subscribedStock.lastPrice)," (",h.Gc(4,6,null==e.selectedItem?null:e.selectedItem.changePercentage,"1.3-3"),"%)")}}function zS(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",66),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"td"),h.rc(5,"span",66),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",66),h.rc(8,"span",66),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",66),h.qd(11),h.qc(),h.rc(12,"td",67),h.qd(13),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(4);h.Ub(2),h.rd(h.Gc(3,5,null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.exchange)),h.Ub(4),h.rd(null==e?null:e.buyCount),h.Ub(3),h.rd(null==e?null:e.sellCount),h.Ub(2),h.sd(" ",null==e?null:e.unknownCount," "),h.Ub(2),h.sd(" ",n.countTotal(null==e?null:e.unknownCount,null==e?null:e.buyCount,null==e?null:e.sellCount)," ")}}function DS(e,t){if(1&e&&(h.rc(0,"nz-table",31,32),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",66),h.qd(5,"Price"),h.qc(),h.rc(6,"th",66),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",66),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",66),h.qd(11,"X"),h.qc(),h.rc(12,"th",67),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,zS,14,8,"tr",11),h.rc(16,"tr"),h.rc(17,"td",68),h.qd(18,"Total"),h.qc(),h.rc(19,"td",68),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",68),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",68),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",35),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc(3);h.Mc("nzShowPagination",!1)("nzScroll",h.Rc(21,gS))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyCount,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellCount,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownCount,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalCount,"1.0")," ")}}function PS(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",66),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"td"),h.rc(5,"span",66),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",66),h.rc(8,"span",66),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",66),h.qd(11),h.qc(),h.rc(12,"td",67),h.qd(13),h.Ec(14,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(4);h.Ub(2),h.rd(h.Gc(3,5,null==e?null:e.price,null==n.selectedItem?null:n.selectedItem.exchange)),h.Ub(4),h.rd(null==e?null:e.buyVolume),h.Ub(3),h.rd(null==e?null:e.sellVolume),h.Ub(2),h.sd(" ",null==e?null:e.unknownVolume," "),h.Ub(2),h.sd(" ",h.Gc(14,8,n.countTotal(null==e?null:e.unknownVolume,null==e?null:e.buyVolume,null==e?null:e.sellVolume),"1.0")," ")}}function IS(e,t){if(1&e&&(h.rc(0,"nz-table",31,32),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",66),h.qd(5,"Price"),h.qc(),h.rc(6,"th",66),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",66),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",66),h.qd(11,"X"),h.qc(),h.rc(12,"th",67),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,PS,15,11,"tr",11),h.rc(16,"tr"),h.rc(17,"td",68),h.qd(18,"Total"),h.qc(),h.rc(19,"td",68),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",68),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",68),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",69),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc(3);h.Mc("nzShowPagination",!0)("nzScroll",h.Rc(21,gS))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyVol,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellVol,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownVol,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalVol,"1.0")," ")}}function kS(e,t){if(1&e&&(h.rc(0,"nz-tab",47),h.rc(1,"div",48),h.rc(2,"nz-card",49),h.rc(3,"nz-row"),h.rc(4,"nz-col",50),h.mc(5,"app-stocks-streaming-indicator",2),h.qc(),h.qc(),h.rc(6,"nz-row",51),h.rc(7,"nz-col",52),h.rc(8,"span"),h.od(9,CS,1,1,"img",53),h.qc(),h.rc(10,"span",54),h.qd(11),h.qc(),h.qc(),h.rc(12,"nz-col",55),h.rc(13,"span",56),h.qd(14),h.Ec(15,"stockPrice"),h.qc(),h.qc(),h.qc(),h.rc(16,"nz-row",57),h.rc(17,"nz-col",52),h.rc(18,"span",58),h.mc(19,"app-stock-exchange-tag",2),h.qd(20),h.qc(),h.qc(),h.rc(21,"nz-col",59),h.od(22,qS,5,9,"div",8),h.od(23,TS,5,9,"div",8),h.od(24,wS,5,9,"div",8),h.qc(),h.qc(),h.rc(25,"nz-row"),h.mc(26,"app-stocks-detail-header",9),h.qc(),h.qc(),h.rc(27,"nz-card"),h.od(28,DS,33,22,"nz-table",16),h.od(29,IS,33,22,"nz-table",16),h.rc(30,"div"),h.rc(31,"nz-row",17),h.rc(32,"span",60),h.qd(33,"X: Off-market Transaction"),h.qc(),h.rc(34,"ol",61),h.rc(35,"li"),h.qd(36,"The total volume shown in the Summary Table may differ from the volume in live trading"),h.qc(),h.rc(37,"li"),h.qd(38,"The difference could be due to the latency in data feed update. Kindly refresh the table"),h.qc(),h.qc(),h.qc(),h.mc(39,"nz-row",62),h.mc(40,"nz-row",62),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("nzTitle","Summary"),h.Ub(4),h.Mc("nzSpan",24),h.Ub(1),h.Mc("exch
5ange",null==e.selectedItem?null:e.selectedItem.exchange),h.Ub(4),h.Mc("ngIf",e.shariahFlag),h.Ub(2),h.rd(null==e.selectedItem?null:e.selectedItem.stockName),h.Ub(3),h.rd(h.Gc(15,14,e.selectedItem.lastPrice,null==e.selectedItem?null:e.selectedItem.exchange)),h.Ub(5),h.Mc("exchange",null==e.selectedItem?null:e.selectedItem.exchange),h.Ub(1),h.sd(" ",null==e.selectedItem?null:e.selectedItem.stockCode,""),h.Ub(2),h.Mc("ngIf",e.selectedItem&&e.selectedItem.change<0),h.Ub(1),h.Mc("ngIf",e.selectedItem&&e.selectedItem.change>0),h.Ub(1),h.Mc("ngIf",e.selectedItem&&0===e.selectedItem.change),h.Ub(2),h.Mc("selectedItem",e.selectedItem),h.Ub(2),h.Mc("ngIf","tc"===e.selectedTradeDetail),h.Ub(1),h.Mc("ngIf","v"===e.selectedTradeDetail)}}function AS(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",36),h.rc(1,"div",37),h.rc(2,"b2c-app-bar-2",38),h.zc("back",(function(){return h.dd(e),h.Dc().handleMobileVisible()})),h.qc(),h.qc(),h.rc(3,"nz-tabset",39),h.od(4,vS,1,1,"nz-tab",40),h.od(5,MS,1,1,"nz-tab",40),h.od(6,kS,41,17,"nz-tab",41),h.qc(),h.rc(7,"div",42),h.rc(8,"nz-row"),h.rc(9,"button",43),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.navigateToStocksFactsheet(null==t.selectedItem?null:t.selectedItem.stockName,null==t.selectedItem?null:t.selectedItem.exchange,null==t.selectedItem?null:t.selectedItem.stockCode)})),h.qd(10,"View Stocks Factsheet "),h.qc(),h.qc(),h.rc(11,"nz-row"),h.rc(12,"button",44),h.zc("click",(function(){return h.dd(e),h.Dc().tradeNow()})),h.qd(13,"Trade Now"),h.qc(),h.qc(),h.mc(14,"nz-row",45),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",!0)("nzWrapClassName","mobile-drawer-no-padding")("nzPlacement","top"),h.Ub(2),h.Mc("title","Stock Information"),h.Ub(1),h.Mc("nzSelectedIndex",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SGX?1:2),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SGX||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SZSE),h.Ub(1),h.Mc("ngIf",(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.KLSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SGX||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SSE||(null==e.selectedItem?null:e.selectedItem.exchange)===e.stockConstant.SZSE)}}let ES=(()=>{class e{constructor(e,t,n,i,c,o){this.uiTableService=e,this.lightStreamerHelperService=t,this.store=n,this.accountService=i,this.liveFeedService=c,this.stocksInfoRestService=o,this.selectMarketDepthEmitter=new h.s,this.selectTimeAndSalesEmitter=new h.s,this.closeEmitter=new h.s,this.mobileShowMarketDepth=new h.s,this.mobileShowTimeAndSales=new h.s,this.mobileBack=new h.s,this.TRADE_DETAIL_FIELDS=["symbol","exchange","stockCode","level","price","buyCount","sellCount","unknownCount","buyVolume","sellVolume","unknownVolume"],this.tempSubPriceQuote=[],this.subscribedStock={},this.stockConstant=M.q,this.PRICE_QUOTE_FIELDS=["symbol","exchange","stockCode","stockName","currency","lastPrice","cumulativeVolume","bidPrice","bidQuantity","askPrice","askQuantity","openPrice","closePrice","dayHigh","dayLow","change","changePercentage","tradingStatus"],this.options=[{label:"Market Depth",value:"md",active:!1,show:!0},{label:"Time & Sales",value:"ts",active:!1,show:!0},{label:"Summary",value:"td",active:!0,show:!0}],this.selectedTradeDetail="tc",this.totalSellCount=0,this.totalBuyCount=0,this.totalUnknownCount=0,this.totalCount=0,this.totalSellVol=0,this.totalBuyVol=0,this.totalUnknownVol=0,this.totalVol=0,this.isHkexLivestreaming=!1,this.isSGXLiveStreaming=!1,this.SHARIAH_COMPLAINT_IMG_PATH=M.g.STOCKS_IMG_PATH,this.shariahFlag=!1,this.marketDetail=[]}ngOnInit(){this.isHkexLivestreaming=this.liveFeedService.checkStreaming(M.q.HKEX),this.isSGXLiveStreaming=this.liveFeedService.checkStreaming(M.q.SGX),this.selectedItem&&(this.options=Object(Tg.c)(this.options,this.selectedItem,this.isSGXLiveStreaming,this.isHkexLivestreaming,this.liveFeedService.checkLiveStreamingMarketDepth(this.selectedItem.exchange)))}ngOnDestroy(){this.unsubscribeTradeDetail()}ngOnChanges(e){e&&e.selectedItem&&(this.handleTradeDetail(this.selectedItem),this.subscribeLSPriceQuote(e.selectedItem.currentValue)),e&&this.selectedItem&&(this.options=Object(Tg.c)(this.options,this.selectedItem,this.isSGXLiveStreaming,this.isHkexLivestreaming,this.liveFeedService.checkLiveStreamingMarketDepth(this.selectedItem.exchange)))}unsubscribeLightStreamerClient(){this.tempSubPriceQuote.length>
50&&(this.tempSubPriceQuote.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubPriceQuote=[],this.subscribedStock={})}subscribeLSPriceQuote(e){this.unsubscribeLightStreamerClient(),e.sedolnumber=M.q.KLSE+":"+e.stockCode,e.securityType="COMMON_STOCK",this.tempSubPriceQuote=this.liveFeedService.subscribePriceQuote(this.lsClient,this.PRICE_QUOTE_FIELDS,[e]),this.tempSubPriceQuote.forEach(e=>{e&&e.addListener({onItemUpdate:e=>{this.subscribedStock.lastPrice=parseFloat(e.updateValues[7]),this.subscribedStock.change=parseFloat(e.updateValues[17]),this.subscribedStock.changePercentage=parseFloat(e.updateValues[18])}})})}unsubscribeTradeDetail(){this.marketDetailSub&&(this.lsClient.unsubscribe(this.marketDetailSub),this.marketDetailSub=null)}handleTradeDetail(e){const t=this;this.marketDetail=[],this.setShariahFlag(e.stockCode,e.exchange===M.q.BURSA?M.q.KLSE:e.exchange),this.selectedItem=e,e.exchange==M.q.BURSA||e.exchange==M.q.KLSE||e.exchange==M.q.SGX||e.exchange===M.q.SSE||e.exchange===M.q.SZSE||e.exchange===M.q.LSE?(console.log("Cubscribing trade details"),this.marketDetailSub=this.liveFeedService.subscribeTradeDetail(this.lsClient,this.TRADE_DETAIL_FIELDS,e),this.marketDetailSub.addListener({onItemUpdate:e=>{if(console.log("trade details update >>:",e),"ADD"===e.updateValues[14])t.marketDetail.push(this.lightStreamerHelperService.mapTradeDetails(e,this.TRADE_DETAIL_FIELDS));else if("UPDATE"===e.updateValues[14])for(let n=0;n<this.marketDetail.length;n++)this.marketDetail[n].key===e.updateValues[13]&&(t.marketDetail[n]=this.lightStreamerHelperService.mapTradeDetails(e,this.TRADE_DETAIL_FIELDS));t.marketDetail=Object(g.a)(t.marketDetail),t.getAllTotal()}})):this.selectedItem.timeAndSale.forEach(e=>{this.marketDetail.push(e)})}setShariahFlag(e,t){this.shariahFlag=!1,this.stocksInfoRestService.getStockTickerInfoDetails(e,t).subscribe(e=>{var t;M.a.RESPONSE_SUCCESS===e.status&&e.data&&e.data.length>0&&"Y"===(null===(t=e.data[0])||void 0===t?void 0:t.shariahCompliantIndicator)&&(this.shariahFlag=!0)})}close(){this.closeEmitter.emit()}tradeNow(){this.mobileBack.emit(this.selectedItem)}handleMobileVisible(){this.mobileBack.emit("value")}showMobileMarketDepth(){this.mobileShowMarketDepth.emit()}showMobileTimeAndSales(){this.mobileShowTimeAndSales.emit()}navigateToStocksFactsheet(e,t,n){let i;t===M.q.BURSA&&(t=M.q.KLSE),this.stocksInfoRestService.getTickerInfoByExchangeAndStockCode(t,n).subscribe(c=>{c.status===M.a.RESPONSE_SUCCESS&&c.data&&(i="ETF"==c.data.productType?Object(mt.f)(r.b.ETF,n,"",e,t):Object(mt.f)(r.b.STOCK_AND_ETF,n,"",e,t),Object(pt.a)(i.route,i.params))})}onChangeOption(e){e===this.options[0].value&&this.selectMarketDepthEmitter.emit(this.selectedItem),e===this.options[1].value&&this.selectTimeAndSalesEmitter.emit(this.selectedItem)}countTotal(e,t,n){return parseInt(e)+parseInt(t)+parseInt(n)}getTotalSellCount(){this.totalSellCount=0,this.marketDetail.forEach(e=>{this.totalSellCount+=parseInt(e.sellCount)})}getTotalBuyCount(){this.totalBuyCount=0,this.marketDetail.forEach(e=>{this.totalBuyCount+=parseInt(e.buyCount)})}getTotalUnknownCount(){this.totalUnknownCount=0,this.marketDetail.forEach(e=>{this.totalUnknownCount+=parseInt(e.unknownCount)})}getTotalCount(){this.totalCount=this.totalSellCount+this.totalBuyCount+this.totalUnknownCount}getTotalSellVol(){this.totalSellVol=0,this.marketDetail.forEach(e=>{this.totalSellVol+=parseInt(e.sellVolume)})}getTotalBuyVol(){this.totalBuyVol=0,this.marketDetail.forEach(e=>{this.totalBuyVol+=parseInt(e.buyVolume)})}getTotalUnknownVol(){this.totalUnknownVol=0,this.marketDetail.forEach(e=>{this.totalUnknownVol+=parseInt(e.unknownVolume)})}getTotalVol(){this.totalVol=this.totalSellVol+this.totalBuyVol+this.totalUnknownVol}getAllTotal(){this.getTotalSellCount(),this.getTotalBuyCount(),this.getTotalUnknownCount(),this.getTotalCount(),this.getTotalSellVol(),this.getTotalBuyVol(),this.getTotalUnknownVol(),this.getTotalVol()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(Cg.e),h.lc(qg.a),h.lc(s.i),h.lc(pm.a),h.lc(hm.a),h.lc(Dg.a))}
5,e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-trade-details"]],inputs:{selectedItem:"selectedItem",lsClient:"lsClient",stockLiveFeeHideScroll:"stockLiveFeeHideScroll"},outputs:{selectMarketDepthEmitter:"selectMarketDepthEmitter",selectTimeAndSalesEmitter:"selectTimeAndSalesEmitter",closeEmitter:"closeEmitter",mobileShowMarketDepth:"mobileShowMarketDepth",mobileShowTimeAndSales:"mobileShowTimeAndSales",mobileBack:"mobileBack"},features:[h.Tb([l.a,qg.a,Cg.e]),h.Sb],decls:41,vars:22,consts:[["nzSize","small"],[1,"d-flex","justify-content-between","mb-3"],[3,"exchange"],["nz-icon","","nzType","close",1,"pointer",3,"click"],[1,"pb-2","mt-2"],[3,"nzSpan"],[1,"text-base","font-weight-bold","text-break"],[1,"text-xs"],[4,"ngIf"],[3,"selectedItem"],[3,"hidden"],[4,"ngFor","ngForOf"],[1,"exchange-tab"],[3,"nzButtonStyle","ngModel","nzSize","ngModelChange"],["nz-radio-button","",1,"text-xs","w-50","text-center",3,"nzValue"],[1,"summary-table"],[3,"nzShowPagination","nzScroll","nzData","nzPageSize",4,"ngIf"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","mt-3"],[1,"text-xs","font-weight-bold","pb-2"],[1,"text-xs","font-weight-normal","pl-3"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement",4,"ngIf"],[1,"text-loss","font-weight-bold"],[1,"text-md"],[1,"text-xs","text-loss","font-weight-bold"],[1,"text-profit","font-weight-bold"],[1,"text-xs","text-profit","font-weight-bold"],[1,"font-weight-bold"],[1,"text-xs","font-weight-bold"],["class","mb-1 rank-tab mr-2 rounded-circle d-inline-flex pointer",3,"ngClass","click",4,"ngIf"],[1,"mb-1","rank-tab","mr-2","rounded-circle","d-inline-flex","pointer",3,"ngClass","click"],[1,"px-1","py-1","text-xs"],[3,"nzShowPagination","nzScroll","nzData","nzPageSize"],["tradeDetailTable",""],[1,"text-xs","table-left-border-color"],[1,"text-xs","table-final-row"],[1,"text-xs","table-final-row","table-left-border-color"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement"],[1,"border-bottom"],[3,"title","back"],[3,"nzSelectedIndex"],[3,"nzTitle","nzClick",4,"ngIf"],[3,"nzTitle",4,"ngIf"],[1,"fixed-bottom","bg-white","shadow","py-3","px-2","mb-1"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"click"],[1,"mb-6"],[3,"nzTitle","nzClick"],[3,"nzTitle"],[1,"stocks-card"],[1,"card-no-padding","stocks-pa
5dding"],[1,"mb-2",3,"nzSpan"],["nzAlign","middle","nzType","flex"],["nzSpan","12"],["class","pr-1","nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",3,"src",4,"ngIf"],[1,"text-md","font-weight-bold","text-body"],["nzSpan","12",1,"text-right"],[1,"text-base","font-weight-bold"],["nzAlign","middle","nzType","flex",1,"mb-2"],[1,"text-base"],["nzSpan","12",1,"text-base","text-right"],[1,"text-base","font-weight-bold","pb-2"],[1,"text-base","font-weight-normal","pl-3"],[1,"my-6"],["nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",1,"pr-1",3,"src"],[1,"text-base","text-loss","font-weight-bold"],[1,"text-base","text-profit","font-weight-bold"],[1,"text-sm"],[1,"text-sm","table-left-border-color"],[1,"text-sm","table-final-row"],[1,"text-sm","table-final-row","table-left-border-color"]],template:function(e,t){1&e&&(h.rc(0,"nz-card",0),h.rc(1,"div",1),h.rc(2,"div"),h.mc(3,"app-stocks-streaming-indicator",2),h.qc(),h.rc(4,"div"),h.rc(5,"i",3),h.zc("click",(function(){return t.close()})),h.qc(),h.qc(),h.qc(),h.rc(6,"nz-row",4),h.rc(7,"nz-col",5),h.rc(8,"span",6),h.qd(9),h.qc(),h.rc(10,"span",7),h.qd(11),h.qc(),h.mc(12,"br"),h.od(13,rS,11,14,"div",8),h.od(14,dS,11,14,"div",8),h.od(15,uS,11,14,"div",8),h.qc(),h.rc(16,"nz-col",5),h.mc(17,"app-stocks-detail-header",9),h.qc(),h.qc(),h.rc(18,"nz-row",10),h.od(19,mS,2,1,"ng-container",11),h.qc(),h.rc(20,"nz-row",10),h.rc(21,"div",12),h.rc(22,"nz-radio-group",13),h.zc("ngModelChange",(function(e){return t.selectedTradeDetail=e})),h.rc(23,"label",14),h.qd(24,"Trade Count"),h.qc(),h.rc(25,"label",14),h.qd(26,"Volume"),h.qc(),h.qc(),h.qc(),h.rc(27,"div",15),h.od(28,bS,33,22,"nz-table",16),h.od(29,yS,33,22,"nz-table",16),h.qc(),h.rc(30,"nz-row",17),h.rc(31,"span",18),h.qd(32,"X: Off-market Transaction"),h.qc(),h.rc(33,"ol",19),h.rc(34,"li"),h.qd(35,"The total volume shown in the Summary Table may differ from the volume in live trading"),h.qc(),h.rc(36,"li"),h.qd(37,"The difference could be due to the latency in data feed update. Kindly refresh the table"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(38,"app-mobile-scaffold"),h.od(39,AS,15,8,"nz-drawer",20),h.Ec(40,"async"),h.qc()),2&e&&(h.Ub(3),h.Mc("exchange",null==t.selectedItem?null:t.selectedItem.exchange),h.Ub(4),h.Mc("nzSpan",12),h.Ub(2),h.sd("",null==t.selectedItem?null:t.selectedItem.stockName," "),h.Ub(2),h.sd(" (",null==t.selectedItem?null:t.selectedItem.stockCode,")"),h.Ub(2),h.Mc("ngIf",t.subscribedStock&&(null==t.subscribedStock?null:t.subscribedStock.change)<0),h.Ub(1),h.Mc("ngIf",t.subscribedStock&&(null==t.subscribedStock?null:t.subscribedStock.change)>0),h.Ub(1),h.Mc("ngIf",t.subscribedStock&&0==(null==t.subscribedStock?null:t.subscribedStock.change)),h.Ub(1),h.Mc("nzSpan",12),h.Ub(1),h.Mc("selectedItem",t.selectedItem),h.Ub(1),h.Mc("hidden",t.stockLiveFeeHideScroll),h.Ub(1),h.Mc("ngForOf",t.options),h.Ub(1),h.Mc("hidden",t.stockLiveFeeHideScroll),h.Ub(2),h.Mc("nzButtonStyle","solid")("ngModel",t.selectedTradeDetail)("nzSize","small"),h.Ub(1),h.Mc("nzValue","tc"),h.Ub(2),h.Mc("nzValue","v"),h.Ub(3),h.Mc("ngIf","tc"===t.selectedTradeDetail),h.Ub(1),h.Mc("ngIf","v"===t.selectedTradeDetail),h.Ub(10),h.Mc("ngIf",h.Fc(40,20,t.isMobile$)))},directives:[I.a,Pg.a,k.b,P.c,P.a,p.t,kg,p.s,Ut.c,oe.t,oe.w,Ut.a,z.a,p.q,ve.a,ve.f,ve.g,ve.e,ve.c,ve.d,Eg.a,D.a,Fg.f,_.a,Fg.b,Og.a,xt.e],pipes:[p.b,Ig.a,p.g],styles:[".ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-profit[_ngcontent-%COMP%]{background-color:#093!important}.ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-loss[_ngcontent-%COMP%]{background-color:#ff333a!important}.ant-btn.outline[_ngcontent-%COMP%], .ant-btn[nzOutline].delay-button[_ngcontent-%COMP%]{border-color:#ff333a!important;color:#ff333a!important}.exchange-tab[_ngcontent-%COMP%]{background-color:#ededed;font-weight:700;border-radius:5px 5px 0 0;overflow-x:auto}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group[_ngcontent-%COMP%]{display:flex}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group[_ngcontent-%COMP%] > .ant-radio-button-wrapper[_ngcontent-%COMP%]{border-radius:5px 5px 0 0;color:#000}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled){background-color:#004bad;color:#fff;box-shadow:none}.table-left-border-color[_ngcontent-%COMP%]{border-left:3px solid #012c5d}.table-final-row[_ngcontent-%COMP%]{border-top:3px solid #012c5d;border-bottom:3px solid #012c5d!important}.stocks-card[_ngcontent-%COMP%] .ant-card{box-shadow:0 10px 2px 8px rgba(0,0,0,.15);border-radius:0}
5.stocks-card[_ngcontent-%COMP%] .stocks-padding[_ngcontent-%COMP%]{padding:0 15px 15px}.summary-table[_ngcontent-%COMP%]{max-height:400px!important;overflow:auto}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var FS=n("MwlG"),OS=n("7Nuv"),US=n("2uUe"),xS=n("mo+6"),LS=n("0p8A"),RS=n("baFZ");const NS=function(e,t){return{"text-profit":e,"text-loss":t}};function BS(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",25),h.rc(2,"span",26),h.qd(3),h.Ec(4,"bondPrice"),h.qc(),h.rc(5,"span",27),h.qd(6),h.Ec(7,"bondPrice"),h.Ec(8,"bondPrice"),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Tc(14,NS,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(2),h.rd(h.Fc(4,7,null==e.subscribedBond?null:e.subscribedBond.lastPrice)),h.Ub(2),h.Mc("ngClass",h.Tc(17,NS,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(1),h.vd(" ",e.getDisplaySign(e.subscribedBond.change),"",h.Fc(7,9,null==e.subscribedBond?null:e.subscribedBond.change)," (",e.getDisplaySign(e.subscribedBond.changePercentage),"",h.Gc(8,11,null==e.subscribedBond?null:e.subscribedBond.changePercentage,!0),") ")}}function _S(e,t){1&e&&(h.rc(0,"div",28),h.qd(1,"-"),h.qc())}const VS=function(e,t,n,i){return{"bg-theme":e,"text-white":t,"bg-lighter":n,"mb-2":i}};function HS(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",29),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onChangeOption(n.value)})),h.Ec(2,"async"),h.rc(3,"span",30),h.qd(4),h.qc(),h.qc(),h.oc()}if(2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Vc(4,VS,e.active,e.active,!e.active,!h.Fc(2,2,n.isMobile$))),h.Ub(3),h.sd(" ",e.label," ")}}function $S(e,t){1&e&&h.nc(0)}const jS=function(e,t,n){return{dataBid:e,dataAsk:t,maxDataLength:n}};function GS(e,t){if(1&e&&(h.pc(0),h.od(1,$S,1,0,"ng-container",31),h.oc()),2&e){const e=h.Dc(2),t=h.ad(7);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Uc(2,jS,e.marketDepthDataAsk,e.marketDepthDataBid,(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>=(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)?e.marketDepthDataBid:e.marketDepthDataAsk))}}const WS=function(e){return{"d-block":e}};function YS(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",32),h.rc(2,"span",33),h.qd(3,"Price Chart "),h.qc(),h.qc(),h.rc(4,"div",16),h.rc(5,"highcharts-chart",34),h.zc("updateChange",(function(t){return h.dd(e),h.Dc(2).updateFlag=t})),h.Ec(6,"async"),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(5),h.Mc("Highcharts",e.Highcharts)("options",e.chartOptions)("runOutsideAngular",!0)("ngClass",h.Sc(8,WS,!h.Fc(6,6,e.isMobile$)))("oneToOne",!0)("update",e.updateFlag)}}const KS=function(){return{color:"#7A7A7A"}},XS=function(){return[""]},QS=function(){return{x:"228px"}};function ZS(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-card",3),h.rc(1,"div",4),h.rc(2,"div",5),h.mc(3,"app-bond-exchange-tag",6),h.qc(),h.rc(4,"div"),h.mc(5,"app-bond-live-streaming-tag"),h.rc(6,"i",7),h.zc("click",(function(){return h.dd(e),h.Dc().close()})),h.qc(),h.qc(),h.qc(),h.rc(7,"div",8),h.rc(8,"span",9),h.qd(9),h.qc(),h.mc(10,"br"),h.rc(11,"span",10),h.qd(12),h.qc(),h.od(13,BS,9,20,"ng-container",11),h.od(14,_S,2,0,"ng-template",null,12,h.pd),h.qc(),h.od(16,HS,5,9,"ng-container",13),h.rc(17,"nz-row"),h.rc(18,"div",14),h.rc(19,"div",15),h.rc(20,"div",16),h.rc(21,"nz-table",17),h.rc(22,"thead"),h.rc(23,"tr"),h.rc(24,"th",18),h.qd(25,"Best Buy"),h.qc(),h.rc(26,"th",18),h.qd(27,"Best Sell"),h.qc(),h.qc(),h.qc(),h.mc(28,"tbody"),h.qc(),h.rc(29,"nz-table",19),h.rc(30,"thead"),h.rc(31,"tr"),h.rc(32,"th",20),h.qd(33,"Qty"),h.qc(),h.rc(34,"th",21),h.qd(35,"Price"),h.mc(36,"br"),h.rc(37,"span",22),h.qd(38,"Yield(%)"),h.qc(),h.qc(),h.rc(39,"th",21),h.qd(40,"Price"),h.mc(41,"br"),h.rc(42,"span",22),h.qd(43,"Yield(%)"),h.qc(),h.qc(),h.rc(44,"th",23),h.qd(45,"Qty"),h.qc(),h.qc(),h.qc(),h.rc(46,"tbody"),h.od(47,GS,2,6,"ng-container",24),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.od(48,YS,7,10,"ng-container",24),h.qc()}if(2&e){const e=h.ad(15),t=h.Dc();h.Ub(3),h.Mc("isFullLotType","Y"===(null==t.selectedItem?null:t.selectedItem.bexFullLotEnabled))("isOddLotType","Y"===(null==t.selectedItem?null:t.selectedItem.bexOddLotEnabled))("isRetail","Y"===(null==t.selectedItem?null:t.selectedItem.retailDistribution)),h.Ub(6),h.sd("",null==t.selectedItem?null:t.selectedItem.bondName," "),h.Ub(2),h.Mc("ngStyle",h.Rc(20,KS)),h.Ub(1),h.sd(" (",null==t.selectedItem?null:t.selectedItem.bondIssuer,")"),h.Ub(1),h.Mc("ngIf",0!==(null==t.subscribedBond?null:t.subscribedBond.change)||0!==(null==t.subscribedBond?null:t.subscribedBond.lastPrice))("ngIfElse",e),h.Ub(3),h.Mc("ngForOf",t.options),h.Ub(2),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzData",h.Rc(21,XS))("nzFrontPagination",!1)("nzShowPagination",!1),h.Ub(8),h.Mc("nzData",(null==t.marketDepthDataAsk?null:t.marketDepthDataAsk.length)>=1?t.marketDepthDataAsk:(null==t.marketDepthDataBid?null:t.marketDepthDataBid.length)>=1?t.marketDepthDataBid:null)("nzScroll",h.Rc(22,QS))("nzShowPagination",!1),h.Ub(8),h.Mc("ngStyle",h.Rc(23,KS)),h.Ub(5),h.Mc("ngStyle",h.Rc(24,KS)),h.Ub(5),h.Mc("ngIf",(null==t.marketDepthDataAsk?null:t.marketDepthDataAsk.length)>=1||(null==t.marketDepthDataBid?null:t.marketDepthDataBid.length)>=1),h.Ub(1),h.Mc("ngIf",!t.isPriceChartLoading&&t.showPriceChart)}}function JS(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",60),h.qd(2),h.Ec(3,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Tc(8,NS,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(1),h.vd(" ",e.getDisplaySign(e.subscribedBond.change),"",e.subscribedBond.change," (",e.getDisplaySign(e.subscribedBond.change),"",h.Gc(3,5,null==e.subscribedBond?null:e.subscribedBond.changePercentage,"1.3-3"),"%)")}}function ey(e,t){1&e&&h.nc(0)}function ty(e,t){if(1&e&&(h.pc(0),h.od(1,ey,1,0,"ng-container",31),h.oc()),2&e){const e=h.Dc(2),t=h.ad(7);h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Uc(2,jS,e.marketDepthDataAsk,e.marketDepthDataBid,(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>=(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)?e.marketDepthDataBid:e.marketDepthDataAsk))}}function ny(e,t){1&e&&h.mc(0,"div",61)}function iy(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",35),h.rc(1,"div",36),h.rc(2,"b2c-app-bar-2",37),h.zc("back",(function(){return h.dd(e),h.Dc().handleMobileVisible()})),h.qc(),h.qc(),h.rc(3,"div"),h.rc(4,"nz-tabset",38),h.zc("nzSelectedIndexChange",(function(t){return h.dd(e),h.Dc().emitSelectedTab(t)})),h.rc(5,"nz-tab",39),h.rc(6,"div"),h.rc(7,"nz-row"),h.rc(8,"div",40),h.rc(9,"nz-card",41),h.rc(10,"div",4),h.rc(11,"div",5),h.mc(12,"app-bond-exchange-tag",6),h.qc(),h.rc(13,"div"),h.mc(14,"app-bond-live-streaming-tag"),h.qc(),h.qc(),h.rc(15,"nz-row",42),h.rc(16,"nz-col",43),h.rc(17,"span",44),h.qd(18),h.qc(),h.qc(),h.rc(19,"nz-col",45),h.rc(20,"span",33),h.qd(21),h.Ec(22,"nullToDash"),h.qc(),h.qc(),h.qc(),h.rc(23,"nz-row",46),h.rc(24,"nz-col",47),h.rc(25,"span",22),h.qd(26),h.qc(),h.qc(),h.rc(27,"nz-col",45),h.od(28,JS,4,11,"div",24),h.qc(),h.qc(),h.qc(),h.rc(29,"nz-card"),h.rc(30,"div",15),h.rc(31,"div",16),h.rc(32,"nz-table",17),h.rc(33,"thead"),h.rc(34,"tr"),h.rc(35,"th",48),h.qd(36,"Best Buy"),h.qc(),h.rc(37,"th",49),h.qd(38,"Best Sell"),h.qc(),h.qc(),h.qc(),h.mc(39,"tbody"),h.qc(),h.rc(40,"nz-table",50),h.rc(41,"thead"),h.rc(42,"tr"),h.rc(43,"th",51),h.qd(44,"Qty"),h.qc(),h.rc(45,"th",52),h.qd(46,"Price"),h.mc(47,"br"),h.rc(48,"span",22),h.qd(49,"Yield(%)"),h.qc(),h.qc(),h.rc(50,"th",53),h.qd(51,"Price"),h.mc(52,"br"),h.rc(53,"span",22),h.qd(54,"Yield(%)"),h.qc(),h.qc(),h.rc(55,"th",54),h.qd(56,"Qty"),h.qc(),h.qc(),h.qc(),h.rc(57,"tbody"),h.od(58,ty,2,6,"ng-container",24),h.qc(),h.qc(),h.qc(),h.od(59,ny,1,0,"div",55),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.mc(60,"nz-tab",39),h.mc(61,"nz-tab",39),h.qc(),h.qc(),h.rc(62,"div",56),h.rc(63,"nz-row"),h.rc(64,"button",57),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.redirectToFactsheetPage(null==t.selectedItem?null:t.selectedItem.bondName,null==t.selectedItem?null:t.selectedItem.issueCode)})),h.qd(65," View Bond Factsheet "),h.qc(),h.qc(),h.rc(66,"nz-row"),h.rc(67,"button",58),h.zc("click",(function(){return h.dd(e),h.Dc().tradeNow()})),h.qd(68,"Trade Now"),h.qc(),h.qc(),h.mc(69,"nz-row",59),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",!0)("nzWrapClassName","mobile-drawer-no-padding")("nzPlacement","bottom"),h.Ub(2),h.Mc("title","Bond Information"),h.Ub(2),h.Mc("nzSelectedIndex",0),h.Ub(1),h.Mc("nzTitle","Market Depth"),h.Ub(3),h.Mc("nzSpan",24),h.Ub(4),h.Mc("isFullLotType","Y"===(null==e.selectedItem?null:e.selectedItem.bexFullLotEnabled))("isOddLotType","Y"===(null==e.selectedItem?null:e.selectedItem.bexOddLotEnabled))("isRetail","Y"===(null==e.selectedItem?null:e.selectedItem.retailDistribution)),h.Ub(6),h.rd(null==e.selectedItem?null:e.selectedItem.bondName),h.Ub(3),h.rd(h.Gc(22,26,e.subscribedBond.lastPrice,!0)),h.Ub(4),h.Mc("ngStyle",h.Rc(29,KS)),h.Ub(1),h.rd(null==e.selectedItem?null:e.selectedItem.bondIssuer),h.Ub(2),h.Mc("ngIf",e.subscribedBond&&e.subscribedBond.change),h.Ub(4),h.Mc("nzData",h.Rc(30,XS))("nzFrontPagination",!1)("nzShowPagination",!1),h.Ub(8),h.Mc("nzData",(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)>=1?e.marketDepthDataAsk:(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>=1?e.marketDepthDataBid:null)("nzShowPagination",!1),h.Ub(8),h.Mc("ngStyle",h.Rc(31,KS)),h.Ub(5),h.Mc("ngStyle",h.Rc(32,KS)),h.Ub(5),h.Mc("ngIf",(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)>=1||(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>=1),h.Ub(1),h.Mc("ngIf",(null==e.marketDepthDataAsk?null:e.marketDepthDataAsk.length)>3||(null==e.marketDepthDataBid?null:e.marketDepthDataBid.length)>3),h.Ub(1),h.Mc("nzTitle","Time & Sales"),h.Ub(1),h.Mc("nzTitle","Summary")}
5}const cy=function(e,t){return{"text-sm":e,"text-xs":t}};function oy(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",62),h.Ec(2,"async"),h.Ec(3,"async"),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"td",63),h.rc(7,"span",64),h.Ec(8,"async"),h.Ec(9,"async"),h.qd(10),h.Ec(11,"bondPrice"),h.qc(),h.mc(12,"br"),h.rc(13,"span",25),h.Ec(14,"async"),h.Ec(15,"async"),h.qd(16),h.Ec(17,"bondPrice"),h.qc(),h.qc(),h.rc(18,"td",65),h.Ec(19,"async"),h.Ec(20,"async"),h.rc(21,"span",66),h.Ec(22,"async"),h.Ec(23,"async"),h.qd(24),h.Ec(25,"bondPrice"),h.qc(),h.mc(26,"br"),h.rc(27,"span",25),h.Ec(28,"async"),h.Ec(29,"async"),h.qd(30),h.Ec(31,"bondPrice"),h.qc(),h.qc(),h.rc(32,"td",67),h.Ec(33,"async"),h.Ec(34,"async"),h.qd(35),h.Ec(36,"number"),h.qc(),h.qc()),2&e){const e=t.index,n=h.Dc(),i=n.dataAsk,c=n.dataBid,o=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(55,cy,h.Fc(2,13,o.isMobile$),!h.Fc(3,15,o.isMobile$))),h.Ub(3),h.rd((null==i?null:i.length)>0&&i[e]?h.Fc(5,17,null==i[e]?null:i[e].bidVolume):0),h.Ub(3),h.Mc("ngClass",h.Tc(58,cy,h.Fc(8,19,o.isMobile$),!h.Fc(9,21,o.isMobile$))),h.Ub(3),h.rd((null==i?null:i.length)>0&&i[e]?h.Fc(11,23,null==i[e]?null:i[e].bidPrice):"-"),h.Ub(3),h.Mc("ngClass",h.Tc(61,cy,h.Fc(14,25,o.isMobile$),!h.Fc(15,27,o.isMobile$))),h.Ub(3),h.rd((null==i?null:i.length)>0&&i[e]?h.Gc(17,29,null==i[e]?null:i[e].bidYield,!0):"-"),h.Ub(2),h.Mc("ngClass",h.Tc(64,cy,h.Fc(19,32,o.isMobile$),!h.Fc(20,34,o.isMobile$))),h.Ub(3),h.Mc("ngClass",h.Tc(67,cy,h.Fc(22,36,o.isMobile$),!h.Fc(23,38,o.isMobile$))),h.Ub(3),h.rd((null==c?null:c.length)>0&&c[e]?h.Fc(25,40,null==c[e]?null:c[e].askPrice):"-"),h.Ub(3),h.Mc("ngClass",h.Tc(70,cy,h.Fc(28,42,o.isMobile$),!h.Fc(29,44,o.isMobile$))),h.Ub(3),h.rd((null==c?null:c.length)>0&&c[e]?h.Gc(31,46,null==c[e]?null:c[e].askYield,!0):"-"),h.Ub(2),h.Mc("ngClass",h.Tc(73,cy,h.Fc(33,49,o.isMobile$),!h.Fc(34,51,o.isMobile$))),h.Ub(3),h.rd((null==c?null:c.length)>0&&c[e]?h.Fc(36,53,null==c[e]?null:c[e].askVolume):0)}}function sy(e,t){1&e&&h.od(0,oy,37,76,"tr",13),2&e&&h.Mc("ngForOf",t.maxDataLength)}let ay=(()=>{class e{constructor(e,t,n,i,c){this.lightstreamerBondService=e,this.uiTableService=t,this.notificationService=n,this.bondRestService=i,this.subHandlingService=c,this.closeEmitter=new h.s,this.selectTimeAndSalesEmitter=new h.s,this.selectTradeDetailEmitter=new h.s,this.Highcharts=Mg,this.MIN="min",this.MAX="max",this.chartOptions={credits:{enabled:!1},xAxis:{crosshair:{width:1,color:"#dadada"},type:"datetime"},yAxis:{title:null,labels:{formatter:function(){const e=String(this.value);return Mg.numberFormat(Number(e),3)}}},legend:{enabled:!1},title:{text:""},tooltip:{},chart:{zoomType:"x",panning:{enabled:!0},panKey:"shift",events:{render:function(){setTimeout(()=>{},0)}}},plotOptions:{area:{lineColor:"#004BAD",fillColor:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,"rgba(144, 175, 214, 0.4)"],[1,"rgba(255, 255, 255, 0.5)"]]}},series:{marker:{enabled:!1}}}},this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.tempSubMarketDepth=[],this.timeAndSales=[],this.selectedStockForMarketDepth=[],this.updateFlag=!1,this.isPriceChartLoading=!1,this.shariahFlag=!1,this.subscribedBond={},this.tempSubPriceQuote=[],this.startHours=0,this.startMinutes=0,this.endHours=0,this.endMinutes=0,this.startLunchBreakHour=0,this.startLunchBreakMinutes=0,this.endLunchBreakHour=0,this.endLunchBreakMinutes=0,this.options=[{label:"Market Depth",value:"md",active:!0,show:!0},{label:"Time & Sales",value:"ts",active:!1,show:!0},{label:"Summary",value:"td",active:!1,show:!0}],this.stockConstant=M.q,this.isPriceChartSupported=Tg.b,this.isHkexLivestreaming=!1,this.snapLoading=!1,this.showPriceChart=!1}ngOnChanges(e){e&&e.selectedItem&&(this.subscribeLSPriceQuote(e.selectedItem.currentValue),this.getTimeAndSalesForHighChart())}ngOnDestroy(){this.unsubscribeLightStreamerClient()}unsubscribeLightStreamerClient(){this.tempSubPriceQuote.length>0&&(this.tempSubPriceQuote.forEach(e=>{e&&this.lsClient.unsubscribe(e)}),this.tempSubPriceQuote=[],this.subscribedBond={}),this.tempSubMarketDepth.length>0&&(this.tempSubMarketDepth.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubMarketDepth=[]),this.marketDepthDataBid=[],this.marketDepthDataAsk=[]}subscribeLSPriceQuote(e){this.unsubscribeLightStreamerClient();
5let t=(null==e?void 0:e.symbol)?null==e?void 0:e.symbol:this.lightstreamerBondService.getSymbol(null==e?void 0:e.externalBondId,"Y"===e.bexOddLotEnabled?FS.a.ODD_LOT:FS.a.FULL_LOT);const n=this.lightstreamerBondService.subscribeMarketDepth(this.lsClient,t,e=>{this.subscribedBond={},e.forEachChangedField((e,t,n)=>{let i=Object(ft.a)(n)?parseFloat(n||"0"):n;this.subscribedBond[e]=i}),this.marketDepthDataBid=[{bidPrice:e.getValue("bid1"),bidVolume:e.getValue("bidVolume1"),bidYield:e.getValue("bidYield1")},{bidPrice:e.getValue("bid2"),bidVolume:e.getValue("bidVolume2"),bidYield:e.getValue("bidYield2")},{bidPrice:e.getValue("bid3"),bidVolume:e.getValue("bidVolume3"),bidYield:e.getValue("bidYield3")}],this.marketDepthDataAsk=[{askPrice:e.getValue("ask1"),askVolume:e.getValue("askVolume1"),askYield:e.getValue("askYield1")},{askPrice:e.getValue("ask2"),askVolume:e.getValue("askVolume2"),askYield:e.getValue("askYield2")},{askPrice:e.getValue("ask3"),askVolume:e.getValue("askVolume3"),askYield:e.getValue("askYield3")}]});this.tempSubMarketDepth.push(n)}getTimeAndSalesForHighChart(){this.isPriceChartLoading=!0,this.showPriceChart=!1,this.updateFlag=!1,this.subHandlingService.subscribe(this.bondRestService.getTimeAndSales(this.selectedItem.symbol).pipe(Object(y.a)(e=>{var t,n,i,c;if(e.status!==M.a.RESPONSE_SUCCESS)return;this.showPriceChart=!0;const o=[],s=[];if(this.chartOptions.xAxis.min=this.convertDate(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.startTime),this.chartOptions.xAxis.max=this.convertDate(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.endTime),this.chartOptions.xAxis.tickInterval=36e5,(null===(c=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.seriesDataList)||void 0===c?void 0:c.length)>0){for(let i=e.data.seriesDataList.length;i>0;i--){let t=i-1;s.push([this.convertDate(e.data.seriesDataList[t][0]),e.data.seriesDataList[t][1]])}let t=this.getCurrentDate(),n=s.length-1;if(n>-1){let e=s[n];t>e[0]&&s.push([t,e[1]])}}o.push({type:"area",name:this.selectedItem.bondName,data:s}),this.chartOptions.series=[...o],this.updateFlag=!0;const a=o[0].data.map(e=>e[1]),l=Math.min(...a),r=Math.max(...a);console.log(l+" + "+r);const d=Math.max(.1*(r-l),.05);this.chartOptions.yAxis.min=l-d,this.chartOptions.yAxis.max=r+d,this.isPriceChartLoading=!1})))}convertDate(e){return e instanceof Date||(e=new Date(e)),Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),0)}getCurrentDate(){let e=Date.now(),t=Math.floor(e/6e4);const n=new Date(60*t*1e3);return Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),0)}close(){this.closeEmitter.emit()}handleMobileVisible(){this.closeEmitter.emit()}tradeNow(){this.closeEmitter.emit()}emitSelectedTab(e){1===e?this.selectTimeAndSalesEmitter.emit(this.selectedItem):2===e&&this.selectTradeDetailEmitter.emit(this.selectedItem)}standardizeDecimalPlaces(e){return e?parseFloat(e).toFixed(3):""}redirectToFactsheetPage(e,t){t=Object(mt.a)(t),e&&Object(pt.a)(["/"+M.o.BONDS,M.o.BOND_FACTSHEET,t],{issueCode:e})}onChangeOption(e){e===this.options[1].value&&this.selectTimeAndSalesEmitter.emit(this.selectedItem),e===this.options[2].value&&this.selectTradeDetailEmitter.emit(this.selectedItem)}displaySnapInterface(e){return!e.endSnapDate||e.endSnapDate<(new Date).getTime()}handleSnapMarketDepth(e){this.clearMarketDepthArr();for(let t of e.marketDepth)t[7]=t.volume,t[8]=t.price,this.marketDepthDataBid.length<10&&t.type===zg.a.BID?this.marketDepthDataBid.push(t):this.marketDepthDataAsk.length<10&&t.type===zg.a.ASK&&this.marketDepthDataAsk.push(t)}clearMarketDepthArr(){this.marketDepthDataBid=[],this.marketDepthDataAsk=[]}getDisplaySign(e){if(e>0)return"+"}}return e.\u0275fac=function(t){return new(t||e)(h.lc(OS.a),h.lc(Cg.e),h.lc(j.e),h.lc(gm.a),h.lc(l.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-market-depth"]],inputs:{selectedItem:"selectedItem",lsClient:"lsClient"},outputs:{closeEmitter:"closeEmitter",selectTimeAndSalesEmitter:"selectTimeAndSalesEmitter",selectTradeDetailEmitter:"selectTradeDetailEmitter"},features:[h.Tb([Cg.e]),h.Sb],decls:8,vars:6,consts:[["nzSize","small",4,"ngIf"],["nzHeight","100%",3,"nzVisible","nzWrapClassName","nzPlacement",4,"ngIf"],["marketDepthRow",""],["nzSize","small"],[1,"d-flex","justify-content-between","mb-2"],[1,""],[3,"isFullLotType","isOddLotType","isRetail"],["nz-icon","","nzType","close",1,"pointer",3,"click"],[1,"pb-2","mt-2"],[1,"font-weight-bold","text-break","text-sm"],[1,"text-xs","mb-1",3,"ngStyle"],[4,"ngIf","ngIfElse"],["showDashTemplate",""],[4,"ngFor","ngForOf"],["nz-col","",3,"nzSpan"],["nz-row","","nzJustify","space-around","nzAlign","middle"],["nz-row",""],[3,"nzData","nzFrontPagination","nzShowPagination"],["nzAlign","center","nzWidth","50%",1,"text-xs"],[3,"nzData","nzScroll","nzShowPagination"],["nzAlign","left","nzWidth","25%",1,"text-xs"],["nzAlign","center","nzWidth","25%",1,"text-xs"],[3,"ngStyle"],["nzAlign","right","nzWidth","25%",1,"text-xs"],[4,"ngIf"],[1,"font-weight-bold",3,"ngClass"],[1,"text-md"],[1,"text-xs","font-weight-bold",3,"ngClass"],[1,"font-weight-bold"],[1,"mb-1","rank-tab","mr-2","rounded-circle","d-inline-flex","pointer",3,"ngClass","click"],[1,"px-2","py-1","text-xs"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nz-row","",1,"mt-3","mb-3"],[1,"text-base","font-weight-bold"],[2,"height","250px","display","block","width","100%",3,"Highcharts","options","runOutsideAngular","ngClass","oneToOne","update","updateChange"],["nzHeight","100%",3,"nzVisible","nzWrapClassName","nzPlacement"],[1,"border-bottom","h-100"],[3,"title","back"],[3,"nzSelectedIndex","nzSelectedIndexChange"],[3,"nzTitle"],["nz-col","",1,"bond-card",3,"nzSpan"],[1,"card-no-padding","bond-padding"],["nzAlign","middle","nzType","flex"],["nzSpan","12"],[1,"text-md","font-weight-bold","text-body"],["nzSpan","12",1,"text-right"],["nzAlign","middle","nzType","flex",1,"mb-2"],["nzSpan","12",1,"text-base"],["nzAlign","center","nzWidth","50%",1,"border-right-1"],["nzAlign","center","nzWidth","50%"],[3,"nzData","nzShowPagination"],["nzAlign","left","nzWidth","25%"],["nzAlign","center","nzWidth","25%",1,"border-right-1"],["nzAlign","center","nzWidth","25%"],["nzAlign","right","nzWidth","25%"],["nz-row","","style","height: 240px;",4,"ngIf"],[1,"fixed-bottom","bg-white","shadow","py-3","px-2","mb-1"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"click"],[1,"mb-6"],[1,"text-base","font-weight-bold",3,"ngClass"],["nz-row","",2,"height","240px"],["nzAlign","left",3,"ngClass"],["nzAlign","center",1,"border-right-1"],[1,"text-profit","font-weight-bold",3,"ngClass"],["nzAlign","center",3,"ngClass"],[1,"text-loss","font-weight-bold",3,"ngClass"],["nzAlign","right",3,"ngClass"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,ZS,49,25,"nz-card",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,iy,70,33,"nz-drawer",1),h.Ec(5,"async"),h.qc(),h.od(6,sy,1,1,"ng-template",null,2,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,2,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(5,4,t.isMobile$)))},directives:[B.a,p.t,z.a,I.a,US.a,xS.a,k.b,p.w,p.s,P.c,P.a,ve.a,ve.f,ve.g,ve.e,ve.c,p.q,p.A,Ag.a,Eg.a,D.a,Fg.f,Fg.b,_.a,ve.d],pipes:[p.b,LS.a,RS.a,p.g],styles:[".border-right-1[_ngcontent-%COMP%]{border-right:1px solid #d3d3d3!important}.bond-card[_ngcontent-%COMP%] .ant-card{box-shadow:0 10px 2px 8px rgba(0,0,0,.15);border-radius:0}.bond-card[_ngcontent-%COMP%] .bond-padding[_ngcontent-%COMP%]{padding:0 15px 15px}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var ly=n("UEQk"),ry=n("J6Z5");const dy=function(e,t){return{"text-profit":e,"text-loss":t}};
5function uy(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",16),h.rc(2,"span",17),h.qd(3),h.Ec(4,"bondPrice"),h.qc(),h.rc(5,"span",18),h.qd(6),h.Ec(7,"bondPrice"),h.Ec(8,"bondPrice"),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(14,dy,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(2),h.rd(h.Fc(4,7,null==e.subscribedBond?null:e.subscribedBond.lastPrice)),h.Ub(2),h.Mc("ngClass",h.Tc(17,dy,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(1),h.vd(" ",e.getDisplaySign(e.subscribedBond.change),"",h.Fc(7,9,null==e.subscribedBond?null:e.subscribedBond.change)," (",e.getDisplaySign(e.subscribedBond.changePercentage),"",h.Gc(8,11,null==e.subscribedBond?null:e.subscribedBond.changePercentage,!0),") ")}}function hy(e,t){1&e&&(h.rc(0,"div",19),h.qd(1,"-"),h.qc())}const py=function(e,t,n,i){return{"bg-theme":e,"text-white":t,"bg-lighter":n,"mb-2":i}};function my(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",20),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc().onChangeOption(n.value)})),h.Ec(2,"async"),h.rc(3,"span",21),h.qd(4),h.qc(),h.qc(),h.oc()}if(2&e){const e=t.$implicit,n=h.Dc();h.Ub(1),h.Mc("ngClass",h.Vc(4,py,e.active,e.active,!e.active,!h.Fc(2,2,n.isMobile$))),h.Ub(3),h.sd(" ",e.label," ")}}function fy(e,t){1&e&&(h.rc(0,"td",33),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("X"))}function gy(e,t){1&e&&(h.rc(0,"td",34),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("B"))}function by(e,t){1&e&&(h.rc(0,"td",35),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("S"))}function Sy(e,t){if(1&e&&(h.rc(0,"span",36),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(h.Fc(2,1,null==e?null:e.price))}}function yy(e,t){if(1&e&&(h.rc(0,"span",37),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(h.Fc(2,1,null==e?null:e.price))}}function vy(e,t){if(1&e&&(h.rc(0,"span",29),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(h.Fc(2,1,null==e?null:e.price))}}function My(e,t){if(1&e&&(h.rc(0,"span",36),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.sd("+",h.Fc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.subscribedBond?null:t.subscribedBond.closePrice)),"")}}function Cy(e,t){if(1&e&&(h.rc(0,"span",37),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.rd(h.Fc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.subscribedBond?null:t.subscribedBond.closePrice)))}}function qy(e,t){if(1&e&&(h.rc(0,"span",29),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.rd(h.Fc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.subscribedBond?null:t.subscribedBond.closePrice)))}}function Ty(e,t){if(1&e&&(h.rc(0,"tr"),h.od(1,fy,2,1,"td",26),h.od(2,gy,2,1,"td",27),h.od(3,by,2,1,"td",28),h.rc(4,"td",29),h.qd(5),h.qc(),h.rc(6,"td"),h.od(7,Sy,3,3,"span",30),h.od(8,yy,3,3,"span",31),h.od(9,vy,3,3,"span",32),h.qc(),h.rc(10,"td",29),h.od(11,My,3,3,"span",30),h.od(12,Cy,3,3,"span",31),h.od(13,qy,3,3,"span",32),h.qc(),h.rc(14,"td",29),h.qd(15),h.Ec(16,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngIf","2"==(null==e?null:e.side)||"X"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","1"==(null==e?null:e.side)||"Buy"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","0"==(null==e?null:e.side)||"Sell"===(null==e?null:e.side)),h.Ub(2),h.rd(null==e?null:e.tradeTime),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)),h.Ub(2),h.sd(" ",h.Fc(16,11,null==e?null:e.size)," ")}}const wy=function(){return{x:"228px",y:"400px"}};function zy(e,t){if(1&e&&(h.rc(0,"nz-table",22,23),h.rc(2,"thead"),h.rc(3,"tr"),h.mc(4,"th"),h.rc(5,"th",24),h.qd(6,"Time"),h.qc(),h.rc(7,"th",25),h.qd(8,"Price"),h.qc(),h.rc(9,"th",25),h.qd(10,"Chg"),h.qc(),h.rc(11,"th",25),h.qd(12,"Size"),h.qc(),h.qc(),h.qc(),h.rc(13,"tbody"),h.od(14,Ty,17,13,"tr",10),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzData",t.timeAndSales)("nzPageSize",t.timeAndSales.length)("nzShowPagination",!1)("nzScroll",h.Rc(5,wy)),h.Ub(14),h.Mc("ngForOf",e.data)}}function Dy(e,t){1&e&&(h.rc(0,"nz-row",38),h.rc(1,"span",39),h.qd(2,"X: Off-market Transaction"),h.qc(),h.qc())}function Py(e,t){1&e&&h.nc(0)}function Iy(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",40),h.rc(1,"div",41),h.rc(2,"b2c-app-bar-2",42),h.zc("back",(function(){return h.dd(e),h.Dc().handleMobileVisible()})),h.qc(),h.qc(),h.rc(3,"nz-tabset",43),h.rc(4,"nz-tab",44),h.zc("nzClick",(function(){h.dd(e);const t=h.Dc();return t.onChangeOption(t.options[0].value)})),h.qc(),h.rc(5,"nz-tab",45),h.od(6,Py,1,0,"ng-container",46),h.qc(),h.rc(7,"nz-tab",44),h.zc("nzClick",(function(){h.dd(e);const t=h.Dc();return t.onChangeOption(t.options[2].value)})),h.qc(),h.qc(),h.rc(8,"div",47),h.rc(9,"nz-row"),h.rc(10,"button",48),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.redirectToFactsheetPage(null==t.selectedItem?null:t.selectedItem.issueCode,null==t.selectedItem?null:t.selectedItem.bondName)})),h.qd(11,"View Bond Factsheet "),h.qc(),h.qc(),h.rc(12,"nz-row"),h.rc(13,"button",49),h.zc("click",(function(){return h.dd(e),h.Dc().tradeNow()})),h.qd(14,"Trade Now"),h.qc(),h.qc(),h.mc(15,"nz-row",50),h.qc(),h.qc()}if(2&e){h.Dc();const e=h.ad(26);h.Mc("nzVisible",!0)("nzWrapClassName","mobile-drawer-no-padding")("nzPlacement","top"),h.Ub(2),h.Mc("title","Bond Information"),h.Ub(1),h.Mc("nzSelectedIndex",1),h.Ub(1),h.Mc("nzTitle","Market Depth"),h.Ub(1),h.Mc("nzTitle","Time & Sales"),h.Ub(1),h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("nzTitle","Summary")}
5}function ky(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",65),h.qd(2),h.Ec(3,"bondPrice"),h.Ec(4,"bondPrice"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Tc(9,dy,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(1),h.vd(" ",e.getDisplaySign(e.subscribedBond.change),"",h.Fc(3,5,e.subscribedBond.change)," (",e.getDisplaySign(e.subscribedBond.change),"",h.Fc(4,7,null==e.subscribedBond?null:e.subscribedBond.changePercentage),")")}}function Ay(e,t){1&e&&(h.rc(0,"td",74),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("X"))}function Ey(e,t){1&e&&(h.rc(0,"td",75),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("B"))}function Fy(e,t){1&e&&(h.rc(0,"td",76),h.qd(1),h.qc()),2&e&&(h.Ub(1),h.rd("S"))}function Oy(e,t){if(1&e&&(h.rc(0,"span",77),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(h.Fc(2,1,null==e?null:e.price))}}function Uy(e,t){if(1&e&&(h.rc(0,"span",78),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(h.Fc(2,1,null==e?null:e.price))}}function xy(e,t){if(1&e&&(h.rc(0,"span",67),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(h.Fc(2,1,null==e?null:e.price))}}function Ly(e,t){if(1&e&&(h.rc(0,"span",77),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.sd("+",h.Fc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.subscribedBond?null:t.subscribedBond.closePrice)),"")}}function Ry(e,t){if(1&e&&(h.rc(0,"span",78),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Fc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.subscribedBond?null:t.subscribedBond.closePrice)))}}function Ny(e,t){if(1&e&&(h.rc(0,"span",67),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Fc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.subscribedBond?null:t.subscribedBond.closePrice)))}}function By(e,t){if(1&e&&(h.rc(0,"tr"),h.od(1,Ay,2,1,"td",68),h.od(2,Ey,2,1,"td",69),h.od(3,Fy,2,1,"td",70),h.rc(4,"td",67),h.qd(5),h.qc(),h.rc(6,"td"),h.od(7,Oy,3,3,"span",71),h.od(8,Uy,3,3,"span",72),h.od(9,xy,3,3,"span",73),h.qc(),h.rc(10,"td",67),h.od(11,Ly,3,3,"span",71),h.od(12,Ry,3,3,"span",72),h.od(13,Ny,3,3,"span",73),h.qc(),h.rc(14,"td",67),h.qd(15),h.Ec(16,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(1),h.Mc("ngIf","2"==(null==e?null:e.side)||"X"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","1"==(null==e?null:e.side)||"Buy"===(null==e?null:e.side)),h.Ub(1),h.Mc("ngIf","0"==(null==e?null:e.side)||"Sell"===(null==e?null:e.side)),h.Ub(2),h.rd(null==e?null:e.tradeTime),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)),h.Ub(2),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.subscribedBond?null:n.subscribedBond.closePrice)),h.Ub(2),h.sd(" ",h.Fc(16,11,null==e?null:e.size)," ")}}function _y(e,t){if(1&e&&(h.rc(0,"nz-table",66,23),h.rc(2,"thead"),h.rc(3,"tr"),h.mc(4,"th"),h.rc(5,"th",67),h.qd(6,"Time"),h.qc(),h.rc(7,"th",67),h.qd(8,"Price"),h.qc(),h.rc(9,"th",67),h.qd(10,"Chg"),h.qc(),h.rc(11,"th",67),h.qd(12,"Size"),h.qc(),h.qc(),h.qc(),h.rc(13,"tbody"),h.od(14,By,17,13,"tr",10),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc(2);h.Mc("nzShowPagination",t.timeAndSales.length>10)("nzData",t.timeAndSales),h.Ub(14),h.Mc("ngForOf",e.data)}}function Vy(e,t){1&e&&(h.rc(0,"nz-row",79),h.rc(1,"span",80),h.qd(2,"X: Off-market Transaction"),h.qc(),h.qc())}const Hy=function(){return{color:"#7A7A7A"}};function $y(e,t){if(1&e&&(h.rc(0,"div",51),h.rc(1,"nz-card",52),h.rc(2,"div",1),h.rc(3,"div",2),h.mc(4,"app-bond-exchange-tag",3),h.qc(),h.rc(5,"div"),h.mc(6,"app-bond-live-streaming-tag"),h.qc(),h.qc(),h.rc(7,"nz-row",53),h.rc(8,"nz-col",54),h.rc(9,"span",55),h.qd(10),h.qc(),h.qc(),h.rc(11,"nz-col",56),h.rc(12,"span",57),h.qd(13),h.Ec(14,"bondPrice"),h.qc(),h.qc(),h.qc(),h.rc(15,"nz-row",58),h.rc(16,"nz-col",59),h.rc(17,"span",60),h.qd(18),h.qc(),h.qc(),h.rc(19,"nz-col",56),h.od(20,ky,5,12,"div",61),h.qc(),h.qc(),h.qc(),h.rc(21,"nz-card"),h.od(22,_y,15,3,"nz-table",62),h.rc(23,"div"),h.od(24,Vy,3,0,"nz-row",63),h.mc(25,"nz-row",64),h.mc(26,"nz-row",64),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(4),h.Mc("isFullLotType","Y"===(null==e.selectedItem?null:e.selectedItem.bexFullLotEnabled))("isOddLotType","Y"===(null==e.selectedItem?null:e.selectedItem.bexOddLotEnabled))("isRetail","Y"===(null==e.selectedItem?null:e.selectedItem.retailDistribution)),h.Ub(6),h.rd(null==e.selectedItem?null:e.selectedItem.bondName),h.Ub(3),h.rd(h.Fc(14,10,e.subscribedBond.lastPrice)),h.Ub(4),h.Mc("ngStyle",h.Rc(12,Hy)),h.Ub(1),h.rd(null==e.selectedItem?null:e.selectedItem.bondIssuer),h.Ub(2),h.Mc("ngIf",e.subscribedBond&&e.subscribedBond.change),h.Ub(2),h.Mc("ngIf",e.timeAndSales.length>=1),h.Ub(2),h.Mc("ngIf",e.hasXTrade)}}let jy=(()=>{class e{constructor(e,t){this.uiTableService=e,this.lightstreamerBondService=t,this.selectMarketDepthEmitter=new h.s,this.selectTradeDetailEmitter=new h.s,this.closeEmitter=new h.s,this.tempSubPriceQuote=[],this.options=[{label:"Market Depth",value:"md",active:!1,show:!0},{label:"Time & Sales",value:"ts",active:!0,show:!0},{label:"Summary",value:"td",active:!1,show:!0}],this.hasXTrade=!1,this.subscribedBond={},this.timeAndSales=[],this.timeAndSalesSub=[]}ngOnInit(){}ngOnChanges(e){e&&e.selectedItem&&(this.handleTimeAndSales(this.selectedItem),this.subscribeLSPriceQuote(e.selectedItem.currentValue)),e&&this.selectedItem&&(this.options=Object(ly.a)(this.selectedItem,this.options))}ngOnDestroy(){this.unsubscribeLightStreamerClient(),this.unsubscribeTimeAndSales()}unsubscribeLightStreamerClient(){this.tempSubPriceQuote.length>
50&&(this.tempSubPriceQuote.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubPriceQuote=[],this.subscribedBond={})}subscribeLSPriceQuote(e){this.unsubscribeLightStreamerClient();let t=(null==e?void 0:e.bexPriceSymbol)?null==e?void 0:e.bexPriceSymbol:ry.a.BEX_PRICE+"-"+this.lightstreamerBondService.getSymbol(null==e?void 0:e.externalBondId,"Y"===e.bexOddLotEnabled?FS.a.ODD_LOT:FS.a.FULL_LOT);const n=this.lightstreamerBondService.subscribeLSPriceQuote(this.lsClient,t,e=>{this.subscribedBond.lastPrice=Object(ft.a)(e.getValue("lastPrice"))?parseFloat(e.getValue("lastPrice")||"0"):e.getValue("lastPrice"),this.subscribedBond.change=Object(ft.a)(e.getValue("netChange"))?parseFloat(e.getValue("netChange")||"0"):e.getValue("netChange"),this.subscribedBond.changePercentage=Object(ft.a)(e.getValue("netChangePercent"))?parseFloat(e.getValue("netChangePercent")||"0"):e.getValue("netChangePercent"),this.subscribedBond.closePrice=Object(ft.a)(e.getValue("closePrice"))?parseFloat(e.getValue("closePrice")||"0"):e.getValue("closePrice")});this.tempSubPriceQuote.push(n)}unsubscribeTimeAndSales(){this.timeAndSalesSub.length>0&&(this.lsClient.unsubscribe(this.timeAndSalesSub),this.timeAndSalesSub=null)}handleTimeAndSales(e){this.unsubscribeTimeAndSales();const t=this;let n=(null==e?void 0:e.symbol)?null==e?void 0:e.symbol:this.lightstreamerBondService.getSymbol(null==e?void 0:e.externalBondId,"Y"===e.bexOddLotEnabled?FS.a.ODD_LOT:FS.a.FULL_LOT);const i=this.lightstreamerBondService.subscribeTimeAndSales(this.lsClient,n,e=>{let n=e.getValue("key");if("ADD"===e.getValue("command"))t.timeAndSales[n]=this.mapTradeDetails(e,ry.a.BOND_RMO_TIME_AND_SALES_FIELDS);else if("UPDATE"===e.getValue("command"))for(let i=0;i<this.timeAndSales.length;i++)t.timeAndSales[i].key===e.getValue("key")&&(t.timeAndSales[i]=this.mapTradeDetails(e,ry.a.BOND_RMO_TIME_AND_SALES_FIELDS));else"DELETE"===e.getValue("command")&&(t.timeAndSales=t.timeAndSales.filter(t=>t.symbol!==e.getValue("symbol")))});this.timeAndSalesSub=i,t.timeAndSales=Object(g.a)(t.timeAndSales),t.timeAndSales=this.sortTimeAndSales(t.timeAndSales),t.hasXTrade=this.checkHasXTrade()}mapTradeDetails(e,t){let n={};for(let i=0;i<t.length;i++)n[t[i]]=e.updateValues[i+2];return n}checkHasXTrade(){return this.timeAndSales.some(e=>"2"===(null==e?void 0:e.side)||"X"===(null==e?void 0:e.side))}getTimeAndSales(){return this.selectedItem.endSnapDate&&this.selectedItem.endSnapDate<(new Date).getTime()?this.timeAndSales.slice(0,4):this.timeAndSales}sortTimeAndSales(e){let t=[];e=this.uiTableService.sort({key:"tradeTime",value:"descend"},e);for(let n=0;n<100&&n<e.length;n++)t.push(e[n]);return t}getTimeAndSalesChgPrice(e,t){return parseFloat(e)-parseFloat(t)}close(){this.closeEmitter.emit()}tradeNow(){this.closeEmitter.emit()}handleMobileVisible(){this.closeEmitter.emit()}redirectToFactsheetPage(e,t){t=Object(mt.a)(t),e&&Object(pt.a)(["/"+M.o.BONDS,M.o.BOND_FACTSHEET,t],{issueCode:e})}onChangeOption(e){e===this.options[0].value&&this.selectMarketDepthEmitter.emit(this.selectedItem),e===this.options[2].value&&this.selectTradeDetailEmitter.emit(this.selectedItem)}getDisplaySign(e){return e>0?"+":""}}return e.\u0275fac=function(t){return new(t||e)(h.lc(Cg.e),h.lc(OS.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-time-and-sales"]],inputs:{selectedItem:"selectedItem",lsClient:"lsClient"},outputs:{selectMarketDepthEmitter:"selectMarketDepthEmitter",selectTradeDetailEmitter:"selectTradeDetailEmitter",closeEmitter:"closeEmitter"},features:[h.Tb([l.a,qg.a,Cg.e]),h.Sb],decls:27,vars:15,consts:[["nzSize","small"],[1,"d-flex","justify-content-between","mb-2"],[1,""],[3,"isFullLotType","isOddLotType","isRetail"],["nz-icon","","nzType","close",1,"pointer",3,"click"],[1,"pb-2","mt-2"],[1,"font-weight-bold","text-break","text-sm"],[1,"text-xs","mb-1",3,"ngStyle"],[4,"ngIf","ngIfElse"],["showDashTemplate",""],[4,"ngFor","ngForOf"],[1,"pb-2"],[3,"nzData","nzPageSize","nzShowPagination","nzScroll",4,"ngIf"],["class","d-flex flex-column mt-3 ml-2","nzType","flex","nzJustify","start",4,"ngIf"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement",4,"ngIf"],["timeSales",""],[1,"font-weight-bold",3,"ngClass"],[1,"text-md"],[1,"text-xs","font-weight-bold",3,"ngClass"],[1,"font-weight-bold"],[1,"mb-1","rank-tab","mr-2","rounded-circle","d-inline-flex","pointer",3,"ngClass","click"],[1,"px-2","py-1","text-xs"],[3,"nzData","nzPageSize","nzShowPagination","nzScroll"],["timeAndSalesTable",""],["nzWidth","25%",1,"text-xs"],["nzWidth","23%",1,"text-xs"],["class","font-weight-bold text-black text-center text-xs",4,"ngIf"],["class","bg-profit font-weight-bold text-white text-center text-xs",4,"ngIf"],["class","bg-loss font-weight-bold text-white text-center text-xs",4,"ngIf"],[1,"text-xs"],["class","text-profit text-xs",4,"ngIf"],["class","text-loss text-xs",4,"ngIf"],["class","text-xs",4,"ngIf"],[1,"font-weight-bold","text-black","text-center","text-xs"],[1,"bg-profit","font-weight-bold","text-white","text-center","text-xs"],[1,"bg-loss","font-weight-bold","text-white","text-center","text-xs"],[1,"text-profit","text-xs"],[1,"text-loss","text-xs"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","mt-3","ml-2"],[1,"text-xs","font-weight-bold","pb-2"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement"],[1,"border-bottom"],[3,"title","back"],[3,"nzSelectedIndex"],[3,"nzTitle","nzClick"],[3,"nzTitle"],[4,"ngTemplateOutlet"],[1,"fixed-bottom","bg-white","shadow","py-3","px-2","mb-1"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"click"],[1,"mb-6"],[1,"bond-card"],[1,"card-no-padding","bond-padding"],["nzAlign","middle","nzType","flex"],["nzSpan","12"],[1,"text-md","font-weight-bold","text-body"],["nzSpan","12",1,"text-right"],[1,"text-base","font-weight-bold"],["nzAlign","middle","nzType","flex",1,"mb-2"],["nzSpan","12",1,"text-base"],[3,"ngStyle"],[4,"ngIf"],[3,"nzShowPagination","nzData",4,"ngIf"],["class","d-flex flex-column my-3 ml-2","nzType","flex","nzJustify","start",4,"ngIf"],[1,"my-6"],[1,"text-base","font-weight-bold",3,"ngClass"],[3,"nzShowPagination","nzData"],[1,"text-sm"],["class","font-weight-bold text-black text-center text-sm",4,"ngIf"],["class","bg-profit font-weight-bold text-white text-center text-sm",4,"ngIf"],["class","bg-loss font-weight-bold text-white text-center text-sm",4,"ngIf"],["class","text-profit text-sm",4,"ngIf"],["class","text-loss text-sm",4,"ngIf"],["class","text-sm",4,"ngIf"],[1,"font-weight-bold","text-black","text-center","text-sm"],[1,"bg-profit","font-weight-bold","text-white","text-center","text-sm"],[1,"bg-loss","font-weight-bold","text-white","text-center","text-sm"],[1,"text-profit","text-sm"],[1,"text-loss","text-sm"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","my-3","ml-2"],[1,"text-base","font-weight-bold","pb-2"]],template:function(e,t){if(1&e&&(h.rc(0,"nz-card",0),h.rc(1,"nz-row"),h.rc(2,"div",1),h.rc(3,"div",2),h.mc(4,"app-bond-exchange-tag",3),h.qc(),h.rc(5,"div"),h.mc(6,"app-bond-live-streaming-tag"),h.rc(7,"i",4),h.zc("click",(function(){return t.close()})),h.qc(),h.qc(),h.qc(),h.rc(8,"div",5),h.rc(9,"span",6),h.qd(10),h.qc(),h.mc(11,"br"),h.rc(12,"span",7),h.qd(13),h.qc(),h.od(14,uy,9,20,"ng-container",8),h.od(15,hy,2,0,"ng-template",null,9,h.pd),h.qc(),h.qc(),h.rc(17,"nz-row"),h.od(18,my,5,9,"ng-container",10),h.qc(),h.rc(19,"nz-row",11),h.od(20,zy,15,6,"nz-table",12),h.od(21,Dy,3,0,"nz-row",13),h.qc(),h.qc(),h.rc(22,"app-mobile-scaffold"),h.od(23,Iy,16,9,"nz-drawer",14),h.Ec(24,"async"),h.od(25,$y,27,
513,"ng-template",null,15,h.pd),h.qc()),2&e){const e=h.ad(16);h.Ub(4),h.Mc("isFullLotType","Y"===(null==t.selectedItem?null:t.selectedItem.bexFullLotEnabled))("isOddLotType","Y"===(null==t.selectedItem?null:t.selectedItem.bexOddLotEnabled))("isRetail","Y"===(null==t.selectedItem?null:t.selectedItem.retailDistribution)),h.Ub(6),h.sd("",null==t.selectedItem?null:t.selectedItem.bondName," "),h.Ub(2),h.Mc("ngStyle",h.Rc(14,Hy)),h.Ub(1),h.sd(" (",null==t.selectedItem?null:t.selectedItem.bondIssuer,")"),h.Ub(1),h.Mc("ngIf",0!==(null==t.subscribedBond?null:t.subscribedBond.change)||0!==(null==t.subscribedBond?null:t.subscribedBond.lastPrice))("ngIfElse",e),h.Ub(4),h.Mc("ngForOf",t.options),h.Ub(2),h.Mc("ngIf",t.timeAndSales.length>0),h.Ub(1),h.Mc("ngIf",t.hasXTrade),h.Ub(2),h.Mc("ngIf",h.Fc(24,12,t.isMobile$))}},directives:[I.a,P.c,US.a,xS.a,k.b,p.w,p.t,p.s,z.a,p.q,ve.a,ve.f,ve.g,ve.e,ve.c,ve.d,Eg.a,D.a,Fg.f,Fg.b,p.A,_.a,P.a],pipes:[p.b,LS.a,p.g],styles:[".ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-profit[_ngcontent-%COMP%]{background-color:#093!important}.ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-loss[_ngcontent-%COMP%]{background-color:#ff333a!important}.ant-btn.outline[_ngcontent-%COMP%], .ant-btn[nzOutline].delay-button[_ngcontent-%COMP%]{border-color:#ff333a!important;color:#ff333a!important}.bond-card[_ngcontent-%COMP%] .ant-card{box-shadow:0 10px 2px 8px rgba(0,0,0,.15);border-radius:0}.bond-card[_ngcontent-%COMP%] .bond-padding[_ngcontent-%COMP%]{padding:0 15px 15px}.snap-icon[_ngcontent-%COMP%]{vertical-align:top;margin:2px}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const Gy=function(e,t){return{"text-profit":e,"text-loss":t}};function Wy(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",20),h.rc(2,"span",21),h.qd(3),h.Ec(4,"bondPrice"),h.qc(),h.rc(5,"span",22),h.qd(6),h.Ec(7,"bondPrice"),h.Ec(8,"bondPrice"),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(14,Gy,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(2),h.rd(h.Fc(4,7,null==e.subscribedBond?null:e.subscribedBond.lastPrice)),h.Ub(2),h.Mc("ngClass",h.Tc(17,Gy,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(1),h.vd(" ",e.getDisplaySign(e.subscribedBond.change),"",h.Fc(7,9,null==e.subscribedBond?null:e.subscribedBond.change)," (",e.getDisplaySign(e.subscribedBond.changePercentage),"",h.Gc(8,11,null==e.subscribedBond?null:e.subscribedBond.changePercentage,!0),") ")}}function Yy(e,t){1&e&&(h.rc(0,"div",23),h.qd(1,"-"),h.qc())}const Ky=function(e,t,n,i){return{"bg-theme":e,"text-white":t,"bg-lighter":n,"mb-2":i}};function Xy(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",24),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc().onChangeOption(n.value)})),h.Ec(2,"async"),h.rc(3,"span",25),h.qd(4),h.qc(),h.qc(),h.oc()}if(2&e){const e=t.$implicit,n=h.Dc();h.Ub(1),h.Mc("ngClass",h.Vc(4,Ky,e.active,e.active,!e.active,!h.Fc(2,2,n.isMobile$))),h.Ub(3),h.sd(" ",e.label," ")}}function Qy(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",28),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.rc(4,"td"),h.rc(5,"span",28),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",28),h.rc(8,"span",28),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",28),h.qd(11),h.qc(),h.rc(12,"td",29),h.qd(13),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(2),h.rd(h.Fc(3,5,null==e?null:e.price)),h.Ub(4),h.rd(null==e?null:e.buyCount),h.Ub(3),h.rd(null==e?null:e.sellCount),h.Ub(2),h.sd(" ",null==e?null:e.unknownCount," "),h.Ub(2),h.sd(" ",n.countTotal(null==e?null:e.unknownCount,null==e?null:e.buyCount,null==e?null:e.sellCount)," ")}}const Zy=function(){return{x:"228px"}};function Jy(e,t){if(1&e&&(h.rc(0,"nz-table",26,27),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",28),h.qd(5,"Price"),h.qc(),h.rc(6,"th",28),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",28),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",28),h.qd(11,"X"),h.qc(),h.rc(12,"th",29),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,Qy,14,7,"tr",10),h.rc(16,"tr"),h.rc(17,"td",30),h.qd(18,"Total"),h.qc(),h.rc(19,"td",30),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",30),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",30),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",31),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzShowPagination",!1)("nzScroll",h.Rc(21,Zy))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyCount,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellCount,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownCount,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalCount,"1.0")," ")}}function ev(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",28),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.rc(4,"td"),h.rc(5,"span",28),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",28),h.rc(8,"span",28),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",28),h.qd(11),h.qc(),h.rc(12,"td",29),h.qd(13),h.Ec(14,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(2),h.rd(h.Fc(3,5,null==e?null:e.price)),h.Ub(4),h.rd(null==e?null:e.buyVolume),h.Ub(3),h.rd(null==e?null:e.sellVolume),h.Ub(2),h.sd(" ",null==e?null:e.unknownVolume," "),h.Ub(2),h.sd(" ",h.Gc(14,7,n.countTotal(null==e?null:e.unknownVolume,null==e?null:e.buyVolume,null==e?null:e.sellVolume),"1.0")," ")}}function tv(e,t){if(1&e&&(h.rc(0,"nz-table",26,27),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",28),h.qd(5,"Price"),h.qc(),h.rc(6,"th",28),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",28),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",28),h.qd(11,"X"),h.qc(),h.rc(12,"th",29),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,ev,15,10,"tr",10),h.rc(16,"tr"),h.rc(17,"td",30),h.qd(18,"Total"),h.qc(),h.rc(19,"td",30),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",30),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",30),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",31),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzShowPagination",!1)("nzScroll",h.Rc(21,Zy))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyVol,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellVol,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownVol,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalVol,"1.0")," ")}}function nv(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",55),h.qd(2),h.Ec(3,"bondPrice"),h.Ec(4,"bondPrice"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Tc(10,Gy,e.subscribedBond.change>0,e.subscribedBond.change<0)),h.Ub(1),h.vd(" ",e.getDisplaySign(e.subscribedBond.change),"",h.Fc(3,5,e.subscribedBond.change)," (",e.getDisplaySign(e.subscribedBond.change),"",h.Gc(4,7,null==e.subscribedBond?null:e.subscribedBond.changePercentage,!0),")")}}function iv(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",56),h.qd(2),h.Ec(3,"number"),h.qc(),h.rc(4,"td"),h.rc(5,"span",56),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",56),h.rc(8,"span",56),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",56),h.qd(11),h.qc(),h.rc(12,"td",57),h.qd(13),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(2),h.rd(h.Gc(3,5,null==e?null:e.price,".3-3")),h.Ub(4),h.rd(null==e?null:e.buyCount),h.Ub(3),h.rd(null==e?null:e.sellCount),h.Ub(2),h.sd(" ",null==e?null:e.unknownCount," "),h.Ub(2),h.sd(" ",n.countTotal(null==e?null:e.unknownCount,null==e?null:e.buyCount,null==e?null:e.sellCount)," ")}}function cv(e,t){if(1&e&&(h.rc(0,"nz-table",26,27),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",56),h.qd(5,"Price"),h.qc(),h.rc(6,"th",56),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",56),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",56),h.qd(11,"X"),h.qc(),h.rc(12,"th",57),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,iv,14,8,"tr",10),h.rc(16,"tr"),h.rc(17,"td",58),h.qd(18,"Total"),h.qc(),h.rc(19,"td",58),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",58),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",58),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",31),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc(2);h.Mc("nzShowPagination",!1)("nzScroll",h.Rc(21,Zy))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyCount,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellCount,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownCount,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalCount,"1.0")," ")}}function ov(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td",56),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.rc(4,"td"),h.rc(5,"span",56),h.qd(6),h.qc(),h.qc(),h.rc(7,"td",56),h.rc(8,"span",56),h.qd(9),h.qc(),h.qc(),h.rc(10,"td",56),h.qd(11),h.qc(),h.rc(12,"td",57),h.qd(13),h.Ec(14,"number"),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(2),h.rd(h.Fc(3,5,null==e?null:e.price)),h.Ub(4),h.rd(null==e?null:e.buyVolume),h.Ub(3),h.rd(null==e?null:e.sellVolume),h.Ub(2),h.sd(" ",null==e?null:e.unknownVolume," "),h.Ub(2),h.sd(" ",h.Gc(14,7,n.countTotal(null==e?null:e.unknownVolume,null==e?null:e.buyVolume,null==e?null:e.sellVolume),"1.0")," ")}}function sv(e,t){if(1&e&&(h.rc(0,"nz-table",26,27),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th",56),h.qd(5,"Price"),h.qc(),h.rc(6,"th",56),h.qd(7,"Buy"),h.qc(),h.rc(8,"th",56),h.qd(9,"Sell"),h.qc(),h.rc(10,"th",56),h.qd(11,"X"),h.qc(),h.rc(12,"th",57),h.qd(13,"Total"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,ov,15,10,"tr",10),h.rc(16,"tr"),h.rc(17,"td",58),h.qd(18,"Total"),h.qc(),h.rc(19,"td",58),h.rc(20,"span"),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"td",58),h.rc(24,"span"),h.qd(25),h.Ec(26,"number"),h.qc(),h.qc(),h.rc(27,"td",58),h.qd(28),h.Ec(29,"number"),h.qc(),h.rc(30,"td",59),h.qd(31),h.Ec(32,"number"),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc(2);h.Mc("nzShowPagination",!0)("nzScroll",h.Rc(21,Zy))("nzData",t.marketDetail)("nzPageSize",null==t.marketDetail?null:t.marketDetail.length),h.Ub(15),h.Mc("ngForOf",e.data),h.Ub(6),h.rd(h.Gc(22,9,t.totalBuyVol,"1.0")),h.Ub(4),h.rd(h.Gc(26,12,t.totalSellVol,"1.0")),h.Ub(3),h.sd(" ",h.Gc(29,15,t.totalUnknownVol,"1.0")," "),h.Ub(3),h.sd(" ",h.Gc(32,18,t.totalVol,"1.0")," ")}}const av=function(){return{color:"#7A7A7A"}};function lv(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",32),h.rc(1,"div",33),h.rc(2,"b2c-app-bar-2",34),h.zc("back",(function(){return h.dd(e),h.Dc().handleMobileVisible()})),h.qc(),h.qc(),h.rc(3,"nz-tabset",35),h.rc(4,"nz-tab",36),h.zc("nzClick",(function(){h.dd(e);const t=h.Dc();return t.onChangeOption(t.options[2].value)})),h.qc(),h.rc(5,"nz-tab",36),h.zc("nzClick",(function(){h.dd(e);const t=h.Dc();return t.onChangeOption(t.options[1].value)})),h.qc(),h.rc(6,"nz-tab",37),h.rc(7,"div",38),h.rc(8,"nz-card",39),h.rc(9,"div",1),h.rc(10,"div",2),h.mc(11,"app-bond-exchange-tag",3),h.qc(),h.rc(12,"div"),h.mc(13,"app-bond-live-streaming-tag"),h.qc(),h.qc(),h.rc(14,"nz-row",40),h.rc(15,"nz-col",41),h.rc(16,"span",42),h.qd(17),h.qc(),h.qc(),h.rc(18,"nz-col",43),h.rc(19,"span",44),h.qd(20),h.qc(),h.qc(),h.qc(),h.rc(21,"nz-row",45),h.rc(22,"nz-col",41),h.rc(23,"span",46),h.qd(24),h.qc(),h.qc(),h.rc(25,"nz-col",43),h.od(26,nv,5,13,"div",47),h.qc(),h.qc(),h.qc(),h.rc(27,"nz-card"),h.od(28,cv,33,22,"nz-table",15),h.od(29,sv,33,22,"nz-table",15),h.rc(30,"div"),h.rc(31,"nz-row",16),h.rc(32,"span",48),h.qd(33,"X: Off-market Transaction"),h.qc(),h.rc(34,"ol",49),h.rc(35,"li"),h.qd(36,"The total volume shown in the Summary Table may differ from the volume in live trading"),h.qc(),h.rc(37,"li"),h.qd(38,"The difference could be due to the latency in data feed update. Kindly refresh the table"),h.qc(),h.qc(),h.qc(),h.mc(39,"nz-row",50),h.mc(40,"nz-row",50),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(41,"div",51),h.rc(42,"nz-row"),h.rc(43,"button",52),h.zc("click",(function(){h.dd(e);const t=h.Dc();return t.redirectToFactsheetPage(null==t.selectedItem?null:t.selectedItem.bondName,null==t.selectedItem?null:t.selectedItem.issueCode)})),h.qd(44,"View Bond Factsheet "),h.qc(),h.qc(),h.rc(45,"nz-row"),h.rc(46,"button",53),h.zc("click",(function(){return h.dd(e),h.Dc().tradeNow()})),h.qd(47,"Trade Now"),h.qc(),h.qc(),h.mc(48,"nz-row",54),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",!0)("nzWrapClassName","mobile-drawer-no-padding")("nzPlacement","top"),h.Ub(2),h.Mc("title","Bond Information"),h.Ub(1),h.Mc("nzSelectedIndex",2),h.Ub(1),h.Mc("nzTitle","Market Depth"),h.Ub(1),h.Mc("nzTitle","Time & Sales"),h.Ub(1),h.Mc("nzTitle","Summary"),h.Ub(5),h.Mc("isFullLotType","Y"===(null==e.selectedItem?null:e.selectedItem.bexFullLotEnabled))("isOddLotType","Y"===(null==e.selectedItem?null:e.selectedItem.bexOddLotEnabled))("isRetail","Y"===(null==e.selectedItem?null:e.selectedItem.retailDistribution)),h.Ub(6),h.rd(null==e.selectedItem?null:e.selectedItem.bondName),h.Ub(3),h.rd(e.subscribedBond.lastPrice),h.Ub(3),h.Mc("ngStyle",h.Rc(18,av)),h.Ub(1),h.sd(" ",null==e.selectedItem?null:e.selectedItem.bondIssuer,""),h.Ub(2),h.Mc("ngIf",e.subscribedBond&&e.subscribedBond.change),h.Ub(2),h.Mc("ngIf","tc"===e.selectedTradeDetail),h.Ub(1),h.Mc("ngIf","v"===e.selectedTradeDetail)}}let rv=(()=>{class e{constructor(e,t,n,i){this.uiTableService=e,this.store=t,this.accountService=n,this.lightstreamerBondService=i,this.selectMarketDepthEmitter=new h.s,this.selectTimeAndSalesEmitter=new h.s,this.closeEmitter=new h.s,this.tempSubPriceQuote=[],this.options=[{label:"Market Depth",value:"md",active:!1,show:!0},{label:"Time & Sales",value:"ts",active:!1,show:!0},{label:"Summary",value:"td",active:!0,show:!0}],this.selectedTradeDetail="tc",this.totalSellCount=0,this.totalBuyCount=0,this.totalUnknownCount=0,this.totalCount=0,this.totalSellVol=0,this.totalBuyVol=0,this.totalUnknownVol=0,this.totalVol=0,this.subscribedBond={},this.marketDetail=[]}ngOnInit(){}ngOnDestroy(){this.unsubscribeLightStreamerClient(),this.unsubscribeTradeDetail()}ngOnChanges(e){e&&e.selectedItem&&(this.handleTradeDetail(this.selectedItem),this.subscribeLSPriceQuote(e.selectedItem.currentValue))}unsubscribeLightStreamerClient(){this.tempSubPriceQuote.length>
50&&(this.tempSubPriceQuote.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubPriceQuote=[],this.subscribedBond={})}subscribeLSPriceQuote(e){this.unsubscribeLightStreamerClient();let t=(null==e?void 0:e.bexPriceSymbol)?null==e?void 0:e.bexPriceSymbol:ry.a.BEX_PRICE+"-"+this.lightstreamerBondService.getSymbol(null==e?void 0:e.externalBondId,"Y"===e.bexOddLotEnabled?FS.a.ODD_LOT:FS.a.FULL_LOT);const n=this.lightstreamerBondService.subscribeLSPriceQuote(this.lsClient,t,e=>{this.subscribedBond.lastPrice=Object(ft.a)(e.getValue("lastPrice"))?parseFloat(e.getValue("lastPrice")||"0"):e.getValue("lastPrice"),this.subscribedBond.change=Object(ft.a)(e.getValue("netChange"))?parseFloat(e.getValue("netChange")||"0"):e.getValue("netChange"),this.subscribedBond.changePercentage=Object(ft.a)(e.getValue("netChangePercent"))?parseFloat(e.getValue("netChangePercent")||"0"):e.getValue("netChangePercent")});this.tempSubPriceQuote.push(n)}unsubscribeTradeDetail(){this.marketDetailSub&&(this.lsClient.unsubscribe(this.marketDetailSub),this.marketDetailSub=null)}handleTradeDetail(e){this.unsubscribeTradeDetail();const t=this;let n=(null==e?void 0:e.symbol)?null==e?void 0:e.symbol:this.lightstreamerBondService.getSymbol(null==e?void 0:e.externalBondId,"Y"===e.bexOddLotEnabled?FS.a.ODD_LOT:FS.a.FULL_LOT);const i=this.lightstreamerBondService.subscribeTradeSummary(this.lsClient,n,e=>{let n=e.getValue("key");if("ADD"===e.getValue("command"))t.marketDetail[n]=this.mapTradeDetails(e,ry.a.BOND_RMO_TRADE_SUMMARY_FIELDS);else if("UPDATE"===e.getValue("command"))for(let i=0;i<this.marketDetail.length;i++)this.marketDetail[i].key===e.getValue("key")&&(t.marketDetail[i]=this.mapTradeDetails(e,ry.a.BOND_RMO_TRADE_SUMMARY_FIELDS));else"DELETE"===e.getValue("command")&&(t.marketDetail=t.marketDetail.filter(t=>t.symbol!==e.getValue("symbol")));t.marketDetail=Object(g.a)(t.marketDetail),t.getAllTotal()});t.marketDetailSub=i}mapTradeDetails(e,t){let n={};for(let i=0;i<t.length;i++)n[t[i]]=e.updateValues[i+2];return n}close(){this.closeEmitter.emit()}tradeNow(){this.closeEmitter.emit()}handleMobileVisible(){this.closeEmitter.emit()}redirectToFactsheetPage(e,t){t=Object(mt.a)(t),e&&Object(pt.a)(["/"+M.o.BONDS,M.o.BOND_FACTSHEET,t],{issueCode:e})}onChangeOption(e){e===this.options[0].value&&this.selectMarketDepthEmitter.emit(this.selectedItem),e===this.options[1].value&&this.selectTimeAndSalesEmitter.emit(this.selectedItem)}countTotal(e,t,n){return parseInt(e)+parseInt(t)+parseInt(n)}getTotalSellCount(){this.totalSellCount=0,this.marketDetail.forEach(e=>{this.totalSellCount+=parseInt(e.sellCount)})}getTotalBuyCount(){this.totalBuyCount=0,this.marketDetail.forEach(e=>{this.totalBuyCount+=parseInt(e.buyCount)})}getTotalUnknownCount(){this.totalUnknownCount=0,this.marketDetail.forEach(e=>{this.totalUnknownCount+=parseInt(e.unknownCount)})}getTotalCount(){this.totalCount=this.totalSellCount+this.totalBuyCount+this.totalUnknownCount}getTotalSellVol(){this.totalSellVol=0,this.marketDetail.forEach(e=>{this.totalSellVol+=parseInt(e.sellVolume)})}getTotalBuyVol(){this.totalBuyVol=0,this.marketDetail.forEach(e=>{this.totalBuyVol+=parseInt(e.buyVolume)})}getTotalUnknownVol(){this.totalUnknownVol=0,this.marketDetail.forEach(e=>{this.totalUnknownVol+=parseInt(e.unknownVolume)})}getTotalVol(){this.totalVol=this.totalSellVol+this.totalBuyVol+this.totalUnknownVol}getAllTotal(){this.getTotalSellCount(),this.getTotalBuyCount(),this.getTotalUnknownCount(),this.getTotalCount(),this.getTotalSellVol(),this.getTotalBuyVol(),this.getTotalUnknownVol(),this.getTotalVol()}getDisplaySign(e){return e>0?"+":""}}return e.\u0275fac=function(t){return new(t||e)(h.lc(Cg.e),h.lc(s.i),h.lc(pm.a),h.lc(OS.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-summary"]],inputs:{selectedItem:"selectedItem",lsClient:"lsClient"},outputs:{selectMarketDepthEmitter:"selectMarketDepthEmitter",selectTimeAndSalesEmitter:"selectTimeAndSalesEmitter",closeEmitter:"closeEmitter"},features:[h.Tb([l.a,qg.a,Cg.e]),h.Sb],decls:40,vars:20,consts:[["nzSize","small"],[1,"d-flex","justify-content-between","mb-2"],[1,""],[3,"isFullLotType","isOddLotType","isRetail"],["nz-icon","","nzType","close",1,"pointer",3,"click"],[1,"pb-2","mt-2"],[1,"font-weight-bold","text-break","text-sm"],[1,"text-xs","mb-1",3,"ngStyle"],[4,"ngIf","ngIfElse"],["showDashTemplate",""],[4,"ngFor","ngForOf"],[1,"exchange-tab"],[3,"nzButtonStyle","ngModel","nzSize","ngModelChange"],["nz-radio-button","",1,"text-xs","w-50","text-center",3,"nz
5Value"],[1,"summary-table"],[3,"nzShowPagination","nzScroll","nzData","nzPageSize",4,"ngIf"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","mt-3"],[1,"text-xs","font-weight-bold","pb-2"],[1,"text-xs","font-weight-normal","pl-3"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement",4,"ngIf"],[1,"font-weight-bold",3,"ngClass"],[1,"text-md"],[1,"text-xs","font-weight-bold",3,"ngClass"],[1,"font-weight-bold"],[1,"mb-1","rank-tab","mr-2","rounded-circle","d-inline-flex","pointer",3,"ngClass","click"],[1,"px-2","py-1","text-xs"],[3,"nzShowPagination","nzScroll","nzData","nzPageSize"],["tradeDetailTable",""],[1,"text-xs"],[1,"text-xs","table-left-border-color"],[1,"text-xs","table-final-row"],[1,"text-xs","table-final-row","table-left-border-color"],["nzHeight","95%",3,"nzVisible","nzWrapClassName","nzPlacement"],[1,"border-bottom"],[3,"title","back"],[3,"nzSelectedIndex"],[3,"nzTitle","nzClick"],[3,"nzTitle"],[1,"bond-card"],[1,"card-no-padding","bond-padding"],["nzAlign","middle","nzType","flex"],["nzSpan","12"],[1,"text-md","font-weight-bold","text-body"],["nzSpan","12",1,"text-right"],[1,"text-base","font-weight-bold"],["nzAlign","middle","nzType","flex",1,"mb-2"],[1,"text-base",3,"ngStyle"],[4,"ngIf"],[1,"text-base","font-weight-bold","pb-2"],[1,"text-base","font-weight-normal","pl-3"],[1,"my-6"],[1,"fixed-bottom","bg-white","shadow","py-3","px-2","mb-1"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"click"],[1,"mb-6"],[1,"text-base","font-weight-bold",3,"ngClass"],[1,"text-sm"],[1,"text-sm","table-left-border-color"],[1,"text-sm","table-final-row"],[1,"text-sm","table-final-row","table-left-border-color"]],template:function(e,t){if(1&e&&(h.rc(0,"nz-card",0),h.rc(1,"div",1),h.rc(2,"div",2),h.mc(3,"app-bond-exchange-tag",3),h.qc(),h.rc(4,"div"),h.mc(5,"app-bond-live-streaming-tag"),h.rc(6,"i",4),h.zc("click",(function(){return t.close()})),h.qc(),h.qc(),h.qc(),h.rc(7,"nz-row",5),h.rc(8,"div"),h.rc(9,"span",6),h.qd(10),h.qc(),h.mc(11,"br"),h.rc(12,"span",7),h.qd(13),h.qc(),h.od(14,Wy,9,20,"ng-container",8),h.od(15,Yy,2,0,"ng-template",null,9,h.pd),h.qc(),h.qc(),h.rc(17,"nz-row"),h.od(18,Xy,5,9,"ng-container",10),h.qc(),h.rc(19,"nz-row"),h.rc(20,"div",11),h.rc(21,"nz-radio-group",12),h.zc("ngModelChange",(function(e){return t.selectedTradeDetail=e})),h.rc(22,"label",13),h.qd(23,"Trade Count"),h.qc(),h.rc(24,"label",13),h.qd(25,"Volume"),h.qc(),h.qc(),h.qc(),h.rc(26,"div",14),h.od(27,Jy,33,22,"nz-table",15),h.od(28,tv,33,22,"nz-table",15),h.qc(),h.rc(29,"nz-row",16),h.rc(30,"span",17),h.qd(31,"X: Off-market Transaction"),h.qc(),h.rc(32,"ol",18),h.rc(33,"li"),h.qd(34,"The total volume shown in the Summary Table may differ from the volume in live trading"),h.qc(),h.rc(35,"li"),h.qd(36,"The difference could be due to the latency in data feed update. Kindly refresh the table"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(37,"app-mobile-scaffold"),h.od(38,lv,49,19,"nz-drawer",19),h.Ec(39,"async"),h.qc()),2&e){const e=h.ad(16);h.Ub(3),h.Mc("isFullLotType","Y"===(null==t.selectedItem?null:t.selectedItem.bexFullLotEnabled))("isOddLotType","Y"===(null==t.selectedItem?null:t.selectedItem.bexOddLotEnabled))("isRetail","Y"===(null==t.selectedItem?null:t.selectedItem.retailDistribution)),h.Ub(7),h.sd("",null==t.selectedItem?null:t.selectedItem.bondName," "),h.Ub(2),h.Mc("ngStyle",h.Rc(19,av)),h.Ub(1),h.sd(" (",null==t.selectedItem?null:t.selectedItem.bondIssuer,")"),h.Ub(1),h.Mc("ngIf",0!==(null==t.subscribedBond?null:t.subscribedBond.change)||0!==(null==t.subscribedBond?null:t.subscribedBond.lastPrice))("ngIfElse",e),h.Ub(4),h.Mc("ngForOf",t.options),h.Ub(3),h.Mc("nzButtonStyle","solid")("ngModel",t.selectedTradeDetail)("nzSize","small"),h.Ub(1),h.Mc("nzValue","tc"),h.Ub(2),h.Mc("nzValue","v"),h.Ub(3),h.Mc("ngIf","tc"===t.selectedTradeDetail),h.Ub(1),h.Mc("ngIf","v"===t.selectedTradeDetail),h.Ub(10),h.Mc("ngIf",h.Fc(39,17,t.isMobile$))}},directives:[I.a,US.a,xS.a,k.b,P.c,p.w,p.t,p.s,Ut.c,oe.t,oe.w,Ut.a,z.a,p.q,ve.a,ve.f,ve.g,ve.e,ve.c,ve.d,Eg.a,D.a,Fg.f,Fg.b,P.a,_.a],pipes:[p.b,LS.a,p.g],styles:[".ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-profit[_ngcontent-%COMP%]{background-color:#093!important}.ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]:hover:not(.ant-table-expanded-row) > td.bg-loss[_ngcontent-%COMP%]{background-color:#ff333a!important}.ant-btn.outline[_ngcontent-%COMP%], .ant-btn[nzOutline].delay-button[_ngcontent-%COMP%]{border-color:#ff333a!important;color:#ff333a!important}.exchange-tab[_ngcontent-%COMP%]{background-color:#ededed;font-weight:700;border-radius:5px 5px 0 0;overflow-x:auto}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group[_ngcontent-%COMP%]{display:flex}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group[_ngcontent-%COMP%] > .ant-radio-button-wrapper[_ngcontent-%COMP%]{border-radius:5px 5px 0 0;color:#000}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled){background-color:#004bad;color:#fff;box-shadow:none}.table-left-border-color[_ngcontent-%COMP%]{border-left:3px solid #012c5d}.table-final-row[_ngcontent-%COMP%]{border-top:3px solid #012c5d;border-bottom:3px solid #012c5d!important}.bond-card[_ngcontent-%COMP%] .ant-card{box-shadow:0 10px 2px 8px rgba(0,0,0,.15);border-radius:0}.bond-card[_ngcontent-%COMP%] .bond-padding[_ngcontent-%COMP%]{padding:0 15px 15px}.summary-table[_ngcontent-%COMP%]{max-height:400px!important;overflow:auto}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var dv=n("EY2u"),uv=n("nYR2"),hv=n("dWXg"),pv=function(e){return e.STOCK_BANNER_WEB="STOCK_BANNER_WEB",e.STOCK_BANNER_MOBILE="STOCK_BANNER_MOBILE",e.STOCK_MAINTENANCE="STOCK_MAINTENANCE",e.BOND_BANNER_WEB="BOND_BANNER_WEB",e.BOND_MAINTENANCE="BOND_MAINTENANCE",e.BOND_HOLIDAY="BOND_HOLIDAY",e}({}),mv=n("OAAr"),fv=n("7hlL"),gv=n("tk/3");let bv=(()=>{class e{constructor(e){this.http=e,this.BASE_URL=Lu.a.ANNOUNCEMENT}findAnnouncementList(){return this.http.post(this.BASE_URL+Lu.a.READ,{})}findWebAnnouncementList(){return this.http.post(this.BASE_URL+Lu.a.WEB+Lu.a.READ,{})}findBondAnnouncementList(){return this.http.post(this.BASE_URL+Lu.a.BOND+Lu.a.READ,{})}}return e.\u0275fac=function(t){return new(t||e)(h.vc(gv.c))},e.\u0275prov=h.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Sv=n("So51"),yv=n("Q3HA"),vv=n("zD6h"),Mv=n("CaJa"),Cv=n("mP9c"),qv=n("Zl8n"),Tv=n("oWhb"),wv=n("aCXV"),zv=n("z7Sm");let Dv=(()=>{class e{}return e.STATUS_VOID="void",e.STATUS_TRIGGERED="triggered",e.PRODUCT_TYPE_STOCK="STOCK",e})();var Pv=n("MKUH"),Iv=n("RC/j"),kv=n("82pO"),Av=n("D0hY"),Ev=n("h0sS"),Fv=n("/gji"),Ov=n("TiNC"),Uv=n("3Xqx"),xv=n("Nqz0"),Lv=n("TIZK"),Rv=n("Lcc6"),Nv=n("+U6L"),Bv=n("7yDB"),_v=n("31Y2");let Vv=(()=>{class e{constructor(e,t){this.http=e,this.paramService=t,this.BASE_URL=Lu.a.PRODUCT_PRICE_ALERT+Lu.a.PROTECTED,this.HIST_BASE_URL=Lu.a.PRODUCT_PRICE_ALERT_HIST+Lu.a.PROTECTED}findByAccountIdAndProductType(e){const t=this.paramService.buildHttpParams({productType:e});return this.http.post(this.BASE_URL+Lu.a.FIND_PRODUCT_PRICE_ALERT_BY_PRODUCT_TYPE,{},{params:t})}findByAccountIdAndProductCodeAndProductType(e,t){const n=this.paramService.buildHttpParams({productC
5ode:e,productType:t});return this.http.post(this.BASE_URL+Lu.a.FIND_PRODUCT_PRICE_ALERT_BY_PRODUCT_CODE_PRODUCT_TYPE,{},{params:n})}findByAccountIdAndProductTypeAndStatus(e,t){const n=this.paramService.buildHttpParams({productType:e,status:t});return this.http.post(this.HIST_BASE_URL+Lu.a.FIND_PRODUCT_PRICE_ALERT_BY_PRODUCT_TYPE_STATUS,{},{params:n})}findByAccountIdAndProductCodeAndProductTypeAndStatus(e,t,n){const i=this.paramService.buildHttpParams({productCode:e,productType:t,status:n});return this.http.post(this.HIST_BASE_URL+Lu.a.FIND_PRODUCT_PRICE_ALERT_BY_PRODUCT_TYPE_PRODUCT_CODE_STATUS,{},{params:i})}addProductPriceAlert(e){return this.http.post(this.BASE_URL+Lu.a.CREATE,e,{})}voidProductPriceAlert(e){return this.http.post(this.BASE_URL+Lu.a.DELETE,e,{})}updateProductPriceAlert(e){return this.http.post(this.BASE_URL+Lu.a.UPDATE,e,{})}removeProductPriceAlertHist(e){return this.http.post(this.HIST_BASE_URL+Lu.a.DELETE,e,{})}}return e.\u0275fac=function(t){return new(t||e)(h.vc(gv.c),h.vc(_v.a))},e.\u0275prov=h.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e})();var Hv=n("elVT"),$v=n("PKr4"),jv=n("TJ1p"),Gv=n("vm/J"),Wv=n("Q8Sa"),Yv=n("aP7/"),Kv=n("8X2B"),Xv=n("zAKX"),Qv=n("UeAZ"),Zv=n("6XSc"),Jv=n("uyr1");function eM(e,t){1&e&&h.nc(0)}function tM(e,t){if(1&e&&h.mc(0,"nz-option",24),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function nM(e,t){if(1&e&&h.mc(0,"nz-option",24),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function iM(e,t){1&e&&(h.pc(0),h.qd(1," Set Alert "),h.oc())}function cM(e,t){1&e&&(h.pc(0),h.qd(1," Update "),h.oc())}function oM(e,t){1&e&&(h.pc(0),h.qd(1," Remove "),h.oc())}function sM(e,t){if(1&e){const e=h.sc();h.rc(0,"tr"),h.rc(1,"td"),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"td"),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.rc(7,"td"),h.rc(8,"span"),h.rc(9,"a",31),h.zc("click",(function(){h.dd(e);const n=t.$implicit,i=h.Dc(3);return i.onActionClick(n,i.UPDATE)})),h.rc(10,"b"),h.qd(11,"Edit"),h.qc(),h.qc(),h.qc(),h.rc(12,"span",32),h.rc(13,"a",31),h.zc("click",(function(){h.dd(e);const n=t.$implicit,i=h.Dc(3);return i.onActionClick(n,i.DELETE)})),h.rc(14,"b"),h.qd(15,"Remove"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(2),h.rd(0===e.ceiling||null!==e.ceiling?h.Hc(3,2,e.ceiling,"BURSA"===(null==n.selectedStock?null:n.selectedStock.exchange)?"KLSE":null==n.selectedStock?null:n.selectedStock.exchange,null==n.selectedStock?null:n.selectedStock.lastPrice):"-"),h.Ub(3),h.rd(0===e.floor||null!==e.floor?h.Hc(6,6,e.floor,"BURSA"===(null==n.selectedStock?null:n.selectedStock.exchange)?"KLSE":null==n.selectedStock?null:n.selectedStock.exchange,null==n.selectedStock?null:n.selectedStock.lastPrice):"-")}}const aM=function(){return{x:"100%"}};function lM(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-table",25,26),h.rc(2,"thead",27),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc(2).sortList(t)})),h.rc(3,"tr"),h.rc(4,"th",28),h.qd(5,"Ceiling Price"),h.qc(),h.rc(6,"th",29),h.qd(7,"Floor Price"),h.qc(),h.rc(8,"th"),h.qd(9,"Actions"),h.qc(),h.qc(),h.qc(),h.rc(10,"tbody"),h.od(11,sM,16,10,"tr",30),h.Ec(12,"slice"),h.qc(),h.qc()}if(2&e){const e=h.ad(1),t=h.Dc(2);h.Mc("nzData",t.stockPriceAlertList)("nzScroll",h.Rc(7,aM)),h.Ub(11),h.Mc("ngForOf",h.Hc(12,3,e.data,0,5))}}function rM(e,t){if(1&e){const e=h.sc();h.rc(0,"tr"),h.rc(1,"td"),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"td"),h.qd(5),h.Ec(6,"stockPrice"),h.qc(),h.rc(7,"td"),h.qd(8),h.Ec(9,"date"),h.qc(),h.rc(10,"td"),h.rc(11,"span"),h.rc(12,"a",31),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).onHistDeleteActionClick(n)})),h.rc(13,"b"),h.qd(14,"Remove"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(2),h.rd(0===e.ceiling||null!==e.ceiling?h.Hc(3,3,e.ceiling,"BURSA"===(null==n.selectedStock?null:n.selectedStock.exchange)?"KLSE":null==n.selectedStock?null:n.selectedStock.exchange,null!=n.selectedStock&&n.selectedStock.lastPrice?null==n.selectedStock?null:n.selectedStock.lastPrice:null==n.selectedStock?null:n.selectedStock.closePrice):"-"),h.Ub(3),h.rd(0===e.floor||null!==e.floor?h.Hc(6,7,e.floor,"BURSA"===(null==n.selectedStock?null:n.selectedStock.exchange)?"KLSE":null==n.selectedStock?null:n.selectedStock.exchange,null!=n.selectedStock&&n.selectedStock.lastPrice?null==n.selectedStock?null:n.selectedStock.lastPrice:null==n.selectedStock?null:n.selectedStock.closePrice):"-"),h.Ub(3),h.rd(e.triggeredDate?h.Gc(9,11,e.triggeredDate,"dd MMM yyyy HH:mm:ss"):"-")}}function dM(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-table",33,34),h.zc("nzPageSizeChange",(function(t){return h.dd(e),h.Dc(2).pageSize=t}))("nzPageIndexChange",(function(t){return h.dd(e),h.Dc(2).pageIndex=t}))("nzTotalChange",(function(t){return h.dd(e),h.Dc(2).stockPriceAlertHistList.length=t})),h.rc(2,"thead",27),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc(2).sortHistList(t)})),h.rc(3,"tr"),h.rc(4,"th",28),h.qd(5,"Ceiling Price"),h.qc(),h.rc(6,"th",29),h.qd(7,"Floor Price"),h.qc(),h.rc(8,"th",35),h.qd(9,"Triggered Date"),h.qc(),h.rc(10,"th"),h.qd(11,"Actions"),h.qc(),h.qc(),h.qc(),h.rc(12,"tbody"),h.od(13,rM,15,14,"tr",30),h.qc(),h.qc()}if(2&e){const e=h.ad(1);h.Dc();const t=h.ad(29),n=h.Dc();h.Mc("nzData",n.stockPriceAlertHistList)("nzPageSize",n.pageSize)("nzShowPagination",n.stockPriceAlertHistList.length>5?"true":"false")("nzPageIndex",n.pageIndex)("nzTotal",n.stockPriceAlertHistList.length)("nzShowTotal",t)("nzScroll",h.Rc(8,aM)),h.Ub(13),h.Mc("ngForOf",e.data)}}function uM(e,t){if(1&e&&h.qd(0),2&e){const e=t.range;h.ud(" Showing ",e[0],"-",e[1]," of ",t.$implicit," results")}}function hM(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",2),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().visible=t}))("nzAfterOpen",(function(){return h.dd(e),h.Dc().onInitAfterOpenModal()}))("nzOnCancel",(function(){return h.dd(e),h.Dc().handlePriceAlertCancel()})),h.od(1,eM,1,0,"ng-container",3),h.rc(2,"nz-input-group",4),h.rc(3,"ui-input-group",5),h.rc(4,"input",6),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().ceilingPrice=t}))("change",(function(){return h.dd(e),h.Dc().ceilingPriceChg()}
5)),h.qc(),h.qc(),h.rc(5,"nz-select",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().ceilingPercentage=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().ceilingPercentageChg()})),h.od(6,tM,1,2,"nz-option",8),h.qc(),h.qc(),h.rc(7,"nz-input-group",4),h.rc(8,"ui-input-group",9),h.rc(9,"input",10),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().floorPrice=t}))("change",(function(){return h.dd(e),h.Dc().floorPriceChg()})),h.qc(),h.qc(),h.rc(10,"nz-select",7),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().floorPercentage=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().floorPercentageChg()})),h.od(11,nM,1,2,"nz-option",8),h.qc(),h.qc(),h.rc(12,"nz-row",11),h.rc(13,"span",12),h.qd(14,"An email and push notification will be sent to you whenever these prices are reached."),h.qc(),h.qc(),h.rc(15,"div",13),h.rc(16,"button",14),h.zc("click",(function(){return h.dd(e),h.Dc().refresh()})),h.qd(17,"Clear"),h.qc(),h.rc(18,"button",15),h.zc("click",(function(){return h.dd(e),h.Dc().handleSubmitAlert()})),h.pc(19,16),h.od(20,iM,2,0,"ng-container",17),h.od(21,cM,2,0,"ng-container",17),h.od(22,oM,2,0,"ng-container",17),h.oc(),h.qc(),h.qc(),h.rc(23,"nz-row",18),h.rc(24,"nz-col",19),h.rc(25,"app-stocks-tab",20),h.zc("onTabChanged",(function(t){return h.dd(e),h.Dc().onAlertPriceTabChanged(t)})),h.qc(),h.qc(),h.qc(),h.od(26,lM,13,8,"nz-table",21),h.od(27,dM,14,9,"nz-table",22),h.od(28,uM,1,3,"ng-template",null,23,h.pd),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(2);h.Mc("nzVisible",e.visible)("nzFooter",null),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(3),h.Mc("ngModel",e.ceilingPrice)("min",null!=e.selectedStock&&e.selectedStock.lastPrice?null==e.selectedStock?null:e.selectedStock.lastPrice:null==e.selectedStock?null:e.selectedStock.closePrice),h.Ub(1),h.Mc("ngModel",e.ceilingPercentage),h.Ub(1),h.Mc("ngForOf",e.ceilingPercentages),h.Ub(3),h.Mc("ngModel",e.floorPrice)("max",null!=e.selectedStock&&e.selectedStock.lastPrice?null==e.selectedStock?null:e.selectedStock.lastPrice:null==e.selectedStock?null:e.selectedStock.closePrice),h.Ub(1),h.Mc("ngModel",e.floorPercentage),h.Ub(1),h.Mc("ngForOf",e.floorPercentages),h.Ub(8),h.Mc("ngSwitch",e.action),h.Ub(1),h.Mc("ngSwitchCase",e.ADD),h.Ub(1),h.Mc("ngSwitchCase",e.UPDATE),h.Ub(1),h.Mc("ngSwitchCase",e.DELETE),h.Ub(3),h.Mc("loading",!1)("tabOptions",e.ALERT_PRICE_TAB),h.Ub(1),h.Mc("ngIf",e.selectedAlertPriceTab===e.ALERT_PRICE_TAB[0]),h.Ub(1),h.Mc("ngIf",e.selectedAlertPriceTab===e.ALERT_PRICE_TAB[1])}}function pM(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",36),h.rc(2,"span",37),h.qd(3),h.qc(),h.mc(4,"br"),h.rc(5,"span"),h.qd(6),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("nzSpan",24),h.Ub(2),h.rd(null==e.selectedStock?null:e.selectedStock.stockName),h.Ub(3),h.td(" ",(null==e.selectedStock?null:e.selectedStock.exchange)===e.BURSA?e.KLSE:null==e.selectedStock?null:e.selectedStock.exchange," | ",null==e.selectedStock?null:e.selectedStock.stockCode," ")}}let mM=(()=>{class e{constructor(e,t,n){this.subHandlingService=e,this.modal=t,this.productPriceAlert=n,this.selectedStock={},this.changeVisible=new h.s,this.visible=!1,this.ceilingPercentages=[],this.floorPercentages=[],this.isAlertPriceTableLoading=!0,this.DELETE="DELETE",this.UPDATE="UPDATE",this.ADD="ADD",this.action=this.ADD,this.KLSE=M.q.KLSE,this.BURSA=M.q.BURSA,this.pageIndex=1,this.pageSize=5,this.ALERT_PRICE_TAB=[{label:"Alert Price",value:"alertPrice"},{label:"Triggered",value:"triggered"}]}ngOnInit(){}onInitAfterOpenModal(){this.onAlertPriceTabChanged(this.ALERT_PRICE_TAB[0]),this.refresh()}refresh(){this.ceilingPercentage=0,this.floorPercentage=0,this.ceilingPercentages=[{label:"1%",value:1},{label:"2%",value:2},{label:"3%",value:3},{label:"4%",value:4},{label:"5%",value:5},{label:"6%",value:6},{label:"7%",value:7},{label:"8%",value:8},{label:"9%",value:9},{label:"10%",value:10},{label:"15%",value:15},{label:"20%",value:20},{label:"30%",value:30},{label:"40%",value:40},{label:"50%",value:50},{label:"60%",value:60},{label:"70%",value:70},{label:"80%",value:80},{label:"90%",value:90},{label:"100%",value:100}],this.floorPercentages=[{label:"-1%",value:-1},{label:"-2%",value:-2},{label:"-3%",value:-3},{label:"-4%",value:-4},{label:"-5%",value:-5},{label:"-6%",value:-6},{label:"-7%",value:-7},{label:"-8%",value:-8},{label:"-9%",value:-9},{label:"-10%",value:-10},{label:"-15%",value:-15},{label:"-20%",value:-20},{label:"-30%",value:-30},{label:"-40%",value:-40},{label:"-50%",value:-50},{label:"-60%",value:-60},{label:"-70%",value:-70},{label:"-80%",value:-80},{label:"-90%",value:-90},{label:"-100%",value:-100}],this.ceilingPercentagesSize=this.ceilingPercentages.length,this.floorPercentagesSize=this.floorPercentages.length,this.ceilingPrice=null,this.ceilingPercentage=null,this.floorPrice=null,this.floorPercentage=null,this.selectedPriceAlertModel=null,this.stockPriceAlertList=null,this.stockPriceAlertHistList=null,this.action=this.ADD,this.readStockPriceAlert()}handlePriceAlertCancel(){this.visible=!1,this.changeVisible.emit(this.visible)}readStockPriceAlert(){this.isAlertPriceTableLoading=!0;
5const e=this.productPriceAlert.findByAccountIdAndProductCodeAndProductType(this.getExchangeProductCode(this.selectedStock.symbol,this.selectedStock.exchange),Dv.PRODUCT_TYPE_STOCK),t=this.productPriceAlert.findByAccountIdAndProductCodeAndProductTypeAndStatus(this.getExchangeProductCode(this.selectedStock.symbol,this.selectedStock.exchange),Dv.PRODUCT_TYPE_STOCK,Dv.STATUS_TRIGGERED);this.subHandlingService.subscribe(Object(ht.a)([e,t]).pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e[0].status?e[0].data&&(this.stockPriceAlertList=e[0].data):this.createNotification("error","Unable to retrieve Stock Price Alert."),M.a.RESPONSE_SUCCESS===e[1].status?e[1].data&&(this.stockPriceAlertHistList=e[1].data):this.createNotification("error","Unable to retrieve Stock Price Alert History."),this.isAlertPriceTableLoading=!1})))}handleSubmitAlert(){if(this.action===this.ADD){if(null==this.ceilingPrice&&null==this.floorPrice)return this.createNotification("error","Ceiling or Floor Price is mandatory field.");let e={ceiling:this.ceilingPrice,floor:this.floorPrice,productCode:this.getExchangeProductCode(this.selectedStock.symbol,this.selectedStock.exchange),productType:Dv.PRODUCT_TYPE_STOCK};this.addPriceAlert(e)}else if(this.action===this.UPDATE){if(null==this.ceilingPrice&&null==this.floorPrice)return this.createNotification("error","Ceiling or Floor Price is mandatory field.");this.selectedPriceAlertModel.ceiling=this.ceilingPrice,this.selectedPriceAlertModel.floor=this.floorPrice,this.updateProductPriceAlert(this.selectedPriceAlertModel)}}onActionClick(e,t){this.selectedPriceAlertModel=e,t===this.DELETE?this.voidProductPriceAlert(this.selectedPriceAlertModel):(this.ceilingPrice=this.selectedPriceAlertModel.ceiling,this.floorPrice=this.selectedPriceAlertModel.floor,this.ceilingPriceChg(),this.floorPriceChg(),this.action=t)}onHistDeleteActionClick(e){this.subHandlingService.once(this.productPriceAlert.removeProductPriceAlertHist(e).pipe(Object(y.a)(e=>{e.status===Fv.a.SUCCESS?(this.createNotification("success",e.data),this.refresh()):this.createNotification("error","Unable to remove alert price history.")})))}addPriceAlert(e){this.subHandlingService.once(this.productPriceAlert.addProductPriceAlert(e).pipe(Object(y.a)(e=>{e.status===Fv.a.SUCCESS?(this.createNotification("success",e.data),this.refresh()):this.createNotification("error","max"===e.errorMessage?"Maximum 5 alert price.":"Unable to add alert price.")})))}voidProductPriceAlert(e){this.subHandlingService.once(this.productPriceAlert.voidProductPriceAlert(e).pipe(Object(y.a)(e=>{e.status===Fv.a.SUCCESS?(this.createNotification("success",e.data),this.refresh()):this.createNotification("error","Unable to void alert price.")})))}updateProductPriceAlert(e){this.subHandlingService.once(this.productPriceAlert.updateProductPriceAlert(e).pipe(Object(y.a)(e=>{e.status===Fv.a.SUCCESS?(this.createNotification("success",e.data),this.refresh()):this.createNotification("error","Unable to update alert price.")})))}createNotification(e,t){if("success"===e){const e=this.modal.success({nzTitle:"All Good!",nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}else if("error"===e){const e=this.modal.error({nzTitle:"Error",nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}}ceilingPriceChg(){if(this.ceilingPrice<=Number(this.selectedStock.lastPrice))return this.ceilingPrice=null,void(this.ceilingPercentage=null);this.ceilingPercentage=this.ceilingPercentageCalculation(this.ceilingPrice),this.ceilingPercentages.findIndex(e=>e.value===this.ceilingPercentage)<0&&(this.ceilingPercentages.length>this.ceilingPercentagesSize&&this.ceilingPercentages.pop(),this.ceilingPercentages.push({label:this.ceilingPercentage+"%",value:this.ceilingPercentage}))}floorPriceChg(){if(this.floorPrice>=Number(this.selectedStock.lastPrice)||this.floorPrice<=0)return this.floorPrice=null,void(this.floorPercentage=null);this.floorPercentage=-this.floorPercentageCalculation(this.floorPrice),this.floorPercentages.findIndex(e=>e.value===this.floorPercentage)<0&&(this.floorPercentages.length>this.floorPercentagesSize&&this.floorPercentages.pop(),this.floorPercentages.push({label:this.floorPercentage+"%",value:this.floorPercentage}))}getExchangeProductCode(e,t){let n=e;switch(t){case this.BURSA:n=this.KLSE+":"+n;break;default:n=t+":"+n}return n}ceilingPercentageChg(){var e,t,n,i,c;this.ceilingPrice=(M.q.NASDAQ===(null===(e=this.selectedStock)||void 0===e?void 0:e.exchange)||M.q.AMEX===(null===(t=this.selectedStock)||void 0===t?void 0:t.exchange)||M.q.NYSE===(null===(n=this.selectedStock)||void 0===n?void 0:n.exchange)||M.q.BATS===(null===(i=this.selectedStock)||void 0===i?void 0:i.exchange))&&(null===(c=this.selectedStock)||void 0===c?void 0:c.lastPrice)<1?Number(this.ceilingPriceCalculation(this.ceilingPercentage).toFixed(4)):Number(this.ceilingPriceCalculation(this.ceilingPercentage).toFixed(3))}floorPercentageChg(){var e,t,n,i,c;this.floorPrice=(M.q.NASDAQ===(null===(e=this.selectedStock)||void 0===e?void 0:e.exchange)||M.q.AMEX===(null===(t=this.selectedStock)||void 0===t?void 0:t.exchange)||M.q.NYSE===(null===(n=this.selectedStock)||void 0===n?void 0:n.exchange)||M.q.BATS===(null===(i=this.selectedStock)||void 0===i?void 0:i.exchange))&&(null===(c=this.selectedStock)||void 0===c?void 0:c.lastPrice)<1?Number(this.floorPriceCalculation(this.floorPercentage).toFixed(4)):Number(this.floorPriceCalculation(this.floorPercentage).toFixed(3))}ceilingPriceCalculation(e){return e/100*Number(this.selectedStock.lastPrice?this.selectedStock.lastPrice:this.selectedStock.closePrice)+Number(this.selectedStock.lastPrice?this.selectedStock.lastPrice:this.selectedStock.closePrice)}floorPriceCalculation(e){return Number(this.selectedStock.lastPrice?this.selectedStock.lastPrice:this.selectedStock.closePrice)+e/100*Number(this.selectedStock.lastPrice?this.selectedStock.lastPrice:this.selectedStock.closePrice)}ceilingPercentageCalculation(e){return+(100*(e/Number(this.selectedStock.lastPrice?this.selectedStock.lastPrice:this.selectedStock.closePrice)-1)).toFixed(2)}floorPercentageCalculation(e){return+(100*(1-e/Number(this.selectedStock.lastPrice?this.selectedStock.lastPrice:this.selectedStock.closePrice))).toFixed(2)}sortList(e){this.stockPriceAlertList=Object(Ov.d)(e,this.stockPriceAlertList)}sortHistList(e){this.stockPriceAlertHistList=Object(Ov.d)(e,this.stockPriceAlertHistList)}onAlertPriceTabChanged(e){this.selectedAlertPriceTab=e;for(const t of this.ALERT_PRICE_TAB)t.active=t.value===e.value}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(j.e),h.lc(Vv))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stock-price-alert-modal"]],inputs:{selectedStock:"selectedStock",visible:"visible"},outputs:{changeVisible:"changeVisible"},features:[h.Tb([l.a])],decls:3,vars:1,consts:[["nzWrapClassName","vertical-center-modal",3,"nz
5Visible","nzFooter","nzVisibleChange","nzAfterOpen","nzOnCancel",4,"ngIf"],["headerTemplate",""],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzVisibleChange","nzAfterOpen","nzOnCancel"],[4,"ngTemplateOutlet"],["nzCompact","",1,"pb-2"],["nzLabelPlaceholder","Ceiling(Higher Than)","nzSize","small",1,"w-50"],["onPaste","return false","ui-input","","type","number",1,"input-without-handler","text-black","font-weight-bold",3,"ngModel","min","ngModelChange","change"],["nzSize","small","nzPlaceHolder","Please select",1,"w-50",3,"ngModel","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzLabelPlaceholder","Floor(Lower Than)","nzSize","small",1,"w-50"],["onPaste","return false","ui-input","","type","number","min","0",1,"input-without-handler","text-black","font-weight-bold",3,"ngModel","max","ngModelChange","change"],[1,"pb-2"],[1,"text-sm"],[1,"text-right","pb-2"],["nz-button","","nzType","outline","nzSize","small",1,"mx-2",3,"click"],["nz-button","","nzType","primary","nzSize","small",1,"ml-2",3,"click"],[3,"ngSwitch"],[4,"ngSwitchCase"],["nzType","flex",1,"mb-2","overflow-x-auto","flex-nowrap"],[1,"align-self-stretch","d-inline-block"],[3,"loading","tabOptions","onTabChanged"],["nzSize","small","nzShowPagination","false",3,"nzData","nzScroll",4,"ngIf"],["nzSize","small",3,"nzData","nzPageSize","nzShowPagination","nzPageIndex","nzTotal","nzShowTotal","nzScroll","nzPageSizeChange","nzPageIndexChange","nzTotalChange",4,"ngIf"],["rangeTemplate",""],[3,"nzLabel","nzValue"],["nzSize","small","nzShowPagination","false",3,"nzData","nzScroll"],["stockPriceAlertTable",""],[3,"nzSortChange"],["nzShowSort","","nzSortKey","ceiling"],["nzShowSort","","nzSortKey","floor"],[4,"ngFor","ngForOf"],[3,"click"],[1,"pl-2"],["nzSize","small",3,"nzData","nzPageSize","nzShowPagination","nzPageIndex","nzTotal","nzShowTotal","nzScroll","nzPageSizeChange","nzPageIndexChange","nzTotalChange"],["stockPriceAlertHistTable",""],["nzShowSort","","nzSortKey","triggeredDate"],[1,"pb-3",3,"nzSpan"],[1,"text-base","font-weight-bold"]],template:function(e,t){1&e&&(h.od(0,hM,30,19,"nz-modal",0),h.od(1,pM,7,4,"ng-template",null,1,h.pd)),2&e&&h.Mc("ngIf",t.visible)},directives:[p.t,j.a,p.A,Pn.c,ae.c,oe.z,oe.c,ae.b,oe.t,oe.w,Xv.d,p.s,P.c,_.a,p.x,p.y,P.a,Jv.a,Xv.a,ve.a,ve.f,ve.g,ve.e,ve.c,ve.d],pipes:[p.F,Ig.a,p.f],encapsulation:2}),e})();var fM=n("rOij"),gM=n("F/iD"),bM=n("PqYM"),SM=n("nxWS"),yM=n("+oEP"),vM=n("W9fG"),MM=n("QlLE"),CM=n("XJtf"),qM=n("Q8cG"),TM=n("vKlF");function wM(e,t){1&e&&h.mc(0,"th",17)}function zM(e,t){if(1&e&&(h.rc(0,"th",21),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Nc("nzSortKey",e.key),h.Mc("nzShowSort",!0)("nzAlign",e.align),h.Ub(1),h.rd(e.colName)}}function DM(e,t){if(1&e&&(h.rc(0,"th",22),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Nc("nzSortKey",e.key),h.Mc("nzShowSort",!0)("nzAlign",e.align),h.Ub(1),h.rd(e.colName)}}function PM(e,t){if(1&e&&(h.pc(0),h.od(1,zM,2,4,"th",19),h.od(2,DM,2,4,"th",20),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf",e.checked&&"stockName"!==e.key),h.Ub(1),h.Mc("ngIf",e.checked&&"stockName"===e.key)}}function IM(e,t){if(1&e){const e=h.sc();h.rc(0,"img",34),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(2).snapSelectedData(t)})),h.qc()}2&e&&h.Mc("src","assets/images/stocks/snap.svg",h.gd)("nzTitle","Live Snap: One-time refresh of live prices of your selected Stocks/ETFs")}function kM(e,t){1&e&&h.nc(0)}const AM=function(e,t){return{index:e,exchange:t}};function EM(e,t){if(1&e&&(h.rc(0,"td"),h.od(1,IM,1,2,"img",32),h.od(2,kM,1,0,"ng-container",33),h.qc()),2&e){const e=h.Dc(),t=e.$implicit,n=e.index,i=h.Dc(2),c=h.ad(25);h.Ub(1),h.Mc("ngIf",i.displaySnapButton(t)),h.Ub(1),h.Mc("ngTemplateOutlet",c)("ngTemplateOutletContext",h.Tc(3,AM,n,null==t?null:t.exchange))}}function FM(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Ub(1),h.sd(" ",n.isZero(t[e.key])?"-":h.Gc(2,1,t[e.key],null==t?null:t.exchange)," ")}}function OM(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Ub(1),h.rd(n.isZero(t[e.key])?"-":t[e.key])}}function UM(e,t){if(1&e&&h.od(0,OM,2,1,"span",2),2&e){const e=h.Dc(3).$implicit;h.Mc("ngIf",e)}}function xM(e,t){if(1&e&&(h.rc(0,"td",37),h.od(1,FM,3,4,"span",38),h.od(2,UM,1,1,"ng-template",null,39,h.pd),h.qc()),2&e){const e=h.ad(3),t=h.Dc().$implicit;
5h.Mc("nzAlign",t.align),h.Ub(1),h.Mc("ngIf","openPrice"===t.key||"closePrice"===t.key||"dayHigh"===t.key||"dayLow"===t.key)("ngIfElse",e)}}function LM(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-row"),h.rc(2,"span",43),h.qd(3),h.Ec(4,"number"),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(5).$implicit;h.Ub(3),h.rd(h.Gc(4,1,e.changePercentage,"1.3-3")+"%")}}function RM(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-row"),h.rc(2,"span",44),h.qd(3),h.Ec(4,"number"),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(5).$implicit;h.Ub(3),h.sd("+",h.Gc(4,1,e.changePercentage,"1.3-3")+"%","")}}function NM(e,t){if(1&e&&(h.pc(0),h.od(1,LM,5,4,"ng-container",2),h.od(2,RM,5,4,"ng-container",2),h.oc()),2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit;h.Ub(1),h.Mc("ngIf",t[e.key]<0),h.Ub(1),h.Mc("ngIf",t[e.key]>0)}}function BM(e,t){1&e&&(h.pc(0),h.rc(1,"nz-row"),h.rc(2,"span"),h.qd(3),h.qc(),h.qc(),h.oc()),2&e&&(h.Ub(3),h.rd("-"))}function _M(e,t){if(1&e&&(h.rc(0,"td",37),h.od(1,NM,3,2,"ng-container",2),h.od(2,BM,4,1,"ng-container",2),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("nzAlign",e.align),h.Ub(1),h.Mc("ngIf",t[e.key]),h.Ub(1),h.Mc("ngIf",!t[e.key]||n.isZero(t[e.key]))}}function VM(e,t){1&e&&h.nc(0)}function HM(e,t){if(1&e&&(h.rc(0,"div"),h.od(1,VM,1,0,"ng-container",48),h.qc()),2&e){h.Dc();const e=h.ad(3);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function $M(e,t){if(1&e&&h.mc(0,"img",52),2&e){const e=h.Dc(7);h.Mc("src",e.SHARIAH_COMPLAINT_IMG_PATH+"shariah-stock.svg",h.gd)}}function jM(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1),h.Ec(2,"date"),h.qc()),2&e){const e=h.Dc(6).$implicit;h.Ub(1),h.sd("Delayed streaming will resume after 15 minutes at ",h.Gc(2,1,null==e?null:e.endSnapDate,"hh:mm a"),"")}}function GM(e,t){if(1&e&&(h.pc(0),h.mc(1,"br"),h.rc(2,"span",53),h.qd(3),h.Ec(4,"date"),h.mc(5,"i",54),h.qc(),h.od(6,jM,3,4,"ng-template",null,55,h.pd),h.oc()),2&e){const e=h.ad(7),t=h.Dc(5).$implicit;h.Ub(3),h.sd("Last Snapped: ",h.Gc(4,2,null==t?null:t.lastSnapDate,"hh:mm a")," "),h.Ub(2),h.Mc("nzTooltipTitle",e)}}function WM(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row"),h.rc(1,"a",49),h.zc("click",(function(){h.dd(e);const t=h.Dc(4).$implicit;return h.Dc(2).navigateToStocksFactsheet(null==t?null:t.stockName,null==t?null:t.exchange,null==t?null:t.stockCode)})),h.qd(2),h.qc(),h.od(3,$M,1,1,"img",50),h.od(4,GM,8,5,"ng-container",2),h.qc(),h.rc(5,"nz-row"),h.rc(6,"small",51),h.qd(7),h.qc(),h.qc()}if(2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Ub(2),h.rd(t[e.key]),h.Ub(1),h.Mc("ngIf","Y"===(null==t?null:t.shariahCompliantIndicator)),h.Ub(1),h.Mc("ngIf",(null==t?null:t.endSnapDate)>n.dateNow),h.Ub(3),h.rd(t[2])}}function YM(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row"),h.rc(1,"a",56),h.zc("click",(function(){h.dd(e);const t=h.Dc(4).$implicit;return h.Dc(2).navigateToStocksFactsheet(null==t?null:t.stockName,null==t?null:t.exchange,null==t?null:t.stockCode)})),h.qd(2),h.qc(),h.qc(),h.rc(3,"nz-row"),h.rc(4,"small",51),h.qd(5),h.qc(),h.qc()}if(2&e){const e=h.Dc(4).$implicit,t=h.Dc(2);h.Ub(1),h.Mc("nzTooltipTitle",null==e?null:e.stockName),h.Ub(1),h.rd(t.truncateStockName(e.stockName,20)),h.Ub(3),h.rd(e[2])}}function KM(e,t){if(1&e&&(h.rc(0,"td",45),h.od(1,HM,2,1,"div",38),h.od(2,WM,8,4,"ng-template",null,46,h.pd),h.od(4,YM,6,3,"ng-template",null,47,h.pd),h.qc()),2&e){const e=h.ad(5),t=h.Dc(2).$implicit,n=h.Dc().$implicit,i=h.Dc(2);h.Mc("nzAlign",t.align),h.Ub(1),h.Mc("ngIf",n.exchange===i.HKEX||n.exchange===i.KLSE||n.exchange===i.BURSA)("ngIfElse",e)}}const XM=function(e){return{"disabled-buy-sell":e}};function QM(e,t){if(1&e){const e=h.sc();h.rc(0,"td",37),h.pc(1),h.rc(2,"p",57),h.zc("click",(function(){h.dd(e);const t=h.Dc(3).$implicit;return h.Dc(2).transactionModalEmitter(t,!1)})),h.rc(3,"span",58),h.qd(4,"S"),h.qc(),h.rc(5,"span",59),h.qd(6),h.Ec(7,"stockPrice"),h.qc(),h.qc(),h.oc(),h.qc()}if(2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,i=h.Dc(2);var n=null;const c=h.Sc(7,XM,!(t.exchange!==i.SSE&&t.exchange!==i.SZSE||null!=(n=i.handleTradingInfo(t.tradingInfo,t.exchange))&&n.sell));h.Mc("nzAlign",e.align),h.Ub(2),h.Mc("ngClass",c),h.Ub(3),h.Mc("ngClass",t.changedColor&&t.changedColor[e.key]?t.changedColor[e.key]:"ask-price w-70"),h.Ub(1),h.rd(i.isZero(t[e.key])||!t[e.key]?"-":h.Gc(7,4,t[e.key],null==t?null:t.exchange))}}function ZM(e,t){if(1&e&&(h.mc(0,"app-stock-exchange-tag",61),h.Ec(1,"displayExchangeName")),2&e){const e=h.Dc(4).$implicit;
5h.Mc("exchange",h.Fc(1,1,null==e?null:e.exchange))}}function JM(e,t){if(1&e&&(h.rc(0,"td"),h.od(1,ZM,2,3,"app-stock-exchange-tag",60),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.Mc("ngIf",null==e?null:e.exchange)}}function eC(e,t){if(1&e&&(h.rc(0,"td",37),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("nzAlign",e.align),h.Ub(2),h.rd(n.isZero(t[e.key])?"-":h.Gc(3,2,t[e.key],"1."))}}function tC(e,t){if(1&e&&(h.rc(0,"td",37),h.rc(1,"span",59),h.qd(2),h.Ec(3,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("nzAlign",e.align),h.Ub(1),h.Mc("ngClass",t.changedColor&&t.changedColor[e.key]?t.changedColor[e.key]:"px-2 py-1"),h.Ub(1),h.rd(n.isZero(t[e.key])?"-":h.Gc(3,3,t[e.key],"1."))}}function nC(e,t){if(1&e&&(h.rc(0,"td",37),h.rc(1,"span",59),h.qd(2),h.Ec(3,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("nzAlign",e.align),h.Ub(1),h.Mc("ngClass",t.changedColor&&t.changedColor[e.key]?t.changedColor[e.key]:"px-2 py-1"),h.Ub(1),h.rd(n.isZero(t[e.key])?"-":h.Gc(3,3,t[e.key],"1."))}}function iC(e,t){if(1&e&&(h.rc(0,"td",37),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("nzAlign",e.align),h.Ub(2),h.rd(n.isZero(t[e.key])?"-":h.Fc(3,2,t[e.key]))}}function cC(e,t){if(1&e){const e=h.sc();h.rc(0,"td",37),h.pc(1),h.rc(2,"p",57),h.zc("click",(function(){h.dd(e);const t=h.Dc(3).$implicit;return h.Dc(2).transactionModalEmitter(t,!0)})),h.rc(3,"span",62),h.qd(4,"B"),h.qc(),h.rc(5,"span",59),h.qd(6),h.Ec(7,"stockPrice"),h.qc(),h.qc(),h.oc(),h.qc()}if(2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,i=h.Dc(2);var n=null;const c=h.Sc(7,XM,!(t.exchange!==i.SSE&&t.exchange!==i.SZSE||null!=(n=i.handleTradingInfo(t.tradingInfo,t.exchange))&&n.buy));h.Mc("nzAlign",e.align),h.Ub(2),h.Mc("ngClass",c),h.Ub(3),h.Mc("ngClass",t.changedColor&&t.changedColor[e.key]?t.changedColor[e.key]:"bid-price w-70"),h.Ub(1),h.rd(i.isZero(t[e.key])||!t[e.key]?"-":h.Gc(7,4,t[e.key],null==t?null:t.exchange))}}function oC(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-row"),h.rc(2,"span",43),h.qd(3),h.Ec(4,"stockPrice"),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(4).$implicit,t=h.Dc().$implicit;h.Ub(3),h.rd(h.Hc(4,1,t[e.key],null==t?null:t.exchange,t.lastPrice))}}function sC(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-row"),h.rc(2,"span",44),h.qd(3),h.Ec(4,"stockPrice"),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(4).$implicit,t=h.Dc().$implicit;h.Ub(3),h.sd("+",h.Hc(4,1,t[e.key],null==t?null:t.exchange,t.lastPrice),"")}}function aC(e,t){if(1&e&&(h.pc(0),h.od(1,oC,5,5,"ng-container",2),h.od(2,sC,5,5,"ng-container",2),h.oc()),2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit;h.Ub(1),h.Mc("ngIf",t[e.key]<0),h.Ub(1),h.Mc("ngIf",t[e.key]>0)}}function lC(e,t){1&e&&(h.pc(0),h.rc(1,"nz-row"),h.rc(2,"span"),h.qd(3),h.qc(),h.qc(),h.oc()),2&e&&(h.Ub(3),h.rd("-"))}function rC(e,t){if(1&e&&(h.rc(0,"td",37),h.od(1,aC,3,2,"ng-container",2),h.od(2,lC,4,1,"ng-container",2),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("nzAlign",e.align),h.Ub(1),h.Mc("ngIf",t[e.key]),h.Ub(1),h.Mc("ngIf",!t[e.key]||n.isZero(t[e.key]))}}function dC(e,t){if(1&e&&(h.rc(0,"span",59),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc(4).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("ngClass",t.changedColor&&t.changedColor.lastPrice?t.changedColor[e.key]:"text-profit font-weight-bold px-2 py-1"),h.Ub(1),h.sd(" ",n.isZero(t[e.key])?"-":h.Gc(2,2,t[e.key],null==t?null:t.exchange),"")}}function uC(e,t){if(1&e&&(h.rc(0,"span",59),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc(4).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("ngClass",t.changedColor&&t.changedColor.lastPrice?t.changedColor[e.key]:"text-loss font-weight-bold px-2 py-1"),h.Ub(1),h.sd(" ",n.isZero(t[e.key])?"-":h.Gc(2,2,t[e.key],null==t?null:t.exchange),"")}}function hC(e,t){if(1&e&&(h.pc(0),h.od(1,dC,3,5,"span",64),h.od(2,uC,3,5,"span",64),h.oc()),2&e){const e=h.Dc(4).$implicit;h.Ub(1),h.Mc("ngIf",e.change>0),h.Ub(1),h.Mc("ngIf",e.change<0)}}function pC(e,t){if(1&e&&(h.rc(0,"span",59),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit,n=h.Dc(2);h.Mc("ngClass",t.changedColor&&t.changedColor.lastPrice?t.changedColor.lastPrice:"font-weight-bold px-2 py-1"),h.Ub(1),h.sd(" ",n.isZero(t[e.key])?"-":h.Gc(2,2,t[e.key],null==t?null:t.exchange),"")}}function mC(e,t){if(1&e&&(h.rc(0,"td",37),h.od(1,hC,3,2,"ng-container",38),h.od(2,pC,3,5,"ng-template",null,63,h.pd),h.qc()),2&e){const e=h.ad(3),t=h.Dc(2).$implicit,n=h.Dc().$implicit;h.Mc("nzAlign",t.align),h.Ub(1),h.Mc("ngIf",n.change>0||n.change<0)("ngIfElse",e)}}function fC(e,t){if(1&e&&(h.rc(0,"span",66),h.qd(1," Insti Pro "),h.qc()),2&e){h.Dc(6);const e=h.ad(31);h.Mc("nzTooltipTitle",e)}}function gC(e,t){if(1&e&&(h.rc(0,"span",66),h.qd(1," Buy Only "),h.qc()),2&e){h.Dc(6);const e=h.ad(29);h.Mc("nzTooltipTitle",e)}}function bC(e,t){if(1&e&&(h.rc(0,"span",66),h.qd(1," Sell Only "),h.qc()),2&e){h.Dc(6);const e=h.ad(27);h.Mc("nzTooltipTitle",e)}}function SC(e,t){1&e&&(h.rc(0,"span"),h.qd(1," - "),h.qc())}function yC(e,t){if(1&e&&(h.rc(0,"td",37),h.od(1,fC,2,1,"span",65),h.od(2,gC,2,1,"span",65),h.od(3,bC,2,1,"span",65),h.od(4,SC,2,0,"span",2),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,s=h.Dc(2);var n;const a=null==(n=s.handleTradingInfo(t[e.key],t.exchange))?null:n.instiPro;var i=null;const l=(null==(i=s.handleTradingInfo(t[e.key],t.exchange))?null:i.buy)&&!(null!=(i=s.handleTradingInfo(t[e.key],t.exchange))&&i.sell);var c=null;const r=!(null!=(c=s.handleTradingInfo(t[e.key],t.exchange))&&c.buy)&&(null==(c=s.handleTradingInfo(t[e.key],t.exchange))?null:c.sell);var o=null;const d=!s.handleTradingInfo(t[e.key],t.exchange)||(null==(o=s.handleTradingInfo(t[e.key],t.exchange))?null:o.buy)&&(null==(o=s.handleTradingInfo(t[e.key],t.exchange))?null:o.sell);h.Mc("nzAlign",e.align),h.Ub(1),h.Mc("ngIf",a),h.Ub(1),h.Mc("ngIf",l),h.Ub(1),h.Mc("ngIf",r),h.Ub(1),h.Mc("ngIf",d)}}function vC(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-row"),h.qd(2),h.Ec(3,"number"),h.Ec(4,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(5).$implicit,t=h.Dc(2);h.Ub(2),h.td("B - ",h.Gc(3,2,t.sentimentCounter(e.bidQuantity,e.askQuantity,"bid"),"1.0-0"),"% S - ",h.Gc(4,5,t.sentimentCounter(e.bidQuantity,e.askQuantity,"ask"),"1.0-0"),"% ")}}function MC(e,t){if(1&e&&h.od(0,vC,5,8,"ng-container",2),2&e){const e=h.Dc(4).$implicit;h.Mc("ngIf",e.bidQuantity&&e.askQuantity)}}function CC(e,t){if(1&e&&(h.rc(0,"td",67),h.rc(1,"nz-row"),h.mc(2,"nz-progress",68),h.qc(),h.od(3,MC,1,1,"ng-template",null,69,h.pd),h.qc()),2&e){const e=h.ad(4),t=h.Dc(3).$implicit,n=h.Dc(2);h.Mc("nzPopoverTitle",null)("nzPopoverContent",e),h.Ub(2),h.Mc("nzShowInfo",!1)("nzStrokeColor","green")("nzPercent",n.sentimentCounter(t.bidQuantity,t.askQuantity,"bid"))}}function qC(e,t){if(1&e&&(h.od(0,_M,3,3,"td",40),h.od(1,KM,6,3,"td",41),h.od(2,QM,8,9,"td",40),h.od(3,JM,2,1,"td",2),h.od(4,eC,4,5,"td",40),h.od(5,tC,4,6,"td",40),h.od(6,nC,4,6,"td",40),h.od(7,iC,4,4,"td",40),h.od(8,cC,8,9,"td",40),h.od(9,rC,3,3,"td",40),h.od(10,mC,4,3,"td",40),h.od(11,yC,5,5,"td",40),h.od(12,CC,5,5,"td",42)),2&e){const e=h.Dc().$implicit,t=h.Dc().$implicit;h.Mc("ngIf",t&&e.checked&&"changePercentage"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"stockName"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"bidPrice"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"exchange"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"cumulativeVolume"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"bidQuantity"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"askQuantity"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"lotSize"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"askPrice"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"change"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"lastPrice"
5===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"tradingInfo"===e.key),h.Ub(1),h.Mc("ngIf",t&&e.checked&&"sentiment"===e.key)}}function TC(e,t){if(1&e&&(h.pc(0),h.od(1,xM,4,3,"td",35),h.od(2,qC,13,13,"ng-template",null,36,h.pd),h.oc()),2&e){const e=t.$implicit,n=h.ad(3),i=h.Dc().$implicit,c=h.Dc(2);h.Ub(1),h.Mc("ngIf",i&&e.checked&&!c.isFunctionalCol(e.key))("ngIfElse",n)}}function wC(e,t){if(1&e){const e=h.sc();h.rc(0,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(3).handleWatchlistModalVisible()})),h.qd(1,"Add to Watchlist "),h.qc()}}function zC(e,t){if(1&e){const e=h.sc();h.rc(0,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(3).deleteItemFromWatchList()})),h.qd(1,"Remove From Watchlist"),h.qc()}}function DC(e,t){if(1&e){const e=h.sc();h.rc(0,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(3).showMarketDepth()})),h.qd(1,"Market Depth"),h.qc()}}function PC(e,t){if(1&e){const e=h.sc();h.rc(0,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(3).showMarketDepth()})),h.qd(1,"Price Chart"),h.qc()}}function IC(e,t){if(1&e){const e=h.sc();h.rc(0,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(3).showTimeAndSalesModal()})),h.qd(1,"Time & Sales"),h.qc()}}function kC(e,t){if(1&e){const e=h.sc();h.rc(0,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(3).showSummaryModal()})),h.qd(1,"Summary"),h.qc()}}function AC(e,t){if(1&e){const e=h.sc();h.rc(0,"span",70),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).handlePriceAlertModalVisible(t)})),h.qd(1),h.qc()}if(2&e){const e=h.Dc().$implicit;h.Mc("nzTitle",!0===e.hasPriceAlert?"Price Alert: Yes":"Price Alert: No"),h.Ub(1),h.rd(!0===e.hasPriceAlert?"Price Alert: Yes":"Price Alert: No")}}function EC(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"tr",23),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onSelectStockInfoRow(n)}))("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).setSelectedItem(n)})),h.od(2,EM,3,6,"td",2),h.od(3,TC,4,2,"ng-container",16),h.rc(4,"td"),h.rc(5,"button",24),h.zc("mouseover",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).setSelectedItemMouseOver(n)})),h.mc(6,"i",25),h.qc(),h.rc(7,"nz-dropdown-menu",null,26),h.rc(9,"ul",27),h.od(10,wC,2,0,"li",28),h.od(11,zC,2,0,"li",28),h.od(12,DC,2,0,"li",28),h.od(13,PC,2,0,"li",28),h.od(14,IC,2,0,"li",28),h.od(15,kC,2,0,"li",28),h.rc(16,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(2).navigateToTechnicalChart()})),h.qd(17,"Technical Chart"),h.qc(),h.rc(18,"li",29),h.zc("click",(function(){return h.dd(e),h.Dc(2).handleCalculatorVisible()})),h.qd(19,"Calculator"),h.qc(),h.rc(20,"li",30),h.od(21,AC,2,2,"span",31),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.oc()}if(2&e){const e=t.$implicit,n=h.ad(8),i=h.Dc(2);h.Ub(2),h.Mc("ngIf","all"===i.selectedExchange||i.displaySnapButton(e)),h.Ub(1),h.Mc("ngForOf",i.fieldNames),h.Ub(2),h.Mc("nzDropdownMenu",n),h.Ub(5),h.Mc("ngIf",!i.isWatchListSelected()),h.Ub(1),h.Mc("ngIf",i.isWatchListSelected()),h.Ub(1),h.Mc("ngIf",e&&i.checkDropdownList(e.exchange,i.StockConstant.MARKET_DEPTH)),h.Ub(1),h.Mc("ngIf",e&&i.checkDropdownList(e.exchange,i.StockConstant.PRICE_CHART)),h.Ub(1),h.Mc("ngIf",e&&i.checkDropdownList(e.exchange,i.StockConstant.TIME_AND_SALES)),h.Ub(1),h.Mc("ngIf",e&&i.checkDropdownList(e.exchange,i.StockConstant.SUMMARY)),h.Ub(6),h.Mc("ngIf",e)}}const FC=function(e){return{"display-pop-up-note":e}},OC=function(){return[]},UC=function(){return{x:"600px"}};function xC(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-table",12,13),h.rc(2,"thead",14),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc().sortByKey(t)})),h.rc(3,"tr"),h.od(4,wM,1,0,"th",15),h.od(5,PM,3,2,"ng-container",16),h.mc(6,"th",17),h.qc(),h.qc(),h.rc(7,"tbody",18),h.od(8,EC,22,10,"ng-container",16),h.qc(),h.qc()}if(2&e){const e=h.ad(1),t=h.Dc(),n=h.ad(23);h.Mc("ngClass",h.Sc(9,FC,t.liveSnapNoteVisible&&!t.isHkexLivestreaming&&e.data.length>0))("nzData",t.isBATSStock()?h.Rc(11,OC):t.stocks)("nzLoading",t.isLoading)("nzShowPagination",!1)("nzScroll",h.Rc(12,UC))("nzNoResult",n),h.Ub(4),h.Mc("ngIf",t.selectedExchange===t.HKEX&&!t.isHkexLivestreaming||"all"===t.selectedExchange),h.Ub(1),h.Mc("ngForOf",t.fieldNames),h.Ub(3),h.Mc("ngForOf",e.data)}}function LC(e,t){1&e&&h.nc(0)}function RC(e,t){if(1&e&&(h.rc(0,"div"),h.od(1,LC,1,0,"ng-container",48),h.qc()),2&e){h.Dc();const e=h.ad(16);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function NC(e,t){if(1&e&&(h.mc(0,"app-stock-exchange-tag",61),h.Ec(1,"displayExchangeName")),2&e){const e=h.Dc(2).$implicit;
5h.Mc("exchange",h.Fc(1,1,null==e?null:e.exchange))}}function BC(e,t){if(1&e&&h.mc(0,"img",87),2&e){const e=h.Dc(5);h.Mc("src",e.SHARIAH_COMPLAINT_IMG_PATH+"shariah-stock.svg",h.gd)}}function _C(e,t){if(1&e&&(h.pc(0),h.mc(1,"br"),h.rc(2,"span",53),h.qd(3),h.Ec(4,"date"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(3),h.sd("Last Snapped: ",h.Gc(4,1,null==e?null:e.lastSnapDate,"hh:mm"),"")}}function VC(e,t){if(1&e){const e=h.sc();h.od(0,NC,2,3,"app-stock-exchange-tag",60),h.rc(1,"a",85),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(3).navigateToStocksFactsheet(null==t?null:t.stockName,null==t?null:t.exchange,null==t?null:t.stockCode)})),h.qd(2),h.qc(),h.od(3,BC,1,1,"img",86),h.od(4,_C,5,4,"ng-container",2)}if(2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Mc("ngIf",null==e?null:e.exchange),h.Ub(2),h.rd(e.stockName),h.Ub(1),h.Mc("ngIf","Y"===(null==e?null:e.shariahCompliantIndicator)),h.Ub(1),h.Mc("ngIf",(null==e?null:e.endSnapDate)>t.dateNow)}}function HC(e,t){if(1&e&&(h.mc(0,"app-stock-exchange-tag",61),h.Ec(1,"displayExchangeName")),2&e){const e=h.Dc(2).$implicit;h.Mc("exchange",h.Fc(1,1,null==e?null:e.exchange))}}function $C(e,t){if(1&e){const e=h.sc();h.rc(0,"img",92),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(3).snapSelectedData(t)})),h.qc()}2&e&&h.Mc("src","assets/images/stocks/snap.svg",h.gd)}function jC(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row"),h.od(1,HC,2,3,"app-stock-exchange-tag",60),h.rc(2,"a",88),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(3).navigateToStocksFactsheet(null==t?null:t.stockName,null==t?null:t.exchange,null==t?null:t.stockCode)})),h.qd(3),h.qc(),h.od(4,$C,1,1,"img",89),h.qc(),h.rc(5,"nz-row",90),h.rc(6,"p",91),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(3).navigateToStocksFactsheet(null==t?null:t.stockName,null==t?null:t.exchange,null==t?null:t.stockCode)})),h.qd(7),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.Mc("ngIf",null==e?null:e.exchange),h.Ub(2),h.rd(e.stockCode),h.Ub(1),h.Mc("ngIf",t.displaySnapButton(e)),h.Ub(3),h.rd(t.truncateStockName(e.stockName,40))}}function GC(e,t){if(1&e&&(h.rc(0,"span",59),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Mc("ngClass",e.changedColor&&e.changedColor.lastPrice?e.changedColor.lastPrice:"text-profit font-weight-bold px-2 py-1"),h.Ub(1),h.sd(" ",h.Gc(2,2,e.lastPrice,null==e?null:e.exchange),"")}}function WC(e,t){if(1&e&&(h.rc(0,"span",59),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Mc("ngClass",e.changedColor&&e.changedColor.lastPrice?e.changedColor.lastPrice:"text-loss font-weight-bold px-2 py-1"),h.Ub(1),h.rd(h.Gc(2,2,e.lastPrice,null==e?null:e.exchange))}}function YC(e,t){if(1&e&&(h.pc(0),h.od(1,GC,3,5,"span",64),h.od(2,WC,3,5,"span",64),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Mc("ngIf",e.change>0),h.Ub(1),h.Mc("ngIf",e.change<0)}}function KC(e,t){if(1&e&&(h.rc(0,"span",59),h.qd(1),h.Ec(2,"stockPrice"),h.qc()),2&e){const e=h.Dc().$implicit;h.Mc("ngClass",e.changedColor&&e.changedColor.lastPrice?e.changedColor.lastPrice:"font-weight-bold px-2 py-1"),h.Ub(1),h.sd(" ",h.Gc(2,2,e.lastPrice,null==e?null:e.exchange),"")}}function XC(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",43),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"span",43),h.qd(5),h.Ec(6,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(2),h.sd("",h.Hc(3,2,e.change,null==e?null:e.exchange,e.lastPrice)," "),h.Ub(3),h.sd("(",h.Gc(6,6,e.changePercentage,"1.3-3")+"%",")")}}function QC(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",44),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"span",44),h.qd(5),h.Ec(6,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(2),h.sd("+",h.Hc(3,2,e.change,null==e?null:e.exchange,e.lastPrice)," "),h.Ub(3),h.sd("(+",h.Gc(6,6,e.changePercentage,"1.3-3")+"%",")")}}function ZC(e,t){if(1&e&&(h.pc(0),h.od(1,XC,7,9,"ng-container",2),h.od(2,QC,7,9,"ng-container",2),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Mc("ngIf",e.change<0),h.Ub(1),h.Mc("ngIf",e.change>0)}}function JC(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"stockPrice"),h.qc(),h.rc(4,"span"),h.qd(5,"(0.000%)"),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(2),h.sd("",h.Hc(3,1,e.change,null==e?null:e.exchange,e.lastPrice)," ")}}function eq(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1," Insti Pro "),h.mc(2,"i",94),h.qc()),2&e){h.Dc(5);const e=h.ad(31);h.Ub(2),h.Mc("nzTooltipTitle",e)}}function tq(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1," Buy Only "),h.mc(2,"i",94),h.qc()),2&e){h.Dc(5);const e=h.ad(29);h.Ub(2),h.Mc("nzTooltipTitle",e)}}function nq(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1," Sell Only "),h.mc(2,"i",94),h.qc()),2&e){h.Dc(5);const e=h.ad(27);h.Ub(2),h.Mc("nzTooltipTitle",e)}}function iq(e,t){if(1&e&&(h.pc(0),h.rc(1,"p",93),h.qd(2," Trading Info: "),h.od(3,eq,3,1,"span",2),h.od(4,tq,3,1,"span",2),h.od(5,nq,3,1,"span",2),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);var n;const o=null==(n=t.handleTradingInfo(e.tradingInfo,e.exchange))?null:n.instiPro;var i=null;const s=(null==(i=t.handleTradingInfo(e.tradingInfo,e.exchange))?null:i.buy)&&!(null!=(i=t.handleTradingInfo(e.tradingInfo,e.exchange))&&i.sell);var c=null;const a=!(null!=(c=t.handleTradingInfo(e.tradingInfo,e.exchange))&&c.buy)&&(null==(c=t.handleTradingInfo(e.tradingInfo,e.exchange))?null:c.sell);h.Ub(3),h.Mc("ngIf",o),h.Ub(1),h.Mc("ngIf",s),h.Ub(1),h.Mc("ngIf",a)}}function cq(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1),h.Ec(2,"date"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd("Delayed streaming will resume after 15 minutes at ",h.Gc(2,1,null==e?null:e.endSnapDate,"hh:mm a"),"")}}function oq(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"span",95),h.zc("click",(function(){h.dd(e);const t=h.ad(7);return h.Dc(4).displayMobileSnapMsg(t)})),h.rc(2,"a",96),h.qd(3),h.Ec(4,"date"),h.qc(),h.mc(5,"i",97),h.qc(),h.od(6,cq,3,4,"ng-template",null,55,h.pd),h.oc()}if(2&e){const e=h.Dc().$implicit;h.Ub(3),h.sd("Last Snapped: ",h.Gc(4,1,null==e?null:e.lastSnapDate,"hh:mm"),"")}}function sq(e,t){if(1&e){const e=h.sc();h.rc(0,"a",104),h.zc("click",(function(){return h.dd(e),h.Dc(5).handleWatchlistModalVisible()})),h.qd(1,"Add To Watchlist"),h.qc()}}function aq(e,t){if(1&e){const e=h.sc();h.rc(0,"a",104),h.zc("click",(function(){return h.dd(e),h.Dc(5).showMarketDepth()})),h.qd(1),h.qc()}2&e&&(h.Ub(1),h.rd("Stock"))}function lq(e,t){if(1&e){const e=h.sc();h.rc(0,"a",104),h.zc("click",(function(){return h.dd(e),h.Dc(5).showTimeAndSalesModal()})),h.qd(1),h.qc()}2&e&&(h.Ub(1),h.rd("Time & Sales"))}function rq(e,t){if(1&e){const e=h.sc();h.rc(0,"a",104),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(3).navigateToStocksFactsheet(null==t?null:t.stockName,null==t?null:t.exchange,null==t?null:t.stockCode)})),h.qd(1),h.qc()}2&e&&(h.Ub(1),h.rd("Factsheet"))}function dq(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row"),h.rc(1,"highcharts-chart",105),h.zc("updateChange",(function(t){return h.dd(e),h.Dc(5).updateFlag=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(5);
5h.Ub(1),h.Mc("Highcharts",e.Highcharts)("options",e.chartOptions)("runOutsideAngular",!0)("oneToOne",!0)("update",e.updateFlag)}}function uq(e,t){if(1&e&&(h.pc(0),h.mc(1,"nz-divider",98),h.rc(2,"nz-row",99),h.rc(3,"nz-col",100),h.od(4,sq,2,0,"a",101),h.qc(),h.mc(5,"nz-col",102),h.rc(6,"nz-col",103),h.od(7,aq,2,1,"a",101),h.od(8,lq,2,1,"a",101),h.od(9,rq,2,1,"a",101),h.qc(),h.qc(),h.od(10,dq,2,5,"nz-row",2),h.oc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(3),h.Mc("nzSpan",8),h.Ub(1),h.Mc("ngIf",!t.isWatchListSelected()),h.Ub(1),h.Mc("nzSpan",8),h.Ub(1),h.Mc("nzSpan",8),h.Ub(1),h.Mc("ngIf",e.exchange===t.KLSE||e.exchange===t.SGX),h.Ub(1),h.Mc("ngIf",e.exchange===t.HKEX||e.exchange===t.SSE||e.exchange===t.SZSE),h.Ub(1),h.Mc("ngIf",e.exchange!==t.KLSE&&e.exchange!==t.HKEX&&e.exchange!==t.SGX&&e.exchange!==t.SSE&&e.exchange!==t.SZSE),h.Ub(1),h.Mc("ngIf",!t.isPriceChartLoading&&(e.exchange===t.KLSE||e.exchange===t.SGX))}}function hq(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"nz-row"),h.rc(2,"div",71),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).onSelectStockInfoRow(n)})),h.rc(3,"nz-row",72),h.rc(4,"nz-col",73),h.pc(5),h.rc(6,"p",74),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).transactionModalEmitter(n,!1)})),h.rc(7,"span",75),h.qd(8,"S"),h.qc(),h.rc(9,"span",59),h.qd(10),h.Ec(11,"stockPrice"),h.qc(),h.qc(),h.oc(),h.qc(),h.rc(12,"nz-col",76),h.rc(13,"nz-row",77),h.od(14,RC,2,1,"div",38),h.od(15,VC,5,4,"ng-template",null,78,h.pd),h.od(17,jC,8,4,"ng-template",null,79,h.pd),h.qc(),h.rc(19,"p",80),h.qd(20),h.Ec(21,"number"),h.qc(),h.rc(22,"p",81),h.qd(23," Last : "),h.od(24,YC,3,2,"ng-container",38),h.od(25,KC,3,5,"ng-template",null,82,h.pd),h.qc(),h.rc(27,"p",80),h.qd(28," Chg: "),h.rc(29,"span",83),h.od(30,ZC,3,2,"ng-container",2),h.od(31,JC,6,5,"ng-container",2),h.qc(),h.qc(),h.od(32,iq,6,3,"ng-container",2),h.od(33,oq,8,4,"ng-container",2),h.qc(),h.rc(34,"nz-col",73),h.pc(35),h.rc(36,"p",74),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(3).transactionModalEmitter(n,!0)})),h.rc(37,"span",84),h.qd(38,"B"),h.qc(),h.rc(39,"span",59),h.qd(40),h.Ec(41,"stockPrice"),h.qc(),h.qc(),h.oc(),h.qc(),h.qc(),h.od(42,uq,11,8,"ng-container",2),h.qc(),h.qc(),h.oc()}if(2&e){const e=t.$implicit,o=h.ad(18),s=h.ad(26),a=h.Dc(3);var n=null;const l=h.Sc(25,XM,!(e.exchange!==a.SSE&&e.exchange!==a.SZSE||null!=(n=a.handleTradingInfo(e.tradingInfo,e.exchange))&&n.sell));var i=null;const r=(e.exchange===a.SSE||e.exchange===a.SZSE)&&(!(null!=(i=a.handleTradingInfo(e.tradingInfo,e.exchange))&&i.buy)||!(null!=(i=a.handleTradingInfo(e.tradingInfo,e.exchange))&&i.sell)||(null==(i=a.handleTradingInfo(e.tradingInfo,e.exchange))?null:i.instiPro));var c=null;const d=h.Sc(27,XM,!(e.exchange!==a.SSE&&e.exchange!==a.SZSE||null!=(c=a.handleTradingInfo(e.tradingInfo,e.exchange))&&c.buy));h.Ub(6),h.Mc("ngClass",l),h.Ub(3),h.Mc("ngClass",e.changedColor&&e.changedColor.bidPrice?e.changedColor.bidPrice:"ask-price ask-price-mobile-web w-70"),h.Ub(1),h.rd(a.isZero(e.bidPrice)||!e.bidPrice?"-":h.Gc(11,16,e.bidPrice,null==e?null:e.exchange)),h.Ub(4),h.Mc("ngIf",e.exchange===a.KLSE||e.exchange===a.BURSA)("ngIfElse",o),h.Ub(6),h.sd("Vol : ",h.Gc(21,19,e.cumulativeVolume,"1."),""),h.Ub(4),h.Mc("ngIf",e.change>0||e.change<0)("ngIfElse",s),h.Ub(6),h.Mc("ngIf",e.change),h.Ub(1),h.Mc("ngIf",!e.change),h.Ub(1),h.Mc("ngIf",r),h.Ub(1),h.Mc("ngIf",(null==e?null:e.endSnapDate)>a.dateNow&&a.displaySnapButton(e)),h.Ub(3),h.Mc("ngClass",d),h.Ub(3),h.Mc("ngClass",e.changedColor&&e.changedColor.askPrice?e.changedColor.askPrice:"bid-price bid-price-mobile-web w-70"),h.Ub(1),h.sd(" ",a.isZero(e.askPrice)||!e.askPrice?"-":h.Gc(41,22,e.askPrice,null==e?null:e.exchange)," "),h.Ub(2),h.Mc("ngIf",a.checkSelectedStock(e))}}function pq(e,t){if(1&e&&(h.pc(0),h.od(1,hq,43,29,"ng-container",16),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.stocks)}}function mq(e,t){if(1&e&&h.od(0,pq,2,1,"ng-container",38),2&e){const e=h.Dc(),t=h.ad(23);h.Mc("ngIf",!e.isBATSStock()&&(null==e.stocks?null:e.stocks.length)>0)("ngIfElse",t)}}function fq(e,t){1&e&&h.nc(0)}function gq(e,t){if(1&e&&(h.pc(0),h.od(1,fq,1,0,"ng-container",48),h.oc()),2&e){h.Dc();const e=h.ad(3);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function bq(e,t){1&e&&h.nc(0)}function Sq(e,t){if(1&e&&(h.pc(0),h.od(1,bq,1,0,"ng-container",48),h.oc()),2&e){h.Dc();const e=h.ad(1);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function yq(e,t){if(1&e&&(h.rc(0,"span",4),h.qd(1,"Powered by iFAST Financial Pte. Ltd. & "),h.mc(2,"img",106),h.qc()),2&e){const e=h.Dc();h.Ub(2),h.Mc("src",e.imagePath+"morning-star-logo.svg",h.gd)}}function vq(e,t){if(1&e&&(h.pc(0),h.mc(1,"nz-empty",107),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("nzNotFoundContent",e.getEmptyWording())}}function Mq(e,t){if(1&e){const e=h.sc();h.rc(0,"div",109),h.rc(1,"div",110),h.mc(2,"div",111),h.rc(3,"div",112),h.rc(4,"div",113),h.rc(5,"div",114),h.rc(6,"div",115),h.rc(7,"p",116),h.qd(8,"Live Snaps"),h.qc(),h.qc(),h.rc(9,"div",117),h.rc(10,"i",118),h.zc("click",(function(){return h.dd(e),h.Dc(2).onAcknowledgeNoteClick()})),h.qc(),h.qc(),h.qc(),h.rc(11,"span",119),h.qd(12,"Our HKEX prices is delay at least 15 minutes. You will get L2 live snap services (30 snap) upon a successful filled trade."),h.qc(),h.rc(13,"div",120),h.rc(14,"button",121),h.zc("click",(function(){return h.dd(e),h.Dc(2).onAcknowledgeNoteClick()})),h.rc(15,"span",122),h.qd(16,"Got It"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}2&e&&(h.Ub(6),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12))}function Cq(e,t){if(1&e&&h.od(0,Mq,17,2,"div",108),2&e){const e=t.index,n=t.exchange,i=h.Dc();h.Mc("ngIf",i.liveSnapNoteVisible&&0==e&&n===i.HKEX&&!i.isHkexLivestreaming)}}function qq(e,t){1&e&&(h.rc(0,"p"),h.qd(1,"The share is limited to Mainland investors, overseas investors will only be allowed to sell."),h.qc())}function Tq(e,t){1&e&&(h.rc(0,"p"),h.qd(1,"The share is limited to Mainland investors, overseas investors will only be allowed to buy."),h.qc())}function wq(e,t){1&e&&(h.rc(0,"p"),h.qd(1,"Northbound trading SZSE ChiNext and SSE STAR shares are limited to Institutional Professionals only."),h.qc())}let zq=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l){this.uiTableService=e,this.stocksInfoRestService=t,this.router=n,this.route=i,this.watchlistRestService=c,this.liveFeedService=o,this.subHandlingService=s,this.modal=a,this.factsetGsaConfigService=l,this.timeAndSalesPopOver=[],this.stocks=[],this.watchList=[],this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.isLoading=!1,this.isLsAlive=!1,this.emitAddPriceAlert=new h.s,this.emitAddToWatchList=new h.s,this.emitTransactionModal=new h.s,this.emitTimeAndSales=new h.s,this.emitMarketDepth=new h.s,this.emitSummary=new h.s,this.emitSelectedStockData=new h.s,this.emitCalculatorModal=new h.s,this.emitWatchlistItemDeletedAction=new h.s,this.emitTimeAndSalesPopOverAction=new h.s,this.emitSnapAction=new h.s,this.emitSortedStock=new h.s,this.emitSortedTableKey=new h.s,this.imagePath=M.g.STOCKS_IMG_PATH,this.SHARED_IMG_PATH=M.g.SHARED_IMG_PATH,this.HKEX=M.q.HKEX,this.KLSE=M.q.KLSE,this.BURSA=M.q.BURSA,this.SGX=M.q.SGX,this.SSE=M.q.SSE,this.SZSE=M.q.SZSE,this.SHARIAH_COMPLAINT_IMG_PATH=M.g.STOCKS_IMG_PATH,this.StockConstant=M.q,this.Highcharts=Mg,this.lotSize=100,this.updateFlag=!1,this.isMobile=!1,this.chartOptions={xAxis:{crosshair:{width:1,color:"#dadada"},type:"datetime"},yAxis:{title:null,min:0,max:0,labels:{formatter:function(){return Mg.numberFormat(Number(this.value),3)}}},legend:{enabled:!1},title:{text:""},tooltip:{},credits:Object.assign({},M.f.CREDIT_CONFIG),chart:{backgroundColor:this.isMobile?"#f2f2f2":"",zoomType:"xy",panning:{enabled:!0},panKey:"shift",events:{render:function(){setTimeout(()=>{},0)}}},plotOptions:{area:{lineColor:"#004BAD",fillColor:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,"rgba(144, 175, 214, 0.4)"],[1,"rgba(255, 255, 255, 0.5)"]]}},series:{marker:{enabled:!1}}}},this.isPriceChartLoading=!1,this.startHours=0,this.startMinutes=0,this.endHours=0,this.endMinutes=0,this.startLunchBreakHour=0,this.startLunchBreakMinutes=0,this.endLunchBreakHour=0,this.endLunchBreakMinutes=0,this.isUSLivestreaming=!1,this.isSgxLivestreaming=!1,this.isHkexLivestreaming=!1,this.isLseLivestreaming=!1,this.livePermissions=[],this.delayedPermissions=[],this.liveSnapNoteVisible=!1}get isFactsetGsa(){return this.factsetGsaConfigService.isFactsetGsaEnabledSync}ngOnInit(){this.isMobile$.subscribe(e=>{this.isMobile=e}),setInterval(()=>
5{this.stocks.forEach(e=>{e&&(e.changedColor={})})},3e3),[{exchanges:[M.q.BURSA],liveStreaming:this.liveFeedService.checkStreaming(M.q.BURSA)},{exchanges:[M.q.NASDAQ,M.q.NYSE,M.q.AMEX,M.q.BATS],liveStreaming:this.liveFeedService.checkStreaming(M.q.AMEX)},{exchanges:[M.q.SGX],liveStreaming:this.liveFeedService.checkStreaming(M.q.SGX)},{exchanges:[M.q.HKEX],liveStreaming:this.liveFeedService.checkStreaming(M.q.HKEX)},{exchanges:[M.q.LSE],liveStreaming:this.liveFeedService.checkStreaming(M.q.LSE)},{exchanges:[M.q.SSE],liveStreaming:this.liveFeedService.checkStreaming(M.q.SSE)},{exchanges:[M.q.SZSE],liveStreaming:this.liveFeedService.checkStreaming(M.q.SZSE)}].forEach(e=>{e.exchanges.forEach(t=>{e.liveStreaming?this.livePermissions.push(t):this.delayedPermissions.push(t),t===M.q.HKEX&&(this.isHkexLivestreaming=e.liveStreaming)})})}ngOnChanges(e){var t,n,i,c,o,s,a,l,r,d,u,h,p,m,f,g,b,S,y,v,C,q,T,w,z,D,P,I,k,A;let E;E=this.stocks.filter(t=>{var n,i;return(null==t?void 0:t.symbol)===(null===(i=null===(n=e.lightStreamerChanges)||void 0===n?void 0:n.currentValue)||void 0===i?void 0:i.symbol)})[0],e.lightStreamerChanges&&e.lightStreamerChanges.currentValue&&(null===(t=this.selectedItem)||void 0===t?void 0:t.symbol)===(null===(i=null===(n=e.lightStreamerChanges)||void 0===n?void 0:n.currentValue)||void 0===i?void 0:i.symbol)&&((null===(o=null===(c=e.lightStreamerChanges)||void 0===c?void 0:c.currentValue)||void 0===o?void 0:o.cumulativeVolume)&&this.selectedItem.cumulativeVolume!==(null===(a=null===(s=e.lightStreamerChanges)||void 0===s?void 0:s.currentValue)||void 0===a?void 0:a.cumulativeVolume)&&(this.selectedItem.cumulativeVolume=null===(r=null===(l=e.lightStreamerChanges)||void 0===l?void 0:l.currentValue)||void 0===r?void 0:r.cumulativeVolume),(null===(u=null===(d=e.lightStreamerChanges)||void 0===d?void 0:d.currentValue)||void 0===u?void 0:u.dayLow)&&(null===(h=this.selectedItem)||void 0===h?void 0:h.dayLow)!==(null===(m=null===(p=e.lightStreamerChanges)||void 0===p?void 0:p.currentValue)||void 0===m?void 0:m.dayLow)&&(this.selectedItem.dayLow=null===(g=null===(f=e.lightStreamerChanges)||void 0===f?void 0:f.currentValue)||void 0===g?void 0:g.dayLow),(null===(S=null===(b=e.lightStreamerChanges)||void 0===b?void 0:b.currentValue)||void 0===S?void 0:S.dayHigh)&&(null===(y=this.selectedItem)||void 0===y?void 0:y.dayHigh)!==(null===(C=null===(v=e.lightStreamerChanges)||void 0===v?void 0:v.currentValue)||void 0===C?void 0:C.dayHigh)&&(this.selectedItem.dayHigh=null===(T=null===(q=e.lightStreamerChanges)||void 0===q?void 0:q.currentValue)||void 0===T?void 0:T.dayHigh),(null===(z=null===(w=e.lightStreamerChanges)||void 0===w?void 0:w.currentValue)||void 0===z?void 0:z.openPrice)&&(null===(D=this.selectedItem)||void 0===D?void 0:D.openPrice)!==(null===(I=null===(P=e.lightStreamerChanges)||void 0===P?void 0:P.currentValue)||void 0===I?void 0:I.openPrice)&&(this.selectedItem.openPrice=null===(A=null===(k=e.lightStreamerChanges)||void 0===k?void 0:k.currentValue)||void 0===A?void 0:A.openPrice)),e.selectedExchange&&(e.selectedExchange.currentValue===M.q.HKEX?(this.liveSnapNoteVisible=null===Object(Av.a)(this.username+M.h.HKEX_LIVE_SNAP_VISIBILE)||Object(Av.a)(this.username+M.h.HKEX_LIVE_SNAP_VISIBILE),this.initClock()):(this.liveSnapNoteVisible=!1,this.destroyClock()))}ngOnDestroy(){this.destroyClock()}initClock(){this.destroyClock(),this.dateNowSubscription=Object(bM.a)(0,1e3).subscribe(e=>{this.dateNow=(new Date).getTime()})}destroyClock(){this.dateNowSubscription&&this.dateNowSubscription.unsubscribe()}triggerChanges(e){setTimeout(()=>{const t=e.changedColor;for(let e in t)t[e]=null;e.changedColor=t},1e3)}sortByKey(e){let t="ascend"!==e.value&&e.value?"descend":"ascend";this.emitSortedTableKey.emit(e),this.stocks=this.uiTableService.sort({key:e.key,value:t},this.stocks),this.emitSortedStock.emit(this.stocks)}onSelectStockInfoRow(e){this.setSelectedItem(e),(null==e?void 0:e.exchange)!==this.HKEX&&(null==e?void 0:e.exchange)!==this.KLSE&&(null==e?void 0:e.exchange)!==this.SGX||(this.emitSelectedStockData.emit(e),this.isMobile?this.getTimeAndSalesForHighChart():this.showMarketDepth())}isFunctionalCol(e){return"lotSize"===e||"exchange"===e||"changePercentage"===e||"lastPrice"
5===e||"cumulativeVolume"===e||"askQuantity"===e||"bidQuantity"===e||"stockName"===e||"bidPrice"===e||"askPrice"===e||"sentiment"===e||"lastPrice"===e||"change"===e||"sentiment"===e||"tradingInfo"===e}handleTradingInfo(e,t){return Object(SM.a)(e,t)}transactionModalEmitter(e,t){e.exchange||(e.exchange=this.selectedExchange===M.q.BURSA?M.q.KLSE:this.selectedExchange),this.emitTransactionModal.emit({data:e,transactionType:t})}sentimentCounter(e,t,n){return parseInt(e)/(parseInt(t)+parseInt(e))*100==0&&parseInt(t)/(parseInt(t)+parseInt(e))*100==0?50:"bid"===n?parseInt(e)/(parseInt(t)+parseInt(e))*100:parseInt(t)/(parseInt(t)+parseInt(e))*100}isWatchListSelected(){return this.watchList.filter(e=>e.listId===this.selectedRanking.listId).length>0}handleWatchlistModalVisible(){this.emitAddToWatchList.emit(this.selectedItem)}handlePriceAlertModalVisible(e){this.selectedPriceAlert=e,this.emitAddPriceAlert.emit(this.selectedPriceAlert)}setSelectedItem(e){this.isMobile?this.isMobile&&(this.selectedItem=this.selectedItem&&e.stockCode===this.selectedItem.stockCode?null:e):(this.selectedItem=e,this.showMarketDepth())}setSelectedItemMouseOver(e){this.selectedItem=e}navigateToTechnicalChart(){return this.router.navigate([M.o.STOCKS,M.o.TOOLS,M.o.TECHNICAL_ANALYSIS],{queryParams:{stockName:this.selectedItem.stockName,stock:this.selectedItem.stockCode,exchange:this.selectedItem.exchange===M.q.BURSA?M.q.KLSE:this.selectedItem.exchange}})}deleteItemFromWatchList(){this.watchlistRestService.deleteWatchlistItem(this.findWatchlistItemId()).subscribe(e=>{"SUCCESS"===e.status&&(this.showSuccessMessage("Successfully removed from your watchlist"),this.emitWatchlistItemDeletedAction.emit("delete"))})}findWatchlistItemId(){return[this.selectedRanking.item.filter(e=>e.productCode.includes(this.selectedItem.stockCode))[0].listItemId]}showTimeAndSalesModal(){this.emitTimeAndSales.emit(this.selectedItem)}showMarketDepth(){this.emitMarketDepth.emit(this.selectedItem)}showSummaryModal(){this.emitSummary.emit(this.selectedItem)}handleCalculatorVisible(){this.emitCalculatorModal.emit(this.selectedItem)}showErrorMessage(e){const t=this.modal.error({nzTitle:"Error",nzContent:e,nzOkText:null});setTimeout(()=>t.destroy(),1e3)}showSuccessMessage(e){this.modal.success({nzTitle:"All Good!",nzContent:e,nzOkText:"OK"})}isZero(e){return 0==e||!e}checkSelectedStock(e){return!!this.selectedItem&&e.stockCode===this.selectedItem.stockCode}getTimeAndSalesForHighChart(){this.isPriceChartLoading=!0,this.setExchangeTradingAndLunchTime(this.selectedItem.exchange),this.subHandlingService.subscribe(this.stocksInfoRestService.getTimeAndSales(this.selectedItem.symbol).pipe(Object(y.a)(e=>{const t=e.data;if("ok"==t.s){const e=[],n=[];let i=!1,c=this.findIndexBeforeLunchBreak(t.t);const o=t.c[c];let s=Date.now();const a=60*Math.floor(s/6e4);for(let l=0;l<t.t.length;l++){const e=t.c[l],c=t.t[l];!i&&this.isLunchEnd(c)&&(n.push([this.convertTime(c-60),o]),i=!0),n.push([this.convertTime(c),e])}this.convertTime(a)>this.convertTime(t.t[c])&&this.isLunchBreak(a)&&n.push([this.convertTime(a),o]),this.determineMinMaxTime(n),this.determineMinMaxPrice(n),this.determineLunchBreakPlotBands(n),e.push({type:"area",name:this.selectedItem.stockName,data:n}),this.chartOptions.series=[...e],this.updateFlag=!0,this.isPriceChartLoading=!1}})))}findIndexBeforeLunchBreak(e){let t=0;for(let n=0;n<e.length;n++)this.isBeforeLunchBreak(e[n])&&(t=n);return t}convertTime(e){return e instanceof Date||(e=new Date(1e3*e)),Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}determineMinMaxPrice(e){this.chartOptions.yAxis.min=e[0][1],this.chartOptions.yAxis.max=e[0][1];for(let t=1;t<e.length;t++)e[t][1]<this.chartOptions.yAxis.min&&(this.chartOptions.yAxis.min=e[t][1]),e[t][1]>this.chartOptions.yAxis.max&&(this.chartOptions.yAxis.max=e[t][1]);this.chartOptions.yAxis.min&&this.chartOptions.yAxis.max&&(this.chartOptions.yAxis.tickInterval=(Math.ceil((this.chartOptions.yAxis.max-this.chartOptions.yAxis.min)/5*200)/200).toFixed(3))}isBeforeLunchBreak(e){let t=new Date(this.convertTime(e));return this.convertTime(e)<=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startLunchBreakHour,this.startLunchBreakMinutes,0,0)}isLunchBreak(e){let t=new Date(this.convertTime(e));return this.convertTime(e)>Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startLunchBreakHour,this.startLunchBreakMinutes,0,0)&&this.convertTime(e)<Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endLunchBreakHour,this.endLunchBreakMinutes,0,0)}isLunchEnd(e){let t=new Date(this.convertTime(e));return this.convertTime(e)>=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endLunchBreakHour,this.endLunchBreakMinutes,0,0)}determineLunchBreakPlotBands(e){if(e[0][0]){let t=new Date(e[0][0]);this.chartOptions.xAxis.plotBands=[{from:Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startLunchBreakHour,this.startLunchBreakMinutes,0,0),to:Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endLunchBreakHour,this.endLunchBreakMinutes,0,0),color:"#f5f8f9",label:{text:"<em>Lunch</em><br> <em>Break</em>",verticalAlign:"top"}}]}}determineMinMaxTime(e){if(e[0][0]){let t=new Date(e[0][0]);this.chartOptions.xAxis.min=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.startHours,this.startMinutes,0,0),this.chartOptions.xAxis.max=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),this.endHours,this.endMinutes,0,0),this.chartOptions.xAxis.tickInterval=36e5}
5}setExchangeTradingAndLunchTime(e){switch(e){case M.q.KLSE:this.startHours=9,this.endHours=17,this.startLunchBreakHour=12,this.startLunchBreakMinutes=30,this.endLunchBreakHour=14,this.endLunchBreakMinutes=30;break;case M.q.SGX:this.startHours=9,this.endHours=17,this.endMinutes=16,this.startLunchBreakHour=12,this.startLunchBreakMinutes=0,this.endLunchBreakHour=12,this.endLunchBreakMinutes=57;break;default:this.startHours=0,this.endHours=0,this.startLunchBreakHour=0,this.startLunchBreakMinutes=0,this.endLunchBreakHour=0,this.endLunchBreakMinutes=0}}snapSelectedData(e){this.emitSnapAction.emit(e)}navigateToStocksFactsheet(e,t,n){let i;"BURSA"===t&&(t="KLSE"),this.stocksInfoRestService.getTickerInfoByExchangeAndStockCode(t,n).subscribe(c=>{c.status===M.a.RESPONSE_SUCCESS&&c.data&&(i="ETF"==c.data.productType?Object(mt.f)(r.b.ETF,n,"",e,t):Object(mt.f)(r.b.STOCK_AND_ETF,n,"",e,t),Object(pt.a)(i.route,i.params))})}truncateStockName(e,t){if(null!=e)return e.length>t?e.slice(0,t-1)+"\u2026":e}getEmptyWording(){var e;return this.selectedExchange===M.q.AMEX&&this.selectedRanking.toString().includes("ETF")&&!this.selectedRanking.toString().includes("watchlist")?"No ETF is available on AMEX Exchange.":this.isBATSStock()?"No Stock is available in BATS exchange":this.selectedExchange===M.q.SSE&&this.selectedRanking.toString().includes("ETF")&&!this.selectedRanking.toString().includes("watchlist")?"China Stock Connect: ETF is not available on Shanghai Stock Exchange. ":this.selectedExchange===M.q.SZSE&&this.selectedRanking.toString().includes("ETF")&&!this.selectedRanking.toString().includes("watchlist")?"China Stock Connect: ETF is not available on Shenzhen Stock Exchange.":this.isLsAlive&&(null===(e=this.stocks)||void 0===e?void 0:e.length)<1&&this.isPreopeningMarket()&&!this.selectedRanking.toString().includes("watchlist")?"Most active is currently not available as the exchange is now at pre-opening session":"No Data"}isPreopeningMarket(){let e=(new Date).getUTCHours();return(this.selectedExchange===M.q.BURSA||this.selectedExchange===M.q.KLSE||this.selectedExchange===M.q.HKEX||this.selectedExchange===M.q.SGX||this.selectedExchange===M.q.SSE||this.selectedExchange===M.q.SZSE)&&0<=e&&e<2||(this.selectedExchange===M.q.NASDAQ||this.selectedExchange===M.q.AMEX||this.selectedExchange===M.q.NYSE||this.selectedExchange===M.q.BATS)&&13<e&&e<14||this.selectedExchange===M.q.LSE&&3<e&&e<7}isBATSStock(){if(this.selectedExchange===M.q.BATS&&this.selectedRanking.toString().includes("Stock"))return!0}onAcknowledgeNoteClick(){this.liveSnapNoteVisible=!1,Object(Av.c)(this.username+M.h.HKEX_LIVE_SNAP_VISIBILE,this.liveSnapNoteVisible)}displaySnapButton(e){return!(e.exchange!==this.HKEX&&this.selectedExchange!==this.HKEX||this.isHkexLivestreaming)}displayMobileSnapMsg(e){this.modal.warning({nzTitle:"Notes",nzContent:e})}checkDropdownList(e,t){return e?M.q.EXCHANGE_DROPDOWN[e][t]:M.q.DEFAULT_EXCHANGE_DROPDOWN[t]}}return e.\u0275fac=function(t){return new(t||e)(h.lc(Cg.e),h.lc(Dg.a),h.lc(c.e),h.lc(c.a),h.lc(Nv.a),h.lc(hm.a),h.lc(l.a),h.lc(j.e),h.lc(CM.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-live-feed-component"]],inputs:{fieldNames:"fieldNames",timeAndSalesPopOver:"timeAndSalesPopOver",stocks:"stocks",watchList:"watchList",selectedRanking:"selectedRanking",addToWatchlistItem:"addToWatchlistItem",lightStreamerChanges:"lightStreamerChanges",marketDepthDataBid:"marketDepthDataBid",marketDepthDataAsk:"marketDepthDataAsk",selectedExchange:"selectedExchange",isLoading:"isLoading",isLsAlive:"isLsAlive",username:"username"},outputs:{emitAddPriceAlert:"emitAddPriceAlert",emitAddToWatchList:"emitAddToWatchList",emitTransactionModal:"emitTransactionModal",emitTimeAndSales:"emitTimeAndSales",emitMarketDepth:"emitMarketDepth",emitSummary:"emitSummary",emitSelectedStockData:"emitSelectedStockData",emitCalculatorModal:"emitCalculatorModal",emitWatchlistItemDeletedAction:"emitWatchlistItemDeletedAction",emitTimeAndSalesPopOverAction:"emitTimeAndSalesPopOverAction",emitSnapAction:"emitSnapAction",emitSortedStock:"emitSortedStock",emitSortedTableKey:"emitSortedTableKey"},features:[h.Tb([l.a,qg.a,Cg.e]),h.Sb],decls:32,vars:9,consts:[["webTemplate",""],["mobileTemplate",""],[4,"ngIf"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","mt-3","ml-2"],[1,"text-xs","mb-1"],[1,"text-xs","mb-2"],["class","text-xs mb-1",4,"ngIf"],["noResults",""],["popUpNote",""],["sellOnlyNote",""],["buyOnlyNote",""],["instiProOnlyNote",""],["nzPageSize","30",1,"live-feed-table",3,"ngClass","nzData","nzLoading","nzShowPagination","nzScroll","nzNoResult"],["liveFeedTable",""],[3,"nzSortChange"],["class","bg-black-1",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"bg-black-1"],[2,"overflow-y","scroll"],["class","bg-black-1 text-xs",3,"nzShowSort","nzSortKey","nzAlign",4,"ngIf"],["class","bg-black-1 text-xs","nzWidth","100px","nzLeft","0px",3,"nzShowSort","nzSortKey","nzAlign",4,"ngIf"],[1,"bg-black-1","text-xs",3,"nzShowSort","nzSortKey","nzAlign"],["nzWidth","100px","nzLeft","0px",1,"bg-black-1","text-xs",3,"nzShowSort","nzSortKey","nzAlign"],[1,"pointer",3,"click"],["nz-button","","nzType","circle","nzSize","small","nz-dropdown","",1,"text-primary","border-primary",3,"nzDropdownMenu","mouseover"],["nz-icon","","nzType","more","nzTheme","outline",1,"pointer"],["menu","nzDropdownMenu"],["nz-menu",""],["nz-menu-item","",3,"click",4,"ngIf"],["nz-menu-item","",3,"click"],["nz-menu-item",""],["width","16","nzTheme","outline","nz-tooltip","",3,"nzTitle","click",4,"ngIf"],["alt","snap","nz-tooltip","","style","width: 16px; height: auto;",3,"src","nzTitle","click",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["alt","snap","nz-tooltip","",2,"width","16px","height","auto",3,"src","nzTitle","click"],[3,"nzAlign",4,"ngIf","ngIfElse"],["functionalCol",""],[3,"nzAlign"],[4,"ngIf","ngIfElse"],["normalText",""],[3,"nzAlign",4,"ngIf"],["nzLeft","0px",3,"nzAlign",4,"ngIf"],["nz-popover","","nzPopoverPlacement","rightTop",3,"nzPopoverTitle","nzPopoverContent",4,"ngIf"],[1,"text-loss"],[1,"text-profit"],["nzLeft","0px",3,"nzAlign"],["showStockName",""],["showStockCode",""],[4,"ngTemplateOutlet"],[1,"stock-name","font-weight-bold",3,"click"],["class","pl-1","
5nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","","style","width: 16px; height: auto;",3,"src",4,"ngIf"],[1,"text-muted"],["nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",1,"pl-1",2,"width","16px","height","auto",3,"src"],[1,"text-xxs"],["nz-tooltip","","nz-icon","","nzType","info-circle","nzTheme","outline",1,"text-info",3,"nzTooltipTitle"],["endSnapDate",""],["nz-tooltip","","nzTooltipPlacement","top",1,"stock-name","font-weight-bold",3,"nzTooltipTitle","click"],[1,"buy-sell-container","mb-0","pointer","font-weight-bold",3,"ngClass","click"],[1,"sell-button"],[3,"ngClass"],["class","mr-2",3,"exchange",4,"ngIf"],[1,"mr-2",3,"exchange"],[1,"buy-button"],["noChangeLastPrice",""],[3,"ngClass",4,"ngIf"],["nz-tooltip","","nzTooltipPlacement","bottomLeft",3,"nzTooltipTitle",4,"ngIf"],["nz-tooltip","","nzTooltipPlacement","bottomLeft",3,"nzTooltipTitle"],["nz-popover","","nzPopoverPlacement","rightTop",3,"nzPopoverTitle","nzPopoverContent"],[3,"nzShowInfo","nzStrokeColor","nzPercent"],["sentimentTemplate",""],["width","16","nzTheme","outline","nz-tooltip","",3,"nzTitle","click"],[1,"pointer","bg-accent-2","py-3","px-2","mb-2",3,"click"],["nzType","flex","nzAlign","middle"],["nzSpan","7"],[1,"buy-sell-container","pointer","mb-0","font-weight-bold","text-sm",3,"ngClass","click"],[1,"sell-button","sell-button-mobile-web"],["nzSpan","10",1,"text-center"],[1,"mb-1","d-inline-block","live-stock-name"],["showStockNameMobile",""],["showStockCodeMobile",""],[1,"mb-0"],[1,"mb-0","d-inline-block","px-2","py-1"],["noChangeLastPriceMobile",""],[1,"font-weight-bold"],[1,"buy-button","buy-button-mobile-web"],[1,"font-weight-bold","mb-1",3,"click"],["class","pl-2","nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",3,"src",4,"ngIf"],["nzTooltipTitle","Shariah Stock / ETF","nz-tooltip","",1,"pl-2",3,"src"],[1,"font-weight-bold",3,"click"],["class","ml-2","alt","snap","style","width: 16px; height: auto;",3,"src","click",4,"ngIf"],[1,"mt-1"],[1,"mb-0",3,"click"],["alt","snap",1,"ml-2",2,"width","16px","height","auto",3,"src","click"],[1,"mb-0","py-1","trading-info"],["nz-tooltip","","nz-icon","","nzType","info-circle","nzTheme","outline",1,"ml-1",3,"nzTooltipTitle"],[1,"text-xxs",3,"click"],[1,"text-underline"],["nz-tooltip","","nz-icon","","nzType","info-circle","nzTheme","outline",1,"text-info","ml-1"],[1,"my-3"],[1,"mb-2"],[1,"text-primary",3,"nzSpan"],["class","mb-0 text-base",3,"click",4,"ngIf"],[3,"nzSpan"],[1,"text-right","text-primary",3,"nzSpan"],[1,"mb-0","text-base",3,"click"],[1,"d-block","w-100","mw-100","highchart-wrapper","bg-accent-2",3,"Highcharts","options","runOutsideAngular","oneToOne","update","updateChange"],["alt","morning star",3,"src"],[3,"nzNotFoundContent"],["class","ant-popover ant-popover-placement-bottom position-absolute w-30 mt-6 pop-up-note",4,"ngIf"],[1,"ant-popover","ant-popover-placement-bottom","position-absolute","w-30","mt-6","pop-up-note"],[1,"ant-popover-content"],[1,"pop-up-arrow","ant-popover-arrow","bg-primary"],["role","tooltip",1,"ant-popover-inner","bg-primary"],[1,"ant-popover-inner-content","text-white"],["nz-row",""],["nz-col","",3,"nzSpan"],[1,"text-sm","font-weight-bold"],["nz-col","",1,"pointer","text-right","text-xs",3,"nzSpan"],["nz-icon","","nzType","close","nzTheme","outline",1,"text-right",3,"click"],[1,"text-sm"],[1,"text-right","mt-2"],["nzType","primary","nz-button","","nzGhost","","nzSize","small",1,"pop-up-button",3,"click"],[1,"text-white"]],template:function(e,t){1&e&&(h.od(0,xC,9,13,"ng-template",null,0,h.pd),h.od(2,mq,1,2,"ng-template",null,1,h.pd),h.od(4,gq,2,1,"ng-container",2),h.Ec(5,"async"),h.od(6,Sq,2,1,"ng-container",2),h.Ec(7,"async"),h.rc(8,"nz-row",3),h.pc(9),h.rc(10,"span",4),h.qd(11),h.qc(),h.rc(12,"span",5),h.qd(13),h.qc(),h.oc(),h.rc(14,"span",4),h.qd(15,"Additional Notes: "),h.rc(16,"b"),h.qd(17,"Ranking data (respective data, for example - Most Active data) "),h.qc(),h.qd(18," for LSE is unavailable before market open. Ranking data will be available after the market opens at "),h.rc(19,"b"),h.qd(20,"3:00 PM MYT during Daylight Saving Time (DST) and 4:00 PM MYT during non-DST period"),h.qc(),h.qc(),h.od(21,yq,3,1,"span",6),h.qc(),h.od(22,vq,2,1,"ng-template",null,7,h.pd),h.od(24,Cq,1,1,"ng-template",null,8,h.pd),h.od(26,qq,2,0,"ng-template",null,9,h.pd),h.od(28,Tq,2,0,"ng-template",null,10,h.pd),h.od(30,wq,2,0,"ng-template",null,11,h.pd)),2&e&&(h.Ub(4),h.Mc("ngIf",h.Fc(5,5,t.isMobile$)),h.Ub(2),h.Mc("ngIf",!h.Fc(7,7,t.isMobile$)),h.Ub(5),h.sd("Live Streaming: ",t.livePermissions.join(", "),""),h.Ub(2),h.sd("Delayed at least 15 minutes: ",t.delayedPermissions.join(", "),""),h.Ub(8),h.Mc("ngIf",!t.isFactsetGsa))},directives:[p.t,P.c,ve.a,p.q,ve.f,ve.g,p.s,ve.e,ve.c,ve.d,_.a,xv.d,k.b,xv.f,qM.a,qM.d,p.A,xt.e,Og.a,yM.b,vM.a,P.a,Nu.a,Ag.a,MM.b],pi
5pes:[p.b,Ig.a,p.g,p.f,TM.a],styles:[".buy-sell-container[_ngcontent-%COMP%]{white-space:nowrap;width:100%}.buy-button[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;background-color:#093;color:#fff;border:1px solid #093;border-top-left-radius:8px;border-bottom-left-radius:8px}.buy-button-mobile-web[_ngcontent-%COMP%]{padding:5px 10px!important}.bid-price[_ngcontent-%COMP%]{display:inline-block;padding:2px 5px;color:#000;border:1px solid #093;border-top-right-radius:8px;border-bottom-right-radius:8px}.bid-price.bg-loss[_ngcontent-%COMP%]{border:1px solid #ff333a}.bid-price-mobile-web[_ngcontent-%COMP%]{padding:5px 10px!important}.profit-blink[_ngcontent-%COMP%]{width:100%;padding:5px;color:#fff;background-color:#093;border:1px solid #093;border-top-right-radius:8px;border-bottom-right-radius:8px}.sell-button[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;border:1px solid #ff333a;background-color:#ff333a;color:#fff;border-top-left-radius:8px;border-bottom-left-radius:8px}.sell-button-mobile-web[_ngcontent-%COMP%]{padding:5px 10px!important}.ask-price[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;color:#000;border:1px solid #ff333a;border-top-right-radius:8px;border-bottom-right-radius:8px}.ask-price.bg-profit[_ngcontent-%COMP%]{border:1px solid #093}.ask-price-mobile-web[_ngcontent-%COMP%]{padding:5px 10px!important}.disabled-buy-sell[_ngcontent-%COMP%]{pointer-events:none}.disabled-buy-sell[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{display:inline-block;border:1px solid #d3d3d3;background-color:#d3d3d3;color:#7a7a7a;border-top-left-radius:8px;border-bottom-left-radius:8px}.disabled-buy-sell[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{display:inline-block;color:#000;border:1px solid #d3d3d3;border-top-right-radius:8px;border-bottom-right-radius:8px}.loss-blink[_ngcontent-%COMP%]{width:100%;padding:5px;border:1px solid #ff333a;border-top-right-radius:8px;border-bottom-right-radius:8px}.loss-blink[_ngcontent-%COMP%], .red-blink[_ngcontent-%COMP%]{color:#fff;background-color:#ff333a}.red-blink[_ngcontent-%COMP%]{border-color:#ff333a}.green-blink[_ngcontent-%COMP%]{color:#fff;border-color:#093;background-color:#093}[_nghost-%COMP%] .ant-progress-inner{background-color:red!important}.drop[_ngcontent-%COMP%]{background-color:red}.ant-dropdown-menu-item[_ngcontent-%COMP%], .ant-dropdown-menu-submenu-title[_ngcontent-%COMP%]{color:#000}.stock-name[_ngcontent-%COMP%]{color:#004bad}.input-without-handler[_ngcontent-%COMP%]::-webkit-inner-spin-button, .input-without-handler[_ngcontent-%COMP%]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.highchart-wrapper[_ngcontent-%COMP%]{height:200px}.live-feed-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{font-size:12px}.live-feed-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:4px!important}.live-feed-table[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%], .live-feed-table[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{padding:4px}.live-feed-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-7px}.display-pop-up-note[_ngcontent-%COMP%] .ant-table-body{min-height:300px}.live-stock-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:-100%;margin-right:-100%;justify-content:center}.pop-up-arrow[_ngcontent-%COMP%]{left:4%!important;border-color:#012c5d!important}.pop-up-button[_ngcontent-%COMP%]{height:30px;background:transparent!important}.pop-up-note[_ngcontent-%COMP%]{z-index:999!important}.trading-info[_ngcontent-%COMP%]{width:-moz-max-content;width:max-content}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getLsPermission)],e.prototype,"lsPermission",void 0),e})();var Dq=n("5OP8"),Pq=n("TfYK"),Iq=n("4L+/"),kq=n("WiZ8"),Aq=n("EbuA");function Eq(e,t){if(1&e&&(h.rc(0,"label",72),h.qd(1),h.Ec(2,"displayExchangeName"),h.qc()),2&e){const e=t.$implicit,n=h.Dc(4);h.Mc("nzValue",e.value)("ngClass",e.checked?"exchange-tab-"+(e.value===n.BURSA?n.KLSE:e.value):""),h.Ub(1),h.rd(h.Fc(2,3,e.label))}}function Fq(e,t){if(1&e&&(h.pc(0),h.rc(1,"label",72),h.qd(2),h.qc(),h.od(3,Eq,3,5,"label",73),h.oc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("nzValue",e.ALL_EXCHANGE_LIST.value)("ngClass",e.ALL_EXCHANGE_LIST.checked?"exchange-tab-"+e.ALL_EXCHANGE_LIST.value:""),h.Ub(1),h.rd(e.ALL_EXCHANGE_LIST.label),h.Ub(1),h.Mc("ngForOf",e.WATCHLIST_EXCHANGE_LIST)}}function Oq(e,t){if(1&e&&(h.rc(0,"label",72),h.qd(1),h.Ec(2,"displayExchangeName"),h.qc()),2&e){const e=t.$implicit,n=h.Dc(4);h.Mc("nzValue",e.value)("ngClass",e.checked?"exchange-tab-"+(e.value===n.BURSA?n.KLSE:e.value):""),h.Ub(1),h.rd(h.Fc(2,3,e.label))}}function Uq(e,t){if(1&e&&(h.pc(0),h.od(1,Oq,3,5,"label",73),h.oc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngForOf",e.EXCHANGE_LIST)}}function xq(e,t){if(1&e){const e=h.sc();h.rc(0,"div",69),h.rc(1,"nz-radio-group",70),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).selectedExchange=t}))("ngModelChange",(function(t){return h.dd(e),h.Dc(2).onExchgChg(t)})),h.od(2,Fq,4,4,"ng-container",0),h.od(3,Uq,2,1,"ng-container",0),h.qc(),h.qc(),h.rc(4,"app-live-feed-component",71),h.zc("emitAddToWatchList",(function(t){return h.dd(e),h.Dc(2).handleAddToWatchList(t)}))("emitAddPriceAlert",(function(t){return h.dd(e),h.Dc(2).handleAddPriceAlertItem(t)}))("emitTransactionModal",(function(t){return h.dd(e),h.Dc(2).handleModalVisible(t)}))("emitTimeAndSales",(function(t){return h.dd(e),h.Dc(2).emitTimeAndSales(t)}))("emitMarketDepth",(function(t){return h.dd(e),h.Dc(2).emitMarketDepth(t)}))("emitSummary",(function(t){return h.dd(e),h.Dc(2).emitSummary(t)}))("emitCalculatorModal",(function(t){return h.dd(e),h.Dc(2).handleCalculatorModalVisible(t)}))("emitWatchlistItemDeletedAction",(function(t){return h.dd(e),h.Dc(2).findStockWatchlistByAccId(t)}))("emitSnapAction",(function(t){return h.dd(e),h.Dc(2).snapSelectedData(t)}))("emitSortedStock",(function(t){return h.dd(e),h.Dc(2).setSortStocks(t)}))("emitSortedTableKey",(function(t){return h.dd(e),h.Dc(2).setSortedTableKey(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("nzButtonStyle","solid")("ngModel",e.selectedExchange)("nzSize","small"),h.Ub(1),h.Mc("ngIf",e.isWatchlistRanking()||e.isThematicPortfolioRanking()),h.Ub(1),h.Mc("ngIf",!e.isWatchlistRanking()&&!e.isThematicPortfolioRanking()),h.Ub(1),h.Mc("marketDepthDataBid",e.marketDepthDataBid)("marketDepthDataAsk",e.marketDepthDataAsk)("fieldNames",e.isExtendedMode?e.extendDisplayCols:e.displayCols)("stocks",e.stocks)("watchList",e.allStockWatchLists)("selectedRanking",e.ranking)("selectedExchange",e.selectedExchange)("lightStreamerChanges",e.lightStreamerChanges)("timeAndSalesPopOver",e.timeAndSales)("isLsAlive",e.isLsAlive)("username",e.username)}}function Lq(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-modal",74),h.zc("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("emitData",(function(t){return h.dd(e),h.Dc(2).showTransactionPreviewModal(t)}))("changeVisible",(function(t){return h.dd(e),h.Dc(2).handleModalOpen(t)}))("changeSelectedTransactionType",(function(t){return h.dd(e),h.Dc(2).handleSelectedTransactionType(t)}))("changeSelectedInvestmentAcctType",(function(t){return h.dd(e),h.Dc(2).handleSelectedInvestmentAcctType(t)}))("changeSelectedPurchasingPowerType",(function(t){return h.dd(e),h.Dc(2).handleSelectedPurchasingPowerType(t)}))("emitGetFeeDetailAction",(function(t){return h.dd(e),h.Dc(2).getFee(t)}))("emitSnapSelectedStockAction",(function(t){return h.dd(e),h.Dc(2).snapSelectedStock(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("holdingInfo",e.holdingInfo)("visible",e.transactionModalVisible)("selectedStock",e.selectedStock)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("marketDepthDataBid",e.marketDepthDataBid)("marketDepthDataAsk",e.marketDepthDataAsk)("feeDetail",e.feeDetail)("feeDetailStatus",e.feeDetailStatus)("rspEtfProductInfo",e.rspEtfProductInfo)("isScheduledSellOrderExist",e.isScheduledSellOrderExist)("isModifyOrder",e.isModifyOrder)}}function Rq(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-modal-revamp",75),h.zc("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("emitData",(function(t){return h.dd(e),h.Dc(2).showTransactionPreviewModal(t)}))("changeVisible",(function(t){return h.dd(e),h.Dc(2).handleModalOpen(t)}))("changeSelectedTransactionType",(function(t){return h.dd(e),h.Dc(2).handleSelectedTransactionType(t)}))("changeSelectedInvestmentAcctType",(function(t){return h.dd(e),h.Dc(2).handleSelectedInvestmentAcctType(t)}))("changeSelectedPurchasingPowerType",(function(t){return h.dd(e),h.Dc(2).handleSelectedPurchasingPowerType(t)}))("changeSelectedStock",(function(t){return h.dd(e),h.Dc(2).handleSelectedStockChange(t)}
5))("emitGetFeeDetailAction",(function(t){return h.dd(e),h.Dc(2).getFee(t)}))("emitSnapSelectedStockAction",(function(t){return h.dd(e),h.Dc(2).snapSelectedStock(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("lsClient",e.lsClient)("holdingInfo",e.holdingInfo)("visible",e.transactionModalVisible)("selectedStock",e.selectedStock)("priceQuote",e.priceQuote)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("marketDepthDataBid",e.marketDepthDataBid)("marketDepthDataAsk",e.marketDepthDataAsk)("feeDetail",e.feeDetail)("feeDetailStatus",e.feeDetailStatus)("feeNameMap",e.exchangeFeeNameDescMap)("rspEtfProductInfo",e.rspEtfProductInfo)("isScheduledSellOrderExist",e.isScheduledSellOrderExist)("isModifyOrder",e.isModifyOrder)}}function Nq(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-preview-modal",76),h.zc("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("backVisible",(function(t){return h.dd(e),h.Dc(2).handlePreviewModalBack(t)}))("refreshPortfolioAction",(function(t){return h.dd(e),h.Dc(2).refreshPortfolio(t)}))("changeVisible",(function(t){return h.dd(e),h.Dc(2).handlePreviewModalVisible(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("feeDetail",e.feeDetail)("feeDetailStatus",e.feeDetailStatus)("visible",e.previewModalVisible)("selectedStock",e.selectedStock)("selectedPurchasingPowerType",e.selectedPurchasingPowerType)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("stockPreviewData",e.transactionPreviewData)("isScheduledSellOrder",e.isScheduledSellOrder)("isModifyOrder",e.isModifyOrder)("marketOrderTypeSelected",e.marketOrderTypeSelected)}}function Bq(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-preview-modal-revamp",77),h.zc("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("backVisible",(function(t){return h.dd(e),h.Dc(2).handlePreviewModalBack(t)}))("refreshPortfolioAction",(function(t){return h.dd(e),h.Dc(2).refreshPortfolio(t)}))("changeVisible",(function(t){return h.dd(e),h.Dc(2).handlePreviewModalVisible(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("feeDetail",e.feeDetail)("feeNameMap",e.exchangeFeeNameDescMap)("feeDetailStatus",e.feeDetailStatus)("visible",e.previewModalVisible)("selectedStock",e.selectedStock)("selectedPurchasingPowerType",e.selectedPurchasingPowerType)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("stockPreviewData",e.transactionPreviewData)("isScheduledSellOrder",e.isScheduledSellOrder)("isModifyOrder",e.isModifyOrder)("marketOrderTypeSelected",e.marketOrderTypeSelected)}}function _q(e,t){if(1&e&&h.mc(0,"ui-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e.listName)}}function Vq(e,t){if(1&e&&h.mc(0,"ui-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e.listName)}}function Hq(e,t){if(1&e){const e=h.sc();h.rc(0,"div",79),h.rc(1,"label",80),h.zc("ngModelChange",(function(n){return h.dd(e),t.$implicit.checked=n})),h.qd(2),h.qc(),h.mc(3,"img",81),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngModel",e.checked)("nzDisabled",null==e?null:e.disabled),h.Ub(1),h.sd("",e.colName," "),h.Ub(1),h.Mc("src",n.SHARED_IMG_PATH+"drag-icon.svg",h.gd)}}function $q(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e.listName)}}function jq(e,t){if(1&e&&(h.rc(0,"nz-option-group",92),h.od(1,$q,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngForOf",e.allStockWatchLists)}}function Gq(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function Wq(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function Yq(e,t){if(1&e&&(h.rc(0,"nz-option-group",95),h.od(1,Wq,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.Mc("ngForOf",e.RANKING_OPTIONS_ALL)}}function Kq(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}
5function Xq(e,t){if(1&e&&(h.rc(0,"nz-option-group",96),h.od(1,Kq,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(4);h.Ub(1),h.Mc("ngForOf",e.RANKING_OPTIONS_ETF)}}function Qq(e,t){if(1&e&&(h.pc(0),h.od(1,Yq,2,1,"nz-option-group",93),h.od(2,Xq,2,1,"nz-option-group",94),h.oc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngIf",e.selectedExchange!==e.stockConstant.BATS),h.Ub(1),h.Mc("ngIf",e.selectedExchange===e.stockConstant.BATS)}}function Zq(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function Jq(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function eT(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-option-group",95),h.od(2,Zq,1,2,"nz-option",24),h.qc(),h.rc(3,"nz-option-group",96),h.od(4,Jq,1,2,"nz-option",24),h.qc(),h.oc()),2&e){const e=h.Dc(3);h.Ub(2),h.Mc("ngForOf",e.RANKING_OPTIONS_STOCK),h.Ub(2),h.Mc("ngForOf",e.RANKING_OPTIONS_ETF)}}function tT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function nT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function iT(e,t){if(1&e&&(h.rc(0,"nz-option-group",97),h.mc(1,"nz-option",98),h.od(2,tT,1,2,"nz-option",24),h.od(3,nT,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("nzValue",e.SEARCH_RESULT.value)("nzLabel",e.SEARCH_RESULT.label),h.Ub(1),h.Mc("ngForOf",e.ETF_LIST_RANKING),h.Ub(1),h.Mc("ngForOf",e.SECTOR_LIST_RANKING)}}function cT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function oT(e,t){if(1&e&&(h.rc(0,"nz-option-group",97),h.mc(1,"nz-option",98),h.od(2,cT,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("nzValue",e.SEARCH_RESULT.value)("nzLabel",e.SEARCH_RESULT.label),h.Ub(1),h.Mc("ngForOf",e.SECTOR_LIST_RANKING)}}function sT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function aT(e,t){1&e&&h.nc(0)}function lT(e,t){if(1&e&&(h.rc(0,"nz-option",99),h.mc(1,"app-stock-exchange-tag",100),h.Ec(2,"displayExchangeName"),h.qd(3," \xa0 "),h.rc(4,"span",101),h.qd(5),h.qc(),h.mc(6,"br"),h.qd(7),h.qc()),2&e){const e=t.$implicit;h.Mc("nzLabel",e.stockName)("nzValue",e),h.Ub(1),h.Mc("exchange",h.Fc(2,6,e.exchange)),h.Ub(4),h.rd(e.stockName),h.Ub(2),h.td(" ",e.stockCode," | ",e.stockNameWildcard," ")}}function rT(e,t){1&e&&(h.rc(0,"nz-option",102),h.mc(1,"em",103),h.qd(2," Loading Stocks... "),h.qc())}function dT(e,t){if(1&e){const e=h.sc();h.rc(0,"li",104),h.zc("click",(function(){return h.dd(e),h.Dc(3).getSearchStockInfo()})),h.rc(1,"span",105),h.qd(2),h.qc(),h.qc()}if(2&e){const e=t.$implicit;h.Ub(2),h.rd(e.stockName)}}function uT(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-col",106),h.rc(1,"button",107),h.zc("click",(function(){return h.dd(e),h.Dc(3).setDrawer(!0)})),h.mc(2,"i",108),h.qc(),h.qc()}}const hT=function(e){return{"mt-4 mb-3":e}};function pT(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row",82),h.rc(1,"nz-col",83),h.rc(2,"nz-select",84),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).ranking=t}))("ngModelChange",(function(t){return h.dd(e),h.Dc(2).onRankingChg(t)})),h.od(3,jq,2,1,"nz-option-group",59),h.rc(4,"nz-option-group",60),h.od(5,Gq,1,2,"nz-option",24),h.qc(),h.od(6,Qq,3,2,"ng-container",0),h.od(7,eT,5,2,"ng-container",0),h.od(8,iT,4,4,"nz-option-group",61),h.od(9,oT,3,3,"nz-option-group",61),h.rc(10,"nz-option-group",62),h.od(11,sT,1,2,"nz-option",24),h.qc(),h.qc(),h.od(12,aT,1,0,"ng-container",45),h.qc(),h.rc(13,"nz-col",85),h.rc(14,"nz-select",86),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).keyword=t}))("nzOnSearch",(function(t){return h.dd(e),h.Dc(2).onKeywordSearch(t)}))("ngModelChange",(function(){return h.dd(e),h.Dc(2).getSearchStockInfo()}))("nzScrollToBottom",(function(){return h.dd(e),h.Dc(2).onLoadMoreDropdown()})),h.od(15,lT,8,8,"nz-option",87),h.od(16,rT,3,0,"nz-option",88),h.qc(),h.rc(17,"nz-dropdown-menu"),h.rc(18,"ul",89),h.od(19,dT,3,1,"li",90),h.qc(),h.qc(),h.qc(),h.od(20,uT,3,0,"nz-col",91),h.qc()}if(2&e){const e=h.Dc(2),t=h.ad(2);h.Mc("ngClass",h.Sc(17,hT,e.isExtendedMode)),h.Ub(2),h.Mc("ngModel",e.ranking),h.Ub(1),h.Mc("ngIf",e.allStockWatchLists.length>0),h.Ub(2),h.Mc("ngForOf",e.WATCHLIST_ACTIONS),h.Ub(1),h.Mc("ngIf",!e.isForeignExchangeSelected()||e.selectedExchange===e.stockConstant.KLSE),h.Ub(1),h.Mc("ngIf",e.isForeignExchangeSelected()&&e.selectedExchange!==e.stockConstant.KLSE),h.Ub(1),h.Mc("ngIf",e.selectedExchange===e.stockConstant.KLSE||e.selectedExchange===e.stockConstant.BURSA||e.selectedExchange===e.ALL_EXCHANGE_LIST.value),h.Ub(1),h.Mc("ngIf",e.selectedExchange!==e.stockConstant.KLSE&&e.selectedExchange!==e.stockConstant.BURSA&&e.selectedExchange!==e.ALL_EXCHANGE_LIST.value),h.Ub(2),h.Mc("ngForOf",e.THEMATIC_LIST_RANKING),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(2),h.Mc("ngModel",e.keyword)("nzShowArrow",!1)("nzAllowClear",!0),h.Ub(1),h.Mc("ngForOf",e.stockSearchDropdownList),h.Ub(1),h.Mc("ngIf",e.searchStockLoading),h.Ub(3),h.Mc("ngForOf",e.stockSearchDropdownList),h.Ub(1),h.Mc("ngIf",!e.isExtendedMode)}}function mT(e,t){1&e&&h.nc(0)}function fT(e,t){1&e&&h.nc(0)}function gT(e,t){if(1&e&&(h.od(0,mT,1,0,"ng-container",45),h.od(1,fT,1,0,"ng-container",45)),2&e){h.Dc();const e=h.ad(72),t=h.ad(2);h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function bT(e,t){1&e&&h.nc(0)}function ST(e,t){if(1&e&&(h.rc(0,"span",114),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Gc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedStock?null:t.selectedStock.lastPrice),"1.3"))}}function yT(e,t){if(1&e&&(h.rc(0,"span",115),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Gc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedStock?null:t.selectedStock.lastPrice),"1.3"))}}function vT(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(3);h.Ub(1),h.rd(h.Gc(2,1,t.getTimeAndSalesChgPrice(null==e?null:e.price,null==t.selectedStock?null:t.selectedStock.lastPrice),"1.3"))}}function MT(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td"),h.qd(2),h.qc(),h.rc(3,"td"),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"td"),h.od(7,ST,3,4,"span",112),h.od(8,yT,3,4,"span",113),h.od(9,vT,3,4,"span",0),h.qc(),h.rc(10,"td"),h.qd(11),h.Ec(12,"number"),h.qc(),h.rc(13,"td"),h.qd(14),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(3);h.Ub(2),h.rd(null==e?null:e.tradeTime),h.Ub(2),h.rd(h.Gc(5,7,null==e?null:e.price,"1.3")),h.Ub(3),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedStock?null:n.selectedStock.lastPrice)>0),h.Ub(1),h.Mc("ngIf",n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedStock?null:n.selectedStock.lastPrice)<0),h.Ub(1),h.Mc("ngIf",0===n.getTimeAndSalesChgPrice(null==e?null:e.price,null==n.selectedStock?null:n.selectedStock.lastPrice)),h.Ub(2),h.sd(" ",h.Fc(12,10,null==e?null:e.size)," "),h.Ub(3),h.rd("0"==(null==e?null:e.side)?"Buy":"Sell")}}function CT(e,t){if(1&e&&(h.rc(0,"nz-table",109,110),h.rc(2,"thead"),h.rc(3,"tr"),h.rc(4,"th"),h.qd(5,"Time"),h.qc(),h.rc(6,"th"),h.qd(7,"Price"),h.qc(),h.rc(8,"th"),h.qd(9,"Chg"),h.qc(),h.rc(10,"th"),h.qd(11,"Trade Size"),h.qc(),h.rc(12,"th"),h.qd(13,"Type"),h.qc(),h.qc(),h.qc(),h.rc(14,"tbody"),h.od(15,MT,15,12,"tr",111),h.qc(),h.qc()),2&e){const e=h.ad(1),t=h.Dc(2);h.Mc("nzData",t.timeAndSales),h.Ub(15),h.Mc("ngForOf",e.data)}}function qT(e,t){1&e&&h.nc(0)}function TT(e,t){1&e&&h.nc(0)}function wT(e,t){if(1&e){const e=h.sc();h.rc(0,"button",116),h.zc("click",(function(){return h.dd(e),h.Dc(2).openStreamingInfoModal()})),h.mc(1,"i",117),h.qd(2,"Streaming "),h.qc()}2&e&&h.Mc("nzSize","small")}function zT(e,t){if(1&e){const e=h.sc();h.rc(0,"button",116),h.zc("click",(function(){h.dd(e);const t=h.Dc(2),n=h.ad(8);return t.displayInfoInDrawer(n)})),h.mc(1,"i",117),h.qd(2,"Streaming "),h.qc()}2&e&&h.Mc("nzSize","small")}function DT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e.listName)}}function PT(e,t){if(1&e&&(h.rc(0,"nz-option-group",92),h.od(1,DT,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.allStockWatchLists)}}function IT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function kT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function AT(e,t){if(1&e&&(h.rc(0,"nz-option-group",95),h.od(1,kT,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngForOf",e.RANKING_OPTIONS_ALL)}}function ET(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}
5function FT(e,t){if(1&e&&(h.rc(0,"nz-option-group",96),h.od(1,ET,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngForOf",e.RANKING_OPTIONS_ETF)}}function OT(e,t){if(1&e&&(h.pc(0),h.od(1,AT,2,1,"nz-option-group",93),h.od(2,FT,2,1,"nz-option-group",94),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",e.selectedExchange!==e.stockConstant.BATS),h.Ub(1),h.Mc("ngIf",e.selectedExchange===e.stockConstant.BATS)}}function UT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function xT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function LT(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-option-group",95),h.od(2,UT,1,2,"nz-option",24),h.qc(),h.rc(3,"nz-option-group",96),h.od(4,xT,1,2,"nz-option",24),h.qc(),h.oc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("ngForOf",e.RANKING_OPTIONS_STOCK),h.Ub(2),h.Mc("ngForOf",e.RANKING_OPTIONS_ETF)}}function RT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function NT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function BT(e,t){if(1&e&&(h.rc(0,"nz-option-group",97),h.mc(1,"nz-option",98),h.od(2,RT,1,2,"nz-option",24),h.od(3,NT,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("nzValue",e.SEARCH_RESULT.value)("nzLabel",e.SEARCH_RESULT.label),h.Ub(1),h.Mc("ngForOf",e.ETF_LIST_RANKING),h.Ub(1),h.Mc("ngForOf",e.SECTOR_LIST_RANKING)}}function _T(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function VT(e,t){if(1&e&&(h.rc(0,"nz-option-group",97),h.mc(1,"nz-option",98),h.od(2,_T,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("nzValue",e.SEARCH_RESULT.value)("nzLabel",e.SEARCH_RESULT.label),h.Ub(1),h.Mc("ngForOf",e.SECTOR_LIST_RANKING)}}function HT(e,t){if(1&e&&h.mc(0,"nz-option",78),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function $T(e,t){1&e&&h.nc(0)}function jT(e,t){1&e&&h.nc(0)}const GT=function(e){return{"mt-4":e}};function WT(e,t){if(1&e){const e=h.sc();h.pc(0),h.od(1,xq,5,16,"ng-template",null,7,h.pd),h.od(3,Lq,1,13,"app-stock-transaction-modal",8),h.od(4,Rq,1,16,"app-stock-transaction-modal-revamp",9),h.rc(5,"cds-account-modal",10),h.zc("changeVisible",(function(t){return h.dd(e),h.Dc().handleCdsModalOpen(t)}))("handleCdsAccountReactivation",(function(t){return h.dd(e),h.Dc().handleCdsReactivation(t)})),h.qc(),h.od(6,Nq,1,12,"app-stock-transaction-preview-modal",11),h.od(7,Bq,1,13,"app-stock-transaction-preview-modal-revamp",12),h.rc(8,"app-stocks-calculator",13),h.zc("isVisibleChange",(function(t){return h.dd(e),h.Dc().isStocksCalculatorVisible=t})),h.qc(),h.rc(9,"nz-modal",14),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseCreateNewWatchlistModal()}))("nzVisibleChange",(function(t){return h.dd(e),h.Dc().isCreateNewWatchlistModalVisible=t})),h.rc(10,"h3",15),h.qd(11,"Add New Watchlist"),h.qc(),h.rc(12,"nz-row"),h.rc(13,"nz-col",16),h.rc(14,"ui-input-group",17),h.rc(15,"input",18),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().addingWatchlist=t})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(16,"div",19),h.rc(17,"button",20),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseCreateNewWatchlistModal()})),h.qd(18,"Cancel"),h.qc(),h.rc(19,"button",21),h.zc("click",(function(){return h.dd(e),h.Dc().onCreateNewWatchlist()})),h.qd(20," Create "),h.qc(),h.qc(),h.qc(),h.rc(21,"nz-modal",22),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().isRenameWatchlistModalVisible=t}))("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseRenameWatchlistModal()})),h.rc(22,"h3",15),h.qd(23,"Rename Watchlist"),h.qc(),h.rc(24,"ui-select",23),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedEditingWatchlist=t}))("ngModelChange",(function(t){return h.dd(e),h.Dc().onSelectWatchlistRenameChanged(t)})),h.od(25,_q,1,2,"ui-option",24),h.qc(),h.rc(26,"ui-input-group",25),h.rc(27,"input",18),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().editingWatchlist=t})),h.qc(),h.qc(),h.rc(28,"div",26),h.rc(29,"button",20),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseRenameWatchlistModal()})),h.qd(30,"Cancel"),h.qc(),h.rc(31,"button",21),h.zc("click",(function(){return h.dd(e),h.Dc().onRenameWatchlist()})),h.qd(32," Rename "),h.qc(),h.qc(),h.qc(),h.rc(33,"app-bcan-redirect-modal",27),h.zc("onCloseBcanRedirrectModel",(function(){return h.dd(e),h.Dc().onCloseBcanRedirrectModel()})),h.qc(),h.rc(34,"nz-modal",22),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().chinaTradeNotAvailableModalVisible=t}))("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseChinaTradeNotAvailableModel()})),h.rc(35,"h3",15),h.mc(36,"i",28),h.rc(37,"span",29),h.qd(38,"China A-Shares (BCAN Form)"),h.qc(),h.qc(),h.pc(39),h.rc(40,"p",30),h.qd(41,"Northbound Trading (China A-Shares) under Stock Connect is not available for China mainland investors with effect from 25 July 2022 with the amendment of rules announced by the China
5Securities Regulatory Commission (CSRC), Shanghai Stock Exchange (SSE), and Shenzhen Stock Exchange (SZSE). For more info kindly refer to this link "),h.rc(42,"a",31),h.qd(43,"here"),h.qc(),h.qd(44,"."),h.qc(),h.rc(45,"div",32),h.rc(46,"button",33),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseChinaTradeNotAvailableModel()})),h.qd(47,"Close"),h.qc(),h.qc(),h.oc(),h.qc(),h.rc(48,"nz-modal",22),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().isDeleteWatchlistModalVisible=t}))("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseDeleteWatchlistModal()})),h.rc(49,"h3",15),h.qd(50,"Delete Watchlist"),h.qc(),h.rc(51,"ui-select",23),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedDeletingWatchlist=t}))("ngModelChange",(function(t){return h.dd(e),h.Dc().onSelectWatchlistRenameChanged(t)})),h.od(52,Vq,1,2,"ui-option",24),h.qc(),h.rc(53,"div",26),h.rc(54,"button",20),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseDeleteWatchlistModal()})),h.qd(55,"Cancel"),h.qc(),h.rc(56,"button",21),h.zc("click",(function(){return h.dd(e),h.Dc().onDeleteWatchlist()})),h.qd(57,"Delete "),h.qc(),h.qc(),h.qc(),h.rc(58,"nz-drawer",34),h.rc(59,"div",35),h.rc(60,"nz-row"),h.rc(61,"nz-checkbox-wrapper",36),h.zc("cdkDropListDropped",(function(t){return h.dd(e),h.Dc().drop(t)})),h.od(62,Hq,4,4,"div",37),h.qc(),h.qc(),h.rc(63,"div"),h.rc(64,"button",38),h.zc("click",(function(){return h.dd(e),h.Dc().setDrawer(!1)})),h.qd(65,"Cancel"),h.qc(),h.rc(66,"a",39),h.zc("click",(function(){return h.dd(e),h.Dc().resetDisplayCol()})),h.mc(67,"i",40),h.qd(68," Reset"),h.qc(),h.rc(69,"button",41),h.zc("click",(function(){return h.dd(e),h.Dc().closeDrawer()})),h.qd(70,"Apply"),h.qc(),h.qc(),h.qc(),h.qc(),h.od(71,pT,21,19,"ng-template",null,42,h.pd),h.od(73,gT,2,2,"ng-template",null,43,h.pd),h.rc(75,"nz-modal",44),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().handleExtendViewCancel()})),h.od(76,bT,1,0,"ng-container",45),h.qc(),h.rc(77,"nz-modal",46),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().timeAndSalesModalVisible=t}))("nzOnCancel",(function(){return h.dd(e),h.Dc().handleTimeAndSalesModalCancel()})),h.od(78,CT,16,2,"nz-table",47),h.rc(79,"div",48),h.rc(80,"button",20),h.zc("click",(function(){return h.dd(e),h.Dc().handleTimeAndSalesModalCancel()})),h.qd(81,"Cancel"),h.qc(),h.qc(),h.qc(),h.rc(82,"app-web-scaffold"),h.od(83,qT,1,0,"ng-container",45),h.rc(84,"div",49),h.od(85,TT,1,0,"ng-container",45),h.qc(),h.qc(),h.rc(86,"app-mobile-scaffold"),h.rc(87,"div",50),h.rc(88,"nz-row"),h.rc(89,"nz-col",51),h.qd(90,"Information"),h.qc(),h.rc(91,"nz-col",52),h.rc(92,"button",53),h.zc("click",(function(){h.dd(e);const t=h.Dc(),n=h.ad(6);return t.displayInfoInDrawer(n)}))("mouseover",(function(){return h.dd(e),h.Dc().refreshLiveSnap()})),h.mc(93,"img",54),h.qd(94,"Live Snap "),h.qc(),h.od(95,wT,3,1,"button",55),h.od(96,zT,3,1,"button",55),h.qc(),h.qc(),h.rc(97,"nz-row",56),h.rc(98,"nz-col",57),h.rc(99,"nz-select",58),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().ranking=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().onRankingChg()})),h.od(100,PT,2,1,"nz-option-group",59),h.rc(101,"nz-option-group",60),h.od(102,IT,1,2,"nz-option",24),h.qc(),h.od(103,OT,3,2,"ng-container",0),h.od(104,LT,5,2,"ng-container",0),h.od(105,BT,4,4,"nz-option-group",61),h.od(106,VT,3,3,"nz-option-group",61),h.rc(107,"nz-option-group",62),h.od(108,HT,1,2,"nz-option",24),h.qc(),h.qc(),h.od(109,$T,1,0,"ng-container",45),h.qc(),h.rc(110,"nz-col",57),h.rc(111,"app-stock-select-input-search",63),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().keyword=t}))("selectItem",(function(t){return h.dd(e),h.Dc().getSearchStockInfoT(t)}))("search",(function(t){return h.dd(e),h.Dc().onKeywordSearch(t)}))("loadMoreEvent",(function(){return h.dd(e),h.Dc().onLoadMoreDropdown()})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(112,"div",64),h.od(113,jT,1,0,"ng-container",45),h.qc(),h.qc(),h.rc(114,"app-add-to-watchlist-modal",65),h.zc("changeVisible",(function(t){return h.dd(e),h.Dc().handleAddToWatchListModalVisible(t)})),h.qc(),h.rc(115,"app-stock-price-alert-modal",66),h.zc("changeVisible",(function(t){return h.dd(e),h.Dc().handleAddPriceAlertItemModalVisible(t)})),h.qc(),h.rc(116,"app-fep-agreement-modal",67),h.zc("changeVisibleFepAgreement",(function(t){return h.dd(e),h.Dc().handleFepAgreementVisible(t)})),h.qc(),h.rc(117,"app-sg-pr-declaration-modal",68),h.zc("changeVisibleSgPrDeclaration",(function(t){return h.dd(e),h.Dc().handleSgPrDeclarationVisible(t)})),h.qc(),h.oc()}if(2&e){const e=h.ad(2),t=h.ad(72),n=h.ad(74),i=h.Dc(),c=h.ad(2);h.Ub(3),h.Mc("ngIf",!i.isNewOrderpadEnabled),h.Ub(1),h.Mc("ngIf",i.isNewOrderpadEnabled),h.Ub(1),h.Mc("isVisible",i.cdsModalVisible)("cdsStatus",i.cdsStatus)("selectedAcctType",i.selectedAcctType)("hasProcessingCdsAccountReactivation",i.hasProcessingCdsAccountReactivation),h.Ub(1),h.Mc("ngIf",!i.isNewOrderpadEnabled),h.Ub(1),h.Mc("ngIf",i.isNewOrderpadEnabled),h.Ub(1),h.Mc("tickerInfo",i.tickerInfo)("isVisible",i.isStocksCalculatorVisible),h.Ub(1),h.Mc("nzClosable",!0)("nzFooter",null)("nzTitle",null)("nzVisible",i.isCreateNewWatchlistModalVisible),h.Ub(6),h.Mc("ngModel",i.addingWatchlist),h.Ub(4),h.Mc("disabled",!i.addingWatchlist),h.Ub(2),h.Mc("nzVisible",i.isRenameWatchlistModalVisible)("nzClosable",!0)("nzFooter",null)("nzTitle",null),h.Ub(3),h.Mc("ngModel",i.selectedEditingWatchlist),h.Ub(1),h.Mc("ngForOf",i.allStockWatchLists),h.Ub(2),h.Mc("ngModel",i.editingWatchlist),h.Ub(4),h.Mc("disabled",!i.editingWatchlist||!i.selectedEditingWatchlist||i.selectedEditingWatchlist.listName===i.editingWatchlist),h.Ub(2),h.Mc("bcanRedirrectModelVisible",i.bcanRedirrectModelVisible)("bcanViewModel",i.bcanViewModel),h.Ub(1),h.Mc("nzVisible",i.chinaTradeNotAvailableModalVisible)("nzClosable",!0)("nzFooter",null)("nzTitle",null),h.Ub(14),h.Mc("nzVisible",i.isDeleteWatchlistModalVisible)("nzClosable",!0)("nzFooter",null)("nzTitle",null),h.Ub(3),h.Mc("ngModel",i.selectedDeletingWatchlist),h.Ub(1),h.Mc("ngForOf",i.allStockWatchLists),h.Ub(4),h.Mc("disabled",!i.selectedDeletingWatchlist),h.Ub(2),h.Mc("nzClosable",!1)("nzVisible",i.drawerVisible)("nzWrapClassName","customize-table-column-drawer"),h.Ub(4),h.Mc("ngForOf",i.displayCols),h.Ub(7),h.Mc("nzLoading",i.storeLoading),h.Ub(6),h.Mc("nzVisible",i.isExtendedMode)("nzFooter",null)("nzWidth","90%"),h.Ub(1),h.Mc("ngTemplateOutlet",n),h.Ub(1),h.Mc("nzVisible",i.timeAndSalesModalVisible)("nzTitle","Trade Details")("nzFooter",null)("nzWrapClassName","vertical-center-modal")("nzOkText",null),h.Ub(1),h.Mc("ngIf",i.timeAndSales.length>=1),h.Ub(5),h.Mc("ngTemplateOutlet",t),h.Ub(2),h.Mc("ngTemplateOutlet",e),h.Ub(7),h.Mc("nzSize","small"),h.Ub(1),h.Mc("src","assets/images/stocks/snap.svg",h.gd),h.Ub(2),h.Mc("ngIf",!i.shouldHide),h.Ub(1),h.Mc("ngIf",i.shouldHide),h.Ub(1),h.Mc("ngClass",h.Sc(80,GT,i.isExtendedMode)),h.Ub(2),h.Mc("ngModel",i.ranking),h.Ub(1),h.Mc("ngIf",i.allStockWatchLists.length>0),h.Ub(2),h.Mc("ngForOf",i.WATCHLIST_ACTIONS),h.Ub(1),h.Mc("ngIf",!i.isForeignExchangeSelected()||i.selectedExchange===i.stockConstant.KLSE),h.Ub(1),h.Mc("ngIf",i.isForeignExchangeSelected()&&i.selectedExchange!==i.stockConstant.KLSE),h.Ub(1),h.Mc("ngIf",i.selectedExchange===i.stockConstant.KLSE||i.selectedExchange===i.stockConstant.BURSA||i.selectedExchange===i.ALL_EXCHANGE_LIST.value),h.Ub(1),h.Mc("ngIf",i.selectedExchange!==i.stockConstant.KLSE&&i.selectedExchange!==i.stockConstant.BURSA&&i.selectedExchange!==i.ALL_EXCHANGE_LIST.value),h.Ub(2),h.Mc("ngForOf",i.THEMATIC_LIST_RANKING),h.Ub(1),h.Mc("ngTemplateOutlet",c),h.Ub(2),h.Mc("options",i.stockSearchDropdownList)("nzServerSearch",!0)("ngModel",i.keyword)("searchLoading",i.searchStockLoading),h.Ub(2),h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("visible",i.showAddToWatchlist)("selectedStock",i.addToWatchlistItem)("watchList",i.allStockWatchLists),h.Ub(1),h.Mc("visible",i.showAddPriceAlertItemModal)("selectedStock",i.addPriceAlertItem),h.Ub(1),h.Mc("visibleFepAgreement",i.visibleFepAgreement),h.Ub(1),h.Mc("visibleSgPrDeclaration",i.visibleSgPrDeclaration)}}function YT(e,t){if(1&e){const e=h.sc();h.rc(0,"div",119),h.rc(1,"div",120),h.mc(2,"div",121),h.rc(3,"div",122),h.rc(4,"div",123),h.rc(5,"div",124),h.rc(6,"div",125),h.rc(7,"p",126),h.qd(8,"Notes"),h.qc(),h.qc(),h.rc(9,"div",127),h.rc(10,"i",128),h.zc("click",(function(){return h.dd(e),h.Dc(2).onAcknowledgeNoteClick()})),h.qc(),h.qc(),h.qc(),h.rc(11,"span",129),h.qd(12,'You can view multiple stocks exchange by selecting "Most Active".'),h.qc(),h.rc(13,"div",130),h.rc(14,"button",131),h.zc("click",(function(){return h.dd(e),h.Dc(2).onAcknowledgeNoteClick()})),h.rc(15,"span",132),h.qd(16,"Got It"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}2&e&&(h.Ub(6),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12))}function KT(e,t){if(1&e&&h.od(0,YT,17,2,"div",118),2&e){const e=h.Dc();h.Mc("ngIf",e.acknowledgeNoteVisible)}}function XT(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"p",133),h.qd(2),h.qc(),h.rc(3,"p",133),h.qd(4),h.qc(),h.rc(5,"p",134),h.qd(6,"You will get L2 live snap services(30 snap), upon a successful filled trade."),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.sd("HKEX L1 Live Snap(s) Available: ",e.snapCountL1,""),h.Ub(2),h.sd("HKEX L2 Live Snap(s) Available: ",e.snapCountL3+e.snapCountL2,"")}}function QT(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"p",133),h.qd(2),h.qc(),h.rc(3,"p",134),h.qd(4,"You will get live snap services(30 snap), upon a successful filled trade."),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.sd("HKEX Live Snap(s) Available: ",e.snapCountL3+e.snapCountL2,"")}}function ZT(e,t){if(1&e&&(h.od(0,XT,7,2,"div",0),h.od(1,QT,5,1,"div",0)),2&e){const e=h.Dc();h.Mc("ngIf",!e.shouldHide),h.Ub(1),h.Mc("ngIf",e.shouldHide)}}function JT(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",135),h.rc(2,"h5",136),h.qd(3),h.qc(),h.mc(4,"app-stocks-streaming-indicator",100),h.qc(),h.rc(5,"div",135),h.rc(6,"h5",136),h.qd(7),h.qc(),h.mc(8,"app-stocks-streaming-indicator",100),h.qc(),h.rc(9,"div",135),h.rc(10,"h5",136),h.qd(11,"NASDAQ,NYSE,AMEX,BATS"),h.qc(),h.mc(12,"app-stocks-streaming-indicator",100),h.qc(),h.rc(13,"div",135),h.rc(14,"h5",136),h.qd(15,"SGX"),h.qc(),h.mc(16,"app-stocks-streaming-indicator",100),h.qc(),h.rc(17,"div",135),h.rc(18,"h5",136),h.qd(19,"SSE,SZSE"),h.qc(),h.mc(20,"app-stocks-streaming-indicator",100),h.qc(),h.rc(21,"div",135),h.rc(22,"h5",136),h.qd(23,"LSE"),h.qc(),h.mc(24,"app-stocks-streaming-indicator",100),h.qc(),h.qc()),2&e){const e=h.Dc();
5h.Ub(3),h.rd(e.BURSA),h.Ub(1),h.Mc("exchange",e.BURSA),h.Ub(3),h.rd(e.HKEX),h.Ub(1),h.Mc("exchange",e.HKEX),h.Ub(4),h.Mc("exchange",e.AMEX),h.Ub(4),h.Mc("exchange",e.SGX),h.Ub(4),h.Mc("exchange",e.SSE),h.Ub(4),h.Mc("exchange",e.LSE)}}function ew(e,t){if(1&e){const e=h.sc();h.rc(0,"stocks-streaming-info-modal",137),h.zc("close",(function(){return h.dd(e),h.Dc().closeStreamingModal()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("isMobile",!0)("isVisible",e.streamingModal)("isTradingPage",e.isTradingPage)}}let tw=(()=>{class e extends Pv.a{constructor(e,t,n,i,c,o,s,a,l,r,u,p,m,f,g,b,S,y,v,C,q,T,w,z,D,P,I,k,A,E,F){super(u,c,r,l,i,v),this.accountRestService=e,this.modal=t,this.portfolioService=n,this.stockInfoRestService=i,this.store=c,this.accountService=o,this.trustAccountRestService=s,this.cdsAccountRestService=a,this.uiTableService=l,this.lightStreamerHelperService=r,this.liveFeedService=u,this.route=p,this.router=m,this.notification=f,this.stockTransactionRestService=g,this.watchlistRestService=b,this.mdfRestService=S,this.stocksInfoRestService=y,this.modalService=v,this.subHandlingService=C,this.stocksFactsheetRestService=q,this.nzNotificationService=T,this.productPriceAlert=w,this.stockKeyConfigRestService=z,this.stocksLeveragedInverseService=D,this.thematicPortfolioService=P,this.drawerService=I,this.cdRef=k,this.scheduledSellRestService=A,this.stockAccountRestService=E,this.stockRestService=F,this.isExtendedMode=!1,this.klseLeveragedInverseStockList=[],this.changeExtendView=new h.s,this.emitTimeAndSalesAction=new h.s,this.emitMarketDepthAction=new h.s,this.emitSummaryAction=new h.s,this.emitSelectedExchange=new h.s,this.handleCdsAccountReactivation=new h.s,this.stockConstant=zv.a,this.STOCK_SEARCH_LIMIT=20,this.LIVE_TRADE_LIMIT=30,this.WATCHLIST_ACTIONS=[{label:"Create New Watchlist",value:"create-new-watchlist"},{label:"Rename Watchlist",value:"rename-watchlist"},{label:"Delete Watchlist",value:"delete-watchlist"}],this.NOTIFICATION_ERROR={type:"error",value:"ERROR"},this.NOTIFICATION_SUCCESS={type:"success",value:"SUCCESS"},this.MARKET_ORDER=zv.a.ORDER_TYPE.MARKET_ORDER,this.MARKET_TO_LIMIT_ORDER=zv.a.ORDER_TYPE.MARKET_TO_LIMIT_ORDER,this.STOP_ORDER=zv.a.ORDER_TYPE.STOP_ORDER,this.STOP_LIMIT_ORDER=zv.a.ORDER_TYPE.STOP_LIMIT_ORDER,this.EXCHANGE_LIST=[],this.WATCHLIST_EXCHANGE_LIST=[],this.searchInput$=new jt.a,this.keywordPage=0,this.searchReachEnd=!1,this.allStockWatchLists=[],this.stockSearchDropdownList=[],this.drawerVisible=!1,this.storeLoading=!1,this.isCreateNewWatchlistModalVisible=!1,this.isRenameWatchlistModalVisible=!1,this.isDeleteWatchlistModalVisible=!1,this.showAddToWatchlist=!1,this.redirectFromFactSheet=!1,this.prevSelectedRanking=null,this.isStocksCalculatorVisible=!1,this.transactionModalVisible=!1,this.priceQuote={},this.addToWatchlistItem={},this.password="",this.cdsModalVisible=!1,this.cdsStatus="",this.hasProcessingCdsAccountReactivation=!1,this.cdsStatusConstant=zv.a.CDS_STATUS,this.previewModalVisible=!1,this.transactionPreviewData={},this.timeAndSalesModalVisible=!1,this.addPriceAlertItem={},this.showAddPriceAlertItemModal=!1,this.IStockOptionType=d.c,this.streamingModal=!1,this.isTradingPage=!0,this.KLSE=zv.a.KLSE,this.BURSA=zv.a.BURSA,this.AMEX=zv.a.AMEX,this.HKEX=zv.a.HKEX,this.SGX=zv.a.SGX,this.SSE=zv.a.SSE,this.SZSE=zv.a.SZSE,this.LSE=zv.a.LSE,this.displayCols=[{key:"lotSize",colName:"Lot Size",align:"left",checked:!1},{key:"exchange",colName:"Exch",align:"left",checked:!1},{key:"stockCode",colName:"Code",align:"left",checked:!0},{key:"stockName",colName:"Name",align:"left",checked:!0,disabled:!0},{key:"currency",colName:"Currency",align:"left",checked:!1},{key:"lastPrice",colName:"Last",align:"right",checked:!0,disabled:!0},{key:"change",colName:"Chg",align:"right",checked:!0,disabled:!0},{key:"changePercentage",colName:"Chg(%)",align:"right",checked:!0,disabled:!0},{key:"bidQuantity",colName:"Bid Qty",align:"right",checked:!0},{key:"bidPrice",colName:"Bid",align:"left",checked:!0,disabled:!0},{key:"askPrice",colName:"Ask",align:"left",checked:!0,disabled:!0},{key:"askQuantity",colName:"Ask Qty",align:"right",checked:!0},{key:"cumulativeVolume",colName:"Vol",align:"right",checked:!0,disabled:!0},{key:"openPrice",colName:"Open",align:"right",checked:!1}
5,{key:"closePrice",colName:"Close",align:"right",checked:!1},{key:"dayHigh",colName:"High",align:"right",checked:!1},{key:"dayLow",colName:"Low",align:"right",checked:!1},{key:"remark",colName:"Remark",align:"left",checked:!1},{key:"sentiment",colName:"Sentiment",align:"left",checked:!1}],this.extendDisplayCols=[],this.originalDisplayCols=[],this.isRedirected=!1,this.exchangeFeeNameDescMap=new Map,this.sectorListStock=[],this.thematicPortfolioStock=[],this.SHARED_IMG_PATH=M.g.SHARED_IMG_PATH,this.WATCHLIST_INIT="init",this.searchStockLoading=!1,this.w8BenChecked=!1,this.visibleFepAgreement=!1,this.visibleSgPrDeclaration=!1,this.checkSiDeclaration=!1,this.checkLeverageInverseRiskAssessment=!1,this.acknowledgeNoteVisible=!0,this.isScheduledSellOrder=!1,this.isScheduledSellOrderExist=!1,this.isModifyOrder=!1,this.bcanRedirrectModelVisible=!1,this.chinaTradeNotAvailableModalVisible=!1,this.CHINA="China",this.shouldHide=!0,this.isNewOrderpadEnabled=!1}ngOnInit(){this.stockRestService.enableMarketData().subscribe(e=>{!1===e.data?this.shouldHide=!0:!0===e.data&&(this.shouldHide=!1)});const e=history.state;"HK"==(null==e?void 0:e.market)?this.selectedExchange="HKEX":"US"==(null==e?void 0:e.market)?this.selectedExchange="NASDAQ":"SG"==(null==e?void 0:e.market)&&(this.selectedExchange="SGX"),this.accountRestService.getFactsheetRevampEnabledProperties().subscribe(e=>{!0===(null==e?void 0:e.data)&&(this.isNewOrderpadEnabled=!0)}),this.tradableRefno=this.accountService.getTradableAccountRefno,this.username=this.store.selectSnapshot(f.a.getId)?this.store.selectSnapshot(f.a.getId)+"_":"",this.acknowledgeNoteVisible=null===Object(Av.a)(this.username+M.h.STOCK_TRADE_NOTICE_VISIBLE)||Object(Av.a)(this.username+M.h.STOCK_TRADE_NOTICE_VISIBLE);let t=Object(g.a)(zv.a.EXCHANGE_LIST);t.splice(1,1),this.EXCHANGE_LIST=this.accountService.isSingaporean?t:Object(g.a)(zv.a.EXCHANGE_LIST),this.originalDisplayCols=Object(g.a)(this.displayCols),this.getCdsAccountDetails(),this.extendDisplayCols=Object(g.a)(this.originalDisplayCols).map(e=>(e.checked=!0,e)),this.screenWidth=screen.width,this.screenHeight=screen.height,this.ranking=this.RANKING_OPTIONS_ALL[0].value,this.setKeyConfig(),this.setThematicPortFolioCategory(),this.subscribeKeyword(),this.findStockWatchlistByAccId(this.WATCHLIST_INIT),this.checkCashBalance(),this.checkSgPrDeclarationIsNotSubmitted()&&(this.visibleSgPrDeclaration=!0),this.checkBcanApplication()}ngOnDestroy(){console.groupEnd(),this.snapStocksSubscription&&this.snapStocksSubscription.unsubscribe()}ngOnChanges(e){var t,n,i,c;(null===(t=null==e?void 0:e.selectedStockOption)||void 0===t?void 0:t.currentValue)===d.c.PRICE&&this.readPortfolio(),(null===(n=null==e?void 0:e.proceedtoRedirectHKEXFlag)||void 0===n?void 0:n.currentValue)&&this.getW8BenDetails().subscribe(e=>{var t,n;e.status===M.a.RESPONSE_SUCCESS&&(this.w8BenStatus=null===(t=e.data)||void 0===t?void 0:t.w8Status,this.w8ExpiryDate=null===(n=e.data)||void 0===n?void 0:n.w8ExpiryDate),this.checkParamforRedirection()}),(null===(i=null==e?void 0:e.cdsAccountReactivateSuccess)||void 0===i?void 0:i.currentValue)&&(this.getCdsAccountDetails(),(null===(c=null==e?void 0:e.cdsAccountPendingTrigger)||void 0===c?void 0:c.currentValue)&&(this.cdsModalVisible=!0)),console.log("changes",e)}onLoadMoreDropdown(){!this.keywordOnSearch||this.searchReachEnd||this.searchStockLoading||(this.keywordPage+=1,this.searchStockByKeyword(this.keywordOnSearch))}subscribeKeyword(){this.searchInput$.pipe(Object(ce.a)(500),Object(b.a)()).subscribe(e=>{""!==e&&null!==e?(this.keywordPage=0,this.searchStockLoading=!1,this.searchReachEnd=!1,this.keywordOnSearch=e,this.stockSearchDropdownList=[],this.searchStockByKeyword(e)):null===e&&(this.keywordOnSearch=null,this.onRankingChg())})}searchStockByKeyword(e){this.searchStockLoading=!0,this.stocksInfoRestService.searchStock(e,this.keywordPage,zv.a.STOCK_SEARCH_LIMIT,this.accountService.isSingaporean?zv.a.EXCHANGE_LIST_WITHOUT_SGX:zv.a.EXCHANGE_LIST_ORDER,null,!0).subscribe(e=>{e.data&&0==e.data.length?this.searchReachEnd=!0:e.data.forEach(e=>{this.stockSearchDropdownList.push(e)}),this.searchStockLoading=!1})}listenToSnapChange(){this.snapStocksSubscription&&this.snapStocksSubscription.unsubscribe(),this.snapStocksSubscription=this.liveFeedService.getSnapStocksObservable().subscribe(e=>{if(e&&0!=e.size)for(const[t,n]of e.entries()){let e=this.findStockRankingPosition(t);-1!=e&&n.endSnapDate>Date.now()&&(this.stocks[e]=Object.assign(Object.assign({},this.stocks[e]),n),this.stocks=[...this.stocks],this.lightStreamerChanges=Object.assign({},n),this.cdRef.detectChanges(),this.cdRef.markForCheck())}})}setKeyConfig(){this.subHandlingService.once(this.stockKeyConfigRestService.readKeyConfig(this.store.selectSnapshot(f.a.getId),this.stockKeyConfigRestService.LIVE_STOCK_CATEGORY).pi
5pe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e.status&&e.data&&e.data.length>0&&(this.displayCols=[],e.data.forEach(e=>{let t=this.originalDisplayCols.find(t=>t.key===e.key);t&&this.displayCols.push({key:e.key,colName:t.colName,align:t.align,checked:e.checked,disabled:!!t.disabled&&t.disabled})}))})))}getGeneralFeeDetails(e,t){e&&t&&this.subHandlingService.subscribe(this.stockInfoRestService.getFeeDetails(e,t).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.generalStockBuyFeeDetails=e.data.buyFeeDetails,this.generalStockSellFeeDetails=e.data.sellFeeDetails,t===zv.a.HKEX&&(this.generalStockBuyFeeDetails.exchangeFees=Object(Ov.b)(this.generalStockBuyFeeDetails.exchangeFees,zv.a.EXCHANGE_FEE_ORDER,"exchangeFeeName"),this.generalStockSellFeeDetails.exchangeFees=Object(Ov.b)(this.generalStockSellFeeDetails.exchangeFees,zv.a.EXCHANGE_FEE_ORDER,"exchangeFeeName")),this.updateExchangeFeeNameDescMap())})))}updateExchangeFeeNameDescMap(){this.exchangeFeeNameDescMap.clear();const e=this.selectedTransactionType?this.generalStockBuyFeeDetails:this.generalStockSellFeeDetails;if(e&&e.exchangeFees){const t=new Map;e.exchangeFees.forEach(e=>{e.exchangeFeeName&&""!==e.exchangeFeeName&&(t.set(e.exchangeFeeName,e.feeDesc),null!=e.taxRate&&e.taxRate>0)&&t.set(e.exchangeFeeName+"_SST",e.feeDesc+" SST")}),e.taxRate&&e.taxRate>0&&t.set("COMMISSION_SST","Processing Fee SST"),this.exchangeFeeNameDescMap=new Map(t)}}addSstToFeeDetails(e){const t=this.selectedTransactionType?this.generalStockBuyFeeDetails:this.generalStockSellFeeDetails,n=[];e.feeDetails.map(e=>{const i=parseFloat(e.feeAmount);let c=0;if("COMMISSION"===e.feeName&&t.taxRate&&t.taxRate>0)c=(null==t?void 0:t.taxRate)||0;else{const n=t.exchangeFees.find(t=>t.exchangeFeeName===e.feeName);n&&n.taxRate&&n.taxRate>0&&(c=n.taxRate)}if(c>0){const t=Object(Uv.a)(i,c);n.push({currency:e.currency,feeAmount:t.toFixed(2),feeName:e.feeName+"_SST"})}}),(null==n?void 0:n.length)>0&&e.feeDetails.push(...n)}setThematicPortFolioCategory(){this.subHandlingService.subscribe(this.thematicPortfolioService.getThematicPortfolioCategory().pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e.status&&e.data&&e.data.forEach(e=>{this.THEMATIC_LIST_RANKING.push({label:e.categoryName,value:e.categoryCode})})})))}checkParamforRedirection(){const e=this.router.parseUrl(this.router.url).queryParams;e.symbol&&e.transactType&&(this.isRedirected=!0,this.selectedTransactionType="buy"===e.transactType,this.subHandlingService.once(this.stocksInfoRestService.getStockTickerInfo(e.symbol).pipe(Object(y.a)(t=>{if(M.a.RESPONSE_SUCCESS===t.status&&t.data){console.log("CHECK PARAM",t.data),this.keyword=t.data;let n=t.data;this.getSearchStockInfo(),this.selectedStock.exchange=n.exchange,this.selectedStock.stockCode=n.stockCode,this.selectedStock.qty=parseInt(e.qty),this.selectedStock.ordPrice=parseFloat(e.ordPrice),this.accountService.isSingaporean&&this.selectedStock.exchange===zv.a.SGX?(this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,this.router.onSameUrlNavigation="reload",this.router.navigate([M.o.APP,M.o.TRADE,M.o.STOCKS])):this.handleModalVisible(this.selectedStock)}}))))}mapOfflineProp(e){let t=e,n=e.productCode.split(":")[0];return n===zv.a.BURSA&&(n=zv.a.KLSE),t.sedolnumber=n+":"+e.productCode,t.stockName=e.productName,t.stockCode=e.productCode.split(".")[2],t.exchange=n,t}mapOfflineSector(e){let t=e;return t.sedolnumber=e.exchange+":"+e.stockCode,t.stockName=e.stockName,t.stockCode=e.stockCode,t.exchange=e.exchange,t}readScreenSector(){let e=[];this.stocksInfoRestService.getTopMarketCapStock(0,this.LIVE_TRADE_LIMIT,this.selectedExchange===zv.a.BURSA?zv.a.KLSE:this.selectedExchange,this.ranking).subscribe(t=>{M.a.RESPONSE_SUCCESS===t.status&&t.data&&(this.sectorListStock=t.data.result,this.stocks=[],this.isLsAlive?(t.data.result.forEach(t=>{t.sedolnumber=t.exchange+":"+t.msInstrumentId,e.push(t)}),this.subscribeLSPriceQuote(e,this.isRedirected)):(this.prevSelectedRanking=this.ranking,this.sectorListStock.forEach(e=>{this.stocks.push(this.mapOfflineSector(e))}),this.stocks=this.setPriceAlert(this.stocks),this.stocks=this.setShariahFlag(this.stocks)))})}readThematicPortfolioProduct(){let e=[];this.subHandlingService.subscribe(this.thematicPortfolioService.getThematicPortfolioProductByExchangeAndCategoryCode(this.selectedExchange===zv.a.BURSA?zv.a.KLSE:this.selectedExchange===this.ALL_EXCHANGE_LIST.value?"":this.selectedExchange,this.ranking).pipe(Object(y.a)(t=>{M.a.RESPONSE_SUCCESS===t.status&&t.data&&(this.accountService.isSingaporean&&t.data.forEach((e,n)=>{e.exchange===zv.a.SGX&&t.data.splice(n,1)}),this.thematicPortfolioStock=t.data.slice(0,31),this.stocks=[],this.thematicPortfolioStock.length>1&&this.thematicPortfolioStock.sort((function(e,t){return e.stockName<t.stockName?-1:e.stockName>t.stockName?1:0})),this.thematicPortfolioStock.length>
5this.LIVE_TRADE_LIMIT&&this.thematicPortfolioStock.splice(0,this.LIVE_TRADE_LIMIT),this.isLsAlive?(t.data.forEach(t=>{t.sedolnumber=t.exchange+":"+t.msInstrumentId,e.push(t)}),this.subscribeLSPriceQuote(e,this.isRedirected)):(this.prevSelectedRanking=this.ranking,this.thematicPortfolioStock.forEach(e=>{this.stocks.push(this.mapOfflineSector(e))}),this.stocks=this.setPriceAlert(this.stocks),this.stocks=this.setShariahFlag(this.stocks)))})))}readScreenETF(){let e=[];this.stocksInfoRestService.getSecurityTypeStock(0,this.LIVE_TRADE_LIMIT,this.selectedExchange===zv.a.BURSA?zv.a.KLSE:this.selectedExchange,this.ranking).subscribe(t=>{M.a.RESPONSE_SUCCESS===t.status&&t.data&&(this.sectorListStock=t.data.result,this.stocks=[],this.isLsAlive?(t.data.result.forEach(t=>{t.sedolnumber=zv.a.KLSE+":"+t.msInstrumentId,e.push(t)}),this.subscribeLSPriceQuote(e)):(this.prevSelectedRanking=this.ranking,this.sectorListStock.forEach(e=>{this.stocks.push(this.mapOfflineSector(e))}),this.stocks=this.setPriceAlert(this.stocks),this.stocks=this.setShariahFlag(this.stocks)))})}checkCashBalance(){const e=this.accountService.getTradableAccountRefno;e&&this.stockTransactionRestService.checkCashBalance(e,this.selectedExchange).subscribe(e=>{e.data&&(this.cashBalanceModel=e.data)})}findStockPriceAlert(){this.subHandlingService.once(this.productPriceAlert.findByAccountIdAndProductType(Dv.PRODUCT_TYPE_STOCK).pipe(Object(y.a)(e=>{if(M.a.RESPONSE_SUCCESS===e.status&&e.data){let t=e.data;this.stockPriceAlertProductCodeList=[];for(let e of t)this.stockPriceAlertProductCodeList.push(e.productCode.substring(e.productCode.indexOf(":")+1))}}),Object(uv.a)(()=>{})))}findStockPriceAlertAndNonShariahAndSiStock(){const e=this.productPriceAlert.findByAccountIdAndProductType(Dv.PRODUCT_TYPE_STOCK),t=this.stocksInfoRestService.getStockTickerInfoS
5hariahDetails(zv.a.KLSE,!0);this.subHandlingService.subscribe(Object(ht.a)([e,t]).pipe(Object(y.a)(e=>{if(M.a.RESPONSE_SUCCESS===e[0].status&&e[0].data){let t=e[0].data;this.stockPriceAlertProductCodeList=[];for(let e of t)this.stockPriceAlertProductCodeList.push(e.productCode.substring(e.productCode.indexOf(":")+1))}M.a.RESPONSE_SUCCESS===e[1].status&&e[1].data&&(this.nonShariahStockList=e[1].data)}),Object(uv.a)(()=>{this.isRedirected||this.onRankingChg()})))}findStockWatchlistByAccId(e){this.subHandlingService.once(this.watchlistRestService.findStockWatchlistByAccountId().pipe(Object(y.a)(t=>{M.a.RESPONSE_SUCCESS===t.status&&t.data&&(this.allStockWatchLists=t.data,this.accountService.isSingaporean&&this.allStockWatchLists[0].item.forEach((e,t)=>{e.productCode.split(":")[0]===zv.a.SGX&&this.allStockWatchLists[0].item.splice(t,1)}),"delete"===e&&(this.ranking=this.allStockWatchLists.filter(e=>this.ranking.listId===e.listId)[0],this.onRankingChg()),e===this.WATCHLIST_INIT&&(this.allStockWatchLists[0].item.forEach(e=>{const t=e.productCode.split(":")[0];this.WATCHLIST_EXCHANGE_LIST.push({checked:!1,label:t===zv.a.BURSA?zv.a.KLSE:t,value:t})}),this.WATCHLIST_EXCHANGE_LIST=Object(kv.a)(this.WATCHLIST_EXCHANGE_LIST,"value"),this.route.snapshot.queryParamMap.get("stock")&&(this.addToWatchlistItem=JSON.parse(this.route.snapshot.queryParamMap.get("stock")),this.showAddToWatchlist=!0,this.redirectFromFactSheet=!0),this.ranking=this.isForeignExchangeSelectedAndNotBATS()?this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_STOCK[0].value:this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_ALL[0].value,this.findStockPriceAlertAndNonShariahAndSiStock())),e===this.WATCHLIST_INIT&&this.findStockPriceAlert()})))}isForeignExchangeSelectedAndNotBATS(){return this.selectedExchange!==zv.a.BURSA&&this.selectedExchange!==this.ALL_EXCHANGE_LIST.value&&this.selectedExchange!==zv.a.BATS}isForeignExchangeSelected(){return this.selectedExchange!==zv.a.BURSA&&this.selectedExchange!==this.ALL_EXCHANGE_LIST.value}createNotification(e,t){if("success"===e){const e=this.modalService.success({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}else if("error"===e){const e=this.modalService.error({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}}readPortfolio(){this.portfolioService.readPortfolio(this.accountService.getTradableAccountRefno,zv.a.allExchangeStr()).subscribe(e=>{this.holdingInfo=e.data})}refreshPortfolio(e){e?setTimeout(()=>{this.readPortfolio()},3e3):this.readPortfolio()}getSearchStockInfoT(e){this.keyword=e,this.getSearchStockInfo()}getSearchStockInfo(){let e=this.keyword;e?(e.sedolnumber=e.exchange+":"+e.stockCode,this.selectedExchange=e.exchange===zv.a.EXCHANGE_LIST[0].label?zv.a.EXCHANGE_LIST[0].value:e.exchange,this.handleChinaDisplayCol(e.exchange),this.setSelectedExchgTabColor(e.exchange),this.ranking=this.SEARCH_RESULT.value,this.subscribeLSPriceQuote([e],this.isRedirected)):(this.ranking=this.isForeignExchangeSelectedAndNotBATS()?this.RANKING_OPTIONS_STOCK[0].value:this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_ALL[0].value,this.onRankingChg())}isWatchListHkexExist(){return this.ranking.item.find(e=>e.sedolnumber.split(":")[0]===zv.a.HKEX)?zv.a.HKEX:this.selectedExchange}isMostActiveETFRanking(){return 1===this.RANKING_OPTIONS_ETF.filter(e=>this.ranking===e.value).length}onExchgChg(e){if(this.selectedExchange===zv.a.HKEX&&!this.isHkexLivestreaming&&this.listenToSnapChange(),this.handleChinaDisplayCol(e),this.setSelectedExchgTabColor(e),this.isWatchlistRanking())return this.emitSelectedExchange.emit(this.selectedExchange),void this.onRankingChg();if(this.isETFRanking()||this.isSectorRanking()||this.isMostActiveETFRanking()||this.isThematicPortfolioRanking())return this.emitSelectedExchange.emit(this.selectedExchange),(this.isETFRanking()||this.isMostActiveETFRanking())&&(this.ranking=this.selectedExchange===zv.a.BURSA?this.ETF_LIST_RANKING[0].value:this.ranking===this.ETF_LIST_RANKING[0].value?this.RANKING_OPTIONS_ETF[0].value:this.ranking),void this.onRankingChg();this.ranking===this.SEARCH_RESULT.value||this.isWatchlistRanking()||this.prevSelectedRanking&&this.prevSelectedRanking.listId&&!this.isForeignExchangeSelectedAndNotBATS()?this.ranking=this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_ALL[0].value:(this.ranking===this.SEARCH_RESULT.value||this.isWatchlistRanking()||this.prevSelectedRanking&&this.prevSelectedRanking.listId&&this.isForeignExchangeSelectedAndNotBATS())&&(this.ranking=this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_STOCK[0].value),this.ranking=e===this.ALL_EXCHANGE_LIST.value&&this.allStockWatchLists.length>0?this.allStockWatchLists[0]:this.isForeignExchangeSelectedAndNotBATS()?this.RANKING_OPTIONS_STOCK[0].value:this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_ALL[0].value,this.onRankingChg();let t=this.selectedExchange;this.selectedExchange===zv.a.EXCHANGE_LIST[0].value&&(t=zv.a.EXCHANGE_LIST[0].label),this.emitSelectedExchange.emit(t)}setSelectedExchgTabColor(e){for(let t=0;t<this.EXCHANGE_LIST.length;t++)this.EXCHANGE_LIST[t].checked=e===this.EXCHANGE_LIST[t].value;for(let t=0;t<this.WATCHLIST_EXCHANGE_LIST.length;t++)this.WATCHLIST_EXCHANGE_LIST[t].checked=e===this.WATCHLIST_EXCHANGE_LIST[t].value;this.ALL_EXCHANGE_LIST.checked=e===this.ALL_EXCHANGE_LIST.value}handleChinaDisplayCol(e){e===this.SSE||e===this.SZSE?this.setChinaExchgDisplayCol():this.removeChinaExchgDisplayCol()}isWatchListContainChinaExchange(){return this.WATCHLIST_EXCHANGE_LIST.filter(e=>e.value===this.SSE||e.value===this.SZSE).length>0}setChinaExchgDisplayCol(){this.removeChinaExchgDisplayCol(),this.displayCols.push({key:"tradingInfo",colName:"Trading Info",align:"right",checked:!0,disabled:!0}),this.originalDisplayCols=Object(g.a)(this.displayCols),this.extendDisplayCols=Object(g.a)(this.originalDisplayCols).map(e=>(e.checked=!0,e))}removeChinaExchgDisplayCol(){this.displayCols=this.displayCols.filter(e=>"tradingInfo"!==e.key),this.originalDisplayCols=Object(g.a)(this.displayCols),this.extendDisplayCols=Object(g.a)(this.originalDisplayCols).map(e=>(e.checked=!0,e))}onRankingChg(e){e&&null!=e&&(this.oriRankingSelected!=e&&(this.sortedTableKey=null),this.oriRankingSelected=e),this.isMostActiveETFRanking()&&this.prevSelectedRanking&&this.prevSelectedRanking.listId&&(this.ranking=this.ETF_LIST_RANKING[0].value);let t=!1;if(this.unsubscribeLightStreamerClient(),this.selectedExchange||(this.selectedExchange=this.EXCHANGE_LIST[0].value),this.keyword=null,this.stockSearchDropdownList=[],this.stocks=[],this.stockSearchDropdownList=[],this.sectorListStock=[],console.log("STCKS",this.ranking),this.isThematicPortfolioRanking())this.subHandlingService.subscribe(this.thematicPortfolioService.getThematicPortfolioProductExchanges(this.ranking).pipe(Object(y.a)(e=>
5{this.WATCHLIST_EXCHANGE_LIST=[],e.data.forEach(e=>{this.accountService.isSingaporean&&e===zv.a.SGX||this.WATCHLIST_EXCHANGE_LIST.push({checked:!1,label:e===zv.a.BURSA?zv.a.KLSE:e,value:e})});let t=e.data.some((function(e){return e===zv.a.SSE||e===zv.a.SZSE}));this.WATCHLIST_EXCHANGE_LIST.sort((e,t)=>this.EXCHANGE_LIST.findIndex(t=>t.label===e.label)-this.EXCHANGE_LIST.findIndex(e=>e.label===t.label));let n=this.WATCHLIST_EXCHANGE_LIST.filter(e=>e.value===this.selectedExchange).length;this.prevSelectedRanking&&!n&&(this.selectedExchange=this.ALL_EXCHANGE_LIST.value,t?this.setChinaExchgDisplayCol():this.removeChinaExchgDisplayCol()),this.readThematicPortfolioProduct(),this.prevSelectedRanking=this.ranking})));else if(this.isSectorRanking())!this.prevSelectedRanking||!this.prevSelectedRanking.listId&&!this.isThematicPortfolioRanking(this.prevSelectedRanking)||this.isSectorRanking()&&this.isETFRanking()||(this.selectedExchange=zv.a.BURSA,this.removeChinaExchgDisplayCol()),this.readScreenSector(),this.prevSelectedRanking=this.ranking;else if(this.isETFRanking())!this.prevSelectedRanking||!this.prevSelectedRanking.listId&&!this.isThematicPortfolioRanking(this.prevSelectedRanking)||this.isSectorRanking()&&this.isETFRanking()||(this.selectedExchange=zv.a.BURSA,this.removeChinaExchgDisplayCol()),this.readScreenETF(),this.prevSelectedRanking=this.ranking;else if(this.isWatchlistRanking()){if(this.WATCHLIST_EXCHANGE_LIST=[],this.allStockWatchLists.find(e=>e.listId===this.ranking.listId).item.forEach(e=>{const t=e.productCode.split(":")[0];this.WATCHLIST_EXCHANGE_LIST.push({checked:!1,label:t===zv.a.BURSA?zv.a.KLSE:t,value:t})}),this.WATCHLIST_EXCHANGE_LIST=Object(kv.a)(this.WATCHLIST_EXCHANGE_LIST,"value"),this.WATCHLIST_EXCHANGE_LIST.some(e=>e.value===this.selectedExchange)||(this.selectedExchange=this.ALL_EXCHANGE_LIST.value),this.prevSelectedRanking&&(this.prevSelectedRanking.listId!==this.ranking.listId&&(this.selectedExchange=this.ALL_EXCHANGE_LIST.value),this.selectedExchange===this.ALL_EXCHANGE_LIST.value&&this.isWatchListContainChinaExchange()?this.setChinaExchgDisplayCol():this.handleChinaDisplayCol(this.selectedExchange)),this.isLsAlive){this.prevSelectedRanking=this.ranking,this.ranking.item.forEach(e=>{e.sedolnumber=e.productCode});let e=this.ranking.item.filter(e=>e.productCode.split(":")[0]===zv.a.KLSE&&this.selectedExchange===zv.a.BURSA||this.selectedExchange===this.ALL_EXCHANGE_LIST.value||e.productCode.split(":")[0]===this.selectedExchange);0!==e.length&&this.subscribeLSPriceQuote(e,this.isRedirected)}else this.prevSelectedRanking=this.ranking,this.ranking.item.forEach(e=>{this.stocks.push(this.mapOfflineProp(e))}),this.selectedExchange!==this.ALL_EXCHANGE_LIST.value&&(this.stocks=this.stocks.filter(e=>e.exchange===zv.a.KLSE&&this.selectedExchange===zv.a.BURSA||e.exchange===this.selectedExchange)),this.stocks=this.setPriceAlert(this.stocks),this.stocks=this.setShariahFlag(this.stocks);this.emitSelectedExchange.emit(this.selectedExchange)}else if(this.ranking===this.WATCHLIST_ACTIONS[0].value)this.ranking=Object(g.a)(this.prevSelectedRanking),this.showCreateNewWatchlistModal();else if(this.ranking===this.WATCHLIST_ACTIONS[1].value)this.ranking=Object(g.a)(this.prevSelectedRanking),this.showRenameWatchlistModal();else if(this.ranking===this.WATCHLIST_ACTIONS[2].value)this.ranking=Object(g.a)(this.prevSelectedRanking),this.showDeleteWatchlistModal();else if(this.isRanking()){if(t=!0,!this.prevSelectedRanking){const e=history.state;this.selectedExchange="HK"==(null==e?void 0:e.market)?"HKEX":"US"==(null==e?void 0:e.market)?"NASDAQ":"SG"==(null==e?void 0:e.market)?"SGX":zv.a.BURSA,this.removeChinaExchgDisplayCol()}if(this.prevSelectedRanking&&(this.prevSelectedRanking.listId||this.isThematicPortfolioRanking(this.prevSelectedRanking))&&(this.selectedExchange=zv.a.BURSA,this.removeChinaExchgDisplayCol()),this.selectedExchange!==this.prevSelectedExchange&&""!==this.prevSelectedExchange)switch(this.ranking=this.prevSelectedRanking,this.selectedExchange){case zv.a.BATS:case zv.a.BURSA:case zv.a.HKEX:case zv.a.AMEX:case zv.a.NASDAQ:case zv.a.NYSE:case zv.a.SGX:case zv.a.SSE:case zv.a.SZSE:case zv.a.LSE:this.ranking=this.ranking.replace("All","Stock");break;default:this.ranking=this.prevSelectedRanking}this.prevSelectedRanking=this.ranking,this.prevSelectedExchange=this.selectedExchange,this.getRankingInfo(this.selectedExchange)}else this.prevSelectedRanking||(this.ranking=this.isForeignExchangeSelectedAndNotBATS()?this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_STOCK[0].value:this.selectedExchange===zv.a.BATS?this.RANKING_OPTIONS_ETF[0].value:this.RANKING_OPTIONS_ALL[0].value),this.getRankingInfo(this.selectedExchange);this.prevSelectedExchange=t?this.prevSelectedExchange:"",this.setSelectedExchgTabColor(this.selectedExchange)}handleModalVisible(e){this.feeDetail=null,this.feeDetailStatus=null,this.isRedirected||(this.selectedStock.ordPrice="",this.selectedTransactionType=e.transactionType),this.selectedStock=e.data?e.data:e,this.checkW8BenForm(this.selectedStock)?this.checkChinaTrade()?this.selectedStock.exchange!==this.SSE&&this.selectedStock.exchange!==this.SZSE||this.bcanViewModel&&"Y"===this.bcanViewModel.bcanFlag?this.checkFepAgreemeent(this.selectedStock)?this.selectedStock.exchange===this.KLSE&&this.checkKlseLeveragedInverse(this.selectedStock)?this.preHandleKlseLeveragedInverseStock():this.handleModalVisiblePost():(this.transactionModalVisible=!1,this.visibleFepAgreement=!0):(this.transactionModalVisible=!1,this.showBcanApplicationRedirrectModel()):(this.transactionModalVisible=!1,this.chinaTradeNotAvailableModalVisible=!0):(this.transactionModalVisible=!1,this.showW8BenFormErrorModel())}preHandleKlseLeveragedInverseStock(){this.stocksLeveragedInverseService.hasSubmittedLiDocumentOrSiDeclaration()?this.stocksLeveragedInverseService.hasAcceptedRiskAssessment()?this.handleModalVisiblePost():(this.transactionModalVisible=!1,this.checkLeverageInverseRiskAssessment=!0):(this.transactionModalVisible=!1,this.checkSiDeclaration=!0)}onSiAccepted(){this.onCloseSiModal(),this.stocksLeveragedInverseService.hasAcceptedRiskAssessment()?this.handleModalVisiblePost():this.checkLeverageInverseRiskAssessment=!0}onCloseSiModal(){this.checkSiDeclaration=!1}onCloseRiskDisclosureModal(e){this.checkLeverageInverseRiskAssessment=e}preHandleModalVisible(){this.checkLeverageInverseRiskAssessment=!1,this.checkSiDeclaration=!1,this.handleModalVisiblePost()}handleModalVisiblePost(){this.selectedStock.exchange!==this.KLSE||this.cdsStatusConstant[1]!==this.cdsStatus&&this.cdsStatusConstant[2]!==this.cdsStatus?(this.selectedStock.bidPrice=parseFloat(this.selectedStock.bidPrice),this.selectedStock.askPrice=parseFloat(this.selectedStock.askPrice),this.selectedStock.name=this.selectedStock.stockName,this.selectedStock.code=this.selectedStock.stockCode,this.getGeneralFeeDetails(this.selectedStock.stockCode,this.selectedStock.exchange),this.stocksFactsheetRestService.readStocksTickerAndPriceInfo(this.selectedStock.stockCode,this.selectedStock.exchange===zv.a.BURSA?zv.a.KLSE:this.selectedStock.exchange).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data&&e.data.priceQuote&&e.data.priceQuote[0]&&(this.priceQuote=e.data.priceQuote[0])}),this.transactionModalVisible=!0,this.isAcctAllowScheduledSell&&(this.getEnabledProduct(),this.checkIsScheduledSellOrderExist()),this.isExtendedMode=!1,this.changeExtendView.emit(this.isExtendedMode),this.handleSelectedStockForMarketDepth(this.selectedStock)):(this.cdsModalVisible=!0,this.cdRef.detectChanges())}getFeeOrder(e,t){if(!isNaN(e.price)&&!isNaN(e.quantity)&&e.stockCode){zv.a.LSE_GBX_CURRENCY===this.selectedStock.currency&&(e.price=e.price/zv.a.LSE_GBX_TO_GBP_MULTIPLIER),this.exchangeFeeNameDescMap&&0!==this.exchangeFeeNameDescMap.size||this.getGeneralFeeDetails(this.selectedStock.stockCode,this.selectedStock.exchange),this.feeDetailStatus=Ev.a.LOADING;let i=t?this.scheduledSellRestService.getScheduledSellFee(e):this.stockInfoRestService.getFeeNewOrder(e);try{this.subHandlingService.once(Object(ht.a)([i]).pipe(Object(y.a)(e=>{(e[0].success||e[0].status===Fv.a.SUCCESS)&&(e[0].data.tradingReference=t?zv.a.SCHEDULED_SELL:null,this.feeDetail=Object(g.a)(e[0].data),this.feeDetailStatus=Ev.a.COMPLETED,this.addSstToFeeDetails(this.feeDetail))})))}catch(n){console.error(n),this.feeDetailStatus=Ev.a.ERROR}}}getFee(e){null==e.orderType||null!=e.orderType&&e.orderType===this.MARKET_ORDER.value||e.orderType===this.STOP_ORDER.value||e.orderType===this.STOP_LIMIT_ORDER.value?this.getFeeOrder(e,!1):(e.orderType=null,this.getFeeOrder(e,!0))}emitTimeAndSales(e){this.emitTimeAndSalesAction.emit(e)}emitMarketDepth(e){this.emitMarketDepthAction.emit(e)}emitSummary(e){this.emitSummaryAction.emit(e)}handleTimeAndSalesModalCancel(){this.timeAndSalesSub=[],this.timeAndSalesModalVisible=!1}setDrawer(e){this.drawerVisible=e}closeDrawer(){if(this.displayCols.length>0){let e=[];for(let t=0;t<this.displayCols.length;t++)e.push({key:this.displayCols[t].key,accountId:this.store.selectSnapshot(f.a.getId),category:this.stockKeyConfigRestService.LIVE_STOCK_CATEGORY,sequenceNo:t,checked:this.displayCols[t].checked,createBy:this.store.selectSnapshot(f.a.getId),updateBy:this.store.selectSnapshot(f.a.getId)});this.storeLoading=!0,this.subHandlingService.once(this.stockKeyConfigRestService.createKeyConfig(e).pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e.status&&this.setDrawer(!1)}),Object(uv.a)(()=>{this.storeLoading=!1})))}else this.setDrawer(!1)}onKeywordSearch(e){this.searchInput$.next(e)}drop(e){Object(wv.d)(this.displayCols,e.previousIndex,e.currentIndex)}resetDisplayCol(){this.displayCols=Object(g.a)(this.originalDisplayCols)}handleModalOpen(e){this.isRedirected=!1,this.transactionModalVisible=e}showTransactionPreviewModal(e){this.transactionPreviewData.qty=e.qty,this.transactionPreviewData.lotSize=e.lotSize,this.transactionPreviewData.price=e.price,this.transactionPreviewData.expireDate=e.expireDate,this.transactionPreviewData.validity=e.validity,this.transactionPreviewData.nextScheduledSellDate=e.nextScheduledSellDate,this.isScheduledSellOrder=e.isScheduledSellOrder,this.isModifyOrder=e.isModifyOrder,this.selectedTransactionType=e.transactionType,this.transactionPreviewData.originalNetAmount=e.originalNetAmount,this.transactionPreviewData.nextScheduledSellDate=e.nextScheduledSellDate,this.selectedStock.orderId=e.orderId,this.transactionPreviewData.orderType=e.orderType,this.transactionPreviewData.timeInForce=e.timeInForce,this.transactionPreviewData.stopPx=e.stopPx,this.transactionPreviewData.previewMarginOrder=e.previewMarginOrder,this.marketOrderTypeSelected=e.orderType===this.MARKET_ORDER.value&&e.timeInForce===this.MARKET_ORDER.timeInForce?this.MARKET_ORDER.label:e.orderType===this.MARKET_ORDER.value&&e.timeInForce===this.MARKET_TO_LIMIT_ORDER.timeInForce?zv.a.US_
5EXCHANGES.includes(this.selectedStock.exchange)?this.MARKET_ORDER.label:this.MARKET_TO_LIMIT_ORDER.label:"",this.previewModalVisible=!0}handleSelectedTransactionType(e){this.selectedTransactionType=e,this.updateExchangeFeeNameDescMap()}handleSelectedInvestmentAcctType(e){this.selectedAcctType=e}handlePreviewModalVisible(e){this.selectedStock.qty=this.transactionPreviewData.qty,this.previewModalVisible=e}handlePreviewModalBack(e){this.selectedStock.qty=this.transactionPreviewData.qty,this.selectedStock.timeInForce=this.transactionPreviewData.validity,this.selectedStock.expiredDate=this.transactionPreviewData.expireDate,this.selectedTransactionType?this.selectedStock.askPrice=this.transactionPreviewData.price:this.selectedStock.bidPrice=this.transactionPreviewData.price,this.marketOrderTypeSelected===this.MARKET_ORDER.label?(this.selectedStock.orderType=this.MARKET_ORDER.value,this.selectedStock.timeInForce=this.MARKET_ORDER.timeInForce):this.marketOrderTypeSelected===this.MARKET_TO_LIMIT_ORDER.label?(this.selectedStock.orderType=this.MARKET_ORDER.value,this.selectedStock.timeInForce=this.MARKET_TO_LIMIT_ORDER.timeInForce):(this.selectedStock.orderType="",this.selectedStock.timeInForce=this.transactionPreviewData.validity),this.previewModalVisible=e,this.transactionModalVisible=!0}handleCalculatorModalVisible(e){this.selectedStock=e,this.stocksFactsheetRestService.readStocksTickerAndPriceInfo(this.selectedStock.stockCode,this.selectedStock.exchange===zv.a.BURSA?zv.a.KLSE:this.selectedStock.exchange).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data?e.data.tickerInfo&&e.data.tickerInfo[0]?(this.tickerInfo=e.data.tickerInfo[0],this.isStocksCalculatorVisible=!0):this.nzNotificationService.error("Error","Unable to retrieve ticker info."):this.nzNotificationService.error("Error","Unable to get stock data")})}handleExtendViewCancel(){this.isExtendedMode=!1,this.changeExtendView.emit(this.isExtendedMode)}showCreateNewWatchlistModal(){this.isCreateNewWatchlistModalVisible=!0}onCloseCreateNewWatchlistModal(){this.isCreateNewWatchlistModalVisible=!1}onCreateNewWatchlist(){this.subHandlingService.once(this.watchlistRestService.addWatchlist(this.addingWatchlist).pipe(Object(y.a)(e=>{this.findStockWatchlistByAccId(),this.onCloseCreateNewWatchlistModal(),M.a.RESPONSE_SUCCESS===e.status?(this.createNotification(this.NOTIFICATION_SUCCESS.type,"Successfully created new watchlist"),this.addingWatchlist=null):this.createNotification(this.NOTIFICATION_ERROR.type,"Failed to create new watchlist")})))}showRenameWatchlistModal(){this.isRenameWatchlistModalVisible=!0}onCloseRenameWatchlistModal(){this.isRenameWatchlistModalVisible=!1}onSelectWatchlistRenameChanged(e){this.editingWatchlist=e.listName}onRenameWatchlist(){this.subHandlingService.once(this.watchlistRestService.updateWatchlist(this.selectedEditingWatchlist.listId,this.editingWatchlist).pipe(Object(y.a)(e=>{this.findStockWatchlistByAccId(),this.onCloseRenameWatchlistModal(),M.a.RESPONSE_SUCCESS===e.status?(this.createNotification(this.NOTIFICATION_SUCCESS.type,"Successfully renamed watchlist"),this.editingWatchlist=null,this.selectedEditingWatchlist=null):this.createNotification(this.NOTIFICATION_ERROR.type,"Failed to rename watchlist")})))}showDeleteWatchlistModal(){this.isDeleteWatchlistModalVisible=!0}onCloseDeleteWatchlistModal(){this.isDeleteWatchlistModalVisible=!1}onDeleteWatchlist(){this.modalService.confirm({nzTitle:"Delete Watchlist",nzContent:"Confirm to delete "+this.selectedDeletingWatchlist.listName+" watchlist?",nzOnOk:()=>{this.subHandlingService.once(this.watchlistRestService.deleteWatchlist(this.selectedDeletingWatchlist.listId).pipe(Object(y.a)(e=>{this.findStockWatchlistByAccId(),this.onCloseDeleteWatchlistModal(),M.a.RESPONSE_SUCCESS===e.status?(this.createNotification(this.NOTIFICATION_SUCCESS.type,"Successfully deleted watchlist"),this.selectedDeletingWatchlist=null):this.createNotification(this.NOTIFICATION_ERROR.type,"Failed to delete watchlist")})))}})}getTimeAndSalesChgPrice(e,t){return parseFloat(e)-parseFloat(t)}handleAddToWatchList(e){this.addToWatchlistItem=e,this.showAddToWatchlist=!0}handleAddToWatchListModalVisible(e){this.showAddToWatchlist=e,this.redirectFromFactSheet&&this.router.navigate([M.o.APP,M.o.TRADE,M.o.STOCKS]),e||this.findStockWatchlistByAccId(this.WATCHLIST_INIT)}handleAddPriceAlertItem(e){this.addPriceAlertItem=e,this.showAddPriceAlertItemModal=!0}handleAddPriceAlertItemModalVisible(e){this.showAddPriceAlertItemModal=e,this.subHandlingService.once(this.productPriceAlert.f
5indByAccountIdAndProductType(Dv.PRODUCT_TYPE_STOCK).pipe(Object(y.a)(e=>{if(M.a.RESPONSE_SUCCESS===e.status&&e.data){let t=e.data;this.stockPriceAlertProductCodeList=[];for(let e of t)this.stockPriceAlertProductCodeList.push(e.productCode.substring(e.productCode.indexOf(":")+1))}}),Object(uv.a)(()=>{this.stocks=this.setPriceAlert(this.stocks)})))}snapSelectedData(e){this.snapSingleData(e)}snapSelectedStock(e){let t=this.liveFeedService.constructMessage(wg.a.PRICE,this.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20",n=new lm.a(n=>{this.liveFeedService.subscribeSnap(this.lsClient,t,n,e.exchange)}).subscribe(t=>{var i;if(n.unsubscribe(),!t)return;const c=JSON.parse(t.updateValues[3]);e.lastPrice=parseFloat(c[e.symbol].lastPrice),e.changePercentage=parseFloat(c[e.symbol].changePercentage),e.change=parseFloat(c[e.symbol].change),e.dayHigh=parseFloat(c[e.symbol].dayHigh),e.dayLow=parseFloat(c[e.symbol].dayLow),e.openPrice=parseFloat(c[e.symbol].openPrice),e.cumulativeVolume=parseFloat(c[e.symbol].cumulativeVolume),(null==e?void 0:e.exchange)===zv.a.HKEX&&(e.lastSnapDate=c[e.symbol].updateTime,e.updateTime=c[e.symbol].updateTime,(null===(i=c[e.symbol])||void 0===i?void 0:i.updateTime)&&(e.endSnapDate=Number(c[e.symbol].updateTime)+9e5)),this.liveFeedService.storeSnapStocks(e.symbol,Object.assign(Object.assign({},e),c[e.symbol]))})}refreshLiveSnap(){this.mdfRestService.getMdfPermission("",M.a.FMY).subscribe(e=>{this.snapCountL3=e.data.result.HKEX.snapL3,this.snapCountL1=e.data.result.HKEX.snapL1,this.snapCountL2=e.data.result.HKEX.snapL2})}displayInfoInDrawer(e){this.drawerService.create({nzPlacement:"bottom",nzContent:e})}setSortStocks(e){this.stocks=e}setSortedTableKey(e){this.sortedTableKey=e}getW8BenDetails(){return this.accountRestService.getStockW8BenFormDetails(this.accountService.getTradableAccountRefno)}checkW8BenForm(e){return e.exchange!==zv.a.NASDAQ&&e.exchange!==zv.a.AMEX&&e.exchange!==zv.a.NYSE&&e.exchange!==zv.a.BATS||this.w8BenStatus==Iv.a.APPROVED&&this.w8ExpiryDate>new Date}showW8BenFormErrorModel(){this.w8BenChecked||(this.w8BenChecked=!0,this.w8BenModalRef=this.w8BenStatus===Iv.a.PENDING?this.modal.warning({nzTitle:"W-8BEN Form",nzContent:"We are currently processing your W-8Ben form to verify your non-US tax status. Note that this manual processing will be longer, all W-8Ben forms will be subjected to review and approve by FSMOne.",nzOkText:"Ok",nzMaskClosable:!0,nzWrapClassName:"vertical-center-modal",nzOnCancel:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()},nzOnOk:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()}}):this.store.selectSnapshot(f.a.getPrimaryDisplay).accountType===Nt.a.ACCOUNT_TYPE_CORPORATE?this.modal.warning({nzTitle:"W-8BEN-E Form",nzVisible:this.w8BenChecked,nzContent:"For corporate accounts, you are required to submit a copy of the W-8BEN-E Form.",nzOkText:"Ok",nzMaskClosable:!0,nzWrapClassName:"vertical-center-modal",nzOnCancel:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()},nzOnOk:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()}}):this.modal.warning({nzTitle:"W-8BEN Form",nzContent:"Please submit your W-8Ben Form to verify your non-US tax status.",nzOkText:"Redirect",nzMaskClosable:!0,nzWrapClassName:"vertical-center-modal",nzOnCancel:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()},nzOnOk:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close(),this.router.navigate([M.o.APP,M.o.ACCOUNT_UPDATE,M.o.W8_BEN_FORM])}}))}checkFepAgreemeent(e){return!zv.a.FOREIGN_EXCHANGES.includes(e.exchange)||this.store.selectSnapshot(f.a.isFepFlag)}checkSgPrDeclarationIsNotSubmitted(){return null===this.store.selectSnapshot(f.a.isSingaporePr)}checkIsSingaporePrSubmitted(){return this.store.selectSnapshot(f.a.isSingaporePr)}checkKlseLeveragedInverse(e){return!!this.klseLeveragedInverseStockList.find(t=>e.stockCode.toString()===t.stockCode&&e.exchange===t.exchange)}handleFepAgreementVisible(e){this.visibleFepAgreement=e,!this.visibleFepAgreement&&this.checkFepAgreemeent(this.selectedStock)&&this.openOrderPadPreparation()}handleSgPrDeclarationVisible(e){this.visibleSgPrDeclaration=e}openOrderPadPreparation(){var e,t,n;this.selectedStock.data=this.selectedStock,this.selectedStock.transactionType=this.selectedTransactionType;let i={exchange:this.selectedStock.exchange===zv.a.BURSA?zv.a.KLSE:this.selectedStock.exchange,stockCode:this.selectedStock.code?this.selectedStock.code:this.selectedStock.stockCode,price:this.selectedStock.askPrice,quantity:1*(null===(e=this.selectedStock)||void 0===e?void 0:e.lotSize)?null===(t=this.selectedStock)||void 0===t?void 0:t.lotSize:null===(n=this.selectedStock)||void 0===n?void 0:n.roundLotSize,orderSide:this.selectedTransactionType?zv.a.BUY:zv.a.SELL,refno:this.accountService.getTradableAccountRefno};this.getFeeOrder(i),this.handleModalVisible(this.selectedStock)}onAcknowledgeNoteClick(){this.acknowledgeNoteVisible=!1,Object(Av.c)(this.username+M.h.STOCK_TRADE_NOTICE_VISIBLE,this.acknowledgeNoteVisible)}getEnabledProduct(){this.scheduledSellRestService.getEnabledProduct(this.selectedStock.code,this.selectedStock.exchange).subscribe(e=>{this.rspEtfProductInfo=e.data})}checkIsScheduledSellOrderExist(){this.scheduledSellRestService.checkIsScheduledSellOrderExist(this.accountService.getTradableAccountRefno,this.selectedStock.code,this.selectedStock.exchange).subscribe(e=>{(e.success||e.status===Fv.a.SUCCESS)&&(null!=e.data?(this.selectedStock.ordId=e.data.orderId,this.selectedStock.ordType=e.data.ordType,this.selectedStock.ordQty=e.data.ordQty,this.selectedStock.expiredDate=e.data.expiredDate,this.selectedStock.remainingQty=e.data.remainingQty,this.isScheduledSellOrderExist=!0):this.isScheduledSellOrderExist=!1)})}handleSelectedPurchasingPowerType(e){this.selectedPurchasingPowerType=e}
5handleSelectedStockChange(e){e&&(!e.msInstrumentId&&e.productCode&&(e.msInstrumentId=e.productCode),this.feeDetail=null,this.feeDetailStatus=null,e.sedolnumber=e.exchange+":"+e.stockCode,this.subscribeLSPriceQuote([e],!0),this.selectedStock=e,this.selectedStock.transactionType=this.selectedTransactionType,this.selectedExchange=e.exchange===zv.a.EXCHANGE_LIST[0].label?zv.a.EXCHANGE_LIST[0].value:e.exchange,this.handleChinaDisplayCol(e.exchange),this.setSelectedExchgTabColor(e.exchange),this.handleModalVisible(this.selectedStock))}handleIsModifyOrder(e){this.selectedStock.qty=null,this.isModifyOrder=e}checkBcanApplication(){this.stockAccountRestService.getBcanIdDeclaration(this.tradableRefno).subscribe(e=>{e.status===Fv.a.SUCCESS&&e.data&&(this.bcanViewModel=e.data)})}showBcanApplicationRedirrectModel(){this.bcanRedirrectModelVisible=!0}onCloseBcanRedirrectModel(){this.bcanRedirrectModelVisible=!1}checkChinaTrade(){if(this.selectedStock.exchange===zv.a.SSE||this.selectedStock.exchange===zv.a.SZSE){const e=this.store.selectSnapshot(f.a.getPrimaryDisplay);if(this.CHINA===e.nationality)return!1}return!0}onCloseChinaTradeNotAvailableModel(){this.chinaTradeNotAvailableModalVisible=!1}redirrectToBcanSubmittion(){this.router.navigate([M.o.APP,M.o.ACCOUNT_UPDATE,M.o.CHINA_A_SHARES])}handleCdsModalOpen(e){this.isRedirected=!1,this.cdsModalVisible=e}handleCdsReactivation(e){this.handleCdsAccountReactivation.emit(e)}getCdsAccountDetails(){this.cdsAccountRestService.getCdsAccount(this.tradableRefno).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&(e.data.cdsAccountStatus&&(this.cdsStatus=e.data.cdsAccountStatus),this.hasProcessingCdsAccountReactivation=e.data.hasProcessingCdsAccountReactivation)})}openStreamingInfoModal(){this.streamingModal=!0}closeStreamingModal(){this.streamingModal=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(bt.a),h.lc(j.e),h.lc(Lv.a),h.lc(Dg.a),h.lc(s.i),h.lc(pm.a),h.lc(mv.a),h.lc(bm.a),h.lc(Cg.e),h.lc(qg.a),h.lc(hm.a),h.lc(c.a),h.lc(c.e),h.lc(Sc.b),h.lc(Rv.a),h.lc(Nv.a),h.lc(Mt.a),h.lc(Dg.a),h.lc(j.e),h.lc(l.a),h.lc(Bv.a),h.lc(Sc.b),h.lc(Vv),h.lc(Hv.a),h.lc(Sv.a),h.lc($v.a),h.lc(Eg.c),h.lc(h.j),h.lc(yv.a),h.lc(jv.a),h.lc(vv.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-price"]],inputs:{isLsAlive:"isLsAlive",primaryCashAcctAvailableBalance:"primaryCashAcctAvailableBalance",isExtendedMode:"isExtendedMode",lsClient:"lsClient",selectedStockOption:"selectedStockOption",cdsAccountReactivateSuccess:"cdsAccountReactivateSuccess",cdsAccountPendingTrigger:"cdsAccountPendingTrigger",klseLeveragedInverseStockList:"klseLeveragedInverseStockList",isAcctAllowScheduledSell:"isAcctAllowScheduledSell"},outputs:{changeExtendView:"changeExtendView",emitTimeAndSalesAction:"emitTimeAndSalesAction",emitMarketDepthAction:"emitMarketDepthAction",emitSummaryAction:"emitSummaryAction",emitSelectedExchange:"emitSelectedExchange",handleCdsAccountReactivation:"handleCdsAccountReactivation"},features:[h.Tb([l.a,Cg.e,qg.a]),h.Rb,h.Sb],decls:10,vars:8,consts:[[4,"ngIf"],["popUpNote",""],[3,"check","show","stayOnCurrentPage","onAccepted","onDecline"],[3,"show","check","refno","onAccepted","onCloseModal"],["liveSnapInfoMobile",""],["liveStreamingInfoMobile",""],[3,"isMobile","isVisible","isTradingPage","close",4,"ngIf"],["priceView",""],[3,"holdingInfo","visible","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitGetFeeDetailAction","emitSnapSelectedStockAction",4,"ngIf"],[3,"lsClient","holdingInfo","visible","selectedStock","priceQuote","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","feeNameMap","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","changeSelectedStock","emitGetFeeDetailAction","emitSnapSelectedStockAction",4,"ngIf"],[3,"isVisible","cdsStatus","selectedAcctType","hasProcessingCdsAccountReactivation","changeVisible","handleCdsAccountReactivation"],[3,"feeDetail","feeDetailStatus","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeIsModifyOrder","backVisible","refreshPortfolioAction","changeVisible",4,"ngIf"],[3,"feeDetail","feeNameMap","feeDetailStatus","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeIsModifyOrder","backVisible","refreshPortfolioAction","changeVisible",4,"ngIf"],[3,"tickerInfo","isVisible","isVisibleChange"],["nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzTitle","nzVisible","nzOnCancel","nzVisibleChange"],[1,"mb-3"],["nzSpan","24"],["nzLabelPlaceholder","Add New Watchlist",1,"w-100","my-3"],["type","text","ui-input","",3,"ngModel","ngModelChange"],[1,"text-right","mt-3"],["nz-button","","nzType","outline",3,"click"],["nz-button","","nzType","primary",1,"ml-3",3,"disabled","click"],["nzWrapClassName","vertical-center-modal",3,"nz
5Visible","nzClosable","nzFooter","nzTitle","nzVisibleChange","nzOnCancel"],["nzLabelPlaceholder","","nzPlaceHolder","Please Select Watchlist",1,"w-100","mt-3","mb-2",3,"ngModel","ngModelChange"],[3,"nzValue","nzLabel",4,"ngFor","ngForOf"],["nzLabelPlaceholder","Rename Watchlist",1,"w-100","mb-3"],[1,"text-center","mt-3"],[3,"bcanRedirrectModelVisible","bcanViewModel","onCloseBcanRedirrectModel"],["nz-icon","","nzType","info-circle","nzTheme","fill",1,"text-warning","text-xl"],[1,"ml-3"],[1,"text-base","ml-5"],["href","https://www.hkex.com.hk/-/media/HKEX-Market/Services/Circulars-and-Notices/Participant-and-Members-Circulars/SEHK/2022/CT08822E.pdf","target","_blank"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","end"],["nz-button","","nzType","primary",1,"mx-2","mt-2",3,"click"],["nzPlacement","right","nzTitle","Customise Table Column",3,"nzClosable","nzVisible","nzWrapClassName"],[1,"px-3","d-flex","flex-column","justify-content-between","h-100"],["cdkDropList","",1,"w-100","pointer","customise-drawer",3,"cdkDropListDropped"],["class","my-2","cdkDrag","",4,"ngFor","ngForOf"],["nzSize","small","nzType","outline","nz-button","",1,"mr-6",3,"click"],[1,"pl-5","pr-1",3,"click"],["nz-icon","","nzType","reload","nzTheme","outline"],["nzSize","small","nzType","primary","nz-button","",3,"nzLoading","click"],["priceViewTopSection",""],["priceViewModal",""],[3,"nzVisible","nzFooter","nzWidth","nzOnCancel"],[4,"ngTemplateOutlet"],[3,"nzVisible","nzTitle","nzFooter","nzWrapClassName","nzOkText","nzVisibleChange","nzOnCancel"],[3,"nzData",4,"ngIf"],[1,"text-right","mt-4"],[1,"mt-3"],[1,"bg-white","px-2","py-3","mt-3"],["nzSpan","8",1,"font-weight-bold"],["nzSpan","16",1,"pointer","text-right","font-weight-bold","text-primary"],["nz-button","","nzOutline","","nzType","primary","nz-tooltip","",1,"mr-2","px-2","mb-2",3,"nzSize","click","mouseover"],["alt","snap",1,"mr-2",2,"width","14px","height","auto",3,"src"],["nz-button","","nzOutline","","nzType","primary","class","mr-2 px-2 mb-2",3,"nzSize","click",4,"ngIf"],["nzGutter","16",3,"ngClass"],["nzXs","24","nzSm","24","nzLg","8","nzXl","8"],["nzAllowClear","false","nzShowSearch","false","nzPlaceHolder","Please Choose",1,"w-100","mb-2",3,"ngModel","ngModelChange"],["nzLabel","My Watchlist",4,"ngIf"],["nzLabel","Create/Edit Watchlist"],["nzLabel","Others",4,"ngIf"],["nzLabel","Thematic Ideas"],["nzPlaceHolder","Quick Trade",3,"options","nzServerSearch","ngModel","searchLoading","ngModelChange","selectItem","search","loadMoreEvent"],[1,"bg-white","px-2","pb-3"],[3,"visible","selectedStock","watchList","changeVisible"],[3,"visible","selectedStock","changeVisible"],[3,"visibleFepAgreement","changeVisibleFepAgreement"],[3,"visibleSgPrDeclaration","changeVisibleSgPrDeclaration"],[1,"exchange-tab"],[3,"nzButtonStyle","ngModel","nzSize","ngModelChange"],[3,"marketDepthDataBid","marketDepthDataAsk","fieldNames","stocks","watchList","selectedRanking","selectedExchange","lightStreamerChanges","timeAndSalesPopOver","isLsAlive","username","emitAddToWatchList","emitAddPriceAlert","emitTransactionModal","emitTimeAndSales","emitMarketDepth","emitSummary","emitCalculatorModal","emitWatchlistItemDeletedAction","emitSnapAction","emitSortedStock","emitSortedTableKey"],["nz-radio-button","",1,"text-sm",3,"nzValue","ngClass"],["nz-radio-button","","class","text-sm",3,"nzValue","ngClass",4,"ngFor","ngForOf"],[3,"holdingInfo","visible","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitGetFeeDetailAction","emitSnapSelectedStockAction"],[3,"lsClient","holdingInfo","visible","selectedStock","priceQuote","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","feeNameMap","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","changeSelectedStock","emitGetFeeDetailAction","emitSnapSelectedStockAction"],[3,"feeDetail","feeDetailStatus","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeIsModifyOrder","backVisible","refreshPortfolioAction","changeVisible"],[3,"feeDetail","feeNameMap","feeDetailStatus","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeIsModifyOrder","backVisible","refreshPortfolioAction","changeVisible"],[3,"nzValue","nzLabel"],["cdkDrag","",1,"my-2"],["nz-checkbox","","nzValue","A",3,"ngModel","nzDisabled","ngModelChange"],["alt","empty-state","align","right",3,"src"],["nzGutter","16",1,"mb-2",3,"ngClass"],["nzXs","24","nzSm","24","nzMd","8","nzLg","8","nzXl","8",1,"select-height"],["nzAllowClear","false","nzShowSearch","false","nzPlaceHolder","Please Choose",1,"w-100",3,"ngModel","ngModelChange"],["nzXs","24","nzSm","24","nzMd","14","nzLg","14","nzXl","14",1,"select-height"],["nzShowSearch","","nzServerSearch","","nzAllowClear","","nzPlaceHolder","Quick Trade",1,"w-100",3,"ngModel","nzShowArrow","nzAllowClear","ngModelChange","nzOnSearch","nzScrollToBottom"],["nzCustomContent","",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzDisabled","","nzCustomContent","",4,"ngIf"],["nz-menu",""],["nz-menu-item","",3,"click",4,"ngFor","ngForOf"],["nzXs","0","nzSm","0","nzMd","2","nzLg","2","nzXl","2",4,"ngIf"],["nzLabel","My Watchlist"],["nzLabel","Stocks",4,"ngIf"],["nzLabel","ETFs",4,"ngIf"],["nzLabel","Stocks"],["nzLabel","ETFs"],["nzLabel","Others"],["nzDisabled","",3,"nz
5Value","nzLabel"],["nzCustomContent","",3,"nzLabel","nzValue"],[3,"exchange"],[1,"font-weight-bold"],["nzDisabled","","nzCustomContent",""],["nz-icon","","nzType","loading",1,"loading-icon"],["nz-menu-item","",3,"click"],[1,"text-black"],["nzXs","0","nzSm","0","nzMd","2","nzLg","2","nzXl","2"],["nzType","outline","nz-button","",1,"w-100","text-lg","d-flex","align-items-center","justify-content-center","setting-button",3,"click"],["nz-icon","","nzType","setting","nzTheme","fill",1,"mt-1"],[3,"nzData"],["timeAndSalesTable",""],[4,"ngFor","ngForOf"],["class","text-profit",4,"ngIf"],["class","text-loss",4,"ngIf"],[1,"text-profit"],[1,"text-loss"],["nz-button","","nzOutline","","nzType","primary",1,"mr-2","px-2","mb-2",3,"nzSize","click"],["nz-icon","","nzTheme","outline","nzType","info-circle"],["class","ant-popover ant-popover-placement-bottom ml-2 mt-5 position-absolute pop-up-note",4,"ngIf"],[1,"ant-popover","ant-popover-placement-bottom","ml-2","mt-5","position-absolute","pop-up-note"],[1,"ant-popover-content"],[1,"pop-up-arrow","ant-popover-arrow","bg-primary"],["role","tooltip",1,"ant-popover-inner","bg-primary"],[1,"ant-popover-inner-content","text-white"],["nz-row",""],["nz-col","",3,"nzSpan"],[1,"text-sm","font-weight-bold"],["nz-col","",1,"pointer","text-right","text-xs",3,"nzSpan"],["nz-icon","","nzType","close","nzTheme","outline",1,"text-right",3,"click"],[1,"text-sm"],[1,"text-right","mt-2"],["nzType","primary","nz-button","","nzGhost","","nzSize","small",1,"pop-up-button",3,"click"],[1,"text-white"],[1,"text-base","font-weight-bold"],[1,"text-base"],[1,"m-2","mb-3"],[1,"text-black","font-weight-bold","mb-0"],[3,"isMobile","isVisible","isTradingPage","close"]],template:function(e,t){1&e&&(h.od(0,WT,118,82,"ng-container",0),h.od(1,KT,1,1,"ng-template",null,1,h.pd),h.rc(3,"shared-si-declaration-revamp-modal",2),h.zc("onAccepted",(function(){return t.onSiAccepted()}))("onDecline",(function(){return t.onCloseSiModal()})),h.qc(),h.rc(4,"app-stocks-leveraged-inverse-risk-disclosure",3),h.zc("onAccepted",(function(){return t.preHandleModalVisible()}))("onCloseModal",(function(e){return t.onCloseRiskDisclosureModal(e)})),h.qc(),h.od(5,ZT,2,2,"ng-template",null,4,h.pd),h.od(7,JT,25,8,"ng-template",null,5,h.pd),h.od(9,ew,1,3,"stocks-streaming-info-modal",6)),2&e&&(h.Mc("ngIf",t.selectedStockOption===t.IStockOptionType.PRICE),h.Ub(3),h.Mc("check",!0)("show",t.checkSiDeclaration)("stayOnCurrentPage",!0),h.Ub(1),h.Mc("show",t.checkLeverageInverseRiskAssessment)("check",!0)("refno",t.tradableRefno),h.Ub(5),h.Mc("ngIf",t.streamingModal))},directives:[p.t,Dt.a,Gv.a,Wv.a,Yv.a,j.a,P.c,P.a,ae.c,oe.c,ae.b,oe.t,oe.w,_.a,Lt.d,p.s,Kv.a,k.b,Eg.a,lo.d,wv.b,p.A,B.a,z.a,xt.e,p.q,Xv.d,Xv.c,Qv.a,Zv.a,mM,fM.a,gM.a,Ut.c,zq,Ut.a,Dq.a,Pq.a,Iq.a,kq.a,Lt.a,wv.a,lo.a,xv.f,qM.a,Xv.a,Og.a,qM.d,ve.a,ve.f,ve.g,ve.e,ve.c,ve.d,Pg.a,Aq.a],pipes:[TM.a,p.g],styles:[".cdk-drag-preview{display:table} .cdk-drag-placeholder{opacity:.5} .cdk-drag-animating{transition:transform .25s cubic-bezier(0,0,.2,1)} .customize-table-column-drawer{min-width:390px} .customize-table-column-drawer>.ant-drawer-content>.ant-drawer-wrapper-body>.ant-drawer-body{height:calc(100% - 55px)}.exchange-tab[_ngcontent-%COMP%]{background-color:#ededed;font-weight:700;border-radius:5px 5px 0 0;overflow-x:auto}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group[_ngcontent-%COMP%]{display:flex}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group[_ngcontent-%COMP%] > .ant-radio-button-wrapper[_ngcontent-%COMP%]{border-radius:5px 5px 0 0;color:#000}.exchange-tab[_ngcontent-%COMP%] > .ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled){background-color:#004bad;color:#fff;box-shadow:none}.exchange-tab-all[_ngcontent-%COMP%]{background-color:#004bad!important}.exchange-tab-all[_ngcontent-%COMP%], .exchange-tab-KLSE[_ngcontent-%COMP%]{color:#fff!important;box-shadow:none!important}.exchange-tab-KLSE[_ngcontent-%COMP%]{background-color:#687abc!important}.exchange-tab-HKEX[_ngcontent-%COMP%]{background-color:#a3b958!important;color:#fff!important;box-shadow:none!important}.exchange-tab-AMEX[_ngcontent-%COMP%], .exchange-tab-BATS[_ngcontent-%COMP%], .exchange-tab-NASDAQ[_ngcontent-%COMP%], .exchange-tab-NYSE[_ngcontent-%COMP%]{background-color:#f48b85!important;color:#fff!important;box-shadow:none!important}.exchange-tab-SGX[_ngcontent-%COMP%]{background-color:#1dadcd!important;color:#fff!important;box-shadow:none!important}.exchange-tab-SSE[_ngcontent-%COMP%], .exchange-tab-SZSE[_ngcontent-%COMP%]{background-color:#f87f18!important;color:#fff!important;box-shadow:none!important}.select-height[_ngcontent-%COMP%] .ant-select-sm[_ngcontent-%COMP%] .ant-select-selection--single[_ngcontent-%COMP%], .select-height[_ngcontent-%COMP%] .ant-select .ant-select-selection--single, .setting-button[_ngcontent-%COMP%]{height:42px!important}.pop-up-arrow[_ngcontent-%COMP%]{left:30%!important;border-color:#012c5d!important}.pop-up-button[_ngcontent-%COMP%]{background:transparent!important}.pop-up-note[_ngcontent-%COMP%]{z-index:999!important}.customise-drawer[_ngcontent-%COMP%] .ant-checkbox-disabled .ant-checkbox-inner{border-color:#d3d3d3!important}"]}),e})();var nw=n("QSgb"),iw=n.n(nw),cw=n("3hac"),ow=n("A07A"),sw=n("Ff2k"),aw=n("+9wz");function lw(e,t){1&e&&h.nc(0)}function rw(e,t){1&e&&h.nc(0)}function dw(e,t){1&e&&h.nc(0)}function uw(e,t){1&e&&h.nc(0)}function hw(e,t){1&e&&h.nc(0)}function pw(e,t){1&e&&h.nc(0)}function mw(e,t){1&e&&h.nc(0)}function fw(e,t){1&e&&h.nc(0)}function gw(e,t){if(1&e){const e=h.sc();h.rc(0,"div",20),h.zc("click",(function(){return h.dd(e),h.Dc(2).emitSelectedAction("buy")})),h.mc(1,"img",21),h.qd(2," Buy "),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("src",e.holdingsImgPath+"buy.svg",h.gd)}}function bw(e,t){if(1&e){const e=h.sc();h.rc(0,"div",20),h.zc("click",(function(){return h.dd(e),h.Dc(2).emitSelectedAction("sell")})),h.mc(1,"img",22),h.qd(2," Sell "),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("src",e.holdingsImgPath+"sell.svg",h.gd)}}function Sw(e,t){if(1&e){const e=h.sc();h.rc(0,"div",20),h.zc("click",(function(){return h.dd(e),h.Dc(2).emitSelectedAction("watchlist")})),h.mc(1,"img",23),h.qd(2," Add to Watchlist "),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("src",e.holdingsImgPath+"add-to-watchlist.svg",h.gd)}}function yw(e,t){if(1&e){const e=h.sc();h.rc(0,"div",20),h.zc("click",(function(){return h.dd(e),h.Dc(2).emitSelectedAction("transactionHistory")})),h.mc(1,"img",24),h.qd(2," Transaction History "),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("src",e.holdingsImgPath+"transaction-history.svg",h.gd)}}const vw=function(e){return{data:e,label:"Account"}},Mw=function(e){return{data:e,label:"Total Qty"}},Cw=function(e){return{data:e,label:"Balance Qty"}},qw=function(e){return{data:e,label:"W.A.C"}},Tw=function(e){return{data:e,label:"P/L"}},ww=function(e){return{data:e,label:"P/L (%)"}},zw=function(e){return{data:e,label:"Market Value"}},Dw=function(e){return{data:e,label:"Cost"}};function Pw(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",4),h.rc(1,"div",5),h.rc(2,"b2c-app-bar-2",6),h.zc("back",(function(){return h.dd(e),h.Dc().hidePortfolioDetail()})),h.qc(),h.qc(),h.rc(3,"div",7),h.rc(4,"div",8),h.rc(5,"b",9),h.qd(6),h.qc(),h.mc(7,"br"),h.rc(8,"span"),h.rc(9,"b",10),h.mc(10,"app-stock-exchange-tag",11),h.qd(11," |"),h.qc(),h.qd(12),h.qc(),h.qc(),h.rc(13,"div",12),h.rc(14,"nz-list",13),h.rc(15,"nz-list-item",14),h.od(16,lw,1,0,"ng-container",15),h.qc(),h.rc(17,"nz-list-item",14),h.od(18,rw,1,0,"ng-container",15),h.Ec(19,"number"),h.qc(),h.rc(20,"nz-list-item",14),h.od(21,dw,1,0,"ng-container",15),h.Ec(22,"number"),h.qc(),h.rc(23,"nz-list-item",14),h.od(24,uw,1,0,"ng-container",15),h.Ec(25,"number"),h.qc(),h.rc(26,"nz-list-item",14),h.pc(27),h.od(28,hw,1,0,"ng-container",15),h.Ec(29,"customizeCurrency"),h.oc(),h.qc(),h.rc(30,"nz-list-item",14),h.od(31,pw,1,0,"ng-container",15),h.Ec(32,"number"),h.qc(),h.rc(33,"nz-list-item",14),h.od(34,mw,1,0,"ng-container",15),h.Ec(35,"number"),h.qc(),h.rc(36,"nz-list-item",14),h.od(37,fw,1,0,"ng-container",15),h.Ec(38,"number"),h.qc(),h.qc(),h.qc(),h.rc(39,"div",16),h.rc(40,"div",17),h.qd(41," Actions "),h.qc(),h.rc(42,"div",18),h.od(43,gw,3,1,"div",19),h.od(44,bw,3,1,"div",19),h.od(45,Sw,3,1,"div",19),h.od(46,yw,3,1,"div",19),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(4);h.Mc("nzVisible",e.visible)("nzWrapClassName","mobile-drawer-no-padding")("nzPlacement","bottom"),h.Ub(2),h.Mc("title","Portfolio Details"),h.Ub(4),h.rd(null!=e.selectedStock&&e.selectedStock.short
5Name?null==e.selectedStock?null:e.selectedStock.shortName:null==e.selectedStock?null:e.selectedStock.name),h.Ub(4),h.Mc("exchange",null==e.selectedStock?null:e.selectedStock.exchange),h.Ub(2),h.sd(" ",null==e.selectedStock?null:e.selectedStock.code,""),h.Ub(4),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(47,vw,null==e.selectedStock?null:e.selectedStock.investmentAccount)),h.Ub(2),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(49,Mw,h.Fc(19,27,null==e.selectedStock?null:e.selectedStock.totalQty))),h.Ub(3),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(51,Cw,h.Fc(22,29,null==e.selectedStock?null:e.selectedStock.totalAvailableQty))),h.Ub(3),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(53,qw,((null==e.selectedStock?null:e.selectedStock.currency)===e.GBX_CURRENCY?e.GBP_CURRENCY:null==e.selectedStock?null:e.selectedStock.currency)+" "+h.Gc(25,31,null==e.selectedStock?null:e.selectedStock.avgPrice,"1.4-4"))),h.Ub(4),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(55,Tw,e.selectedStock.exchange===e.USOTC?"-":h.Hc(29,34,e.priceDiff*(null==e.selectedStock?null:e.selectedStock.totalQty),(null==e.selectedStock?null:e.selectedStock.currency)===e.GBX_CURRENCY?e.GBP_CURRENCY:null==e.selectedStock?null:e.selectedStock.currency,".2-2"))),h.Ub(3),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(57,ww,e.selectedStock.exchange===e.USOTC?"-":0!=e.selectedStock.avgPrice?h.Gc(32,38,e.priceDiff/(null==e.selectedStock?null:e.selectedStock.avgPrice)*100,"1.2-2"):"-%")),h.Ub(3),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(59,zw,e.selectedStock.exchange===e.USOTC?"-":((null==e.selectedStock?null:e.selectedStock.currency)===e.GBX_CURRENCY?e.GBP_CURRENCY:null==e.selectedStock?null:e.selectedStock.currency)+" "+h.Gc(35,41,(null==e.selectedStock?null:e.selectedStock.totalQty)*(null==e.selectedStock?null:e.selectedStock.lastPrice),"1.2-2"))),h.Ub(3),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(61,Dw,e.selectedStock.exchange===e.USOTC?"-":((null==e.selectedStock?null:e.selectedStock.currency)===e.GBX_CURRENCY?e.GBP_CURRENCY:null==e.selectedStock?null:e.selectedStock.currency)+" "+h.Gc(38,44,null==e.selectedStock?null:e.selectedStock.cost,"1.2-2"))),h.Ub(6),h.Mc("ngIf",e.isNzOptionVisible(e.selectedStock,"buy")),h.Ub(1),h.Mc("ngIf",e.isNzOptionVisible(e.selectedStock,"sell")),h.Ub(1),h.Mc("ngIf",e.isNzOptionVisible(e.selectedStock,"watchlist")),h.Ub(1),h.Mc("ngIf",e.isNzOptionVisible(e.selectedStock,"transactionHistory"))}}function Iw(e,t){if(1&e&&h.mc(0,"i",29),2&e){h.Dc(2);const e=h.ad(6);h.Mc("nzTooltipTitle",e)}}function kw(e,t){if(1&e&&(h.rc(0,"nz-row",25),h.rc(1,"nz-col",26),h.qd(2),h.od(3,Iw,1,1,"i",27),h.qc(),h.rc(4,"nz-col",28),h.qd(5),h.qc(),h.qc()),2&e){const e=t.data,n=t.label,i=h.Dc();h.Ub(2),h.sd(" ",n," "),h.Ub(1),h.Mc("ngIf",(null==i.selectedStock?null:i.selectedStock.exchange)===i.USOTC&&"Market Value"===n),h.Ub(1),h.Mc("ngClass",i.determineTextColor(n,e)),h.Ub(1),h.sd(" ",e," ")}}function Aw(e,t){1&e&&h.qd(0," Current value for USOTC shares is not available due to limited info.\n")}let Ew=(()=>{class e{constructor(e){this.accountService=e,this.selectedStock={},this.visible=!1,this.changeVisibleEmitter=new h.s,this.selectedActionEmitter=new h.s,this.BURSA="BURSA",this.KLSE="KLSE",this.SSE=M.q.SSE,this.SZSE=M.q.SZSE,this.USOTC=M.q.USOTC,this.GBX_CURRENCY=M.q.LSE_GBX_CURRENCY,this.GBP_CURRENCY=M.q.LSE_GBP_CURRENCY,this.priceDiff=0}ngOnInit(){}ngOnDestroy(){}ngOnChanges(e){this.calculatePriceDiff(),console.log(e)}hidePortfolioDetail(){this.visible=!1,this.changeVisibleEmitter.emit()}get holdingsImgPath(){return M.g.HOLDINGS_IMG_PATH}calculatePriceDiff(){this.priceDiff=this.selectedStock?this.selectedStock.lastPrice-this.selectedStock.avgPrice:0}determineTextColor(e,t){return"P/L"!==e&&"P/L (%)"!==e||"-"===t||0===this.priceDiff?"":this.priceDiff<0?"text-loss":"text-profit"}emitSelectedAction(e){this.selectedActionEmitter.emit(e)}getTradingInfo(e){return Object(SM.a)(null==e?void 0:e.tradingInfo,null==e?void 0:e.exchange)}isNzOptionVisible(e,t){switch(t){case"buy":return!(((null==e?void 0:e.exchange)===this.SSE||(null==e?void 0:e.exchange)===this.SZSE)&&!this.getTradingInfo(e).buy)&&(null==e?void 0:e.exchange)!==this.USOTC;case"sell":return!(((null==e?void 0:e.exchange)===this.SSE||(null==e?void 0:e.exchange)===this.SZSE)&&!this.getTradingInfo(e).sell);case"watchlist":return(null==e?void 0:e.exchange)!==this.USOTC;default:return!0}}}return e.\u0275fac=function(t){return new(t||e)(h.lc(pm.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stock-portfolio-detail"]],inputs:{selectedStock:"selectedStock",selectedTransactionType:"selectedTransactionType",visible:"visible"},outputs:{changeVisibleEmitter:"changeVisibleEmitter",selectedActionEmitter:"selectedActionEmitter"},features:[h.Sb],decls:7,vars:3,consts:[["nzHeight","100%",3,"nzVisible","nzWrapClassName","nzPlacement",4,"ngIf"],["class","w-100"],["listItem",""],["usotcCurrentValueTooltip",""],["nzHeight","100%",3,"nzVisible","nzWrapClassName","nzPlacement"],[1,"border-bottom"],[3,"title","back"],[1,"container","px-3","pt-3"],[1,"list-item","p-0","mb-3"],[1,"text-md","font-weight-bold","m-0"],[1,"text-black-6","text-base"],[3,"exchange"],[1,"list-item","p-0"],[1,"bg-black-2","px-1","text-base","inner-list-item"],[1,"p-0"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"list-item","p-0","mt-3"],[1,"pb-3","font-weight-bold"],[1,"text-base","pt-0","px-1"],["class","pb-4",3,"click",4,"ngIf"],[1,"pb-4",3,"click"],["alt","buy image",1,"px-1",3,"src"],["alt","sell image",1,"px-1",3,"src"],["alt","add to wat
5ch list image",1,"px-1",3,"src"],["alt","transaction history image",1,"px-1",3,"src"],["nzType","flex","nzAlign","middle",1,"px-2","py-2","w-100"],["nzSpan","12"],["class","pointer text-info","nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",3,"nzTooltipTitle",4,"ngIf"],["nzSpan","12",1,"text-base","text-right","font-weight-bold",3,"ngClass"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",1,"pointer","text-info",3,"nzTooltipTitle"]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,Pw,47,63,"nz-drawer",0),h.Ec(2,"async"),h.qc(),h.od(3,kw,6,4,"ng-template",1,2,h.pd),h.od(5,Aw,1,0,"ng-template",null,3,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",h.Fc(2,1,t.isMobile$)&&t.visible))},directives:[z.a,p.t,Eg.a,D.a,Og.a,sw.a,sw.b,p.A,P.c,P.a,p.q,k.b,xt.e],pipes:[p.b,p.g,aw.a],styles:[".list-item[_ngcontent-%COMP%]{padding:2%}.inner-list-item[_ngcontent-%COMP%]{padding-left:2%}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function Fw(e,t){1&e&&(h.rc(0,"span",100),h.qd(1,"Total Investment"),h.qc())}function Ow(e,t){if(1&e&&(h.rc(0,"span",101),h.qd(1,"MYR "),h.qc(),h.rc(2,"span",61),h.qd(3),h.Ec(4,"number"),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.rd(h.Gc(4,1,e.totalInvestmentValue,"1.2-2"))}}function Uw(e,t){if(1&e&&h.mc(0,"i",63),2&e){h.Dc(2);const e=h.ad(165);h.Mc("nzTooltipTitle",e)}}function xw(e,t){if(1&e&&(h.rc(0,"span",100),h.qd(1,"Current Value "),h.od(2,Uw,1,1,"i",64),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("ngIf",e.isPortfolioContainOtc())}}function Lw(e,t){if(1&e&&(h.rc(0,"span",101),h.qd(1,"MYR "),h.qc(),h.rc(2,"span",61),h.qd(3),h.Ec(4,"number"),h.qc()),2&e){const e=h.Dc(2);h.Ub(3),h.rd(h.Gc(4,1,e.totalCurrentValue,"1.2-2"))}}function Rw(e,t){if(1&e&&(h.rc(0,"span",100),h.qd(1,"Unrealised Profit / Loss "),h.mc(2,"i",63),h.qc()),2&e){h.Dc(2);const e=h.ad(2);h.Ub(2),h.Mc("nzTooltipTitle",e)}}function Nw(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",102),h.qd(2,"MYR "),h.qc(),h.rc(3,"span",103),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"span",103),h.qd(7),h.Ec(8,"number"),h.qc(),h.mc(9,"i",104),h.qc()),2&e){const e=h.Dc(3);h.Ub(4),h.rd(h.Gc(5,2,e.totalProfitAndLossValue,"1.2-2")),h.Ub(3),h.rd(" ("+h.Gc(8,5,e.totalProfitAndLossPercentageValue,"1.2-2")+"%) ")}}function Bw(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",105),h.qd(2,"- MYR "),h.qc(),h.rc(3,"span",106),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"span",106),h.qd(7),h.Ec(8,"number"),h.qc(),h.mc(9,"i",107),h.qc()),2&e){const e=h.Dc(3);h.Ub(4),h.rd(h.Gc(5,2,0-e.totalProfitAndLossValue,"1.2-2")),h.Ub(3),h.rd(" ("+h.Gc(8,5,e.totalProfitAndLossPercentageValue,"1.2-2")+"%) ")}}function _w(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",101),h.qd(2,"MYR "),h.qc(),h.rc(3,"span",61),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"span",61),h.qd(7),h.Ec(8,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(4),h.rd(h.Gc(5,2,e.totalProfitAndLossValue,"1.2-2")),h.Ub(3),h.rd(" ("+h.Gc(8,5,e.totalProfitAndLossPercentageValue,"1.2-2")+"%)")}}function Vw(e,t){if(1&e&&(h.od(0,Nw,10,8,"div",0),h.od(1,Bw,10,8,"div",0),h.od(2,_w,9,8,"div",0)),2&e){const e=h.Dc(2);h.Mc("ngIf",e.totalProfitAndLossValue>0),h.Ub(1),h.Mc("ngIf",e.totalProfitAndLossValue<0),h.Ub(1),h.Mc("ngIf",0===e.totalProfitAndLossValue)}}function Hw(e,t){if(1&e){const e=h.sc();h.rc(0,"i",108),h.zc("click",(function(){return h.dd(e),h.Dc(2).onSearchClear()})),h.qc()}}function $w(e,t){1&e&&h.mc(0,"i",109)}function jw(e,t){if(1&e&&(h.mc(0,"ui-option",36),h.Ec(1,"displayExchangeName")),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",h.Fc(1,2,e.label))}}function Gw(e,t){if(1&e&&h.mc(0,"ui-option",36),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e)}}function Ww(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",110),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).selectedCurrency=t}))("ngModelChange",(function(){return h.dd(e),h.Dc(2).searchByCurrency()})),h.mc(1,"ui-option",36),h.od(2,Gw,1,2,"ui-option",37),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("nzDropdownMatchSelectWidth",!1)("ngModel",e.selectedCurrency),h.Ub(1),h.Mc("nzValue","")("nzLabel","All"),h.Ub(1),h.Mc("ngForOf",e.currencyList)}}function Yw(e,t){if(1&e&&(h.rc(0,"label",111),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function Kw(e,t){1&e&&h.mc(0,"th",112)}function Xw(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",116),h.qd(2),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Nc("nzSortKey",e.key),h.Mc("nzShowSort",!0),h.Ub(1),h.rd(e.colName)}}function Qw(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",117),h.qd(2),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(2),h.rd(e.colName)}}function Zw(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",118),h.qd(2),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Mc("nzShowSort",!0),h.Ub(1),h.rd(e.colName)}}function Jw(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",119),h.qd(2),h.rc(3,"a",120),h.mc(4,"i",121),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Dc();const t=h.ad(161);h.Ub(1),h.Nc("nzSortKey",e.key),h.Mc("nzShowSort",!0),h.Ub(1),h.sd("",e.colName," "),h.Ub(1),h.Mc("nz-tooltip",t)}}function ez(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",122),h.qd(2),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Mc("nzShowSort",!0),h.Ub(1),h.rd(e.colName)}}function tz(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",119),h.qd(2),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Nc("nzSortKey",e.key),h.Mc("nzShowSort",!0),h.Ub(1),h.rd(e.colName)}}function nz(e,t){if(1&e&&(h.pc(0),h.pc(1,113),h.od(2,Xw,3,3,"ng-container",114),h.od(3,Qw,3,1,"ng-container",114),h.od(4,Zw,3,2,"ng-container",114),h.od(5,Jw,5,4,"ng-container",114),h.od(6,ez,3,2,"ng-container",114),h.od(7,tz,3,3,"ng-container",115),h.oc(),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngSwitch",e.key),h.Ub(1),h.Mc("ngSwitchCase","name"),h.Ub(1),h.Mc("ngSwitchCase","actions"),h.Ub(1),h.Mc("ngSwitchCase","unrealisedPL"),h.Ub(1),h.Mc("ngSwitchCase","avgPrice"),h.Ub(1),h.Mc("ngSwitchCase","cost")}}function iz(e,t){if(1&e){const e=h.sc();h.rc(0,"img",134),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(2).snapSingleData(t)})),h.qc()}2&e&&h.Mc("src","assets/images/stocks/snap.svg",h.gd)("nzTitle","Live Snap: One-time refresh of live prices of your selected Stocks/ETFs")}
5function cz(e,t){if(1&e&&(h.rc(0,"td"),h.od(1,iz,1,2,"img",133),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.Mc("ngIf","HKEX"===(null==e?null:e.exchange)&&!t.isHkexLivestreaming)}}function oz(e,t){if(1&e&&(h.rc(0,"a",135),h.mc(1,"i",121),h.qc()),2&e){h.Dc(2);const e=h.ad(163);h.Mc("nz-tooltip",e)}}function sz(e,t){if(1&e&&(h.rc(0,"p"),h.qd(1),h.Ec(2,"date"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd("Delayed streaming will resume after 15 minutes at ",h.Gc(2,1,null==e?null:e.endSnapDate,"hh:mm a"),"")}}function az(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",136),h.qd(2),h.Ec(3,"date"),h.mc(4,"i",137),h.qc(),h.od(5,sz,3,4,"ng-template",null,138,h.pd),h.oc()),2&e){const e=h.ad(6),t=h.Dc().$implicit;h.Ub(2),h.sd("Last Snapped: ",h.Gc(3,2,null==t?null:t.lastSnapDate,"hh:mm")," "),h.Ub(2),h.Mc("nzTooltipTitle",e)}}function lz(e,t){1&e&&(h.rc(0,"td",127),h.qd(1," - "),h.qc())}function rz(e,t){if(1&e&&(h.rc(0,"td",139),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.td(" ",t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency," ",h.Gc(2,2,t.selectedCurrencyOption===t.displayOptions[0].value?e.costInLocalCurrency:e.cost,"1.2-2")," ")}}function dz(e,t){1&e&&(h.rc(0,"td",127),h.qd(1," - "),h.qc())}function uz(e,t){if(1&e&&(h.rc(0,"span",142),h.qd(1),h.Ec(2,"stockPrice"),h.Ec(3,"stockPrice"),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc(2);h.Ub(1),h.td(" ",t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency," ",t.selectedCurrencyOption===t.displayOptions[0].value?h.Gc(2,2,e.lastPriceInLocalCurrency,null==e?null:e.exchange):h.Gc(3,5,e.lastPrice,null==e?null:e.exchange)," ")}}function hz(e,t){if(1&e&&(h.rc(0,"span",143),h.qd(1),h.Ec(2,"stockPrice"),h.Ec(3,"stockPrice"),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc(2);h.Ub(1),h.td(" ",t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency," ",t.selectedCurrencyOption===t.displayOptions[0].value?h.Gc(2,2,e.lastPriceInLocalCurrency,null==e?null:e.exchange):h.Gc(3,5,e.lastPrice,null==e?null:e.exchange),"")}}function pz(e,t){if(1&e&&(h.rc(0,"td",127),h.od(1,uz,4,8,"span",140),h.od(2,hz,4,8,"span",141),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Mc("ngIf",e.lastPrice-e.avgPrice<0),h.Ub(1),h.Mc("ngIf",e.lastPrice-e.avgPrice>=0)}}function mz(e,t){1&e&&(h.rc(0,"td",127),h.qd(1," - "),h.qc())}function fz(e,t){if(1&e&&(h.rc(0,"td",139),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.td(" ",t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency," ",h.Gc(2,2,e.totalQty*(t.selectedCurrencyOption===t.displayOptions[0].value?e.lastPriceInLocalCurrency:e.lastPrice),"1.2-2"),"")}}function gz(e,t){1&e&&(h.rc(0,"nz-row"),h.rc(1,"span"),h.qd(2," - "),h.qc(),h.qc())}const bz=function(e,t){return{"text-loss":e,"text-profit":t}};function Sz(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"span",144),h.qd(2),h.Ec(3,"customizeCurrency"),h.Ec(4,"customizeCurrency"),h.qc(),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Tc(10,bz,e.lastPrice-e.avgPrice<0,e.lastPrice-e.avgPrice>0)),h.Ub(1),h.sd(" ",t.selectedCurrencyOption===t.displayOptions[0].value?h.Hc(3,2,(e.lastPriceInLocalCurrency-e.avgPriceInLocalCurrency)*e.totalQty,t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency,".2-2"):h.Hc(4,6,(e.lastPrice-e.avgPrice)*e.totalQty,t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency,".2-2")," ")}}function yz(e,t){if(1&e&&(h.rc(0,"span",147),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd(" ",0!=e.avgPrice?h.Gc(2,1,(e.lastPrice-e.avgPrice)/e.avgPrice*100,"1.2-2"):"-"," % ")}}function vz(e,t){if(1&e&&(h.rc(0,"span",148),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd(" ",0!=e.avgPrice?h.Gc(2,1,(e.lastPrice-e.avgPrice)/e.avgPrice*100,"1.2-2"):"-"," % ")}}function Mz(e,t){if(1&e&&(h.rc(0,"nz-row"),h.od(1,yz,3,4,"span",145),h.od(2,vz,3,4,"span",146),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Mc("ngIf",e.lastPrice-e.avgPrice<0),h.Ub(1),h.Mc("ngIf",e.lastPrice-e.avgPrice>=0)}}function Cz(e,t){1&e&&h.mc(0,"nz-option",36),2&e&&h.Mc("nzValue","buy")("nzLabel","Buy")}function qz(e,t){1&e&&h.mc(0,"nz-option",36),2&e&&h.Mc("nzValue","sell")("nzLabel","Sell")}function Tz(e,t){1&e&&h.mc(0,"nz-option",36),2&e&&h.Mc("nzValue","
5watchlist")("nzLabel","Add to Watchlist")}function wz(e,t){if(1&e){const e=h.sc();h.rc(0,"tr",123),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onSelectStockInfoRow(n)})),h.od(1,cz,2,1,"td",0),h.rc(2,"td"),h.rc(3,"a",124),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).navigateToStocksFactsheet(null!=n&&n.shortName?null==n?null:n.shortName:null==n?null:n.name,n.exchange,n.code,n.securityType)})),h.qd(4),h.qc(),h.od(5,oz,2,1,"a",125),h.rc(6,"p",126),h.qd(7),h.qc(),h.od(8,az,7,5,"ng-container",0),h.qc(),h.rc(9,"td",127),h.mc(10,"app-stock-exchange-tag",128),h.Ec(11,"displayExchangeName"),h.qc(),h.rc(12,"td",127),h.rc(13,"span",46),h.qd(14),h.Ec(15,"number"),h.qc(),h.qc(),h.rc(16,"td",127),h.rc(17,"span",46),h.qd(18),h.Ec(19,"number"),h.qc(),h.qc(),h.rc(20,"td",127),h.rc(21,"span",46),h.qd(22),h.Ec(23,"number"),h.Ec(24,"number"),h.qc(),h.qc(),h.od(25,lz,2,0,"td",129),h.od(26,rz,3,5,"td",130),h.od(27,dz,2,0,"td",129),h.od(28,pz,3,2,"td",129),h.od(29,mz,2,0,"td",129),h.od(30,fz,3,5,"td",130),h.rc(31,"td",127),h.od(32,gz,3,0,"nz-row",0),h.od(33,Sz,5,13,"nz-row",0),h.od(34,Mz,3,2,"nz-row",0),h.qc(),h.rc(35,"td",127),h.rc(36,"nz-select",131),h.zc("ngModelChange",(function(n){return h.dd(e),t.$implicit.action=n}))("ngModelChange",(function(n){h.dd(e);const i=t.$implicit;return h.Dc(2).onChangeAction(n,i)})),h.od(37,Cz,1,2,"nz-option",132),h.od(38,qz,1,2,"nz-option",132),h.od(39,Tz,1,2,"nz-option",132),h.mc(40,"nz-option",36),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngIf",n.isHKEXStockExist()),h.Ub(3),h.rd(null!=e&&e.shortName?null==e?null:e.shortName:null==e?null:e.name),h.Ub(1),h.Mc("ngIf",n.isOtc(e)),h.Ub(2),h.rd(e.code),h.Ub(1),h.Mc("ngIf",n.displaySnapInfo(e)),h.Ub(2),h.Mc("exchange",h.Fc(11,26,null==e?null:e.exchange)),h.Ub(4),h.rd(h.Gc(15,28,e.totalQty,"1.0-4")),h.Ub(4),h.rd(h.Gc(19,31,e.totalAvailableQty,"1.0-4")),h.Ub(4),h.td(" ",n.selectedCurrencyOption===n.displayOptions[0].value?"MYR":e.currency===n.GBX?n.GBP:e.currency," ",n.selectedCurrencyOption===n.displayOptions[0].value?h.Gc(23,34,e.avgPriceInLocalCurrency,"1.4-4"):h.Gc(24,37,e.avgPrice,"1.4-4")," "),h.Ub(3),h.Mc("ngIf",n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e)),h.Ub(1),h.Mc("ngIf",n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e)),h.Ub(1),h.Mc("ngIf",n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e)),h.Ub(2),h.Mc("ngIf",n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e)),h.Ub(2),h.Mc("nzDropdownMatchSelectWidth",!1)("ngModel",e.action),h.Ub(1),h.Mc("ngIf",n.isNzOptionVisible(e,"buy")),h.Ub(1),h.Mc("ngIf",n.isNzOptionVisible(e,"sell")),h.Ub(1),h.Mc("ngIf",n.isNzOptionVisible(e,"watchlist")),h.Ub(1),h.Mc("nzValue","transactionHistory")("nzLabel","View Transaction History")}}function zz(e,t){1&e&&h.mc(0,"td")}function Dz(e,t){if(1&e&&(h.rc(0,"tr",149),h.od(1,zz,1,0,"td",0),h.rc(2,"td",150),h.qd(3,"Total"),h.qc(),h.mc(4,"td"),h.rc(5,"td",151),h.qd(6),h.Ec(7,"number"),h.qc(),h.mc(8,"td"),h.rc(9,"td",152),h.qd(10),h.Ec(11,"number"),h.qc(),h.mc(12,"td"),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",e.isHKEXStockExist()),h.Ub(4),h.Mc("ngClass",h.Tc(12,bz,e.totalSelectedCurrencyProfitAndLossValue<0,e.totalSelectedCurrencyProfitAndLossValue>0)),h.Ub(1),h.td("",e.selectedCurrency,"\xa0",h.Gc(7,6,e.totalSelectedCurrencyProfitAndLossValue,"1.2-2"),""),h.Ub(4),h.td("",e.selectedCurrency,"\xa0",h.Gc(11,9,e.totalSelectedCurrencyCurrentValue,"1.2-2"),"")}}function Pz(e,t){if(1&e){const e=h.sc();h.rc(0,"i",153),h.zc("click",(function(){return h.dd(e),h.Dc(2).readPortfolio(!0)})),h.qc(),h.rc(1,"span",154),h.qd(2),h.Ec(3,"date"),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(2),h.sd("Last Update: ",h.Gc(3,1,e.liveStreamDate,"dd MMM yyyy HH:mm"),"")}}function Iz(e,t){if(1&e&&(h.rc(0,"span",55),h.qd(1,"Powered by iFAST Financial Pte. Ltd. & "),h.mc(2,"img",155),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("src",e.imagePath+"morning-star-logo.svg",h.gd)}}function kz(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",156),h.qd(2),h.Ec(3,"number"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.td("MYR ",h.Gc(3,2,e.totalProfitAndLossValue,"1.2-2")," (",h.Gc(4,5,e.totalProfitAndLossPercentageValue,"1.2-2"),"%)")}}function Az(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",157),h.qd(2),h.Ec(3,"number"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.td("- MYR ",h.Gc(3,2,0-e.totalProfitAndLossValue,"1.2-2")," (",h.Gc(4,5,e.totalProfitAndLossPercentageValue,"1.2-2"),"%)")}}function Ez(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",65),h.qd(2),h.Ec(3,"number"),h.Ec(4,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.td("MYR ",h.Gc(3,2,e.totalProfitAndLossValue,"1.2-2")," (",h.Gc(4,5,e.totalProfitAndLossPercentageValue,"1.2-2"),"%)")}}function Fz(e,t){if(1&e&&h.mc(0,"i",63),2&e){h.Dc();const e=h.ad(165);h.Mc("nzTooltipTitle",e)}}function Oz(e,t){if(1&e&&(h.rc(0,"label",158),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function Uz(e,t){if(1&e){const e=h.sc();h.rc(0,"i",108),h.zc("click",(function(){return h.dd(e),h.Dc(2).onSearchClear()}
5)),h.qc()}}function xz(e,t){1&e&&h.mc(0,"i",109)}function Lz(e,t){if(1&e&&(h.mc(0,"nz-option",36),h.Ec(1,"displayExchangeName")),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",h.Fc(1,2,e.label))}}function Rz(e,t){if(1&e&&h.mc(0,"nz-option",36),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e)}}function Nz(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-select",159),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).selectedCurrency=t}))("ngModelChange",(function(){return h.dd(e),h.Dc(2).searchByCurrency()})),h.mc(1,"nz-option",36),h.od(2,Rz,1,2,"nz-option",37),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("nzDropdownMatchSelectWidth",!1)("ngModel",e.selectedCurrency),h.Ub(1),h.Mc("nzValue","")("nzLabel","All"),h.Ub(1),h.Mc("ngForOf",e.currencyList)}}function Bz(e,t){1&e&&h.mc(0,"th",160)}function _z(e,t){if(1&e&&(h.rc(0,"th",164),h.qd(1),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.rd(e.colName)}}function Vz(e,t){if(1&e&&(h.rc(0,"a",120),h.mc(1,"i",121),h.qc()),2&e){h.Dc(4);const e=h.ad(161);h.Mc("nz-tooltip",e)}}function Hz(e,t){if(1&e&&(h.rc(0,"th",165),h.rc(1,"span"),h.qd(2),h.qc(),h.mc(3,"br"),h.rc(4,"span",166),h.qd(5),h.od(6,Vz,2,1,"a",167),h.qc(),h.qc()),2&e){const e=h.Dc(2).index,t=h.Dc(2);h.Ub(2),h.rd(t.displayMobileCols[e].colName),h.Ub(3),h.sd("",null==t.displayMobileCols[e+4]?null:t.displayMobileCols[e+4].colName," "),h.Ub(1),h.Mc("ngIf","avgPrice"===(null==t.displayMobileCols[e+4]?null:t.displayMobileCols[e+4].key))}}function $z(e,t){if(1&e&&(h.rc(0,"th",168),h.qd(1),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.rd(e.colName)}}function jz(e,t){if(1&e&&(h.pc(0),h.od(1,_z,2,1,"th",161),h.od(2,Hz,7,3,"th",162),h.od(3,$z,2,1,"th",163),h.oc()),2&e){const e=h.Dc().index;h.Ub(1),h.Mc("ngIf",0===e),h.Ub(1),h.Mc("ngIf",0!==e&&e<7),h.Ub(1),h.Mc("ngIf",7===e)}}function Gz(e,t){if(1&e&&(h.pc(0),h.od(1,jz,4,3,"ng-container",0),h.oc()),2&e){const e=t.index,n=h.Dc(2);h.Ub(1),h.Mc("ngIf",e<n.displayMobileCols.length-3-1)}}function Wz(e,t){if(1&e){const e=h.sc();h.rc(0,"img",134),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(2).snapSingleData(t)})),h.qc()}2&e&&h.Mc("src","assets/images/stocks/snap.svg",h.gd)("nzTitle","Live Snap: One-time refresh of live prices of your selected Stocks/ETFs")}function Yz(e,t){if(1&e&&(h.rc(0,"td",160),h.od(1,Wz,1,2,"img",133),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.Mc("ngIf","HKEX"===(null==e?null:e.exchange)&&!t.isHkexLivestreaming)}}function Kz(e,t){if(1&e&&(h.rc(0,"a",135),h.mc(1,"i",121),h.qc()),2&e){h.Dc(2);const e=h.ad(163);h.Mc("nz-tooltip",e)}}function Xz(e,t){if(1&e&&(h.pc(0),h.mc(1,"br"),h.rc(2,"span",136),h.qd(3),h.Ec(4,"date"),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(3),h.sd("Last Snapped: ",h.Gc(4,1,null==e?null:e.lastSnapDate,"hh:mm"),"")}}function Qz(e,t){1&e&&(h.rc(0,"span",127),h.qd(1," - "),h.qc())}function Zz(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.Ec(2,"number"),h.Ec(3,"number"),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.td("",t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency," ",t.selectedCurrencyOption===t.displayOptions[0].value?h.Gc(2,2,e.costInLocalCurrency,"1.2-2"):h.Gc(3,5,e.cost,"1.2-2"),"")}}function Jz(e,t){1&e&&(h.rc(0,"td",165),h.rc(1,"span",172),h.qd(2," - "),h.qc(),h.mc(3,"br"),h.rc(4,"span"),h.qd(5," - "),h.qc(),h.qc())}function eD(e,t){if(1&e&&(h.rc(0,"td",165),h.rc(1,"span",172),h.qd(2),h.Ec(3,"stockPrice"),h.Ec(4,"stockPrice"),h.qc(),h.mc(5,"br"),h.rc(6,"span"),h.qd(7),h.Ec(8,"number"),h.qc(),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(2),h.td("",t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency," ",t.selectedCurrencyOption===t.displayOptions[0].value?h.Gc(3,4,e.lastPriceInLocalCurrency,null==e?null:e.exchange):h.Gc(4,7,e.lastPrice,null==e?null:e.exchange),""),h.Ub(5),h.td("",t.selectedCurrencyOption===t.displayOptions[0].value?"MYR":e.currency===t.GBX?t.GBP:e.currency," ",h.Gc(8,10,e.totalQty*(t.selectedCurrencyOption===t.displayOptions[0].value?e.lastPriceInLocalCurrency:e.lastPrice),"1.2-2")," ")}}function tD(e,t){1&e&&(h.rc(0,"td",165),h.rc(1,"span",172),h.qd(2," - "),h.qc(),h.mc(3,"br"),h.rc(4,"span"),h.qd(5," - "),h.qc(),h.qc())}function nD(e,t){if(1&e&&(h.rc(0,"span",178),h.qd(1),h.Ec(2,"number"),h.Ec(3,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc(2);h.Ub(1),h.sd(" ",t.selectedCurrencyOption===t.displayOptions[0].value?h.Gc(2,1,(e.lastPriceInLocalCurrency-e.avgPriceInLocalCurrency)*e.totalQty,"1.2-2"):h.Gc(3,4,(e.lastPrice-e.avgPrice)*e.totalQty,"1.2-2")," ")}}function iD(e,t){if(1&e&&(h.rc(0,"span",179),h.qd(1),h.Ec(2,"number"),h.Ec(3,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc(2);h.Ub(1),h.sd(" ",t.selectedCurrencyOption===t.displayOptions[0].value?h.Gc(2,1,(e.lastPriceInLocalCurrency-e.avgPriceInLocalCurrency)*e.totalQty,"1.2-2"):h.Gc(3,4,(e.lastPrice-e.avgPrice)*e.totalQty,"1.2-2")," ")}}function cD(e,t){if(1&e&&(h.rc(0,"span",180),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd(" ",0!=e.avgPrice?h.Gc(2,1,(e.lastPrice-e.avgPrice)/e.avgPrice*100,"1.2-2"):"-","")}}function oD(e,t){if(1&e&&(h.rc(0,"span",181),h.qd(1),h.Ec(2,"number"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.sd(" ",0!=e.avgPrice?h.Gc(2,1,(e.lastPrice-e.avgPrice)/e.avgPrice*100,"1.2-2"):"-","")}}function sD(e,t){if(1&e&&(h.rc(0,"td",165),h.od(1,nD,4,7,"span",174),h.od(2,iD,4,7,"span",175),h.mc(3,"br"),h.od(4,cD,3,4,"span",176),h.od(5,oD,3,4,"span",177),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.Mc("ngIf",e.lastPrice-e.avgPrice<0),h.Ub(1),h.Mc("ngIf",e.lastPrice-e.avgPrice>=0),h.Ub(2),h.Mc("ngIf",e.lastPrice-e.avgPrice<0),h.Ub(1),h.Mc("ngIf",e.lastPrice-e.avgPrice>=0)}}function aD(e,t){if(1&e){const e=h.sc();h.rc(0,"tr",169),h.zc("click",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(2).setPortfolioMobileActionVisible(n)})),h.od(1,Yz,2,1,"td",82),h.rc(2,"td",164),h.rc(3,"a",170),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).navigateToStocksFactsheet(null!=n&&n.shortName?null==n?null:n.shortName:null==n?null:n.name,n.exchange,n.code,n.securityType)})),h.qd(4),h.qc(),h.od(5,Kz,2,1,"a",125),h.mc(6,"br"),h.rc(7,"span",171),h.mc(8,"app-stock-exchange-tag",128),h.Ec(9,"displayExchangeName"),h.qd(10),h.qc(),h.od(11,Xz,5,4,"ng-container",0),h.qc(),h.rc(12,"td",165),h.rc(13,"span",172),h.qd(14),h.Ec(15,"number"),h.qc(),h.mc(16,"br"),h.rc(17,"span"),h.qd(18),h.Ec(19,"number"),h.qc(),h.qc(),h.rc(20,"td",165),h.rc(21,"span",172),h.qd(22),h.Ec(23,"number"),h.Ec(24,"number"),h.qc(),h.mc(25,"br"),h.od(26,Qz,2,0,"span",129),h.od(27,Zz,4,8,"span",0),h.mc(28,"br"),h.qc(),h.od(29,Jz,6,0,"td",162),h.od(30,eD,9,13,"td",162),h.od(31,tD,6,0,"td",162),h.od(32,sD,6,4,"td",162),h.rc(33,"td",165),h.mc(34,"i",173),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngIf",n.isHKEXStockExist()),h.Ub(3),h.rd(null!=e&&e.shortName?null==e?null:e.shortName:null==e?null:e.name),h.Ub(1),h.Mc("ngIf",n.isOtc(e)),h.Ub(3),h.Mc("exchange",h.Fc(9,16,null==e?null:e.exchange)),h.Ub(2),h.sd(" | ",e.code,""),h.Ub(1),h.Mc("ngIf",n.displaySnapInfo(e)),h.Ub(3),h.rd(h.Gc(15,18,e.totalQty,"1.0-4")),h.Ub(4),h.rd(h.Gc(19,21,e.totalAvailableQty,"1.0-4")),h.Ub(4),h.td(" ",n.selectedCurrencyOption===n.displayOptions[0].value?"MYR":e.currency===n.GBX?n.GBP:e.currency," ",n.selectedCurrencyOption===n.displayOptions[0].value?h.Gc(23,24,e.avgPriceInLocalCurrency,"1.4-4"):h.Gc(24,27,e.avgPrice,"1.4-4"),""),h.Ub(4),h.Mc("ngIf",n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e)),h.Ub(2),h.Mc("ngIf",n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e)),h.Ub(1),h.Mc("ngIf",n.isOtc(e)),h.Ub(1),h.Mc("ngIf",!n.isOtc(e))}}function lD(e,t){if(1&e){const e=h.sc();h.rc(0,"i",182),h.zc("click",(function(){return h.dd(e),h.Dc(2).readPortfolio()})),h.qc(),h.rc(1,"span",183),h.qd(2),h.Ec(3,"date"),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(2),h.sd("Last Update: ",h.Gc(3,1,e.liveStreamDate,"dd MMM yyyy HH:mm"),"")}}function rD(e,t){if(1&e&&(h.rc(0,"span",87),h.qd(1,"Powered by iFAST Financial Pte. Ltd. & "),h.mc(2,"img",155),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("src",e.imagePath+"morning-star-logo.svg",h.gd)}}function dD(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-modal",184),h.zc("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("emitData",(function(t){return h.dd(e),h.Dc(2).showTransactionPreviewModal(t)}))("changeVisible",(function(t){return h.dd(e),h.Dc(2).handleTransactionModalVisible(t)}))("emitGetFeeDetailAction",(function(t){return h.dd(e),h.Dc(2).getFee(t)}))("changeSelectedTransactionType",(function(t){return h.dd(e),h.Dc(2).handleSelectedTransactionType(t)}))("changeSelectedInvestmentAcctType",(function(t){return h.dd(e),h.Dc(2).handleSelectedInvestmentAcctType(t)}))("changeSelectedPurchasingPowerType",(function(t){return h.dd(e),h.Dc(2).handleSelectedPurchasingPowerType(t)}))("emitSnapSelectedStockAction",(function(t){return h.dd(e),h.Dc(2).snapSelectedStock(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("isSwitchCurrency",e.isSwitchCurrency)("isCalculator",e.isCalculator)("holdingInfo",e.portfolioItems)("visible",e.transactionModalVisible)("selectedStock",e.selectedStock)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("marketDepthDataBid",e.marketDepthDataBid)("marketDepthDataAsk",e.marketDepthDataAsk)("feeDetail",e.feeDetail)("feeDetailStatus",e.feeDetailStatus)("rspEtfProductInfo",e.rspEtfProductInfo)("isScheduledSellOrderExist",e.isScheduledSellOrderExist)("isModifyOrder",e.isModifyOrder)}}function uD(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-modal-revamp",185),h.zc("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("emitData",(function(t){return h.dd(e),h.Dc(2).showTransactionPreviewModal(t)}))("changeVisible",(function(t){return h.dd(e),h.Dc(2).handleTransactionModalVisible(t)}))("emitGetFeeDetailAction",(function(t){return h.dd(e),h.Dc(2).getFee(t)}))("changeSelectedTransactionType",(function(t){return h.dd(e),h.Dc(2).handleSelectedTransactionType(t)}))("changeSelectedInvestmentAcctType",(function(t){return h.dd(e),h.Dc(2).handleSelectedInvestmentAcctType(t)}))("changeSelectedPurchasingPowerType",(function(t){return h.dd(e),h.Dc(2).handleSelectedPurchasingPowerType(t)}))("changeSelectedStock",(function(t){return h.dd(e),h.Dc(2).handleSelectedStockChange(t)}
5))("emitSnapSelectedStockAction",(function(t){return h.dd(e),h.Dc(2).snapSelectedStock(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("lsClient",e.lsClient)("isSwitchCurrency",e.isSwitchCurrency)("isCalculator",e.isCalculator)("holdingInfo",e.portfolioItems)("visible",e.transactionModalVisible)("selectedStock",e.selectedStock)("priceQuote",e.priceQuote)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("marketDepthDataBid",e.marketDepthDataBid)("marketDepthDataAsk",e.marketDepthDataAsk)("feeDetail",e.feeDetail)("feeDetailStatus",e.feeDetailStatus)("feeNameMap",e.exchangeFeeNameDescMap)("rspEtfProductInfo",e.rspEtfProductInfo)("isScheduledSellOrderExist",e.isScheduledSellOrderExist)("isModifyOrder",e.isModifyOrder)}}function hD(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-preview-modal",186),h.zc("changeVisible",(function(t){return h.dd(e),h.Dc(2).handleTransactionPreviewModalVisible(t)}))("refreshPortfolioAction",(function(t){return h.dd(e),h.Dc(2).refreshPortfolio(t)}))("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("backVisible",(function(t){return h.dd(e),h.Dc(2).handleTransactionPreviewModalBack(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("visible",e.transactionPreviewVisible)("feeDetail",e.feeDetail)("feeDetailStatus",e.feeDetailStatus)("selectedStock",e.selectedStock)("selectedPurchasingPowerType",e.selectedPurchasingPowerType)("selectedTransactionType",e.selectedTransactionType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("stockPreviewData",e.transactionPreviewData)("isScheduledSellOrder",e.isScheduledSellOrder)("isModifyOrder",e.isModifyOrder)("marketOrderTypeSelected",e.marketOrderTypeSelected)}}function pD(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-transaction-preview-modal-revamp",187),h.zc("changeVisible",(function(t){return h.dd(e),h.Dc(2).handleTransactionPreviewModalVisible(t)}))("refreshPortfolioAction",(function(t){return h.dd(e),h.Dc(2).refreshPortfolio(t)}))("changeIsModifyOrder",(function(t){return h.dd(e),h.Dc(2).handleIsModifyOrder(t)}))("backVisible",(function(t){return h.dd(e),h.Dc(2).handleTransactionPreviewModalBack(t)})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("feeNameMap",e.exchangeFeeNameDescMap)("visible",e.transactionPreviewVisible)("feeDetail",e.feeDetail)("feeDetailStatus",e.feeDetailStatus)("selectedStock",e.selectedStock)("selectedPurchasingPowerType",e.selectedPurchasingPowerType)("selectedTransactionType",e.selectedTransactionType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("stockPreviewData",e.transactionPreviewData)("isScheduledSellOrder",e.isScheduledSellOrder)("isModifyOrder",e.isModifyOrder)("marketOrderTypeSelected",e.marketOrderTypeSelected)}}function mD(e,t){1&e&&h.qd(0," Price are include fees and charges ")}function fD(e,t){1&e&&h.qd(0," Info for USOTC shares is not available. ")}function gD(e,t){1&e&&h.qd(0," Current value for USOTC shares is not available due to limited info. ")}function bD(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stock-portfolio-detail",188),h.zc("selectedActionEmitter",(function(t){h.dd(e);const n=h.Dc(2);return n.onChangeAction(t,n.selectedPortfolioMobileData)}))("changeVisibleEmitter",(function(){return h.dd(e),h.Dc(2).setPortfolioMobileActionVisible()})),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("selectedStock",e.selectedPortfolioMobileData)("visible",e.portfolioMobileActionVisible)}}const SD=function(){return{x:"600px"}},yD=function(){return{x:"300px"}};function vD(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-web-scaffold"),h.rc(2,"nz-row"),h.rc(3,"div",15),h.rc(4,"nz-row",16),h.rc(5,"nz-col",17),h.rc(6,"div",18),h.mc(7,"img",19),h.rc(8,"div"),h.mc(9,"nz-statistic",20),h.od(10,Fw,2,0,"ng-template",null,21,h.pd),h.od(12,Ow,5,4,"ng-template",null,22,h.pd),h.qc(),h.qc(),h.qc(),h.rc(14,"nz-col",17),h.rc(15,"div",18),h.mc(16,"img",19),h.rc(17,"div"),h.mc(18,"nz-statistic",20),h.od(19,xw,3,1,"ng-template",null,23,h.pd),h.od(21,Lw,5,4,"ng-template",null,24,h.pd),h.qc(),h.qc(),h.qc(),h.rc(23,"nz-col",25),h.rc(24,"div",18),h.mc(25,"img",19),h.rc(26,"div"),h.mc(27,"nz-statistic",20),h.od(28,Rw,3,1,"ng-template",null,26,h.pd),h.od(30,Vw,3,3,"ng-template",null,27,h.pd),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(32,"nz-row",28),h.rc(33,"nz-col",29),h.rc(34,"form",30),h.rc(35,"nz-input-group",31),h.rc(36,"input",32),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().searchValue=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().search()})),h.qc(),h.qc(),h.qc(),h.od(37,Hw,1,0,"ng-template",null,33,h.pd),h.od(39,$w,1,0,"ng-template",null,34,h.pd),h.qc(),h.rc(41,"nz-col",29),h.rc(42,"ui-select",35),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedExchange=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().searchByExchange()})),h.mc(43,"ui-option",36),h.od(44,jw,2,4,"ui-option",37),h.qc(),h.qc(),h.rc(45,"nz-col",29),h.od(46,Ww,3,5,"ui-select",38),h.qc(),h.rc(47,"nz-col",29),h.rc(48,"div",39),h.qd(49,"Display Portfolio By \xa0 "),h.rc(50,"nz-radio-group",40),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedCurrencyOption=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().changeDisplayFlag()})),h.od(51,Yw,2,2,"label",41),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(52,"nz-row",42),h.rc(53,"nz-table",43,44),h.rc(55,"thead",45),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc().tableSort(t)})),h.rc(56,"tr",46),h.od(57,Kw,1,0,"th",47),h.od(58,nz,8,6,"ng-container",48),h.qc(),h.qc(),h.rc(59,"tbody"),h.od(60,wz,41,40,"tr",49),h.od(61,Dz,13,15,"tr",50),h.qc(),h.qc(),h.qc(),h.rc(62,"nz-row",51),h.od(63,Pz,4,4,"ng-template",null,52,h.pd),h.mc(65,"nz-spin",53),h.qc(),h.rc(66,"nz-row",54),h.pc(67),h.rc(68,"span",55),h.qd(69),h.qc(),h.rc(70,"span",56),h.qd(71),h.qc(),h.oc(),h.od(72,Iz,3,1,"span",57),h.qc(),h.qc(),h.rc(73,"app-mobile-scaffold"),h.rc(74,"nz-row"),h.rc(75,"div",58),h.rc(76,"nz-row"),h.rc(77,"nz-col",29),h.rc(78,"span",59),h.qd(79,"Total Investment"),h.qc(),h.qc(),h.rc(80,"nz-col",60),h.rc(81,"span",61),h.qd(82),h.Ec(83,"number"),h.qc(),h.qc(),h.qc(),h.rc(84,"nz-row"),h.rc(85,"nz-col",29),h.rc(86,"span",62),h.qd(87,"Unrealised Profit / Loss "),h.mc(88,"i",63),h.qc(),h.qc(),h.rc(89,"nz-col",60),h.od(90,kz,5,8,"div",0),h.od(91,Az,5,8,"div",0),h.od(92,Ez,5,8,"div",0),h.qc(),h.qc(),h.rc(93,"nz-row"),h.rc(94,"nz-col",29),h.rc(95,"span",62),h.qd(96,"Current Value "),h.od(97,Fz,1,1,"i",64),h.qc(),h.qc(),h.rc(98,"nz-col",60),h.rc(99,"span",65),h.qd(100),h.Ec(101,"number"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(102,"nz-row",66),h.rc(103,"nz-col",29),h.rc(104,"div",67),h.qd(105,"Display Portfolio By\xa0 "),h.rc(106,"nz-radio-group",40),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedCurrencyOption=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().changeDisplayFlag()})),h.od(107,Oz,2,2,"label",68),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(108,"nz-row",69),h.rc(109,"nz-row"),h.rc(110,"nz-col",70),h.qd(111,"Information"),h.qc(),h.rc(112,"nz-col",71),h.rc(113,"button",72),h.zc("click",(function(){h.dd(e);const t=h.Dc(),n=h.ad(22);return t.displayInfoInDrawer(n)})),h.mc(114,"i",73),h.qd(115,"Streaming "),h.qc(),h.qc(),h.qc(),h.rc(116,"nz-row"),h.rc(117,"nz-col",74),h.rc(118,"form",30),h.rc(119,"nz-input-group",31),h.rc(120,"input",75),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().searchValue=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().search()})),h.qc(),h.qc(),h.qc(),h.od(121,Uz,1,0,"ng-template",null,33,h.pd),h.od(123,xz,1,0,"ng-template",null,34,h.pd),h.qc(),h.qc(),h.rc(125,"nz-row",76),h.rc(126,"nz-col",29),h.rc(127,"nz-select",77),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedExchange=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().searchByExchange()})),h.mc(128,"nz-option",36),h.od(129,Lz,2,4,"nz-option",37),h.qc(),h.qc(),h.rc(130,"nz-col",78),h.od(131,Nz,3,5,"nz-select",79),h.qc(),h.qc(),h.rc(132,"nz-row",80),h.rc(133,"nz-table",81,44),h.rc(135,"thead"),h.rc(136,"tr"),h.od(137,Bz,1,0,"th",82),h.od(138,Gz,2,1,"ng-container",48),h.mc(139,"th"),h.qc(),h.qc(),h.rc(140,"tbody"),h.od(141,aD,35,30,"tr",83),h.qc(),h.qc(),h.qc(),h.rc(142,"nz-row",84),h.rc(143,"nz-col",29),h.od(144,lD,4,4,"ng-template",null,85,h.pd),h.mc(146,"nz-spin",53),h.qc(),h.qc(),h.rc(147,"nz-row",86),h.pc(148),h.rc(149,"span",87),h.qd(150),h.qc(),h.rc(151,"span",88),h.qd(152),h.qc(),h.oc(),h.od(153,rD,3,1,"span",89),h.qc(),h.qc(),h.qc(),h.od(154,dD,1,15,"app-stock-transaction-modal",90
5),h.od(155,uD,1,18,"app-stock-transaction-modal-revamp",91),h.rc(156,"cds-account-modal",92),h.zc("changeVisible",(function(t){return h.dd(e),h.Dc().handleCdsModalOpen(t)}))("handleCdsAccountReactivation",(function(t){return h.dd(e),h.Dc().handleCdsReactivation(t)})),h.qc(),h.od(157,hD,1,11,"app-stock-transaction-preview-modal",93),h.od(158,pD,1,12,"app-stock-transaction-preview-modal-revamp",94),h.rc(159,"app-add-to-watchlist-modal",95),h.zc("changeVisible",(function(t){return h.dd(e),h.Dc().handleAddToWatchListModalVisible(t)})),h.qc(),h.od(160,mD,1,0,"ng-template",null,96,h.pd),h.od(162,fD,1,0,"ng-template",null,97,h.pd),h.od(164,gD,1,0,"ng-template",null,98,h.pd),h.od(166,bD,1,2,"app-stock-portfolio-detail",99),h.oc()}if(2&e){const e=h.ad(11),t=h.ad(13),n=h.ad(20),i=h.ad(22),c=h.ad(29),o=h.ad(31),s=h.ad(38),a=h.ad(40),l=h.ad(54),r=h.ad(64),d=h.ad(145),u=h.Dc(),p=h.ad(2);h.Ub(7),h.Mc("src",u.imagePath+"portfolio/total-investment.svg",h.gd),h.Ub(2),h.Mc("nzValueTemplate",t)("nzTitle",e),h.Ub(7),h.Mc("src",u.imagePath+"portfolio/current-value.svg",h.gd),h.Ub(2),h.Mc("nzValueTemplate",i
5)("nzTitle",n),h.Ub(7),h.Mc("src",u.imagePath+"portfolio/profit-loss.svg",h.gd),h.Ub(2),h.Mc("nzValueTemplate",o)("nzTitle",c),h.Ub(5),h.Mc("nzGutter",16),h.Ub(1),h.Mc("nzSpan",8),h.Ub(2),h.Mc("nzPrefix",a)("nzSuffix",s),h.Ub(1),h.Mc("ngModel",u.searchValue),h.Ub(5),h.Mc("nzSpan",4),h.Ub(1),h.Mc("nzDropdownMatchSelectWidth",!1)("ngModel",u.selectedExchange),h.Ub(1),h.Mc("nzValue","")("nzLabel","All"),h.Ub(1),h.Mc("ngForOf",u.exchangeList),h.Ub(1),h.Mc("nzSpan",4),h.Ub(1),h.Mc("ngIf",u.selectedCurrencyOption===u.displayOptions[1].value),h.Ub(1),h.Mc("nzSpan",8),h.Ub(3),h.Mc("ngModel",u.selectedCurrencyOption),h.Ub(1),h.Mc("ngForOf",u.displayOptions),h.Ub(2),h.Mc("nzData",u.filteredPortfolioItems)("nzScroll",h.Rc(96,SD))("nzFrontPagination",!1)("nzLoading",u.portfolioTableLoading),h.Ub(4),h.Mc("ngIf",u.isHKEXStockExist()),h.Ub(1),h.Mc("ngForOf",u.displayCols),h.Ub(2),h.Mc("ngForOf",l.data),h.Ub(1),h.Mc("ngIf",u.showTotalFlag),h.Ub(4),h.Mc("nzIndicator",r),h.Ub(4),h.sd("Live Streaming: ",u.livePermissions,""),h.Ub(2),h.sd("Delayed at least 15 minutes: ",u.delayedPermissions,""),h.Ub(1),h.Mc("ngIf",!u.isFactsetGsa),h.Ub(5),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12),h.Ub(2),h.sd("MYR ",h.Gc(83,90,u.totalInvestmentValue,"1.2-2"),""),h.Ub(3),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzTooltipTitle",p),h.Ub(1),h.Mc("nzSpan",12),h.Ub(1),h.Mc("ngIf",u.totalProfitAndLossValue>0),h.Ub(1),h.Mc("ngIf",u.totalProfitAndLossValue<0),h.Ub(1),h.Mc("ngIf",0===u.totalProfitAndLossValue),h.Ub(2),h.Mc("nzSpan",12),h.Ub(3),h.Mc("ngIf",u.isPortfolioContainOtc()),h.Ub(1),h.Mc("nzSpan",12),h.Ub(2),h.sd("MYR ",h.Gc(101,93,u.totalCurrentValue,"1.2-2"),""),h.Ub(3),h.Mc("nzSpan",24),h.Ub(3),h.Mc("ngModel",u.selectedCurrencyOption),h.Ub(1),h.Mc("ngForOf",u.displayOptions),h.Ub(6),h.Mc("nzSize","small"),h.Ub(4),h.Mc("nzSpan",24),h.Ub(2),h.Mc("nzPrefix",a)("nzSuffix",s),h.Ub(1),h.Mc("ngModel",u.searchValue),h.Ub(6),h.Mc("nzSpan",u.selectedCurrencyOption===u.displayOptions[1].value?12:24),h.Ub(1),h.Mc("nzDropdownMatchSelectWidth",!1)("ngModel",u.selectedExchange),h.Ub(1),h.Mc("nzValue","")("nzLabel","All"),h.Ub(1),h.Mc("ngForOf",u.exchangeList),h.Ub(1),h.Mc("nzSpan",12),h.Ub(1),h.Mc("ngIf",u.selectedCurrencyOption===u.displayOptions[1].value),h.Ub(2),h.Mc("nzData",u.filteredPortfolioItems)("nzScroll",h.Rc(97,yD))("nzLoading",u.portfolioTableLoading)("nzFrontPagination",!1),h.Ub(4),h.Mc("ngIf",u.isHKEXStockExist()),h.Ub(1),h.Mc("ngForOf",u.displayMobileCols),h.Ub(3),h.Mc("ngForOf",l.data),h.Ub(2),h.Mc("nzSpan",24),h.Ub(3),h.Mc("nzIndicator",d),h.Ub(4),h.sd("Live Streaming: ",u.livePermissions,""),h.Ub(2),h.sd("Delayed at least 15 minutes: ",u.delayedPermissions,""),h.Ub(1),h.Mc("ngIf",!u.isFactsetGsa),h.Ub(1),h.Mc("ngIf",!u.isNewOrderpadEnabled),h.Ub(1),h.Mc("ngIf",u.isNewOrderpadEnabled),h.Ub(1),h.Mc("isVisible",u.cdsModalVisible)("cdsStatus",u.cdsStatus)("selectedAcctType",u.selectedAcctType)("hasProcessingCdsAccountReactivation",u.hasProcessingCdsAccountReactivation),h.Ub(1),h.Mc("ngIf",!u.isNewOrderpadEnabled),h.Ub(1),h.Mc("ngIf",u.isNewOrderpadEnabled),h.Ub(1),h.Mc("visible",u.addToWatchlistModalVisible)("selectedStock",u.selectedStock)("watchList",u.stockWatchLists),h.Ub(7),h.Mc("ngIf",u.selectedPortfolioMobileData)}}function MD(e,t){1&e&&(h.rc(0,"div",59),h.rc(1,"span"),h.qd(2,"For foreign currency stocks and ETFs, the Cost and WAC displayed in MYR are using daily indicative FX rate for reference purposes."),h.qc(),h.qc())}function CD(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"div",189),h.rc(2,"h5",190),h.qd(3),h.qc(),h.mc(4,"app-stocks-streaming-indicator",128),h.qc(),h.rc(5,"div",189),h.rc(6,"h5",190),h.qd(7),h.qc(),h.mc(8,"app-stocks-streaming-indicator",128),h.qc(),h.rc(9,"div",189),h.rc(10,"h5",190),h.qd(11,"NASDAQ,NYSE,AMEX,BATS"),h.qc(),h.mc(12,"app-stocks-streaming-indicator",128),h.qc(),h.rc(13,"div",189),h.rc(14,"h5",190),h.qd(15,"SGX"),h.qc(),h.mc(16,"app-stocks-streaming-indicator",128),h.qc(),h.rc(17,"div",189),h.rc(18,"h5",190),h.qd(19,"SSE,SZSE"),h.qc(),h.mc(20,"app-stocks-streaming-indicator",128),h.qc(),h.rc(21,"div",189),h.rc(22,"h5",190),h.qd(23,"LSE"),h.qc(),h.mc(24,"app-stocks-streaming-indicator",128),h.qc(),h.qc()),2&e){const e=h.Dc();
5h.Ub(3),h.rd(e.BURSA),h.Ub(1),h.Mc("exchange",e.BURSA),h.Ub(3),h.rd(e.HKEX),h.Ub(1),h.Mc("exchange",e.HKEX),h.Ub(4),h.Mc("exchange",e.AMEX),h.Ub(4),h.Mc("exchange",e.SGX),h.Ub(4),h.Mc("exchange",e.SSE),h.Ub(4),h.Mc("exchange",e.LSE)}}let qD=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l,r,u,p,m,f,S,y,v,C,q){this.cdsAccountRestService=e,this.stockInfoRestService=t,this.stockAccountRestService=n,this.stocksLeveragedInverseService=i,this.ref=c,this.liveFeedService=o,this.portfolioService=s,this.watchlistRestService=a,this.subHandlingService=l,this.accountService=r,this.accountRestService=u,this.lightStreamerHelperService=p,this.drawerService=m,this.scheduledSellRestService=f,this.modal=S,this.router=y,this.store=v,this.stocksFactsheetRestService=C,this.factsetGsaConfigService=q,this.klseLeveragedInverseStockList=[],this.emitMarketDepthAction=new h.s,this.handleCdsAccountReactivation=new h.s,this.CNH="CNH",this.CNY="CNY",this.isCalculator=!1,this.isSwitchCurrency=!0,this.totalInvestmentValue=0,this.totalCurrentValue=0,this.totalSelectedCurrencyProfitAndLossValue=0,this.totalSelectedCurrencyCurrentValue=0,this.totalProfitAndLossValue=0,this.totalProfitAndLossPercentageValue=0,this.selectedExchange="",this.selectedAccount="",this.IStockOptionType=d.c,this.exchangeFeeNameDescMap=new Map,this.portfolioItems=[],this.filteredPortfolioItems=[],this.selectedCurrency="",this.currencyList=[],this.livePermissions=[],this.delayedPermissions=[],this.HKEX=M.q.HKEX,this.SGX=M.q.SGX,this.KLSE=M.q.KLSE,this.BURSA=M.q.BURSA,this.AMEX=M.q.AMEX,this.USOTC=M.q.USOTC,this.SSE=M.q.SSE,this.SZSE=M.q.SZSE,this.LSE=M.q.LSE,this.GBX=M.q.LSE_GBX_CURRENCY,this.GBP=M.q.LSE_GBP_CURRENCY,this.imagePath=M.g.STOCKS_IMG_PATH,this.MARKET_DEPTH_FIELDS=["symbol","exchange","stockCode","level","type","volume","price","numberOfTrade","brokerQueue"],this.PRICE_DELAY="PRICE-DELAY-",this.displayCols=[{key:"name",colName:"Stock Name"},{key:"exchange",colName:"Exch"},{key:"totalQty",colName:"Total Qty"},{key:"totalAvailableQty",colName:"Balance Qty"},{key:"avgPrice",colName:"W.A.C"},{key:"cost",colName:"Cost"},{key:"lastPrice",colName:"Last"},{key:"marketValue",colName:"Market Value"},{key:"unrealisedPL",colName:"P/L"},{key:"actions",colName:"Actions"}],this.displayMobileCols=[{key:"name",colName:"Stock Name"},{key:"totalQty",colName:"Qty"},{key:"avgPrice",colName:"W.A.C"},{key:"lastPrice",colName:"Market Price"},{key:"unrealisedPL",colName:"P/L"},{key:"totalAvailableQty",colName:"Balance Qty"},{key:"cost",colName:"Cost"},{key:"marketValue",colName:"Market Value"},{key:"unrealisedPLPercent",colName:"P/L (%)"}],this.searchValue="",this.addToWatchlistModalVisible=!1,this.transactionModalVisible=!1,this.priceQuote={},this.portfolioMobileActionVisible=!1,this.selectedStock={},this.transactionPreviewVisible=!1,this.transactionPreviewData={},this.lotSize=100,this.selectedTransactionType=!0,this.isScheduledSellOrder=!1,this.isScheduledSellOrderExist=!1,this.isModifyOrder=!1,this.cdsModalVisible=!1,this.cdsStatus="",this.hasProcessingCdsAccountReactivation=!1,this.cdsStatusConstant=M.q.CDS_STATUS,this.w8BenChecked=!1,this.bcanRedirrectModelVisible=!1,this.chinaTradeNotAvailableModalVisible=!1,this.CHINA="China",this.visibleFepAgreement=!1,this.checkSiDeclaration=!1,this.checkLeverageInverseRiskAssessment=!1,this.previewModalVisible=!1,this.confirmedOrderButtonLoading=!1,this.stockWatchLists=[],this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.tempSubMarketDepth=[],this.tempSubPriceQuote=[],this.portfolioTableLoading=!1,this.liveStreamDate=new Date,this.isHkexLivestreaming=!1,this.searchQuery=new jt.a,this.searchByExchangeQuery=new jt.a,this.searchByCurrenyQuery=new jt.a,this.searchByAccountQuery=new jt.a,this.PRICE_QUOTE_FIELDS=["symbol","exchange","stockCode","stockName","currency","lastPrice","cumulativeVolume","bidPrice","bidQuantity","askPrice","askQuantity","openPrice","closePrice","dayHigh","dayLow","change","changePercentage","tradingInfo"],this.showTotalFlag=!1,this.exchangeList=M.q.EXCHANGE_LIST,this.displayAccountOptions=[{label:"Cash Upfront",value:"M"},{label:"Margin Acct",value:"C"}],this.displayOptions=[{label:"MYR",value:"myr"},{label:"Currency",value:"product"}],this.selectedCurrencyOption=this.displayOptions[1].value,this.concatenatedSymbol
5="",this.snapRankingIndex=1,this.MARKET_ORDER=M.q.ORDER_TYPE.MARKET_ORDER,this.MARKET_TO_LIMIT_ORDER=M.q.ORDER_TYPE.MARKET_TO_LIMIT_ORDER,this.STOP_ORDER=M.q.ORDER_TYPE.STOP_ORDER,this.STOP_LIMIT_ORDER=M.q.ORDER_TYPE.STOP_LIMIT_ORDER,this.isNewOrderpadEnabled=!1,this.searchQuery.pipe(Object(ce.a)(500),Object(b.a)()).subscribe(e=>{this.filteredPortfolioItems=this.portfolioItems,this.filteredPortfolioItems=this.filteredPortfolioItems.filter(t=>t.shortName&&t.shortName.toLowerCase().includes(e.toLowerCase())||t.name&&t.name.toLowerCase().includes(e.toLowerCase())||t.code&&t.code.toLowerCase().includes(e.toLowerCase()))}),this.searchByExchangeQuery.subscribe(()=>{this.changeDisplayFlag(),this.filteredPortfolioItems=Object(g.a)(this.portfolioItems),this.filteredPortfolioItems=this.filteredPortfolioItems.filter(e=>!(e.currency!==this.selectedCurrency&&""!==this.selectedCurrency||(e.exchange===M.q.KLSE?M.q.BURSA:e.exchange)!==this.selectedExchange&&""!==this.selectedExchange))}),this.searchByCurrenyQuery.subscribe(()=>{this.changeDisplayFlag(),this.filteredPortfolioItems=Object(g.a)(this.portfolioItems),this.filteredPortfolioItems=this.filteredPortfolioItems.filter(e=>!(""!==this.selectedCurrency&&("GBP"!==this.selectedCurrency||"GBP"!==e.currency&&"GBX"!==e.currency)&&e.currency!==this.selectedCurrency||""!==this.selectedExchange&&(e.exchange===M.q.KLSE?M.q.BURSA:e.exchange)!==this.selectedExchange))}),this.searchByAccountQuery.subscribe(()=>{this.changeDisplayFlag(),this.filteredPortfolioItems=Object(g.a)(this.portfolioItems),this.filteredPortfolioItems=this.filteredPortfolioItems.filter(e=>(e.currency===this.selectedCurrency||""===this.selectedCurrency)&&((e.exchange===M.q.KLSE?M.q.BURSA:e.exchange)===this.selectedExchange||""===this.selectedExchange)&&(e.refno.includes(this.selectedAccount)||""===this.selectedAccount))})}get isFactsetGsa(){return this.factsetGsaConfigService.isFactsetGsaEnabledSync}ngOnInit(){this.accountRestService.getFactsheetRevampEnabledProperties().subscribe(e=>{!0===(null==e?void 0:e.data)&&(this.isNewOrderpadEnabled=!0)}),this.tradableRefno=this.accountService.getTradableAccountRefno,this.getCdsAccountDetails(),this.changeDisplayFlag(),this.readWatchList(),[{exchanges:[M.q.BURSA],liveStreaming:this.liveFeedService.checkStreaming(M.q.BURSA)},{exchanges:[M.q.NASDAQ,M.q.NYSE,M.q.AMEX,M.q.BATS],liveStreaming:this.liveFeedService.checkStreaming(M.q.AMEX)},{exchanges:[M.q.SGX],liveStreaming:this.liveFeedService.checkStreaming(M.q.SGX)},{exchanges:[M.q.HKEX],liveStreaming:this.liveFeedService.checkStreaming(M.q.HKEX)},{exchanges:[M.q.LSE],liveStreaming:this.liveFeedService.checkStreaming(M.q.LSE)},{exchanges:[M.q.SSE],liveStreaming:this.liveFeedService.checkStreaming(M.q.SSE)},{exchanges:[M.q.SZSE],liveStreaming:this.liveFeedService.checkStreaming(M.q.SZSE)}].forEach(e=>
5{e.exchanges.forEach(t=>{e.liveStreaming?this.livePermissions.push(t):this.delayedPermissions.push(t),t===M.q.HKEX&&(this.isHkexLivestreaming=e.liveStreaming)})})}ngOnChanges(e){var t,n,i;(null===(t=null==e?void 0:e.selectedStockOption)||void 0===t?void 0:t.currentValue)===d.c.PORTFOLIO&&(this.selectedExchange="",this.selectedCurrency="",this.readPortfolio()),this.subHandlingService.once(Object(ht.a)([this.getW8BenDetails(),this.getBcanView()]).pipe(Object(y.a)(e=>{var t,n;e[0].status===M.a.RESPONSE_SUCCESS&&(this.w8BenStatus=null===(t=e[0].data)||void 0===t?void 0:t.w8Status,this.w8ExpiryDate=null===(n=e[0].data)||void 0===n?void 0:n.w8ExpiryDate),e[1].status===M.a.RESPONSE_SUCCESS&&(this.bcanViewModel=e[1].data)}))),this.getW8BenDetails().subscribe(e=>{var t,n;e.status===M.a.RESPONSE_SUCCESS&&(this.w8BenStatus=null===(t=e.data)||void 0===t?void 0:t.w8Status,this.w8ExpiryDate=null===(n=e.data)||void 0===n?void 0:n.w8ExpiryDate)}),(null===(n=null==e?void 0:e.cdsAccountReactivateSuccess)||void 0===n?void 0:n.currentValue)&&(this.getCdsAccountDetails(),(null===(i=null==e?void 0:e.cdsAccountPendingTrigger)||void 0===i?void 0:i.currentValue)&&(this.cdsModalVisible=!0))}ngOnDestroy(){var e;this.unsubscribePriceQuote(),this.unsubscribeSelectedStockPriceQuote(),this.unsubscribeTimeAndSalesAndMarketDepth(),this.unsubscribeSnapOnly(),null===(e=this.snapStocksSubscription)||void 0===e||e.unsubscribe()}readWatchList(){this.subHandlingService.once(this.watchlistRestService.findWatchlistByAccountId().pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e.status&&e.data&&(this.stockWatchLists=Object(g.a)(e.data))})))}tableSort(e){let t=Object(g.a)(this.filteredPortfolioItems);if(!e.value)return this.tableSortKey={key:"name",value:"ascend"},void(this.filteredPortfolioItems=Object(Ov.c)(this.tableSortKey,t));this.tableSortKey=Object(g.a)(e),t.forEach(e=>{e.unrealisedPL=(e.lastPrice-e.avgPrice)*e.totalQty,e.unrealisedPLInLocalCurrency=(e.lastPriceInLocalCurrency-e.avgPriceInLocalCurrency)*e.totalQty}),this.selectedCurrencyOption===this.displayOptions[1].value?"avgPrice"!==e.key&&"cost"!==e.key&&"lastPrice"!==e.key&&"marketValue"!==e.key&&"unrealisedPL"!==e.key||(t=Object(Ov.c)(e,t),e.key="currency"):"avgPrice"===e.key?e.key="avgPriceInLocalCurrency":"cost"===e.key?e.key="costInLocalCurrency":"lastPrice"===e.key?e.key="lastPriceInLocalCurrency":"marketValue"===e.key?e.key="marketValueInLocalCurrency":"unrealisedPL"===e.key?e.key="unrealisedPLInLocalCurrency":"investmentAcctType"===e.key&&(e.key="investmentAcctType"),this.filteredPortfolioItems=Object(Ov.c)(e,t)}showTransactionPreviewModal(e){this.transactionPreviewData.qty=e.qty,this.transactionPreviewData.lotSize=e.lotSize,this.transactionPreviewData.price=e.price,this.transactionPreviewData.expireDate=e.expireDate,this.transactionPreviewData.validity=e.validity,this.transactionPreviewData.nextScheduledSellDate=e.nextScheduledSellDate,this.isScheduledSellOrder=e.isScheduledSellOrder,this.isModifyOrder=e.isModifyOrder,this.selectedTransactionType=e.transactionType,this.transactionPreviewData.originalNetAmount=e.originalNetAmount,this.transactionPreviewData.nextScheduledSellDate=e.nextScheduledSellDate,this.selectedStock.orderId=e.orderId,this.transactionPreviewData.orderType=e.orderType,this.transactionPreviewData.timeInForce=e.timeInForce,this.transactionPreviewData.stopPx=e.stopPx,this.transactionPreviewData.previewMarginOrder=e.previewMarginOrder,this.marketOrderTypeSelected=e.orderType===this.MARKET_ORDER.value&&e.timeInForce===this.MARKET_ORDER.timeInForce?this.MARKET_ORDER.label:e.orderType===this.MARKET_ORDER.value&&e.timeInForce===this.MARKET_TO_LIMIT_ORDER.timeInForce?M.q.US_EXCHANGES.includes(this.selectedStock.exchange)?this.MARKET_ORDER.label:this.MARKET_TO_LIMIT_ORDER.label:"",this.transactionPreviewVisible=!0}onCloseModal(){this.portfolioItems.map(e=>e.action=null),this.filteredPortfolioItems.map(e=>e.action=null)}readPortfolio(e){e&&(this.selectedExchange="",this.selectedCurrency=""),this.portfolioTableLoading=!0,this.portfolioService.readPortfolio(this.accountService.getTradableAccountRefno,M.q.allExchangeStr()).subscribe(e=>{this.portfolioItems=e.data,this.exchangeList=Object(kv.a)(e.data.map(e=>({label:e.exchange===M.q.KLSE?M.q.KLSE:e.exchange,value:e.exchange===M.q.KLSE?M.q.BURSA:e.exchange})),"value"),this.initCurrencyList(),this.subscribeLightStreamer(),this.portfolioItems=Object(Ov.c)({key:"name",value:"ascend"},this.portfolioItems),this.filteredPortfolioItems=this.portfolioItems,this.searchValue&&(this.selectedCurrency="",this.selectedExchange="",this.filteredPortfolioItems=this.filteredPortfolioItems.filter(e=>!!(null!==e.shortName&&e.shortName.toLowerCase().includes(this.searchValue.toLowerCase())||null!==e.name&&e.name.toLowerCase().includes(this.searchValue.toLowerCase())||null!==e.code&&e.code.toLowerCase().includes(this.searchValue.toLowerCase())))),this.updatePortfolioSummary(),this.portfolioTableLoading=!1})}refreshPortfolio(e){e?setTimeout(()=>{this.readPortfolio()},3e3):this.readPortfolio()}search(){this.searchQuery.next(this.searchValue)}searchByExchange(){this.searchByExchangeQuery.next(),this.tableSortKey&&this.tableSort(this.tableSortKey)}searchByCurrency(){this.searchByCurrenyQuery.next(),this.tableSortKey&&this.tableSort(this.tableSortKey)}searchByAccount(){this.searchByAccountQuery.next(),this.tableSortKey&&this.tableSort(this.tableSortKey)}onSearchClear(){this.searchValue="",this.search()}getTradingInfo(e){return Object(SM.a)(null==e?void 0:e.tradingInfo,null==e?void 0:e.exchange)}findStockPosition(e){const t=e.split("-")[2];for(let n=0;n<this.portfolioItems.length;n++)if(t===this.portfolioItems[n].symbol)return n;return-1}findFilteredStockPosition(e){const t=e.split("-")[2];for(let n=0;n<this.filteredPortfolioItems.length;n++)if(t===this.filteredPortfolioItems[n].symbol)return n;return-1}isZeroPriceValue(e){const t=parseFloat(e);return!isNaN(t)&&0===t}resolveEffectivePrice(e,t){return e&&!this.isZeroPriceValue(e)?e:t&&!this.isZeroPriceValue(t)?t:null}applyLastPrice(e,t,n){const i=n?new iw.a(t).div(M.q.LSE_GBX_TO_GBP_MULTIPLIER):null;e.lastPrice=i?i.toNumber():parseFloat(t),e.marketValue=i?i.mul(e.totalQty).toNumber():parseFloat(t)*e.totalQty,e.lastPriceInLocalCurrency=i?i.mul(e.fxRate).toNumber():parseFloat(t)*e.fxRate,e.marketValueInLocalCurrency=e.lastPriceInLocalCurrency*e.totalQty}subscribeLightStreamer(){this.unsubscribePriceQuote(),this.unsubscribeSnapOnly();const e=this;let t=[];[{key:"symbol",colName:"Symbol",checked:!1}
5,{key:"exchange",colName:"Exch",checked:!1},{key:"stockCode",colName:"Stock Code",checked:!1},{key:"level",colName:"Level",checked:!1},{key:"tickerNo",colName:"Ticker No",checked:!1},{key:"stockName",colName:"Stock Name",checked:!0},{key:"currency",colName:"Currency",checked:!1},{key:"lotSize",colName:"Lot Size",checked:!1},{key:"productType",colName:"Product Type",checked:!1},{key:"lastPrice",colName:"Last Price",checked:!0},{key:"lastVolume",colName:"Last Volume",checked:!1},{key:"cumulativeVolume",colName:"Cumulative Volume",checked:!1},{key:"bidPrice",colName:"Bid Price",checked:!0,disabled:!0},{key:"bidQuantity",colName:"Bid Quantity",checked:!0},{key:"askPrice",colName:"Ask Price",checked:!0,disabled:!0},{key:"askQuantity",colName:"Ask Quantity",checked:!0},{key:"openPrice",colName:"Open Price",checked:!0},{key:"closePrice",colName:"Close Price",checked:!1},{key:"dayHigh",colName:"Day High",checked:!1},{key:"dayLow",colName:"Day Low",checked:!1},{key:"change",colName:"Change",checked:!0},{key:"changePercentage",colName:"Change Percentage",checked:!1},{key:"tradingStatus",colName:"Trading Status",checked:!1},{key:"suspension",colName:"Suspension",checked:!1},{key:"updateTime",colName:"Update Time",checked:!1},{key:"remark",colName:"Remark",checked:!1},{key:"tacPrice",colName:"Tac Price",checked:!1},{key:"sentiment",colName:"Sentiment",checked:!0}].forEach(e=>{t.push(e.key)}),t.push("tradingInfo"),this.portfolioItems&&this.portfolioItems.length>0&&this.portfolioItems.forEach(e=>{e.sedolnumber=e.exchange+":"+e.code}),this.tempSubPriceQuote=this.liveFeedService.subscribePriceQuote(this.lsClient,t,this.portfolioItems),this.tempSubPriceQuote.forEach(t=>{t&&t.addListener({onItemUpdate:t=>{this.lightStreamerChanges=this.lightStreamerHelperService.mapPriceQuoteInfo(t,this.PRICE_QUOTE_FIELDS);let n=this.findStockPosition(t.getItemName()),i=this.findFilteredStockPosition(t.getItemName());if(-1!==n){let c=this.portfolioItems[n].exchange===M.q.HKEX;if(!this.isHkexLivestreaming&&c&&!this.handleSnapDataForPositionStock(this.portfolioItems[n].symbol))return;let o=!1;if("GBX"===t.getValue("currency")&&(o=!0),t.forEachChangedField((t,c,s)=>{"lastPrice"!==t&&("askPrice"!==t&&"bidPrice"!==t&&"closePrice"!==t&&"openPrice"!==t&&"dayHigh"!==t&&"dayLow"!==t&&"change"!==t||!s||"0.00"===s?(this.portfolioItems[n][t]=s||this.portfolioItems[n][t],this.filteredPortfolioItems[i][t]=s||this.portfolioItems[n][t]):(this.portfolioItems[n][t]=s?o?new iw.a(s).div(M.q.LSE_GBX_TO_GBP_MULTIPLIER).toNumber():parseFloat(s):this.portfolioItems[n][t],this.filteredPortfolioItems[i][t]=s?o?new iw.a(s).div(M.q.LSE_GBX_TO_GBP_MULTIPLIER).toNumber():parseFloat(s):this.portfolioItems[n][t])),"exchange"===t&&(s=s===M.q.BURSA?M.q.KLSE:s),"currency"===t&&(s=s===e.CNH?e.CNY:s,this.portfolioItems[n].exchange!==M.q.SSE&&this.portfolioItems[n].exchange!==M.q.SZSE||(this.portfolioItems[n].currency=e.CNY),this.filteredPortfolioItems[i].exchange!==M.q.SSE&&this.filteredPortfolioItems[i].exchange!==M.q.SZSE||(this.filteredPortfolioItems[i].currency=e.CNY))}),t.isValueChanged("lastPrice")||t.isValueChanged("closePrice")){const c=this.resolveEffectivePrice(t.getValue("lastPrice"),t.getValue("closePrice"));c&&(this.applyLastPrice(this.portfolioItems[n],c,o),-1!==i&&this.applyLastPrice(this.filteredPortfolioItems[i],c,o),e.updatePortfolioSummary())}}else{let n=[];t.forEachChangedField((e,t,i)=>{const c=this.PRICE_QUOTE_FIELDS.indexOf(e);n[c]=i}),e.updatePortfolioSummary();let i=n.exchange===M.q.HKEX,c=null;!this.isHkexLivestreaming&&i&&(c=this.handleSnapDataForNoPositionStock(this.lightStreamerHelperService.mapPriceQuoteInfo(n,this.PRICE_QUOTE_FIELDS)),c&&this.portfolioItems.push(c)),c||this.portfolioItems.push(this.lightStreamerHelperService.mapPriceQuoteInfo(n,this.PRICE_QUOTE_FIELDS)),this.ref.markForCheck()}console.log("Portfolio Items after subscribed to price quote = ",this.portfolioItems),console.log("Temp sub price quote = ",this.tempSubPriceQuote),this.ref.detectChanges(),this.liveStreamDate=new Date}})})}listenToSnapChange(){this.snapStocksSubscription=this.liveFeedService.getSnapStocksObservable().subscribe(e=>{if(e&&0!=e.size)for(const[t,n]of e.entries()){let e=this.portfolioItems.filter(e=>e.symbol===t).length>0,i=this.filteredPortfolioItems.filter(e=>e.symbol===t).length>0;e&&n.endSnapDate>Date.now()&&this.patchPortfolioItemFromSnapResult({[t]:n},t),i&&n.endSnapDate>Date.now()&&this.patchFilterPortfolioItemFromSnapResult({[t]:n},t),this.updatePortfolioSummary()}})}handleSnapDataForNoPositionStock(e){let t=this.liveFeedService.getSnapStocks(e.symbol);if(t){const n=Date.now();if(t.lastSnapDate&&t.endSnapDate>n)return Object.assign(Object.assign({},e),t)}return null}handleSnapDataForPositionStock(e){let t=this.liveFeedService.getSnapStocks(e);if(t){const n=Date.now();if(t.lastSnapDate&&t.endSnapDate>n){let n=this.portfolioItems.filter(t=>t.symbol===e).length>0,i=this.filteredPortfolioItems.filter(t=>t.symbol===e).length>0;return n&&t.endSnapDate>Date.now()&&this.patchPortfolioItemFromSnapResult({[e]:t},e),i&&t.endSnapDate>Date.now()&&this.patchFilterPortfolioItemFromSnapResult({[e]:t},e),!1}}return!0}snapSingleData(e){let t=this.liveFeedService.constructMessage(wg.a.PRICE,this.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20",n=new lm.a(n=>{this.liveFeedService.subscribeSnap(this.lsClient,t,n,e.exchange)}).subscribe(t=>{var i;if(n.unsubscribe(),!t)return;const c=JSON.parse(t.updateValues[3]);e.exchange===M.q.HKEX&&(c[e.symbol].lastSnapDate=c[e.symbol].updateTime,(null===(i=c[e.symbol])||void 0===i?void 0:i.updateTime)&&(c[e.symbol].endSnapDate=Number(c[e.symbol].updateTime)+9e5)),this.liveFeedService.storeSnapStocks(e.symbol,c[e.symbol]),c[e.symbol].lastPrice&&0!=parseFloat(c[e.symbol].lastPrice)&&(this.patchPortfolioItemFromSnapResult(c,e.symbol),this.patchFilterPortfolioItemFromSnapResult(c,e.symbol)),this.updatePortfolioSummary()})}displaySnapInfo(e){return!(!e.endSnapDate||e.endSnapDate<(new Date).getTime())}displayInfoInDrawer(e){this.drawerService.create({nzPlacement:"bottom",nzContent:e})}patchPortfolioItemFromSnapResult(e,t){var n,i;let c=this.portfolioItems,o=c.findIndex(e=>e.symbol===t);c[o].lastPrice=parseFloat(e[t].lastPrice),c[o].changePercentage=parseFloat(e[t].changePercentage),c[o].change=parseFloat(e[t].change),c[o].dayHigh=parseFloat(e[t].dayHigh),c[o].dayLow=parseFloat(e[t].dayLow),c[o].openPrice=parseFloat(e[t].openPrice),c[o].cumulativeVolume=parseFloat(e[t].cumulativeVolume),c[o].marketValue=parseFloat(e[t].lastPrice)*c[o].totalAvailableQty,c[o].lastPriceInLocalCurrency=parseFloat(e[t].lastPrice)*c[o].fxRate,c[o].marketValueInLocalCurrency=c[o].lastPriceInLocalCurrency*c[o].totalAvailableQty,(null===(n=c[o])||void 0===n?void 0:n.exchange)===M.q.HKEX&&(c[o].lastSnapDate=e[t].updateTime,(null===(i=e[t])||void 0===i?void 0:i.updateTime)&&(c[o].endSnapDate=Number(e[t].updateTime)+9e5))}patchFilterPortfolioItemFromSnapResult(e,t){var n,i;let c=this.filteredPortfolioItems,o=c.findIndex(e=>e.symbol===t);c[o].lastPrice=parseFloat(e[t].lastPrice),c[o].changePercentage=parseFloat(e[t].changePercentage),c[o].change=parseFloat(e[t].change),c[o].dayHigh=parseFloat(e[t].dayHigh),c[o].dayLow=parseFloat(e[t].dayLow),c[o].openPrice=parseFloat(e[t].openPrice),c[o].cumulativeVolume=parseFloat(e[t].cumulativeVolume),c[o].marketValue=parseFloat(e[t].lastPrice)*c[o].totalAvailableQty,c[o].lastPriceInLocalCurrency=parseFloat(e[t].lastPrice)*c[o].fxRate,c[o].marketValueInLocalCurrency=c[o].lastPriceInLocalCurrency*c[o].totalAvailableQty,(null===(n=c[o])||void 0===n?void 0:n.exchange)===M.q.HKEX&&(c[o].lastSnapDate=e[t].updateTime,(null===(i=e[t])||void 0===i?void 0:i.updateTime)&&(c[o].endSnapDate=Number(e[t].updateTime)+9e5))}snapSelectedStock(e){let t=this.liveFeedService.constructMessage(wg.a.PRICE,this.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20",n=new lm.a(n=>{this.liveFeedService.subscribeSnap(this.lsClient,t,n,e.exchange)}).subscribe(t=>{var i,c;if(n.unsubscribe(),!t)return;const o=JSON.parse(t.updateValues[3]);this.selectedStock.lastPrice=parseFloat(o[e.symbol].lastPrice),this.selectedStock.changePercentage=parseFloat(o[e.symbol].changePercentage),this.selectedStock.change=parseFloat(o[e.symbol].change),this.selectedStock.dayHigh=parseFloat(o[e.symbol].dayHigh),this.selectedStock.dayLow=parseFloat(o[e.symbol].dayLow),this.selectedStock.openPrice=parseFloat(o[e.symbol].openPrice),this.selectedStock.cumulativeVolume=parseFloat(o[e.symbol].cumulativeVolume),(null===(i=this.selectedStock)||void 0===i?void 0:i.exchange)===M.q.HKEX&&(this.selectedStock.lastSnapDate=o[e.symbol].updateTime,this.selectedStock.updateTime=o[e.symbol].updateTime,(null===(c=o[e.symbol])||void 0===c?void 0:c.updateTime)&&(this.selectedStock.endSnapDate=Number(o[e.symbol].updateTime)+9e5)),this.liveFeedService.storeSnapStocks(e.symbol,Object.assign(Object.assign({},this.selectedStock),o[e.symbol]))})}unsubscribeSnapOnly(){this.tempSnapSub&&(this.lsClient.unsubscribe(this.tempSnapSub),this.tempSnapSub.getListeners().forEac
5h(e=>{this.tempSnapSub.removeListener(e)}),this.tempSnapSub=null)}updatePortfolioSummary(){this.calculateTotalInvestment(),this.calculateTotalCurrentValue(),this.calculateTotalProfitLoss(),this.calculateTotalProfitLossPercentage()}calculateTotalInvestment(){let e=0;this.portfolioItems&&this.portfolioItems.length>0&&this.portfolioItems.forEach(t=>{e+=t.cost*t.fxRate}),this.totalInvestmentValue=e}calculateTotalCurrentValue(){let e=0;this.portfolioItems&&this.portfolioItems.length>0&&this.portfolioItems.forEach(t=>{e+=0!=t.lastPrice&&t.lastPrice?(t.lastPrice?t.lastPrice:0)*t.fxRate*t.totalQty:(t.closePrice?t.closePrice:0)*t.fxRate*t.totalQty}),this.totalCurrentValue=e}calculateTotalProfitLoss(){this.totalProfitAndLossValue=this.totalCurrentValue-this.totalInvestmentValue}calculateTotalProfitLossPercentage(){this.totalProfitAndLossPercentageValue=0,this.totalInvestmentValue&&(this.totalProfitAndLossPercentageValue=(this.totalCurrentValue-this.totalInvestmentValue)/this.totalInvestmentValue*100)}calculateTotalSelectedCurrencyCurrentValue(){let e=0;this.portfolioItems&&this.portfolioItems.length>0&&this.portfolioItems.forEach(t=>{t.exchange===this.selectedExchange&&t.currency===this.selectedCurrency&&(e+=0!=t.lastPrice&&t.lastPrice?(t.lastPrice?t.lastPrice:0)*t.totalQty:(t.closePrice?t.closePrice:0)*t.totalQty)}),this.totalSelectedCurrencyCurrentValue=e}calculateTotalSelectedCurrencyProfitLoss(){let e=0;this.portfolioItems&&this.portfolioItems.length>0&&this.portfolioItems.forEach(t=>{t.exchange===this.selectedExchange&&t.currency===this.selectedCurrency&&(e+=0!=t.lastPrice&&t.lastPrice?((t.lastPrice?t.lastPrice:0)-t.avgPrice)*t.totalQty:((t.closePrice?t.closePrice:0)-t.avgPrice)*t.totalQty)}),this.totalSelectedCurrencyProfitAndLossValue=e}showTransactionModal(e,t){e.exchange!==M.q.USOTC?(this.selectedStock=e,this.selectedStock.ordPrice="",this.selectedTransactionType=t,this.checkW8BenForm(this.selectedStock)?this.checkChinaTrade()?this.selectedStock.exchange!==this.SSE&&this.selectedStock.exchange!==this.SZSE||this.bcanViewModel&&"Y"===this.bcanViewModel.bcanFlag?this.checkFepAgreemeent(this.selectedStock)?this.selectedStock.exchange===this.KLSE&&this.checkKlseLeveragedInverse(this.selectedStock)?this.preHandleKlseLeveragedInverseStock():this.handleModalVisiblePost():(this.transactionModalVisible=!1,this.visibleFepAgreement=!0):(this.transactionModalVisible=!1,this.showBcanApplicationRedirrectModel()):(this.transactionModalVisible=!1,this.chinaTradeNotAvailableModalVisible=!0):(this.transactionModalVisible=!1,this.showW8BenFormErrorModel())):this.modal.error({nzTitle:"US OTC",nzContent:"To sell US over-the-counter (OTC) shares, kindly call our dealing hotline at +603-2149 0619.",nzOkText:"Ok",nzMaskClosable:!0,nzOnOk:()=>{this.onCloseModal(),this.modal.closeAll()}})}handleModalVisiblePost(){var e,t;this.selectedStock.exchange!==this.KLSE||this.cdsStatus!==this.cdsStatusConstant[1]&&this.cdsStatus!==this.cdsStatusConstant[2]?(this.isAcctAllowScheduledSell&&(this.getEnabledProduct(this.selectedStock),this.checkIsScheduledSellOrderExist(this.selectedStock)),this.selectedStock.ordPrice=this.selectedTransactionType?parseFloat(null===(e=this.selectedStock)||void 0===e?void 0:e.askPrice):parseFloat(null===(t=this.selectedStock)||void 0===t?void 0:t.bidPrice),this.getGeneralFeeDetails(this.selectedStock.stockCode,this.selectedStock.exchange),this.selectedStock.exchange!==M.q.KLSE&&this.selectedStock.exchange!==M.q.BURSA||this.handleSelectedStockForMarketDepth(this.selectedStock),this.stocksFactsheetRestService.readStocksTickerAndPriceInfo(this.selectedStock.stockCode,this.selectedStock.exchange===M.q.BURSA?M.q.KLSE:this.selectedStock.exchange).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data&&e.data.priceQuote&&e.data.priceQuote[0]&&(this.priceQuote=e.data.priceQuote[0])}),this.transactionModalVisible=!0):this.cdsModalVisible=!0}showAddToWatchlistModal(e){this.selectedStock=e,this.addToWatchlistModalVisible=!0}handleTransactionModalVisible(e){this.transactionModalVisible=e,this.onCloseModal()}handleTransactionPreviewModalVisible(e){this.transactionPreviewVisible=e,this.onCloseModal()}handleTransactionPreviewModalBack(e){this.selectedStock.qty=this.transactionPreviewData.qty,this.selectedTransactionType?this.selectedStock.askPrice=this.transactionPreviewData.price:this.selectedStock.bidPrice=this.transactionPreviewData.price,this.selectedStock.ordPrice=this.transactionPreviewData.price,this.marketOrderTypeSelected===this.MARKET_ORDER.label?(this.selectedStock.orderType=this.MARKET_ORDER.value,this.selectedStock.timeInForce=this.MARKET_ORDER.timeInForce):this.marketOrderTypeSelected===this.MARKET_TO_LIMIT_ORDER.label?(this.selectedStock.orderType=this.MARKET_ORDER.value,this.selectedStock.timeInForce=this.MARKET_TO_LIMIT_ORDER.timeInForce):(this.selectedStock.orderType="",this.selectedStock.timeInForce=this.transactionPreviewData.validity),this.transactionPreviewVisible=e,this.transactionModalVisible=!0,this.onCloseModal()}handleAddToWatchListModalVisible(e){this.addToWatchlistModalVisible=e,this.onCloseModal()}unsubscribeTimeAndSalesAndMarketDepth(){this.tempSubMarketDepth.length>
50&&(this.tempSubMarketDepth.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubMarketDepth=[]),this.marketDepthDataBid=[],this.marketDepthDataAsk=[]}unsubscribePriceQuote(){this.tempSubPriceQuote.length>0&&(this.tempSubPriceQuote.forEach(e=>{e&&this.lsClient.unsubscribe(e)}),this.tempSubPriceQuote=[])}unsubscribeSelectedStockPriceQuote(){this.subSelectedStock&&(this.lsClient.unsubscribe(this.subSelectedStock),this.subSelectedStock=null)}isConvertFieldRequired(e,t){return!("lastPrice"!==e&&"bidPrice"!==e&&"askPrice"!==e&&"openPrice"!==e&&"closePrice"!==e&&"dayHigh"!==e&&"dayLow"!==e&&"change"!==e||!t)}patchFromExistingSnap(){console.log(this.selectedStock);let e=this.liveFeedService.getSnapStocks(this.selectedStock.symbol);return e&&e.endSnapDate>(new Date).getTime()?(this.mapDesiredDataFromSnap(this.selectedStock,e),!1):(e&&e.endSnapDate<=(new Date).getTime()&&this.liveFeedService.removeSnapStock(this.selectedStock.symbol),!0)}mapDesiredDataFromSnap(e,t){e.lastPrice=parseFloat(t.lastPrice),e.changePercentage=parseFloat(t.changePercentage),e.change=parseFloat(t.change),e.dayHigh=parseFloat(t.dayHigh),e.dayLow=parseFloat(t.dayLow),e.openPrice=parseFloat(t.openPrice),e.cumulativeVolume=parseFloat(t.cumulativeVolume),e.lastSnapDate=t.updateTime,e.updateTime=t.updateTime}handleSelectedStockForPriceQuote(e){this.unsubscribeSelectedStockPriceQuote();let t=this;e.stockCode=e.stockCode?e.stockCode:e.code,e.sedolnumber=e.exchange+":"+e.stockCode;const n=this.liveFeedService.subscribePriceQuote(this.lsClient,this.PRICE_QUOTE_FIELDS,[e]);if(!n||0===n.length)return;this.subSelectedStock=n[0];let i=!0;this.subSelectedStock.addListener({onItemUpdate:e=>{let n=[],c={};if(!this.patchFromExistingSnap())return;let o="GBX"===e.getValue("currency");e.forEachChangedField((e,i,s)=>{const a=this.PRICE_QUOTE_FIELDS.indexOf(e);let l=s;isNaN(s)||"stockCode"===e||(s=parseFloat(s)),this.isConvertFieldRequired(e,o)&&s&&(l=parseFloat(s)/M.q.LSE_GBX_TO_GBP_MULTIPLIER),n[a]=l,"exchange"===e&&(n[a]=l===M.q.BURSA?M.q.KLSE:l),"currency"===e&&(n[a]=l===t.CNH?M.q.CNY:l),c[e]=n[a]}),t.transactionModalVisible&&!i?Object.assign(t.selectedStock,c):(t.selectedStock=Object.assign(Object.assign({},t.selectedStock),c),i=!1),this.ref.markForCheck()}})}handleSelectedStockForMarketDepth(e){this.unsubscribeTimeAndSalesAndMarketDepth(),this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.selectedStockForMarketDepth=e;const t=this.liveFeedService.checkLiveStreamingMarketDepth(e.exchange);let n=this.liveFeedService.subscribeMarketDepth(this.lsClient,this.MARKET_DEPTH_FIELDS,e,t);null!=n&&(this.tempSubMarketDepth.push(n),this.tempSubMarketDepth.forEach(t=>{t.addListener({onItemUpdate:t=>{let n=[],i=parseInt(this.liveFeedService.checkLiveStreamingMarketDepth(e.exchange));"bid"===t.updateValues[6]&&"ADD"===t.updateValues[12]?(n=this.marketDepthDataBid.length>=i?[]:Object(g.a)(this.marketDepthDataBid),n.push(t.updateValues),this.marketDepthDataBid=Object(g.a)(n)):"ask"===t.updateValues[6]&&"ADD"===t.updateValues[12]?(n=this.marketDepthDataAsk.length>=i?[]:Object(g.a)(this.marketDepthDataAsk),n.push(t.updateValues),this.marketDepthDataAsk=Object(g.a)(n)):"bid"===t.updateValues[6]&&"UPDATE"===t.updateValues[12]?(n=Object(g.a)(this.marketDepthDataBid),n[parseInt(t.updateValues[11])]=t.updateValues,this.marketDepthDataBid=Object(g.a)(n)):"ask"===t.updateValues[6]&&"UPDATE"===t.updateValues[12]&&(n=Object(g.a)(this.marketDepthDataAsk),n[parseInt(t.updateValues[11])-i]=t.updateValues,this.marketDepthDataAsk=Object(g.a)(n)),this.ref.markForCheck()}})}))}handleSelectedTransactionType(e){this.selectedTransactionType=e}getFeeOrder(e,t){if(!isNaN(e.price)&&!isNaN(e.quantity)&&e.stockCode){this.feeDetailStatus=Ev.a.LOADING,M.q.LSE_GBX_CURRENCY===this.selectedStock.currency&&(e.price=e.price/M.q.LSE_GBX_TO_GBP_MULTIPLIER);let i=t?this.scheduledSellRestService.getScheduledSellFee(e):this.stockInfoRestService.getFeeNewOrder(e);try{this.subHandlingService.once(Object(ht.a)([i]).pipe(Object(y.a)(e=>{(e[0].success||e[0].status===Fv.a.SUCCESS)&&(e[0].data.tradingReference=t?M.q.SCHEDULED_SELL:null,this.feeDetail=Object(g.a)(e[0].data),this.feeDetailStatus=Ev.a.COMPLETED,this.addSstToFeeDetails(this.feeDetail))})))}catch(n){console.error(n),this.feeDetailStatus=Ev.a.ERROR}}}getFee(e){null==e.orderType||null!=e.orderType&&e.orderType===this.MARKET_ORDER.value||e.orderType===this.STOP_ORDER.value||e.orderType===this.STOP_LIMIT_ORDER.value?this.getFeeOrder(e,!1):(e.orderType=null,this.getFeeOrder(e,!0))}onAppBarBack(){}navigateToTransactionHistory(e){console.log("Navigate to Transaction History: "+JSON.stringify(e));const t=this.router.createUrlTree([M.o.APP,M.o.HOLDINGS,M.o.DETAILS
5],{queryParams:{refno:this.accountService.getTradableAccountRefno,id:e.tickerNo,code:e.code,type:(null==e?void 0:e.productType)===r.b.ETF||"ETF"===(null==e?void 0:e.securityType)?cw.a.ETFS:cw.a.STOCKS,exchange:e.exchange,payment:"cheque"}});Object(pt.a)(t),setTimeout(()=>{this.onCloseModal()})}onChangeAction(e,t){"transactionHistory"===e?this.navigateToTransactionHistory(t):"buy"===e?this.showTransactionModal(t,!0):"sell"===e?this.showTransactionModal(t,!1):"watchlist"===e&&this.showAddToWatchlistModal(t),this.setPortfolioMobileActionVisible()}navigateToStocksFactsheet(e,t,n,i){let c;"BURSA"===t&&(t="KLSE"),c="ETF"==i?Object(mt.f)(r.b.ETF,n,"",e,t):Object(mt.f)(r.b.STOCK_AND_ETF,n,"",e,t),Object(pt.a)(c.route,c.params)}setPortfolioMobileActionVisible(e){e&&(e.investmentAccount=this.accountService.primaryAccount.refno+" - "+this.accountService.primaryAccount.nricName,this.selectedPortfolioMobileData=e),this.portfolioMobileActionVisible=!this.portfolioMobileActionVisible}changeDisplayFlag(){this.tableSortKey&&this.tableSort(this.tableSortKey),this.calculateTotalSelectedCurrencyCurrentValue(),this.calculateTotalSelectedCurrencyProfitLoss(),this.selectedCurrencyOption===this.displayOptions[1].value&&this.selectedCurrency&&""!==this.selectedExchange?this.showTotalFlag=!0:this.selectedCurrencyOption===this.displayOptions[0].value?(this.selectedCurrency="",this.showTotalFlag=!1):this.showTotalFlag=!1}initCurrencyList(){this.currencyList=[];const e=this.portfolioItems.map(e=>e.currency).filter((e,t,n)=>n.indexOf(e)===t);this.currencyList=this.currencyList.concat(e)}isHKEXStockExist(){return null!=this.filteredPortfolioItems.find(e=>e.exchange===M.q.HKEX)}onSelectStockInfoRow(e){e.exchange===M.q.BURSA&&(e.exchange=M.q.KLSE),e.exchange===M.q.HKEX&&(e.stockCode=e.code),this.selectedItem=e,this.showMarketDepth()}showMarketDepth(){this.emitMarketDepthAction.emit(this.selectedItem)}getEnabledProduct(e){this.scheduledSellRestService.getEnabledProduct(e.code,e.exchange).subscribe(e=>{this.rspEtfProductInfo=e.data})}checkIsScheduledSellOrderExist(e){this.scheduledSellRestService.checkIsScheduledSellOrderExist(this.accountService.getTradableAccountRefno,e.code,e.exchange).subscribe(e=>{(e.success||e.status===Fv.a.SUCCESS)&&(null!=e.data?(this.selectedStock.ordId=e.data.orderId,this.selectedStock.ordType=e.data.ordType,this.selectedStock.ordQty=e.data.ordQty,this.selectedStock.expiredDate=e.data.expiredDate,this.selectedStock.remainingQty=e.data.remainingQty,this.isScheduledSellOrderExist=!0):this.isScheduledSellOrderExist=!1)})}handleIsModifyOrder(e){this.selectedStock.qty=null,this.isModifyOrder=e}isNzOptionVisible(e,t){switch(t){case"buy":return!(e.delisted||((null==e?void 0:e.exchange)===this.SSE||(null==e?void 0:e.exchange)===this.SZSE)&&!this.getTradingInfo(e).buy||(null==e?void 0:e.exchange)===this.USOTC);case"sell":return!(e.delisted||((null==e?void 0:e.exchange)===this.SSE||(null==e?void 0:e.exchange)===this.SZSE)&&!this.getTradingInfo(e).sell);case"watchlist":return(null==e?void 0:e.exchange)!==this.USOTC;default:return!0}}isOtc(e){return e.exchange===this.USOTC}isPortfolioContainOtc(){return this.portfolioItems.some(e=>e.exchange===this.USOTC)}handleSelectedInvestmentAcctType(e){this.selectedAcctType=e}handleSelectedPurchasingPowerType(e){this.selectedPurchasingPowerType=e}handleSelectedStockChange(e){e&&(!e.msInstrumentId&&e.productCode&&(e.msInstrumentId=e.productCode),this.feeDetail=null,this.feeDetailStatus=null,this.selectedExchange=e.exchange,this.handleSelectedStockForPriceQuote(e),this.showTransactionModal(e,this.selectedTransactionType))}getGeneralFeeDetails(e,t){e&&t&&this.subHandlingService.subscribe(this.stockInfoRestService.getFeeDetails(e,t).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.generalStockBuyFeeDetails=e.data.buyFeeDetails,this.generalStockSellFeeDetails=e.data.sellFeeDetails,t===M.q.HKEX&&(this.generalStockBuyFeeDetails.exchangeFees=Object(Ov.b)(this.generalStockBuyFeeDetails.exchangeFees,M.q.EXCHANGE_FEE_ORDER,"exchangeFeeName"),this.generalStockSellFeeDetails.exchangeFees=Object(Ov.b)(this.generalStockSellFeeDetails.exchangeFees,M.q.EXCHANGE_FEE_ORDER,"exchangeFeeName")),this.updateExchangeFeeNameDescMap())})))}updateExchangeFeeNameDescMap(){this.exchangeFeeNameDescMap.clear();const e=this.selectedTransactionType?this.generalStockBuyFeeDetails:this.generalStockSellFeeDetails;if(e&&e.exchangeFees){const t=new Map;
5e.exchangeFees.forEach(e=>{e.exchangeFeeName&&""!==e.exchangeFeeName&&(t.set(e.exchangeFeeName,e.feeDesc),null!=e.taxRate&&e.taxRate>0)&&t.set(e.exchangeFeeName+"_SST",e.feeDesc+" SST")}),e.taxRate&&e.taxRate>0&&t.set("COMMISSION_SST","Processing Fee SST"),this.exchangeFeeNameDescMap=new Map(t)}}addSstToFeeDetails(e){const t=this.selectedTransactionType?this.generalStockBuyFeeDetails:this.generalStockSellFeeDetails,n=[];e.feeDetails.map(e=>{const i=parseFloat(e.feeAmount);let c=0;if("COMMISSION"===e.feeName&&t.taxRate&&t.taxRate>0)c=(null==t?void 0:t.taxRate)||0;else{const n=t.exchangeFees.find(t=>t.exchangeFeeName===e.feeName);n&&n.taxRate&&n.taxRate>0&&(c=n.taxRate)}if(c>0){const t=Object(Uv.a)(i,c);n.push({currency:e.currency,feeAmount:t.toFixed(2),feeName:e.feeName+"_SST"})}}),(null==n?void 0:n.length)>0&&e.feeDetails.push(...n)}handleCdsModalOpen(e){this.cdsModalVisible=e}getCdsAccountDetails(){this.cdsAccountRestService.getCdsAccount(this.tradableRefno).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&(e.data.cdsAccountStatus&&(this.cdsStatus=e.data.cdsAccountStatus),this.hasProcessingCdsAccountReactivation=e.data.hasProcessingCdsAccountReactivation)})}handleCdsReactivation(e){this.handleCdsAccountReactivation.emit(e)}getBcanView(){return this.stockAccountRestService.getBcanIdDeclaration(this.tradableRefno)}showBcanApplicationRedirrectModel(){this.bcanRedirrectModelVisible=!0}onCloseBcanRedirrectModel(){this.bcanRedirrectModelVisible=!1}checkChinaTrade(){if(this.selectedStock.exchange===M.q.SSE||this.selectedStock.exchange===M.q.SZSE){const e=this.store.selectSnapshot(f.a.getPrimaryDisplay);if(this.CHINA===e.nationality)return!1}return!0}onCloseChinaTradeNotAvailableModel(){this.chinaTradeNotAvailableModalVisible=!1}checkFepAgreemeent(e){return!M.q.FOREIGN_EXCHANGES.includes(e.exchange)||this.store.selectSnapshot(f.a.isFepFlag)}handleFepAgreementVisible(e){this.visibleFepAgreement=e,!this.visibleFepAgreement&&this.checkFepAgreemeent(this.selectedStock)&&this.showTransactionModal(this.selectedStock,this.selectedTransactionType)}getW8BenDetails(){return this.accountRestService.getStockW8BenFormDetails(this.accountService.getTradableAccountRefno)}checkW8BenForm(e){return e.exchange!==M.q.NASDAQ&&e.exchange!==M.q.AMEX&&e.exchange!==M.q.NYSE&&e.exchange!==M.q.BATS||this.w8BenStatus==Iv.a.APPROVED&&this.w8ExpiryDate>new Date}showW8BenFormErrorModel(){this.w8BenChecked||(this.w8BenChecked=!0,this.w8BenModalRef=this.w8BenStatus===Iv.a.PENDING?this.modal.warning({nzTitle:"W-8BEN Form",nzContent:"We are currently processing your W-8Ben form to verify your non-US tax status. Note that this manual processing will be longer, all W-8Ben forms will be subjected to review and approve by FSMOne.",nzOkText:"Ok",nzMaskClosable:!0,nzWrapClassName:"vertical-center-modal",nzOnCancel:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()},nzOnOk:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()}}):this.store.selectSnapshot(f.a.getPrimaryDisplay).accountType===Nt.a.ACCOUNT_TYPE_CORPORATE?this.modal.warning({nzTitle:"W-8BEN-E Form",nzVisible:this.w8BenChecked,nzContent:"For corporate accounts, you are required to submit a copy of the W-8BEN-E Form.",nzOkText:"Ok",nzMaskClosable:!0,nzWrapClassName:"vertical-center-modal",nzOnCancel:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()},nzOnOk:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()}}):this.modal.warning({nzTitle:"W-8BEN Form",nzContent:"Please submit your W-8Ben Form to verify your non-US tax status.",nzOkText:"Redirect",nzMaskClosable:!0,nzWrapClassName:"vertical-center-modal",nzOnCancel:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close()},nzOnOk:()=>{this.w8BenChecked=!1,this.w8BenModalRef.close(),this.router.navigate([M.o.APP,M.o.ACCOUNT_UPDATE,M.o.W8_BEN_FORM])}}))}checkKlseLeveragedInverse(e){return!!this.klseLeveragedInverseStockList.find(t=>e.stockCode.toString()===t.stockCode&&e.exchange===t.exchange)}preHandleKlseLeveragedInverseStock(){this.stocksLeveragedInverseService.hasSubmittedLiDocumentOrSiDeclaration()?this.stocksLeveragedInverseService.hasAcceptedRiskAssessment()?this.handleModalVisiblePost():(this.transactionModalVisible=!1,this.checkLeverageInverseRiskAssessment=!0):(this.transactionModalVisible=!1,this.checkSiDeclaration=!0)}onSiAccepted(){this.onCloseSiModal(),this.stocksLeveragedInverseService.hasAcceptedRiskAssessment()||(this.checkLeverageInverseRiskAssessment=!0)}onCloseSiModal(){this.checkSiDeclaration=!1}preHandleModalVisible(){this.checkLeverageInverseRiskAssessment=!1,this.checkSiDeclaration=!1,this.handleModalVisiblePost()}onCloseRiskDisclosureModal(e){this.checkLeverageInverseRiskAssessment=e}}return e.\u0275fac=function(t){return new(t||e)(h.lc(bm.a),h.lc(Dg.a),h.lc(jv.a),h.lc(Sv.a),h.lc(h.j),h.lc(hm.a),h.lc(Lv.a),h.lc(Nv.a),h.lc(l.a),h.lc(pm.a),h.lc(bt.a),h.lc(qg.a),h.lc(Eg.c),h.lc(yv.a),h.lc(j.e),h.lc(c.e),h.lc(s.i),h.lc(Bv.a),h.lc(CM.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-portfolio"]],inputs:{primaryCashAcctAvailableBalance:"primaryCashAcctAvailableBalance",lsClient:"lsClient",isAcctAllowScheduledSell:"isAcctAllowScheduledSell",selectedStockOption:"selectedStockOption",cdsAccountReactivateSuccess:"cdsAccountReactivateSuccess",cdsAccountPendingTrigger:"cdsAccountPendingTrigger",klseLeveragedInverseStockList:"klseLeveragedInverseStockList"},outputs:{emitMarketDepthAction:"emitMarketDepthAction",handleCdsAccountReactivation:"handleCdsAccountReactivation"},features:[h.Tb([l.a,qg.a,_c.a,p.f,p.g]),h.Sb],decls:23,vars:14,consts:[[4,"ngIf"],["plToolTips",""],[3,"bcanRedirrectModelVisible","bcanViewModel","onCloseBcanRedirrectModel"],["nzWrapClassName","vertical-center-modal",3,"nz
5Visible","nzClosable","nzFooter","nzTitle","nzVisibleChange","nzOnCancel"],[1,"mb-3"],["nz-icon","","nzType","info-circle","nzTheme","fill",1,"text-warning","text-xl"],[1,"ml-3"],[1,"text-base","ml-5"],["href","https://www.hkex.com.hk/-/media/HKEX-Market/Services/Circulars-and-Notices/Participant-and-Members-Circulars/SEHK/2022/CT08822E.pdf","target","_blank"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","end"],["nz-button","","nzType","primary",1,"mx-2","mt-2",3,"click"],[3,"visibleFepAgreement","changeVisibleFepAgreement"],[3,"check","show","stayOnCurrentPage","onAccepted","onDecline"],[3,"show","check","refno","onAccepted","onCloseModal"],["liveStreamingInfoMobile",""],[1,"grey-bg","mb-3"],["nzType","flex","nzJustify","start",1,"p-3"],["nzMd","8","nzXl","7"],[1,"d-flex","align-items-center"],[1,"m-2",3,"src"],[1,"statistic-panel",3,"nzValueTemplate","nzTitle"],["totalInvestmentTitle",""],["totalInvestment",""],["currentValueTitle",""],["currentValue",""],["nzMd","8","nzXl","10"],["profitLossTitle",""],["profitLoss",""],[1,"d-flex","align-items-center",3,"nzGutter"],[3,"nzSpan"],["autocomplete","off"],[3,"nzPrefix","nzSuffix"],["type","text","nz-input","","placeholder","Name","name","filterSearch",3,"ngModel","ngModelChange"],["suffixIconClear",""],["suffixIconSearch",""],["nzShowSearch","","nzLabelPlaceholder","","nzPlaceHolder","Exchange",1,"w-100",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange"],[1,"text-wrap",3,"nzValue","nzLabel"],["class","text-wrap",3,"nzValue","nzLabel",4,"ngFor","ngForOf"],["class","w-100","nzShowSearch","","nzLabelPlaceholder","","nzPlaceHolder","Currency",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange",4,"ngIf"],[1,"py-1","text-sm","text-right"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["nz-radio-button","","class","px-4",3,"nzValue",4,"ngFor","ngForOf"],[1,"mt-3"],[1,"stock-portfolio-table",3,"nzData","nzScroll","nzFrontPagination","nzLoading"],["portfolioTable",""],[3,"nzSortChange"],[1,"text-xs"],["class","bg-black-1",4,"ngIf"],[4,"ngFor","ngForOf"],["class","pointer",3,"click",4,"ngFor","ngForOf"],["class","row-total font-weight-bold text-black",4,"ngIf"],[1,"pt-2","ml-1","text-sm"],["indicatorTemplateSpin",""],["nzSimple","",3,"nzIndicator"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","mt-3"],[1,"text-xs","mb-1"],[1,"text-xs","mb-2"],["class","text-xs mb-1",4,"ngIf"],[1,"px-3","pt-0","pb-3","bg-white"],[1,"text-base"],[1,"text-right",3,"nzSpan"],[1,"text-base","font-weight-bold"],[1,"text-sm"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",1,"pointer","text-info",3,"nzTooltipTitle"],["class","pointer text-info","nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",3,"nzTooltipTitle",4,"ngIf"],[1,"text-sm","font-weight-bold"],[1,"mt-3","bg-white"],[1,"py-1","px-3","mt-3","mb-2","text-sm","text-left"],["nz-radio-button","","class","px-4 text-sm",3,"nzValue",4,"ngFor","ngForOf"],[1,"px-3","bg-white"],["nzSpan","8",1,"font-weight-bold"],["nzSpan","16",1,"pointer","text-right","font-weight-bold","text-primary"],["nz-button","","nzOutline","","nzType","primary",1,"px-2","mb-2",3,"nzSize","click"],["nz-icon","","nzTheme","outline","nzType","info-circle"],[1,"mb-2",3,"nzSpan"],["type","text","nz-input","","placeholder","Name","name","filterSearch",1,"h-50","text-sm",3,"ngModel","ngModelChange"],["nzType","flex","nzAlign","middle",1,"mt-1"],["nzShowSearch","","nzLabelPlaceholder","","nzPlaceHolder","Exchange","nzSize","small",1,"w-100","h-50","text-sm",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange"],[1,"pl-1",3,"nzSpan"],["class","w-100 h-50 text-sm","nzShowSearch","","nzLabelPlaceholder","","nzPlaceHolder","Currency","nzSize","small",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange",4,"ngIf"],[1,"mt-2"],[3,"nzData","nzScroll","nzLoading","nzFrontPagination"],["nzLeft","0px",4,"ngIf"],[3,"click",4,"ngFor","ngForOf"],[1,"pt-1","mb-3"],["indicatorTemplateSpinMobile",""],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","my-3"],[1,"text-sm","mb-1"],[1,"text-sm","mb-2"],["class","text-sm mb-1",4,"ngIf"],[3,"isSwitchCurrency","isCalculator","holdingInfo","visible","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","emitGetFeeDetailAction","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitSnapSelectedStockAction",4,"ngIf"],[3,"lsClient","
5isSwitchCurrency","isCalculator","holdingInfo","visible","selectedStock","priceQuote","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","feeNameMap","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","emitGetFeeDetailAction","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","changeSelectedStock","emitSnapSelectedStockAction",4,"ngIf"],[3,"isVisible","cdsStatus","selectedAcctType","hasProcessingCdsAccountReactivation","changeVisible","handleCdsAccountReactivation"],[3,"visible","feeDetail","feeDetailStatus","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","changeIsModifyOrder","backVisible",4,"ngIf"],[3,"feeNameMap","visible","feeDetail","feeDetailStatus","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","changeIsModifyOrder","backVisible",4,"ngIf"],[3,"visible","selectedStock","watchList","changeVisible"],["wacTooltip",""],["usotcInfoTooltip",""],["usotcCurrentValueTooltip",""],[3,"selectedStock","visible","selectedActionEmitter","changeVisibleEmitter",4,"ngIf"],[1,"text-sm","text-black"],[1,"text-xs","font-weight-bold"],[1,"text-profit","text-xs","font-weight-bold"],[1,"text-profit","text-base","font-weight-bold"],["nz-icon","","nzType","caret-up","nzTheme","fill",1,"text-profit","text-sm"],[1,"text-loss","text-xs","font-weight-bold"],[1,"text-loss","text-base","font-weight-bold"],["nz-icon","","nzType","caret-down","nzTheme","fill",1,"text-loss","text-sm"],["nz-icon","","nzType","close",1,"text-black",3,"click"],["nz-icon","","nzType","search",1,"text-black"],["nzShowSearch","","nzLabelPlaceholder","","nzPlaceHolder","Currency",1,"w-100",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange"],["nz-radio-button","",1,"px-4",3,"nzValue"],[1,"bg-black-1"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["nzAlign","left",1,"bg-black-1",3,"nzShowSort","nzSortKey"],["nzAlign","center","nzWidth","100px",1,"bg-black-1"],["nzAlign","center","nzWidth","100px","nzSortKey","unrealisedPL",1,"text-right","bg-black-1",3,"nzShowSort"],["nzAlign","right",1,"bg-black-1",3,"nzShowSort","nzSortKey"],["href","javascript:void(0)","nzTooltipPlacement","left",3,"nz-tooltip"],["nz-icon","","nzType","info-circle",1,"text-info"],["nzAlign","center","nzSortKey","cost",1,"text-right","bg-black-1",3,"nzShowSort"],[1,"pointer",3,"click"],[1,"font-weight-bold","text-xs",3,"click"],["nzTooltipPlacement","left","class","ml-1",3,"nz-tooltip",4,"ngIf"],[1,"text-xs","m-0","text-black-6"],["nzAlign","right"],[3,"exchange"],["nzAlign","right",4,"ngIf"],["nzAlign","right","class","text-xs",4,"ngIf"],["nzShowSearch","","nzAllowClear","","nzAllowClear","","nzLabelPlaceholder","","nzPlaceHolder","Go To","nzSize","small",1,"w-100",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange"],["class","text-wrap",3,"nzValue","nzLabel",4,"ngIf"],["alt","snap","nz-tooltip","","style","width: 16px; height: auto;",3,"src","nzTitle","click",4,"ngIf"],["alt","snap","nz-tooltip","",2,"width","16px","height","auto",3,"src","nzTitle","click"],["nzTooltipPlacement","left",1,"ml-1",3,"nz-tooltip"],[1,"text-xxs"],["nz-tooltip","","nz-icon","","nzType","info-circle","nzTheme","outline",1,"text-info",3,"nzTooltipTitle"],["endSnapDate",""],["nzAlign","right",1,"text-xs"],["class","text-loss font-weight-bold text-xs",4,"ngIf"],["class","text-profit font-weight-bold text-xs",4,"ngIf"],[1,"text-loss","font-weight-bold","text-xs"],[1,"text-profit","font-weight-bold","text-xs"],[1,"text-xs",3,"ngClass"],["class","text-loss text-xs",4,"ngIf"],["class","text-profit text-xs",4,"ngIf"],[1,"text-loss","text-xs"],[1,"text-profit","text-xs"],[1,"row-total","font-weight-bold","text-black"],["colspan","5"],["colspan","1","nzAlign","right",3,"ngClass"],["colspan","1","nzAlign","right"],["nz-icon","","nzType","reload","nzTheme","outline",1,"text-xs","pointer",3,"click"],[1,"text-xs","ml-2","text-body"],["alt","morning star",3,"src"],[1,"text-profit","text-sm","font-weight-bold"],[1,"text-loss","text-sm","font-weight-bold"],["nz-radio-button","",1,"px-4","text-sm",3,"nz
5Value"],["nzShowSearch","","nzLabelPlaceholder","","nzPlaceHolder","Currency","nzSize","small",1,"w-100","h-50","text-sm",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange"],["nzLeft","0px"],["class","text-sm","nzWidth","25%","nzLeft","0px",4,"ngIf"],["class","text-sm","nzWidth","25%","nzAlign","right",4,"ngIf"],["class","text-sm","nzWidth","25%",4,"ngIf"],["nzWidth","25%","nzLeft","0px",1,"text-sm"],["nzWidth","25%","nzAlign","right",1,"text-sm"],[1,"font-weight-normal"],["href","javascript:void(0)","nzTooltipPlacement","left",3,"nz-tooltip",4,"ngIf"],["nzWidth","25%",1,"text-sm"],[3,"click"],[1,"font-weight-bold","text-sm",3,"click"],[1,"text-black-6"],[1,"font-weight-bold"],["nz-icon","","nzType","right",1,"text-info"],["class","text-loss font-weight-bold",4,"ngIf"],["class","text-profit font-weight-bold",4,"ngIf"],["class","text-loss",4,"ngIf"],["class","text-profit",4,"ngIf"],[1,"text-loss","font-weight-bold"],[1,"text-profit","font-weight-bold"],[1,"text-loss"],[1,"text-profit"],["nz-icon","","nzType","reload",1,"text-sm","pointer","font-weight-bold",3,"click"],[1,"text-sm","text-body","ml-2"],[3,"isSwitchCurrency","isCalculator","holdingInfo","visible","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","emitGetFeeDetailAction","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitSnapSelectedStockAction"],[3,"lsClient","isSwitchCurrency","isCalculator","holdingInfo","visible","selectedStock","priceQuote","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","feeDetail","feeDetailStatus","feeNameMap","rspEtfProductInfo","isScheduledSellOrderExist","isModifyOrder","changeIsModifyOrder","emitData","changeVisible","emitGetFeeDetailAction","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","changeSelectedStock","emitSnapSelectedStockAction"],[3,"visible","feeDetail","feeDetailStatus","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","changeIsModifyOrder","backVisible"],[3,"feeNameMap","visible","feeDetail","feeDetailStatus","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","isModifyOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","changeIsModifyOrder","backVisible"],[3,"selectedStock","visible","selectedActionEmitter","changeVisibleEmitter"],[1,"m-2","mb-3"],[1,"text-black","font-weight-bold","mb-0"]],template:function(e,t){1&e&&(h.od(0,vD,167,98,"ng-container",0),h.od(1,MD,3,0,"ng-template",null,1,h.pd),h.rc(3,"app-bcan-redirect-modal",2),h.zc("onCloseBcanRedirrectModel",(function(){return t.onCloseBcanRedirrectModel()})),h.qc(),h.rc(4,"nz-modal",3),h.zc("nzVisibleChange",(function(e){return t.chinaTradeNotAvailableModalVisible=e}))("nzOnCancel",(function(){return t.onCloseChinaTradeNotAvailableModel()})),h.rc(5,"h3",4),h.mc(6,"i",5),h.rc(7,"span",6),h.qd(8,"China A-Shares (BCAN Form)"),h.qc(),h.qc(),h.pc(9),h.rc(10,"p",7),h.qd(11,"Northbound Trading (China A-Shares) under Stock Connect is not available for China mainland investors with effect from 25 July 2022 with the amendment of rules announced by the China Securities Regulatory Commission (CSRC), Shanghai Stock Exchange (SSE), and Shenzhen Stock Exchange (SZSE). For more info kindly refer to this link "),h.rc(12,"a",8),h.qd(13,"here"),h.qc(),h.qd(14,"."),h.qc(),h.rc(15,"div",9),h.rc(16,"button",10),h.zc("click",(function(){return t.onCloseChinaTradeNotAvailableModel()})),h.qd(17,"Close"),h.qc(),h.qc(),h.oc(),h.qc(),h.rc(18,"app-fep-agreement-modal",11),h.zc("changeVisibleFepAgreement",(function(e){return t.handleFepAgreementVisible(e)})),h.qc(),h.rc(19,"shared-si-declaration-revamp-modal",12),h.zc("onAccepted",(function(){return t.onSiAccepted()}))("onDecline",(function(){return t.onCloseSiModal()})),h.qc(),h.rc(20,"app-stocks-leveraged-inverse-risk-disclosure",13),h.zc("onAccepted",(function(){return t.preHandleModalVisible()}))("onCloseModal",(function(e){return t.onCloseRiskDisclosureModal(e)})),h.qc(),h.od(21,CD,25,8,"ng-template",null,14,h.pd)),2&e&&(h.Mc("ngIf",t.selectedStockOption===t.IStockOptionType.PORTFOLIO),h.Ub(3),h.Mc("bcanRedirrectModelVisible",t.bcanRedirrectModelVisible)("bcanViewModel",t.bcanViewModel),h.Ub(1),h.Mc("nzVisible",t.chinaTradeNotAvailableModalVisible)("nzClosable",!0)("nzFooter",null)("nzTitle",null),h.Ub(14),h.Mc("visibleFepAgreement",t.visibleFepAgreement),h.Ub(1),h.Mc("check",!0)("show",t.checkSiDeclaration)("stayOnCurrentPage",!0),h.Ub(1),h.Mc("show",t.checkLeverageInverseRiskAssessment)("check",!0)("refno",t.tradableRefno))},directives:[p.t,Kv.a,j.a,k.b,P.c,_.a,fM.a,Dt.a,Gv.a,B.a,P.a,ow.b,oe.J,oe.u,oe.v,Pn.c,oe.c,Pn.b,oe.t,oe.w,Lt.d,Lt.a,p.s,Ut.c,ve.a,ve.f,ve.g,ve.c,Il.a,z.a,xt.e,Xv.d,Xv.a,ve.e,Wv.a,Zv.a,Ut.a,p.x,p.y,p.z,ve.d,Og.a,p.q,Dq.a,Pq.a,Iq.a,kq.a,Ew,Pg.a],pipes:[p.g,TM.a,p.f,Ig.a,aw.a],styles:[".grey-bg[_ngcontent-%COMP%]{background-color:#f2f2f2}.drop-down[_ngcontent-%COMP%]{color:#000}.statistic-panel[_ngcontent-%COMP%]{line-height:12px!important}.stock-portfolio-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-
57px}.stock-portfolio-table[_ngcontent-%COMP%] .ant-table-thead>tr>th{padding:4px}.stock-portfolio-table[_ngcontent-%COMP%] .ant-table-tbody>tr>td{padding:4px}"]}),e})();var TD=n("PQUx"),wD=n("W8w6"),zD=n("3IYF");function DD(e,t){if(1&e&&h.mc(0,"i",33),2&e){h.Dc(3);const e=h.ad(22);h.Mc("nz-tooltip",e)}}function PD(e,t){if(1&e&&(h.rc(0,"td",30),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(e.currency+" Cash Account")}}function ID(e,t){if(1&e&&(h.rc(0,"td",30),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(e.autosweepCurrency+" "+e.paymentMode)}}function kD(e,t){if(1&e&&(h.rc(0,"td",30),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(e.paymentMode)}}const AD=function(){return{color:"#004bad"}},ED=function(e){return{color:e}};function FD(e,t){if(1&e){const e=h.sc();h.rc(0,"tr",22),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onSelectStockInfoRow(n)})),h.rc(1,"td"),h.rc(2,"span",23),h.qd(3),h.Ec(4,"sdate"),h.qc(),h.qc(),h.rc(5,"td"),h.rc(6,"nz-row"),h.rc(7,"a",24),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).navigateToStocksFactsheet(null!=n&&n.stockShortName?null==n?null:n.stockShortName:null==n?null:n.stockName,n.exchange,n.stockCode,n.exchangeSubType)})),h.qd(8),h.qc(),h.od(9,DD,1,1,"i",25),h.qc(),h.rc(10,"nz-row"),h.rc(11,"nz-col",26),h.qd(12),h.qc(),h.qc(),h.qc(),h.rc(13,"td"),h.mc(14,"app-stock-exchange-tag",27),h.Ec(15,"displayExchangeName"),h.qc(),h.rc(16,"td",28),h.qd(17),h.Ec(18,"titlecase"),h.qc(),h.od(19,PD,2,1,"td",29),h.od(20,ID,2,1,"td",29),h.od(21,kD,2,1,"td",29),h.rc(22,"td",30),h.qd(23),h.qc(),h.rc(24,"td",30),h.qd(25),h.qc(),h.rc(26,"td",30),h.qd(27),h.Ec(28,"stockPrice"),h.qc(),h.rc(29,"td",30),h.qd(30),h.Ec(31,"stockPrice"),h.qc(),h.rc(32,"td",30),h.qd(33),h.Ec(34,"stockPrice"),h.qc(),h.rc(35,"td",31),h.rc(36,"nz-tag",32),h.qd(37),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(3),h.rd(h.Fc(4,19,e.sdate)),h.Ub(4),h.Mc("ngStyle",h.Rc(35,AD)),h.Ub(1),h.sd("",null!=e&&e.stockShortName?null==e?null:e.stockShortName:null==e?null:e.stockName," "),h.Ub(1),h.Mc("ngIf",(null==e?null:e.exchange)===n.USOTC),h.Ub(3),h.rd(e.stockCode),h.Ub(2),h.Mc("exchange",h.Fc(15,21,e.exchange)),h.Ub(2),h.Mc("ngStyle",h.Sc(36,ED,n.determineTypeColor(e.ordSide))),h.Ub(1),h.rd(h.Fc(18,23,n.changeBidAsk(e.ordSide))),h.Ub(2),h.Mc("ngIf",e.paymentMode===n.TRUST_ACCOUNT),h.Ub(1),h.Mc("ngIf",e.paymentMode===n.AUTO_SWEEP),h.Ub(1),h.Mc("ngIf",e.paymentMode!=n.AUTO_SWEEP&&e.paymentMode!=n.TRUST_ACCOUNT),h.Ub(2),h.rd(e.ordQty),h.Ub(2),h.rd("Rejected"===e.ordStatusText?"-":e.filledQty),h.Ub(2),h.td("",e.currency," ",h.Gc(28,25,e.ordPrice,null==e?null:e.exchange),""),h.Ub(3),h.rd("Rejected"===e.ordStatusText?"-":e.currency+" "+h.Gc(31,28,e.avgPrice,null==e?null:e.exchange)),h.Ub(3),h.rd("Rejected"===e.ordStatusText?"-":e.currency+" "+h.Hc(34,31,e.totalAmount,null==e?null:e.exchange,e.ordPrice)),h.Ub(3),h.Mc("ngClass",n.determineStatusColor(e.ordStatus)),h.Ub(1),h.rd(e.ordStatusText)}}const OD=function(){return{x:"600px"}};function UD(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-table",12,13),h.rc(2,"thead",14),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc().tableSort(t)})),h.rc(3,"tr",15),h.rc(4,"th",16),h.qd(5,"Date"),h.qc(),h.rc(6,"th",17),h.qd(7,"Stock "),h.mc(8,"br"),h.qd(9," Name"),h.qc(),h.rc(10,"th",18),h.qd(11,"Exch"),h.qc(),h.rc(12,"th",19),h.qd(13,"Order Type"),h.qc(),h.rc(14,"th",20),h.qd(15,"Payment Method"),h.qc(),h.rc(16,"th",19),h.qd(17,"Qty"),h.qc(),h.rc(18,"th",19),h.qd(19,"Matched Qty"),h.qc(),h.rc(20,"th",19),h.qd(21,"Price"),h.qc(),h.rc(22,"th",19),h.qd(23,"Avg Matched Price"),h.qc(),h.rc(24,"th",19),h.qd(25,"Gross Amt"),h.qc(),h.rc(26,"th",19),h.qd(27,"Status"),h.qc(),h.mc(28,"th"),h.qc(),h.qc(),h.rc(29,"tbody"),h.od(30,FD,38,38,"tr",21),h.qc(),h.qc()}if(2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzData",t.tempOrderBookInfos)("nzScroll",h.Rc(15,OD))("nzShowPagination",(null==t.tempOrderBookInfos?null:t.tempOrderBookInfos.length)>10),h.Ub(4),h.Mc("nzSortKey",t.displayCols[0].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[1].key),h.Ub(4),h.Mc("nzSortKey",t.displayCols[2].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[4].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[5].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[6].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[7].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[8].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[9].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[10].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[11].key),h.Ub(4),h.Mc("ngForOf",e.data)}}function xD(e,t){if(1&e&&h.mc(0,"i",33),2&e){h.Dc(3);const e=h.ad(22);h.Mc("nz-tooltip",e)}}function LD(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(e.currency+" Cash Account")}}function RD(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(e.autosweepCurrency+" "+e.paymentMode)}}function ND(e,t){if(1&e&&(h.rc(0,"span"),h.qd(1),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(1),h.rd(e.paymentMode)}}function BD(e,t){if(1&e){const e=h.sc();h.rc(0,"tr",43),h.zc("click",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(2).navigateToStocksFactsheet(n.stockShortName?n.stockShortName:n.stockName,n.exchange,n.stockCode,n.exchangeSubType)})),h.rc(1,"td",44),h.rc(2,"nz-row"),h.rc(3,"nz-col",45),h.qd(4),h.qc(),h.qc(),h.qc(),h.rc(5,"td"),h.rc(6,"nz-row"),h.rc(7,"nz-col",37),h.rc(8,"span",46),h.qd(9),h.od(10,xD,1,1,"i",25),h.qc(),h.rc(11,"span",47),h.mc(12,"app-stock-exchange-tag",48),h.Ec(13,"displayExchangeName"),h.qd(14),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(15,"td"),h.rc(16,"nz-row"),h.rc(17,"nz-col"),h.rc(18,"div",49),h.rc(19,"span",50),h.qd(20),h.qc(),h.mc(21,"br"),h.qd(22),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(23,"td"),h.rc(24,"nz-row"),h.rc(25,"nz-col"),h.rc(26,"div",49),h.rc(27,"span",50),h.qd(28),h.Ec(29,"stockPrice"),h.qc(),h.mc(30,"br"),h.rc(31,"span"),h.qd(32),h.Ec(33,"stockPrice"),h.qc(),h.mc(34,"br"),h.rc(35,"span",50),h.qd(36),h.Ec(37,"stockPrice"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(38,"td"),h.rc(39,"nz-row"),h.rc(40,"nz-col"),h.rc(41,"div",49),h.rc(42,"span",50),h.qd(43),h.Ec(44,"sdate"),h.qc(),h.mc(45,"br"),h.od(46,LD,2,1,"span",10),h.od(47,RD,2,1,"span",10),h.od(48,ND,2,1,"span",10),h.mc(49,"br"),h.rc(50,"nz-tag",32),h.qd(51),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngClass",n.mobileDetermineStatusColor(e.ordSide)),h.Ub(3),h.sd(" ",n.mobileChangeBidAsk(e.ordSide)," "),h.Ub(5),h.sd("",e.stockShortName?e.stockShortName:e.stockName," "),h.Ub(1),h.Mc("ngIf",(null==e?null:e.exchange)===n.USOTC),h.Ub(2),h.Mc("exchange",h.Fc(13,18,null==e?null:e.exchange)),h.Ub(2),h.rd(e.stockCode),h.Ub(6),h.rd(e.ordQty),h.Ub(2),h.sd(" ","Rejected"===e.ordStatusText?"-":e.filledQty," "),h.Ub(6),h.td("",e.currency," ",h.Gc(29,20,e.ordPrice,null==e?null:e.exchange),""),h.Ub(4),h.rd("Rejected"===e.ordStatusText?"-":e.currency+" "+h.Gc(33,23,e.avgPrice,null==e?null:e.exchange)),h.Ub(4),h.rd("Rejected"===e.ordStatusText?"-":e.currency+" "+h.Hc(37,26,e.totalAmount,null==e?null:e.exchange,e.ordPrice)),h.Ub(7),h.rd(h.Fc(44,30,e.sdate)),h.Ub(3),h.Mc("ngIf",e.paymentMode===n.TRUST_ACCOUNT),h.Ub(1),h.Mc("ngIf",e.paymentMode===n.AUTO_SWEEP),h.Ub(1),h.Mc("ngIf",e.paymentMode!=n.AUTO_SWEEP&&e.paymentMode!=n.TRUST_ACCOUNT),h.Ub(2),h.Mc("ngClass",n.determineStatusColor(e.ordStatus)),h.Ub(1),h.rd(e.ordStatusText)}}const _D=function(){return{x:"100%"}};function VD(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-table",34,13),h.rc(2,"thead",14),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc().tableSort(t)})),h.rc(3,"tr"),h.mc(4,"th",35),h.rc(5,"th",36),h.rc(6,"span",37),h.qd(7,"Stock Name"),h.qc(),h.qc(),h.rc(8,"th",38),h.qd(9,"Qty"),h.mc(10,"br"),h.rc(11,"span",39),h.qd(12,"Matched Qty"),h.qc(),h.qc(),h.rc(13,"th",40),h.qd(14,"Price"),h.mc(15,"br"),h.rc(16,"span",39),h.qd(17,"Matched Price"),h.qc(),h.mc(18,"br"),h.rc(19,"span"),h.qd(20,"Gross Amt"),h.qc(),h.qc(),h.rc(21,"th",41),h.qd(22,"Date"),h.mc(23,"br"),h.rc(24,"span",39),h.qd(25,"Payment Method"),h.qc(),h.mc(26,"br"),h.rc(27,"span",39),h.qd(28,"Status"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(29,"tbody"),h.od(30,BD,52,32,"tr",42),h.qc(),h.qc()}if(2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzData",t.tempOrderBookInfos)("nzScroll",h.Rc(5,_D))("nzFrontPagination",!0)("nzShowPagination",(null==t.tempOrderBookInfos?null:t.tempOrderBookInfos.length)>10),h.Ub(30),h.Mc("ngForOf",e.data)}}function HD(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"Today's transaction history will only be available after "),h.rc(2,"b"),h.qd(3,"8:30pm"),h.qc(),h.qd(4," (for BURSA, SGX, HKEX, SSE and SZSE stock exchange), "),h.rc(5,"b"),h.qd(6,"7:30am"),h.qc(),h.qd(7," (US stock exchange), "),h.rc(8,"b"),h.qd(9,"6:30am"),h.qc(),h.qd(10," (LSE stock exchange for Daylight Savings) and "),h.rc(11,"b"),h.qd(12,"7:30am"),h.qc(),h.qd(13," (LSE stock exchange for Non Daylight Savings) after the trading session."),h.qc())}function $D(e,t){1&e&&(h.rc(0,"span"),h.qd(1,"Today's transaction history will only be available after "),h.rc(2,"b"),h.qd(3,"6:00pm"),h.qc(),h.qd(4," (BURSA stock exchange), "),h.rc(5,"b"),h.qd(6,"8:30pm"),h.qc(),h.qd(7," (for SGX, HKEX, SSE and SZSE stock exchange), "),h.rc(8,"b"),h.qd(9,"7:30am"),h.qc(),h.qd(10," (US stock exchange), "),h.rc(11,"b"),h.qd(12,"6:30am"),h.qc(),h.qd(13," (LSE stock exchange for Daylight Savings) and "),h.rc(14,"b"),h.qd(15,"7:30am"),h.qc(),h.qd(16," (LSE stock exchange for Non Daylight Savings) after the trading session."),h.qc())}function jD(e,t){1&e&&h.qd(0," Info for USOTC shares is not available.\n")}let GD=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l){this.notification=e,this.authService=t,this.stockTransactionRestService=n,this.orderBookService=i,this.accountService=c,this.router=o,this.liveFeedService=s,this.scheduledSellRestService=a,this.subHandlingService=l,this.emitMarketDepth=new h.s,this.selectedItem={ordPrice:0},this.orderBookLoading=!0,this.isNewTradingHourStart=!1,this.orderBookInfos=[],this.tempOrderBookInfos=[],this.displayCols=[{key:"ordDate",colName:"Date"},{key:"stockName",colName:"Stock Name"}
5,{key:"exchange",colName:"Exch"},{key:"investmentAcctType",colName:"Account"},{key:"ordSide",colName:"Type"},{key:"ordQty",colName:"Qty"},{key:"filledQty",colName:"Matched Qty"},{key:"ordPrice",colName:"Price"},{key:"avgPrice",colName:"W.A.C"},{key:"totalAmount",colName:"Gross Amt"},{key:"orderId",colName:"Contract ID"},{key:"ordStatusText",colName:"Status"}],this.KLSE="KLSE",this.BURSA="BURSA",this.CNH="CNH",this.CNY="CNY",this.USOTC=M.q.USOTC,this.PRICE_DELAY="PRICE-DELAY-",this.TRUST_ACCOUNT=M.q.TRUST_ACCOUNT,this.AUTO_SWEEP=M.q.AUTO_SWEEP,this.PRICE_QUOTE_FIELDS=["symbol","exchange","stockCode","stockName","currency","lastPrice","cumulativeVolume","bidPrice","bidQuantity","askPrice","askQuantity","openPrice","closePrice","dayHigh","dayLow","change","changePercentage"]}ngOnInit(){this.orderBookLoading=!1,this.readOrderHistory();const e=new Date,t=new Date("2023-04-15 00:00:00");e.getTime()>=t.getTime()&&(this.isNewTradingHourStart=!0)}ngOnChanges(){this.filter()}filter(){this.tempOrderBookInfos=this.orderBookInfos,this.filterStatus&&"ALL"!==this.filterStatus&&(this.tempOrderBookInfos=this.orderBookInfos.filter(e=>e.exchange===this.filterStatus)),this.filterSearchText&&(this.tempOrderBookInfos=this.tempOrderBookInfos.filter(e=>e.stockName.toLowerCase().includes(this.filterSearchText.toLowerCase()))),this.filterAccount&&(this.tempOrderBookInfos=this.tempOrderBookInfos.filter(e=>e.refno.toLowerCase().includes(this.filterAccount.toLowerCase())||e.refno.toLowerCase().includes(this.filterAccount.toLowerCase())))}tableSort(e){this.tempOrderBookInfos=Object(Ov.c)(e,this.orderBookInfos)}readOrderHistory(){this.orderBookLoading=!0;const e=this.scheduledSellRestService.readOrderHistory(this.accountService.getTradableAccountRefno),t=this.orderBookService.readOrderHistory(this.accountService.getTradableAccountRefno,"");this.subHandlingService.once(Object(ht.a)([e,t]).pipe(Object(y.a)(e=>{let t=[];t.push(...e[0].data,...e[1].data),this.orderBookInfos=t,this.tempOrderBookInfos=t,this.refactorOrderBookInfos(this.orderBookInfos),this.refactorOrderBookInfos(this.tempOrderBookInfos),this.filter(),this.orderBookLoading=!1})))}refactorOrderBookInfos(e){e.forEach(e=>{e.totalAmount=e.avgPrice*e.filledQty,e.orderId.indexOf(".")>0&&(e.orderId=e.orderId.split(".")[0]),e.sdate=this.convertToDate(e.ordDate)})}determineTypeColor(e){return"BUY"===e?"#009933":"#FF333A"}changeBidAsk(e){return"BUY"===e?"Buy":e===M.q.SCHEDULED_SELL?e:"Sell"}convertToDate(e){return new Date(e.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))}determineStatusColor(e){return 0==e||1==e||3==e||5==e||6==e||9==e||"A"==e||"B"==e||"C"==e||"D"==e||"E"==e?"ant-tag-blue":2==e?"tag-received":"tag-terminated"}mobileDetermineStatusColor(e){return"BUY"===e?"bg-profit":"bg-loss"}mobileChangeBidAsk(e){return"BUY"===e?"B":"A"}navigateToStocksFactsheet(e,t,n,i){let c;"BURSA"===t&&(t="KLSE"),c="ETF"==i?Object(mt.f)(r.b.ETF,n,"",e,t):Object(mt.f)(r.b.STOCK_AND_ETF,n,"",e,t),Object(pt.a)(c.route,c.params)}redirectToTransHist(){this.router.navigate([Object(v.a)(M.o.APP,M.o.TRANSACTION_RECORD,M.o.HISTORICAL)],{queryParams:{refno:this.accountService.getTradableAccountRefno}})}onSelectStockInfoRow(e){return Object(o.b)(this,void 0,void 0,(function*(){e.securityType=e.exchangeSubType,e.exchange===M.q.BURSA&&(e.exchange=M.q.KLSE),this.selectedItem=Object(g.a)(e),this.handleSelectedStockForPriceQuote(this.selectedItem),this.emitMarketDepth.emit(this.selectedItem)}))}unsubscribePriceQuoteLS(){this.tempSubPriceQuote&&(this.lsClient.unsubscribe(this.tempSubPriceQuote),this.tempSubPriceQuote=null)}unsubscribeSnapOnly(){this.tempSnapSub&&(this.lsClient.unsubscribe(this.tempSnapSub),this.tempSnapSub.getListeners().forEach(e=>{this.tempSnapSub.removeListener(e)}),this.tempSnapSub=null)}determineSedolNumberExchg(e){return e.exchange===M.q.KLSE||e.exchange===M.q.BURSA?"135:"+e.stockCode:"126:"+e.stockCode}handleSelectedStockForPriceQuote(e){this.unsubscribePriceQuoteLS();let t=this;e.sedolnumber=this.determineSedolNumberExchg(e),this.tempSubPriceQuote=this.liveFeedService.subscribePriceQuote(this.lsClient,this.PRICE_QUOTE_FIELDS,[e])[0],this.tempSubPriceQuote.addListener({onItemUpdate:e=>{let n=[];e.forEachChangedField((e,i,c)=>{const o=this.PRICE_QUOTE_FIELDS.indexOf(e);n[o]=c,"exchange"===e&&(n[o]=c===M.q.BURSA?M.q.KLSE:c),"currency"===e&&(n[o]=c===t.CNH?t.CNY:c),t.selectedItem[e]=n[o]})}})}handleSubscribeDelayedSnap(e){return new Promise(t=>{const n=this;(null==e?void 0:e.symbol)&&null!=(null==e?void 0:e.symbol)&&null!=(null==e?void 0:e.symbol)&&!(null==e?void 0:e.symbol.includes("undefined"))?(this.tempSnapSub=this.liveFeedService.getSNAP(this.lsClient),this.tempSnapSub.addListener({onItemUpdate(i){let c=JSON.parse(i.updateV
5alues[3]);n.selectedItem=Object.assign(Object.assign({},e),c[e.symbol]),n.unsubscribeSnapOnly(),t(n.selectedItem)},onSubscription(){n.lsClient.sendMessage(n.liveFeedService.constructMessage(wg.a.PRICE,n.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20","UNORDERED_MESSAGES",0,{})}})):console.log("Invalid symbol found for LS Subscription : "+(null==e?void 0:e.symbol))})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(Sc.b),h.lc(wD.a),h.lc(Rv.a),h.lc(zD.a),h.lc(pm.a),h.lc(c.e),h.lc(hm.a),h.lc(yv.a),h.lc(l.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-order-book-historical-transaction"]],inputs:{filterStatus:"filterStatus",filterSearchText:"filterSearchText",filterAccount:"filterAccount",lsClient:"lsClient"},outputs:{emitMarketDepth:"emitMarketDepth"},features:[h.Sb],decls:23,vars:9,consts:[[3,"nzActive","nzLoading"],["class","order-book-historical-table",3,"nzData","nzScroll","nzShowPagination",4,"ngIf"],[3,"nzSpan"],[3,"nzData","nzScroll","nzFrontPagination","nzShowPagination",4,"ngIf"],[1,"text-xs","mt-4"],["nzType","flex","nzAlign","middle"],["nzXs","2","nzSm","2","nzMd","2","nzLg","1",1,"text-center"],["nz-icon","","nzType","info-circle","nzTheme","outline",1,"text-warning"],["nzXs","22","nzSm","22","nzMd","22","nzLg","22"],[1,"text-info","pointer","text-black-7",3,"click"],[4,"ngIf"],["usotcInfoTooltip",""],[1,"order-book-historical-table",3,"nzData","nzScroll","nzShowPagination"],["orderBookTable",""],[3,"nzSortChange"],[1,"text-xs"],["nzShowSort","","nzWidth","10%",1,"text-center",3,"nzSortKey"],["nzShowSort","","nzWidth","15%",3,"nzSortKey"],["nzShowSort","","nzWidth","10%",3,"nzSortKey"],["nzShowSort","",1,"text-right",3,"nzSortKey"],["nzShowSort","",1,"text-left",3,"nzSortKey"],["class","pointer",3,"click",4,"ngFor","ngForOf"],[1,"pointer",3,"click"],[1,"text-center","text-xs"],[1,"font-weight-bold","text-xs","ellipsis-stock-name",3,"ngStyle","click"],["nz-icon","","nzType","info-circle","class","text-info","nzTooltipPlacement","left",3,"nz-tooltip",4,"ngIf"],[1,"text-xs","text-right"],[3,"exchange"],[1,"font-weight-bold","text-right","text-xs","align-middle",3,"ngStyle"],["class","text-right text-xs align-middle",4,"ngIf"],[1,"text-right","text-xs","align-middle"],[1,"text-right","align-middle"],[1,"m-0",3,"ngClass"],["nz-icon","","nzType","info-circle","nzTooltipPlacement","left",1,"text-info",3,"nz-tooltip"],[3,"nzData","nzScroll","nzFrontPagination","nzShowPagination"],["nzWidth","5%"],["nzWidth","35%"],[1,"text-sm"],["nzWidth","22%",1,"text-right","text-sm"],[1,"font-weight-normal"],["nzWidth","28%",1,"text-right","text-sm"],["nzWidth","30%",1,"text-right","text-sm"],[3,"click",4,"ngFor","ngForOf"],[3,"click"],[3,"ngClass"],[1,"text-xs","font-weight-bold","text-white"],[1,"text-info","font-weight-bold","ellipsis-stock-name"],[1,"text-black-6"],[1,"mr-2",3,"exchange"],[1,"text-right","text-sm"],[1,"font-weight-bold"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.rc(1,"nz-row"),h.mc(2,"nz-skeleton",0),h.od(3,UD,31,16,"nz-table",1),h.qc(),h.qc(),h.rc(4,"app-mobile-scaffold"),h.rc(5,"nz-row"),h.rc(6,"nz-col",2),h.mc(7,"nz-skeleton",0),h.od(8,VD,31,6,"nz-table",3),h.qc(),h.qc(),h.qc(),h.rc(9,"div",4),h.rc(10,"nz-row",5),h.rc(11,"nz-col",6),h.mc(12,"i",7),h.qc(),h.rc(13,"nz-col",8),h.rc(14,"span"),h.qd(15,"For historical transactions beyond past 5 trading days, kindly refer to Transaction Record > "),h.qc(),h.rc(16,"span",9),h.zc("click",(function(){return t.redirectToTransHist()})),h.qd(17," Historical Transaction "),h.qc(),h.mc(18,"br"),h.od(19,HD,14,0,"span",10),h.od(20,$D,17,0,"span",10),h.qc(),h.qc(),h.qc(),h.od(21,jD,1,0,"ng-template",null,11,h.pd)),2&e&&(h.Ub(2),h.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),h.Ub(1),h.Mc("ngIf",!t.orderBookLoading),h.Ub(3),h.Mc("nzSpan",24),h.Ub(1),h.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),h.Ub(1),h.Mc("ngIf",!t.orderBookLoading),h.Ub(11),h.Mc("ngIf",!t.isNewTradingHourStart),h.Ub(1),h.Mc("ngIf",t.isNewTradingHourStart))},directives:[B.a,P.c,W.a,p.t,z.a,P.a,k.b,ve.a,ve.f,ve.g,ve.e,ve.c,p.s,ve.d,p.w,Og.a,le.a,p.q,xt.e],pipes:[_c.a,TM.a,p.G,Ig.a],styles:[".order-book-historical-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-
57px}.ellipsis-stock-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;max-width:100%;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}"]}),e})();function WD(e,t){1&e&&h.nc(0)}function YD(e,t){1&e&&h.nc(0)}function KD(e,t){1&e&&h.nc(0)}function XD(e,t){1&e&&h.nc(0)}function QD(e,t){if(1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col"),h.od(2,XD,1,0,"ng-container",3),h.qc(),h.qc()),2&e){h.Dc();const e=h.ad(25);h.Ub(2),h.Mc("ngTemplateOutlet",e)}}function ZD(e,t){1&e&&h.nc(0)}function JD(e,t){1&e&&h.nc(0)}function eP(e,t){1&e&&h.nc(0)}function tP(e,t){1&e&&h.nc(0)}function nP(e,t){if(1&e&&(h.rc(0,"nz-row",16),h.rc(1,"nz-col"),h.od(2,tP,1,0,"ng-container",3),h.qc(),h.qc()),2&e){h.Dc();const e=h.ad(25);h.Ub(2),h.Mc("ngTemplateOutlet",e)}}function iP(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-order-book-your-order",17),h.zc("handleCdsAccountReactivation",(function(t){return h.dd(e),h.Dc(3).handleCdsAccountReactivate(t)}))("hideAppBar",(function(t){return h.dd(e),h.Dc(3).hideAppBar(t)}))("emitMarketDepth",(function(t){return h.dd(e),h.Dc(3).emitMarketDepth(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("lsClient",e.lsClient)("filterStatus",e.filterStatus)("filterSearchText",e.filterSearchText)("filterAccount",e.filterAccount)("isAcctAllowScheduledSell",e.isAcctAllowScheduledSell)("cdsAccountPendingTrigger",e.cdsAccountPendingTrigger)("cdsStatus",e.cdsStatus)("hasProcessingCdsAccountReactivation",e.hasProcessingCdsAccountReactivation)}}function cP(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-order-book-historical-transaction",18),h.zc("emitMarketDepth",(function(t){return h.dd(e),h.Dc(3).emitMarketDepth(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("lsClient",e.lsClient)("filterStatus",e.filterStatus)("filterSearchText",e.filterSearchText)("filterAccount",e.filterAccount)}}function oP(e,t){if(1&e&&(h.od(0,iP,2,9,"ng-container",0),h.od(1,cP,2,4,"ng-container",0)),2&e){const e=h.Dc(2);h.Mc("ngIf","order"===e.selectedOrderBookNavigation),h.Ub(1),h.Mc("ngIf","historical"===e.selectedOrderBookNavigation)}}function sP(e,t){if(1&e&&h.mc(0,"ui-option",24),2&e){const e=t.$implicit;h.Mc("nzValue",null==e?null:e.value)("nzLabel",null==e?null:e.label)}}function aP(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",21),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).filterAccount=t})),h.mc(1,"ui-option",22),h.od(2,sP,1,2,"ui-option",23),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("ngModel",e.filterAccount),h.Ub(2),h.Mc("ngForOf",e.displayAccountOptions)}}function lP(e,t){if(1&e&&h.mc(0,"ui-option",24),2&e){const e=t.$implicit;h.Mc("nzValue",null==e?null:e.value)("nzLabel",null==e?null:e.label)}}function rP(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",25),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).filterAccount=t})),h.mc(1,"ui-option",22),h.od(2,lP,1,2,"ui-option",23),h.qc()}if(2&e){h.Dc(2);const e=h.ad(39),t=h.Dc();h.Mc("nzSuffixIcon",e)("ngModel",t.filterAccount),h.Ub(2),h.Mc("ngForOf",t.displayAccountOptions)}}function dP(e,t){if(1&e&&(h.od(0,aP,3,2,"ui-select",19),h.Ec(1,"async"),h.od(2,rP,3,3,"ui-select",20),h.Ec(3,"async")),2&e){const e=h.Dc(2);h.Mc("ngIf",!h.Fc(1,2,e.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(3,4,e.isMobile$))}}function uP(e,t){1&e&&h.mc(0,"ui-option",41)}function hP(e,t){1&e&&h.mc(0,"ui-option",42)}function pP(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",28),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).filterStatus=t})),h.mc(1,"ui-option",29),h.mc(2,"ui-option",30),h.od(3,uP,1,0,"ui-option",31),h.mc(4,"ui-option",32),h.mc(5,"ui-option",33),h.mc(6,"ui-option",34),h.mc(7,"ui-option",35),h.mc(8,"ui-option",36),h.od(9,hP,1,0,"ui-option",37),h.mc(10,"ui-option",38),h.mc(11,"ui-option",39),h.mc(12,"ui-option",40),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("ngModel",e.filterStatus),h.Ub(3),h.Mc("ngIf",!e.isSingaporean),h.Ub(6),h.Mc("ngIf","historical"===e.selectedOrderBookNavigation)}}function mP(e,t){1&e&&h.mc(0,"ui-option",41)}function fP(e,t){1&e&&h.mc(0,"ui-option",42)}function gP(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",43),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).filterStatus=t})),h.mc(1,"ui-option",29),h.mc(2,"ui-option",30),h.od(3,mP,1,0,"ui-option",31),h.mc(4,"ui-option",32),h.mc(5,"ui-option",33),h.mc(6,"ui-option",34),h.mc(7,"ui-option",35),h.mc(8,"ui-option",36),h.od(9,fP,1,0,"ui-option",37),h.mc(10,"ui-option",38),h.mc(11,"ui-option",39),h.qc()}if(2&e){h.Dc(2);const e=h.ad(39),t=h.Dc();h.Mc("nzSuffixIcon",e)("ngModel",t.filterStatus),h.Ub(3),h.Mc("ngIf",!t.isSingaporean),h.Ub(6),h.Mc("ngIf","historical"===t.selectedOrderBookNavigation)}}function bP(e,t){if(1&e&&(h.od(0,pP,13,3,"ui-select",26),h.Ec(1,"async"),h.od(2,gP,12,4,"ui-select",27),h.Ec(3,"async")),2&e){const e=h.Dc(2);h.Mc("ngIf",!h.Fc(1,2,e.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(3,4,e.isMobile$))}}function SP(e,t){if(1&e){const e=h.sc();h.rc(0,"form",44),h.rc(1,"nz-input-group",45),h.rc(2,"input",46),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).filterSearchText=t})),h.qc(),h.qc(),h.qc()}if(2&e){h.Dc();const e=h.ad(37),t=h.ad(35),n=h.Dc();h.Ub(1),h.Mc("nzPrefix",e)("nzSuffix",t),h.Ub(1),h.Mc("ngModel",n.filterSearchText)}}const yP=function(){return{width:"auto"}};function vP(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-col",48),h.rc(1,"div",49),h.zc("click",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(3).onTabClick(n.value)})),h.qd(2),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(3);h.Mc("ngStyle",h.Rc(4,yP)),h.Ub(1),h.Mc("title",e.label)("ngStyle",n.isActive(e.value)),h.Ub(1),h.rd(e.label)}}function MP(e,t){if(1&e&&h.od(0,vP,3,5,"nz-col",47),2&e){const e=h.Dc(2);h.Mc("ngForOf",e.menu)}}function CP(e,t){if(1&e){const e=h.sc();h.rc(0,"i",51),h.zc("click",(function(){return h.dd(e),h.Dc(3).clear()})),h.qc()}}function qP(e,t){if(1&e&&h.od(0,CP,1,0,"i",50),2&e){const e=h.Dc(2);h.Mc("ngIf",e.filterSearchText)}}function TP(e,t){1&e&&h.mc(0,"i",52)}function wP(e,t){1&e&&h.mc(0,"i",53)}function zP(e,t){if(1&e&&(h.pc(0),h.rc(1,"app-web-scaffold"),h.rc(2,"nz-row",1),h.rc(3,"nz-col",2),h.od(4,WD,1,0,"ng-container",3),h.qc(),h.rc(5,"nz-col",2),h.od(6,YD,1,0,"ng-container",3),h.qc(),h.qc(),h.rc(7,"nz-row",4),h.od(8,KD,1,0,"ng-container",3),h.qc(),h.od(9,QD,3,1,"nz-row",0),h.Ec(10,"async"),h.qc(),h.rc(11,"app-mobile-scaffold"),h.rc(12,"nz-row",5),h.rc(13,"nz-col"),h.rc(14,"nz-row"),h.rc(15,"nz-col"),h.od(16,ZD,1,0,"ng-container",3),h.qc(),h.qc(),h.rc(17,"nz-row",6),h.rc(18,"nz-col"),h.od(19,JD,1,0,"ng-container",3),h.qc(),h.qc(),h.rc(20,"nz-row",4),h.od(21,eP,1,0,"ng-container",3),h.qc(),h.od(22,nP,3,1,"nz-row",7),h.Ec(23,"async"),h.qc(),h.qc(),h.qc(),h.od(24,oP,2,2,"ng-template",null,8,h.pd),h.od(26,dP,4,6,"ng-template",null,9,h.pd),h.od(28,bP,4,6,"ng-template",null,10,h.pd),h.od(30,SP,3,3,"ng-template",null,11,h.pd),h.od(32,MP,1,1,"ng-template",null,12,h.pd),h.od(34,qP,1,1,"ng-template",null,13,h.pd),h.od(36,TP,1,0,"ng-template",null,14,h.pd),h.od(38,wP,1,0,"ng-template",null,15,h.pd),h.oc()),2&e){const e=h.ad(29),t=h.ad(31),n=h.ad(33),i=h.Dc();h.Ub(3),h.Mc("nzSpan",6),h.Ub(1),h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("nzSpan",17),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(2),h.Mc("ngTemplateOutlet",n),h.Ub(1),h.Mc("ngIf",!h.Fc(10,10,i.isMobile$)),h.Ub(7),h.Mc("ngTemplateOutlet",e),h.Ub(3),h.Mc("ngTemplateOutlet",t),h.Ub(2),h.Mc("ngTemplateOutlet",n),h.Ub(1),h.Mc("ngIf",h.Fc(23,12,i.isMobile$))}}let DP=(()=>{class e{constructor(e,t){this.accountService=e,this.cdsAccountRestService=t,this.emitMarketDepthAction=new h.s,this.handleCdsAccountReactivation=new h.s,this.cdsStatus="",this.hasProcessingCdsAccountReactivation=!1,this.IStockOptionType=d.c,this.hide=!1,this.orderBookInfos=[],this.tempOrderBookInfos=[],this.displayCols=[{key:"stockName",colName:"Stock Name"},{key:"ordTime",colName:"Order Date"},{key:"ordSide",colName:"Type"},{key:"ordQty",colName:"Qty"},{key:"ordPrice",colName:"Price"},{key:"avgPrice",colName:"W.A.C"},{key:"filledQty",colName:"Matched Qty"},{key:"matchAmt",colName:"Matched Amt"},{key:"orderId",colName:"Contract ID"},{key:"ordStatusText",colName:"Status"}],this.menu=[{label:"Your Order",value:"order"},{label:"Historical Transaction",value:"historical"}],this.todayDate=new Date,this.selectedOrderBookNavigation="order",this.displayAccountOptions=[{label:"Cash Upfront",value:"M"},{label:"Margin Acct",value:"C"}]}ngOnInit(){this.isSingaporean=this.accountService.isSingaporean,this.getCdsAccountDetails()}ngOnChanges(e){var t;(null===(t=null==e?void 0:e.cdsAccountReactivateSuccess)||void 0===t?void 0:t.currentValue)&&this.getCdsAccountDetails()}clear(){this.filterSearchText=null,this.tempOrderBookInfos=this.orderBookInfos}onTabClick(e){this.selectedOrderBookNavigation=e}isActive(e){if(this.selectedOrderBookNavigation===e)return{backgroundColor:"#BD2E26",color:"white"}}hideAppBar(e){this.hide=e}onAppBarBack(){}emitMarketDepth(e){this.emitMarketDepthAction.emit(e)}getCdsAccountDetails(){this.cdsAccountRestService.getCdsAccount(this.accountService.getTradableAccountRefno).subscribe(e=>{var t;e.status===M.a.RESPONSE_SUCCESS&&((null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.cdsAccountStatus)&&(this.cdsStatus=e.data.cdsAccountStatus),this.hasProcessingCdsAccountReactivation=e.data.hasProcessingCdsAccountReactivation)})}handleCdsAccountReactivate(e){this.handleCdsAccountReactivation.emit(e)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(pm.a),h.lc(bm.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-order-book"]],inputs:{primaryCashAcctAvailableBalance:"primaryCashAcctAvailableBalance",lsClient:"lsClient",selectedStockOption:"selectedStockOption",isAcctAllowScheduledSell:"isAcctAllowScheduledSell",cdsAccountReactivateSuccess:"cdsAccountReactivateSuccess",cdsAccountPendingTrigger:"cdsAccountPendingTrigger"},outputs:{emitMarketDepthAction:"emitMarketDepthAction",handleCdsAccountReactivation:"handleCdsAccountReactivation"},features:[h.Sb],decls:1,vars:1,consts:[[4,"ngIf"],["nzGutter","16"],[3,"nzSpan"],[4,"ngTemplateOutlet"],["nzType","flex","nzAlign","middle",1,"pb-3","mt-3"],[1,"p-3","bg-white","mt-3"],[1,"mt-2"],["class","mt-1",4,"ngIf"],["tableTemplate",""],["filterAccountType",""],["filterStatusTemplate",""],["filterSearchTextTemplate",""],["orderBookTabTemplate",""],["suffixTemplate",""],["prefixIconSearch",""],["suffixStatus",""],[1,"mt-1"],[3,"primaryCashAcctAvailableBalance","lsClient","filterStatus","filterSearchText","filterAccount","
5isAcctAllowScheduledSell","cdsAccountPendingTrigger","cdsStatus","hasProcessingCdsAccountReactivation","handleCdsAccountReactivation","hideAppBar","emitMarketDepth"],[3,"lsClient","filterStatus","filterSearchText","filterAccount","emitMarketDepth"],["class","w-100","nzPlaceHolder","Account","nzAllowClear","",3,"ngModel","ngModelChange",4,"ngIf"],["class","w-100","nzPlaceHolder","Account","nzAllowClear","",3,"nzSuffixIcon","ngModel","ngModelChange",4,"ngIf"],["nzPlaceHolder","Account","nzAllowClear","",1,"w-100",3,"ngModel","ngModelChange"],["nzValue","","nzLabel","All"],[3,"nzValue","nzLabel",4,"ngFor","ngForOf"],[3,"nzValue","nzLabel"],["nzPlaceHolder","Account","nzAllowClear","",1,"w-100",3,"nzSuffixIcon","ngModel","ngModelChange"],["class","w-100","nzPlaceHolder","Filter By Exchange","nzAllowClear","",3,"ngModel","ngModelChange",4,"ngIf"],["class","w-100","nzPlaceHolder","Filter By Exchange","nzAllowClear","",3,"nzSuffixIcon","ngModel","ngModelChange",4,"ngIf"],["nzPlaceHolder","Filter By Exchange","nzAllowClear","",1,"w-100",3,"ngModel","ngModelChange"],["nzValue","ALL","nzLabel","All"],["nzValue","KLSE","nzLabel","BURSA"],["nzValue","SGX","nzLabel","SGX",4,"ngIf"],["nzValue","HKEX","nzLabel","HKEX"],["nzValue","NASDAQ","nzLabel","NASDAQ"],["nzValue","AMEX","nzLabel","AMEX"],["nzValue","NYSE","nzLabel","NYSE"],["nzValue","BATS","nzLabel","BATS"],["nzValue","USOTC","nzLabel","USOTC",4,"ngIf"],["nzValue","SSE","nzLabel","SSE"],["nzValue","SZSE","nzLabel","SZSE"],["nzValue","LSE","nzLabel","LSE"],["nzValue","SGX","nzLabel","SGX"],["nzValue","USOTC","nzLabel","USOTC"],["nzPlaceHolder","Filter By Exchange","nzAllowClear","",1,"w-100",3,"nzSuffixIcon","ngModel","ngModelChange"],["autocomplete","off"],[3,"nzPrefix","nzSuffix"],["type","search","nz-input","","placeholder","Search for Stock name","name","filterSearch",3,"ngModel","ngModelChange"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[1,"tab","rounded-circle","px-2","py-1","mr-3","text-sm","text-center",3,"title","ngStyle","click"],["nz-icon","","nz-tooltip","","class","ant-input-clear-icon","nzTheme","fill","nzType","close-circle",3,"click",4,"ngIf"],["nz-icon","","nz-tooltip","","nzTheme","fill","nzType","close-circle",1,"ant-input-clear-icon",3,"click"],["nz-icon","","nzType","search",1,"text-black"],["nz-icon","","nzType","right","nzTheme","outline",1,"text-black"]],template:function(e,t){1&e&&h.od(0,zP,40,14,"ng-container",0),2&e&&h.Mc("ngIf",t.selectedStockOption===t.IStockOptionType.ORDER_BOOK)},directives:[p.t,B.a,P.c,P.a,p.A,z.a,TD.a,GD,Lt.d,oe.t,oe.w,Lt.a,p.s,oe.J,oe.u,oe.v,Pn.c,oe.c,Pn.b,p.w,k.b,xt.e],pipes:[p.b],styles:[".tab[_ngcontent-%COMP%]{-moz-user-select:none;user-select:none;color:#000;background-color:#ededed;cursor:pointer}.active[_ngcontent-%COMP%]{background-color:#bd2e26;color:#fff}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function PP(e,t){1&e&&h.nc(0)}function IP(e,t){if(1&e&&(h.pc(0),h.od(1,PP,1,0,"ng-container",10),h.oc()),2&e){h.Dc();const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function kP(e,t){1&e&&h.nc(0)}function AP(e,t){if(1&e&&(h.pc(0),h.od(1,kP,1,0,"ng-container",10),h.oc()),2&e){h.Dc();const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function EP(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",14),h.mc(2,"img",15),h.mc(3,"p",16),h.qc(),h.oc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("src",e.SHARED_IMAGE_PATH+e.UNDER_MAINTENANCE_IMAGE,h.gd)("alt",e.UNDER_MAINTENANCE_IMAGE),h.Ub(1),h.Mc("innerHTML",e.maintenance.message,h.ed)}}function FP(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-stocks-opt-in-cds-acc",18),h.zc("onCreateCdsAccount",(function(t){return h.dd(e),h.Dc(4).createCdsAccount(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(4);h.Ub(1),h.Mc("hasApprovedThirdPartyRelation",e.hasApprovedThirdPartyRelation)("openCdsAccount",e.openCdsAccount)("isPendingLinkCds",e.isPendingLinkCds)("isBumiPutraFieldRequired",e.isBumiPutraFieldRequired)}}const OP=function(){return{height:"500px"}};function UP(e,t){if(1&e&&(h.pc(0),h.rc(1,"nz-row",19),h.rc(2,"nz-row",20),h.rc(3,"nz-col",21),h.mc(4,"img",22),h.qc(),h.rc(5,"nz-col",23),h.rc(6,"h4"),h.qd(7,"We have received your CDS account application. "),h.mc(8,"br"),h.qd(9,"An email will send to notify you once the CDS account is activated. "),h.qc(),h.qc(),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(4);h.Ub(1),h.Mc("ngStyle",h.Rc(4,OP)),h.Ub(2),h.Mc("nzSpan",24),h.Ub(1),h.Mc("src",e.STOCKS_IMAGE_PATH+e.WAITING_ICON_IMAGE,h.gd),h.Ub(1),h.Mc("nzSpan",24)}}function xP(e,t){1&e&&(h.pc(0),h.mc(1,"app-stock-payment-reminder-modal",24),h.oc()),2&e&&(h.Ub(1),h.Mc("modalVisible",!1))}function LP(e,t){if(1&e&&(h.rc(0,"nz-row"),h.od(1,FP,2,4,"ng-container",0),h.od(2,UP,10,5,"ng-container",0),h.od(3,xP,2,1,"ng-container",0),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngIf",!e.isCdsAvailable&&!e.isCdsOpeningProcessing&&!e.isCdsPending&&!e.hasPendingCompleteCdsPayment&&!e.hasPendingProcessCdsAccountOpening||e.isPendingLinkCds),h.Ub(1),h.Mc("ngIf",e.isCdsOpeningProcessing||e.hasPendingCompleteCdsPayment||e.hasPendingProcessCdsAccountOpening),h.Ub(1),h.Mc("ngIf",e.isCdsPending&&!e.hasPendingCompleteCdsPayment&&!e.hasPendingProcessCdsAccountOpening)}}function RP(e,t){if(1&e&&(h.rc(0,"label",35),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function NP(e,t){1&e&&h.nc(0)}function BP(e,t){if(1&e){const e=h.sc();h.rc(0,"button",42),h.zc("click",(function(){return h.dd(e),h.Dc(6).openStreamingInfoModal()})),h.mc(1,"i",43),h.qd(2,"Streaming "),h.qc()}2&e&&h.Mc("nzSize","small")}function _P(e,t){if(1&e&&(h.rc(0,"button",44),h.mc(1,"i",43),h.qd(2,"Streaming "),h.qc()),2&e){h.Dc(6);const e=h.ad(11);h.Mc("nzSize","small")("nzOverlayClassName","stock-stream-tooltip-wrapper hide-tooltip-arrow")("nzTooltipTitle",e)}}function VP(e,t){if(1&e){const e=h.sc();h.rc(0,"button",45),h.zc("click",(function(){return h.dd(e),h.Dc(6).showExtendView()})),h.mc(1,"i",46),h.qc()}2&e&&h.Mc("nzSize","small")}function HP(e,t){if(1&e){const e=h.sc();h.rc(0,"div",36),h.rc(1,"button",37),h.zc("mouseover",(function(){return h.dd(e),h.Dc(5).refreshLiveSnap()}))("mouseout",(function(){return h.dd(e),h.Dc(5).setIsLiveSnapInfoShow(!1)})),h.mc(2,"img",38),h.qd(3,"Live Snap "),h.qc(),h.od(4,NP,1,0,"ng-container",10),h.od(5,BP,3,1,"button",39),h.od(6,_P,3,3,"button",40),h.od(7,VP,2,1,"button",41),h.qc()}if(2&e){const e=h.Dc(5),t=h.ad(18);h.Ub(1),h.Mc("nzSize","small"),h.Ub(1),h.Mc("src","assets/images/stocks/snap.svg",h.gd),h.Ub(2),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngIf",!e.shouldHide),h.Ub(1),h.Mc("ngIf",e.shouldHide),h.Ub(1),h.Mc("ngIf",e.selectedStockOption===e.IStockOptionType.PRICE)}}function $P(e,t){1&e&&h.mc(0,"div")}function jP(e,t){1&e&&h.mc(0,"div")}function GP(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",30),h.rc(2,"div",31),h.rc(3,"nz-radio-group",32),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(4).selectedStockOption=t})),h.od(4,RP,2,2,"label",33),h.qc(),h.qc(),h.od(5,HP,8,6,"div",34),h.qc(),h.od(6,$P,1,0,"div",10),h.od(7,jP,1,0,"div",10),h.qc()}if(2&e){const e=h.Dc(4),t=h.ad(15),n=h.ad(13);h.Ub(3),h.Mc("ngModel",e.selectedStockOption),h.Ub(1),h.Mc("ngForOf",e.stockTradeOptions),h.Ub(1),h.Mc("ngIf",e.selectedStockOption===e.IStockOptionType.PRICE||e.selectedStockOption===e.IStockOptionType.PORTFOLIO),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngTemplateOutlet",n)}}function WP(e,t){1&e&&h.mc(0,"div")}function YP(e,t){1&e&&h.mc(0,"div")}function KP(e,t){if(1&e&&(h.pc(0),h.od(1,WP,1,0,"div",10),h.od(2,YP,1,0,"div",10),h.oc()),2&e){h.Dc(4);const e=h.ad(15),t=h.ad(13);h.Ub(1),h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function XP(e,t){if(1&e&&(h.mc(0,"investment-account-selector",47),h.Ec(1,"async")),2&e){const e=h.Dc(4);h.Mc("isStockPage",!0)("selectedExchange",e.selectedExchange)("hidePP",!(!h.Fc(1,3,e.isMobile$)||e.selectedStockOption!==e.IStockOptionType.PORTFOLIO))}}function QP(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-stocks-order-book",48),h.zc("emitMarketDepthAction",(function(t){return h.dd(e),h.Dc(4).emitMarketDepthAction(t)}))("handleCdsAccountReactivation",(function(t){return h.dd(e),h.Dc(4).reactivateCdsAccount(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(4);h.Ub(1),h.Mc("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("lsClient",e.lsClient)("selectedStockOption",e.selectedStockOption)("isAcctAllowScheduledSell",e.isAcctAllowScheduledSell)("cdsAccountReactivateSuccess",e.isCdsReactivateProcessing)("cdsAccountPendingTrigger",e.isCdsReactivatePendingTrigger)}}const ZP=function(e){return{"mt-2":e}};function JP(e,t){if(1&e){const e=h.sc();h.pc(0),h.od(1,GP,8,5,"div",0),h.Ec(2,"async"),h.od(3,KP,3,2,"ng-container",0),h.Ec(4,"async"),h.rc(5,"div",25),h.Ec(6,"async"),h.rc(7,"div",26),h.od(8,XP,2,5,"investment-account-selector",27),h.Ec(9,"async"),h.rc(10,"app-stocks-price",28),h.zc("emitTimeAndSalesAction",(function(t){return h.dd(e),h.Dc(3).emitTimeAndSalesAction(t)}))("emitMarketDepthAction",(function(t){return h.dd(e),h.Dc(3).emitMarketDepthAction(t)}))("emitSummaryAction",(function(t){return h.dd(e),h.Dc(3).emitSummaryAction(t)}))("emitSelectedExchange",(function(t){return h.dd(e),h.Dc(3).selectedExchangeChange(t)}
5))("changeExtendView",(function(t){return h.dd(e),h.Dc(3).handleExtendView(t)}))("handleCdsAccountReactivation",(function(t){return h.dd(e),h.Dc(3).reactivateCdsAccount(t)})),h.qc(),h.od(11,QP,2,6,"ng-container",0),h.rc(12,"app-stocks-portfolio",29),h.zc("handleCdsAccountReactivation",(function(t){return h.dd(e),h.Dc(3).reactivateCdsAccount(t)}))("emitMarketDepthAction",(function(t){return h.dd(e),h.Dc(3).emitMarketDepthAction(t)})),h.qc(),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("ngIf",!h.Fc(2,22,e.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(4,24,e.isMobile$)),h.Ub(2),h.Mc("ngClass",h.Sc(30,ZP,!h.Fc(6,26,e.isMobile$))),h.Ub(3),h.Mc("ngIf",h.Fc(9,28,e.isMobile$)&&(e.selectedStockOption===e.IStockOptionType.PRICE||e.selectedStockOption===e.IStockOptionType.ORDER_BOOK||e.selectedStockOption===e.IStockOptionType.PORTFOLIO)),h.Ub(2),h.Mc("proceedtoRedirectHKEXFlag",e.proceedtoRedirectHKEXFlag)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("lsClient",e.lsClient)("isLsAlive",e.isLivefeedAlive)("isExtendedMode",e.extendViewVisible)("cdsAccountReactivateSuccess",e.isCdsReactivateProcessing)("cdsAccountPendingTrigger",e.isCdsReactivatePendingTrigger)("selectedStockOption",e.selectedStockOption)("klseLeveragedInverseStockList",e.klseLeveragedInverseStockList)("isAcctAllowScheduledSell",e.isAcctAllowScheduledSell),h.Ub(1),h.Mc("ngIf",e.selectedStockOption===e.IStockOptionType.ORDER_BOOK),h.Ub(1),h.Mc("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("lsClient",e.lsClient)("selectedStockOption",e.selectedStockOption)("cdsAccountReactivateSuccess",e.isCdsReactivateProcessing)("cdsAccountPendingTrigger",e.isCdsReactivatePendingTrigger)("klseLeveragedInverseStockList",e.klseLeveragedInverseStockList)("isAcctAllowScheduledSell",e.isAcctAllowScheduledSell)}}function eI(e,t){if(1&e&&(h.pc(0),h.od(1,LP,4,3,"nz-row",0),h.mc(2,"app-cds-account-opening-success-modal",17),h.od(3,JP,13,32,"ng-container",0),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",!e.isCdsAcctLoading),h.Ub(1),h.Mc("isFromAccountOpening",!1)("isCashAccountPayment",e.isCashAccountPayment)("isVisible",e.isCdsAccountOpeningReactivationSuccessModalVisible)("content",e.cdsAccountOpeningReactivationSuccessModalContent),h.Ub(1),h.Mc("ngIf",e.isCdsAvailable&&!e.isPendingLinkCds)}}const tI=function(){return{rows:10}};function nI(e,t){if(1&e&&(h.rc(0,"div",11),h.mc(1,"fpx-submit-form",12),h.mc(2,"nz-skeleton",13),h.od(3,EP,4,3,"ng-container",0),h.od(4,eI,4,6,"ng-container",0),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("fpxPaymentDetails",e.fpxPaymentDetails),h.Ub(1),h.Mc("nzActive",!0)("nzLoading",e.isLoading||e.isCdsAcctLoading)("nzParagraph",h.Rc(6,tI)),h.Ub(1),h.Mc("ngIf",(null==e.maintenance?null:e.maintenance.enabled)===e.MAINTENANCE_TRUE&&!e.isLoading&&!e.isCdsAcctLoading),h.Ub(1),h.Mc("ngIf",!(null!=e.maintenance&&e.maintenance.enabled===e.MAINTENANCE_TRUE||e.isLoading||e.isCdsAcctLoading||e.isLoadingAccDetails))}}function iI(e,t){if(1&e&&(h.rc(0,"div",49),h.rc(1,"div",50),h.rc(2,"div",51),h.rc(3,"h5",52),h.qd(4),h.qc(),h.mc(5,"app-stocks-streaming-indicator",53),h.qc(),h.rc(6,"div",51),h.rc(7,"h5",52),h.qd(8),h.qc(),h.mc(9,"app-stocks-streaming-indicator",53),h.qc(),h.rc(10,"div",51),h.rc(11,"h5",52),h.qd(12,"NASDAQ,NYSE,AMEX,BATS"),h.qc(),h.mc(13,"app-stocks-streaming-indicator",53),h.qc(),h.rc(14,"div",51),h.rc(15,"h5",52),h.qd(16,"SGX"),h.qc(),h.mc(17,"app-stocks-streaming-indicator",53),h.qc(),h.rc(18,"div",51),h.rc(19,"h5",52),h.qd(20,"SSE,SZSE"),h.qc(),h.mc(21,"app-stocks-streaming-indicator",53),h.qc(),h.rc(22,"div",51),h.rc(23,"h5",52),h.qd(24,"LSE"),h.qc(),h.mc(25,"app-stocks-streaming-indicator",53),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(4),h.rd(e.BURSA),h.Ub(1),h.Mc("exchange",e.BURSA),h.Ub(3),h.rd(e.HKEX),h.Ub(1),h.Mc("exchange",e.HKEX),h.Ub(4),h.Mc("exchange",e.AMEX),h.Ub(4),h.Mc("exchange",e.SGX),h.Ub(4),h.Mc("exchange",e.SSE),h.Ub(4),h.Mc("exchange",e.LSE)}}const cI=function(e){return{"bg-white px-2 pt-3":e}},oI=function(e){return{"mb-2":e}};function sI(e,t){if(1&e){const e=h.sc();h.rc(0,"div",56),h.Ec(1,"async"),h.rc(2,"div",57),h.Ec(3,"async"),h.mc(4,"img",58),h.rc(5,"div",59),h.rc(6,"span"),h.qd(7),h.qc(),h.qc(),h.rc(8,"i",60),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).closeBanner(t)})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Mc("ngClass",h.Sc(9,cI,h.Fc(1,5,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(11,oI,!h.Fc(3,7,t.isMobile$))),h.Ub(2),h.Mc("src","assets/images/stocks/speaker.svg",h.gd),h.Ub(1),h.Mc("id",e.id),h.Ub(2),h.rd(e.message)}}function aI(e,t){if(1&e&&(h.rc(0,"div"),h.od(1,sI,9,13,"div",55),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngIf",e&&(null==e?null:e.enabled)===n.MAINTENANCE_TRUE&&!n.isLoading)}}function lI(e,t){if(1&e&&h.od(0,aI,2,1,"div",54),2&e){const e=h.Dc();h.Mc("ngForOf",e.banners)}}function rI(e,t){1&e&&(h.rc(0,"span",64),h.qd(1,"Live price updates may be unavailable due to a browser cookie issue. If you experience problems, please try clearing your browser cookies. We apologise for the inconvenience and are working to resolve all issues promptly."),h.qc())}function dI(e,t){1&e&&(h.rc(0,"span",64),h.qd(1,"Your current live trading session has been disconnected due to other active sessions detected. To resume live prices, kindly refresh your page or app. "),h.qc())}function uI(e,t){if(1&e&&(h.rc(0,"div",56),h.Ec(1,"async"),h.rc(2,"div",61),h.Ec(3,"async"),h.mc(4,"i",62),h.od(5,rI,2,0,"span",63),h.od(6,dI,2,0,"span",63),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("ngClass",h.Sc(8,cI,h.Fc(1,4,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(10,oI,!h.Fc(3,6,e.isMobile$))),h.Ub(3),h.Mc("ngIf",!e.isDupl
5icateLogin),h.Ub(1),h.Mc("ngIf",e.isDuplicateLogin)}}function hI(e,t){if(1&e&&h.od(0,uI,7,12,"div",55),2&e){const e=h.Dc();h.Mc("ngIf",!e.isLivefeedAlive)}}function pI(e,t){if(1&e&&(h.rc(0,"div",71),h.rc(1,"p",72),h.qd(2),h.qc(),h.rc(3,"p",73),h.qd(4,"You will get live snap services"),h.mc(5,"br"),h.qd(6,"(30 snap), upon a successful filled trade."),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd("HKEX Live Snap(s) Available: ",e.snapCountL3+e.snapCountL2,"")}}function mI(e,t){if(1&e&&(h.rc(0,"div",71),h.rc(1,"p",72),h.qd(2),h.qc(),h.rc(3,"p",72),h.qd(4),h.qc(),h.rc(5,"p",73),h.qd(6,"You will get L2 live snap services"),h.mc(7,"br"),h.qd(8,"(30 snap), upon a successful filled trade."),h.qc(),h.qc()),2&e){const e=h.Dc(3);h.Ub(2),h.sd("HKEX L1 Live Snap(s) Available: ",e.snapCountL1,""),h.Ub(2),h.sd("HKEX L2 Live Snap(s) Available: ",e.snapCountL3+e.snapCountL2,"")}}function fI(e,t){if(1&e&&(h.rc(0,"div",66),h.rc(1,"div",67),h.mc(2,"div",68),h.rc(3,"div",69),h.od(4,pI,7,1,"div",70),h.od(5,mI,9,2,"div",70),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(4),h.Mc("ngIf",e.shouldHide),h.Ub(1),h.Mc("ngIf",!e.shouldHide)}}function gI(e,t){if(1&e&&h.od(0,fI,6,2,"div",65),2&e){const e=h.Dc();h.Mc("ngIf",e.isLiveSnapInfoShow)}}function bI(e,t){if(1&e){const e=h.sc();h.rc(0,"stocks-streaming-info-modal",74),h.zc("close",(function(){return h.dd(e),h.Dc().closeStreamingModal()})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc();h.Mc("isMobile",h.Fc(1,3,e.isMobile$))("isVisible",e.streamingInfoModalVisible)("isTradingPage",e.isTradingPage)}}let SI=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l,r,u,p,m,f,g,b,S,y,v,C,q,T,w,z){this.transactionService=e,this.store=t,this.trustAccountRestService=n,this.accountService=i,this.cdsAccountRestService=c,this.subHandlingService=o,this.activatedRoute=s,this.router=a,this.fpxRestService=l,this.paymentRestService=r,this.stockInvestmentObjectiveRestService=u,this.announcementRestService=p,this.standardDatePipe=m,this.datePipe=f,this.decimalPipe=g,this.nzNotification=b,this.accountRestService=S,this.stocksLeveragedInverseService=y,this.stocksInfoRestService=v,this.liveFeedService=C,this.scheduledSellRestService=q,this.mdfRestService=T,this.utilityRestService=w,this.stockAccountRestService=z,this.emitTimeAndSalesActionToTrade=new h.s,this.cdsAvailabilityEmitter=new h.s,this.emitMarketDepthToTrade=new h.s,this.emitSummaryToTrade=new h.s,this.emitExchangeOnChange=new h.s,this.isLivefeedAlive=!0,this.isDuplicateLogin=!1,this.proceedtoRedirectHKEXFlag=!1,this.streamingInfoModalVisible=!1,this.isTradingPage=!0,this.STOCKS_IMAGE_PATH=M.g.STOCKS_IMG_PATH,this.SHARED_IMAGE_PATH=M.g.SHARED_IMG_PATH,this.UNDER_MAINTENANCE_IMAGE="under-maintenance.svg",this.WAITING_ICON_IMAGE="waiting-icon.svg",this.MAINTENANCE_TRUE="Y",this.NOTIFICATION_TITLE_ERROR="Error",this.FPX_SUCCESS_CODE="00",this.IStockOptionType=d.c,this.stockTradeOptions=[{value:d.c.PRICE,label:"Prices"},{value:d.c.ORDER_BOOK,label:"Order Book"},{value:d.c.PORTFOLIO,label:"Portfolio"}],this.selectedStockOption=d.c.PRICE,this.extendViewVisible=!1,this.primaryCashAcctAvailableBalance=0,this.maintenance={},this.banners=[],this.isBannerVisible=!0,this.currentHeight=0,this.scrollToBottom=!0,this.autoScrollCounter=0,this.isLoading=!0,this.isCdsAcctLoading=!1,this.hasApprovedThirdPartyRelation=!1,this.isCashAccountPayment=!1,this.isCashAcctAvailable=!1,this.isCdsOpeningProcessing=!1,this.hasPendingProcessCdsAccountOpening=!1,this.isCdsAvailable=!1,this.isPendingLinkCds=!1,this.showCdsLinkModalSuccess=!1,this.isCdsPending=!1,this.hasPendingCompleteCdsPayment=!1,this.isCdsAccountOpeningReactivationSuccessModalVisible=!1,this.fpxInfo={},this.cdsAccountOpeningReactivationSuccessModalContent=[],this.selectedExchange=M.q.KLSE,this.BURSA=M.q.BURSA,this.KLSE=M.q.KLSE,this.HKEX=M.q.HKEX,this.AMEX=M.q.AMEX,this.SGX=M.q.SGX,this.SSE=M.q.SSE,this.LSE=M.q.LSE,this.CDS=M.a.CDS,this.isHkexLivestreaming=!1,this.isLiveSnapInfoShow=!1,this.klseLeveragedInverseStockList=[],this.isAcctAllowScheduledSell=!1,this.isSkipCdsFee=!1,this.systemSstRate=0,this.shouldHide=!0}ngOnInit(){this.stockAccountRestService.enableMarketData().subscribe(e=>{!1===e.data?this.shouldHide=!0:!0===e.data&&(this.shouldHide=!1)}),this.accountRestService.checkIsSkipCdsFee().subscribe(e=>{this.isSkipCdsFee=e.data,console.log("is skip cds fee: ",this.isSkipCdsFee)}),this.store.dispatch(new u.U(r.b.STOCK_AND_ETF)),this.store.dispatch(new u.N(this.accountService.getTradableAccountRefno)),this.isHkexLivestreaming=this.liveFeedService.checkStreaming(M.q.HKEX),this.screenWidth=screen.width,this.subHandlingService.once(this.announcementRestService.findWebAnnouncementList().pipe(Object(y.a)(e=>{var t;
5e.status===M.a.RESPONSE_SUCCESS&&e.data&&e.data.forEach(e=>{e.announcementType===pv.STOCK_MAINTENANCE&&(this.maintenance=e),e.announcementType===pv.STOCK_BANNER_WEB&&this.banners.push(e)}),console.log("MAINTAINENCE",this.maintenance),null==this.maintenance||(null===(t=this.maintenance)||void 0===t?void 0:t.enabled)!==this.MAINTENANCE_TRUE?this.subscribeParam():this.isLoading=!1,this.banners.forEach(e=>{e&&(null==e?void 0:e.enabled)===this.MAINTENANCE_TRUE&&!this.isLoading&&setTimeout(()=>{setInterval(()=>{this.autoScrollBanner(e)},250)},5e3)})}))),Ru.a.rspEtfEnabled&&this.checkIsAcctAllowScheduledSell(),this.handleRedirection(),this.getSystemSstRate()}getSystemSstRate(){this.utilityRestService.getSstRate().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS?this.systemSstRate=e.data:console.error("[getSystemSstRate] error retrieving system sst rate")})}handleRedirection(){switch(this.router.url.split("/").pop()){case M.o.STOCKS_PORTFOLIO:this.selectedStockOption=d.c.PORTFOLIO;break;case M.o.STOCKS_ORDERBOOK:this.selectedStockOption=d.c.ORDER_BOOK;break;default:this.selectedStockOption=d.c.PRICE}}subscribeParam(){this.isLoading=!0,console.log("waiting over ehre"),this.subHandlingService.once(this.activatedRoute.queryParams.pipe(Object(y.a)(e=>{console.log("res",e),(null==e?void 0:e.poNumber)&&this.getFpxInfo(e.poNumber),(null==e?void 0:e.openCdsAccount)&&(this.openCdsAccount=e.openCdsAccount),this.getCdsAccountDetails(),this.getAccountDetails()}),Object(uv.a)(()=>{this.isLoading=!1})))}getCdsAccountDetails(){this.isLoading=!0,this.isCdsAcctLoading=!0;const e=this.accountService.getTradableAccountRefno,t=this.trustAccountRestService.findActiveTrustAccount(e),n=this.cdsAccountRestService.getCdsAccount(e),i=this.stocksInfoRestService.getLeveragedAndInverseStockList(M.q.KLSE);e?(console.log("BEFORE calling api"),this.subHandlingService.once(Object(ht.a)([t,n,i]).pipe(Object(y.a)(e=>{console.log(e),e[0]&&(e[0].length>0&&(this.primaryCashAcctAvailableBalance=e[0].availableBalance),this.isCashAcctAvailable=this.checkCashAcctAvailability(e[0])),e[1].status===M.a.RESPONSE_SUCCESS&&(e[1].data.cdsAccountBean&&(this.isCdsAvailable=!0,this.cdsAvailabilityEmitter.emit(this.isCdsAvailable)),e[1].data.hasProcessingCdsAccountOpening&&(this.isCdsOpeningProcessing=!0),e[1].data.hasPendingProcessCdsAccountOpening&&(this.hasPendingProcessCdsAccountOpening=!0),void 0!==e[1].data.stockLiRiskDisclosureAccepted&&this.stocksLeveragedInverseService.setStockLiRiskDisclosureAccepted(e[1].data.stockLiRiskDisclosureAccepted),void 0!==e[1].data.stockLiDocumentSubmitted&&this.stocksLeveragedInverseService.setStockLiDocumentSubmitted(e[1].data.stockLiDocumentSubmitted),e[1].data.pendingCdsPayment&&(this.isCdsPending=!0),e[1].data.hasPendingCompleteCdsPayment&&(this.hasPendingCompleteCdsPayment=!0),e[1].data.pendingLinkCds&&(this.isPendingLinkCds=e[1].data.pendingLinkCds)),e[2].status===M.a.RESPONSE_SUCCESS&&(this.klseLeveragedInverseStockList=e[2].data)}),Object(uv.a)(()=>{this.isCdsAvailable||this.isCdsOpeningProcessing?(this.isLoading=!1,this.isCdsAcctLoading=!1):this.checkApprovedThirdPartyRelationAllowed()})))):(this.isLoading=!1,this.isCdsAcctLoading=!1)}checkApprovedThirdPartyRelationAllowed(){this.subHandlingService.once(this.cdsAccountRestService.hasApprovedThirdPartyRelation(this.accountService.primaryAccount.nric).pipe(Object(y.a)(e=>{this.hasApprovedThirdPartyRelation=e.data}),Object(uv.a)(()=>{this.isLoading=!1,this.isCdsAcctLoading=!1})))}createCdsAccount(e){this.isCdsAcctLoading=!0;const t=this.accountService.getTradableAccountRefno,n=this.cdsAccountRestService.createCdsAccount(t,{mode:e.mode},e.bumiPutraFlag,e.relatedToIfastStaffFlag,this.isSkipCdsFee),i=this.stockInvestmentObjectiveRestService.createInvestmentObjective(t,e.stockInvestmentObjective.investmentObjective,e.stockInvestmentObjective.riskTolerance,e.stockInvestmentObjective.yearExperienceOpt);this.subHandlingService.once(Object(ht.a)([n,i]).pipe(Object(y.a)(e=>{e[1].status!==M.a.RESPONSE_SUCCESS&&this.nzNotification.error(this.NOTIFICATION_TITLE_ERROR,"Unable to insert stock
5investment objective.")}),Object(F.a)(n=>{if(n[0].status===M.a.RESPONSE_SUCCESS&&n[0].data)if(e.mode===d.b.FPX&&e.fpxReqestData){if(!this.isSkipCdsFee)return e.fpxReqestData.fpxSellerOrderNo=n[0].data,this.paymentRestService.preSubmit(t,!0,e.fpxReqestData);this.transactionService.setLastVisitedUrl(this.router.url),this.getCdsAccountDetails()}else e.mode===d.b.TRUST?(this.formatAndShowCdsAccountOpeningReactivationSuccessModal(n[0].data,e.mode,hv.a.CDS_FEE),this.getCdsAccountDetails()):e.mode===d.b.LINK&&(this.showCdsLinkModalSuccess=!0);else this.nzNotification.error("Error","High risk country"===n[0].errorCode||"not.allow.to.open.cds.account"===n[0].errorCode?'We are sorry that we are unable to process your CDS account application. Please contact our customer service at 03-21490567 or write to us at <a href="mailto:[email protected]">[email protected]</a> for assistance. ':"Unable to create CDS Account."),e.mode===d.b.TRUST&&this.getCdsAccountDetails();return dv.a}),Object(y.a)(e=>{this.isSkipCdsFee||M.a.RESPONSE_SUCCESS===(null==e?void 0:e.status)&&(this.fpxPaymentDetails=Object(g.a)(e.data),this.transactionService.setLastVisitedUrl(this.router.url))}),Object(uv.a)(()=>{this.isCdsAcctLoading=!1})))}reactivateCdsAccount(e){const t=this.accountService.getTradableAccountRefno;this.subHandlingService.once(this.cdsAccountRestService.createCdsAccountReactivate(t,e.mode).pipe(Object(F.a)(n=>{if(n.status===M.a.RESPONSE_SUCCESS&&n.data){if(e.mode===d.b.FPX&&e.fpxRequestData)return e.fpxRequestData.fpxSellerOrderNo=n.data,this.paymentRestService.preSubmit(t,!0,e.fpxRequestData);e.mode===d.b.TRUST?(this.formatAndShowCdsAccountOpeningReactivationSuccessModal(n.data,e.mode,this.systemSstRate>0?hv.a.CDS_REACTIVATION_FEE_SST:hv.a.CDS_REACTIVATION_FEE),this.isCdsReactivateProcessing=!0):e.mode===d.b.LINK&&(this.isCdsReactivateProcessing=!0,this.isCdsReactivatePendingTrigger=!0)}else this.nzNotification.error("Error","Unable to reactivate CDS Account.");return dv.a}),Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===(null==e?void 0:e.status)&&(this.fpxPaymentDetails=Object(g.a)(e.data),this.transactionService.setLastVisitedUrl(this.router.url))})))}formatAndShowCdsAccountOpeningReactivationSuccessModal(e,t,n){this.cdsAccountOpeningReactivationSuccessModalContent.push({label:"Account No",value:t===d.b.FPX?this.fpxInfo.buyerRefno:this.accountService.getTradableAccountRefno});let i=new Date;t===d.b.FPX?(this.cdsAccountOpeningReactivationSuccessModalContent.push({label:"Bank Name",value:this.fpxInfo.buyerBankName},{label:"FPX Transaction ID",value:e},{label:"Purchase Order No",value:this.fpxInfo.purchaseOrderNo}),i=this.fpxInfo.txDateTime):(this.isCashAccountPayment=!0,this.cdsAccountOpeningReactivationSuccessModalContent.push({label:"Transaction ID",value:e})),this.cdsAccountOpeningReactivationSuccessModalContent.push({label:"Transaction Amount",value:U.a.PAYMENT_CURRENCY_MYR+this.decimalPipe.transform(n,"1.2-2")},{label:"Transaction Date & Time",value:this.standardDatePipe.transform(i)+" "+this.datePipe.transform(i,"mediumTime")}),this.isCdsAccountOpeningReactivationSuccessModalVisible=!0}getFpxInfo(e){this.isLoading=!0,this.subHandlingService.once(this.fpxRestService.getFpxInfo(e).pipe(Object(y.a)(e=>{var t,n;e.status===M.a.RESPONSE_SUCCESS&&(null===(t=e.data)||void 0===t?void 0:t.debitStatusCode)===this.FPX_SUCCESS_CODE&&(null===(n=e.data)||void 0===n?void 0:n.transactionType)===this.CDS&&(this.fpxInfo=e.data,this.formatAndShowCdsAccountOpeningReactivationSuccessModal(this.fpxInfo.fpxTransactionId,d.b.FPX,this.fpxInfo.transactionAmount))}),Object(uv.a)(()=>{this.isLoading=!1})))}checkCashAcctAvailability(e){let t=!1;return null==e||e.forEach(e=>{e.currency===U.a.PAYMENT_CURRENCY_MYR&&e.availableBalance>=+hv.a.CDS_FEE&&(t=!0)}),t}getAccountDetails(){this.isLoadingAccDetails=!0,this.accountService.getTradableAccountRefno?this.subHandlingService.once(this.accountRestService.getDetails(this.accountService.getTradableAccountRefno).pipe(Object(y.a)(e=>{var t,n;this.isLoadingAccDetails=!1,(null==e?void 0:e.status)===M.a.RESPONSE_SUCCESS&&((null===(n=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.iamAccountBean)||void 0===n?void 0:n.bumiputraFlag)||(this.isBumiPutraFieldRequired=!0))}))):this.isLoadingAccDetails=!1}emitTimeAndSalesAction(e){this.emitTimeAndSalesActionToTrade.emit(e)}emitMarketDepthAction(e){this.emitMarketDepthToTrade.emit(e)}emitSummaryAction(e){this.emitSummaryToTrade.emit(e)}selectedExchangeChange(e){this.selectedExchange=e,this.emitExchangeOnChange.emit(e)}showExtendView(){this.extendViewVisible=!0}handleExtendView(e){this.extendViewVisible=e}goBack(){window.history.back()}closeBanner(e){e.enabled="N"}autoScrollBanner(e){let t=document.getElementById(String(e.id));e.enabled&&this.autoScrollCounter<2&&(((null==this?void 0:this.currentHeight)<0||(null==this?void 0:this.currentHeight)>(null==t?void 0:t.scrollHeight))&&(this.scrollToBottom=!this.scrollToBottom,this.autoScrollCounter++),this.scrollToBottom?null==t||t.scrollTo(0,this.currentHeight+=5):null==t||t.scrollTo(0,this.currentHeight-=5))}refreshLiveSnap(){this.liveSnapInfoHoverTimer=setTimeout(()=>{this.setIsLiveSnapInfoShow(!0)},300),this.mdfRestService.getMdfPermission("",M.a.FMY).subscribe(e=>{this.snapCountL3=e.data.result.HKEX.snapL3,this.snapCountL1=e.data.result.HKEX.snapL1,this.snapCountL2=e.data.result.HKEX.snapL2})}setIsLiveSnapInfoShow(e){e||clearTimeout(this.liveSnapInfoHoverTimer),this.isLiveSnapInfoShow=e}checkIsAcctAllowScheduledSell(){this.scheduledSellRestService.checkIsScheduledSellAllow(this.accountService.getTradableAccountRefno,M.q.ETF_PRODUCT_TYPE).subscribe(e=>{this.isAcctAllowScheduledSell=e.data})}openStreamingInfoModal(){this.streamingInfoModalVisible=!0}closeStreamingModal(){this.streamingInfoModalVisible=!1}}return e.\u0275fac=function(t){return new(t||e)(h.lc(C.a),h.lc(s.i),h.lc(mv.a),h.lc(pm.a),h.lc(bm.a),h.lc(l.a),h.lc(c.a),h.lc(c.e),h.lc(Eu.a),h.lc(Au.a),h.lc(fv.a),h.lc(bv),h.lc(_c.a),h.lc(p.f),h.lc(p.g),h.lc(Sc.b),h.lc(bt.a),h.lc(Sv.a),h.lc(Dg.a),h.lc(hm.a),h.lc(yv.a),h.lc(Mt.a),h.lc(w.a),h.lc(vv.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-stocks-trade"]],inputs:{lsClient:"lsClient",isLivefeedAlive:"isLivefeedAlive",isDupl
vendor: 4,950 bytes, line 5
5icateLogin:"isDuplicateLogin",proceedtoRedirectHKEXFlag:"proceedtoRedirectHKEXFlag"},outputs:{emitTimeAndSalesActionToTrade:"emitTimeAndSalesActionToTrade",cdsAvailabilityEmitter:"cdsAvailabilityEmitter",emitMarketDepthToTrade:"emitMarketDepthToTrade",emitSummaryToTrade:"emitSummaryToTrade",emitExchangeOnChange:"emitExchangeOnChange"},features:[h.Tb([l.a,_c.a,p.f,p.g])],decls:20,vars:10,consts:[[4,"ngIf"],[1,"border-bottom"],[3,"title","back"],["routerTemplate",""],["livestreaming",""],["announcementTemplate",""],["livefeedNoticeTemplate",""],[3,"showModal","isTradingPage"],["liveSnapInfo",""],[3,"isMobile","isVisible","isTradingPage","close",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"stocks-trade"],[3,"fpxPaymentDetails"],[3,"nzActive","nzLoading","nzParagraph"],[1,"h-100","w-100","text-center","my-6","py-6","container"],[3,"src","alt"],[1,"pt-5","font-weight-normal","text-base",3,"innerHTML"],[3,"isFromAccountOpening","isCashAccountPayment","isVisible","content"],[3,"hasApprovedThirdPartyRelation","openCdsAccount","isCdsAccountOpeningLoading","isPendingLinkCds","isBumiPutraFieldRequired","onCreateCdsAccount"],["nzType","flex","nzAlign","middle",3,"ngStyle"],[1,"w-100"],[1,"text-center","mb-3",3,"nzSpan"],["alt","cds-account-processing",3,"src"],[1,"text-center",3,"nzSpan"],[3,"modalVisible"],["nz-row","",3,"ngClass"],["nz-col",""],[3,"isStockPage","selectedExchange","hidePP",4,"ngIf"],[3,"proceedtoRedirectHKEXFlag","primaryCashAcctAvailableBalance","lsClient","isLsAlive","isExtendedMode","cdsAccountReactivateSuccess","cdsAccountPendingTrigger","selectedStockOption","klseLeveragedInverseStockList","isAcctAllowScheduledSell","emitTimeAndSalesAction","emitMarketDepthAction","emitSummaryAction","emitSelectedExchange","changeExtendView","handleCdsAccountReactivation"],[3,"primaryCashAcctAvailableBalance","lsClient","selectedStockOption","cdsAccountReactivateSuccess","cdsAccountPendingTrigger","klseLeveragedInverseStockList","isAcctAllowScheduledSell","handleCdsAccountReactivation","emitMarketDepthAction"],["nz-row",""],["nz-col","","nzSpan","14",1,"mb-2"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["nz-radio-button","","class","px-4",3,"nzValue",4,"ngFor","ngForOf"],["nz-col","","nzSpan","10","class","pointer text-right font-weight-bold text-primary",4,"ngIf"],["nz-radio-button","",1,"px-4",3,"nzValue"],["nz-col","","nzSpan","10",1,"pointer","text-right","font-weight-bold","text-primary"],["nz-button","","nzOutline","","nzType","primary","nz-tooltip","",1,"mr-2",3,"nzSize","mouseover","mouseout"],["alt","snap",1,"mr-2",2,"width","16px","height","auto",3,"src"],["nz-button","","nzOutline","","nzType","primary","class","mr-2",3,"nzSize","click",4,"ngIf"],["nz-button","","nzOutline","","nzType","primary","class","mr-2","nzTooltipPlacement","bottomRight","nz-tooltip","",3,"nzSize","nzOverlayClassName","nzTooltipTitle",4,"ngIf"],["nz-button","","nzOutline","","nzType","primary",3,"nzSize","click",4,"ngIf"],["nz-button","","nzOutline","","nzType","primary",1,"mr-2",3,"nzSize","click"],["nz-icon","","nzTheme","outline","nzType","info-circle"],["nz-button","","nzOutline","","nzType","primary","nzTooltipPlacement","bottomRight","nz-tooltip","",1,"mr-2",3,"nzSize","nzOverlayClassName","nzTooltipTitle"],["nz-button","","nzOutline","","nzType","primary",3,"nzSize","click"],["nz-icon","","nzType","fullscreen","nzTheme","outline",1,"text-primary"],[3,"isStockPage","selectedExchange","hidePP"],[3,"primaryCashAcctAvailableBalance","lsClient","selectedStockOption","isAcctAllowScheduledSell","cdsAccountReactivateSuccess","cdsAccountPendingTrigger","emitMarketDepthAction","handleCdsAccountReactivation"],[1,"stock-tooltip"],[1,"d-flex"],[1,"mr-3"],[1,"text-black","font-weight-bold"],[3,"exchange"],[4,"ngFor","ngForOf"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[1,"d-flex","align-items-start","bg-stock-alert","px-2","py-2",2,"border-radius","5px",3,"ngClass"],["alt","speaker",1,"text-info","text-md","ml-2","mt-1",3,"src"],[1,"vertical-scrollable","text-base","pl-3",3,"id"],["nz-icon","","nzType","close","nzTheme","outline",1,"anticon","text-base","ml-2","mt-1","mr-2","anticon-close","pointer",3,"click"],[1,"d-flex","align-items-center","bg-stock-alert","px-2","py-2",2,"border-radius","5px",3,"ngClass"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-info","text-md","ml-2","mt-1"],["class","text-base py-1 pl-3",4,"ngIf"],[1,"text-base","py-1","pl-3"],["class","ant-popover ant-popover-placement-bottom position-absolute w-70","style","margin-top: 2rem !important;",4,"ngIf"],[1,"ant-popover","ant-popover-placement-bottom","position-absolute","w-70",2,"margin-top","2rem !important"],[1,"ant-popover-content"],[1,"pop-up-arrow","ant-popover-arrow","bg-white"],["role","tooltip",1,"ant-popover-inner","bg-white"],["class","ant-popover-inner-content",4,"ngIf"],[1,"ant-popover-inner-content"],[1,"text-base","font-weight-bold"],[1,"text-sm"],[3,"isMobile","
5isVisible","isTradingPage","close"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,IP,2,1,"ng-container",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.rc(4,"div",1),h.rc(5,"b2c-app-bar-2",2),h.zc("back",(function(){return t.goBack()})),h.qc(),h.qc(),h.od(6,AP,2,1,"ng-container",0),h.Ec(7,"async"),h.qc(),h.od(8,nI,5,7,"ng-template",null,3,h.pd),h.od(10,iI,26,8,"ng-template",null,4,h.pd),h.od(12,lI,1,1,"ng-template",null,5,h.pd),h.od(14,hI,1,1,"ng-template",null,6,h.pd),h.mc(16,"app-stocks-cds-link-success-modal",7),h.od(17,gI,1,1,"ng-template",null,8,h.pd),h.od(19,bI,2,5,"stocks-streaming-info-modal",9)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,6,t.isMobile$)),h.Ub(4),h.Mc("title","Stocks - Trade"),h.Ub(1),h.Mc("ngIf",h.Fc(7,8,t.isMobile$)),h.Ub(10),h.Mc("showModal",t.showCdsLinkModalSuccess)("isTradingPage",!0),h.Ub(3),h.Mc("ngIf",t.streamingInfoModalVisible))},directives:[B.a,p.t,z.a,D.a,Mv.a,p.A,ch.a,W.a,Cv.a,P.c,qv.a,p.w,P.a,Tv.a,p.q,tw,qD,Ut.c,oe.t,oe.w,p.s,Ut.a,_.a,xt.e,k.b,ut.a,DP,Pg.a,Aq.a],pipes:[p.b],styles:[".bg-stock-alert[_ngcontent-%COMP%]{background-color:#d8e9ff} .stock-stream-tooltip-wrapper.ant-tooltip{max-width:none} .stock-stream-tooltip-wrapper.ant-tooltip .ant-tooltip-inner{max-width:none;background-color:#fff}.vertical-scrollable[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.vertical-scrollable[_ngcontent-%COMP%]{-ms-overflow-style:none;scrollbar-width:none;overflow-y:scroll;max-height:60px}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var yI=n("Qdzq"),vI=n("1G5W"),MI=n("MV2b"),CI=n("qf4f"),qI=n("ORRK"),TI=n("Jioy"),wI=n("TvE7"),zI=n("jFTi"),DI=n("TUIa"),PI=n("CnlF"),II=n("ar4Q"),kI=n("SYWN"),AI=n("p1br");function EI(e,t){1&e&&h.mc(0,"i",13)}function FI(e,t){1&e&&(h.rc(0,"span",14),h.qd(1,"Yield"),h.qc())}function OI(e,t){1&e&&(h.rc(0,"span",14),h.qd(1,"Chg (%)"),h.qc())}const UI=function(e){return{"bid-price-table":e}};function xI(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",10),h.od(2,EI,1,0,"i",11),h.qd(3),h.mc(4,"br"),h.od(5,FI,2,0,"span",12),h.od(6,OI,2,0,"span",12),h.qc(),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Nc("nzSortKey",e.key),h.Mc("nzWidth",null==e?null:e.width)("ngClass",h.Sc(10,UI,"Bid"===e.label))("nzShowSort",!0)("nzLeft",null!=e&&e.nzLeft?"0px":"")("nzAlign",e.align),h.Ub(1),h.Mc("ngIf","Vol"===e.label),h.Ub(1),h.sd("",e.label," "),h.Ub(2),h.Mc("ngIf","Ask"===e.label||"Bid"===e.label||"Last"===e.label),h.Ub(1),h.Mc("ngIf","Chg"===e.label)}}function LI(e,t){if(1&e&&h.mc(0,"app-bond-exchange-tag",32),2&e){const e=h.Dc(3).$implicit;h.Mc("isFullLotType","Y"===(null==e?null:e.bexFullLotEnabled))("isOddLotType","Y"===(null==e?null:e.bexOddLotEnabled))("isRetail","Y"===(null==e?null:e.retailDistribution))}}function RI(e,t){if(1&e&&h.mc(0,"app-bond-exchange-tag",32),2&e){const e=h.Dc(5).$implicit;h.Mc("isFullLotType","Y"===(null==e?null:e.bexFullLotEnabled))("isOddLotType","Y"===(null==e?null:e.bexOddLotEnabled))("isRetail","Y"===(null==e?null:e.retailDistribution))}}function NI(e,t){if(1&e&&(h.mc(0,"app-bond-exchange-tag",38),h.Ec(1,"async")),2&e){const e=h.Dc(6);h.Mc("nzClass",h.Fc(1,2,e.isMobile$)?"t-3xs":"t-2xs")("isLastTradingDay",!0)}}const BI=function(){return{"flex-shrink":0}},_I=function(){return{"line-height":"16px"}};function VI(e,t){if(1&e&&(h.rc(0,"div",24),h.rc(1,"div",25),h.od(2,RI,1,3,"app-bond-exchange-tag",26),h.od(3,NI,2,4,"app-bond-exchange-tag",36),h.qc(),h.qc(),h.rc(4,"div",37),h.mc(5,"span",30),h.Ec(6,"bondName"),h.qc(),h.rc(7,"p",31),h.qd(8),h.qc()),2&e){const e=h.Dc(4).$implicit,t=h.Dc();h.Mc("ngStyle",h.Rc(9,BI)),h.Ub(2),h.Mc("ngIf",t.isBondExchange(e)),h.Ub(1),h.Mc("ngIf",t.isBondExchange(e)&&t.isLastTradingDate(e)),h.Ub(1),h.Mc("ngStyle",h.Rc(10,_I)),h.Ub(1),h.Mc("innerHTML",h.Gc(6,6,e.bondName,t.isBondExchange(e)?null==e?null:e.bexTradingWithoutAi:null==e?null:e.tradingWithoutAi),h.ed),h.Ub(3),h.rd(e.bondIssuer)}}function HI(e,t){if(1&e&&(h.rc(0,"div",33),h.mc(1,"app-bond-exchange-tag",34),h.Ec(2,"async"),h.od(3,VI,9,11,"ng-template",null,35,h.pd),h.qc()),2&e){const e=h.ad(4),t=h.Dc(4);h.Mc("nzTooltipTitle",e)("nzOverlayClassName","last-trading-date-tooltip-wrapper"),h.Ub(1),h.Mc("nzClass",h.Fc(2,5,t.isMobile$)?"t-3xs w-75":"t-2xs w-75")("isLastTradingDay",!0)("nzClassText","live-trading-web")}}function $I(e,t){if(1&e&&h.mc(0,"app-bond-otc-tag",39),2&e){const e=h.Dc(3).$implicit;h.Mc("isRetail","Y"===(null==e?null:e.retailDistribution))}}function jI(e,t){if(1&e&&h.mc(0,"app-bond-express-tag",39),2&e){const e=h.Dc(3).$implicit;h.Mc("isRetail","Y"===(null==e?null:e.retailDistribution))}}function GI(e,t){if(1&e){const e=h.sc();h.rc(0,"td",23),h.rc(1,"div",24),h.rc(2,"div",25),h.od(3,LI,1,3,"app-bond-exchange-tag",26),h.od(4,HI,5,7,"div",27),h.qc(),h.od(5,$I,1,1,"app-bond-otc-tag",28),h.qc(),h.od(6,jI,1,1,"app-bond-express-tag",28),h.rc(7,"div",29),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc().redirectToFactsheetPage(null==t?null:t.issueCode,null==t?null:t.bondName,null==t?null:t.lotType)})),h.mc(8,"span",30),h.Ec(9,"bondName"),h.qc(),h.rc(10,"p",31),h.qd(11),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc().$implicit,n=h.Dc();h.Mc("nzAlign",null==e?null:e.align),h.Ub(1),h.Mc("ngStyle",h.Rc(12,BI)),h.Ub(2),h.Mc("ngIf",n.isBondExchange(t)),h.Ub(1),h.Mc("ngIf",n.isBondExchange(t)&&n.isLastTradingDate(t)),h.Ub(1),h.Mc("ngIf",n.isBondOtc(t)),h.Ub(1),h.Mc("ngIf",n.isBondExpress(t)),h.Ub(1),h.Mc("ngStyle",h.Rc(13,_I)),h.Ub(1),h.Mc("innerHTML",h.Gc(9,9,t.bondName,n.isBondExchange(t)?null==t?null:t.bexTradingWithoutAi:null==t?null:t.tradingWithoutAi),h.ed),h.Ub(3),h.rd(t.bondIssuer)}}function WI(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc(4).$implicit,t=h.Dc().$implicit;h.Mc("ngClass",t.changedColor&&t.changedColor.lastPrice?t.changedColor[e.key]:"text-profit px-2 py-1"),h.Ub(1),h.sd(" ",h.Fc(2,2,t[e.key]),"")}}function YI(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc(4).$implicit,t=h.Dc().$implicit;h.Mc("ngClass",t.changedColor&&t.changedColor.lastPrice?t.changedColor[e.key]:"text-loss px-2 py-1"),h.Ub(1),h.sd(" ",h.Fc(2,2,t[e.key]),"")}}function KI(e,t){if(1&e&&(h.pc(0),h.od(1,WI,3,4,"span",45),h.od(2,YI,3,4,"span",45),h.oc()),2&e){const e=h.Dc(4).$implicit;h.Ub(1),h.Mc("ngIf",e.netChange>0),h.Ub(1),h.Mc("ngIf",e.netChange<0)}}function XI(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit;h.Mc("ngClass",t.changedColor&&t.changedColor.lastPrice?t.changedColor.lastPrice:" px-2 py-1"),h.Ub(1),h.sd(" ",h.Fc(2,2,t[e.key]),"")}}
5function QI(e,t){if(1&e&&(h.pc(0),h.od(1,KI,3,2,"ng-container",8),h.od(2,XI,3,4,"ng-template",null,43,h.pd),h.mc(4,"br"),h.rc(5,"span",44),h.qd(6),h.Ec(7,"bondPrice"),h.qc(),h.oc()),2&e){const e=h.ad(3),t=h.Dc(3).$implicit;h.Ub(1),h.Mc("ngIf",t.netChange>0||t.netChange<0)("ngIfElse",e),h.Ub(5),h.rd(h.Gc(7,3,t.lastYield,!0))}}const ZI=function(e,t){return{"text-profit":e,"text-loss":t}};function JI(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",46),h.qd(2),h.Ec(3,"bondPrice"),h.mc(4,"br"),h.qd(5),h.Ec(6,"bondPrice"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(10,ZI,(null==t?null:t.netChange)>0,(null==t?null:t.netChange)<0)),h.Ub(1),h.td(" ",n.getDisplaySign(t.netChange),"",h.Fc(3,5,t[e.key])," "),h.Ub(3),h.td("",n.getDisplaySign(t.netChange),"",h.Gc(6,7,t.netChangePercent,!0)," ")}}function ek(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",46),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(5,ZI,(null==t?null:t.yieldNetChange)>0,(null==t?null:t.yieldNetChange)<0)),h.Ub(1),h.td(" ",n.getDisplaySign(t.yieldNetChange),"",h.Fc(3,3,t[e.key])," ")}}function tk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit;h.Ub(2),h.rd(h.Fc(3,1,t[e.key])||"-")}}function nk(e,t){if(1&e&&(h.rc(0,"div",52),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc(5).$implicit;h.Ub(1),h.rd(h.Gc(2,1,e.bidYield,!0))}}function ik(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",48),h.rc(2,"span",49),h.zc("click",(function(){h.dd(e);const t=h.Dc(4).$implicit;return h.Dc().onClickSell(t)})),h.rc(3,"span",46),h.qd(4),h.Ec(5,"bondPrice"),h.qc(),h.rc(6,"span",50),h.qd(7,"S"),h.qc(),h.qc(),h.qc(),h.od(8,nk,3,4,"div",51),h.oc()}if(2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit,n=h.Dc();h.Ub(3),h.Mc("ngClass",t.changedColor&&t.changedColor[e.key]?t.changedColor[e.key]:" bid-price w-75 px-1"),h.Ub(1),h.rd(h.Fc(5,3,t[e.key])),h.Ub(4),h.Mc("ngIf",n.showRmoInfo())}}function ck(e,t){if(1&e&&(h.pc(0),h.od(1,ik,9,5,"ng-container",47),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.Mc("ngIf",null!==(null==e?null:e.bidPrice))}}function ok(e,t){if(1&e&&(h.rc(0,"div",55),h.rc(1,"span",56),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.qc()),2&e){const e=h.Dc(5).$implicit;h.Ub(2),h.rd(h.Gc(3,1,e.askYield,!0))}}function sk(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div"),h.rc(2,"span",49),h.zc("click",(function(){h.dd(e);const t=h.Dc(4).$implicit;return h.Dc().onClickBuy(t)})),h.rc(3,"span",53),h.qd(4,"B"),h.qc(),h.rc(5,"span",46),h.qd(6),h.Ec(7,"bondPrice"),h.qc(),h.qc(),h.qc(),h.od(8,ok,4,4,"div",54),h.oc()}if(2&e){const e=h.Dc(3).$implicit,t=h.Dc().$implicit,n=h.Dc();h.Ub(5),h.Mc("ngClass",t.changedColor&&t.changedColor[e.key]?t.changedColor[e.key]:" ask-price w-75 px-1"),h.Ub(1),h.rd(h.Fc(7,3,t[e.key])),h.Ub(2),h.Mc("ngIf",n.showRmoInfo())}}function ak(e,t){if(1&e&&(h.pc(0),h.od(1,sk,9,5,"ng-container",47),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(1),h.Mc("ngIf",null!==(null==e?null:e.askPrice))}}function lk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit;h.Ub(2),h.rd(h.Fc(3,1,t[e.key])||"-")}}function rk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit;h.Ub(2),h.rd(h.Fc(3,1,t[e.key])||"-")}}function dk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit;h.Ub(2),h.rd(h.Fc(3,1,t[e.key])||"-")}}function uk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"nullToDash"),h.Ec(4,"nullToDash"),h.qc(),h.oc()),2&e){const e=h.Dc(3).$implicit,t=h.Dc();h.Ub(2),h.td("",h.Fc(3,2,t.displayCrRating(e,!1))," (",h.Fc(4,4,t.displayCrRating(e,!0)),")")}}function hk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"nullToDash"),h.qc(),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(2),h.rd(h.Fc(3,1,e.maturityDateString))}}function pk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"nullToDash"),h.qc(),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(2),h.rd(h.Fc(3,1,e.yearsToMaturity))}}function mk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"nullToDash"),h.qc(),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(2),h.rd(h.Fc(3,1,e.callDateString))}}function fk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"nullToDash"),h.qc(),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(2),h.rd(h.Fc(3,1,e.yearsToNextCall))}}function gk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"nullToDash"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit;h.Ub(2),h.rd(h.Fc(3,1,t[e.key]))}}function bk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc();h.Ub(2),h.sd("",h.Gc(3,1,t[e.key],n.bondConstant.NEW_BOND_YIELD_DECIMAL_PLACE),"%")}}function Sk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc().$implicit,n=h.Dc();h.Ub(2),h.sd("",h.Gc(3,1,t[e.key],n.bondConstant.NEW_BOND_YIELD_DECIMAL_PLACE),"%")}}function yk(e,t){if(1&e&&(h.rc(0,"td",40),h.pc(1,41),h.od(2,QI,8,6,"ng-container",42),h.od(3,JI,7,13,"ng-container",42),h.od(4,ek,4,8,"ng-container",42),h.od(5,tk,4,3,"ng-container",42),h.od(6,ck,2,1,"ng-container",42),h.od(7,ak,2,1,"ng-container",42),h.od(8,lk,4,3,"ng-container",42),h.od(9,rk,4,3,"ng-container",42),h.od(10,dk,4,3,"ng-container",42),h.od(11,uk,5,6,"ng-container",42),h.od(12,hk,4,3,"ng-container",42),h.od(13,pk,4,3,"ng-container",42),h.od(14,mk,4,3,"ng-container",42),h.od(15,fk,4,3,"ng-container",42),h.od(16,gk,4,3,"ng-container",42),h.od(17,bk,4,4,"ng-container",42),h.od(18,Sk,4,4,"ng-container",42),h.oc(),h.qc()),2&e){const e=h.Dc().$implicit;h.Mc("nzAlign",null==e?null:e.align),h.Ub(1),h.Mc("ngSwitch",e.key),h.Ub(1),h.Mc("ngSwitchCase","lastPrice"),h.Ub(1),h.Mc("ngSwitchCase","netChange"),h.Ub(1),h.Mc("ngSwitchCase","yieldNetChange"),h.Ub(1),h.Mc("ngSwitchCase","bidSize"),h.Ub(1),h.Mc("ngSwitchCase","bidPrice"),h.Ub(1),h.Mc("ngSwitchCase","askPrice"),h.Ub(1),h.Mc("ngSwitchCase","askSize"),h.Ub(1),h.Mc("ngSwitchCase","cumQty"),h.Ub(1),h.Mc("ngSwitchCase","minSize"),h.Ub(1),h.Mc("ngSwitchCase","rating"),h.Ub(1),h.Mc("ngSwitchCase","maturityDate"),h.Ub(1),h.Mc("ngSwitchCase","yearsToMaturity"),h.Ub(1),h.Mc("ngSwitchCase","callDate"),h.Ub(1),h.Mc("ngSwitchCase","yearsToNextCall"),h.Ub(1),h.Mc("ngSwitchCase","bondCurrencyCode"),h.Ub(1),h.Mc("ngSwitchCase","bidYield"),h.Ub(1),h.Mc("ngSwitchCase","askYield")}}function vk(e,t){if(1&e&&(h.pc(0),h.od(1,GI,12,14,"td",21),h.od(2,yk,19,19,"td",22),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf","bondName"===e.key),h.Ub(1),h.Mc("ngIf","bondName"!==e.key)}}function Mk(e,t){if(1&e){const e=h.sc();h.rc(0,"li",57),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().addToWatchlist(t)})),h.qd(1,"Add to Watchlist "),h.qc()}}function Ck(e,t){if(1&e){const e=h.sc();h.rc(0,"li",57),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().onDeleteFromWatchlistAction(t)})),h.qd(1,"Remove From Watchlist"),h.qc()}}function qk(e,t){if(1&e){const e=h.sc();h.rc(0,"li",57),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().onShowMarketDepth(t)})),h.qd(1,"Market Depth"),h.qc()}}function Tk(e,t){if(1&e){const e=h.sc();h.rc(0,"li",57),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().onShowTimeAndSales(t)})),h.qd(1,"Time & Sales"),h.qc()}}function wk(e,t){if(1&e){const e=h.sc();h.rc(0,"li",57),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc().onShowSummary(t)})),h.qd(1,"Summary"),h.qc()}}function zk(e,t){if(1&e){const e=h.sc();h.rc(0,"tr",15),h.zc("click",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc().setSelectedItem(n)})),h.od(1,vk,3,2,"ng-container",3),h.rc(2,"td"),h.rc(3,"button",16),h.mc(4,"i",17),h.qc(),h.rc(5,"nz-dropdown-menu",null,18),h.rc(7,"ul",19),h.od(8,Mk,2,0,"li",20),h.od(9,Ck,2,0,"li",20),h.od(10,qk,2,0,"li",20),h.od(11,Tk,2,0,"li",20),h.od(12,wk,2,0,"li",20),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(6),i=h.Dc();h.Ub(1),h.Mc("ngForOf",i.getSelectedTableHeaders()),h.Ub(2),h.Mc("nzDropdownMenu",n),h.Ub(5),h.Mc("ngIf",!i.isWatchListSelected()),h.Ub(1),h.Mc("ngIf",i.isWatchListSelected()),h.Ub(1),h.Mc("ngIf",i.isBondExchange(e)),h.Ub(1),h.Mc("ngIf",i.isBondExchange(e)),h.Ub(1),h.Mc("ngIf",i.isBondExchange(e))}}function Dk(e,t){if(1&e&&h.mc(0,"app-bond-exchange-tag",32),2&e){const e=h.Dc().$implicit;h.Mc("isFullLotType","Y"===(null==e?null:e.bexFullLotEnabled))("isOddLotType","Y"===(null==e?null:e.bexOddLotEnabled))("isRetail","Y"===(null==e?null:e.retailDistribution))}}function Pk(e,t){if(1&e&&(h.mc(0,"app-bond-exchange-tag",38),h.Ec(1,"async")),2&e){const e=h.Dc(3);h.Mc("nzClass",h.Fc(1,2,e.isMobile$)?"t-3xs":"t-2xs")("isLastTradingDay",!0)}}function Ik(e,t){if(1&e&&h.mc(0,"app-bond-otc-tag",39),2&e){const e=h.Dc().$implicit;h.Mc("isRetail","Y"===(null==e?null:e.retailDistribution))}}function kk(e,t){if(1&e&&h.mc(0,"app-bond-express-tag",39),2&e){const e=h.Dc().$implicit;h.Mc("isRetail","Y"===(null==e?null:e.retailDistribution))}}function Ak(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",80),h.rc(2,"div",81),h.rc(3,"p",82),h.qd(4,"-"),h.qc(),h.rc(5,"p",83),h.qd(6,"N.R"),h.qc(),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(4);h.Ub(1),h.nd("background-image","url("+e.BOND_NEW_GREY_RATING+")",h.ec)}}function Ek(e,t){if(1&e&&(h.rc(0,"div",80),h.rc(1,"div",81),h.rc(2,"p",84),h.qd(3),h.qc(),h.rc(4,"p",83),h.qd(5),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc(2);h.nd("background-image","url("+t.BOND_RATING_IMG_PATH+")",h.ec),h.Ub(3),h.rd(t.displayCrRating(e,!0)),h.Ub(2),h.rd(t.displayCrRating(e,!1))}}function Fk(e,t){if(1&e&&(h.rc(0,"nz-col",78),h.od(1,Ak,7,2,"ng-container",8),h.od(2,Ek,6,4,"ng-template",null,79,h.pd),h.qc()),2&e){const e=h.ad(3),t=h.Dc().$implicit,n=h.Dc(2);h.Ub(1),h.Mc("ngIf",n.isUnrated(t))("ngIfElse",e)}}function Ok(e,t){if(1&e&&(h.rc(0,"p",85),h.rc(1,"span",86),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(2),h.rd(h.Gc(3,1,e.bidYield,!0))}}function Uk(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Mc("ngClass",e.changedColor&&e.changedColor.lastPrice?e.changedColor.lastPrice:"text-profit font-weight-bold py-1"),h.Ub(1),h.sd(" ",h.Fc(2,2,e.lastPrice),"")}}function xk(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc(3).$implicit;h.Mc("ngClass",e.changedColor&&e.changedColor.lastPrice?e.changedColor.lastPrice:"text-loss font-weight-bold py-1"),h.Ub(1),h.rd(h.Fc(2,2,e.lastPrice))}}function Lk(e,t){if(1&e&&(h.pc(0),h.od(1,Uk,3,4,"span",45),h.od(2,xk,3,4,"span",45),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.Mc("ngIf",e.change>0),h.Ub(1),h.Mc("ngIf",e.change<0)}}function Rk(e,t){if(1&e&&(h.rc(0,"span",46),h.qd(1),h.Ec(2,"bondPrice"),h.qc()),2&e){const e=h.Dc(2).$implicit;h.Mc("ngClass",e.changedColor&&e.changedColor.lastPrice?e.changedColor.lastPrice:"font-weight-bold py-1"),h.Ub(1),h.sd(" ",h.Fc(2,2,e.lastPrice),"")}}function Nk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",46),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.rc(4,"span",46),h.qd(5),h.Ec(6,"bondPrice"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Tc(11,ZI,e.netChange>0,e.netChange<0)),h.Ub(1),h.td("",t.getDisplaySign(e.netChange),"",h.Fc(3,6,e.netChange)," "),h.Ub(2),h.Mc("ngClass",h.Tc(14,ZI,e.netChange>0,e.netChange<0)),h.Ub(1),h.td("(",t.getDisplaySign(e.netChange),"",h.Gc(6,8,e.
5netChangePercent,!0),")")}}function Bk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.rc(4,"span"),h.qd(5,"0.000%"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(2),h.sd("",h.Fc(3,1,e.lastPrice)," ")}}function _k(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",92),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(2),h.sd("",h.Fc(3,1,e.yieldNetChange)," ")}}function Vk(e,t){if(1&e&&(h.pc(0),h.rc(1,"span",93),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.oc()),2&e){const e=h.Dc(3).$implicit;h.Ub(2),h.sd("+",h.Fc(3,1,e.yieldNetChange)," ")}}function Hk(e,t){if(1&e&&(h.pc(0),h.od(1,_k,4,3,"ng-container",47),h.od(2,Vk,4,3,"ng-container",47),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(1),h.Mc("ngIf",e.yieldNetChange<0),h.Ub(1),h.Mc("ngIf",e.yieldNetChange>0)}}function $k(e,t){if(1&e&&(h.pc(0),h.rc(1,"span"),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(2),h.sd("",h.Gc(3,1,e.lastYield,!0)," ")}}function jk(e,t){if(1&e&&(h.pc(0),h.rc(1,"p",87),h.qd(2),h.Ec(3,"number"),h.qc(),h.rc(4,"p",88),h.qd(5," Last/Yield : "),h.od(6,Lk,3,2,"ng-container",8),h.od(7,Rk,3,4,"ng-template",null,89,h.pd),h.rc(9,"span",90),h.qd(10),h.Ec(11,"bondPrice"),h.qc(),h.qc(),h.rc(12,"p",87),h.qd(13," Chg: "),h.rc(14,"span",91),h.od(15,Nk,7,17,"ng-container",47),h.od(16,Bk,6,3,"ng-container",47),h.qc(),h.qc(),h.rc(17,"p",87),h.qd(18," Chg in Yield: "),h.rc(19,"span",91),h.od(20,Hk,3,2,"ng-container",47),h.od(21,$k,4,4,"ng-container",47),h.qc(),h.qc(),h.oc()),2&e){const e=h.ad(8),t=h.Dc().$implicit,n=h.Dc(2);h.Ub(2),h.sd("Vol : ",h.Fc(3,8,t.cumQty),""),h.Ub(4),h.Mc("ngIf",t.change>0||t.change<0)("ngIfElse",e),h.Ub(4),h.sd(" /",h.Gc(11,10,t.lastYield,!0),""),h.Ub(5),h.Mc("ngIf",!n.isZero(t.netChange)),h.Ub(1),h.Mc("ngIf",n.isZero(t.netChange)),h.Ub(4),h.Mc("ngIf",t.yieldNetChange),h.Ub(1),h.Mc("ngIf",!t.yieldNetChange)}}function Gk(e,t){if(1&e&&(h.rc(0,"p",94),h.rc(1,"span",86),h.qd(2),h.Ec(3,"bondPrice"),h.qc(),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(2),h.rd(h.Gc(3,1,e.askYield,!0))}}function Wk(e,t){if(1&e&&(h.rc(0,"p",87),h.qd(1,"Maturity Date :"),h.qc(),h.rc(2,"p",87),h.qd(3),h.qc(),h.rc(4,"p",87),h.qd(5,"Next Call Date :"),h.qc(),h.rc(6,"p",87),h.qd(7),h.qc()),2&e){const e=h.Dc().$implicit;h.Ub(3),h.td("",e.maturityDateString," (",e.yearsToMaturity,")"),h.Ub(4),h.td(" ",e.callDateString," (",e.yearsToNextCall,")")}}function Yk(e,t){if(1&e&&(h.pc(0),h.rc(1,"p",87),h.qd(2),h.Ec(3,"number"),h.qc(),h.rc(4,"p",87),h.qd(5,"Bid Yield : "),h.rc(6,"span",91),h.qd(7),h.Ec(8,"number"),h.qc(),h.qc(),h.rc(9,"p",87),h.qd(10,"Ask Yield : "),h.rc(11,"span",91),h.qd(12),h.Ec(13,"number"),h.qc(),h.qc(),h.rc(14,"p",87),h.qd(15),h.Ec(16,"number"),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit,t=h.Dc(2);h.Ub(2),h.sd("Bid Vol : ",h.Fc(3,4,e.bidSize)||"-",""),h.Ub(5),h.sd("",h.Gc(8,6,e.bidYield,t.bondConstant.NEW_BOND_YIELD_DECIMAL_PLACE),"%"),h.Ub(5),h.sd("",h.Gc(13,9,e.askYield,t.bondConstant.NEW_BOND_YIELD_DECIMAL_PLACE),"%"),h.Ub(3),h.sd("Ask Vol : ",h.Fc(16,12,e.askSize)||"-","")}}function Kk(e,t){if(1&e&&h.od(0,Yk,17,14,"ng-container",8),2&e){h.Dc();const e=h.ad(39),t=h.Dc(2);h.Mc("ngIf",t.showBeInfo())("ngIfElse",e)}}function Xk(e,t){if(1&e){const e=h.sc();h.rc(0,"a",100),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(2).addToWatchlist(t)})),h.qd(1,"Add To Watchlist"),h.qc()}}function Qk(e,t){if(1&e){const e=h.sc();h.rc(0,"a",100),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(2).onDeleteFromWatchlistAction(t)})),h.qd(1,"Remove From Watchlist"),h.qc()}}function Zk(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-col",101),h.rc(1,"a",102),h.zc("click",(function(){h.dd(e);const t=h.Dc(2).$implicit;return h.Dc(2).onShowMarketDepth(t)})),h.qd(2,"Market Depth"),h.qc(),h.qc()}2&e&&h.Mc("nzSpan",12)}function Jk(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row"),h.rc(1,"highcharts-chart",103),h.zc("updateChange",(function(t){return h.dd(e),h.Dc(4).updateFlag=t})),h.qc(),h.qc()}if(2&e){const e=h.Dc(4);h.Ub(1),h.Mc("Highcharts",e.Highcharts)("options",e.chartOptions)("runOutsideAngular",!0)("oneToOne",!0)("update",e.updateFlag)}}function eA(e,t){if(1&e&&(h.pc(0),h.mc(1,"nz-divider",95),h.rc(2,"nz-row",96),h.rc(3,"nz-col",97),h.od(4,Xk,2,0,"a",98),h.od(5,Qk,2,0,"a",98),h.qc(),h.od(6,Zk,3,1,"nz-col",99),h.qc(),h.od(7,Jk,2,5,"nz-row",47),h.oc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(3),h.Mc("nzSpan",12),h.Ub(1),h.Mc("ngIf",!t.isWatchListSelected()),h.Ub(1),h.Mc("ngIf",t.isWatchListSelected()),h.Ub(1),h.Mc("ngIf",t.isBondExchange(e)),h.Ub(1),h.Mc("ngIf",t.isBondExchange(e)&&t.showPriceChart)}}const tA=function(){return{color:"#7A7A7A"}};function nA(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",58),h.rc(2,"div",59),h.zc("click",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(2).onSelectBond(n)})),h.rc(3,"nz-row",60),h.rc(4,"nz-col"),h.rc(5,"div",61),h.od(6,Dk,1,3,"app-bond-exchange-tag",26),h.od(7,Pk,2,4,"app-bond-exchange-tag",36),h.qc(),h.od(8,Ik,1,1,"app-bond-otc-tag",28),h.od(9,kk,1,1,"app-bond-express-tag",28),h.rc(10,"a",62),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).redirectToFactsheetPage(null==n?null:n.issueCode,null==n?null:n.bondName,null==n?null:n.lotType)})),h.mc(11,"div",63),h.Ec(12,"bondName"),h.rc(13,"div",64),h.qd(14),h.qc(),h.qc(),h.qc(),h.od(15,Fk,4,2,"nz-col",65),h.qc(),h.rc(16,"nz-row",66),h.rc(17,"nz-row",67),h.rc(18,"nz-col",68),h.pc(19),h.rc(20,"p",69),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onClickSell(n)})),h.rc(21,"span",46),h.qd(22),h.Ec(23,"bondPrice"),h.qc(),h.rc(24,"span",70),h.qd(25,"S"),h.qc(),h.qc(),h.od(26,Ok,4,4,"p",71),h.oc(),h.qc(),h.rc(27,"nz-col",72),h.od(28,jk,22,13,"ng-container",8),h.qc(),h.rc(29,"nz-col",68),h.pc(30),h.rc(31,"p",73),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onClickBuy(n)})),h.rc(32,"span",74),h.qd(33,"B"),h.qc(),h.rc(34,"span",46),h.qd(35),h.Ec(36,"bondPrice"),h.qc(),h.qc(),h.od(37,Gk,4,4,"p",75),h.oc(),h.qc(),h.qc(),h.od(38,Wk,8,4,"ng-template",null,76,h.pd),h.od(40,Kk,1,2,"ng-template",null,77,h.pd),h.qc(),h.qc(),h.od(42,eA,8,5,"ng-container",47),h.qc(),h.oc()}if(2&e){const e=t.$implicit,n=h.ad(41),i=h.Dc(2);h.Ub(6),h.Mc("ngIf",i.isBondExchange(e)),h.Ub(1),h.Mc("ngIf",i.isBondExchange(e)&&i.isLastTradingDate(e)),h.Ub(1),h.Mc("ngIf",i.isBondOtc(e)),h.Ub(1),h.Mc("ngIf",i.isBondExpress(e)),h.Ub(2),h.Mc("innerHTML",h.Gc(12,17,e.bondName,i.isBondExchange(e)?null==e?null:e.bexTradingWithoutAi:null==e?null:e.tradingWithoutAi),h.ed),h.Ub(2),h.Mc("ngStyle",h.Rc(24,tA)),h.Ub(1),h.rd(e.bondIssuer),h.Ub(1),h.Mc("ngIf",!i.showRmoInfo()&&!i.showBeInfo()),h.Ub(6),h.Mc("ngClass",e.changedColor&&e.changedColor.bidPrice?e.changedColor.bidPrice:"bid-price bid-price-mobile-web w-100"),h.Ub(1),h.sd(" ",h.Fc(23,20,e.bidPrice)," "),h.Ub(4),h.Mc("ngIf",i.showRmoInfo()),h.Ub(2),h.Mc("ngIf",i.showRmoInfo())("ngIfElse",n),h.Ub(6),h.Mc("ngClass",e.changedColor&&e.changedColor.askPrice?e.changedColor.askPrice:"ask-price ask-price-mobile-web w-100"),h.Ub(1),h.sd(" ",h.Fc(36,22,e.askPrice),""),h.Ub(2),h.Mc("ngIf",i.showRmoInfo()),h.Ub(5),h.Mc("ngIf",i.checkShowBondDetails(e))}}function iA(e,t){if(1&e&&(h.pc(0),h.od(1,nA,43,25,"ng-container",3),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngForOf",e.bondDataListConverted)}}function cA(e,t){1&e&&(h.pc(0),h.mc(1,"nz-empty",104),h.oc()),2&e&&(h.Ub(1),h.Mc("nzNotFoundContent","No Data"))}const oA=function(){return{x:"600px"}};let sA=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l,r,d,u,p,m,f,g){this.iBondFilter=e,this.bondSelectorService=t,this.bondRestService=n,this.subHandlingService=i,this.holdingRestService=c,this.acctService=o,this.route=s,this.cdRef=a,this.siDeclarationService=l,this.store=r,this.watchlistRestService=d,this.nzNotificationService=u,this.router=p,this.productSearchService=m,this.uiTableService=f,this.modalService=g,this.isLoading=!1,this.isLoadingBondInfo=!1,this.watchlist=[],this.isWatchlistLoading=!1,this.isExtendedMode=!1,this.showMarketDepth=new h.s,this.showSummary=new h.s,this.showTimeAndSales=new h.s,this.addToWatchlistClicked=new h.s,this.actionButtonClicked=new h.s,this.deleteWatchlistSucceed=new h.s,this.setSortingKey=new h.s,this.BOND_TABLE_HEADERS=[{label:"Bond Name",key:"bondName",checked:!0,align:"left",nzLeft:!0,width:"180px"},{label:"Last",key:"lastPrice",checked:!0,align:"right"},{label:"Chg",key:"netChange",checked:!0,align:"right"},{label:"Chg in Yield",key:"yieldNetChange",checked:!0,align:"right"},{label:"Bid Qty",key:"bidSize",checked:!0,align:"right"},{label:"Live Bid",key:"bidPrice",checked:!0,align:"left",width:"100px"},{label:"Live Ask",key:"askPrice",checked:!0,align:"right ",width:"90px"},{label:"Ask Qty",key:"askSize",checked:!0,align:"right"},{label:"Vol",key:"cumQty",checked:!0,align:"right",width:"80px"},{label:"Min. Size",key:"minSize",checked:!0,align:"right"}],this.BOND_OTC_TABLE_HEADERS=[{label:"Bond Name",key:"bondName",checked:!0,align:"left",nzLeft:!0},{label:"Bond Rating",key:"rating",checked:!0,align:"center"},{label:"Maturity Date",key:"maturityDate",checked:!0,align:"center"},{label:"Years to maturity ",key:"yearsToMaturity",checked:!0,align:"center"},{label:"Next Call Date",key:"callDate",checked:!0,align:"center"}
5,{label:"Years to Next Call",key:"yearsToNextCall",checked:!0,align:"center"},{label:"Ind. Bid",key:"bidPrice",checked:!0,align:"left"},{label:"Ind. Ask",key:"askPrice",checked:!0,align:"right "}],this.BOND_BE_TABLE_HEADERS=[{label:"Bond Name",key:"bondName",checked:!0,align:"left",nzLeft:!0},{label:"Currency",key:"bondCurrencyCode",checked:!0,align:"right"},{label:"Live Bid Volume",key:"bidSize",checked:!0,width:"110px",align:"right"},{label:"Live Bid Yield",key:"bidYield",checked:!0,align:"right"},{label:"Live Bid Price",key:"bidPrice",checked:!0,align:"right"},{label:"Live Ask Price",key:"askPrice",checked:!0,align:"right"},{label:"Live Ask Yield",key:"askYield",checked:!0,align:"right"},{label:"Live Ask Volume",key:"askSize",checked:!0,width:"120px",align:"right"}],this.tabLists=[{label:"Bond Express",value:"bondExpress"},{label:"Bonds (OTC)",value:"bondOtc"}],this.page=1,this.isMobile=!1,this.BOND_RATING_IMG_PATH=M.g.BOND_IMG_PATH+"/bond-rating.svg",this.BOND_NEW_GREY_RATING=M.g.BOND_IMG_PATH+"/new-grey-rating.svg",this.FORMAT_DATE_WITHOUT_DASH="dd MMM yyyy",this.Highcharts=Mg,this.MIN="min",this.MAX="max",this.chartOptions={credits:{enabled:!1},xAxis:{crosshair:{width:1,color:"#dadada"},type:"datetime"},yAxis:{title:null,min:0,max:0,labels:{formatter:function(){const e=String(this.value);return Mg.numberFormat(Number(e),3)}}},legend:{enabled:!1},title:{text:""},tooltip:{},chart:{zoomType:"x",panning:{enabled:!0},panKey:"shift",events:{render:function(){setTimeout(()=>{},0)}}},plotOptions:{area:{lineColor:"#004BAD",fillColor:{linearGradient:{x1:0,x2:0,y1:0,y2:1},stops:[[0,"rgba(144, 175, 214, 0.4)"],[1,"rgba(255, 255, 255, 0.5)"]]}},series:{marker:{enabled:!1}}}},this.updateFlag=!1,this.isPriceChartLoading=!1,this.startHours=0,this.startMinutes=0,this.endHours=0,this.endMinutes=0,this.showPriceChart=!1,this.bondConstant=FS.a}ngOnChanges(e){var t,n,i;(null===(t=null==e?void 0:e.isExtendedMode)||void 0===t?void 0:t.previousValue)!==(null===(n=null==e?void 0:e.isExtendedMode)||void 0===n?void 0:n.currentValue)&&(!0===(null===(i=null==e?void 0:e.isExtendedMode)||void 0===i?void 0:i.currentValue)?this.BOND_TABLE_HEADERS.forEach(e=>{"bondName"===e.key?e.width="250px":"bidPrice"===e.key?e.width="150px":"askPrice"===e.key&&(e.width="140px")}):this.BOND_TABLE_HEADERS.forEach(e=>{"bondName"===e.key?e.width="150px":"bidPrice"===e.key?e.width="100px":"askPrice"===e.key&&(e.width="90px")}))}ngOnInit(){this.isMobile$.subscribe(e=>{this.isMobile=e})}onClickBuy(e){this.actionButtonClicked.emit([null==e?void 0:e.issueCode,null==e?void 0:e.lotType,"Buy"])}onClickSell(e){this.actionButtonClicked.emit([null==e?void 0:e.issueCode,null==e?void 0:e.lotType,"Sell"])}isZero(e){return 0==e||!e}redirectToFactsheetPage(e,t,n){t=Object(mt.a)(t),e&&Object(pt.a)(["/"+M.o.BONDS,M.o.BOND_FACTSHEET,t],{issueCode:e,lotType:n})}sortByKey(e){let t="ascend"!==e.value&&e.value?"descend":"ascend";this.bondDataListConverted=this.uiTableService.sort({key:e.key,value:t},this.bondDataListConverted),this.setSortingKey.emit({key:e.key,value:t})}onPageChange(e){this.page=e}displayCrRating(e,t){let n="";if(n=FS.a.HIGH_INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e)),n||(n=FS.a.INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e))),n||(n=FS.a.B_NON_INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e))),n||(n=FS.a.C_NON_INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e))),!n)return FS.a.UNRATED;if(t){let t=this.getBondRating(n,e);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}return n}checkBondRating(e,t){return e===t.crSnpBond||e===t.crFitchBond||e===t.crMarcBond||e===t.crRamBond}getBondRating(e,t){return t.crSnpBond===e?FS.a.SNP_RATING:t.crFitchBond===e?FS.a.FITCH_RATING:t.crMarcBond===e?FS.a.MARC_RATING:t.crRamBond===e?FS.a.RAM_RATING:void 0}getSelectedTableHeaders(){return this.showRmoInfo()?this.BOND_TABLE_HEADERS:this.showBeInfo()?this.BOND_BE_TABLE_HEADERS:this.BOND_OTC_TABLE_HEADERS}showRmoInfo(){return"bondRmo"===this.selectedTab||"all"===this.selectedTab}showBeInfo(){return"bondExpress"===this.selectedTab}isUnrated(e){return this.displayCrRating(e)===FS.a.UNRATED||this.displayCrRating(e)===FS.a.NR||this.displayCrRating(e)===FS.a.NO_RATING||this.displayCrRating(e)===FS.a.WR}checkShowBondDetails(e){var t;return!!this.selectedItem&&e.issueCode===(null===(t=this.selectedItem)||void 0===t?void 0:t.issueCode)}isWatchListSelected(){return!!this.watchlist.find(e=>e.listId.toString()===this.selectedBondFilter.toString())}
5onShowMarketDepth(e){this.showMarketDepth.emit(e)}onShowTimeAndSales(e){this.showTimeAndSales.emit(e)}onShowSummary(e){this.showSummary.emit(e)}addToWatchlist(e){this.addToWatchlistClicked.emit(e)}isBondExchange(e){return"Y"===(null==e?void 0:e.bexFullLotEnabled)||"Y"===(null==e?void 0:e.bexOddLotEnabled)}isBondExpress(e){return null==e?void 0:e.isBondExpress}isBondOtc(e){return null==e?void 0:e.isBondOtc}setSelectedItemMouseOver(e){this.selectedItem=e,this.isBondExchange(e)&&this.onShowMarketDepth(e)}onSelectBond(e){this.setSelectedItem(e)}setSelectedItem(e){this.isMobile?this.isMobile&&(this.selectedItem=this.selectedItem&&e.issueCode===this.selectedItem.issueCode?null:e,this.isBondExchange(e)&&this.getTimeAndSalesForHighChart(e.symbol)):(this.selectedItem=e,this.isBondExchange(e)&&this.onShowMarketDepth(this.selectedItem))}getDisplaySign(e){if(e>0)return"+"}onDeleteFromWatchlistAction(e){this.isWatchListSelected()&&this.modalService.confirm({nzTitle:"Delete Item from Watchlist",nzContent:"Confirm to delete "+e.bondName+" from this watchlist?",nzOnOk:()=>{let t=[this.watchlist.find(e=>e.listId.toString()===this.selectedBondFilter.toString()).itemList.filter(t=>t.productCode.includes(e.issueCode))[0].listItemId];this.watchlistRestService.deleteWatchlistItem(t).subscribe(e=>{"SUCCESS"===e.status&&this.deleteWatchlistSucceed.emit(t)})}})}getTimeAndSalesForHighChart(e){this.isPriceChartLoading=!0,this.showPriceChart=!1,this.updateFlag=!1,this.subHandlingService.subscribe(this.bondRestService.getTimeAndSales(e).pipe(Object(y.a)(e=>{var t,n,i,c;if(e.status!==M.a.RESPONSE_SUCCESS)return;this.showPriceChart=!0;const o=[],s=[];if(this.chartOptions.xAxis.min=this.convertDate(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.startTime),this.chartOptions.xAxis.max=this.convertDate(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.endTime),this.chartOptions.xAxis.tickInterval=36e5,(null===(c=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.seriesDataList)||void 0===c?void 0:c.length)>0){for(let i=e.data.seriesDataList.length;i>0;i--){let t=i-1;s.push([this.convertDate(e.data.seriesDataList[t][0]),e.data.seriesDataList[t][1]])}let t=this.getCurrentDate(),n=s.length-1;if(n>-1){let e=s[n];t>e[0]&&s.push([t,e[1]])}}o.push({type:"area",name:this.selectedItem.bondName,data:s}),this.chartOptions.series=[...o],this.updateFlag=!0,this.isPriceChartLoading=!1})))}isLastTradingDate(e){if(!e.lastTradingDate)return!1;const t=new Date(e.lastTradingDate),n=new Date;return n.setHours(0,0,0,0),t.setHours(0,0,0,0),n.getTime()===t.getTime()}convertDate(e){return e instanceof Date||(e=new Date(e)),Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),0)}getCurrentDate(){let e=Date.now(),t=Math.floor(e/6e4);const n=new Date(60*t*1e3);return Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),0)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(CI.a),h.lc(qI.a),h.lc(gm.a),h.lc(l.a),h.lc(xc.a),h.lc(pm.a),h.lc(c.a),h.lc(h.j),h.lc(yt.a),h.lc(s.i),h.lc(Nv.a),h.lc(Sc.b),h.lc(c.e),h.lc(wI.a),h.lc(Cg.e),h.lc(j.e))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-price-details-table"]],inputs:{isLoading:"isLoading",isLoadingBondInfo:"isLoadingBondInfo",bondDataListConverted:"bondDataListConverted",watchlist:"watchlist",isWatchlistLoading:"isWatchlistLoading",selectedBondFilter:"selectedBondFilter",selectedTab:"selectedTab",isFullLot:"isFullLot",totalSize:"totalSize",isExtendedMode:"isExtendedMode"},outputs:{showMarketDepth:"showMarketDepth",showSummary:"showSummary",showTimeAndSales:"showTimeAndSales",addToWatchlistClicked:"addToWatchlistClicked",actionButtonClicked:"actionButtonClicked",deleteWatchlistSucceed:"deleteWatchlistSucceed",setSortingKey:"setSortingKey"},features:[h.Tb([l.a,Cg.e]),h.Sb],decls:14,vars:15,consts:[["nzPaginationType","small",1,"live-feed-table",3,"nzData","nzLoading","nzShowPagination","nzScroll","nzNoResult","nzPageSize","nzPageIndex","nzFrontPagination","nzTotal","nzPageIndexChange"],["liveFeedTable",""],[3,"nzSortChange"],[4,"ngFor","ngForOf"],[1,"bg-black-1"],[2,"overflow-y","scroll"],["class","pointer",3,"click",4,"ngFor","ngForOf"],["nzTip","Loading...",3,"nzSpinning"],[4,"ngIf","ngIfElse"],["noResults",""],[1,"bg-black-1","text-xs",3,"nzWidth","ngClass","nzShowSort","nzLeft","nzSortKey","nzAlign"],["nz-icon","","class","text-black d-inline-block","nzTheme","fill","nzType","info-circle","nz-tooltip","","nzTooltipTitle","Traded volume stated includes on and off-market transactions.","nzTooltipTrigger","hover",4,"ngIf"],["class","text-grey font-weight-normal",4,"ngIf"],["nz-icon","","nzTheme","fill","nzType","info-circle","nz-tooltip","","nzTooltipTitle","Traded volume stated includes on and off-market transactions.","nzTooltipTrigger","hover",1,"text-black","d-inline-block"],[1,"text-grey","font-weight-normal"],[1,"pointer",3,"click"],["nz-button","","nzType","circle","nzSize","small","nz-dropdown","",1,"text-primary","border-primary",3,"nzDropdownMenu"],["nz-icon","","nzType","more","nzTheme","outline",1,"pointer"],["menu","nzDropdownMenu"],["nz-menu","",1,"text-black"],["nz-menu-item","","class","text-black",3,"click",4,"ngIf"],["nzLeft","0",3,"nzAlign",4,"ngIf"],[3,"nzAlign",4,"ngIf"],["nzLeft","0",3,"nzAlign"],[3,"ngStyle"],[1,"d-flex"],[3,"isFullLotType","isOddLotType","isRetail",4,"ngIf"],["class","w-50","nz-tooltip","",3,"nzTooltipTitle","nzOverlayClassName",4,"ngIf"],[3,"isRetail",4,"ngIf"],[1,"font-weight-bold",3,"ngStyle","click"],[3,"innerHTML"],[1,"text-xxs","text-black-5"],[3,"isFullLotType","isOddLotType","isRetail"],["nz-tooltip","",1,"w-50",3,"nzTooltipTitle","nzOverlayClassName"],[3,"nzClass","isLastTradingDay","nzClassText"],["lastTradingDateTooltipTpl",""],[3,"nzClass","isLastTradingDay",4,"ngIf"],[1,"font-weight-bold","text-black-7",3,"ngStyle"],[3,"nzClass","isLastTradingDay"],[3,"isRetail"],[3,"nzAlign"],[3,"ngSwitch"],[4,"ngSwitchCase"],["noChangeLastPrice",""],[1,"px-2","py-1"],[3,"ngClass",4,"ngIf"],[3,"ngClass"],[4,"ngIf"],[1,"bid-price-table"],[1,"buy-sell-container","mb-0","pointer","font-weight-bold",3,"click"],[1,"sell-button"],["class","w-70 text-center bid-price-table",4,"ngIf"],[1,"w-70","text-center","bid-price-table"],[1,"buy-button"],["class","end-align",4,"ngIf"],[1,"end-align"],[1,"w-75","text-center"],["nz-menu-item","",1,"text-black",3,"click"],[1,"pointer","bg-accent-2","py-3","px-2","mb-2"],[3,"click"],["nzGutter","8","nzType","flex","nzJustify","space-between",1,"flex-nowrap"],[1,"d-flex","align-items-end"],[1,"font-weight-bold","mb-1",3,"click"],[1,"font-weight-bold","text-base","mt-1",3,"innerHTML"],[1,"text-sm","font-weight-normal",3,"ngStyle"],["class","mt-2",4,"ngIf"],[1,"pt-2"],["nzType","flex","nzAlign","middle"],["nzSpan","7"],[1,"buy-sell-container","pointer","mb-0","font-weight-bold","text-base","text-center","start-align",3,"click"],[1,"sell-button","sell-button-mobile-web"],["class"," mb-0 font-weight-bold text-base start-align",4,"ngIf"],["nzSpan","10",1,"text-center"],[1,"buy-sell-container","pointer","mb-0","font-weight-bold","text-base","text-center","end-align",3,"click"],[1,"buy-button","buy-button-mobile-web"],["class","mb-0 font-weight-bold text-base end-align",4,"ngIf"],["otcInfo",""],["beInfo",""],[1,"mt-2"],["ratingTpl",""],[1,"bg-cert"],[1,"d-flex","flex-column","align-items-center","justify-content-center","text-center","h-100"],[1,"mb-0","font-weight-bold",2,"font-size","7px","line-height","1"],[1,"mb-0",2,"font-size","11px","font-weight","800"],[1,"mb-0",2,"font-size","7px","line-height","1","font-weight","800"],[1,"mb-0","font-weight-bold","text-base","start-align"],[1,"text-center","w-80"],[1,"mb-0"],[1,"mb-0","d-inline-block","px-2","py-1"],["noChangeLastPriceMobile",""],[1,"font-weight-bold","py-1"],[1,"font-weight-bold"],[1,"text-loss"],[1,"text-profit"],[1,"mb-0","font-weight-bold","text-base","end-align"],[1,"my-3"],[1,"mb-2"],[1,"text-primary",3,"nzSpan"],["class","mb-0 text-base",3,"click",4,"ngIf"],["class","text-right",3,"nzSpan",4,"ngIf"],[1,"mb-0","text-base",3,"click"],[1,"text-right",3,"nzSpan"],[1,"mb-0","text-right",3,"click"],[1,"d-block","w-100","mw-100","highchart-wrapper","bg-accent-2",3,"Highcharts","options","runOutsideAngular","oneToOne","update","updateChange"],[3,"nzNotFoundContent"]],template:function(e,t){if(1&e&&(h.rc(0,"app-web-scaffold"),h.rc(1,"nz-table",0,1),h.zc("nzPageIndexChange",(function(e){return t.page=e}))("nzPageIndexChange",(function(e){return t.onPageChange(e)}
5)),h.rc(3,"thead",2),h.zc("nzSortChange",(function(e){return t.sortByKey(e)})),h.rc(4,"tr"),h.od(5,xI,7,12,"ng-container",3),h.mc(6,"th",4),h.qc(),h.qc(),h.rc(7,"tbody",5),h.od(8,zk,13,7,"tr",6),h.qc(),h.qc(),h.qc(),h.rc(9,"app-mobile-scaffold"),h.rc(10,"nz-spin",7),h.od(11,iA,2,1,"ng-container",8),h.qc(),h.qc(),h.od(12,cA,2,1,"ng-template",null,9,h.pd)),2&e){const e=h.ad(2),n=h.ad(13);h.Ub(1),h.Mc("nzData",t.bondDataListConverted)("nzLoading",t.isLoading||t.isLoadingBondInfo)("nzShowPagination",!0)("nzScroll",h.Rc(14,oA))("nzNoResult","No Data")("nzPageSize",20)("nzPageIndex",t.page)("nzFrontPagination",!0)("nzTotal",t.totalSize),h.Ub(4),h.Mc("ngForOf",t.getSelectedTableHeaders()),h.Ub(3),h.Mc("ngForOf",e.data),h.Ub(2),h.Mc("nzSpinning",t.isLoading||t.isLoadingBondInfo||t.isWatchlistLoading),h.Ub(1),h.Mc("ngIf",(null==t.bondDataListConverted?null:t.bondDataListConverted.length)>0)("ngIfElse",n)}},directives:[B.a,ve.a,ve.f,ve.g,p.s,ve.e,ve.c,z.a,Il.a,p.t,p.q,k.b,xt.e,ve.d,_.a,xv.d,xv.f,qM.a,p.w,US.a,II.a,kI.a,p.x,p.y,qM.d,P.c,P.a,Nu.a,Ag.a,MM.b],pipes:[AI.a,p.b,LS.a,p.g,RS.a],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}.chart-tab[_ngcontent-%COMP%] .ant-radio-button-wrapper[_ngcontent-%COMP%]{border-radius:4px;font-size:14px;color:var(--black)}.chart-tab.ant-radio-group-small[_ngcontent-%COMP%] .ant-radio-button-wrapper[_ngcontent-%COMP%]{padding:0 8px;margin:0 2px}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%]{border-radius:4px}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]{box-shadow:none}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled){background:#004bad}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled):hover{box-shadow:0 3px 8px 0 rgba(0,0,0,.5)}.live-feed-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{font-size:12px}.live-feed-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:4px!important}.live-feed-table[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%], .live-feed-table[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{padding:4px}.live-feed-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-7px}.bid-price[_ngcontent-%COMP%]{display:inline-block;padding:2px 5px;color:#000;border:1px solid #ff333a;border-top-left-radius:8px;border-bottom-left-radius:8px;text-align:center}.bid-price.bg-loss[_ngcontent-%COMP%]{border:1px solid #ff333a}.bid-price.bg-profit[_ngcontent-%COMP%]{border:1px solid #093}.bid-price-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.profit-blink[_ngcontent-%COMP%]{width:100%;padding:5px;color:#fff;background-color:#093}.ask-price[_ngcontent-%COMP%], .profit-blink[_ngcontent-%COMP%]{border:1px solid #093;border-top-right-radius:8px;border-bottom-right-radius:8px}.ask-price[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;color:#000;text-align:center}.ask-price.bg-loss[_ngcontent-%COMP%]{border:1px solid #ff333a}.ask-price.bg-profit[_ngcontent-%COMP%]{border:1px solid #093}.ask-price-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-right-radius:4px!important;border-bottom-right-radius:4px!important}.loss-blink[_ngcontent-%COMP%]{width:100%;padding:5px;border:1px solid #ff333a;border-top-right-radius:8px;border-bottom-right-radius:8px}.loss-blink[_ngcontent-%COMP%], .red-blink[_ngcontent-%COMP%]{color:#fff;background-color:#ff333a}.red-blink[_ngcontent-%COMP%]{border-color:#ff333a}.green-blink[_ngcontent-%COMP%]{color:#fff;border-color:#093;background-color:#093}.buy-sell-container[_ngcontent-%COMP%]{white-space:nowrap;width:100%}.buy-button[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;background-color:#093;color:#fff;border:1px solid #093;border-top-left-radius:8px;border-bottom-left-radius:8px}.buy-button-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.sell-button[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;border:1px solid #ff333a;background-color:#ff333a;color:#fff;border-top-right-radius:8px;border-bottom-right-radius:8px}.sell-button-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-right-radius:4px!important;border-bottom-right-radius:4px!important}.add-label[_ngcontent-%COMP%]{font-weight:600;background:#cba119 0 0 no-repeat padding-box;display:inline-block;transform:skewX(-15deg);padding:2px 6px;font-size:13px}.disabled-buy-sell[_ngcontent-%COMP%]{pointer-events:none}.disabled-buy-sell[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{display:inline-block;border:1px solid #d3d3d3;background-color:#d3d3d3;color:#7a7a7a;border-top-left-radius:8px;border-bottom-left-radius:8px}.disabled-buy-sell[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{display:inline-block;color:#000;border:1px solid #d3d3d3;border-top-right-radius:8px;border-bottom-right-radius:8px}.custom-loading-icon[_ngcontent-%COMP%]{color:red}.custom-nz-switch[_ngcontent-%COMP%]{display:inline-block;position:relative;cursor:pointer}.custom-nz-switch-toggle[_ngcontent-%COMP%]{display:none}.custom-nz-switch-label[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:52px;height:16px;background-color:rgba(221,174,23,.3);border-radius:20px;transition:background-color .3s ease}.custom-nz-switch-inner[_ngcontent-%COMP%]{position:relative;flex:1;width:100%}.custom-nz-switch-check[_ngcontent-%COMP%], .custom-nz-switch-uncheck[_ngcontent-%COMP%]{display:inline-block;height:100%;width:50%;text-align:center;line-height:40px;color:#fff}.custom-nz-switch-handle[_ngcontent-%COMP%]{position:absolute;top:50%;transform:translateY(-50%);width:24px;height:24px;background-color:#ddae17;opacity:1;border-radius:20px;transition:left .3s ease}.custom-nz-switch-toggle[_ngcontent-%COMP%]:checked + .custom-nz-switch-label[_ngcontent-%COMP%]{background-color:rgba(45,68,198,.3)}.custom-nz-switch-toggle[_ngcontent-%COMP%]:checked + .custom-nz-switch-label[_ngcontent-%COMP%] .custom-nz-switch-handle[_ngcontent-%COMP%]{left:calc(100% - 24px);background-color:#2d44c6}@media only screen and (max-width:767px){.chart-tab[_ngcontent-%COMP%] .ant-radio-button-wrapper[_ngcontent-%COMP%]{border-radius:4px;font-size:14px;color:var(--black)}.chart-tab.ant-radio-group-small[_ngcontent-%COMP%] .ant-radio-button-wrapper[_ngcontent-%COMP%]{padding:0 8px;margin:0 2px;width:48%}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%]{border-radius:4px}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]{box-shadow:none}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled){background:#004bad;width:49.9%}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled):hover{box-shadow:0 3px 8px 0 rgba(0,0,0,.5)}}.end-align[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.start-align[_ngcontent-%COMP%]{display:flex;justify-content:flex-start}
5.text-grey[_ngcontent-%COMP%]{color:#adadad}.bg-cert[_ngcontent-%COMP%]{background-repeat:no-repeat;height:56px;width:56px}.right-width[_ngcontent-%COMP%]{position:absolute;right:0;width:70%}.bid-price-table[_ngcontent-%COMP%]{margin-left:10px} .last-trading-date-tooltip-wrapper.ant-tooltip .ant-tooltip-arrow{border:#fff} .last-trading-date-tooltip-wrapper.ant-tooltip .ant-tooltip-inner{background:#fff}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var aA=n("8fFf"),lA=n("5vfD"),rA=n("gWp5");function dA(e,t){if(1&e&&(h.rc(0,"nz-spin",53),h.mc(1,"nz-skeleton",54),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzLoading",e.isLoading)}}function uA(e,t){1&e&&h.nc(0)}function hA(e,t){if(1&e&&h.mc(0,"nz-option",86),2&e){const e=t.$implicit;h.Mc("nzValue",null==e?null:e.listId)("nzLabel",e.listName)}}function pA(e,t){if(1&e&&(h.rc(0,"nz-option-group",85),h.od(1,hA,1,2,"nz-option",24),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.watchlist)}}function mA(e,t){if(1&e&&h.mc(0,"nz-option",86),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function fA(e,t){if(1&e&&h.mc(0,"nz-option",86),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function gA(e,t){if(1&e&&h.mc(0,"nz-option",86),2&e){const e=t.$implicit;h.Mc("nzValue",e.value)("nzLabel",e.label)}}function bA(e,t){if(1&e){const e=h.sc();h.rc(0,"button",87),h.zc("click",(function(){return h.dd(e),h.Dc(2).onShowFilterModal()})),h.mc(1,"i",88),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("disabled",e.isLoading||e.isWatchlistLoading)}}function SA(e,t){if(1&e){const e=h.sc();h.rc(0,"label",94),h.zc("ngModelChange",(function(n){return h.dd(e),t.$implicit.active=n})),h.qd(1),h.qc()}if(2&e){const e=t.$implicit;h.Mc("ngModel",e.active)("nzValue",e.value),h.Ub(1),h.sd(" ",e.label," ")}}function yA(e,t){if(1&e){const e=h.sc();h.rc(0,"div",89),h.rc(1,"ui-select",90),h.rc(2,"ui-option",91),h.rc(3,"nz-checkbox-wrapper",92),h.zc("nzOnChange",(function(t){return h.dd(e),h.Dc(2).filterCurrency(t)})),h.od(4,SA,2,3,"label",93),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2),t=h.ad(20);h.Ub(1),h.Mc("nzSuffixIcon",t)("nzLoading",e.loadingCurrencyCodeList)("nzPlaceHolder","Currency \u2022 "+(null==e.selectedCurrencyList?null:e.selectedCurrencyList.length))("nzDisabled",e.isLoading||e.isWatchlistLoading),h.Ub(3),h.Mc("ngForOf",e.currencyList)}}const vA=function(e){return{"ui-dropdown-options-selected":e}};function MA(e,t){if(1&e){const e=h.sc();h.rc(0,"div",95),h.rc(1,"button",96),h.zc("click",(function(){return h.dd(e),h.Dc(2).onClickRetail()})),h.rc(2,"span",97),h.qd(3,"Retail"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Sc(5,vA,"Y"===e.isRetailBond))("disabled",e.isLoading||e.isWatchlistLoading),h.Vb("data-count","X"),h.Ub(1),h.nd("color","Y"===e.isRetailBond?"#000":"#9D9D9D")}}function CA(e,t){1&e&&h.nc(0)}const qA=function(e){return{bond:e}};function TA(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-auto-option",100),h.zc("click",(function(){h.dd(e);const n=t.$implicit,i=h.Dc(3);return!i.isLoadingBondInfo&&i.onSelectBondFromSearchInput(n)})),h.od(1,CA,1,0,"ng-container",101),h.qc()}if(2&e){const e=t.$implicit;h.Dc(2);const n=h.ad(28);h.Mc("nzValue",e.productName),h.Ub(1),h.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",h.Sc(3,qA,e))}}function wA(e,t){if(1&e){const e=h.sc();h.pc(0),h.od(1,TA,2,5,"nz-auto-option",98),h.rc(2,"nz-auto-option"),h.rc(3,"div",99),h.zc("visibilityChange",(function(t){return h.dd(e),h.Dc(2).loadMore(t,!0)})),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngForOf",e.bondDataListDisplay),h.Ub(2),h.Mc("intersectionDebounce",0)}}function zA(e,t){1&e&&(h.rc(0,"nz-auto-option",102),h.mc(1,"em",103),h.qd(2," Loading Bonds... "),h.qc())}function DA(e,t){1&e&&h.mc(0,"i",104)}function PA(e,t){if(1&e){const e=h.sc();h.rc(0,"i",105),h.zc("click",(function(){return h.dd(e),h.Dc(2).clearSearchText()})),h.qc()}}function IA(e,t){1&e&&(h.rc(0,"span",109),h.qd(1,"BSM ODD"),h.qc()),2&e&&h.nd("background-color","#2952AC")}function kA(e,t){1&e&&(h.rc(0,"span",109),h.qd(1,"BSM FULL"),h.qc()),2&e&&h.nd("background-color","#CBA119")}function AA(e,t){1&e&&(h.rc(0,"span",109),h.qd(1,"OTC"),h.qc()),2&e&&h.nd("background-color","#94DEB1")}function EA(e,t){1&e&&(h.rc(0,"span",109),h.qd(1,"BE"),h.qc()),2&e&&h.nd("background-color","#2952AC")}function FA(e,t){if(1&e&&(h.od(0,IA,2,2,"span",106),h.od(1,kA,2,2,"span",106),h.od(2,AA,2,2,"span",106),h.od(3,EA,2,2,"span",106),h.mc(4,"br"),h.rc(5,"span",107),h.qd(6),h.mc(7,"br"),h.mc(8,"span",108),h.Ec(9,"bondName"),h.qc()),2&e){const e=t.bond,n=h.Dc(2);h.Mc("ngIf",e.type===n.bondConstant.ODD_LOT),h.Ub(1),h.Mc("ngIf",e.type===n.bondConstant.FULL_LOT),h.Ub(1),h.Mc("ngIf",e.type===n.bondConstant.OTC),h.Ub(1),h.Mc("ngIf",e.type===n.bondConstant.BOND_EXPRESS),h.Ub(3),h.sd("",e.bondIssuer," "),h.Ub(2),h.Mc("innerHTML",h.Gc(9,6,e.productName,e.type===n.bondConstant.ODD_LOT||e.type===n.bondConstant.FULL_LOT?null==e?null:e.bexTradingWithoutAi:null==e?null:e.tradingWithoutAi),h.ed)}}const OA=function(e,t){return{"w-100":e,"px-3":t}};function UA(e,t){if(1&e&&(h.rc(0,"label",110),h.Ec(1,"async"),h.Ec(2,"async"),h.qd(3,"All"),h.qc()),2&e){const e=h.Dc(2);h.Mc("ngClass",h.Tc(6,OA,h.Fc(1,2,e.isMobile$),!h.Fc(2,4,e.isMobile$)))("nzValue","all")}}function xA(e,t){if(1&e&&(h.rc(0,"label",110),h.Ec(1,"async"),h.Ec(2,"async"),h.qd(3),h.qc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Mc("ngClass",h.Tc(7,OA,h.Fc(1,3,t.isMobile$),!h.Fc(2,5,t.isMobile$)))("nzValue",e.value),h.Ub(3),h.rd(e.label)}}function LA(e,t){if(1&e&&(h.pc(0),h.od(1,xA,4,10,"label",79),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngIf",e.display)}}const RA=function(e,t){return{"text-right py-1":e,"pt-3":t}},NA=function(e){return{checked:e}};function BA(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-col",111),h.Ec(1,"async"),h.Ec(2,"async"),h.rc(3,"div"),h.rc(4,"span",112),h.qd(5,"Full Lot"),h.qc(),h.rc(6,"div",113),h.mc(7,"input",114),h.rc(8,"label",115),h.zc("click",(function(){return h.dd(e),h.Dc(2).onSwitchChange()})),h.rc(9,"span",116),h.mc(10,"span",117),h.mc(11,"span",118),h.qc(),h.mc(12,"span",119),h.qc(),h.qc(),h.rc(13,"span",2),h.qd(14,"Odd Lot"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("nzLg",8)("ngClass",h.Tc(12,RA,!h.Fc(1,8,e.isMobile$),h.Fc(2,10,e.isMobile$))),h.Ub(3),h.nd("pointer-events",e.isLoading||e.isWatchlistLoading?"none":"auto"),h.Ub(1),h.Mc("ngClass",e.isFullLot?"font-weight-bold":"font-weight-bold text-black-5"),h.Ub(4),h.Mc("ngClass",h.Sc(15,NA,e.isFullLot)),h.Ub(4),h.Mc("ngClass",h.Sc(17,NA,e.isFullLot)),h.Ub(1),h.Mc("ngClass",e.isFullLot?"font-weight-bold text-black-5":"font-weight-bold")}}const _A=function(e){return{"pt-3":e}},VA=function(e){return{"d-flex justify-content-between":e}},HA=function(e){return{"w-100":e}},$A=function(){return{display:"flex"}};function jA(e,t){if(1&e){const e=h.sc();h.rc(0,"div",55),h.Ec(1,"async"),h.rc(2,"div",56),h.Ec(3,"async"),h.rc(4,"nz-select",57),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedBondFilter=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().onChangeFilterOption()})),h.od(5,pA,2,1,"nz-option-group",58),h.rc(6,"nz-option-group",59),h.od(7,mA,1,2,"nz-option",24),h.qc(),h.rc(8,"nz-option-group",60),h.od(9,fA,1,2,"nz-option",24),h.qc(),h.rc(10,"nz-option-group",61),h.od(11,gA,1,2,"nz-option",24),h.mc(12,"nz-option",62),h.qc(),h.qc(),h.od(13,bA,2,1,"button",63),h.qc(),h.od(14,yA,5,5,"div",64),h.od(15,MA,4,7,"div",65),h.rc(16,"div",66),h.rc(17,"nz-input-group",67),h.rc(18,"input",68),h.zc("input",(function(t){return h.dd(e),h.Dc().onSearchBond(t.target.value)})),h.qc(),h.qc(),h.rc(19,"nz-autocomplete",69,70),h.od(21,wA,4,2,"ng-container",71),h.od(22,zA,3,0,"nz-auto-option",72),h.qc(),h.od(23,DA,1,0,"ng-template",null,10,h.pd),h.od(25,PA,1,0,"ng-template",null,73,h.pd),h.od(27,FA,10,9,"ng-template",null,74,h.pd),h.qc(),h.qc(),h.rc(29,"div",75),h.rc(30,"nz-row",76),h.rc(31,"nz-col",77),h.rc(32,"div"),h.rc(33,"nz-radio-group",78),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedTab=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().onChangeTabOption()})),h.Ec(34,"async"),h.Ec(35,"async"),h.od(36,UA,4,9,"label",79),h.od(37,LA,2,1,"ng-container",80),h.qc(),h.qc(),h.qc(),h.od(38,BA,15,19,"nz-col",81),h.qc(),h.qc(),h.rc(39,"app-bond-price-details-table",82),h.zc("showMarketDepth",(function(t){return h.dd(e),h.Dc().onShowMarketDepth(t)}))("showSummary",(function(t){return h.dd(e),h.Dc().onShowSummary(t)}))("showTimeAndSales",(function(t){return h.dd(e),h.Dc().onShowTimeAndSales(t)}))("addToWatchlistClicked",(function(t){return h.dd(e),h.Dc().addToWatchlist(t)}))("actionButtonClicked",(function(t){return h.dd(e),h.Dc().onShowOrderpadAction(t[0].toString(),t[2].toString(),t[1].toString())}))("deleteWatchlistSucceed",(function(t){return h.dd(e),h.Dc().onSuccessDeleteItemFromWatchlist(t)}))("setSortingKey",(function(t){return h.dd(e),h.Dc().onSetSortingKey(t)})),h.qc(),h.rc(40,"nz-row",83),h.mc(41,"img",84),h.qc()}if(2&e){const e=h.ad(20),t=h.ad(24),n=h.ad(26),i=h.Dc(),c=h.ad(20);h.Mc("ngClass",h.Sc(50,_A,h.Fc(1,42,i.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(52,VA,h.Fc(3,44,i.isMobile$))),h.Ub(2),h.Mc("ngModel",i.selectedBondFilter)("nzDropdownMatchSelectWidth",!1)("nzSuffixIcon",c)("nzDisabled",i.isLoading||i.isWatchlistLoading),h.Ub(1),h.Mc("ngIf",i.watchlist.length>0),h.Ub(2),h.Mc("ngForOf",i.WATCHLIST_ACTIONS),h.Ub(2),h.Mc("ngForOf",i.bondFilterList),h.Ub(2),h.Mc("ngForOf",i.otherBondFilterList),h.Ub(1),h.Mc("nzValue",i.SEARCH_RESULT),h.Ub(1),h.Mc("ngIf",i.isMobile),h.Ub(1),h.Mc("ngIf",!i.isMobile),h.Ub(1),h.Mc("ngIf",!i.isMobile),h.Ub(2),h.Mc("nzPrefix",t)("nzSuffix",n),h.Ub(1),h.Mc("formControl",i.keyword)("nzAutocomplete",e),h.Ub(1),h.Mc("nzBackfill",!0),h.Ub(2),h.Mc("ngIf",i.bondDataListDisplay&&(null==i.bondDataListDisplay?null:i.bondDataListDisplay.length)>0),h.Ub(1),h.Mc("ngIf",i.isLoading||i.isSearchingKeyword||i.isLoadingMore),h.Ub(8),h.Mc("nzGutter",16),h.Ub(2),h.nd("pointer-events",i.isLoading||i.isWatchlistLoading?"none":"auto"),h.Ub(1),h.Mc("ngClass",h.Sc(54,HA,h.Fc(34,46,i.isMobile$)))("ngStyle",h.Fc(35,48,i.isMobile$)?h.Rc(56,$A):"")("ngModel",i.selectedTab)("nzSize","small"),h.Ub(3),h.Mc("ngIf",i.isWatchListSelected()),h.Ub(1),h.Mc("ngForOf",i.tabLists),h.Ub(1),h.Mc("ngIf",i.selectedTab===i.tabLists[0].value),h.Ub(1),h.Mc("isLoading",i.isLoading)("isLoadingBondInfo",i.isLoadingBondInfo)("bondDataListConverted",i.bondDataDisplayListConverted)("totalSize",i.totalSize)("watchlist",i.watchlist)("isWatchlistLoading",i.isWatchlistLoading)("selectedBondFilter",i.selectedBondFilter)("selectedTab",i.selectedTab)("isFullLot",i.isFullLot)("isExtendedMode",i.isExtendedMode),h.Ub(2),h.Mc("src",i.BOND_IMG_PATH+"powered-by-bsm-logo.svg",h.gd)}}
5function GA(e,t){1&e&&(h.rc(0,"div"),h.rc(1,"div",36),h.rc(2,"span",123),h.qd(3,"This bond is now classified as "),h.rc(4,"span",124),h.qd(5,"Speculative / Distressed"),h.qc(),h.qd(6," profile."),h.qc(),h.qc(),h.rc(7,"div",121),h.qd(8," The risk of loss in purchasing this bond can be substantial. You should therefore assess if the purchase of this bond is suitable for you in light of your objective, financial resources and other relevant circumstances. In deciding whether to purchase this bond you should be aware of the following: "),h.mc(9,"br"),h.rc(10,"div",125),h.qd(11," 1. The purchase of this bond is subject to higher risk of default. In the event of default, you may not able to receive back both interest and principal. "),h.mc(12,"br"),h.qd(13," 2. The higher degree of fluctuation and volatility of bond\u2019s price. "),h.mc(14,"br"),h.qd(15," 3. The higher level of liquidity risk. Under certain conditions, it may become difficult to sell this bond. "),h.mc(16,"br"),h.qc(),h.qd(17," This brief warning cannot disclose all the risks associated with the purchase of this bond. You should conduct your own risk assessment and seek professional advice, where necessary. "),h.qc(),h.qc())}function WA(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",120),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseRiskNote()})),h.rc(1,"div",33),h.mc(2,"i",34),h.rc(3,"span",35),h.qd(4,"You are taking too much risk."),h.qc(),h.qc(),h.rc(5,"div",121),h.qd(6," I/We notice that my/our selected investments belong to a risk class higher than my/our tolerance. FSMOne has already provided the appropriate and necessary warning on the risks associated with the investments to ensure my/our awareness on the risk mismatch and potential losses. Despite this, I/we consider my/our selected investments are suitable for my/our personal circumstances and decide to proceed with my/our transaction request(s). "),h.qc(),h.od(7,GA,18,0,"div",71),h.rc(8,"div",37),h.rc(9,"button",122),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseRiskNote()})),h.qd(10,"Cancel"),h.qc(),h.rc(11,"button",38),h.zc("click",(function(){return h.dd(e),h.Dc().onRiskApprove()})),h.qd(12,"I Agree & Check Out"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",e.isRiskExcessive)("nzFooter",null)("nzWidth",600),h.Ub(7),h.Mc("ngIf","DISTRESS"===(null==e.selectedBond?null:e.selectedBond.bondSuitabilityCode))}}function YA(e,t){1&e&&h.mc(0,"em",126)}function KA(e,t){if(1&e&&h.mc(0,"img",127),2&e){const e=h.Dc();h.Mc("src",e.TRANSACTION_IMG_PATH+"filterIcon.svg",h.gd)}}function XA(e,t){if(1&e&&(h.rc(0,"nz-spin",53),h.mc(1,"nz-skeleton",54),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoadingMore),h.Ub(1),h.Mc("nzLoading",e.isLoadingMore)}}function QA(e,t){if(1&e&&h.mc(0,"ui-option",86),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e.listName)}}function ZA(e,t){if(1&e&&h.mc(0,"ui-option",86),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e.listName)}}function JA(e,t){1&e&&(h.pc(0),h.mc(1,"nz-empty",128),h.oc()),2&e&&(h.Ub(1),h.Mc("nzNotFoundContent","No Data"))}function eE(e,t){1&e&&(h.pc(0),h.mc(1,"nz-empty",128),h.oc()),2&e&&(h.Ub(1),h.Mc("nzNotFoundContent","No Data"))}function tE(e,t){1&e&&h.nc(0)}function nE(e,t){if(1&e){const e=h.sc();h.rc(0,"app-rmo-transaction-details",129),h.zc("onChangeShowBondDetails",(function(t){return h.dd(e),h.Dc().onBondBuyDetailVisibleChange(t)}))("onLoading",(function(t){return h.dd(e),h.Dc().onLoadingOrderPad(t)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("show",e.showBondDetails)("routeRefno",e.routeRefno)("lotType",e.lotType)("transType",e.transType)("lsClient",e.lsClient)("isUpdate",!1)("issueCode",e.selectedIssueCode)}}function iE(e,t){1&e&&h.nc(0)}function cE(e,t){1&e&&h.nc(0)}function oE(e,t){if(1&e){const e=h.sc();h.rc(0,"uic-mobile-full-screen",46),h.pc(1,47),h.rc(2,"div",48),h.rc(3,"div",130),h.rc(4,"i",131),h.zc("click",(function(){return h.dd(e),h.Dc().closeFilterModal()})),h.qc(),h.rc(5,"h2"),h.qd(6,"Filters"),h.qc(),h.qc(),h.qc(),h.oc(),h.pc(7,51),h.rc(8,"div",48),h.od(9,iE,1,0,"ng-container",6),h.qc(),h.oc(),h.pc(10,52),h.rc(11,"div",48),h.od(12,cE,1,0,"ng-container",6),h.qc(),h.oc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(85),n=h.ad(83);h.Mc("isVisible",e.showFilterModal),h.Ub(9),h.Mc("ngTemplateOutlet",t),h.Ub(3),h.Mc("ngTemplateOutlet",n)}}function sE(e,t){if(1&e){const e=h.sc();
5h.rc(0,"div",132),h.rc(1,"div",133),h.rc(2,"span",134),h.qd(3),h.qc(),h.rc(4,"span",135),h.qd(5),h.qc(),h.qc(),h.qc(),h.rc(6,"div",136),h.rc(7,"button",137),h.zc("click",(function(){return h.dd(e),h.Dc().resetFilter()})),h.rc(8,"span"),h.qd(9),h.qc(),h.qc(),h.rc(10,"button",138),h.zc("click",(function(){return h.dd(e),h.Dc().filterListBasedOnSelectedSearchCondition()})),h.rc(11,"span"),h.qd(12),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(3),h.rd(e.totalCount),h.Ub(2),h.sd(" ","Selected",""),h.Ub(4),h.rd("Reset"),h.Ub(3),h.rd("Filter Now")}}const aE=function(e,t,n){return{"bg-white-9 text-info border-blue hover:border-info":e,"bg-white border-black-4 text-black":t,"uic-dropdown-options-selected":n}};function lE(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"nz-row",139),h.Ec(2,"async"),h.rc(3,"nz-col",140),h.rc(4,"nz-row"),h.rc(5,"div",141),h.rc(6,"nz-row",142),h.rc(7,"nz-col",143),h.pc(8),h.rc(9,"div",144),h.zc("click",(function(){return h.dd(e),h.Dc().onClickCurrencyFilterModal()})),h.rc(10,"div",145),h.rc(11,"h6"),h.qd(12,"Currency"),h.qc(),h.qc(),h.qc(),h.oc(),h.qc(),h.rc(13,"nz-col",143),h.pc(14),h.rc(15,"div",144),h.zc("click",(function(){return h.dd(e),h.Dc().onClickRetail(!0)})),h.rc(16,"div",145),h.rc(17,"h6"),h.qd(18,"Retail"),h.qc(),h.qc(),h.qc(),h.oc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Fc(2,8,e.isMobile$)?"pt-1":""),h.Ub(2),h.Mc("nzSpan",24),h.Ub(4),h.Mc("nzSpan",8),h.Ub(2),h.Mc("ngClass",h.Uc(10,aE,(null==e.selectedCurrencyList?null:e.selectedCurrencyList.length)>0,0===(null==e.selectedCurrencyList?null:e.selectedCurrencyList.length),(null==e.selectedCurrencyList?null:e.selectedCurrencyList.length)>0)),h.Vb("data-count",null==e.selectedCurrencyList?null:e.selectedCurrencyList.length),h.Ub(4),h.Mc("nzSpan",8),h.Ub(2),h.Mc("ngClass",h.Uc(14,aE,"Y"===e.isRetailBond,"Y"!==e.isRetailBond,"Y"===e.isRetailBond)),h.Vb("data-count","X")}}function rE(e,t){if(1&e){const e=h.sc();h.rc(0,"div",146),h.rc(1,"button",147),h.zc("click",(function(){return h.dd(e),h.Dc().onSaveCurrencyFilterList()})),h.rc(2,"span"),h.qd(3,"Save"),h.qc(),h.qc(),h.qc()}}function dE(e,t){1&e&&h.mc(0,"i",154)}function uE(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row"),h.rc(1,"div",155),h.rc(2,"span",156),h.rc(3,"div",157),h.rc(4,"nz-checkbox-wrapper",158),h.rc(5,"label",159),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).selectedAllCurrency=t}))("ngModelChange",(function(t){return h.dd(e),h.Dc(2).selectedAllCurrencyClicked(t)})),h.qd(6),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.mc(7,"nz-divider",160),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(5),h.Mc("nzValue","all")("nzChecked",e.selectedAllCurrency)("ngModel",e.selectedAllCurrency),h.Ub(1),h.rd("All")}}function hE(e,t){1&e&&h.mc(0,"nz-divider",160)}function pE(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"nz-row"),h.rc(2,"div",155),h.rc(3,"span",161),h.rc(4,"div",157),h.rc(5,"nz-checkbox-wrapper",158),h.rc(6,"label",162),h.zc("ngModelChange",(function(n){return h.dd(e),t.$implicit.selected=n}))("ngModelChange",(function(n){h.dd(e);const i=t.$implicit;return h.Dc(2).onCheckBoxChange(n,null==i?null:i.value)})),h.qd(7),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.od(8,hE,1,0,"nz-divider",163),h.qc(),h.oc()}if(2&e){const e=t.$implicit,n=t.last;h.Ub(6),h.Mc("nzValue",null==e?null:e.value)("nzChecked",e.selected)("ngModel",e.selected),h.Ub(1),h.rd(null==e?null:e.label),h.Ub(1),h.Mc("ngIf",!n)}}const mE=function(){return{"max-height":"calc(90vh - 180px)"}};function fE(e,t){if(1&e){const e=h.sc();h.mc(0,"nz-divider"),h.rc(1,"div",148),h.rc(2,"div",149),h.rc(3,"nz-row",150),h.rc(4,"nz-input-group",151),h.rc(5,"input",152),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().searchCurrency=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().onSearchCurrencyList()})),h.qc(),h.od(6,dE,1,0,"ng-template",null,153,h.pd),h.qc(),h.qc(),h.rc(8,"div"),h.od(9,uE,8,4,"nz-row",71),h.od(10,pE,9,5,"ng-container",80),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.ad(7),t=h.Dc();h.Ub(2),h.Mc("ngStyle",h.Rc(6,mE)),h.Ub(2),h.Mc("nzPrefix",e),h.Ub(1),h.Nc("placeholder","Search"),h.Mc("ngModel",t.searchCurrency),h.Ub(4),h.Mc("ngIf",!t.searchCurrency),h.Ub(1),h.Mc("ngForOf",t.currencyDisplayList)}}function gE(e,t){1&e&&h.nc(0)}function bE(e,t){1&e&&h.nc(0)}const SE=function(e){return{"px-2 mt-3 bg-white pb-5":e}};let yE=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l,r,d,u,p,m,f,b,S){this.iBondFilter=e,this.bondSelectorService=t,this.bondRestService=n,this.subHandlingService=i,this.holdingRestService=c,this.acctService=o,this.route=s,this.cdRef=a,this.siDeclarationService=l,this.store=r,this.watchlistRestService=d,this.nzNotificationService=u,this.router=p,this.productSearchService=m,this.uiTableService=f,this.lightstreamerBondService=b,this.modalService=S,this.isExtendedMode=!1,this.onChangeExtendView=new h.s,this.onChangeShowBondDetails=new h.s,this.TRANSACTION_IMG_PATH=M.g.TRANSACTION_IMG_PATH,this.isLoading=!1,this.showBondDetails=!1,this.isLoadingBondInfo=!1,this.watchlist=[],this.isWatchlistLoading=!1,this.bondFilterList=[{label:"All",value:vE.ALL_BONDS},{label:"Most Active (Volume)",value:vE.MOST_ACTIVE},{label:"Top Gainers",value:vE.TOP_GAINERS},{label:"Top Gainers (%)",value:vE.TOP_GAINERS_PERCENT},{label:"Top Losers",value:vE.TOP_LOSERS},{label:"Top Losers (%)",value:vE.TOP_LOSERS_PERCENT}],this.otherBondFilterList=[{label:"Government Bonds",value:ME.GOVERNMENT_BONDS},{label:"Corporate Bonds",value:ME.CORPORATE_BONDS}],this.selectedBondFilter=vE.ALL_BONDS,this.searchValue="",this.bondDataListConverted=[],this.bondDataDisplayListConverted=[],this.isRiskExcessive=!1,this.bondFilterEnum=vE,this.isFirstLoad=!1,this.allBondData=[],this.show
5ForceUpdateModal=!1,this.isFirstLoadSearch=!1,this.isLoadedKeyword=!1,this.isSearchingKeyword=!1,this.isLoadingSearchDisplayList=!1,this.selectTabSubject=new jt.a,this.page=1,this.limit=10,this.destroySubject=new jt.a,this.isLoadingMore=!1,this.isFirstTimeLoadAll=!1,this.tabLists=[{label:"Bondsupermart Live",value:"bondRmo",display:!0},{label:"Bond Express",value:"bondExpress",display:!0},{label:"OTC",value:"bondOtc",display:!0}],this.oriTabList=Object(g.a)(this.tabLists),this.showLotList=!0,this.selectedTab=this.tabLists[0].value,this.allWatchLists=[],this.WATCHLIST_ACTIONS=[{label:"Create New Watchlist",value:"create-new-watchlist"},{label:"Rename Watchlist",value:"rename-watchlist"},{label:"Delete Watchlist",value:"delete-watchlist"}],this.isMobile=!1,this.isFullLot=!0,this.isRenameWatchlistModalVisible=!1,this.isCreateNewWatchlistModalVisible=!1,this.NOTIFICATION_ERROR={type:"error",value:"ERROR"},this.NOTIFICATION_SUCCESS={type:"success",value:"SUCCESS"},this.editingWatchlistName=!1,this.testing=1,this.isDeleteWatchlistModalVisible=!1,this.isAddBondModalVisible=!1,this.isAddBondModalPriceVisible=!1,this.isSuspendedBondModalVisible=!1,this.errorVisible=!1,this.BOND_RATING_IMG_PATH=M.g.BOND_IMG_PATH+"/bond-rating.svg",this.BOND_NEW_GREY_RATING=M.g.BOND_IMG_PATH+"/new-grey-rating.svg",this.subscriptionList={rankingList:[],bexPrice:[]},this.showMarketDepth=new h.s,this.showSummary=new h.s,this.showTimeAndSales=new h.s,this.onCloseExchangeDetails=new h.s,this.rankingList=[],this.bondConstant=FS.a,this.watchListResultList=[],this.SEARCH_RESULT="SEARCH_RESULT",this.BOND_IMG_PATH="assets/images/bond/",this.currencyList=[],this.currencyDisplayList=[],this.selectedCurrencyList=[],this.isRetailBond="N",this.subscriptionsInitialized=[],this.loadingCurrencyCodeList=!1,this.showFilterModal=!1,this.showCurrencyFilterModal=!1,this.totalCount=0,this.selectedAllCurrency=!1,this.bondExpressList=[],this.isFirstLoadBe=!0,this.isFirstTimeLoadPage=!0,this.sortingKey={}}ngOnChanges(e){this.isBondLsAlive&&this.lsClient&&!this.isFirstLoad&&this.onChangeFilterOption()}ngOnInit(){this.isBondLsAlive&&this.lsClient&&!this.isFirstLoad&&this.onChangeFilterOption(),this.isMobile$.subscribe(e=>{this.isMobile=e}),setInterval(()=>{this.bondDataListConverted.forEach(e=>{e&&(e.changedColor={})}),this.bondDataDisplayListConverted.forEach(e=>{e&&(e.changedColor={})})},3e3),this.form=new oe.k({keyword:new oe.h("")}),this.store.dispatch(new u.V(d.d.BUY)),this.getBondCurrencyCodeList(),this.getBondWatchlist(),this.initRouteParam(),this.subscribeRefnoChange(),this.getRiskAppetite(),this.subscribeKeyword(),this.searchBondByKeyword()}onChangeFilterOption(){this.isFirstLoad=!0,this.WATCHLIST_ACTIONS[0].value===this.selectedBondFilter?this.showCreateNewWatchlistModal():this.WATCHLIST_ACTIONS[1].value===this.selectedBondFilter?this.showRenameWatchlistModal():this.WATCHLIST_ACTIONS[2].value===this.selectedBondFilter?this.showDeleteWatchlistModal():(this.clearBondExpressListInterval(),this.unsubscribeRankingList(),this.unsubscribeBexPrice(),this.bondFilterModel=this.resetBondFilterModel(),this.showLotList=!1,this.isFirstTimeLoadAll=!0,this.clearSearchText(),this.selectedItem=null,this.closeAllExchangeDetails(),this.tabLists=Object(g.a)(this.oriTabList),this.resetExchangeDetails(),this.isFirstTimeLoadPage=!0,vE.ALL_BONDS===this.selectedBondFilter?this.getListBasedOnTab():vE.TOP_LOSERS===this.selectedBondFilter||vE.TOP_GAINERS===this.selectedBondFilter||vE.MOST_ACTIVE===this.selectedBondFilter||vE.TOP_GAINERS_PERCENT===this.selectedBondFilter||vE.TOP_LOSERS_PERCENT===this.selectedBondFilter?(this.selectedTab=this.tabLists[0].value,this.subscribeRankingList(this.selectedBondFilter)):ME.GOVERNMENT_BONDS===this.selectedBondFilter||ME.CORPORATE_BONDS===this.selectedBondFilter?(this.setOtherBondFilter(),this.getListBasedOnTab()):this.getWatchlistItem(this.selectedBondFilter,!0))}getListBasedOnTab(){this.selectedTab===this.tabLists[0].value?this.findBondRmoList(this.bondFilterModel,!0,this.isFullLot,!this.isFullLot):this.selectedTab===this.tabLists[1].value?this.refreshBondExpressListInterval=this.bondExpressReloadInterval():this.findBondSelectorList(this.bondFilterModel)}resetBondFilterModel(){const e=this.iBondFilter.initDefaultBondSelectorFilterModel();return e.buyenabled=M.a.YES_FLAG,e.onlineDistributeFlag=M.a.YES_FLAG,this.page=1,this.bondDataListConverted=[],this.bondDataDisplayListConverted=[],this.bondDataList=[],this.watchListResultList=[],e.isFullLot="N",e.isOddLot="N",this.bondDataListDisplay=[],this.unsubscribeBexPrice(),this.unsubscribeRankingList(
5),this.sortingKey={},e}resetExchangeDetails(){this.showLotList=!0,this.isFullLot=!0,this.bondFilterModel.isFullLot=this.isFullLot?"Y":"N",this.bondFilterModel.isOddLot=this.isFullLot?"N":"Y"}getWatchlistItem(e,t){let n=[],i=this.watchlist.find(t=>t.listId===e);if(i&&(n=null==i?void 0:i.itemList.map(e=>e.productCode)),n.length>0){if(!t)return void this.filterListBasedOnSelectedSearchCondition();this.isLoading=!0,this.bondFilterModel=this.resetBondFilterModel(),this.clearSearchText(),this.bondFilterModel.issueCodeList=n,this.bondFilterModel.isFullLot="Y",this.bondFilterModel.isOddLot="Y",Object(ht.a)({bondExchangeList:this.getBondRmoList(this.bondFilterModel).pipe(Object(Zr.a)(e=>(console.log("error "+e),Object(Qr.a)(!1)))),bondOtcList:this.findBondSelector(this.bondFilterModel).pipe(Object(Zr.a)(e=>(console.log("error "+e),Object(Qr.a)(!1)))),bondBeList:this.findBondExpressList().pipe(Object(Zr.a)(e=>(console.log("error "+e),Object(Qr.a)(!1))))}).subscribe({next:e=>{e.bondOtcList.status===M.a.RESPONSE_SUCCESS&&this.processBondOtcData(e.bondOtcList),e.bondExchangeList.status===M.a.RESPONSE_SUCCESS&&this.isBondLsAlive&&this.processBondRmoList(e.bondExchangeList.data.result,!0,!0),e.bondBeList.status===M.a.RESPONSE_SUCCESS&&(this.processBondExpressData(e.bondBeList,n),this.refreshBondExpressListInterval=this.bondExpressReloadInterval(n)),this.bondDataListConverted=this.bondDataListConverted.sort((e,t)=>e.bondName>t.bondName?1:t.bondName>e.bondName?-1:0),this.watchListResultList=this.bondDataListConverted,this.bondDataDisplayListConverted=this.bondDataListConverted,this.filterListBasedOnSelectedSearchCondition(),this.isLoading=!1,this.isFirstTimeLoadAll=!1},error:e=>{this.isLoading=!1}})}else this.isLoading=!1,this.bondDataList=[],this.bondDataListConverted=[],this.bondDataDisplayListConverted=[],this.unsubscribeBexPrice(),this.unsubscribeRankingList()}filterWatchListBasedOnSelectedTab(e){this.selectedTab===this.tabLists[0].value?this.isFullLot?(this.bondFilterModel.isFullLot="Y",this.bondDataDisplayListConverted=e.filter(e=>"Y"===e.bexFullLotEnabled)):(this.bondFilterModel.isOddLot="Y",this.bondDataDisplayListConverted=e.filter(e=>"Y"===e.bexOddLotEnabled)):this.selectedTab===this.tabLists[1].value?this.bondDataDisplayListConverted=e.filter(e=>e.isBondExpress):this.selectedTab===this.tabLists[2].value&&(this.bondDataDisplayListConverted=e.filter(e=>e.isBondOtc)),this.totalSize=this.bondDataDisplayListConverted.length}clearBondExpressListInterval(){this.isFirstLoadBe=!0,this.refreshBondExpressListInterval&&clearInterval(this.refreshBondExpressListInterval)}onChangeTabOption(){this.unsubscribeRankingList(),this.unsubscribeBexPrice(),this.clearOffSearchResultFilter();let e=this.isWatchListSelected();this.isFirstTimeLoadAll=!0,this.isFullLot=!0,this.page=1,this.selectedItem=null,this.sortingKey={},this.closeAllExchangeDetails(),this.clearBondExpressListInterval(),e?this.getWatchlistItem(this.selectedBondFilter):(this.bondFilterModel=this.resetBondFilterModel(),this.searchInputIssueCodeResult(),this.setOtherBondFilter(),this.unsubscribeBexPrice(),this.selectedTab===this.tabLists[0].value?(this.isFirstTimeLoadPage=!0,this.resetExchangeDetails(),this.findBondRmoList(this.bondFilterModel,!0,this.isFullLot,!this.isFullLot)):(vE.TOP_LOSERS!==this.selectedBondFilter&&vE.TOP_GAINERS!==this.selectedBondFilter&&vE.MOST_ACTIVE!==this.selectedBondFilter&&vE.TOP_GAINERS_PERCENT!==this.selectedBondFilter&&vE.TOP_LOSERS_PERCENT!==this.selectedBondFilter||(this.selectedBondFilter=vE.ALL_BONDS),this.showLotList=!1,this.selectedTab===this.tabLists[1].value?this.refreshBondExpressListInterval=this.bondExpressReloadInterval(this.SEARCH_RESULT===this.selectedBondFilter?this.bondFilterModel.issueCodeList:null):this.findBondSelectorList(this.bondFilterModel)))}setOtherBondFilter(){ME.GOVERNMENT_BONDS===this.selectedBondFilter?this.bondFilterModel.isSovereign="Y":ME.CORPORATE_BONDS===this.selectedBondFilter&&(this.bondFilterModel.isSovereign="N")}clearOffSearchResultFilter(){this.searchInputIssueCode||this.selectedBondFilter!==this.SEARCH_RESULT||(this.selectedBondFilter=vE.ALL_BONDS,this.clearSearchText())}searchInputIssueCodeResult(){this.searchInputIssueCode&&this.selectedBondFilter===this.SEARCH_RESULT?(this.bondFilterModel.issueCodeList=[this.searchInputIssueCode],this.searchInputIssueCode=null):this.clearSearchText()}search(){}clearSearchText(){var e;null===(e=this.keyword)||void 0===e||e.patchValue(null),this.searchValue=""}getBondWatchlist(e){this.isWatchlistLoading=!0,this.subHandlingService.once(this.watchlistRestService.findBondWatchlistByAccountId().pipe(Object(y.a)(t=>{t.status===M.a.RESPONSE_SUCCESS&&(t.data&&(this.watchlist=[...t.data.sort((e,t)=>
5e.listName>t.listName?1:t.listName>e.listName?-1:0)],e&&this.onChangeFilterOption()),this.isWatchlistLoading=!1)})))}getBondCurrencyCodeList(){this.loadingCurrencyCodeList=!0,this.subHandlingService.once(this.bondRestService.findBondCurrencyCodeList().pipe(Object(y.a)(e=>{var t;(null==e?void 0:e.status)===M.a.RESPONSE_SUCCESS&&(this.loadingCurrencyCodeList=!1,(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.length)>0&&(this.currencyList=e.data.map(e=>({label:e,value:e,active:!1,selected:!1})),this.currencyDisplayList=Object(g.a)(this.currencyList)))},e=>console.log(e)),Object(uv.a)(()=>{this.loadingCurrencyCodeList=!1})))}findBondSelectorList(e){this.isLoading=!0,this.subHandlingService.once(this.findBondSelector(e).pipe(Object(y.a)(e=>{(null==e?void 0:e.status)===M.a.RESPONSE_SUCCESS&&(e&&this.processBondOtcData(e),this.isFirstTimeLoadAll=!1)},e=>console.log(e)),Object(uv.a)(()=>{this.isLoadingMore=!1})))}findBondSelector(e){return this.bondRestService.findBondOtcList(e)}processBondOtcData(e){var t;let n=[];if(e.data&&(n=e.data.result,this.bondDataList=this.bondDataList&&this.bondDataList.length>0?[...this.bondDataList,...n]:n),this.bondDataList=this.bondDataList.map(e=>Object.assign(Object.assign({},e),{bexOddLotEnabled:"N",bexFullLotEnabled:"N",isBondOtc:!0,askPrice:e.offerPrice,askYldToWorst:e.askYldToWorst,askYield:e.offerYtm,bidYield:e.bidYtm,minSize:e.minInitialAmt,lotType:this.bondConstant.OTC,callDateString:(null==e?void 0:e.callDate)?Object(p.K)(null==e?void 0:e.callDate,MI.a.DATE_FORMAT_WITHOUT_DASH,M.a.LOCALE_EN):"-",yearsToNextCall:(null==e?void 0:e.callDate)?this.getYearsCompareCurrent(null==e?void 0:e.callDate):"-",maturityDateString:this.getMaturityDateString(e,!0),yearsToMaturity:this.getMaturityDateString(e,!1)})),this.selectedBondFilter===vE.ALL_BONDS&&(this.allBondData=this.bondDataList),this.isLoading=!1,this.isLoadingMore=!1,(null===(t=this.bondDataList)||void 0===t?void 0:t.length)>0){let e=Object(g.a)(this.bondDataList);e=e.sort((e,t)=>e.bondName>t.bondName?1:t.bondName>e.bondName?-1:0),this.bondDataListConverted=[...this.bondDataListConverted,...e],this.filterListBasedOnSelectedSearchCondition()}else this.isLoading=!1;this.handleFirstTimeRoute()}getHoldings(){return this.holdingRestService.findHoldingList(this.routeRefno,"bond")}getBondRmoList(e){return this.bondRestService.findBondExchangeList(e)}sortRankingList(e,t){return e.sort((e,n)=>t.indexOf(e.externalBondId)-t.indexOf(n.externalBondId))}processBondRmoList(e,t,n,i){let c=[];(null==e?void 0:e.length)>0&&(i&&(e=this.sortRankingList(e,i)),c=this.filterBondExchangeList(n,t,e),(null==c?void 0:c.length)>0&&(this.bondDataList=this.bondDataList&&this.bondDataList.length>0?[...this.bondDataList,...c]:c)),(null==c?void 0:c.length)>0&&(this.unsubscribeBexPrice(),this.bondDataListConverted=[...this.bondDataListConverted,...c],i||(this.isLoading=!0),this.subscriptionsInitialized=new Array(this.bondDataListConverted.length).fill(!1),this.bondDataListConverted.forEach((e,t)=>{if(e.firstTimeLoad=!0,this.setCurrentLotTypeDisplayByMarket(e),this.bondDataDisplayListConverted[t]=e,null==e?void 0:e.bexPriceSymbol){this.subscriptionsInitialized[t]=!1;const n=this.lightstreamerBondService.subscribeLSPriceQuote(this.lsClient,null==e?void 0:e.bexPriceSymbol,n=>{this.subscriptionsInitialized[t]=!0;let c=n.getItemName(),o=this.findBondListPosition(c);this.mapBexPriceData(o,e,n),this.allSubscriptionsInitialized()&&(i||(this.bondDataListConverted=Object(Ov.c)({key:"cumQty",value:"descend"},this.bondDataListConverted)),this.filterListBasedOnSelectedSearchCondition())});this.subscriptionList.bexPrice.push(n)}})),this.isLoading=!1,this.handleFirstTimeRoute(),this.isFirstTimeLoadAll=!1}allSubscriptionsInitialized(){return this.subscriptionsInitialized.every(e=>e)}subscribeRankingList(e){if(!this.isBondLsAlive)return void(this.isLoading=!1);this.isLoading=!0,this.unsubscribeRankingList();let t=this.isFullLot?"BE_PLUS":"BE";const n=this;let i,c;this.rankingList=[];let o=new Promise((e,t)=>{i=e,c=t,setTimeout(()=>{e(n.rankingList)},2e3)});const s=this.lightstreamerBondService.subscribeRanking(this.lsClient,e,t,e=>{var t=parseInt(e.getValue("key"));if("ADD"===e.getValue("command"))n.rankingList[t]=this.mapTradeDetails(e,ry.a.BOND_RMO_RANKING_FIELDS);else if("UPDATE"===e.getValue("command"))for(let i=0;i<n.rankingList.length;i++)n.rankingList[i].key===t&&(n.rankingList[i]=this.mapTradeDetails(e,ry.a.BOND_RMO_RANKING_FIELDS));else"DELETE"===e.getValue("command")&&(n.rankingList=n.rankingList.filter(t=>t.symbol!==e.getValue("symbol")));o=new Promise((e,t)=>
5{i=e,c=t,setTimeout(()=>{e(n.rankingList)},2e3)})});this.subscriptionList.rankingList.push(s),o.then(e=>{if(this.isLoading=!1,n.rankingList=Object(g.a)(n.rankingList),n.rankingList.length>0){let t=e.map(e=>{if(null!==e.symbol)return e.symbol.replace("8000.9.","").replace("/O","")}),n=this.bondFilterModel;n.externalBondIdList=t,this.findBondRmoList(n,!0,this.isFullLot,!this.isFullLot,t)}else this.isFirstTimeLoadPage&&this.selectedTab===this.tabLists[0].value&&!this.isFullLot&&(this.onSwitchChange(),this.isFirstTimeLoadPage=!1)}).catch(e=>{console.error("Error:",e)})}mapTradeDetails(e,t){let n={};for(let i=0;i<t.length;i++)n[t[i]]=e.updateValues[i+2];return n}filterBondExchangeList(e,t,n){let i=Object(g.a)(n).filter(n=>e&&!t?"Y"===(null==n?void 0:n.bexOddLotEnabled):!e&&t?"Y"===(null==n?void 0:n.bexFullLotEnabled):e&&t?"Y"===(null==n?void 0:n.bexFullLotEnabled)||"Y"===(null==n?void 0:n.bexOddLotEnabled):void 0);return t&&e?[...i.filter(e=>"Y"===e.bexFullLotEnabled).map(e=>Object.assign(Object.assign({},e),{bexOddLotEnabled:"N"})),...i.filter(e=>"Y"===e.bexOddLotEnabled).map(e=>Object.assign(Object.assign({},e),{bexFullLotEnabled:"N"}))]:i}findBondRmoList(e,t,n,i,c){this.isBondLsAlive?(this.isLoading=!0,this.subHandlingService.once(this.getBondRmoList(e).pipe(Object(y.a)(e=>{var t,o,s;if(e.status===M.a.RESPONSE_SUCCESS&&e){if(this.isFirstTimeLoadPage&&this.selectedTab===this.tabLists[0].value&&!this.isFullLot&&(null===(o=null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.result)||void 0===o?void 0:o.length)<=0)return this.onSwitchChange(),void(this.isFirstTimeLoadPage=!1);this.processBondRmoList(null===(s=null==e?void 0:e.data)||void 0===s?void 0:s.result,n,i,c),this.isFirstTimeLoadAll=!1,this.isFirstTimeLoadPage=!1}},e=>console.log(e)),Object(uv.a)(()=>{this.isLoadingMore=!1})))):this.isLoading=!1}checkBondLotType(e){this.lotType=null,this.lotType=(null==e?void 0:e.bexFullLotEnabled)?FS.a.FULL_LOT:(null==e?void 0:e.bexOddLotEnabled)?FS.a.ODD_LOT:FS.a.OTC}isZero(e){return 0==e||!e}mapBexPriceData(e,t,n){var i;if(e>-1){let t={changedColor:{}};n.forEachChangedField((e,n,i)=>{let c=Object(ft.a)(i)?parseFloat(i||"0"):i;t[e]=null!==c?c:t[e]});for(let n in t)"changedColor"!==n&&(this.isPriceKey(n)?null!=t[n]&&t[n]!==this.bondDataListConverted[e][n]&&(t.changedColor[n]=this.determineColor(this.bondDataListConverted[e][n],t[n],n),this.bondDataListConverted[e].firstTimeLoad||(this.bondDataListConverted[e].changedColor=t.changedColor),this.bondDataListConverted[e][n]=t[n]):null!=t[n]&&t[n]!==this.bondDataListConverted[e][n]&&(this.isColorChangeKey(n)&&(t.changedColor[n]=this.determineColor(this.bondDataListConverted[e][n],t[n],n),this.bondDataListConverted[e].firstTimeLoad||(this.bondDataListConverted[e].changedColor=t.changedColor)),"tradeWoAccrdInt"===n?t[n]&&0!==(null===(i=t[n])||void 0===i?void 0:i.length)&&(this.bondDataListConverted[e].bexTradingWithoutAi=t[n]):this.bondDataListConverted[e][n]=t[n]));this.bondDataListConverted[e].firstTimeLoad=!1,this.bondDataDisplayListConverted.forEach((t,n)=>{t.bexPriceSymbol===this.bondDataListConverted[e].bexPriceSymbol&&(this.bondDataDisplayListConverted[n]=this.bondDataListConverted[e])})}}determineColor(e,t,n){if((e=parseFloat(e)||0)===(t=parseFloat(t)||0))return;const i=this.isMobile?"bid-price bid-price-mobile-web ":"bid-price ",c=this.isMobile?"ask-price ask-price-mobile-web ":"ask-price ";return"bidPrice"===n?e<t?i+" bg-profit text-white w-75 px-1":i+" bg-loss text-white w-75 px-1":"askPrice"===n?e<t?c+" bg-profit text-white w-75 px-1":c+" bg-loss text-white w-75 px-1":"bidSize"===n||"askSize"===n?e<t?"px-2 py-1 rounded bg-profit text-white":"px-2 py-1 rounded bg-loss text-white":e<t?"px-2 py-1 bg-profit rounded text-white":"px-2 py-1 bg-loss rounded text-white"}isColorChangeKey(e){return"lastPrice"===e||"bidPrice"===e||"askPrice"===e||"openPrice"===e||"closePrice"===e||"bidSize"===e||"askSize"===e}isPriceKey(e){return"bidPrice"===e||"askPrice"===e||"openPrice"===e||"closePrice"===e||"lastPrice"===e||"bidYield"===e||"askYield"===e}setAskDetails(e){e.forEach(e=>{e.askPrice=e.offerPrice,e.askYldToWorst=e.askYldToWorst,e.askYield=e.offerYtm,e.bi
5dYield=e.bidYtm})}findBondListPosition(e){var t;if((null===(t=this.bondDataListConverted)||void 0===t?void 0:t.length)>0)for(let n=0;n<this.bondDataListConverted.length;n++)if(e==this.bondDataListConverted[n].bexPriceSymbol)return n;return-1}setCurrentLotTypeDisplayByMarket(e){"Y"===(null==e?void 0:e.bexFullLotEnabled)?(e.symbol="8000.9."+e.externalBondId,e.lotTypeDisplay="fullLotType",e.lotType=this.bondConstant.FULL_LOT,e.minSize=null==e?void 0:e.bexFullLotMinLotSize,e.bexPriceSymbol=this.lightstreamerBondService.getItemName(ry.a.BEX_PRICE,e.symbol)):"Y"===(null==e?void 0:e.bexOddLotEnabled)&&(e.symbol="8000.9."+e.externalBondId+"/O",e.lotTypeDisplay="oddLotType",e.lotType=this.bondConstant.ODD_LOT,e.minSize=null==e?void 0:e.bexOddLotMinLotSize,e.bexPriceSymbol=this.lightstreamerBondService.getItemName(ry.a.BEX_PRICE,e.symbol))}getRiskAppetite(){this.subHandlingService.once(this.holdingRestService.getRiskProfileInfo(this.acctService.primaryAccount.refno).pipe(Object(y.a)(e=>{e.data&&e.data.riskAppetite?this.riskAppetite=e.data:this.showForceUpdateModal=!0})))}onShowOrderpadAction(e,t,n){this.selectedBondFilter!==this.SEARCH_RESULT&&this.searchValue&&this.searchValue.length>0&&this.clearSearchText(),this.selectedIssueCode=e,this.transType=t,this.lotType=n,this.showBondDetails=!0}onRiskApprove(){this.isRiskExcessive=!1,this.showBondDetails=!0,this.onChangeShowBondDetails.emit(this.showBondDetails)}onCloseRiskNote(){this.isRiskExcessive=!1}convertBondList(e){if(e)return e.map(e=>({issueCode:e.issueCode,bondName:e.bondName,bondIssuer:e.bondIssuer?e.bondIssuer:e.issuer,offerPrice:e.offerPrice,currencyCode:e.bondCurrencyCode,offerYtm:e.offerYtm?e.offerYtm:e.offerYield,yrsToMaturity:e.yrsToMaturity}))}initRouteParam(){this.route.queryParams.subscribe(e=>{this.routeIssueCode=e.issueCode,e.refno&&(this.routeRefno=e.refno),e.lotType&&(this.lotType=e.lotType)})}handleFirstTimeRoute(){this.routeIssueCode&&(this.onShowOrderpadAction(this.routeIssueCode,"Buy",this.lotType),this.routeIssueCode="")}handleOnBack(){window.history.back()}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.routeRefno=e,this.cdRef.markForCheck()})))}ngOnDestroy(){this.destroySubject.next(),this.destroySubject.complete(),this.unsubscribeBexPrice(),this.unsubscribeRankingList(),this.closeAllExchangeDetails(),this.clearBondExpressListInterval()}onBondBuyDetailVisibleChange(e){e||(this.transType=null),this.showBondDetails=e,this.onChangeShowBondDetails.emit(e)}onLoadingOrderPad(e){this.isLoadingBondInfo=e,this.cdRef.detectChanges()}trackByBond(e,t){return t.issueCode}redirectToFactsheetPage(e,t){t=Object(mt.a)(t),e&&Object(pt.a)(["/"+M.o.BONDS,M.o.BOND_FACTSHEET,t],{issueCode:e})}get keyword(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("keyword")}subscribeKeyword(){this.keyword.valueChanges.pipe(Object(ce.a)(500),Object(y.a)(e=>{if(e&&e.length>=2)return this.keywordPage=0,this.bondDataListDisplay=[],this.isLoadedKeyword=!1,this.isSearchingKeyword=!0,void this.selectTabSubject.next();this.bondDataListDisplay=[],this.selectedBondFilter===this.SEARCH_RESULT&&(this.selectedBondFilter=vE.ALL_BONDS,this.onChangeFilterOption())}),Object(vI.a)(this.destroySubject)).subscribe()}searchBondByKeyword(){0===this.bondExpressList.length&&(this.isFirstLoadBe=!0,this.getBondExpressList(null,!0)),this.selectTabSubject.pipe(Object(F.a)(()=>this.bondRestService.findProductsByKeyword("BOND",this.keyword.value,this.keywordPage,100).pipe(Object(y.a)(e=>{let t=e.data||[],n=t.filter(e=>(null==e?void 0:e.status)&&"active"===(null==e?void 0:e.status)),i=[],c=[],o=[],s=[];n.forEach(e=>{let t=!1;"Y"===e.bexOddLotEnabled&&(t=!0,i.push(Object.assign(Object.assign({},e),{type:FS.a.ODD_LOT}))),"Y"===e.bexFullLotEnabled&&(t=!0,c.push(Object.assign(Object.assign({},e),{type:FS.a.FULL_LOT})));let n=this.bondExpressList.some((function(t){return t.issueCode===e.productCode}));!t&&n&&s.push(Object.assign(Object.assign({},e),{type:FS.a.BOND_EXPRESS})),"Y"!==e.bexOddLotEnabled&&"Y"!==e.bexFullLotEnabled&&o.push(Object.assign(Object.assign({},e),{type:FS.a.OTC}))});let a=[...i,...c,...s,...o];this.bondDataListDisplay=[...this.bondDataListDisplay,...a],this.isSearchingKeyword=!1,t.length<30&&(this.isLoadedKeyword=!0),this.cdRef.markForCheck()})))).subscribe()}loadMore(e,t){this.keyword.value&&!this.isLoadedKeyword&&!this.isSearchingKeyword&&t&&(this.keywordPage+=1,this.isSearchingKeyword=!0,this.selectTabSubject.next())}onSearchBond(e){this.searchValue=e,e?this.keyword.patchValue(e):this.bondDataListDisplay=[]}findBondSelectorWithOptionAll(e){this.bondFilterModel=this.iBondFilter.initDefaultBondSelectorFilterModel(),this.bondFilterModel.buyenabled=M.a.YES_FLAG,this.bondFilterModel.onlineDistributeFlag=M.a.YES_FLAG,this.bondFilterModel.pageNum=e.toString(),this.bondFilterModel.limitNum=this.limit.toString(),this.findBondSelectorList(this.bondFilterModel)}
5onSwitchChange(){this.unsubscribeRankingList(),this.unsubscribeBexPrice(),this.isFullLot=!this.isFullLot,this.selectedItem=null,this.sortingKey={},this.closeAllExchangeDetails(),this.clearOffSearchResultFilter(),this.isWatchListSelected()?this.getWatchlistItem(this.selectedBondFilter):(this.bondFilterModel=this.resetBondFilterModel(),this.bondFilterModel.isFullLot=this.isFullLot?"Y":"N",this.bondFilterModel.isOddLot=this.isFullLot?"N":"Y",this.setOtherBondFilter(),this.searchInputIssueCodeResult(),this.isFirstTimeLoadAll=!0,vE.TOP_LOSERS===this.selectedBondFilter||vE.TOP_GAINERS===this.selectedBondFilter||vE.MOST_ACTIVE===this.selectedBondFilter||vE.TOP_GAINERS_PERCENT===this.selectedBondFilter||vE.TOP_LOSERS_PERCENT===this.selectedBondFilter?this.subscribeRankingList(this.selectedBondFilter):this.findBondRmoList(this.bondFilterModel,!0,this.isFullLot,!this.isFullLot))}setSelectedItemMouseOver(e){this.selectedItem=e}showCreateNewWatchlistModal(){this.isCreateNewWatchlistModalVisible=!0}onCloseCreateNewWatchlistModal(){this.isCreateNewWatchlistModalVisible=!1}onCreateNewWatchlist(){this.isWatchlistLoading=!0,this.subHandlingService.once(this.watchlistRestService.addWatchlist(this.newWatchlist).pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e.status?(this.getBondWatchlist(),this.onCloseCreateNewWatchlistModal(),this.createNotification(this.NOTIFICATION_SUCCESS.type,"Successfully created new watchlist"),this.newWatchlist=null):(this.createNotification(this.NOTIFICATION_ERROR.type,"Failed to create new watchlist"),this.isWatchlistLoading=!1)})))}onSelectRenameWatchlist(e){this.selectedWatchlistName=e.listName}showRenameWatchlistModal(){this.isRenameWatchlistModalVisible=!0}onCloseRenameWatchlistModal(){this.isRenameWatchlistModalVisible=!1,this.selectedWatchlist=null}onRenameWatchlist(){this.isWatchlistLoading=!0,this.subHandlingService.once(this.watchlistRestService.updateWatchlist(this.selectedWatchlist.listId,this.selectedWatchlistName).pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e.status?(this.getBondWatchlist(),this.onCloseRenameWatchlistModal(),this.createNotification(this.NOTIFICATION_SUCCESS.type,"Successfully renamed watchlist"),this.editingWatchlistName=null,this.selectedWatchlist=null):(this.isWatchlistLoading=!1,this.createNotification(this.NOTIFICATION_ERROR.type,"Failed to rename watchlist"))})))}showDeleteWatchlistModal(){this.isDeleteWatchlistModalVisible=!0}onCloseDeleteWatchlistModal(){this.isDeleteWatchlistModalVisible=!1,this.selectedWatchlist=null}onDeleteWatchlist(){this.modalService.confirm({nzTitle:"Delete Watchlist",nzContent:"Confirm to delete "+this.selectedWatchlist.listName+" watchlist?",nzOnOk:()=>{this.isWatchlistLoading=!0,this.subHandlingService.once(this.watchlistRestService.deleteWatchlist(this.selectedWatchlist.listId).pipe(Object(y.a)(e=>{M.a.RESPONSE_SUCCESS===e.status?(this.getBondWatchlist(),this.onCloseDeleteWatchlistModal(),this.createNotification(this.NOTIFICATION_SUCCESS.type,"Successfully deleted watchlist")):(this.isWatchlistLoading=!1,this.createNotification(this.NOTIFICATION_ERROR.type,"Failed to delete watchlist"))})))}})}createNotification(e,t){if("success"===e){const e=this.modalService.success({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}else if("error"===e){const e=this.modalService.error({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}}addToWatchlist(e){this.bondToAddWatchlist=e.isBondExpress?{issueCode:e.issueCode,bondName:e.bondName,bidPrice:e.bidPrice,bidYtm:this.getBidYtm(e),offerPrice:e.offerPrice,offerYtm:this.getOfferYtm(e),offerYldToWorst:null,bidYldToWorst:null}:{issueCode:null==e?void 0:e.issueCode,bondName:null==e?void 0:e.bondName,bidPrice:null==e?void 0:e.bidPrice,bidYtm:null==e?void 0:e.bidYtm,bidYldToWorst:null==e?void 0:e.bidYldToWorst,offerPrice:null==e?void 0:e.offerPrice,offerYtm:null==e?void 0:e.offerYtm,offerYldToWorst:null==e?void 0:e.offerYldToWorst},"Y"!==e.bexFullLotEnabled&&"Y"!==e.bexOddLotEnabled&&(this.isAddBondModalPriceVisible=!0),this.isAddBondModalVisible=!0}onCloseAddToWatchlist(){this.isAddBondModalPriceVisible=!1,this.isAddBondModalVisible=!1}isWatchListSelected(){return!!this.selectedBondFilter&&!!this.watchlist.find(e=>e.listId.toString()===this.selectedBondFilter.toString())}handleExtendViewCancel(){this.isExtendedMode=!1,this.onChangeExtendView.emit(this.isExtendedMode)}checkShowBondDetails(e){return!!this.selectedItem&&e.issueCode===this.selectedItem.issueCode}onSelectBond(e){this.setSelectedItem(e)}setSelectedItem(e){this.isMobile?this.isMobile&&(this.selectedItem&&e.issueCode===this.selectedItem.issueCode?(this.selectedItem=null,this.closeAllExchangeDetails()):this.selectedItem=e):this.selectedItem=e}
5onShowMarketDepth(e){this.showMarketDepth.emit(e)}onShowTimeAndSales(e){this.showTimeAndSales.emit(e)}onShowSummary(e){this.showSummary.emit(e)}onPageChange(e){this.isWatchListSelected()||(this.bondDataListConverted=[],this.bondDataDisplayListConverted=[],this.bondDataList=[],this.page=e,this.bondFilterModel.pageNum=(e-1).toString(),this.findBondSelectorList(this.bondFilterModel))}onCloseSuspendedBondModal(){this.isSuspendedBondModalVisible=!1}displayCrRating(e,t){let n="";return n=FS.a.HIGH_INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e)),n||(n=FS.a.INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e))),n||(n=FS.a.B_NON_INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e))),n||(n=FS.a.C_NON_INVESTMENT_GRADE_LIST.find(t=>this.checkBondRating(t,e))),n?t?this.getBondRating(n,e):n:FS.a.UNRATED}checkBondRating(e,t){return e===t.crSnpBond||e===t.crFitchBond||e===t.crMarcBond||e===t.crRamBond}getBondRating(e,t){return t.crSnpBond===e?FS.a.SNP_RATING:t.crFitchBond===e?FS.a.FITCH_RATING:t.crMarcBond===e?FS.a.MARC_RATING:t.crRamBond===e?FS.a.RAM_RATING:void 0}getMaturityDateString(e,t){return["-","Perpetual","Matured/ Called"].includes(null==e?void 0:e.yrsToMaturity)?null==e?void 0:e.yrsToMaturity:t?Object(p.K)(null==e?void 0:e.maturityDate,MI.a.DATE_FORMAT_WITHOUT_DASH,M.a.LOCALE_EN):this.getYearsCompareCurrent(null==e?void 0:e.maturityDate)}getYearsCompareCurrent(e){if(e){const t=new Date(e);if(t instanceof Date){const e=new Date;let n=12*(t.getFullYear()-e.getFullYear());n-=e.getMonth(),n+=t.getMonth();let i=0;for(;n>=12;)i+=1,n-=12;return(0!==i?i+" Year(s) ":"")+(n<=0?0:n)+" Month(s)"}}return"-"}isUnrated(e){return this.displayCrRating(e)===FS.a.UNRATED||this.displayCrRating(e)===FS.a.NR||this.displayCrRating(e)===FS.a.NO_RATING||this.displayCrRating(e)===FS.a.WR}unsubscribeBexPrice(){this.subscriptionList.bexPrice.length>0&&(this.subscriptionList.bexPrice.forEach(e=>{e&&this.lsClient.unsubscribe(e)}),this.subscriptionList.bexPrice=[])}unsubscribeRankingList(){this.subscriptionList.rankingList.length>0&&(this.subscriptionList.rankingList.forEach(e=>{e&&this.lsClient.unsubscribe(e)}),this.subscriptionList.rankingList=[])}onSuccessDeleteItemFromWatchlist(e){e&&(this.createNotification(this.NOTIFICATION_SUCCESS.type,"Successfully removed from your watchlist"),this.getBondWatchlist(!0))}closeAllExchangeDetails(){this.onCloseExchangeDetails.emit()}isBondExchange(e){return"Y"===(null==e?void 0:e.bexFullLotEnabled)||"Y"===(null==e?void 0:e.bexOddLotEnabled)}onSelectBondFromSearchInput(e){(null==e?void 0:e.productCode)&&this.keyword.value&&(this.tabLists=Object(g.a)(this.oriTabList),this.selectedTab=this.tabLists[0].value,this.selectedBondFilter=this.SEARCH_RESULT,this.searchInputIssueCode=null==e?void 0:e.productCode,setTimeout(()=>{let t=document.getElementById("custom-nz-switch-toggle");e.type===FS.a.FULL_LOT?(this.isFullLot=!1,t.checked=!0,this.onSwitchChange()):e.type===FS.a.ODD_LOT?(this.isFullLot=!0,t.checked&&(t.checked=!1),this.onSwitchChange()):e.type===FS.a.BOND_EXPRESS?(this.selectedTab=this.tabLists[1].value,this.onChangeTabOption()):(this.selectedTab=this.tabLists[2].value,this.onChangeTabOption())},100))}onClickRetail(e){this.isRetailBond="Y"===this.isRetailBond?"N":"Y",this.isRetailBond&&!e&&this.filterListBasedOnSelectedSearchCondition(),this.getTotalCount()}filterListBasedOnSelectedSearchCondition(){var e;this.isLoading=!0;let t=this.bondDataListConverted;this.selectedBondFilter!==this.SEARCH_RESULT&&("Y"===this.isRetailBond&&(t=t.filter(e=>"Y"===e.retailDistribution)),(null===(e=this.selectedCurrencyList)||void 0===e?void 0:e.length)>0&&(t=t.filter(e=>this.selectedCurrencyList.includes(e.bondCurrencyCode)))),this.bondDataDisplayListConverted=t,this.closeFilterModal(),this.totalSize=this.bondDataDisplayListConverted.length,this.isWatchListSelected()&&this.filterWatchListBasedOnSelectedTab(this.bondDataDisplayListConverted),this.selectedTab===this.tabLists[1].value&&this.sortingKey!=={}&&(this.bondDataDisplayListConverted=Object(Ov.c)(this.sortingKey,this.bondDataDisplayListConverted)),this.isLoading=!1}filterCurrency(e,t){this.selectedCurrencyList=e,t||this.filterListBasedOnSelectedSearchCondition()}
5closeFilterModal(){this.showFilterModal=!1}onShowFilterModal(){this.showFilterModal=!0}getTotalCount(){var e;this.totalCount=0,"Y"===this.isRetailBond&&(this.totalCount+=1),(null===(e=this.selectedCurrencyList)||void 0===e?void 0:e.length)>0&&(this.totalCount+=1)}cancelFilter(){this.showFilterModal=!1}resetFilter(){this.isRetailBond="N",this.selectedCurrencyList=[],this.totalCount=0,this.currencyDisplayList=this.currencyDisplayList.map(e=>e.selected=!1)}onClickCurrencyFilterModal(){this.showCurrencyFilterModal=!0}onCloseCurrencyFilterModal(){this.showCurrencyFilterModal=!1}onSearchCurrencyList(){this.currencyDisplayList=this.searchCurrency?this.currencyList.filter(e=>e.value&&e.value.toLowerCase().includes(this.searchCurrency.toLowerCase())):Object(g.a)(this.currencyList)}selectedAllCurrencyClicked(e){this.currencyDisplayList=this.currencyDisplayList.map(t=>Object.assign(Object.assign({},t),{selected:e})),this.selectedAllCurrency=e}onCheckBoxChange(e,t){this.currencyDisplayList.forEach((function(n){n.value===t&&(n.selected=e)})),this.selectedAllCurrency=!!this.currencyDisplayList.every(e=>!0===e.selected)}onSaveCurrencyFilterList(){this.selectedCurrencyList=this.currencyDisplayList.filter(e=>!0===e.selected).map(e=>e.value),this.getTotalCount(),this.onCloseCurrencyFilterModal()}bondExpressReloadInterval(e){return this.isFirstLoadBe&&this.getBondExpressList(e),setInterval(()=>{this.getBondExpressList(e)},1e4)}findBondExpressList(){return this.bondRestService.findBondExpressList("FMY")}getBondExpressList(e,t){this.isFirstLoadBe&&(this.isLoading=!0,this.isFirstLoadBe=!1),t&&(this.isLoading=!1,this.isSearchingKeyword=!0),this.subHandlingService.once(this.findBondExpressList().pipe(Object(y.a)(n=>{this.processBondExpressData(n,e,t),t&&(this.isSearchingKeyword=!1)},e=>console.log(e)),Object(uv.a)(()=>{})))}processBondExpressData(e,t,n){var i,c,o;if(e.data){let s=[];(null===(i=e.data.bondWholesaleList)||void 0===i?void 0:i.length)>0&&(s=e.data.bondWholesaleList.map(e=>this.mapBeData(e,!1)));let a=[];(null===(c=e.data.bondRetailList)||void 0===c?void 0:c.length)>0&&(a=e.data.bondRetailList.map(e=>this.mapBeData(e,!0)));let l=[...s,...a];if(this.bondExpressList=l,(null==t?void 0:t.length)>0)l=l.filter(e=>t.some(t=>t===e.issueCode)),this.bondDataListConverted.length>0?(l.forEach(e=>{this.bondDataList.forEach(t=>{t.isBondExpress&&t.issueCode===e.issueCode&&(t=e)})}),l.forEach(e=>{let t=!1;this.bondDataListConverted.forEach(n=>{n.isBondExpress&&n.issueCode===e.issueCode&&(t=!0,n=e)}),t||(this.bondDataListConverted.push(e),this.bondDataList.push(e))})):(this.bondDataListConverted=l,this.bondDataList=l);else if(!n&&(ME.GOVERNMENT_BONDS===this.selectedBondFilter?l=l.filter(e=>e.sovereignBond):ME.CORPORATE_BONDS===this.selectedBondFilter&&(l=l.filter(e=>!e.sovereignBond)),this.bondDataList=l,(null===(o=this.bondDataList)||void 0===o?void 0:o.length)>0)){let e=Object(g.a)(this.bondDataList);e=Object(Ov.c)({key:"offerVolume",value:"descend"},e),this.bondDataListConverted=e}n||(this.filterListBasedOnSelectedSearchCondition(),this.isLoading=!1)}}mapBeData(e,t){return Object.assign(Object.assign({},e),{bexOddLotEnabled:"N",bexFullLotEnabled:"N",askPrice:e.offerPrice,isBondExpress:!0,bidSize:e.bidVolume,askSize:e.offerVolume,bidYield:this.getBidYtm(e),askYield:this.getOfferYtm(e),lotType:FS.a.BOND_EXPRESS,retailDistribution:t?"Y":"N"})}getOfferYtm(e){return(null==e?void 0:e.offerYtm)?null==e?void 0:e.offerYtm:null==e?void 0:e.offerYield}getBidYtm(e){return(null==e?void 0:e.bidYtm)?null==e?void 0:e.bidYtm:null==e?void 0:e.bidYield}onSetSortingKey(e){e&&(this.sortingKey=e)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(CI.a),h.lc(qI.a),h.lc(gm.a),h.lc(l.a),h.lc(xc.a),h.lc(pm.a),h.lc(c.a),h.lc(h.j),h.lc(yt.a),h.lc(s.i),h.lc(Nv.a),h.lc(Sc.b),h.lc(c.e),h.lc(wI.a),h.lc(Cg.e),h.lc(OS.a),h.lc(j.e))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-price-list"]],inputs:{isExtendedMode:"isExtendedMode",lsClient:"lsClient",isBondLsAlive:"isBondLsAlive"},outputs:{onChangeExtendView:"onChangeExtendView",onChangeShowBondDetails:"onChangeShowBondDetails",showMarketDepth:"showMarketDepth",showSummary:"showSummary",showTimeAndSales:"showTimeAndSales",onCloseExchangeDetails:"onCloseExchangeDetails"},features:[h.Tb([l.a,Cg.e]),h.Sb],decls:101,vars:60,consts:[["loadingTemplate",""],[3,"hidden"],[3,"ngClass"],[1,"d-flex","flex-row","ant-row-flex-space-between","align-items-center","pt-2"],[1,"font-weight-bold"],["nz-button","","nzOutline","","nzType","primary",1,"px-2",3,"nzSize"],[4,"ngTemplateOutlet"],["priceViewModal",""],["nzWrapClassName","vertical-center-modal",3,"nz
5Visible","nzFooter","nzWidth","nzOnCancel",4,"ngIf"],[3,"check","show","onAccepted"],["prefixIconSearch",""],["prefixIconFilter",""],[3,"showForceUpdateModal"],["loadingMoreTemplate",""],["nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzTitle","nzVisible","nzOnCancel","nzVisibleChange"],[1,"mb-3"],["nzSpan","24"],["nzLabelPlaceholder","Add New Watchlist",1,"w-100","my-3"],["type","text","ui-input","",3,"ngModel","ngModelChange"],[1,"text-right","mt-3"],["nz-button","","nzType","outline",3,"click"],["nz-button","","nzType","primary",1,"ml-3",3,"disabled","nzLoading","click"],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzClosable","nzFooter","nzTitle","nzVisibleChange","nzOnCancel"],["nzLabelPlaceholder","","nzPlaceHolder","Please Select Watchlist",1,"w-100","mt-3","mb-2",3,"ngModel","ngModelChange"],[3,"nzValue","nzLabel",4,"ngFor","ngForOf"],["nzLabelPlaceholder","Rename Watchlist",1,"w-100","mb-3"],[1,"text-center","mt-3"],["noResults",""],[3,"bondToAddWatchlist","watchlistLoading","allWatchlist","showAddBondModal","showPrice","onWatchlistClose","addWatchlistStatus"],[3,"selectedBond","isSuspendedBondModalVisible","closeButtonClicked","proceedButtonClicked"],[3,"nzVisible","nzFooter","nzWidth","nzOnCancel"],[1,"pt-3"],[3,"nzWrapClassName","nzVisible","nzWidth","nzFooter","nzOnCancel"],["nz-row","","nzJustify","left","nzAlign","middle",1,"pt-3"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"text-xl","text-warning","px-2"],[1,"text-lg","font-weight-bold"],["nz-row","","nzJustify","middle","nzAlign","middle",1,"pt-4","px-5"],[1,"text-right","mt-4","py-3"],["nz-button","","nzType","primary",3,"click"],[3,"show","routeRefno","lotType","transType","lsClient","isUpdate","issueCode","onChangeShowBondDetails","onLoading",4,"ngIf"],[1,"mobile-fullscreen"],[3,"isVisible",4,"ngIf"],["modalFooter",""],["modalContent",""],["currencyFilterModalFooter",""],["currencyFilterModalContent",""],[3,"isVisible"],["header",""],[1,"container"],[1,"d-flex","align-items-center"],["nz-icon","","nzType","arrow-left","nzTheme","outline",1,"mr-4",3,"click"],["body",""],["footer",""],["nzTip","Loading...",3,"nzSpinning"],[3,"nzLoading"],["nz-row","","nzGutter","16",1,"mt-2",3,"ngClass"],["nz-col","","nzLg","6","nzSm","6","nzMd","6","nzXs","24",1,"py-1",3,"ngClass"],[1,"w-100",3,"ngModel","nzDropdownMatchSelectWidth","nzSuffixIcon","nzDisabled","ngModelChange"],["nzLabel","My Watchlist",4,"ngIf"],["nzLabel","Create/Edit Watchlist"],["nzLabel","Bonds"],["nzLabel","Others"],["nzDisabled","","nzLabel","Search Result",3,"nzValue"],["nz-button","","class","btn-icon-outline ml-2 text-base rounded-lg align-items-center d-flex justify-content-center font-weight-normal","onclick","this.blur();",3,"disabled","click",4,"ngIf"],["nz-col","","nzLg","6","nzSm","6","nzMd","6","nzXs","24","class","py-1",4,"ngIf"],["nz-col","","nzLg","3","nzSm","3","nzMd","3","nzXs","3","class","py-1",4,"ngIf"],["nz-col","","nzLg","9","nzSm","9","nzMd","9","nzXs","24",1,"py-1"],[1,"w-100",3,"nzPrefix","nzSuffix"],["type","text","nz-input","","placeholder","Search",3,"formControl","nzAutocomplete","input"],[3,"nzBackfill"],["auto",""],[4,"ngIf"],["nzDisabled","","nzCustomContent","",4,"ngIf"],["suffixIconClose",""],["optionTemplate",""],[1,"w-100","my-3"],["nzAlign","middle","nzType","flex",3,"nzGutter"],["nzLg","16","nzSm","24","nzMd","16","nzXs","24",1,"py-1"],["nzButtonStyle","solid",1,"chart-tab",3,"ngClass","ngStyle","ngModel","nzSize","ngModelChange"],["class","text-center font-weight-bold","nz-radio-button","",3,"ngClass","nzValue",4,"ngIf"],[4,"ngFor","ngForOf"],["nzSm","24","nzMd","showTabList?8:24","nzXs","24",3,"nzLg","ngClass",4,"ngIf"],[3,"isLoading","isLoadingBondInfo","bondDataListConverted","totalSize","watchlist","isWatchlistLoading","selectedBondFilter","selectedTab","isFullLot","isExtendedMode","showMarketDepth","showSummary","showTimeAndSales","addToWatchlistClicked","actionButtonClicked","deleteWatchlistSucceed","setSortingKey"],["nzType","flex","nzJustify","start",1,"d-flex","flex-column","mt-3","ml-2"],["alt","bond",3,"src"],["nzLabel","My Watchlist"],[3,"nzValue","nzLabel"],["nz-button","","onclick","this.blur();",1,"btn-icon-outline","ml-2","text-base","rounded-lg","align-items-center","d-flex","justify-content-center","font-weight-normal",3,"disabled","click"],["nz-icon","","nzType","unordered-list","nzTheme","outline"],["nz-col","","nzLg","6","nzSm","6","nzMd","6","nzXs","24",1,"py-1"],["nzDropdownClassName","option-container",1,"w-100","mb-3",3,"nzSuffixIcon","nzLoading","nzPlaceHolder","nzDisabled"],["nzCustomContent",""],[3,"nzOnChange"],["class","p-2 d-block m-0","nz-checkbox","",3,"ngModel","nzValue","ngModelChange",4,"ngFor","ngForOf"],["nz-checkbox","",1,"p-2","d-block","m-0",3,"ngModel","nzValue","ngModelChange"],["nz-col","","nzLg","3","nzSm","3","nzMd","3","nzXs","3",1,"py-1"],["nz-button","","onclick","this.blur();",1,"btn-icon-outline","text-base","rounded-lg","align-items-center","d-flex","justify-content-center","w-100","font-weight-normal",3,"ngClass","disabled","click"],[1,"hidden-sm-down","text-capitalize"],[3,"nzValue","click",4,"ngFor","ngForOf"],["intersectionObserver","",3,"intersectionDebounce","visibilityChange"],[3,"nzValue","click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nzDisabled","","nzCustomContent",""],["nz-icon","","nzType","loading",1,"loading-icon"],["nz-icon","","nzType","search"],["nz-icon","","nzType","close","nzTheme","outline",3,"click"],["class","tag-css text-xs",3,"background-color",4,"ngIf"],[1,"text-sm"],[3,"innerHTML"],[1,"tag-css","text-xs"],["nz-radio-button","",1,"text-center","font-weight-bold",3,"ngClass","nzValue"],["nzSm","24","nzMd","showTabList?8:24","nzXs","24",3,"nzLg","ngClass"],[1,"pr-2",3,"ngClass"],[1,"custom-nz-switch","pr-2"],["type","checkbox","id","custom-nz-switch-toggle",1,"custom-nz-switch-toggle"],["for","custom-nz-switch-toggle",1,"custom-nz-switch-label",3,"ngClass","click"],[1,"custom-nz-switch-inner"],[1,"custom-nz-switch-uncheck"],[1,"custom-nz-switch-check"],[1,"custom-nz-switch-handle",3,"ngClass"],["nzWrapClassName","vertical-center-modal",3,"nz
5Visible","nzFooter","nzWidth","nzOnCancel"],["nz-row","","nzJustify","middle","nzAlign","middle",1,"pt-2","px-5"],["nz-button","","nzType","outline",1,"mr-3",3,"click"],[1,"text-md","font-weight-bold"],[1,"text-theme"],[1,"pt-2","pb-2"],["nz-icon","","nzType","search",1,"text-md"],[1,"img-fluid",3,"src"],[3,"nzNotFoundContent"],[3,"show","routeRefno","lotType","transType","lsClient","isUpdate","issueCode","onChangeShowBondDetails","onLoading"],[1,"d-flex","align-items-center","font-weight-bold","text-black-7"],["nz-icon","","nzType","close","nzTheme","outline",1,"mr-4","text-4xl",3,"click"],[1,"d-flex","justify-content-between"],[1,"text-left","w-50","d-flex","align-items-center"],[1,"selected-count"],[1,"uppercase","ml-1"],[1,"d-flex","flex-row","justify-content-between","w-full","mt-4"],["nz-button","","nzType","default",1,"d-flex","justify-content-center",3,"click"],["nz-button","","nzType","primary",1,"w-100","ml-4",3,"click"],["nzGutter","32",1,"scrollable-modal","container-fluid",3,"ngClass"],[1,"gutter-row","d-table-row","p-0",3,"nzSpan"],[1,"wrapper"],[1,"row-wrapper","gutter-y-4"],[3,"nzSpan"],["stopPropagation","",1,"basic-card","p-4","items-center","rounded-lg","align-item-center","ant-btn-default",3,"ngClass","click"],[1,"text-wrap","my-auto","text-center"],[1,"w-full","container-fluid","pl-2","pr-4"],["nz-button","","nzType","primary",1,"w-full",3,"click"],[1,"container-fluid","px-3"],[1,"scrollable-modal",3,"ngStyle"],[1,"mb-2"],[1,"h-full",3,"nzPrefix"],["nz-input","",3,"placeholder","ngModel","ngModelChange"],["prefixTemplateUser",""],["nz-icon","","nzTheme","outline","nzType","search"],[1,"d-flex","justify-content-start","sm","hover","n-border-bottom"],[1,"w-100","flex"],[1,"self-center","whitespace-nowrap","w-100"],[1,"w-100"],["nz-checkbox","",1,"align-items-center","preline","w-100","pt-2","pb-1",3,"nzValue","nzChecked","ngModel","ngModelChange"],[1,"mt-1","mb-1"],[1,"w-100","d-flex"],["nz-checkbox","",1,"align-self-center","preline","w-100","pt-2","pb-1",3,"nzValue","nzChecked","ngModel","ngModelChange"],["class","mt-1 mb-1",4,"ngIf"]],template:function(e,t){if(1&e&&(h.od(0,dA,2,2,"ng-template",null,0,h.pd),h.rc(2,"div",1),h.Ec(3,"async"),h.rc(4,"div",2),h.Ec(5,"async"),h.rc(6,"app-mobile-scaffold"),h.rc(7,"div",3),h.rc(8,"div",4),h.qd(9," Information "),h.qc(),h.rc(10,"button",5),h.qd(11," Streaming "),h.qc(),h.qc(),h.qc(),h.od(12,uA,1,0,"ng-container",6),h.qc(),h.qc(),h.od(13,jA,42,57,"ng-template",null,7,h.pd),h.od(15,WA,13,4,"nz-modal",8),h.rc(16,"shared-si-declaration-revamp-modal",9),h.zc("onAccepted",(function(){return t.onShowOrderpadAction(t.selectedIssueCode,t.transType,t.lotType)})),h.qc(),h.od(17,YA,1,0,"ng-template",null,10,h.pd),h.od(19,KA,1,1,"ng-template",null,11,h.pd),h.mc(21,"app-risk-profile-required-modal",12),h.od(22,XA,2,2,"ng-template",null,13,h.pd),h.rc(24,"nz-modal",14),h.zc("nzOnCancel",(function(){return t.onCloseCreateNewWatchlistModal()}))("nzVisibleChange",(function(e){return t.isCreateNewWatchlistModalVisible=e})),h.rc(25,"h3",15),h.qd(26,"Add New Watchlist"),h.qc(),h.rc(27,"nz-row"),h.rc(28,"nz-col",16),h.rc(29,"ui-input-group",17),h.rc(30,"input",18),h.zc("ngModelChange",(function(e){return t.newWatchlist=e})),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(31,"div",19),h.rc(32,"button",20),h.zc("click",(function(){return t.onCloseCreateNewWatchlistModal()})),h.qd(33,"Cancel"),h.qc(),h.rc(34,"button",21),h.zc("click",(function(){return t.onCreateNewWatchlist()})),h.qd(35," Create "),h.qc(),h.qc(),h.qc(),h.rc(36,"nz-modal",22),h.zc("nzVisibleChange",(function(e){return t.isRenameWatchlistModalVisible=e}))("nzOnCancel",(function(){return t.onCloseRenameWatchlistModal()})),h.rc(37,"h3",15),h.qd(38,"Rename Watchlist"),h.qc(),h.rc(39,"ui-select",23),h.zc("ngModelChange",(function(e){return t.selectedWatchlist=e}))("ngModelChange",(function(e){return t.onSelectRenameWatchlist(e)})),h.od(40,QA,1,2,"ui-option",24),h.qc(),h.rc(41,"ui-input-group",25),h.rc(42,"input",18),h.zc("ngModelChange",(function(e){return t.selectedWatchlistName=e})),h.qc(),h.qc(),h.rc(43,"div",26),h.rc(44,"button",20),h.zc("click",(function(){return t.onCloseRenameWatchlistModal()})),h.qd(45,"Cancel"),h.qc(),h.rc(46,"button",21),h.zc("click",(function(){return t.onRenameWatchlist()})),h.qd(47," Rename "),h.qc(),h.qc(),h.qc(),h.rc(48,"nz-modal",22),h.zc("nzVisibleChange",(function(e){return t.isDeleteWatchlistModalVisible=e}))("nzOnCancel",(function(){return t.onCloseDeleteWatchlistModal()})),h.rc(49,"h3",15),h.qd(50,"Delete Watchlist"),h.qc(),h.rc(51,"ui-select",23),h.zc("ngModelChange",(function(e){return t.selectedWatchlist=e})),h.od(52,ZA,1,2,"ui-option",24),h.qc(),h.rc(53,"div",26),h.rc(54,"button",20),h.zc("click",(function(){return t.onCloseDeleteWatchlistModal()})),h.qd(55,"Cancel"),h.qc(),h.rc(56,"button",21),h.zc("click",(function(){return t.onDeleteWatchlist()})),h.qd(57,"Delete "),h.qc(),h.qc(),h.qc(),h.od(58,JA,2,1,"ng-template",null,27,h.pd),h.rc(60,"bond-watchlist-icon",28),h.zc("onWatchlistClose",(function(){return t.onCloseAddToWatchlist()}))("addWatchlistStatus",(function(){return t.getBondWatchlist()})),h.qc(),h.od(61,eE,2,1,"ng-template",null,27,h.pd),h.rc(63,"app-bond-rmo-suspension-modal",29),h.zc("closeButtonClicked",(function(){return t.onCloseSuspendedBondModal()}))("proceedButtonClicked",(function(){return t.onShowOrderpadAction(t.selectedBond.issueC
5ode,t.transType,t.bondConstant.OTC)})),h.qc(),h.rc(64,"nz-modal",30),h.zc("nzOnCancel",(function(){return t.handleExtendViewCancel()})),h.rc(65,"div",31),h.od(66,tE,1,0,"ng-container",6),h.qc(),h.qc(),h.rc(67,"nz-modal",32),h.zc("nzOnCancel",(function(){return t.errorVisible=!1})),h.rc(68,"div",33),h.mc(69,"i",34),h.rc(70,"span",35),h.qd(71,"Notice"),h.qc(),h.qc(),h.rc(72,"div",36),h.qd(73," You do not have selected bond holdings for sell. "),h.qc(),h.rc(74,"div",37),h.rc(75,"button",38),h.zc("click",(function(){return t.errorVisible=!1})),h.qd(76,"Close"),h.qc(),h.qc(),h.qc(),h.od(77,nE,1,7,"app-rmo-transaction-details",39),h.rc(78,"app-mobile-scaffold"),h.rc(79,"div",40),h.od(80,oE,13,3,"uic-mobile-full-screen",41),h.Ec(81,"async"),h.qc(),h.od(82,sE,13,4,"ng-template",null,42,h.pd),h.od(84,lE,19,18,"ng-template",null,43,h.pd),h.od(86,rE,4,0,"ng-template",null,44,h.pd),h.od(88,fE,11,7,"ng-template",null,45,h.pd),h.rc(90,"uic-mobile-full-screen",46),h.pc(91,47),h.rc(92,"div",48),h.rc(93,"div",49),h.rc(94,"i",50),h.zc("click",(function(){return t.onCloseCurrencyFilterModal()})),h.qc(),h.rc(95,"h2"),h.qd(96,"Currency"),h.qc(),h.qc(),h.qc(),h.oc(),h.pc(97,51),h.od(98,gE,1,0,"ng-container",6),h.oc(),h.pc(99,52),h.od(100,bE,1,0,"ng-container",6),h.oc(),h.qc(),h.qc()),2&e){const e=h.ad(14),n=h.ad(87),i=h.ad(89);h.Ub(2),h.Mc("hidden",h.Fc(3,52,t.isMobile$)&&(t.showBondDetails||t.showFilterModal)),h.Ub(2),h.Mc("ngClass",h.Sc(58,SE,h.Fc(5,54,t.isMobile$))),h.Ub(6),h.Mc("nzSize","small"),h.Ub(2),h.Mc("ngTemplateOutlet",e),h.Ub(3),h.Mc("ngIf",t.selectedBond),h.Ub(1),h.Mc("check",!0)("show",t.showSiDeclarationModel),h.Ub(5),h.Mc("showForceUpdateModal",t.showForceUpdateModal),h.Ub(3),h.Mc("nzClosable",!0)("nzFooter",null)("nzTitle",null)("nzVisible",t.isCreateNewWatchlistModalVisible),h.Ub(6),h.Mc("ngModel",t.newWatchlist),h.Ub(4),h.Mc("disabled",!t.newWatchlist||t.isWatchlistLoading)("nzLoading",t.isWatchlistLoading),h.Ub(2),h.Mc("nzVisible",t.isRenameWatchlistModalVisible)("nzClosable",!0)("nzFooter",null)("nzTitle",null),h.Ub(3),h.Mc("ngModel",t.selectedWatchlist),h.Ub(1),h.Mc("ngForOf",t.watchlist),h.Ub(2),h.Mc("ngModel",t.selectedWatchlistName),h.Ub(4),h.Mc("disabled",!t.selectedWatchlistName||!t.selectedWatchlist||t.selectedWatchlist.listName===t.selectedWatchlistName||t.isWatchlistLoading)("nzLoading",t.isWatchlistLoading),h.Ub(2),h.Mc("nzVisible",t.isDeleteWatchlistModalVisible)("nzClosable",!0)("nzFooter",null)("nzTitle",null),h.Ub(3),h.Mc("ngModel",t.selectedWatchlist),h.Ub(1),h.Mc("ngForOf",t.watchlist),h.Ub(4),h.Mc("disabled",!t.selectedWatchlist||t.isWatchlistLoading)("nzLoading",t.isWatchlistLoading),h.Ub(4),h.Mc("bondToAddWatchlist",t.bondToAddWatchlist)("watchlistLoading",t.isWatchlistLoading)("allWatchlist",t.watchlist)("showAddBondModal",t.isAddBondModalVisible)("showPrice",t.isAddBondModalPriceVisible),h.Ub(3),h.Mc("selectedBond",t.selectedBond)("isSuspendedBondModalVisible",t.isSuspendedBondModalVisible),h.Ub(1),h.Mc("nzVisible",t.isExtendedMode)("nzFooter",null)("nzWidth","90%"),h.Ub(2),h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("nzWrapClassName","vertical-center-modal")("nzVisible",t.errorVisible)("nzWidth",600)("nzFooter",null),h.Ub(10),h.Mc("ngIf",t.showBondDetails),h.Ub(3),h.Mc("ngIf",h.Fc(81,56,t.isMobile$)),h.Ub(10),h.Mc("isVisible",t.showCurrencyFilterModal),h.Ub(8),h.Mc("ngTemplateOutlet",i),h.Ub(2),h.Mc("ngTemplateOutlet",n)}},directives:[p.q,z.a,_.a,p.A,p.t,Dt.a,yI.a,j.a,P.c,P.a,ae.c,oe.c,ae.b,oe.t,oe.w,Lt.d,p.s,zI.a,DI.a,k.b,PI.a,Il.a,W.a,Xv.d,Xv.c,Xv.a,Pn.c,TI.e,Pn.b,oe.i,TI.a,Ut.c,p.w,sA,Lt.a,lo.d,lo.a,TI.d,aA.a,Ut.a,MM.b,lA.a,rA.a,Nu.a],pipes:[p.b,AI.a],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}.chart-tab[_ngcontent-%COMP%] .ant-radio-button-wrapper[_ngcontent-%COMP%]{border-radius:4px;font-size:14px;color:var(--black)}.chart-tab.ant-radio-group-small[_ngcontent-%COMP%] .ant-radio-button-wrapper[_ngcontent-%COMP%]{padding:0 8px;margin:0 2px}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%]{border-radius:4px}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]{box-shadow:none}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled){background:#004bad}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled):hover{box-shadow:0 3px 8px 0 rgba(0,0,0,.5)}.live-feed-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{font-size:12px}.live-feed-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:4px!important}.live-feed-table[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%], .live-feed-table[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{padding:4px}.live-feed-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-
57px}.bid-price[_ngcontent-%COMP%]{display:inline-block;padding:2px 5px;color:#000;border:1px solid #ff333a;border-top-left-radius:8px;border-bottom-left-radius:8px}.bid-price.bg-loss[_ngcontent-%COMP%]{border:1px solid #ff333a}.bid-price.bg-profit[_ngcontent-%COMP%]{border:1px solid #093}.bid-price-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.profit-blink[_ngcontent-%COMP%]{width:100%;padding:5px;color:#fff;background-color:#093}.ask-price[_ngcontent-%COMP%], .profit-blink[_ngcontent-%COMP%]{border:1px solid #093;border-top-right-radius:8px;border-bottom-right-radius:8px}.ask-price[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;color:#000}.ask-price.bg-profit[_ngcontent-%COMP%]{border:1px solid #093}.ask-price.bg-loss[_ngcontent-%COMP%]{border:1px solid #ff333a}.ask-price-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-right-radius:4px!important;border-bottom-right-radius:4px!important}.loss-blink[_ngcontent-%COMP%]{width:100%;padding:5px;border:1px solid #ff333a;border-top-right-radius:8px;border-bottom-right-radius:8px}.loss-blink[_ngcontent-%COMP%], .red-blink[_ngcontent-%COMP%]{color:#fff;background-color:#ff333a}.red-blink[_ngcontent-%COMP%]{border-color:#ff333a}.green-blink[_ngcontent-%COMP%]{color:#fff;border-color:#093;background-color:#093}.buy-sell-container[_ngcontent-%COMP%]{white-space:nowrap;width:100%}.buy-button[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;background-color:#093;color:#fff;border:1px solid #093;border-top-left-radius:8px;border-bottom-left-radius:8px}.buy-button-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-left-radius:4px!important;border-bottom-left-radius:4px!important}.sell-button[_ngcontent-%COMP%]{padding:2px 5px;display:inline-block;border:1px solid #ff333a;background-color:#ff333a;color:#fff;border-top-right-radius:8px;border-bottom-right-radius:8px}.sell-button-mobile-web[_ngcontent-%COMP%]{padding:4px!important;border-top-right-radius:4px!important;border-bottom-right-radius:4px!important}.add-label[_ngcontent-%COMP%]{font-weight:600;background:#cba119 0 0 no-repeat padding-box;display:inline-block;transform:skewX(-15deg);padding:2px 6px;font-size:13px}.disabled-buy-sell[_ngcontent-%COMP%]{pointer-events:none}.disabled-buy-sell[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{display:inline-block;border:1px solid #d3d3d3;background-color:#d3d3d3;color:#7a7a7a;border-top-left-radius:8px;border-bottom-left-radius:8px}.disabled-buy-sell[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{display:inline-block;color:#000;border:1px solid #d3d3d3;border-top-right-radius:8px;border-bottom-right-radius:8px}.custom-loading-icon[_ngcontent-%COMP%]{color:red}.custom-nz-switch[_ngcontent-%COMP%]{display:inline-block;position:relative;cursor:pointer}.custom-nz-switch-toggle[_ngcontent-%COMP%]{display:none}.custom-nz-switch-label[_ngcontent-%COMP%]{display:flex;align-items:center;position:relative;width:52px;height:16px;background-color:rgba(45,68,198,.3);border-radius:20px;transition:background-color .3s ease}.custom-nz-switch-inner[_ngcontent-%COMP%]{position:relative;flex:1;width:100%}.custom-nz-switch-check[_ngcontent-%COMP%], .custom-nz-switch-uncheck[_ngcontent-%COMP%]{display:inline-block;height:100%;width:50%;text-align:center;line-height:40px;color:#fff}.custom-nz-switch-handle[_ngcontent-%COMP%]{position:absolute;top:50%;transform:translateY(-50%);width:24px;height:24px;background-color:#2d44c6;opacity:1;border-radius:20px;transition:left .3s ease;left:calc(100% - 24px)}.custom-nz-switch-label.checked[_ngcontent-%COMP%]{background-color:rgba(221,174,23,.3)}.custom-nz-switch-handle.checked[_ngcontent-%COMP%]{left:0;background-color:#ddae17}.parent-container[_ngcontent-%COMP%]{display:flex}.flex-container[_ngcontent-%COMP%]{flex:1}@media only screen and (max-width:767px){.chart-tab[_ngcontent-%COMP%] .ant-radio-button-wrapper[_ngcontent-%COMP%]{border-radius:4px;font-size:14px;color:var(--black);white-space:nowrap}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%]{border-radius:4px}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]{box-shadow:none}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled){background:#004bad}.chart-tab.ant-radio-group-solid[_ngcontent-%COMP%] .ant-radio-button-wrapper-checked[_ngcontent-%COMP%]:not(.ant-radio-button-wrapper-disabled):hover{box-shadow:0 3px 8px 0 rgba(0,0,0,.5)}}.end-align[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.start-align[_ngcontent-%COMP%]{display:flex;justify-content:flex-start}
5.text-grey[_ngcontent-%COMP%]{color:#adadad}.bg-cert[_ngcontent-%COMP%]{background-repeat:no-repeat;height:56px;width:56px}.tag-css[_ngcontent-%COMP%]{padding:3px 4px;border-radius:4px;color:#fff;text-transform:capitalize;font:normal normal medium 11px/10px SF Pro Text;background-color:#f48b85}.ui-dropdown-options-selected[_ngcontent-%COMP%]{border:2px solid #0073cf!important;overflow:unset}.ui-dropdown-options-selected[_ngcontent-%COMP%]:after{content:attr(data-count);background-color:#0073cf;color:#fff;width:18px;height:18px;border-radius:50%;text-align:center;line-height:16px;font-size:10px;position:absolute;top:0;right:0;left:unset;border:1px solid #0073cf;transform:translateY(-50%);opacity:1;background-image:unset;transition:none}.btn-icon-outline[_ngcontent-%COMP%]{padding:0 16px!important;color:#000;transition:unset}.btn-icon-outline.no-focus[_ngcontent-%COMP%]{color:#000!important;background-color:var(--black-1)!important;border:1px solid var(--black-4)!important;box-shadow:none!important}.btn-icon-outline[_ngcontent-%COMP%]:hover{color:var(--black)!important;background-color:var(--black-1);border:2px solid var(--black)!important;padding:0 15px!important;box-shadow:none}.btn-icon-outline.no-uppercase[_ngcontent-%COMP%]{text-transform:none}.btn-icon-outline.active[_ngcontent-%COMP%]:not(.no-focus), .btn-icon-outline[_ngcontent-%COMP%]:focus:not(.no-focus){color:var(--brand-info)!important;background-color:var(--black-2);border:2px solid var(--black-2)!important;padding:0 15px!important;box-shadow:none}.btn-icon-outline.active[_ngcontent-%COMP%]:hover{border-color:var(--brand-info)!important}.btn-icon-outline.ant-btn-sm[_ngcontent-%COMP%]:hover{padding:0 8px!important}.btn-icon-outline.ant-btn-sm.active[_ngcontent-%COMP%]:not(.no-focus), .btn-icon-outline.ant-btn-sm[_ngcontent-%COMP%]:focus:not(.no-focus){padding:0 8px!important}.basic-card-button[_ngcontent-%COMP%]{padding-top:1px;padding-bottom:1px}.basic-card[_ngcontent-%COMP%], .basic-card-button[_ngcontent-%COMP%]{border-radius:8px;border:1px solid var(--black-4);height:100%;display:flex;align-items:center!important;justify-content:center;box-sizing:border-box;cursor:pointer}.basic-card[_ngcontent-%COMP%] .card-shadow[_ngcontent-%COMP%]{box-shadow:0 3px 10px var(--black-4)}.basic-card[_ngcontent-%COMP%] .rounded-sm[_ngcontent-%COMP%]{border-radius:4px}.basic-card.no-focus[_ngcontent-%COMP%]{color:#000;background-color:#fff;border:1px solid #d3d3d3;box-shadow:none}.basic-card[_ngcontent-%COMP%]:hover{color:#000;background-color:#fff;border:1px solid #000;box-shadow:none}.basic-card.active[_ngcontent-%COMP%]:not(.no-focus), .basic-card[_ngcontent-%COMP%]:focus:not(.no-focus){color:#0073cf;background-color:#e8f2ff;border:2px solid #e8f2ff;box-shadow:none}.basic-card.active[_ngcontent-%COMP%]:hover{border-color:#0073cf}.uic-dropdown-options-selected[_ngcontent-%COMP%]{border:2px solid #0073cf;overflow:unset}.uic-dropdown-options-selected[_ngcontent-%COMP%]:after{content:attr(data-count);background-color:#0073cf;color:#fff;width:18px;height:18px;border-radius:50%;text-align:center;line-height:16px;font-size:10px;position:absolute;top:0;right:0;border:1px solid #0073cf;transform:translateY(-50%);left:unset;opacity:1;background-image:unset;transition:none}.scrollable-modal[_ngcontent-%COMP%]{overflow-y:auto}.wrapper[_ngcontent-%COMP%]{max-width:1038px;margin:0 auto;width:100%}.row-wrapper[_ngcontent-%COMP%]{flex-direction:row;display:flex;flex-wrap:wrap}.gutter-y-4[_ngcontent-%COMP%] .ant-col[_ngcontent-%COMP%]{padding:9px}.border-blue[_ngcontent-%COMP%]{border-color:var(--blue)!important}.selected-count[_ngcontent-%COMP%]{background-color:#0073cf;color:#fff;width:18px;height:18px;border-radius:50%;text-align:center;font-size:14px;top:0;right:0;border:1px solid #0073cf;line-height:15px;display:inline-block} .ant-select-dropdown-menu-item{background-color:transparent!important}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();var vE=function(e){return e.ALL_BONDS="allBonds",e.MOST_ACTIVE="TopVolume",e.TOP_GAINERS="TopGainerByAmount",e.TOP_GAINERS_PERCENT="TopGainerByPercent",e.TOP_LOSERS="TopLoserByAmount",e.TOP_LOSERS_PERCENT="TopLoserByPercent",e}({}),ME=function(e){return e.GOVERNMENT_BONDS="govBonds",e.CORPORATE_BONDS="corpBonds",e}({}),CE=n("/NUC");function qE(e,t){if(1&e&&(h.pc(0),h.rc(1,"tr"),h.rc(2,"td"),h.rc(3,"span",26),h.qd(4),h.Ec(5,"sdate"),h.qc(),h.qc(),h.rc(6,"td"),h.rc(7,"nz-row"),h.rc(8,"a",27),h.qd(9),h.qc(),h.qc(),h.qc(),h.rc(10,"td"),h.qd(11),h.qc(),h.rc(12,"td"),h.qd(13),h.qc(),h.rc(14,"td"),h.qd(15),h.Ec(16,"number"),h.qc(),h.rc(17,"td"),h.qd(18),h.Ec(19,"number"),h.qc(),h.rc(20,"td"),h.qd(21),h.Ec(22,"number"),h.qc(),h.rc(23,"td"),h.qd(24),h.Ec(25,"number"),h.qc(),h.rc(26,"td"),h.qd(27),h.Ec(28,"number"),h.qc(),h.rc(29,"td",28),h.rc(30,"nz-tag",29),h.qd(31),h.qc(),h.qc(),h.mc(32,"td"),h.qc(),h.oc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(4),h.rd(h.Fc(5,11,null==e?null:e.transactionDate)),h.Ub(5),h.rd(e.productName),h.Ub(2),h.rd(e.transactionType),h.Ub(2),h.rd(e.method),h.Ub(2),h.rd(h.Gc(16,13,e.nominalQuantity,"1.0-0")),h.Ub(3),h.rd(h.Gc(19,16,e.matchedNominal,"1.0-0")),h.Ub(3),h.rd("complete"==e.status?h.Gc(22,19,null==e?null:e.price,"1.3-3"):"-"),h.Ub(3),h.rd("complete"==e.status?h.Gc(25,22,null==e?null:e.price,"1.3-3"):"-"),h.Ub(3),h.rd("complete"==e.status?(null==e?null:e.productCurrency)+" "+h.Gc(28,25,e.amount,"1.2-2"):"-"),h.Ub(3),h.Mc("ngClass",n.determineStatusColor(e.status)),h.Ub(1),h.rd(e.status)}}const TE=function(){return{x:"600px"}};function wE(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-table",16,17),h.rc(2,"thead",18),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc().tableSort(t)})),h.rc(3,"tr",19),h.rc(4,"th",20),h.qd(5,"Date"),h.qc(),h.rc(6,"th",21),h.qd(7,"Bond "),h.mc(8,"br"),h.qd(9," Name"),h.qc(),h.rc(10,"th",22),h.qd(11,"Order Type"),h.qc(),h.rc(12,"th",23),h.qd(13,"Payment Method"),h.qc(),h.rc(14,"th",22),h.qd(15,"Qty"),h.qc(),h.rc(16,"th",22),h.qd(17,"Matched Qty"),h.qc(),h.rc(18,"th",22),h.qd(19,"Price"),h.qc(),h.rc(20,"th",24),h.qd(21,"Avg Matched Price"),h.qc(),h.rc(22,"th",24),h.qd(23,"Gross Amt"),h.qc(),h.rc(24,"th",22),h.qd(25,"Status"),h.qc(),h.mc(26,"th"),h.qc(),h.qc(),h.rc(27,"tbody"),h.od(28,qE,33,28,"ng-container",25),h.qc(),h.qc()}if(2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzData",t.filteredPendingTableDisplayData)("nzScroll",h.Rc(12,TE))("nzShowPagination",(null==t.tempOrderBookInfos?null:t.tempOrderBookInfos.length)>=0),h.Ub(4),h.Mc("nzSortKey",t.displayCols[0].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[1].key),h.Ub(4),h.Mc("nzSortKey",t.displayCols[2].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[3].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[4].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[5].key),h.Ub(2),h.Mc("nzSortKey",t.displayCols[6].key),h.Ub(6),h.Mc("nzSortKey",t.displayCols[7].key),h.Ub(4),h.Mc("ngForOf",e.data)}}function zE(e,t){1&e&&h.nc(0)}function DE(e,t){1&e&&h.nc(0)}function PE(e,t){if(1&e&&(h.rc(0,"tr"),h.rc(1,"td"),h.rc(2,"nz-row"),h.rc(3,"nz-col",38),h.qd(4),h.qc(),h.qc(),h.qc(),h.rc(5,"td"),h.rc(6,"nz-row"),h.rc(7,"nz-col",33),h.rc(8,"span",39),h.qd(9),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(10,"td"),h.rc(11,"nz-row"),h.rc(12,"nz-col"),h.rc(13,"div",40),h.rc(14,"span",41),h.qd(15),h.qc(),h.mc(16,"br"),h.qd(17," - "),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(18,"td"),h.rc(19,"nz-row"),h.rc(20,"nz-col"),h.rc(21,"div",40),h.rc(22,"span"),h.qd(23),h.Ec(24,"number"),h.qc(),h.mc(25,"br"),h.qd(26," - "),h.mc(27,"br"),h.qd(28," - "),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(29,"td"),h.rc(30,"nz-row"),h.rc(31,"nz-col"),h.rc(32,"div",40),h.rc(33,"span",41),h.qd(34),h.Ec(35,"sdate"),h.qc(),h.mc(36,"br"),h.rc(37,"span"),h.qd(38),h.qc(),h.mc(39,"br"),h.rc(40,"nz-tag",29),h.qd(41),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Ub(4),h.sd(" ",n.mobileChangeBidAsk(e.ordSide)," "),h.Ub(5),h.rd(e.productName),h.Ub(6),h.rd(e.nominalQuantity),h.Ub(8),h.rd(h.Gc(24,8,null==e?null:e.price,"1.4-4")),h.Ub(11),h.rd(h.Fc(35,11,e.transactionDate)),h.Ub(4),h.rd(e.method),h.Ub(2),h.Mc("ngClass",n.determineStatusColor(e.status)),h.Ub(1),h.rd(e.status)}}const IE=function(){return{x:"100%"}};function kE(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-table",30,17),h.rc(2,"thead",18),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc().tableSort(t)})),h.rc(3,"tr"),h.mc(4,"th",31),h.rc(5,"th",32),h.rc(6,"span",33),h.qd(7,"Bond Name"),h.qc(),h.qc(),h.rc(8,"th",34),h.qd(9,"Qty"),h.mc(10,"br"),h.rc(11,"span",35),h.qd(12,"Matched Qty"),h.qc(),h.qc(),h.rc(13,"th",36),h.qd(14,"Price"),h.mc(15,"br"),h.rc(16,"span",35),h.qd(17,"Matched Price"),h.qc(),h.mc(18,"br"),h.rc(19,"span"),h.qd(20,"Gross Amt"),h.qc(),h.qc(),h.rc(21,"th",37),h.qd(22,"Date"),h.mc(23,"br"),h.rc(24,"span",35),h.qd(25,"Payment Method"),h.qc(),h.mc(26,"br"),h.rc(27,"span",35),h.qd(28,"Status"),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(29,"tbody"),h.od(30,PE,42,13,"tr",25),h.qc(),h.qc()}if(2&e){const e=h.ad(1),t=h.Dc();h.Mc("nzData",t.filteredPendingTableDisplayData)("nzScroll",h.Rc(4,IE))("nzFrontPagination",!0),h.Ub(30),h.Mc("ngForOf",e.data)}}function AE(e,t){1&e&&h.qd(0," Info for USOTC shares is not available.\n")}function EE(e,t){if(1&e&&h.mc(0,"ui-option",44),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function FE(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",42),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().filterMarket=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().onFilterStatus()})),h.od(1,EE,1,2,"ui-option",43),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngModel",e.filterMarket),h.Ub(1),h.Mc("ngForOf",e.filterOption)}}function OE(e,t){if(1&e){const e=h.sc();h.rc(0,"form",45),h.rc(1,"nz-input-group"),h.rc(2,"input",46),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().filterSearchText=t}))("ngModelChange",(function(){return h.dd(e),h.Dc().search()})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(2),h.Mc("ngModel",e.filterSearchText)}}let UE=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l,r,d){this.notification=e,this.holdingRestService=t,this.authService=n,this.stockTransactionRestService=i,this.orderBookService=c,this.accountService=o,this.router=s,this.liveFeedService=a,this.scheduledSellRestService=l,this.cdRef=r,this.subHandlingService=d,this.emitMarketDepth=new h.s,this.selectedItem={ordPrice:0},this.orderBookLoading=!0,this.isNewTradingHourStart=!1,this.orderBookInfos=[],this.tempOrderBookInfos=[],this.transactionListModel=[],this.historicalTableInfoModelList=[],this.transactionBondListModel=[],this.pendingTableInfoModelList=[],this.filteredPendingTableDisplayData=[],this.searchQuery=new jt.a,this.searchByStatus=new jt.a,this.historicalUpdateInteral=3e4,this.displayCols=[{key:"transactionDate",colName:"Date"},{key:"productName",colName:"Bond Name"},{key:"transactionType",colName:"Order Type"},{key:"method",colName:"Payment Method"},{key:"nominalQuantity",colName:"Qty"},{key:"filledQty",colName:"Matched Qty"},{key:"price",colName:"Price"},{key:"status",colName:"Status"}],this.KLSE="KLSE",this.BURSA="BURSA",this.CNH="CNH",this.CNY="CNY",this.USOTC=M.q.USOTC,this.PRICE_DELAY="PRICE-DELAY-",this.TRUST_ACCOUNT=M.q.TRUST_ACCOUNT,this.AUTO_SWEEP=M.q.AUTO_SWEEP,this.PRICE_QUOTE_FIELDS=["symbol","exchange","stockCode","stockName","currency","lastPrice","cumulativeVolume","bidPrice","bidQuantity","askPrice","askQuantity","openPrice","closePrice","dayHigh","dayLow","change","changePercentage"],this.filterOption=[{label:"All",value:""},{label:"Bond Express",value:"RMO"},{label:"OTC Bond",value:"OTC"}],this.searchQuery.pipe(Object(ce.a)(500),Object(b.a)()).subscribe(e=>{this.filterMarket="",this.filteredPendingTableDisplayData=Object(g.a)(this.historicalTableInfoModelList),this.filteredPendingTableDisplayData=this.filteredPendingTableDisplayData.filter(t=>t.productName&&t.productName.toLowerCase().includes(e.toLowerCase()))}),this.searchByStatus.subscribe(()=>{this.filterSearchText="",this.filteredPendingTableDisplayData=Object(g.a)(this.historicalTableInfoModelList),this.filteredPendingTableDisplayData=this.filteredPendingTableDisplayData.filter(e=>e.bondChannel===this.filterMarket||""===this.filterMarket)})}ngOnInit(){this.subscribeRefnoChange();const e=new Date,t=new Date("2023-04-15 00:00:00");e.getTime()>=t.getTime()&&(this.isNewTradingHourStart=!0)}ngOnChanges(){this.search(),this.onFilterStatus()}ngOnDestroy(){}search(){this.searchQuery.next(this.filterSearchText)}
5onFilterStatus(){this.searchByStatus.next(this.filterMarket)}tableSort(e){this.filteredPendingTableDisplayData=Object(Ov.c)(e,this.filteredPendingTableDisplayData)}findAllHistoricalTransaction(){return this.historicalTableInfoModelList=[],this.transactionListModel=[],this.holdingRestService.findAllBondHistoricalTransaction(this.routeRefno).pipe(Object(y.a)(e=>{(null==e?void 0:e.status)===M.a.RESPONSE_SUCCESS&&(e.data.buy.forEach(e=>{this.transactionListModel.push(e)}),e.data.sell.forEach(e=>{this.transactionListModel.push(e)}),this.transactionBondListModel=this.transactionListModel.filter(e=>"bond"===e.productType),this.transactionBondListModel.forEach(e=>{e.transactionHistoryList.forEach(t=>{("RMO"!==(null==t?void 0:t.bondChannel)&&"void"===(null==t?void 0:t.status)||"RMO"===(null==t?void 0:t.bondChannel)&&"void"!==(null==t?void 0:t.status)&&"complete"===(null==t?void 0:t.status)||"RMO"!==(null==t?void 0:t.bondChannel)&&"complete"===(null==t?void 0:t.status))&&this.historicalTableInfoModelList.push(this.mapPendingTableInfoModel(e,t))})}),this.filteredPendingTableDisplayData=this.historicalTableInfoModelList,this.sortByOrderDateDescending(),this.orderBookLoading=!1)}))}refreshFindAllHistoricalTransaction(){return this.historicalTableInfoModelList=[],this.transactionListModel=[],this.holdingRestService.findAllBondHistoricalTransaction(this.routeRefno).pipe(Object(y.a)(e=>{(null==e?void 0:e.status)===M.a.RESPONSE_SUCCESS&&(e.data.buy.forEach(e=>{this.transactionListModel.push(e)}),e.data.sell.forEach(e=>{this.transactionListModel.push(e)}),this.transactionBondListModel=this.transactionListModel.filter(e=>"bond"===e.productType),this.transactionBondListModel.forEach(e=>{e.transactionHistoryList.forEach(t=>{("RMO"!==(null==t?void 0:t.bondChannel)&&"void"===(null==t?void 0:t.status)||"RMO"===(null==t?void 0:t.bondChannel)&&"void"!==(null==t?void 0:t.status)&&"complete"===(null==t?void 0:t.status)||"RMO"!==(null==t?void 0:t.bondChannel)&&"complete"===(null==t?void 0:t.status))&&this.historicalTableInfoModelList.push(this.mapPendingTableInfoModel(e,t))})}),this.filteredPendingTableDisplayData=this.historicalTableInfoModelList,this.sortByOrderDateDescending(),this.orderBookLoading=!1)}))}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.routeRefno=e,this.cdRef.markForCheck(),this.orderBookLoading=!0,this.subHandlingService.once(this.findAllHistoricalTransaction())})))}sortByOrderDateDescending(){this.filteredPendingTableDisplayData=this.historicalTableInfoModelList.sort((e,t)=>new Date(t.voidCompleteDate).getTime()-new Date(e.voidCompleteDate).getTime())}mapPendingTableInfoModel(e,t){var n;let i,c,o="-";switch(t.paymentMode){case U.a.CHEQUE_FPX:case U.a.CHEQUE.toLowerCase():o="Cheque";break;case U.a.CASH_FUND:o="CMF2";break;case U.a.TRUST_ACCOUNT:o="Cash Account ("+t.currency+")";break;case U.a.EPF_FUNDS.toUpperCase():o=U.a.EPF_FUNDS.toUpperCase();break;case U.a.GOPAYZ:o=U.a.GOPAYZ;break;case U.a.CASH_MANAGEMENT_FUND:o="Cash Account";break;default:o=this.checkAutoSweepRelatedPaymentMethod(o,null==t?void 0:t.paymentMode)}return i="complete"===t.status?t.nominalValue:"-",c="Buy"===e.paymentType&&"complete"===t.status?t.productCurrency:t.currency,{orderDate:(null==t?void 0:t.orderDate)?t.orderDate:(null==t?void 0:t.transactionDate)?t.transactionDate:e.clientOrderDate,orderNum:e.orderNo,productType:e.productType,exchange:t.exchange,transactionType:e.paymentType,amount:null!=t.amountAf?t.amountAf:t.amount,nominalQuantity:t.nominalValue,price:null==t?void 0:t.transactedPrice,method:o,refno:this.routeRefno,orderType:t.orderType,status:t.status,fpxPaymentSuccessful:e.fpxPaymentSuccessful,fpxPaymentAllowed:e.fpxPaymentAllowed,currency:c,productCurrency:t.productCurrency,pendingTransactionModel:t,fxPaymentAllowed:null==e?void 0:e.fxPaymentAllowed,completeDate:null==t?void 0:t.settlementDate,voidCompleteDate:null==t?void 0:t.voidCompleteDate,contractNum:(null==t?void 0:t.contractNo)?null==t?void 0:t.contractNo:"-",transactionDate:null==t?void 0:t.transactionDate,paymentAllowed:null==e?void 0:e.paymentAllowed,goPayzPaymentAllowed:null==e?void 0:e.goPayzPaymentAllowed,totalAmount:null==e?void 0:e.totalAmount,productName:null==t?void 0:t.productName,matchedNominal:i,gotSyariahPortfolio:(null==e?void 0:e.productType)===r.b.DPMS&&-1!==(null===(n=null==t?void 0:t.productName)||void 0===n?void 0:n.indexOf("Islamic")),bondChannel:"RMO"===(null==t?void 0:t.bondChannel)?"RMO":"OTC"}}checkAutoSweepRelatedPaymentMethod(e,t){return(null==t?void 0:t.includes(U.a.AUTO_SWEEP))?t:t===U.a.UNIT_TRUST?U.a.UNIT_TRUST_DISPLAY:t===U.a.BOND_DISPLAY?U.a.BOND_DISPLAY:t===U.a.DPMS?U.a.DPMS_DISPLAY:e}readOrderHistory(){}
5refactorOrderBookInfos(e){e.forEach(e=>{e.totalAmount=e.avgPrice*e.filledQty,e.orderId.indexOf(".")>0&&(e.orderId=e.orderId.split(".")[0]),e.sdate=this.convertToDate(e.ordDate)})}determineTypeColor(e){return"BUY"===e?"#009933":"#FF333A"}changeBidAsk(e){return"BUY"===e?"Buy":e===M.q.SCHEDULED_SELL?e:"Sell"}convertToDate(e){return new Date(e.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))}determineStatusColor(e){return"unfulfilled"==e?"tag-pending-processing":"complete"==e?"tag-received":"tag-terminated"}mobileDetermineStatusColor(e){return"BUY"===e?"bg-profit":"bg-loss"}mobileChangeBidAsk(e){return"BUY"===e?"B":"A"}navigateToStocksFactsheet(e,t,n,i){let c;"BURSA"===t&&(t="KLSE"),c="ETF"==i?Object(mt.f)(r.b.ETF,n,"",e,t):Object(mt.f)(r.b.STOCK_AND_ETF,n,"",e,t),Object(pt.a)(c.route,c.params)}redirectToTransHist(){this.router.navigate([Object(v.a)(M.o.APP,M.o.TRANSACTION_RECORD,M.o.HISTORICAL)],{queryParams:{refno:this.routeRefno}})}onSelectStockInfoRow(e){return Object(o.b)(this,void 0,void 0,(function*(){e.securityType=e.exchangeSubType,e.exchange===M.q.BURSA&&(e.exchange=M.q.KLSE),this.selectedItem=Object(g.a)(e),this.handleSelectedStockForPriceQuote(this.selectedItem),this.emitMarketDepth.emit(this.selectedItem)}))}unsubscribePriceQuoteLS(){this.tempSubPriceQuote&&(this.lsClient.unsubscribe(this.tempSubPriceQuote),this.tempSubPriceQuote=null)}unsubscribeSnapOnly(){this.tempSnapSub&&(this.lsClient.unsubscribe(this.tempSnapSub),this.tempSnapSub.getListeners().forEach(e=>{this.tempSnapSub.removeListener(e)}),this.tempSnapSub=null)}determineSedolNumberExchg(e){return e.exchange===M.q.KLSE||e.exchange===M.q.BURSA?"135:"+e.stockCode:"126:"+e.stockCode}handleSelectedStockForPriceQuote(e){this.unsubscribePriceQuoteLS();let t=this;e.sedolnumber=this.determineSedolNumberExchg(e),this.tempSubPriceQuote=this.liveFeedService.subscribePriceQuote(this.lsClient,this.PRICE_QUOTE_FIELDS,[e])[0],this.tempSubPriceQuote.addListener({onItemUpdate:e=>{let n=[];e.forEachChangedField((e,i,c)=>{const o=this.PRICE_QUOTE_FIELDS.indexOf(e);n[o]=c,"exchange"===e&&(n[o]=c===M.q.BURSA?M.q.KLSE:c),"currency"===e&&(n[o]=c===t.CNH?t.CNY:c),t.selectedItem[e]=n[o]})}})}handleSubscribeDelayedSnap(e){return new Promise(t=>{const n=this;(null==e?void 0:e.symbol)&&null!=(null==e?void 0:e.symbol)&&null!=(null==e?void 0:e.symbol)&&!(null==e?void 0:e.symbol.includes("undefined"))?(this.tempSnapSub=this.liveFeedService.getSNAP(this.lsClient),this.tempSnapSub.addListener({onItemUpdate(i){let c=JSON.parse(i.updateValues[3]);n.selectedItem=Object.assign(Object.assign({},e),c[e.symbol]),n.unsubscribeSnapOnly(),t(n.selectedItem)},onSubscription(){n.lsClient.sendMessage(n.liveFeedService.constructMessage(wg.a.PRICE,n.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20","UNORDERED_MESSAGES",0,{})}})):console.log("Invalid symbol found for LS Subscription : "+(null==e?void 0:e.symbol))})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(Sc.b),h.lc(xc.a),h.lc(wD.a),h.lc(Rv.a),h.lc(zD.a),h.lc(pm.a),h.lc(c.e),h.lc(hm.a),h.lc(yv.a),h.lc(h.j),h.lc(l.a))},e.\u0275cmp=h.fc({type:e,selectors:[["bond-app-order-book-historical-transaction"]],inputs:{filterMarket:"filterMarket",filterSearchText:"filterSearchText",filterAccount:"filterAccount",lsClient:"lsClient"},outputs:{emitMarketDepth:"emitMarketDepth"},features:[h.Sb],decls:31,vars:9,consts:[[3,"nzActive","nzLoading"],["class","order-book-historical-table",3,"nzData","nzScroll","nzShowPagination",4,"ngIf"],[1,"bg-white"],[4,"ngTemplateOutlet"],[1,"mt-2","mb-3"],[3,"nzSpan"],[3,"nzData","nzScroll","nzFrontPagination",4,"ngIf"],[1,"text-xs","mt-4"],["nzType","flex","nzAlign","middle"],["nzXs","2","nzSm","2","nzMd","2","nzLg","1",1,"text-center"],["nz-icon","","nzType","info-circle","nzTheme","outline",1,"text-warning"],["nzXs","22","nzSm","22","nzMd","22","nzLg","22"],[1,"text-info","pointer","text-black-7",3,"click"],["usotcInfoTooltip",""],["filterMarketTemplate",""],["filterSearchTextTemplate",""],[1,"order-book-historical-table",3,"nzData","nzScroll","nzShowPagination"],["orderBookTable",""],[3,"nzSortChange"],[1,"text-xs"],["nzShowSort","","nzWidth","10%",1,"text-center",3,"nzSortKey"],["nzShowSort","","nzWidth","15%",3,"nzSortKey"],["nzShowSort","",1,"text-right",3,"nzSortKey"],["nzShowSort","",1,"text-left",3,"nzSortKey"],["nzShowSort","",1,"text-right"],[4,"ngFor","ngForOf"],[1,"text-center","text-xs"],[1,"font-weight-bold","text-xs","ellipsis-stock-name"],[1,"text-center"],[1,"m-0",3,"ngClass"],[3,"nzData","nzScroll","nzFrontPagination"],["nzWidth","5%"],["nzWidth","35%"],[1,"text-sm"],["nzWidth","22%",1,"text-right","text-sm"],[1,"font-weight-normal"],["nzWidth","28%",1,"text-right","text-sm"],["nzWidth","30%",1,"text-right","text-sm"],[1,"text-xs","font-weight-bold","text-white"],[1,"text-info","font-weight-bold","ellipsis-stock-name"],[1,"text-right","text-sm"],[1,"font-weight-bold"],["nzPlaceHolder","Filter by Market","nzAllowClear","",1,"w-100",3,"ngModel","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],[3,"nzLabel","nzValue"],["autocomplete","off"],["type","search","nz-input","","placeholder","Search","name","filterSearch",3,"ngModel","ngModelChange"]],template:function(e,t){if(1&e&&(h.rc(0,"app-web-scaffold"),h.rc(1,"nz-row"),h.mc(2,"nz-skeleton",0),h.od(3,wE,29,13,"nz-table",1),h.qc(),h.qc(),h.rc(4,"app-mobile-scaffold"),h.rc(5,"nz-row",2),h.rc(6,"nz-row"),h.rc(7,"nz-col"),h.od(8,zE,1,0,"ng-container",3),h.qc(),h.qc(),h.rc(9,"nz-row",4),h.rc(10,"nz-col"),h.od(11,DE,1,0,"ng-container",3),h.qc(),h.qc(),h.rc(12,"nz-col",5),h.mc(13,"nz-skeleton",0),h.od(14,kE,31,5,"nz-table",6),h.qc(),h.qc(),h.qc(),h.rc(15,"div",7),h.rc(16,"nz-row",8),h.rc(17,"nz-col",9),h.mc(18,"i",10),h.qc(),h.rc(19,"nz-col",11),h.rc(20,"span"),h.qd(21,"For historical transactions beyond past 5 trading days, kindly refer to Transaction Record > "),h.qc(),h.rc(22,"span",12),h.zc("click",(function(){return t.redirectToTransHist()})),h.qd(23," Historical Transaction "),h.qc(),h.mc(24,"br"),h.qc(),h.qc(),h.qc(),h.od(25,AE,1,0,"ng-template",null,13,h.pd),h.od(27,FE,2,2,"ng-template",null,14,h.pd),h.od(29,OE,3,1,"ng-template",null,15,h.pd)),2&e){const e=h.ad(28),n=h.ad(30);h.Ub(2),h.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),h.Ub(1),h.Mc("ngIf",!t.orderBookLoading),h.Ub(5),h.Mc("ngTemplateOutlet",e),h.Ub(3),h.Mc("ngTemplateOutlet",n),h.Ub(1),h.Mc("nzSpan",24),h.Ub(1),h.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),h.Ub(1),h.Mc("ngIf",!t.orderBookLoading)}},directives:[B.a,P.c,W.a,p.t,z.a,P.a,p.A,k.b,ve.a,ve.f,ve.g,ve.e,ve.c,p.s,ve.d,le.a,p.q,Lt.d,oe.t,oe.w,Lt.a,oe.J,oe.u,oe.v,Pn.c,oe.c,Pn.b],pipes:[_c.a,p.g],styles:[".order-book-historical-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-
57px}.ellipsis-stock-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;max-width:100%;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}"]}),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function xE(e,t){1&e&&h.nc(0)}function LE(e,t){1&e&&h.nc(0)}function RE(e,t){1&e&&h.nc(0)}function NE(e,t){1&e&&h.nc(0)}function BE(e,t){if(1&e&&(h.rc(0,"app-web-scaffold"),h.rc(1,"nz-row",9),h.rc(2,"nz-col",10),h.od(3,xE,1,0,"ng-container",11),h.qc(),h.rc(4,"nz-col",10),h.od(5,LE,1,0,"ng-container",11),h.qc(),h.qc(),h.rc(6,"nz-row",12),h.od(7,RE,1,0,"ng-container",11),h.qc(),h.rc(8,"nz-row"),h.rc(9,"nz-col"),h.od(10,NE,1,0,"ng-container",11),h.qc(),h.qc(),h.qc()),2&e){h.Dc();const e=h.ad(10),t=h.ad(12),n=h.ad(14),i=h.ad(6);h.Ub(2),h.Mc("nzSpan",6),h.Ub(1),h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("nzSpan",17),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(2),h.Mc("ngTemplateOutlet",n),h.Ub(3),h.Mc("ngTemplateOutlet",i)}}function _E(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"bond-app-order-book-your-order",14),h.zc("hideAppBar",(function(t){return h.dd(e),h.Dc(3).hideAppBar(t)}))("emitMarketDepth",(function(t){return h.dd(e),h.Dc(3).emitMarketDepth(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("lsClient",e.lsClient)("filterMarket",e.filterMarket)("filterSearchText",e.filterSearchText)("filterAccount",e.filterAccount)("isAcctAllowScheduledSell",e.isAcctAllowScheduledSell)}}function VE(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"bond-app-order-book-historical-transaction",15),h.zc("emitMarketDepth",(function(t){return h.dd(e),h.Dc(3).emitMarketDepth(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("lsClient",e.lsClient)("filterMarket",e.filterMarket)("filterSearchText",e.filterSearchText)("filterAccount",e.filterAccount)}}function HE(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.rc(1,"nz-row",13),h.rc(2,"nz-col"),h.rc(3,"nz-row"),h.rc(4,"nz-col"),h.od(5,_E,2,6,"ng-container",0),h.od(6,VE,2,4,"ng-container",0),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(5),h.Mc("ngIf","order"===e.selectedOrderBookNavigation),h.Ub(1),h.Mc("ngIf","historical"===e.selectedOrderBookNavigation)}}function $E(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"bond-app-order-book-your-order",14),h.zc("hideAppBar",(function(t){return h.dd(e),h.Dc(3).hideAppBar(t)}))("emitMarketDepth",(function(t){return h.dd(e),h.Dc(3).emitMarketDepth(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("lsClient",e.lsClient)("filterMarket",e.filterMarket)("filterSearchText",e.filterSearchText)("filterAccount",e.filterAccount)("isAcctAllowScheduledSell",e.isAcctAllowScheduledSell)}}function jE(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"bond-app-order-book-historical-transaction",15),h.zc("emitMarketDepth",(function(t){return h.dd(e),h.Dc(3).emitMarketDepth(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(3);h.Ub(1),h.Mc("lsClient",e.lsClient)("filterMarket",e.filterMarket)("filterSearchText",e.filterSearchText)("filterAccount",e.filterAccount)}}function GE(e,t){if(1&e&&(h.od(0,$E,2,6,"ng-container",0),h.od(1,jE,2,4,"ng-container",0)),2&e){const e=h.Dc(2);h.Mc("ngIf","order"===e.selectedOrderBookNavigation),h.Ub(1),h.Mc("ngIf","historical"===e.selectedOrderBookNavigation)}}function WE(e,t){if(1&e&&h.mc(0,"ui-option",21),2&e){const e=t.$implicit;h.Mc("nzValue",null==e?null:e.value)("nzLabel",null==e?null:e.label)}}function YE(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",18),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).filterAccount=t})),h.mc(1,"ui-option",19),h.od(2,WE,1,2,"ui-option",20),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("ngModel",e.filterAccount),h.Ub(2),h.Mc("ngForOf",e.displayAccountOptions)}}function KE(e,t){if(1&e&&h.mc(0,"ui-option",21),2&e){const e=t.$implicit;h.Mc("nzValue",null==e?null:e.value)("nzLabel",null==e?null:e.label)}}function XE(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",22),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(3).filterAccount=t})),h.mc(1,"ui-option",19),h.od(2,KE,1,2,"ui-option",20),h.qc()}if(2&e){h.Dc(2);const e=h.ad(20),t=h.Dc();h.Mc("nzSuffixIcon",e)("ngModel",t.filterAccount),h.Ub(2),h.Mc("ngForOf",t.displayAccountOptions)}}function QE(e,t){if(1&e&&(h.od(0,YE,3,2,"ui-select",16),h.Ec(1,"async"),h.od(2,XE,3,3,"ui-select",17),h.Ec(3,"async")),2&e){const e=h.Dc(2);h.Mc("ngIf",!h.Fc(1,2,e.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(3,4,e.isMobile$))}}function ZE(e,t){if(1&e&&h.mc(0,"ui-option",25),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}function JE(e,t){if(1&e){const e=h.sc();h.rc(0,"ui-select",23),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).filterMarket=t})),h.od(1,ZE,1,2,"ui-option",24),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("ngModel",e.filterMarket),h.Ub(1),h.Mc("ngForOf",e.filterOption)}}function eF(e,t){if(1&e){const e=h.sc();h.rc(0,"form",26),h.rc(1,"nz-input-group",27),h.rc(2,"input",28),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).filterSearchText=t})),h.qc(),h.qc(),h.qc()}if(2&e){h.Dc();const e=h.ad(18),t=h.ad(16),n=h.Dc();h.Ub(1),h.Mc("nzPrefix",e)("nzSuffix",t),h.Ub(1),h.Mc("ngModel",n.filterSearchText)}}const tF=function(){return{width:"auto"}};function nF(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-col",30),h.rc(1,"div",31),h.zc("click",(function(){h.dd(e);
5const n=t.$implicit;return h.Dc(3).onTabClick(n.value)})),h.qd(2),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.Dc(3);h.Mc("ngStyle",h.Rc(4,tF)),h.Ub(1),h.Mc("title",e.label)("ngStyle",n.isActive(e.value)),h.Ub(1),h.rd(e.label)}}function iF(e,t){if(1&e&&h.od(0,nF,3,5,"nz-col",29),2&e){const e=h.Dc(2);h.Mc("ngForOf",e.menu)}}function cF(e,t){if(1&e){const e=h.sc();h.rc(0,"i",33),h.zc("click",(function(){return h.dd(e),h.Dc(3).clear()})),h.qc()}}function oF(e,t){if(1&e&&h.od(0,cF,1,0,"i",32),2&e){const e=h.Dc(2);h.Mc("ngIf",e.filterSearchText)}}function sF(e,t){1&e&&h.mc(0,"i",34)}function aF(e,t){1&e&&h.mc(0,"i",35)}function lF(e,t){if(1&e&&(h.pc(0),h.od(1,BE,11,6,"app-web-scaffold",0),h.Ec(2,"async"),h.od(3,HE,7,2,"app-mobile-scaffold",0),h.Ec(4,"async"),h.od(5,GE,2,2,"ng-template",null,1,h.pd),h.od(7,QE,4,6,"ng-template",null,2,h.pd),h.od(9,JE,2,2,"ng-template",null,3,h.pd),h.od(11,eF,3,3,"ng-template",null,4,h.pd),h.od(13,iF,1,1,"ng-template",null,5,h.pd),h.od(15,oF,1,1,"ng-template",null,6,h.pd),h.od(17,sF,1,0,"ng-template",null,7,h.pd),h.od(19,aF,1,0,"ng-template",null,8,h.pd),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",!h.Fc(2,2,e.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(4,4,e.isMobile$))}}let rF=(()=>{class e{constructor(e,t,n){this.accountService=e,this.route=t,this.store=n,this.emitMarketDepthAction=new h.s,this.IStockOptionType=d.c,this.bondEnum=d.a,this.hide=!1,this.orderBookInfos=[],this.tempOrderBookInfos=[],this.displayCols=[{key:"stockName",colName:"Stock Name"},{key:"ordTime",colName:"Order Date"},{key:"ordSide",colName:"Type"},{key:"ordQty",colName:"Qty"},{key:"ordPrice",colName:"Price"},{key:"avgPrice",colName:"W.A.C"},{key:"filledQty",colName:"Matched Qty"},{key:"matchAmt",colName:"Matched Amt"},{key:"orderId",colName:"Contract ID"},{key:"ordStatusText",colName:"Status"}],this.menu=[{label:"Your Order",value:"order"},{label:"Historical Transaction",value:"historical"}],this.filterMarket="",this.todayDate=new Date,this.selectedOrderBookNavigation="order",this.displayAccountOptions=[{label:"Cash Upfront",value:"M"},{label:"Margin Acct",value:"C"}],this.filterOption=[{label:"All",value:""},{label:"Bond Express",value:"RMO"},{label:"OTC Bond",value:"OTC"}]}ngOnInit(){this.initRouteParam()}clear(){this.filterSearchText=null,this.tempOrderBookInfos=this.orderBookInfos}initRouteParam(){this.route.queryParams.subscribe(e=>{e.refno&&this.store.dispatch(new u.N(e.refno)),e.tabType&&(this.selectedOrderBookNavigation=e.tabType)})}onTabClick(e){this.selectedOrderBookNavigation=e,this.filterMarket="",this.filterSearchText=""}isActive(e){if(this.selectedOrderBookNavigation===e)return{backgroundColor:"#BD2E26",color:"white"}}hideAppBar(e){this.hide=e}onAppBarBack(){}emitMarketDepth(e){this.emitMarketDepthAction.emit(e)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(pm.a),h.lc(c.a),h.lc(s.i))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-order-book"]],inputs:{primaryCashAcctAvailableBalance:"primaryCashAcctAvailableBalance",lsClient:"lsClient",selectedTab:"selectedTab",isAcctAllowScheduledSell:"isAcctAllowScheduledSell"},outputs:{emitMarketDepthAction:"emitMarketDepthAction"},decls:1,vars:1,consts:[[4,"ngIf"],["tableTemplate",""],["filterAccountType",""],["filterMarketTemplate",""],["filterSearchTextTemplate",""],["orderBookTabTemplate",""],["suffixTemplate",""],["prefixIconSearch",""],["suffixStatus",""],["nzGutter","16"],[3,"nzSpan"],[4,"ngTemplateOutlet"],["nzType","flex","nzAlign","middle",1,"pb-3","mt-3"],[1,"p-3","bg-white","mt-3"],[3,"primaryCashAcctAvailableBalance","lsClient","filterMarket","filterSearchText","filterAccount","isAcctAllowScheduledSell","hideAppBar","emitMarketDepth"],[3,"lsClient","filterMarket","filterSearchText","filterAccount","emitMarketDepth"],["class","w-100","nzPlaceHolder","Account","nzAllowClear","",3,"ngModel","ngModelChange",4,"ngIf"],["class","w-100","nzPlaceHolder","Account","nzAllowClear","",3,"nzSuffixIcon","ngModel","ngModelChange",4,"ngIf"],["nzPlaceHolder","Account","nzAllowClear","",1,"w-100",3,"ngModel","ngModelChange"],["nzValue","","nzLabel","All"],[3,"nzValue","nzLabel",4,"ngFor","ngForOf"],[3,"nzValue","nzLabel"],["nzPlaceHolder","Account","nzAllowClear","",1,"w-100",3,"nzSuffixIcon","ngModel","ngModelChange"],["nzPlaceHolder","Filter by Market","nzAllowClear","",1,"w-100",3,"ngModel","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],[3,"nzLabel","nzValue"],["autocomplete","off"],[3,"nzPrefix","nzSuffix"],["type","search","nz-input","","placeholder","Search","name","filterSearch",3,"ngModel","ngModelChange"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[1,"tab","rounded-circle","px-2","py-1","mr-3","text-sm","text-center",3,"title","ngStyle","click"],["nz-icon","","nz-tooltip","","class","ant-input-clear-icon","nzTheme","fill","nzType","close-circle",3,"click",4,"ngIf"],["nz-icon","","nz-tooltip","","nzTheme","fill","nzType","close-circle",1,"ant-input-clear-icon",3,"click"],["nz-icon","","nzType","search",1,"text-black"],["nz-icon","","nzType","right","nzTheme","outline",1,"text-black"]],template:function(e,t){1&e&&h.od(0,lF,21,6,"ng-container",0),2&e&&h.Mc("ngIf",t.selectedTab===t.bondEnum.ORDER_BOOK)},directives:[p.t,B.a,P.c,P.a,p.A,z.a,CE.a,UE,Lt.d,oe.t,oe.w,Lt.a,p.s,oe.J,oe.u,oe.v,Pn.c,oe.c,Pn.b,p.w,k.b,xt.e],pipes:[p.b],styles:[".tab[_ngcontent-%COMP%]{-moz-user-select:none;user-select:none;color:#000;background-color:#ededed;cursor:pointer}.active[_ngcontent-%COMP%]{background-color:#bd2e26;color:#fff}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var dF=n("6n6N");function uF(e,t){if(1&e&&(h.rc(0,"span",53),h.qd(1," Current Value "),h.mc(2,"i",31),h.qc()),2&e){h.Dc();const e=h.ad(132);h.Ub(2),h.Mc("nzTooltipTitle",e)}}function hF(e,t){if(1&e&&(h.rc(0,"span",54),h.qd(1,"MYR "),h.qc(),h.rc(2,"
5span",33),h.qd(3),h.Ec(4,"number"),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.rd(h.Gc(4,1,e.totalCurrentValueMyr,"1.2-2"))}}function pF(e,t){if(1&e&&(h.rc(0,"span",53),h.qd(1,"Total Cost "),h.mc(2,"i",31),h.qc()),2&e){h.Dc();const e=h.ad(134);h.Ub(2),h.Mc("nzTooltipTitle",e)}}function mF(e,t){if(1&e&&(h.rc(0,"span",54),h.qd(1,"MYR "),h.qc(),h.rc(2,"span",33),h.qd(3),h.Ec(4,"number"),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.rd(h.Gc(4,1,e.totalCostMyr,"1.2-2"))}}function fF(e,t){if(1&e&&(h.rc(0,"span",53),h.qd(1,"Interest Income "),h.mc(2,"i",31),h.qc()),2&e){h.Dc();const e=h.ad(136);h.Ub(2),h.Mc("nzTooltipTitle",e)}}function gF(e,t){if(1&e&&(h.rc(0,"span",54),h.qd(1,"MYR "),h.qc(),h.rc(2,"span",33),h.qd(3),h.Ec(4,"number"),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.rd(h.Gc(4,1,e.totalIntestIncomeValueMyr,"1.2-2"))}}function bF(e,t){1&e&&(h.rc(0,"span",53),h.qd(1,"P/L (%)"),h.qc())}function SF(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",56),h.qd(2,"MYR "),h.qc(),h.rc(3,"span",57),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"span",57),h.qd(7),h.Ec(8,"number"),h.qc(),h.mc(9,"i",58),h.qc()),2&e){const e=h.Dc(2);h.Ub(4),h.rd(h.Gc(5,2,e.totalProfitAndLossValueMyr,"1.2-2")),h.Ub(3),h.rd(" ("+h.Gc(8,5,e.totalProfitAndLossPercentageValueMyr,"1.2-2")+"%) ")}}function yF(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",59),h.qd(2,"- MYR "),h.qc(),h.rc(3,"span",60),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"span",60),h.qd(7),h.Ec(8,"number"),h.qc(),h.mc(9,"i",61),h.qc()),2&e){const e=h.Dc(2);h.Ub(4),h.rd(h.Gc(5,2,0-e.totalProfitAndLossValueMyr,"1.2-2")),h.Ub(3),h.rd(" ("+h.Gc(8,5,e.totalProfitAndLossPercentageValueMyr,"1.2-2")+"%) ")}}function vF(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"span",54),h.qd(2,"MYR "),h.qc(),h.rc(3,"span",33),h.qd(4),h.Ec(5,"number"),h.qc(),h.rc(6,"span",33),h.qd(7),h.Ec(8,"number"),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(4),h.rd(h.Gc(5,2,e.totalProfitAndLossValueMyr,"1.2-2")),h.Ub(3),h.rd(" ("+h.Gc(8,5,e.totalProfitAndLossPercentageValueMyr,"1.2-2")+"%)")}}function MF(e,t){if(1&e&&(h.od(0,SF,10,8,"div",55),h.od(1,yF,10,8,"div",55),h.od(2,vF,9,8,"div",55)),2&e){const e=h.Dc();h.Mc("ngIf",e.totalProfitAndLossValueMyr>0),h.Ub(1),h.Mc("ngIf",e.totalProfitAndLossValueMyr<0),h.Ub(1),h.Mc("ngIf",0===e.totalProfitAndLossValueMyr)}}function CF(e,t){if(1&e){const e=h.sc();h.rc(0,"i",62),h.zc("click",(function(){return h.dd(e),h.Dc().onSearchClear()})),h.qc()}}function qF(e,t){1&e&&h.mc(0,"i",63)}function TF(e,t){if(1&e&&h.mc(0,"ui-option",64),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e)}}function wF(e,t){if(1&e&&(h.rc(0,"label",65),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function zF(e,t){if(1&e){const e=h.sc();h.rc(0,"app-rmo-transaction-details",66),h.zc("onChangeShowBondDetails",(function(t){return h.dd(e),h.Dc().onBondBuyDetailVisibleChange(t)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("show",e.showBondDetails)("routeRefno",e.routeRefno)("lotType",e.lotType)("transType",e.transType)("lsClient",e.lsClient)("isUpdate",!1)("issueCode",e.selectedIssueCode)}}function DF(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",67),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().isSuspendedBondModalVisible=t}))("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseSuspendedBondModal()})),h.rc(1,"div",68),h.mc(2,"i",69),h.rc(3,"span",70),h.qd(4,"Trade on OTC Market"),h.qc(),h.qc(),h.rc(5,"div",71),h.rc(6,"span",72),h.qd(7),h.qc(),h.qd(8," is currently suspended in Bond Express. Click \u201cProceed\u201d to trade it on the OTC market. "),h.qc(),h.rc(9,"div",73),h.rc(10,"button",74),h.zc("click",(function(){return h.dd(e),h.Dc().suspendedBondOnProceed()})),h.qd(11," Proceed "),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",e.isSuspendedBondModalVisible)("nzClosable",!0)("nzFooter",null)("nzTitle",null)("nzMaskClosable",!1),h.Ub(7),h.rd(null==e.selectedBond?null:e.selectedBond.bondName)}}function PF(e,t){if(1&e&&(h.rc(0,"label",75),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function IF(e,t){if(1&e){const e=h.sc();h.rc(0,"i",62),h.zc("click",(function(){return h.dd(e),h.Dc().onSearchClear()}
5)),h.qc()}}function kF(e,t){1&e&&h.mc(0,"i",63)}function AF(e,t){if(1&e&&h.mc(0,"nz-option",64),2&e){const e=t.$implicit;h.Mc("nzValue",e)("nzLabel",e)}}function EF(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",85),h.Ec(2,"async"),h.Ec(3,"async"),h.qd(4),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.Mc("nzShowSort",!h.Fc(2,4,t.isMobile$))("nzSortKey",e.key)("nzWidth",h.Fc(3,6,t.isMobile$)?"90px":"180px"),h.Ub(3),h.sd(" ",e.colName," ")}}function FF(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",86),h.qd(2),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit;h.Ub(2),h.rd(e.colName)}}function OF(e,t){if(1&e&&(h.pc(0),h.rc(1,"div"),h.qd(2),h.qc(),h.oc()),2&e){const e=h.Dc(2).$implicit;h.Ub(2),h.rd(e.additionalColName)}}function UF(e,t){if(1&e&&(h.pc(0),h.rc(1,"th",87),h.Ec(2,"async"),h.rc(3,"div"),h.qd(4),h.qc(),h.od(5,OF,3,1,"ng-container",55),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(1),h.Nc("nzSortKey",e.key),h.Mc("nzShowSort",!h.Fc(2,4,t.isMobile$)),h.Ub(3),h.rd(e.colName),h.Ub(1),h.Mc("ngIf",null==e?null:e.additionalColName)}}function xF(e,t){if(1&e&&(h.pc(0),h.pc(1,82),h.od(2,EF,5,8,"ng-container",83),h.od(3,FF,3,1,"ng-container",83),h.od(4,UF,6,6,"ng-container",84),h.oc(),h.oc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngSwitch",e.key),h.Ub(1),h.Mc("ngSwitchCase","productName"),h.Ub(1),h.Mc("ngSwitchCase","actions")}}const LF=function(e,t){return{"text-profit":e,"text-loss":t}};function RF(e,t){if(1&e&&(h.pc(0),h.rc(1,"tr"),h.rc(2,"td",88),h.rc(3,"div",89),h.qd(4),h.qc(),h.qc(),h.rc(5,"td",90),h.rc(6,"p",91),h.qd(7),h.Ec(8,"number"),h.Ec(9,"number"),h.qc(),h.rc(10,"p",92),h.qd(11),h.Ec(12,"number"),h.qc(),h.qc(),h.rc(13,"td",90),h.rc(14,"div",93),h.rc(15,"p",91),h.qd(16),h.Ec(17,"number"),h.qc(),h.rc(18,"p",94),h.qd(19),h.Ec(20,"number"),h.qc(),h.qc(),h.qc(),h.rc(21,"td",90),h.rc(22,"p",91),h.qd(23),h.Ec(24,"number"),h.qc(),h.rc(25,"p",91),h.qd(26),h.Ec(27,"number"),h.qc(),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Ub(4),h.rd(e.productName),h.Ub(3),h.sd(" ","myr"===t.selectedCurrencyOption?h.Gc(8,8,e.productCurValMyr,".2-2"):h.Gc(9,11,e.productCurVal,".2-2")," "),h.Ub(4),h.sd(" ",h.Gc(12,14,null==e?null:e.currentUnits,".3-3")," "),h.Ub(3),h.Mc("ngClass",h.Tc(29,LF,e.profitValue>0||e.profitValueMyr>0,e.profitValue<0||e.profitValueMyr<0)),h.Ub(2),h.sd(" ",h.Gc(17,17,"myr"===t.selectedCurrencyOption?e.profitValueMyr:e.profitValue,"1.2-2")," "),h.Ub(3),h.sd(" ",h.Gc(20,20,"myr"===t.selectedCurrencyOption?e.profitPercentageMyr:e.profitPercentage,"1.2-2"),"% "),h.Ub(4),h.rd(h.Gc(24,23,null==e?null:e.lastestPrice,".3-3")),h.Ub(3),h.rd(h.Gc(27,26,null==e?null:e.wac,".4-4"))}}function NF(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"tr"),h.rc(2,"td",88),h.rc(3,"div",89),h.qd(4),h.qc(),h.qc(),h.rc(5,"td",90),h.qd(6),h.Ec(7,"number"),h.qc(),h.rc(8,"td",90),h.rc(9,"div"),h.qd(10),h.Ec(11,"number"),h.qc(),h.rc(12,"div"),h.qd(13),h.Ec(14,"number"),h.qc(),h.qc(),h.rc(15,"td",90),h.rc(16,"span"),h.qd(17),h.Ec(18,"number"),h.Ec(19,"number"),h.qc(),h.qc(),h.rc(20,"td",90),h.rc(21,"span"),h.qd(22),h.Ec(23,"number"),h.Ec(24,"number"),h.qc(),h.qc(),h.rc(25,"td",90),h.rc(26,"div",93),h.rc(27,"div"),h.qd(28),h.Ec(29,"customizeCurrency"),h.Ec(30,"customizeCurrency"),h.qc(),h.rc(31,"div"),h.qd(32),h.Ec(33,"number"),h.qc(),h.qc(),h.qc(),h.rc(34,"td",90),h.rc(35,"span"),h.qd(36),h.Ec(37,"number"),h.Ec(38,"number"),h.qc(),h.qc(),h.rc(39,"td",90),h.rc(40,"span",95),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).buyBond("",t.allowBuy,t.productCode)})),h.qd(41,"Buy"),h.qc(),h.rc(42,"span",96),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).sellBond("",t.allowSell,t.productCode)})),h.qd(43,"Sell"),h.qc(),h.rc(44,"button",97),h.mc(45,"i",98),h.qc(),h.rc(46,"nz-dropdown-menu",null,99),h.rc(48,"ul",100),h.rc(49,"li",101),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).handleWatchlistModalVisible(t)})),h.qd(50,"Add to Watchlist"),h.qc(),h.rc(51,"li",101),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).goToTransactionHistory(t)})),h.qd(52,"View Transaction History"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.ad(47),t=h.Dc().$implicit,n=h.Dc(2);h.Ub(4),h.rd(t.productName),h.Ub(2),h.td(" ",t.currencyCode," ",h.Gc(7,16,null==t?null:t.currentUnits,".3-3")," "),h.Ub(4),h.rd(h.Gc(11,19,null==t?null:t.lastestPrice,".3-3")),h.Ub(3),h.td("",t.currencyCode," ",h.Gc(14,22,null==t?null:t.wac,".4-4"),""),h.Ub(4),h.td(" ","myr"===n.selectedCurrencyOption?"MYR":t.currencyCode," ","myr"===n.selectedCurrencyOption?h.Gc(18,25,t.productC
5ostMyr,".2-2"):h.Gc(19,28,t.productCost,".2-2")," "),h.Ub(5),h.td(" ","myr"===n.selectedCurrencyOption?"MYR":t.currencyCode," ","myr"===n.selectedCurrencyOption?h.Gc(23,31,t.productCurValMyr,".2-2"):h.Gc(24,34,t.productCurVal,".2-2")," "),h.Ub(4),h.Mc("ngClass",h.Tc(53,LF,t.profitValue>0||t.profitValueMyr>0,t.profitValue<0||t.profitValueMyr<0)),h.Ub(2),h.sd(" ","myr"===n.selectedCurrencyOption?h.Gc(29,37,t.profitValueMyr,"MYR"):h.Hc(30,40,t.profitValue,t.currencyCode,".2-2")," "),h.Ub(4),h.sd(" ",h.Gc(33,44,"myr"===n.selectedCurrencyOption?t.profitPercentageMyr:t.profitPercentage,"1.2-2"),"% "),h.Ub(4),h.td(" ","myr"===n.selectedCurrencyOption?"MYR":t.currencyCode," ","myr"===n.selectedCurrencyOption?h.Gc(37,47,t.interestIncomeMyr,".2-2"):h.Gc(38,50,t.interestIncome,".2-2")," "),h.Ub(8),h.Mc("nzDropdownMenu",e)}}function BF(e,t){if(1&e&&(h.pc(0),h.od(1,RF,28,32,"ng-container",55),h.Ec(2,"async"),h.od(3,NF,53,56,"ng-container",55),h.Ec(4,"async"),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",h.Fc(2,2,e.isMobile$)),h.Ub(2),h.Mc("ngIf",!h.Fc(4,4,e.isMobile$))}}function _F(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-row",76),h.rc(1,"nz-table",77,78),h.rc(3,"thead",79),h.zc("nzSortChange",(function(t){return h.dd(e),h.Dc().tableSort(t)})),h.rc(4,"tr",80),h.od(5,xF,5,3,"ng-container",81),h.Ec(6,"async"),h.qc(),h.qc(),h.rc(7,"tbody"),h.od(8,BF,5,6,"ng-container",81),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.ad(2),t=h.Dc();h.Ub(1),h.Mc("nzData",t.filteredBondsHoldings)("nzFrontPagination",!1)("nzLoading",t.portfolioTableLoading),h.Ub(4),h.Mc("ngForOf",h.Fc(6,5,t.isMobile$)?t.mobileDisplayCol:t.displayCols),h.Ub(3),h.Mc("ngForOf",e.data)}}function VF(e,t){1&e&&(h.rc(0,"div",102),h.rc(1,"div",103),h.qd(2," Current Value (MYR equiv.) = Sum of (Bid Price x Quantity / 100) "),h.qc(),h.rc(3,"div",103),h.qd(4," All bond bid prices shown are indicative due to the OTC nature. Displayed P/L is for reference only. "),h.qc(),h.rc(5,"div",103),h.qd(6," All MYR equivalent values are converted using the latest indicative FX rates. "),h.qc(),h.qc())}function HF(e,t){1&e&&(h.rc(0,"div",102),h.rc(1,"div",103),h.qd(2," Total Cost (MYR equiv.) = Sum of (W.A.C x Quantity) "),h.qc(),h.rc(3,"div",103),h.qd(4," All MYR equivalent values are converted using the latest indicative FX rates. "),h.qc(),h.qc())}function $F(e,t){1&e&&(h.rc(0,"div",102),h.rc(1,"div",103),h.qd(2," Interest Income (MYR equiv.) = Sum of (Accrued Interest + Interest Received or Paid) "),h.qc(),h.rc(3,"div",103),h.qd(4," All MYR equivalent values are converted using the latest indicative FX rates. "),h.qc(),h.qc())}let jF=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l){this.bondSelectorService=e,this.nzNotificationService=t,this.watchlistService=n,this.holdingRestService=i,this.subHandlingService=c,this.cdRef=o,this.lightstreamerBondService=s,this.router=a,this.currencyPipe=l,this.bondsHoldings=[],this.filteredBondsHoldings=[],this.bondHeaderSummary={totalCurrentValue:0,totalCurrentValueMyr:0,totalCost:0,totalCostMyr:0,totalProfitAndLossValue:0,totalProfitAndLossValueMyr:0,totalProfitAndLossPercentageValue:0,totalProfitAndLossPercentageValueMyr:0},this.portfolioTableLoading=!0,this.showBondDetails=!1,this.bondTempSubPriceQuote=[],this.showAddBondModal=!1,this.isSuspendedBondModalVisible=!1,this.imagePath=M.g.STOCKS_IMG_PATH,this.displayCols=[{key:"productName",colName:"Name"},{key:"currentUnits",colName:"Qty."},{key:"lastestPrice",colName:"Bid Price",additionalColName:"W.A.C"}
5,{key:"productCostMyr",colName:"Cost"},{key:"productCurValMyr",colName:"Current Value"},{key:"profitValueMyr",colName:"P/L"},{key:"interestIncomeMyr",colName:"Interest Income"},{key:"actions",colName:"Actions"}],this.mobileDisplayCol=[{key:"productName",colName:"Name"},{key:"productCurValMyr",colName:"Current Value",additionalColName:"Qty."},{key:"profitValueMyr",colName:"P/L"},{key:"lastestPrice",colName:"Bid Price",additionalColName:"W.A.C"}],this.currencyList=["All"],this.displayOptions=[{label:"MYR",value:"myr"},{label:"Currency",value:"product"}],this.searchValue="",this.searchCurrency="All",this.selectedCurrencyOption=this.displayOptions[1].value,this.searchByTextQuery=new jt.a,this.searchByCurrencyQuery=new jt.a,this.onDestroySubject=new jt.a,this.liveStreaming=!1}ngOnInit(){this.searchByTextQuery.pipe(Object(ce.a)(500),Object(b.a)(),Object(vI.a)(this.onDestroySubject)).subscribe(e=>{this.searchCurrency="All",this.filteredBondsHoldings=this.bondsHoldings.filter(t=>t.productName&&t.productName.toLowerCase().includes(e.toLowerCase())),console.log("Search query by text: "+e)}),this.searchByCurrencyQuery.pipe(Object(vI.a)(this.onDestroySubject)).subscribe(e=>{this.searchValue="",this.filteredBondsHoldings=this.bondsHoldings.filter(t=>t.currencyCode===e||"All"===e),console.log("Search query by currency: "+e)}),this.refno$.pipe(Object(vI.a)(this.onDestroySubject)).subscribe(e=>{console.log("subscribeRefnoChange: "+e),this.routeRefno=e,this.cdRef.markForCheck(),this.retrieveBondPortfolioList(e)}),this.getAllWatchlistByAccountId()}ngOnChanges(e){}ngOnDestroy(){this.onDestroySubject.next(),this.onDestroySubject.complete(),this.unsubscribeBondLightStreamerClient()}getAllWatchlistByAccountId(){this.watchlistService.findWatchlistByAccountId().pipe(Object(qt.a)(1)).subscribe(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data&&(console.log("Get watch list success: "+e.data),this.watchlist=e.data,this.watchlistLoading=!1)},e=>{console.error("Get watch list error - "+e),this.watchlistLoading=!1},()=>{this.watchlistLoading=!1})}unsubscribeBondLightStreamerClient(){this.bondTempSubPriceQuote.forEach(e=>{this.lsClient.unsubscribe(e)}),this.bondTempSubPriceQuote=[]}retrieveBondPortfolioList(e){this.portfolioTableLoading=!0,this.bondsHoldings=[],this.filteredBondsHoldings=[],this.bondHeaderSummary={totalCurrentValue:0,totalCurrentValueMyr:0,totalCost:0,totalCostMyr:0,totalProfitAndLossValue:0,totalProfitAndLossValueMyr:0,totalProfitAndLossPercentageValue:0,totalProfitAndLossPercentageValueMyr:0};const t=this.bondSelectorService.checkBondRmoTradingHours(),n=this.holdingRestService.getConsolidatedBondHolding(e,null);this.subHandlingService.subscribe(Object(ht.a)([t,n]).pipe(Object(y.a)(([e,t])=>{var n,i,c;const o=!!e&&(null==e?void 0:e.data);if(console.log(`rmoTradingHour: ${o} `),t.status!==M.a.RESPONSE_SUCCESS||!(null==t?void 0:t.data))return void console.error("consolidated bond holding response is invalid");const s=(null!==(c=null===(i=null===(n=t.data)||void 0===n?void 0:n.summary)||void 0===i?void 0:i.bondHoldings)&&void 0!==c?c:[]).map(e=>({refno:e.refno,productType:"Bonds",productName:e.productName,productCode:e.productCode,currencyCode:e.bondCurrencyCode,productCost:e.investmentAmountExcludeAi,productCurVal:e.currentValue,profitValue:e.profitValueExcludeAi,profitPercentage:e.profitPercentageExcludeAi,wac:e.wacExcludeAi,productCostMyr:e.investmentAmountMyrExcludeAi,productCurValMyr:e.currentValueFc,profitValueMyr:e.profitValueMyrExcludeAi,profitPercentageMyr:e.profitPercentageMyrExcludeAi,wacMyr:e.localWacExcludeAi,paymentMethod:e.paymentMethod,currentUnits:e.currentUnits,lastestPrice:e.lastestPrice,fxRate:e.fxRate,interestIncome:e.interestIncome,interestIncomeMyr:e.interestIncomeFc,accruedInterest:e.indicateAccruedInt,accruedInterestMyr:e.indicateAccruedIntFc,couponReceived:e.couponReceived,couponReceivedMyr:e.couponReceivedFc,allowBuy:"Y"===e.bondInfoAndPerformanceModel.display&&"active"===e.bondInfoAndPerformanceModel.status&&"Y"===e.bondInfoAndPerformanceModel.buyenabled&&"Y"===e.bondInfoAndPerformanceModel.distributeFsm,allowSell:e.availableQuantity>0&&"Y"===e.bondInfoAndPerformanceModel.sellenabled&&"Y"===e.bondInfoAndPerformanceModel.distributeFsm,bidYtm:e.bidYtm,offerPrice:e.offerPrice,offerYtm:e.offerYtm,bidYldToWorst:e.bondInfoAndPerformanceModel.bidYldToWorst,offYldToWorst:e.bondInfoAndPerformanceModel.offYldToWorst,bexPriceType:e.bexPriceType,externalBondId:e.bondInfoAndPerformanceModel.externalBondId})),a=[...Object(dF.c)(s,"productCurValMyr",!1)];this.bondsHoldings=[...a],this.filteredBondsHoldings=[...a];const l=s.reduce((e,t)=>
5e+t.productCurVal,0),r=s.reduce((e,t)=>e+t.productCost,0),d=s.reduce((e,t)=>e+t.profitValue,0),u=0===r?0:d/r*100,h=s.reduce((e,t)=>e+t.productCurValMyr,0),p=s.reduce((e,t)=>e+t.productCostMyr,0),m=s.reduce((e,t)=>e+t.profitValueMyr,0);this.bondHeaderSummary={totalCurrentValue:l,totalCurrentValueMyr:h,totalCost:r,totalCostMyr:p,totalProfitAndLossValue:d,totalProfitAndLossValueMyr:m,totalProfitAndLossPercentageValue:u,totalProfitAndLossPercentageValueMyr:0===p?0:m/p*100};const f=s.map(e=>e.currencyCode),g=Array.from(new Set(f));this.currencyList=["All",...g],o&&(this.liveStreaming=!0,this.subscribeBondLivePricing()),this.portfolioTableLoading=!1})))}subscribeBondLivePricing(){this.unsubscribeBondLightStreamerClient(),this.bondsHoldings.forEach(e=>{const{lastestPrice:t,bexPriceType:n,externalBondId:i,fxRate:c,currentUnits:o,productCost:s,productCostMyr:a,interestIncome:l,interestIncomeMyr:r,productCurVal:d,productCurValMyr:u,profitValue:h,profitValueMyr:p}=e;if("BEX_FULL"===n||"BEX_ODD"===n){const m=ry.a.BEX_PRICE+"-"+this.lightstreamerBondService.getSymbol(i,"BEX_ODD"===(null==e?void 0:e.bexPriceType)?FS.a.ODD_LOT:FS.a.FULL_LOT),f=this.lightstreamerBondService.subscribeLSPriceQuote(this.lsClient,m,f=>{const g=+f.getValue("lastPrice")<=0?+f.getValue("bidPrice"):+f.getValue("lastPrice");if(console.log("Bid Price: "+ +f.getValue("bidPrice")),console.log("Last Price: "+ +f.getValue("lastPrice")),g>0){const f=.01*g,b=f*o,S=b-s+l,y=S/s*100,v=f*o*c,M=v-a+r,C=M/a*100;e.lastestPrice=g,e.productCurVal=b,e.profitValue=S,e.profitPercentage=y,e.productCurValMyr=v,e.profitValueMyr=M,e.profitPercentageMyr=C,this.cdRef.markForCheck(),console.group("Bond Holding Portfolio lsPrice > 0"),console.log(`Bond Bex Price Type: ${n} & externalId: ${i} & bexPriceSymbol: ${m}`),console.log(`Recalculating ${e.productName} bond currentValue, profitValue and profitPercentage`),console.log(`New lastPrice (lsPrice) = ${g} while prev lastPrice = ${t}`),console.log(`New currentValue = ${b} while prev currentValue = ${d}`),console.log(`New profitValue = ${S} while prev profitValue = ${h}`),console.log("\n"),console.log(`New lastPriceMyr (lsPrice) = ${g*c} while prev lastPrice = ${t*c}`),console.log(`New currentValue = ${v} while prev currentValue = ${u}`),console.log(`New profitValue = ${M} while prev profitValue = ${p}`),console.groupEnd()}});this.bondTempSubPriceQuote.push(f)}})}get totalCurrentValueMyr(){return this.bondsHoldings.reduce((e,t)=>e+t.productCurValMyr,0)}get totalCostMyr(){return this.bondsHoldings.reduce((e,t)=>e+t.productCostMyr,0)}get totalProfitAndLossValueMyr(){return this.bondsHoldings.reduce((e,t)=>e+t.profitValueMyr,0)}get totalProfitAndLossPercentageValueMyr(){return 0===this.totalProfitAndLossValueMyr?0:this.totalProfitAndLossValueMyr/this.totalCostMyr*100}get totalIntestIncomeValueMyr(){return this.bondsHoldings.reduce((e,t)=>e+t.interestIncomeMyr,0)}tableSort(e){if(console.log("Sort by: "+JSON.stringify(e)),"actions"==e.key)return;if(null===e.value)return void(this.filteredBondsHoldings=[...Object(dF.c)(this.filteredBondsHoldings,"productCurValMyr",!1)]);const t=["productName"].includes(e.key)?dF.d:dF.c;this.filteredBondsHoldings=[...t(this.filteredBondsHoldings,e.key,"ascend"===e.value)]}searchByText(){this.searchByTextQuery.next(this.searchValue)}onSearchClear(){this.searchValue="",this.searchByText()}searchByCurrency(){this.searchByCurrencyQuery.next(this.searchCurrency)}onBondBuyDetailVisibleChange(e){console.log(e),console.log(this.showBondDetails),e||(this.transType=null),this.showBondDetails=e}
5buyBond(e,t,n){console.log("what is this: "+n),console.log("what is this: "+t),console.log("what is this: "+e),t?(this.transType="Buy",this.selectedIssueCode=n,this.lotType=e,this.showBondDetails=!0):this.nzNotificationService.error("Error","Selected Bond cant be buy.")}sellBond(e,t,n){console.log("what is this: "+n),console.log("what is this: "+t),console.log("what is this: "+e),t?(this.transType="Sell",this.selectedIssueCode=n,this.lotType=e,this.showBondDetails=!0):this.nzNotificationService.error("Error","Selected Bond cant be sell.")}goToTransactionHistory(e){const t=this.router.createUrlTree([M.o.APP,M.o.HOLDINGS,M.o.DETAILS],{queryParams:{refno:e.refno,id:e.productCode,code:e.productCode,type:cw.a.BONDS,payment:e.paymentMethod}});Object(pt.a)(t)}handleWatchlistModalVisible(e){this.bondToAddWatchlist={issueCode:e.productCode,bondName:e.productName,bidPrice:e.lastestPrice,offerPrice:e.offerPrice,bidYtm:e.bidYtm,offerYtm:e.offerYtm,bidYldToWorst:e.bidYldToWorst||null,offerYldToWorst:e.offYldToWorst||null},this.showAddBondModal=!0}onCloseAddToWatchlist(){this.showAddBondModal=!1}onCloseSuspendedBondModal(){this.isSuspendedBondModalVisible=!1}suspendedBondOnProceed(){this.isSuspendedBondModalVisible=!1,this.lotType=FS.a.OTC,this.showBondDetails=!0}}return e.\u0275fac=function(t){return new(t||e)(h.lc(qI.a),h.lc(Sc.b),h.lc(Nv.a),h.lc(xc.a),h.lc(l.a),h.lc(h.j),h.lc(OS.a),h.lc(c.e),h.lc(p.d))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-portfolio"]],inputs:{lsClient:"lsClient"},features:[h.Tb([l.a,qg.a,OS.a]),h.Sb],decls:137,vars:91,consts:[[1,"grey-bg","mb-3"],["nzType","flex","nzJustify","start",1,"p-3",3,"nzGutter"],[3,"nzSpan"],[1,"d-flex","align-items-center"],[1,"statistic-panel",3,"nzValueTemplate","nzTitle"],["currentValueTitle",""],["currentValue",""],["totalCostTitleTpl",""],["totalCostValueTpl",""],["totalInterestIncomeTitle",""],["totalInterestIncomeValue",""],["profitLossTitle",""],["profitLoss",""],[1,"d-flex","align-items-center",3,"nzGutter"],["autocomplete","off"],[3,"nzPrefix","nzSuffix"],["type","text","nz-input","","placeholder","Name","name","filterSearch",3,"ngModel","ngModelChange"],["suffixIconClear",""],["suffixIconSearch",""],["nzPlaceHolder","Currency","nzAllowClear","",1,"w-100",3,"ngModel","ngModelChange"],["class","text-wrap",3,"nzValue","nzLabel",4,"ngFor","ngForOf"],[1,"py-1","text-sm","text-right"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["nz-radio-button","","class","px-4",3,"nzValue",4,"ngFor","ngForOf"],[3,"ngTemplateOutlet"],[3,"show","routeRefno","lotType","transType","lsClient","isUpdate","issueCode","onChangeShowBondDetails",4,"ngIf"],[3,"bondToAddWatchlist","showAddBondModal","watchlistLoading","showPrice","allWatchlist","onWatchlistClose"],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzClosable","nzFooter","nzTitle","nzMaskClosable","nzVisibleChange","nzOnCancel",4,"ngIf"],[3,"nzGutter"],[1,"px-3","pt-0","pb-3","bg-white"],[1,"text-base"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",1,"pointer","text-info",3,"nzTooltipTitle"],[1,"text-right",3,"nzSpan"],[1,"text-base","font-weight-bold"],[1,"text-sm"],[1,"text-sm","font-weight-bold",3,"ngClass"],[1,"text-sm","font-weight-bold"],[1,"mt-3","bg-white"],[1,"py-1","px-3","mt-3","mb-2","text-sm","text-left"],["nz-radio-button","","class","px-4 text-sm",3,"nzValue",4,"ngFor","ngForOf"],[1,"px-3","bg-white"],["nzSpan","8",1,"font-weight-bold"],["nzSpan","16",1,"pointer","text-right","font-weight-bold","text-primary"],["nz-button","","nzOutline","","nzType","primary",1,"px-2","mb-2",3,"nzSize"],["nz-icon","","nzTheme","outline","nzType","info-circle"],[1,"mb-2",3,"nzSpan"],["type","text","nz-input","","placeholder","Name","name","filterSearch",1,"h-50","text-sm",3,"ngModel","ngModelChange"],["nzType","flex","nzAlign","middle",1,"mt-1"],["nzShowSearch","","nzLabelPlaceholder","","nzPlaceHolder","Filter By Currency","nzSize","small",1,"w-100","h-50","text-sm",3,"nzDropdownMatchSelectWidth","ngModel","ngModelChange"],["portfolioResultTable",""],["currentValueTooltipTpl",""],["totalCostTooltipTpl",""],["totalInterestIncomeTooltipTpl",""],[1,"text-sm","text-black"],[1,"text-xs","font-weight-bold"],[4,"ngIf"],[1,"text-profit","text-xs","font-weight-bold"],[1,"text-profit","text-base","font-weight-bold"],["nz-icon","","nzType","caret-up","nzTheme","fill",1,"text-profit","text-sm"],[1,"text-loss","text-xs","font-weight-bold"],[1,"text-loss","text-base","font-weight-bold"],["nz-icon","","nzType","caret-down","nzTheme","fill",1,"text-loss","text-sm"],["nz-icon","","nzType","close",1,"text-black",3,"click"],["nz-icon","","nzType","search",1,"text-black"],[1,"text-wrap",3,"nzValue","nzLabel"],["nz-radio-button","",1,"px-4",3,"nzValue"],[3,"show","routeRefno","lotType","transType","lsClient","
5isUpdate","issueCode","onChangeShowBondDetails"],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzClosable","nzFooter","nzTitle","nzMaskClosable","nzVisibleChange","nzOnCancel"],["nz-row","","nzJustify","left","nzAlign","middle",1,"pt-3"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"text-xl","text-warning","px-2"],[1,"text-lg","font-weight-bold"],["nz-row","","nzJustify","middle","nzAlign","middle",1,"pt-2","px-5"],[1,"font-weight-bold"],[1,"text-right","mt-4"],["nz-button","","nzType","primary",1,"ml-3",3,"click"],["nz-radio-button","",1,"px-4","text-sm",3,"nzValue"],[1,"mt-3"],[1,"bond-portfolio-table",3,"nzData","nzFrontPagination","nzLoading"],["portfolioTable",""],[3,"nzSortChange"],[1,"text-xs"],[4,"ngFor","ngForOf"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],["nzAlign","left","nzLeft","0",1,"text-left",3,"nzShowSort","nzSortKey","nzWidth"],["nzAlign","center","nzWidth","130px",1,"bg-black-1"],["nzAlign","right",1,"bg-black-1",3,"nzShowSort","nzSortKey"],["nzLeft","0px"],[1,"font-weight-bold","text-xs"],["nzAlign","right"],[1,"mb-0"],[1,"t-4xs","text-content-primary","mb-0"],[3,"ngClass"],[1,"t-4xs","mb-0"],[1,"px-2","py-1","text-sm","text-center","green-button","mr-1",3,"click"],[1,"px-2","py-1","text-sm","text-center","red-button","mr-1",3,"click"],["nz-button","","nzType","circle","nzSize","small","nz-dropdown","",1,"text-primary","border-primary",3,"nzDropdownMenu"],["nz-icon","","nzType","more","nzTheme","outline",1,"pointer"],["menu","nzDropdownMenu"],["nz-menu",""],["nz-menu-item","",2,"color","black",3,"click"],[1,"text-sm","font-normal","text-content-secondary"],[1,"mb-4"]],template:function(e,t){if(1&e&&(h.pc(0),h.rc(1,"app-web-scaffold"),h.rc(2,"nz-row"),h.rc(3,"div",0),h.rc(4,"nz-row",1),h.rc(5,"nz-col",2),h.rc(6,"div",3),h.rc(7,"div"),h.mc(8,"nz-statistic",4),h.od(9,uF,3,1,"ng-template",null,5,h.pd),h.od(11,hF,5,4,"ng-template",null,6,h.pd),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(13,"nz-row",1),h.rc(14,"nz-col",2),h.rc(15,"div",3),h.rc(16,"div"),h.mc(17,"nz-statistic",4),h.od(18,pF,3,1,"ng-template",null,7,h.pd),h.od(20,mF,5,4,"ng-template",null,8,h.pd),h.qc(),h.qc(),h.qc(),h.rc(22,"nz-col",2),h.rc(23,"div",3),h.rc(24,"div"),h.mc(25,"nz-statistic",4),h.od(26,fF,3,1,"ng-template",null,9,h.pd),h.od(28,gF,5,4,"ng-template",null,10,h.pd),h.qc(),h.qc(),h.qc(),h.rc(30,"nz-col",2),h.rc(31,"div",3),h.rc(32,"div"),h.mc(33,"nz-statistic",4),h.od(34,bF,2,0,"ng-template",null,11,h.pd),h.od(36,MF,3,3,"ng-template",null,12,h.pd),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(38,"nz-row",13),h.rc(39,"nz-col",2),h.rc(40,"form",14),h.rc(41,"nz-input-group",15),h.rc(42,"input",16),h.zc("ngModelChange",(function(e){return t.searchValue=e}))("ngModelChange",(function(){return t.searchByText()})),h.qc(),h.qc(),h.qc(),h.od(43,CF,1,0,"ng-template",null,17,h.pd),h.od(45,qF,1,0,"ng-template",null,18,h.pd),h.qc(),h.rc(47,"nz-col",2),h.rc(48,"ui-select",19),h.zc("ngModelChange",(function(e){return t.searchCurrency=e}))("ngModelChange",(function(){return t.searchByCurrency()})),h.od(49,TF,1,2,"ui-option",20),h.qc(),h.qc(),h.mc(50,"nz-col",2),h.rc(51,"nz-col",2),h.rc(52,"div",21),h.qd(53,"Display Portfolio By \xa0 "),h.rc(54,"nz-radio-group",22),h.zc("ngModelChange",(function(e){return t.selectedCurrencyOption=e})),h.od(55,wF,2,2,"label",23),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(56,"div"),h.nc(57,24),h.qc(),h.qc(),h.od(58,zF,1,7,"app-rmo-transaction-details",25),h.oc(),h.rc(59,"bond-watchlist-icon",26),h.zc("onWatchlistClose",(function(){return t.onCloseAddToWatchlist()})),h.qc(),h.od(60,DF,12,6,"nz-modal",27),h.rc(61,"app-mobile-scaffold"),h.rc(62,"nz-row",28),h.rc(63,"div",29),h.rc(64,"nz-row"),h.rc(65,"nz-col",2),h.rc(66,"span",30),h.qd(67,"Total Cost "),h.mc(68,"i",31),h.qc(),h.qc(),h.rc(69,"nz-col",32),h.rc(70,"span",33),h.qd(71),h.Ec(72,"currency"),h.qc(),h.qc(),h.qc(),h.rc(73,"nz-row"),h.rc(74,"nz-col",2),h.rc(75,"span",34),h.qd(76,"P/L (%)"),h.qc(),h.qc(),h.rc(77,"nz-col",32),h.rc(78,"span",35),h.qd(79),h.Ec(80,"currency"),h.Ec(81,"number"),h.qc(),h.qc(),h.qc(),h.rc(82,"nz-row"),h.rc(83,"nz-col",2),h.rc(84,"span",34),h.qd(85,"Current Value "),h.mc(86,"i",31),h.qc(),h.qc(),h.rc(87,"nz-col",32),h.rc(88,"span",36),h.qd(89),h.Ec(90,"currency"),h.qc(),h.qc(),h.qc(),h.rc(91,"nz-row"),h.rc(92,"nz-col",2),h.rc(93,"span",34),h.qd(94,"Interest Income "),h.mc(95,"i",31),h.qc(),h.qc(),h.rc(96,"nz-col",32),h.rc(97,"span",36),h.qd(98),h.Ec(99,"currency"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(100,"nz-row",37),h.rc(101,"nz-col",2),h.rc(102,"div",38),h.qd(103,"Dis
5play Portfolio By\xa0 "),h.rc(104,"nz-radio-group",22),h.zc("ngModelChange",(function(e){return t.selectedCurrencyOption=e})),h.od(105,PF,2,2,"label",39),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(106,"nz-row",40),h.rc(107,"nz-row"),h.rc(108,"nz-col",41),h.qd(109,"Information"),h.qc(),h.rc(110,"nz-col",42),h.rc(111,"button",43),h.mc(112,"i",44),h.qd(113,"Streaming "),h.qc(),h.qc(),h.qc(),h.rc(114,"nz-row"),h.rc(115,"nz-col",45),h.rc(116,"form",14),h.rc(117,"nz-input-group",15),h.rc(118,"input",46),h.zc("ngModelChange",(function(e){return t.searchValue=e}))("ngModelChange",(function(){return t.searchByText()})),h.qc(),h.qc(),h.qc(),h.od(119,IF,1,0,"ng-template",null,17,h.pd),h.od(121,kF,1,0,"ng-template",null,18,h.pd),h.qc(),h.qc(),h.rc(123,"nz-row",47),h.rc(124,"nz-col",2),h.rc(125,"nz-select",48),h.zc("ngModelChange",(function(e){return t.searchCurrency=e}))("ngModelChange",(function(){return t.searchByCurrency()})),h.od(126,AF,1,2,"nz-option",20),h.qc(),h.qc(),h.qc(),h.rc(127,"div"),h.nc(128,24),h.qc(),h.qc(),h.qc(),h.od(129,_F,9,7,"ng-template",null,49,h.pd),h.od(131,VF,7,0,"ng-template",null,50,h.pd),h.od(133,HF,5,0,"ng-template",null,51,h.pd),h.od(135,$F,5,0,"ng-template",null,52,h.pd)),2&e){const e=h.ad(10),n=h.ad(12),i=h.ad(19),c=h.ad(21),o=h.ad(27),s=h.ad(29),a=h.ad(35),l=h.ad(37),r=h.ad(44),d=h.ad(46),u=h.ad(130),p=h.ad(132),m=h.ad(134),f=h.ad(136);h.Ub(4),h.Mc("nzGutter",24),h.Ub(1),h.Mc("nzSpan",8),h.Ub(3),h.Mc("nzValueTemplate",n)("nzTitle",e),h.Ub(5),h.Mc("nzGutter",24),h.Ub(1),h.Mc("nzSpan",8),h.Ub(3),h.Mc("nzValueTemplate",c)("nzTitle",i
5),h.Ub(5),h.Mc("nzSpan",8),h.Ub(3),h.Mc("nzValueTemplate",s)("nzTitle",o),h.Ub(5),h.Mc("nzSpan",8),h.Ub(3),h.Mc("nzValueTemplate",l)("nzTitle",a),h.Ub(5),h.Mc("nzGutter",16),h.Ub(1),h.Mc("nzSpan",8),h.Ub(2),h.Mc("nzPrefix",d)("nzSuffix",r),h.Ub(1),h.Mc("ngModel",t.searchValue),h.Ub(5),h.Mc("nzSpan",4),h.Ub(1),h.Mc("ngModel",t.searchCurrency),h.Ub(1),h.Mc("ngForOf",t.currencyList),h.Ub(1),h.Mc("nzSpan",4),h.Ub(1),h.Mc("nzSpan",8),h.Ub(3),h.Mc("ngModel",t.selectedCurrencyOption),h.Ub(1),h.Mc("ngForOf",t.displayOptions),h.Ub(2),h.Mc("ngTemplateOutlet",u),h.Ub(1),h.Mc("ngIf",t.showBondDetails),h.Ub(1),h.Mc("bondToAddWatchlist",t.bondToAddWatchlist)("showAddBondModal",t.showAddBondModal)("watchlistLoading",t.watchlistLoading)("showPrice",!t.isSuspendedBondModalVisible)("allWatchlist",t.watchlist),h.Ub(1),h.Mc("ngIf",t.selectedBond),h.Ub(2),h.Mc("nzGutter",24),h.Ub(3),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzTooltipTitle",m),h.Ub(1),h.Mc("nzSpan",12),h.Ub(2),h.rd(h.Ic(72,65,t.totalCostMyr,"MYR ","code","1.2-2")),h.Ub(3),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzSpan",12),h.Ub(1),h.Mc("ngClass",h.Tc(88,LF,t.totalProfitAndLossValueMyr>0,t.totalProfitAndLossValueMyr<0)),h.Ub(1),h.td(" ",h.Ic(80,70,t.totalProfitAndLossValueMyr,"MYR ","code","1.2-2")," (",h.Gc(81,75,t.totalProfitAndLossPercentageValueMyr,"1.2-2"),"%) "),h.Ub(4),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzTooltipTitle",p),h.Ub(1),h.Mc("nzSpan",12),h.Ub(2),h.rd(h.Ic(90,78,t.totalCurrentValueMyr,"MYR ","code","1.2-2")),h.Ub(3),h.Mc("nzSpan",12),h.Ub(3),h.Mc("nzTooltipTitle",f),h.Ub(1),h.Mc("nzSpan",12),h.Ub(2),h.sd("",h.Ic(99,83,t.totalIntestIncomeValueMyr,"MYR ","code","1.2-2")," "),h.Ub(3),h.Mc("nzSpan",24),h.Ub(3),h.Mc("ngModel",t.selectedCurrencyOption),h.Ub(1),h.Mc("ngForOf",t.displayOptions),h.Ub(6),h.Mc("nzSize","small"),h.Ub(4),h.Mc("nzSpan",24),h.Ub(2),h.Mc("nzPrefix",d)("nzSuffix",r),h.Ub(1),h.Mc("ngModel",t.searchValue),h.Ub(6),h.Mc("nzSpan",24),h.Ub(1),h.Mc("nzDropdownMatchSelectWidth",!1)("ngModel",t.searchCurrency),h.Ub(1),h.Mc("ngForOf",t.currencyList),h.Ub(2),h.Mc("ngTemplateOutlet",u)}},directives:[B.a,P.c,P.a,ow.b,oe.J,oe.u,oe.v,Pn.c,oe.c,Pn.b,oe.t,oe.w,Lt.d,p.s,Ut.c,p.A,p.t,zI.a,z.a,k.b,xt.e,p.q,_.a,Xv.d,Lt.a,Ut.a,lA.a,j.a,Xv.a,ve.a,ve.f,ve.g,ve.c,p.x,p.y,p.z,ve.e,ve.d,xv.d,xv.f,qM.a,qM.d],pipes:[p.d,p.g,p.b,aw.a],styles:[".grey-bg[_ngcontent-%COMP%]{background-color:#f2f2f2}.drop-down[_ngcontent-%COMP%]{color:#000}.statistic-panel[_ngcontent-%COMP%]{line-height:12px!important}.bond-portfolio-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-7px}.bond-portfolio-table[_ngcontent-%COMP%] .ant-table-thead>tr>th{padding:4px}.bond-portfolio-table[_ngcontent-%COMP%] .ant-table-tbody>tr>td{padding:4px}.modify-button[_ngcontent-%COMP%]{color:var(---3a3a3a-darker-grey-text-secondary-btn-);text-align:left;margin-right:8px;background-color:green}.modify-button[_ngcontent-%COMP%], .withdraw-button[_ngcontent-%COMP%]{letter-spacing:0;font-size:14px;opacity:1;cursor:pointer;border-radius:5px}.withdraw-button[_ngcontent-%COMP%]{color:var(---3a3a3a-darker-grey-text-secondary-btn-);color:#3a3a3a;text-align:right;background-color:red}.button-container[_ngcontent-%COMP%]{justify-content:space-between;align-items:center;padding:4px}.red-button[_ngcontent-%COMP%]{background-color:#ff333a;border-color:#ff333a}.green-button[_ngcontent-%COMP%], .red-button[_ngcontent-%COMP%]{color:#fff;border-radius:5px;cursor:pointer}.green-button[_ngcontent-%COMP%]{border-color:#093;background-color:#093}.text-end[_ngcontent-%COMP%]{text-align:end}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),e})();function GF(e,t){1&e&&h.nc(0)}function WF(e,t){1&e&&h.mc(0,"div")}function YF(e,t){1&e&&h.mc(0,"div")}function KF(e,t){if(1&e&&(h.pc(0),h.od(1,WF,1,0,"div",10),h.od(2,YF,1,0,"div",10),h.oc()),2&e){h.Dc(3);const e=h.ad(10),t=h.ad(8);h.Ub(1),h.Mc("ngTemplateOutlet",e),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}const XF=function(){return{rows:10}};function QF(e,t){if(1&e&&(h.pc(0),h.mc(1,"investment-account-selector"),h.mc(2,"nz-skeleton",9),h.od(3,GF,1,0,"ng-container",10),h.od(4,KF,3,2,"ng-container",0),h.oc()),2&e){const e=h.Dc(2),t=h.ad(12);h.Ub(2),h.Mc("nzActive",!0)("nzLoading",e.isLoading)("nzParagraph",h.Rc(5,XF)),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngIf",(null==e.maintenance||e.maintenance.enabled!==e.MAINTENANCE_TRUE)&&!e.isLoading&&e.selectedTab===e.bondEnum.PRICE)}}function ZF(e,t){1&e&&h.mc(0,"div")}function JF(e,t){if(1&e&&(h.pc(0),h.od(1,ZF,1,0,"div",10),h.oc()),2&e){h.Dc(2);const e=h.ad(5);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function eO(e,t){if(1&e){const e=h.sc();h.rc(0,"app-mobile-scaffold"),h.rc(1,"div",6),h.rc(2,"div",7),h.rc(3,"b2c-app-bar-2",8),h.zc("back",(function(){return h.dd(e),h.Dc().handleOnBack()})),h.qc(),h.qc(),h.od(4,QF,5,6,"ng-container",0),h.Ec(5,"async"),h.qc(),h.od(6,JF,2,1,"ng-container",0),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("hidden",!e.showAccountAndAnnouncementDetails),h.Ub(2),h.Mc("title","Bond"),h.Ub(1),h.Mc("ngIf",h.Fc(5,4,e.isMobile$)),h.Ub(2),h.Mc("ngIf",(null==e.maintenance||e.maintenance.enabled!==e.MAINTENANCE_TRUE)&&!e.isLoading)}}function tO(e,t){1&e&&h.nc(0)}function nO(e,t){if(1&e){const e=h.sc();h.rc(0,"button",16),h.zc("click",(function(){return h.dd(e),h.Dc(4).showExtendView()})),h.mc(1,"i",17),h.qc()}2&e&&h.Mc("nzSize","small")}const iO=function(){return{"pointer-events":"none"}};function cO(e,t){if(1&e&&(h.rc(0,"div"),h.rc(1,"button",14),h.qd(2," Streaming "),h.qc(),h.od(3,nO,2,1,"button",15),h.qc()),2&e){const e=h.Dc(3);h.Ub(1),h.Mc("nzSize","small")("ngStyle",h.Rc(3,iO)),h.Ub(2),h.Mc("ngIf",e.selectedTab===e.bondEnum.PRICE)}}function oO(e,t){1&e&&h.mc(0,"div")}function sO(e,t){1&e&&h.mc(0,"div")}function aO(e,t){1&e&&h.mc(0,"div")}function lO(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",11),h.rc(2,"nz-radio-group",12),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc(2).selectedTab=t})),h.rc(3,"label",13),h.qd(4,"Prices"),h.qc(),h.rc(5,"label",13),h.qd(6,"Order Book"),h.qc(),h.rc(7,"label",13),h.qd(8,"Portfolio"),h.qc(),h.qc(),h.od(9,cO,4,4,"div",0),h.qc(),h.od(10,oO,1,0,"div",10),h.od(11,sO,1,0,"div",10),h.od(12,aO,1,0,"div",10),h.oc()}if(2&e){const e=h.Dc(2),t=h.ad(10),n=h.ad(8),i=h.ad(5);h.Ub(2),h.Mc("ngModel",e.selectedTab),h.Ub(1),h.Mc("nzValue",e.bondEnum.PRICE),h.Ub(2),h.Mc("nzValue",e.bondEnum.ORDER_BOOK),h.Ub(2),h.Mc("nzValue",e.bondEnum.PORTFOLIO),h.Ub(2),h.Mc("ngIf",e.selectedTab===e.bondEnum.PRICE),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngTemplateOutlet",n),h.Ub(1),h.Mc("ngTemplateOutlet",i)}}function rO(e,t){if(1&e&&(h.rc(0,"app-web-scaffold"),h.mc(1,"nz-skeleton",9),h.od(2,tO,1,0,"ng-container",10),h.od(3,lO,13,8,"ng-container",0),h.qc()),2&e){const e=h.Dc(),t=h.ad(12);h.Ub(1),h.Mc("nzActive",!0)("nzLoading",e.isLoading)("nzParagraph",h.Rc(5,XF)),h.Ub(1),h.Mc("ngTemplateOutlet",t),h.Ub(1),h.Mc("ngIf",(null==e.maintenance||e.maintenance.enabled!==e.MAINTENANCE_TRUE)&&!e.isLoading)}}function dO(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-bond-price-list",18),h.zc("onChangeExtendView",(function(t){return h.dd(e),h.Dc(2).handleExtendView(t)}))("showMarketDepth",(function(t){return h.dd(e),h.Dc(2).onShowMarketDepth(t)}))("showSummary",(function(t){return h.dd(e),h.Dc(2).onShowSummary(t)}))("showTimeAndSales",(function(t){return h.dd(e),h.Dc(2).onShowTimeAndSales(t)}))("onChangeShowBondDetails",(function(t){return h.dd(e),h.Dc(2).showAccountAndAnnouncementDetail(t)}))("onCloseExchangeDetails",(function(t){return h.dd(e),h.Dc(2).closeExchangeDetails(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("isExtendedMode",e.extendViewVisible)("lsClient",e.lsClient)("isBondLsAlive",e.isBondLsAlive)}}function uO(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-bond-order-book",19),h.zc("emitMarketDepthAction",(function(t){return h.dd(e),h.Dc(2).emitMarketDepthAction(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("lsClient",e.lsClient)("selectedTab",e.selectedTab)("isAcctAllowScheduledSell",e.isAcctAllowScheduledSell)}}function hO(e,t){if(1&e&&(h.pc(0),h.mc(1,"app-bond-portfolio",20),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("lsClient",e.lsClient)}}function pO(e,t){if(1&e&&(h.od(0,dO,2,3,"ng-container",0),h.od(1,uO,2,4,"ng-container",0),h.od(2,hO,2,1,"ng-container",0)),2&e){const e=h.Dc();h.Mc("ngIf",e.selectedTab===e.bondEnum.PRICE),h.Ub(1),h.Mc("ngIf",e.selectedTab===e.bondEnum.ORDER_BOOK),h.Ub(1),h.Mc("ngIf",e.selectedTab===e.bondEnum.PORTFOLIO)}}const mO=function(e){return{"bg-white px-2 py-3":e}},fO=function(e){return{"mb-2":e}};function gO(e,t){if(1&e){const e=h.sc();h.rc(0,"div",22),h.Ec(1,"async"),h.rc(2,"div",24),h.Ec(3,"async"),h.mc(4,"img",25),h.rc(5,"div",26),h.rc(6,"span"),h.qd(7),h.qc(),h.qc(),h.rc(8,"i",27),h.zc("click",(function(){h.dd(e);const t=h.Dc().$implicit;return h.Dc(2).closeBanner(t)})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.Mc("ngClass",h.Sc(9,mO,h.Fc(1,5,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(11,fO,!h.Fc(3,7,t.isMobile$))),h.Ub(2),h.Mc("src","assets/images/stocks/speaker.svg",h.gd),h.Ub(1),h.Mc("id",e.id),h.Ub(2),h.rd(e.message)}}const bO=function(e){return{"bg-white px-2 pt-3":e}};function SO(e,t){if(1&e&&(h.rc(0,"div",22),h.Ec(1,"async"),h.od(2,gO,9,13,"div",23),h.qc()),2&e){const e=t.$implicit,n=h.Dc(2);h.Mc("ngClass",h.Sc(4,bO,h.Fc(1,2,n.isMobile$))),h.Ub(2),h.Mc("ngIf",e&&(null==e?null:e.enabled)===n.MAINTENANCE_TRUE&&!n.isLoading)}}function yO(e,t){if(1&e&&h.od(0,SO,3,6,"div",21),2&e){const e=h.Dc();h.Mc("ngForOf",e.banners)}}function vO(e,t){1&e&&(h.rc(0,"span",31),h.qd(1,"We're regret to inform live price feature temporarily under maintenance and please know our teams are working hard to get everything up and running. We're really sorry to be holding you up today! "),h.qc())}function MO(e,t){1&e&&(h.rc(0,"span",31),h.qd(1,"Your current live trading session has been disconnected due to other active sessions detected. To resume live prices, kindly refresh your page or app. "),h.qc())}const CO=function(e){return{"my-1":e}};function qO(e,t){if(1&e&&(h.rc(0,"div",22),h.Ec(1,"async"),h.rc(2,"div",28),h.Ec(3,"async"),h.mc(4,"i",29),h.od(5,vO,2,0,"span",30),h.od(6,MO,2,0,"span",30),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Mc("ngClass",h.Sc(8,mO,h.Fc(1,4,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(10,CO,!h.Fc(3,6,e.isMobile$))),h.Ub(3),h.Mc("ngIf",!e.isBondLsDuplicateLogin),h.Ub(1),h.Mc("ngIf",e.isBondLsDuplicateLogin)}}
5function TO(e,t){if(1&e&&h.od(0,qO,7,12,"div",23),2&e){const e=h.Dc();h.Mc("ngIf",!e.showBanner)}}function wO(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",32),h.mc(2,"img",33),h.mc(3,"p",34),h.qc(),h.oc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("src",e.SHARED_IMAGE_PATH+e.UNDER_MAINTENANCE_IMAGE,h.gd)("alt",e.UNDER_MAINTENANCE_IMAGE),h.Ub(1),h.Mc("innerHTML",e.maintenance.message,h.ed)}}function zO(e,t){if(1&e&&h.od(0,wO,4,3,"ng-container",0),2&e){const e=h.Dc();h.Mc("ngIf",(null==e.maintenance?null:e.maintenance.enabled)===e.MAINTENANCE_TRUE&&!e.isLoading)}}let DO=(()=>{class e{constructor(e,t,n,i,c,o){this.transactionService=e,this.router=t,this.subHandlingService=n,this.cdRef=i,this.store=c,this.announcementRestService=o,this.selectedTab="price",this.transactionTypeEnum=d.d,this.bondEnum=d.a,this.extendViewVisible=!1,this.maintenance={},this.banners=[],this.MAINTENANCE_TRUE="Y",this.isLoading=!0,this.isBannerVisible=!0,this.currentHeight=0,this.scrollToBottom=!0,this.autoScrollCounter=0,this.SHARED_IMAGE_PATH=M.g.SHARED_IMG_PATH,this.UNDER_MAINTENANCE_IMAGE="under-maintenance.svg",this.WAITING_ICON_IMAGE="waiting-icon.svg",this.showMarketDepth=new h.s,this.showSummary=new h.s,this.showTimeAndSales=new h.s,this.closeEmitter=new h.s,this.showAccountAndAnnouncementDetails=!0,this.primaryCashAcctAvailableBalance=0,this.isAcctAllowScheduledSell=!1,this.emitMarketDepthToTrade=new h.s,this.showBanner=!0}ngOnInit(){var e;(null===(e=this.store.selectSnapshot(f.a.getAuthData))||void 0===e?void 0:e.rmoEnabled)||this.router.navigate([M.o.BONDS]),this.transactionService.setActiveTradeProduct(r.b.BOND_RMO),this.forceUpdateRiskProfile=this.store.selectSnapshot(f.a.isForceRiskProfileUpdate),this.forceUpdateRiskProfile&&(this.show
5ForceUpdateModal=!0),this.getBanners(),this.redirectToRespectiveTab()}ngOnChanges(e){var t,n;null!=(null===(t=null==e?void 0:e.isBondLsAlive)||void 0===t?void 0:t.currentValue)&&(this.showBanner=null===(n=null==e?void 0:e.isBondLsAlive)||void 0===n?void 0:n.currentValue)}onSelectedTabChange(){this.router.navigate([M.o.APP,M.o.TRADE,M.o.BONDS,this.selectedTab])}showExtendView(){this.extendViewVisible=!0}handleExtendView(e){this.extendViewVisible=e}getBanners(){this.subHandlingService.once(this.announcementRestService.findBondAnnouncementList().pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data&&e.data.forEach(e=>{e.announcementType===pv.BOND_MAINTENANCE&&(this.maintenance=e),e.announcementType===pv.BOND_BANNER_WEB&&this.banners.push(e),e.announcementType===pv.BOND_HOLIDAY&&(e.message="Bondsupermart Live Market Holiday - "+e.message,this.banners.push(e))}),this.isLoading=!1,this.banners.forEach(e=>{e&&(null==e?void 0:e.enabled)===this.MAINTENANCE_TRUE&&!this.isLoading&&setTimeout(()=>{setInterval(()=>{this.autoScrollBanner(e)},250)},5e3)})})))}autoScrollBanner(e){let t=document.getElementById(String(e.id));e.enabled&&this.autoScrollCounter<2&&((this.currentHeight<0||this.currentHeight>(null==t?void 0:t.scrollHeight))&&(this.scrollToBottom=!this.scrollToBottom,this.autoScrollCounter++),this.scrollToBottom?null==t||t.scrollTo(0,this.currentHeight+=5):null==t||t.scrollTo(0,this.currentHeight-=5))}closeBanner(e){e.enabled="N"}handleOnBack(){window.history.back()}onShowMarketDepth(e){this.showMarketDepth.emit(e)}onShowTimeAndSales(e){this.showTimeAndSales.emit(e)}onShowSummary(e){this.showSummary.emit(e)}closeExchangeDetails(e){this.closeEmitter.emit()}showAccountAndAnnouncementDetail(e){this.showAccountAndAnnouncementDetails=!e}emitMarketDepthAction(e){this.emitMarketDepthToTrade.emit(e)}redirectToRespectiveTab(){let e=this.router.url.split("/").pop(),t=e.indexOf("?");switch(-1!==t&&(e=e.substring(0,t)),e){case M.o.BOND_PORTFOLIO:this.selectedTab=this.bondEnum.PORTFOLIO;break;case M.o.BOND_ORDER_BOOK:this.selectedTab=this.bondEnum.ORDER_BOOK;break;default:this.selectedTab=this.bondEnum.PRICE}}}return e.\u0275fac=function(t){return new(t||e)(h.lc(C.a),h.lc(c.e),h.lc(l.a),h.lc(h.j),h.lc(s.i),h.lc(bv))},e.\u0275cmp=h.fc({type:e,selectors:[["app-bond-rmo-trade"]],inputs:{lsClient:"lsClient",isBondLsDuplicateLogin:"isBondLsDuplicateLogin",isBondLsAlive:"isBondLsAlive"},outputs:{showMarketDepth:"showMarketDepth",showSummary:"showSummary",showTimeAndSales:"showTimeAndSales",closeEmitter:"closeEmitter",emitMarketDepthToTrade:"emitMarketDepthToTrade"},features:[h.Sb],decls:13,vars:7,consts:[[4,"ngIf"],["bondDetails",""],[3,"showForceUpdateModal"],["announcementTemplate",""],["livefeedNoticeTemplate",""],["maintenanceBanner",""],[3,"hidden"],[1,"border-bottom"],[3,"title","back"],[3,"nzActive","nzLoading","nzParagraph"],[4,"ngTemplateOutlet"],[1,"d-flex","flex-row","ant-row-flex-space-between","mb-2"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["nz-radio-button","",1,"px-4",3,"nzValue"],["nz-button","","nzOutline","","nzType","primary",1,"px-2","mr-2",3,"nzSize","ngStyle"],["nz-button","","nzOutline","","nzType","primary",3,"nzSize","click",4,"ngIf"],["nz-button","","nzOutline","","nzType","primary",3,"nzSize","click"],["nz-icon","","nzType","fullscreen","nzTheme","outline",1,"text-primary"],[3,"isExtendedMode","lsClient","isBondLsAlive","onChangeExtendView","showMarketDepth","showSummary","showTimeAndSales","onChangeShowBondDetails","onCloseExchangeDetails"],[3,"primaryCashAcctAvailableBalance","lsClient","selectedTab","isAcctAllowScheduledSell","emitMarketDepthAction"],[3,"lsClient"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[3,"ngClass",4,"ngIf"],[1,"d-flex","align-items-center","bg-stock-alert","px-2","py-2",2,"border-radius","5px",3,"ngClass"],["alt","speaker",1,"text-info","text-md","ml-2","mt-1",3,"src"],[1,"vertical-scrollable","text-base","pl-3",3,"id"],["nz-icon","","nzType","close","nzTheme","outline",1,"anticon","text-base","ml-2","mt-1","mr-2","anticon-close","pointer",3,"click"],[1,"d-flex","align-items-center","bg-stock-alert","px-2","py-3",2,"border-radius","5px",3,"ngClass"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-info","text-md","ml-2","mt-1"],["class","text-base py-1 pl-3",4,"ngIf"],[1,"text-base","py-1","pl-3"],[1,"h-100","w-100","text-center","my-6","py-6","container"],[3,"src","alt"],[1,"pt-5","font-weight-normal","text-base",3,"innerHTML"]],template:function(e,t){1&e&&(h.od(0,eO,7,6,"app-mobile-scaffold",0),h.Ec(1,"async"),h.od(2,rO,4,6,"app-web-scaffold",0),h.Ec(3,"async"),h.od(4,pO,3,3,"ng-template",null,1,h.pd),h.mc(6,"app-risk-profile-required-modal",2),h.od(7,yO,1,1,"ng-template",null,3,h.pd),h.od(9,TO,1,1,"ng-template",null,4,h.pd),h.od(11,zO,1,1,"ng-template",null,5,h.pd)),2&e&&(h.Mc("ngIf",h.Fc(1,3,t.isMobile$)),h.Ub(2),h.Mc("ngIf",!h.Fc(3,5,t.isMobile$)),h.Ub(4),h.Mc("showForceUpdateModal",t.showForceUpdateModal))},directives:[p.t,yI.a,z.a,D.a,ut.a,W.a,p.A,B.a,Ut.c,oe.t,oe.w,Ut.a,_.a,p.w,k.b,yE,rF,jF,p.s,p.q],pipes:[p.b],styles:[".bg-stock-alert[_ngcontent-%COMP%]{background-color:#d8e9ff} .stock-stream-tooltip-wrapper.ant-tooltip{max-width:none} .stock-stream-tooltip-wrapper.ant-tooltip .ant-tooltip-inner{max-width:none;background-color:#fff}.vertical-scrollable[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}.vertical-scrollable[_ngcontent-%COMP%]{-ms-overflow-style:none;scrollbar-width:none;overflow-y:scroll;max-height:60px}"]}),Object(o.c)([Object(s.e)(u.X.getSelectedTransactionType)],e.prototype,"selectedTransactionType$",void 0),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const PO=["padWrapper"];function IO(e,t){if(1&e&&(h.mc(0,"confirmed-acct-follow-up",29),h.Ec(1,"async")),2&e){const e=h.Dc(2);h.Mc("hasFollowUp",h.Fc(1,1,e.confirmedAcctFollowStatus$))}}function kO(e,t){1&e&&h.nc(0)}function AO(e,t){1&e&&h.nc(0)}function EO(e,t){1&e&&h.nc(0)}function FO(e,t){1&e&&h.nc(0)}const OO=function(e){return[e]},UO=function(e){return{title:"IPO Center",link:e,product:null}};function xO(e,t){if(1&e&&h.nc(0,30),2&e){const e=h.Dc(2),t=h.ad(19);h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Sc(4,UO,h.Sc(2,OO,"../"+e.RouteConstant.IPO_CENTER)))}}function LO(e,t){if(1&e&&h.nc(0,31),2&e){h.Dc(2);const e=h.ad(21);h.Mc("ngTemplateOutlet",e)}}function RO(e,t){1&e&&h.mc(0,"buy-order-cart-sider")}function NO(e,t){1&e&&h.mc(0,"sell-order-cart-sider")}function BO(e,t){1&e&&h.mc(0,"switch-order-cart-sider")}function _O(e,t){if(1&e&&(h.pc(0),h.pc(1,27),h.Ec(2,"async"),h.od(3,RO,1,0,"buy-order-cart-sider",28),h.od(4,NO,1,0,"sell-order-cart-sider",28),h.od(5,BO,1,0,"switch-order-cart-sider",28),h.oc(),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngSwitch",h.Fc(2,4,e.transactionType$)),h.Ub(2),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.BUY),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.SELL),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.SWITCH)}}function VO(e,t){1&e&&h.mc(0,"dpms-buy-order-cart-sider")}function HO(e,t){1&e&&h.mc(0,"dpms-sell-order-cart-sider")}function $O(e,t){if(1&e&&(h.pc(0),h.pc(1,27),h.Ec(2,"async"),h.od(3,VO,1,0,"dpms-buy-order-cart-sider",28),h.od(4,HO,1,0,"dpms-sell-order-cart-sider",28),h.oc(),h.oc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngSwitch",h.Fc(2,3,e.transactionType$)),h.Ub(2),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.BUY),h.Ub(1),h.Mc("ngSwitchCase",e.ITransactionTypeEnum.SELL)}}function jO(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stocks-live-market",36),h.zc("selectTimeAndSalesEmitter",(function(t){return h.dd(e),h.Dc(3).showTimeAndSales(t)}))("selectTradeDetailEmitter",(function(t){return h.dd(e),h.Dc(3).showTradeDetail(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc(3).showNone()}))("refreshHkexSnapCount",(function(){return h.dd(e),h.Dc(3).refreshHkexLiveSnap()})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("selectedItem",e.selectedItem)("lsClient",e.lsClient)("stockLiveFeeHideScroll",!1)("hkexSnapCount",e.snapCount)}}function GO(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stocks-time-and-sales",37),h.zc("selectMarketDepthEmitter",(function(t){return h.dd(e),h.Dc(3).showMarketDepth(t)}))("selectTradeDetailEmitter",(function(t){return h.dd(e),h.Dc(3).showTradeDetail(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc(3).showNone()}))("refreshHkexSnapCount",(function(){return h.dd(e),h.Dc(3).refreshHkexLiveSnap()})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("selectedItem",e.selectedItem)("lsClient",e.lsClient)("stockLiveFeeHideScroll",!1)("hkexSnapCount",e.snapCount)}}function WO(e,t){if(1&e){const e=h.sc();
5h.rc(0,"app-stocks-trade-details",38),h.zc("selectTimeAndSalesEmitter",(function(t){return h.dd(e),h.Dc(3).showTimeAndSales(t)}))("selectMarketDepthEmitter",(function(t){return h.dd(e),h.Dc(3).showMarketDepth(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc(3).showNone()})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("selectedItem",e.selectedItem)("lsClient",e.lsClient)("stockLiveFeeHideScroll",!1)}}function YO(e,t){if(1&e&&(h.rc(0,"nz-row",null,32),h.od(2,jO,1,4,"app-stocks-live-market",33),h.od(3,GO,1,4,"app-stocks-time-and-sales",34),h.od(4,WO,1,3,"app-stocks-trade-details",35),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("ngIf",e.selectedStockInfoComponent===e.SHOW_MARKET_DEPTH),h.Ub(1),h.Mc("ngIf",e.selectedStockInfoComponent===e.SHOW_TIME_AND_SALES),h.Ub(1),h.Mc("ngIf",e.selectedStockInfoComponent===e.SHOW_TRADE_DETAILS)}}function KO(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bond-market-depth",39),h.zc("selectTimeAndSalesEmitter",(function(t){return h.dd(e),h.Dc(3).showBondTimeAndSales(t)}))("selectTradeDetailEmitter",(function(t){return h.dd(e),h.Dc(3).showBondSummary(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc(3).closeBondDetails()})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("lsClient",e.bondLsClient)("selectedItem",e.selectedBond)}}function XO(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bond-time-and-sales",40),h.zc("selectMarketDepthEmitter",(function(t){return h.dd(e),h.Dc(3).showBondMarketDepth(t)}))("selectTradeDetailEmitter",(function(t){return h.dd(e),h.Dc(3).showBondSummary(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc(3).closeBondDetails()})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("lsClient",e.bondLsClient)("selectedItem",e.selectedBond)}}function QO(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bond-summary",41),h.zc("selectTimeAndSalesEmitter",(function(t){return h.dd(e),h.Dc(3).showBondTimeAndSales(t)}))("selectMarketDepthEmitter",(function(t){return h.dd(e),h.Dc(3).showBondMarketDepth(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc(3).closeBondDetails()})),h.qc()}if(2&e){const e=h.Dc(3);h.Mc("lsClient",e.bondLsClient)("selectedItem",e.selectedBond)}}function ZO(e,t){if(1&e&&(h.rc(0,"nz-row",null,32),h.od(2,KO,1,2,"app-bond-market-depth",4),h.od(3,XO,1,2,"app-bond-time-and-sales",5),h.od(4,QO,1,2,"app-bond-summary",6),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("ngIf",e.selectedBondInfoTab===e.SHOW_MARKET_DEPTH),h.Ub(1),h.Mc("ngIf",e.selectedBondInfoTab===e.SHOW_TIME_AND_SALES),h.Ub(1),h.Mc("ngIf",e.selectedBondInfoTab===e.SHOW_TRADE_DETAILS)}}const JO=function(e,t){return{title:"Unit Trusts",link:e,product:t}},eU=function(e,t){return{title:"Stocks & ETFs",link:e,product:t}},tU=function(e,t){return{title:"Bonds",link:e,product:t}},nU=function(e,t){return{title:"Managed Portfolios",link:e,product:t}};function iU(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",9),h.rc(2,"div",10),h.od(3,IO,2,3,"confirmed-acct-follow-up",11),h.Ec(4,"async"),h.rc(5,"nz-row",12),h.rc(6,"nz-col",13),h.rc(7,"nz-card",14),h.rc(8,"div",15),h.rc(9,"p",16),h.qd(10,"Home / Trade "),h.qc(),h.rc(11,"h3",17),h.qd(12,"Trade"),h.qc(),h.qc(),h.rc(13,"div",18),h.od(14,kO,1,0,"ng-container",19),h.od(15,AO,1,0,"ng-container",19),h.od(16,EO,1,0,"ng-container",19),h.od(17,FO,1,0,"ng-container",19),h.od(18,xO,1,6,"ng-container",20),h.qc(),h.rc(19,"div",21),h.od(20,LO,1,1,"ng-container",22),h.Ec(21,"async"),h.qc(),h.qc(),h.qc(),h.rc(22,"nz-col",23),h.rc(23,"div",24),h.rc(24,"nz-row",25),h.mc(25,"investment-account-selector",26),h.pc(26,27),h.Ec(27,"async"),h.od(28,_O,6,6,"ng-container",28),h.od(29,$O,5,5,"ng-container",28),h.oc(),h.qc(),h.od(30,YO,5,3,"nz-row",0),h.od(31,ZO,5,3,"nz-row",0),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.oc()),2&e){const e=h.Dc(),t=h.ad(19);h.Ub(3),h.Mc("ngIf",h.Fc(4,22,e.confirmedAcctFollowStatus$)),h.Ub(11),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Tc(30,JO,h.Sc(28,OO,"./"+(null==e.RouteConstant?null:e.RouteConstant.FUNDS)),e.IProductEnum.UNIT_TRUST)),h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Tc(35,eU,h.Sc(33,OO,"./"+(null==e.RouteConstant?null:e.RouteConstant.STOCKS)),e.IProductEnum.STOCK_AND_ETF)),h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",e.rmoEnabled?h.Tc(40,tU,h.Sc(38,OO,"./"+(null==e.RouteConstant?null:e.RouteConstant.BONDS_RMO)),e.IProductEnum.BOND_RMO):h.Tc(45,tU,h.Sc(43,OO,"./"+(null==e.RouteConstant?null:e.RouteConstant.BONDS)),e.IProductEnum.BOND)),h.Ub(1),h.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",h.Tc(50,nU,h.Sc(48,OO,"./"+(null==e.RouteConstant?null:e.RouteConstant.DPMS)),e.IProductEnum.DPMS)),h.Ub(1),h.Mc("ngIf",e.bursaStockIpoCenterEnabled),h.Ub(2),h.Mc("ngIf",!h.Fc(21,24,e.mobile$)),h.Ub(2),h.nd("top",e.verticalOffsetExceeded?e.tradeComponentRightPaneTopCss:null),h.Mc("ngClass",e.tradeProduct===e.IProductEnum.STOCK_AND_ETF&&e.verticalOffsetExceeded?"sticky-card":""),h.Ub(2),h.Mc("hidden",e.tradeProduct===e.IProductEnum.STOCK_AND_ETF&&e.verticalOffsetExceeded),h.Ub(1),h.Mc("isStockPage",e.tradeProduct===e.IProductEnum.STOCK_AND_ETF)("selectedExchange",e.selectedExchange),h.Ub(1),h.Mc("ngSwitch",h.Fc(27,26,e.tradeProduct$)),h.Ub(2),h.Mc("ngSwitchCase",e.IProductEnum.UNIT_TRUST),h.Ub(1),h.Mc("ngSwitchCase",e.IProductEnum.DPMS),h.Ub(1),h.Mc("ngIf",e.tradeProduct===e.IProductEnum.STOCK_AND_ETF),h.Ub(1),h.Mc("ngIf",e.tradeProduct===e.IProductEnum.BOND_RMO&&e.selectedBond)}}function cU(e,t){1&e&&h.nc(0)}function oU(e,t){if(1&e&&(h.pc(0),h.rc(1,"div",42),h.od(2,cU,1,0,"ng-container",43),h.qc(),h.oc()),2&e){h.Dc();const e=h.ad(21);h.Ub(2),h.Mc("ngTemplateOutlet",e)}}function sU(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stocks-live-market",44),h.zc("mobileBack",(function(){return h.dd(e),h.Dc().showNone()}))("mobileShowTimeAndSales",(function(){return h.dd(e),h.Dc().showTimeAndSales()}))("mobileShowTradeDetails",(function(){return h.dd(e),h.Dc().showTradeDetail()}))("closeEmitter",(function(){return h.dd(e),h.Dc().showNone()}))("refreshHkexSnapCount",(function(){return h.dd(e),h.Dc().refreshHkexLiveSnap()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("selectedItem",e.selectedItem)("lsClient",e.lsClient)("hkexSnapCount",e.snapCount)}}function aU(e,t){if(1&e){const e=h.sc();h.rc(0,"app-stocks-time-and-sales",45),h.zc("mobileBack",(function(){return h.dd(e),h.Dc().showNone()}))("mobileShowMarketDepth",(function(){return h.dd(e),h.Dc().showMarketDepth()}))("mobileShowTradeDetails",(function(){return h.dd(e),h.Dc().showTradeDetail()}))("closeEmitter",(function(){return h.dd(e),h.Dc().showNone()}))("refreshHkexSnapCount",(function(){return h.dd(e),h.Dc().refreshHkexLiveSnap()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("selectedItem",e.selectedItem)("lsClient",e.lsClient)("hkexSnapCount",e.snapCount)}}function lU(e,t){if(1&e){const e=h.sc();
5h.rc(0,"app-stocks-trade-details",46),h.zc("mobileBack",(function(){return h.dd(e),h.Dc().showNone()}))("mobileShowMarketDepth",(function(){return h.dd(e),h.Dc().showMarketDepth()}))("mobileShowTimeAndSales",(function(){return h.dd(e),h.Dc().showTimeAndSales()}))("closeEmitter",(function(){return h.dd(e),h.Dc().showNone()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("selectedItem",e.selectedItem)("lsClient",e.lsClient)}}function rU(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bond-market-depth",39),h.zc("selectTimeAndSalesEmitter",(function(t){return h.dd(e),h.Dc().showBondTimeAndSales(t)}))("selectTradeDetailEmitter",(function(t){return h.dd(e),h.Dc().showBondSummary(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc().closeBondDetails()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("lsClient",e.bondLsClient)("selectedItem",e.selectedBond)}}function dU(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bond-time-and-sales",40),h.zc("selectMarketDepthEmitter",(function(t){return h.dd(e),h.Dc().showBondMarketDepth(t)}))("selectTradeDetailEmitter",(function(t){return h.dd(e),h.Dc().showBondSummary(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc().closeBondDetails()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("lsClient",e.bondLsClient)("selectedItem",e.selectedBond)}}function uU(e,t){if(1&e){const e=h.sc();h.rc(0,"app-bond-summary",41),h.zc("selectTimeAndSalesEmitter",(function(t){return h.dd(e),h.Dc().showBondTimeAndSales(t)}))("selectMarketDepthEmitter",(function(t){return h.dd(e),h.Dc().showBondMarketDepth(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc().closeBondDetails()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("lsClient",e.bondLsClient)("selectedItem",e.selectedBond)}}function hU(e,t){if(1&e){const e=h.sc();h.rc(0,"a",50),h.zc("click",(function(){h.dd(e);const t=h.Dc().product;return h.Dc().onProductTypeClick(t)})),h.qd(1),h.qc()}if(2&e){const e=h.Dc(),t=e.title,n=e.link,i=e.product,c=h.Dc();h.Mc("title",t)("routerLink",n)("ngClass",c.tradeProduct===i?"active font-weight-bold text-theme":""),h.Ub(1),h.sd(" ",t," ")}}function pU(e,t){if(1&e){const e=h.sc();h.rc(0,"a",51),h.zc("click",(function(){h.dd(e);const t=h.Dc().product;return h.Dc().onProductTypeClick(t)})),h.qd(1),h.qc()}if(2&e){const e=h.Dc(),t=e.title,n=e.link,i=h.Dc();h.Mc("ngClass",i.tradeProduct===i.IProductEnum.STOCK_AND_ETF?"tab text-black-5 py-2 px-4 mr-4 active font-weight-bold text-theme":"tab text-black-5 py-2 px-4 mr-4")("title",t)("routerLink",n),h.Ub(1),h.sd(" ",t," ")}}function mU(e,t){if(1&e){const e=h.sc();h.rc(0,"a",52),h.zc("click",(function(){h.dd(e);const t=h.Dc().product;return h.Dc().onProductTypeClick(t)})),h.qd(1),h.qc()}if(2&e){const e=h.Dc(),t=e.product,n=e.title,i=e.link,c=h.Dc();h.Mc("ngClass",c.tradeProduct===t?"active font-weight-bold text-theme":"")("title",n)("routerLink",i),h.Ub(1),h.sd(" ",n," ")}}function fU(e,t){if(1&e&&(h.od(0,hU,2,4,"a",47),h.od(1,pU,2,4,"a",48),h.od(2,mU,2,4,"a",49)),2&e){const e=t.product,n=h.Dc();h.Mc("ngIf",e!==n.IProductEnum.STOCK_AND_ETF&&e!==n.IProductEnum.BOND_RMO),h.Ub(1),h.Mc("ngIf",e===n.IProductEnum.STOCK_AND_ETF),h.Ub(1),h.Mc("ngIf",e===n.IProductEnum.BOND_RMO&&n.rmoEnabled)}}function gU(e,t){1&e&&(h.pc(0),h.mc(1,"router-outlet"),h.oc())}function bU(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-stocks-trade",53),h.zc("emitTimeAndSalesActionToTrade",(function(t){return h.dd(e),h.Dc(2).showTimeAndSales(t)}))("cdsAvailabilityEmitter",(function(t){return h.dd(e),h.Dc(2).updateCdsAvailabilityFlag(t)}))("emitMarketDepthToTrade",(function(t){return h.dd(e),h.Dc(2).showMarketDepth(t)}))("emitSummaryToTrade",(function(t){return h.dd(e),h.Dc(2).showTradeDetail(t)}))("emitExchangeOnChange",(function(t){return h.dd(e),h.Dc(2).exchangeOnChange(t)})),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("lsClient",e.lsClient)("proceedtoRedirectHKEXFlag",e.proceedtoRedirectHKEXFlag)("isDuplicateLogin",e.isDuplicateLogin)("isLivefeedAlive",e.isLivefeedAlive)}}function SU(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"app-bond-rmo-trade",54),h.zc("showTimeAndSales",(function(t){return h.dd(e),h.Dc(2).showBondTimeAndSales(t)}))("showMarketDepth",(function(t){return h.dd(e),h.Dc(2).showBondMarketDepth(t)}))("showSummary",(function(t){return h.dd(e),h.Dc(2).showBondSummary(t)}))("closeEmitter",(function(){return h.dd(e),h.Dc(2).closeBondDetails()})),h.qc(),h.oc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("lsClient",e.bondLsClient)("isBondLsDuplicateLogin",e.isBondLsDuplicateLogin)("isBondLsAlive",e.isBondLsAlive)}}function yU(e,t){if(1&e&&(h.od(0,gU,2,0,"ng-container",0),h.od(1,bU,2,4,"ng-container",0),h.od(2,SU,2,3,"ng-container",0)),2&e){const e=h.Dc();h.Mc("ngIf",e.tradeProduct!==e.IProductEnum.STOCK_AND_ETF&&e.tradeProduct!==e.IProductEnum.BOND_RMO),h.Ub(1),h.Mc("ngIf",e.tradeProduct===e.IProductEnum.STOCK_AND_ETF&&e.proceedtoRedirectHKEXFlag),h.Ub(1),h.Mc("ngIf",e.tradeProduct===e.IProductEnum.BOND_RMO&&e.rmoEnabled)}}let vU=(()=>{class e extends rm.a{constructor(e,t,n,i,c,o,s,a,l,u,h,p){super(e,n,i,o),this.liveFeedService=e,this.router=t,this.store=n,this.accountService=i,this.titleService=c,this.lightstreamerService=o,this.mdfRestService=s,this.lightstreamerBondInitService=a,this.bondRestService=l,this.subHandlingService=u,this.cdsAccountRestService=h,this.cdr=p,this.RouteConstant=M.o,this.STICKY_CARD_Y_SCROLL_OFFSET=550,this.SHOW_TIME_AND_SALES="SHOW_TIME_AND_SALES",this.SHOW_TRADE_DETAILS="SHOW_TRADE_DETAILS",this.SHOW_MARKET_DEPTH="SHOW_MARKET_DEPTH",this.STOCK_TRADE="Stock Trade",this.SLASH="/",this.transactionType$=new lm.a,this.tradeProduct$=new lm.a,this.ITransactionTypeEnum=d.d,this.IProductEnum=r.b,this.selectedExchange=M.q.KLSE,this.bondLsClient=new um.a(Ru.a.lsUrl,"BOND_EXPRESS"),this.isBondLsDuplicateLogin=!1,this.rmoEnabled=!1,this.bursaStockIpoCenterEnabled=!1}onScroll(e){this.verticalOffsetExceeded=this.getVerticalOffsetExceeded(),this.tradeComponentRightPaneTopCss=this.calculateTradeComponentRightPaneHeight()}ngOnDestroy(){this.lightstreamerService.destroyLightStreamer(),null!=this.lightstreamerBondInitService.getLsClient()&&this.lightstreamerBondInitService.destroyLightStreamer()}ngOnInit(){switch(console.log("initBondLight"),this.initBondLightStreamerConnection(),this.tradeProduct$=this.store.select(u.X.getTradeProduct),this.tradeProduct$.subscribe(e=>{this.tradeProduct=e}),this.router.url.split(this.SLASH)[3]||""){case M.o.FUNDS:this.tradeProduct=r.b.UNIT_TRUST;break;case M.o.BONDS:this.tradeProduct=r.b.BOND;break;case M.o.STOCKS:this.tradeProduct=r.b.STOCK_AND_ETF;break;case M.o.DPMS:this.tradeProduct=r.b.DPMS;break;case M.o.BONDS_RMO:this.tradeProduct=r.b.BOND_RMO}this.transactionType$=this.store.select(u.X.getSelectedTransactionType),this.connectLightStreamer(),this.cdsAccountRestService.enableBurs
5aIpo().subscribe(e=>{this.bursaStockIpoCenterEnabled=(null==e?void 0:e.status)===M.a.RESPONSE_SUCCESS&&(null==e?void 0:e.data),this.cdr.detectChanges()})}updateCdsAvailabilityFlag(e){!this.cdsAccount&&e&&this.initLightStreamerConnection()}onProductTypeClick(e){this.tradeProduct=e,this.store.dispatch(new u.U(this.tradeProduct)),this.store.dispatch(new u.V(d.d.BUY)),this.tradeProduct===r.b.STOCK_AND_ETF&&this.titleService.setTitle(this.STOCK_TRADE)}showTimeAndSales(e){e&&(this.selectedItem=e),this.selectedStockInfoComponent=this.SHOW_TIME_AND_SALES}showTradeDetail(e){e&&(this.selectedItem=e),this.selectedStockInfoComponent=this.SHOW_TRADE_DETAILS}showMarketDepth(e){e&&(this.selectedItem=e),(null==e?void 0:e.exchange)===M.q.USOTC?this.showNone():this.selectedStockInfoComponent=this.SHOW_MARKET_DEPTH}showNone(){this.selectedStockInfoComponent=null}exchangeOnChange(e){this.selectedExchange=e}getVerticalOffsetExceeded(){return(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0)>=this.STICKY_CARD_Y_SCROLL_OFFSET}calculateTradeComponentRightPaneHeight(){const e=window.innerHeight-100;return this.padWrapper&&this.padWrapper.nativeElement.offsetHeight>e?window.innerHeight-this.padWrapper.nativeElement.offsetHeight+"px":"100px"}connectLightStreamer(){this.cdsAccount=this.accountService.cdsAccount,console.log("CDS acc",this.cdsAccount),this.cdsAccount?this.initLightStreamerConnection():this.proceedtoRedirectHKEXFlag=!0,this.refreshHkexLiveSnap()}refreshHkexLiveSnap(){console.log("run refresh"),this.mdfRestService.getMdfPermission("",M.a.FMY).subscribe(e=>{this.snapCount=e.data.result.HKEX.snapL3>0||e.data.result.HKEX.snapL2>0?e.data.result.HKEX.snapL3+e.data.result.HKEX.snapL2:e.data.result.HKEX.snapL1>0?e.data.result.HKEX.snapL1:0})}showBondTimeAndSales(e){e&&(this.selectedBond=e,this.selectedBondInfoTab=this.SHOW_TIME_AND_SALES)}showBondSummary(e){e&&(this.selectedBond=e,this.selectedBondInfoTab=this.SHOW_TRADE_DETAILS)}showBondMarketDepth(e){e&&(this.selectedBond=e,this.selectedBondInfoTab=this.SHOW_MARKET_DEPTH)}closeBondDetails(){this.selectedBondInfoTab=null}initBondLightStreamerConnection(){var e;this.rmoEnabled=null===(e=this.store.selectSnapshot(f.a.getAuthData))||void 0===e?void 0:e.rmoEnabled,this.rmoEnabled&&(this.bondLsClient=this.lightstreamerBondInitService.initLightstreamer(),this.lightstreamerBondInitService.setOnStatusChangeCallback(e=>{this.isBondLsAlive=e}),this.lightstreamerBondInitService.setOnServerErrorCallback(e=>{console.error("Lightstreamer server error:",e),this.isDuplicateLogin=e}))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(hm.a),h.lc(c.e),h.lc(s.i),h.lc(pm.a),h.lc(mm.h),h.lc(dm.a),h.lc(Mt.a),h.lc(fm.a),h.lc(gm.a),h.lc(l.a),h.lc(bm.a),h.lc(h.j))},e.\u0275cmp=h.fc({type:e,selectors:[["ng-component"]],viewQuery:function(e,t){var n;1&e&&h.yd(PO,!0),2&e&&h.Zc(n=h.Ac())&&(t.padWrapper=n.first)},hostBindings:function(e,t){1&e&&h.zc("scroll",(function(e){return t.onScroll(e)}),!1,h.cd)("resize",(function(e){return t.onScroll(e)}),!1,h.cd)},features:[h.Tb([l.a,dm.a]),h.Rb],decls:22,vars:24,consts:[[4,"ngIf"],[3,"selectedItem","lsClient","hkexSnapCount","mobileBack","mobileShowTimeAndSales","mobileShowTradeDetails","closeEmitter","refreshHkexSnapCount",4,"ngIf"],[3,"selectedItem","lsClient","hkexSnapCount","mobileBack","mobileShowMarketDepth","mobileShowTradeDetails","closeEmitter","refreshHkexSnapCount",4,"ngIf"],[3,"selectedItem","lsClient","mobileBack","mobileShowMarketDepth","mobileShowTimeAndSales","closeEmitter",4,"ngIf"],[3,"lsClient","selectedItem","selectTimeAndSalesEmitter","selectTradeDetailEmitter","closeEmitter",4,"ngIf"],[3,"lsClient","selectedItem","selectMarketDepthEmitter","selectTradeDetailEmitter","closeEmitter",4,"ngIf"],[3,"lsClient","selectedItem","selectTimeAndSalesEmitter","selectMarketDepthEmitter","closeEmitter",4,"ngIf"],["webTabTemplate",""],["routerTemplate",""],[1,"bg-black-2","pb-4"],[1,"container","mb-4"],[3,"hasFollowUp",4,"ngIf"],["nzType","flex","nzGutter","20"],["nzSpan","18"],[1,"card-no-padding"],[1,"p-4"],[1,"text-xs"],[1,"mb-0"],[1,"mb-3","pb-2","border-bottom"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngTemplateOutlet","ngTemplateOutletContext",4,"ngIf"],[1,"pl-4","pr-4","pb-4","pt-2"],[3,"ngTemplateOutlet",4,"ngIf"],["id","trade-component-right-pane","nzSpan","6",1,"order-cart",3,"ngClass"],[1,"bg-black-2","stock-sidebar-content"],[3,"hidden"],[3,"isStockPage","selectedExchange"],[3,"ngSwitch"],[4,"ngSwitchCase"],[3,"hasFollowUp"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngTemplateOutlet"],["padWrapper",""],[3,"selectedItem","lsClient","stockLiveFeeHideScroll","hkexSnapCount","selectTimeAndSalesEmitter","selectTradeDetailEmitter","closeEmitter","refreshHkexSnapCount",4,"ngIf"],[3,"selectedItem","lsClient","stockLiveFeeHideScroll","hkexSnapCount","selectMarketDepthEmitter","selectTradeDetailEmitter","closeEmitter","refreshHkexSnapCount",4,"ngIf"],[3,"selectedItem","lsClient","stockLiveFeeHideScroll","selectTimeAndSalesEmitter","selectMarketDepthEmitter","closeEmitter",4,"ngIf"],[3,"selectedItem","lsClient","stockLiveFeeHideScroll","hkexSnapCount","selectTimeAndSalesEmitter","selectTradeDetailEmitter","closeEmitter","refreshHkexSnapCount"],[3,"selectedItem","lsClient","stockLiveFeeHideScroll","hkexSnapCount","selectMarketDepthEmitter","selectTradeDetailEmitter","closeEmitter","refreshHkexSnapCount"],[3,"selectedItem","lsClient","stockLiveFeeHideScroll","selectTimeAndSalesEmitter","selectMarketDepthEmitter","closeEmitter"],[3,"lsClient","selectedItem","selectTimeAndSalesEmitter","selectTradeDetailEmitter","closeEmitter"],[3,"lsClient","selectedItem","selectMarketDepthEmitter","selectTradeDetailEmitter","closeEmitter"],[3,"lsClient","selectedItem","selectTimeAndSalesEmitter","selectMarketDepthEmitter","closeEmitter"],[1,"bg-black-2"],[4,"ngTemplateOutlet"],[3,"selectedItem","lsClient","hkexSnapCount","mobileBack","mobileShowTimeAndSales","mobileShowTradeDetails","closeEmitter","refreshHkexSnapCount"],[3,"selectedItem","lsClient","hkexSnapCount","mobileBack","mobileShowMarketDepth","mobileShowTradeDetails","closeEmitter","refreshHkexSnapCount"],[3,"selectedItem","lsClient","mobileBack","mobileShowMarketDepth","mobileShowTimeAndSales","closeEmitter"],["class","tab text-black-5 py-2 px-4 mr-4","role","navigation",3,"title","routerLink","ngClass","click",4,"ngIf"],["role","navigation",3,"ngClass","title","routerLink","click",4,"ngIf"],["class","tab text-black-5 py-2 px-4 mr-4","role","navigation",3,"ngClass","title","routerLink","click",4,"ngIf"],["role","navigation",1,"tab","text-black-5","py-2","px-4","mr-4",3,"title","routerLink","ngClass","click"],["role","navigation",3,"ngClass","title","routerLink","click"],["role","navigation",1,"tab","text-black-5","py-2","px-4","mr-4",3,"ngClass","title","routerLink","click"],[3,"lsClient","proceedtoRedirectHKEXFlag","isDuplicateLogin","isLivefeedAlive","emitTimeAndSalesActionToTrade","cdsAvailabilityEmitter","emitMarketDepthToTrade","emitSummaryToTrade","emitExchangeOnChange"],[3,"lsClient","
5isBondLsDuplicateLogin","isBondLsAlive","showTimeAndSales","showMarketDepth","showSummary","closeEmitter"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,iU,32,53,"ng-container",0),h.Ec(2,"async"),h.qc(),h.rc(3,"app-mobile-scaffold"),h.od(4,oU,3,1,"ng-container",0),h.Ec(5,"async"),h.od(6,sU,1,3,"app-stocks-live-market",1),h.Ec(7,"async"),h.od(8,aU,1,3,"app-stocks-time-and-sales",2),h.Ec(9,"async"),h.od(10,lU,1,2,"app-stocks-trade-details",3),h.Ec(11,"async"),h.od(12,rU,1,2,"app-bond-market-depth",4),h.Ec(13,"async"),h.od(14,dU,1,2,"app-bond-time-and-sales",5),h.Ec(15,"async"),h.od(16,uU,1,2,"app-bond-summary",6),h.Ec(17,"async"),h.qc(),h.od(18,fU,3,3,"ng-template",null,7,h.pd),h.od(20,yU,3,3,"ng-template",null,8,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,8,t.mobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(5,10,t.mobile$)),h.Ub(2),h.Mc("ngIf",t.selectedStockInfoComponent===t.SHOW_MARKET_DEPTH&&h.Fc(7,12,t.mobile$)),h.Ub(2),h.Mc("ngIf",t.selectedStockInfoComponent===t.SHOW_TIME_AND_SALES&&h.Fc(9,14,t.mobile$)),h.Ub(2),h.Mc("ngIf",t.selectedStockInfoComponent===t.SHOW_TRADE_DETAILS&&h.Fc(11,16,t.mobile$)),h.Ub(2),h.Mc("ngIf",t.selectedBond&&t.tradeProduct===t.IProductEnum.BOND_RMO&&t.selectedBondInfoTab===t.SHOW_MARKET_DEPTH&&h.Fc(13,18,t.mobile$)),h.Ub(2),h.Mc("ngIf",t.selectedBond&&t.tradeProduct===t.IProductEnum.BOND_RMO&&t.selectedBondInfoTab===t.SHOW_TIME_AND_SALES&&h.Fc(15,20,t.mobile$)),h.Ub(2),h.Mc("ngIf",t.selectedBond&&t.tradeProduct===t.IProductEnum.BOND_RMO&&t.selectedBondInfoTab===t.SHOW_TRADE_DETAILS&&h.Fc(17,22,t.mobile$)))},directives:[B.a,p.t,z.a,P.c,P.a,I.a,p.A,p.q,ut.a,p.x,p.y,Sm.a,Um,af,Qf,lg,vg,Sb,lS,ES,ay,jy,rv,c.h,c.j,SI,DO],pipes:[p.b],styles:[".active[_ngcontent-%COMP%]{border-bottom:2px solid #bd2e26}.tab[_ngcontent-%COMP%]{-moz-user-select:none;user-select:none}.stock-sidebar-anchor[_ngcontent-%COMP%] .stock-sidebar-content[_ngcontent-%COMP%]{max-height:calc(100vh - 260px)}.stock-sidebar-anchor[_ngcontent-%COMP%] .ant-anchor-wrapper{background-color:transparent}.stock-sidebar-anchor[_ngcontent-%COMP%] .ant-anchor-wrapper>.ant-anchor>.ant-anchor-ink:before{display:none}.sticky-card[_ngcontent-%COMP%]{z-index:3;position:sticky;position:-webkit-sticky}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"mobile$",void 0),Object(o.c)([Object(s.e)(f.a.getConfirmedAcctFollowStatus)],e.prototype,"confirmedAcctFollowStatus$",void 0),e})();function MU(e,t){if(1&e&&(h.rc(0,"label",7),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(null==e?null:e.label)}}function CU(e,t){if(1&e){const e=h.sc();h.rc(0,"div",8),h.rc(1,"a",9),h.zc("click",(function(){return h.dd(e),h.Dc(2).goToSwitchingCalculator()})),h.rc(2,"b"),h.rc(3,"ins"),h.qd(4,"Switching Calculator"),h.qc(),h.qc(),h.qc(),h.qc()}}function qU(e,t){if(1&e){const e=h.sc();h.rc(0,"div",3),h.rc(1,"nz-radio-group",4),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedTransactionType=t}))("ngModelChange",(function(){h.dd(e);const t=h.Dc();return t.onSelectedTransactionTypeChange(t.selectedTransactionType)})),h.od(2,MU,2,2,"label",5),h.qc(),h.od(3,CU,5,0,"div",6),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("ngModel",e.selectedTransactionType),h.Ub(1),h.Mc("ngForOf",e.transactionTypeOptions),h.Ub(1),h.Mc("ngIf","switch"===e.selectedTransactionType)}}function TU(e,t){1&e&&h.nc(0)}function wU(e,t){if(1&e&&(h.pc(0),h.od(1,TU,1,0,"ng-container",10),h.oc()),2&e){h.Dc();const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function zU(e,t){1&e&&h.nc(0)}function DU(e,t){if(1&e&&(h.pc(0),h.od(1,zU,1,0,"ng-container",10),h.oc()),2&e){h.Dc();const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function PU(e,t){1&e&&h.mc(0,"router-outlet")}let IU=(()=>{class e{constructor(e,t,n,i,c){this.transactionService=e,this.store=t,this.router=n,this.subHandlingService=i,this.cdRef=c,this.ITransactionTypeEnum=d.d,this.transactionTypeOptions=[{value:d.d.BUY,label:"Buy"},{value:d.d.SELL,label:"Sell"},{value:d.d.SWITCH,label:"Switch"}],this.selectedTransactionType=d.d.BUY,this.selectedAuthenticatedDisplay=null}ngOnInit(){this.subscribeTransactionTypeChange(),this.store.dispatch(new u.U(r.b.UNIT_TRUST)),this.subscribeSelectedAuthenticatedDisplayChange()}onSelectedTransactionTypeChange(e){this.selectedTransactionType=e,this.router.navigate([M.o.APP,M.o.TRADE,M.o.FUNDS,this.selectedTransactionType])}subscribeTransactionTypeChange(){this.subHandlingService.subscribe(this.selectedTransactionType$.pipe(Object(y.a)(e=>{this.selectedTransactionType=e,this.cdRef.markForCheck()})))}subscribeSelectedAuthenticatedDisplayChange(){this.subHandlingService.subscribe(this.selectedAuthenticatedDisplay$.pipe(Object(y.a)(e=>{this.selectedAuthenticatedDisplay=e,this.cdRef.markForCheck()})))}goToSwitchingCalculator(){Object(pt.a)([M.o.FUNDS,M.o.TOOLS,M.o.SWITCHING_CALCULATOR])}}return e.\u0275fac=function(t){return new(t||e)(h.lc(C.a),h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(h.j))},e.\u0275cmp=h.fc({type:e,selectors:[["ng-component"]],decls:10,vars:9,consts:[["class","d-flex",4,"ngIf"],[4,"ngIf"],["routerTemplate",""],[1,"d-flex"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["nz-radio-button","","class","px-4",3,"nzValue",4,"ngFor","ngForOf"],["class","mb-0 pl-3 py-2",4,"ngIf"],["nz-radio-button","",1,"px-4",3,"nzValue"],[1,"mb-0","pl-3","py-2"],[1,"text-info","text-sm","sub-text",3,"click"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(h.od(0,qU,4,3,"div",0),h.Ec(1,"async"),h.rc(2,"app-web-scaffold"),h.od(3,wU,2,1,"ng-container",1),h.Ec(4,"async"),h.qc(),h.rc(5,"app-mobile-scaffold"),h.od(6,DU,2,1,"ng-container",1),h.Ec(7,"async"),h.qc(),h.od(8,PU,1,0,"ng-template",null,2,h.pd)),2&e&&(h.Mc("ngIf",!h.Fc(1,3,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!h.Fc(4,5,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(7,7,t.isMobile$)))},directives:[p.t,B.a,z.a,Ut.c,oe.t,oe.w,p.s,Ut.a,p.A,c.j],pipes:[p.b],styles:[".ant-select-dropdown-menu-item{white-space:unset;text-overflow:clip}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedTransactionType)],e.prototype,"selectedTransactionType$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedAuthenticatedDisplay)],e.prototype,"selectedAuthenticatedDisplay$",void 0),e})(),kU=(()=>{class e{constructor(){}ngOnInit(){}get transactionImgPath(){return M.g.TRANSACTION_IMG_PATH}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-trade-not-allowed"]],decls:8,vars:2,consts:[["nz-row","","nzType","flex",1,"text-center","position-relative","container","p-5"],[1,"w-100"],[1,"pending-icon","ml-2","mr-5",3,"src","alt"],[1,"text-md","py-3"],["nz-button","","nzType","primary"]],template:function(e,t){1&e&&(h.rc(0,"div",0),h.rc(1,"div",1),h.mc(2,"img",2),h.qc(),h.rc(3,"div"),h.rc(4,"p",3),h.qd(5," We are currently processing your investment account, we will activate your investment account within the same business day. You will be able to perform transactions as soon as your account is ready. In the meantime, have take a look at our investment ideas. "),h.qc(),h.rc(6,"button",4),h.qd(7,"Browse Idea"),h.qc(),h.qc(),h.qc()),2&e&&(h.Ub(2),h.Mc("src",t.transactionImgPath+"pending-approval.svg",h.gd)("alt","pending-approval"))},directives:[P.c,_.a],styles:[""]}),e})();var AU=n("Gj66");function EU(e,t){1&e&&h.nc(0)}function FU(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",3),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().closeUpdatePPAModalAction()}))("nzVisibleChange",(function(t){return h.dd(e),h.Dc().showUpdatePPA=t})),h.rc(1,"div",4),h.rc(2,"h3"),h.mc(3,"i",5),h.qd(4,"Update PPA Account Number "),h.qc(),h.od(5,EU,1,0,"ng-container",6),h.qc(),h.rc(6,"div",7),h.rc(7,"div",8),h.rc(8,"button",9),h.zc("click",(function(){return h.dd(e),h.Dc().closeUpdatePPAModalAction()})),h.qd(9,"Maybe Later "),h.qc(),h.rc(10,"button",10),h.zc("click",(function(){return h.dd(e),h.Dc().updateInfo()})),h.qd(11,"Update PPA Number "),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Mc("nzVisible",e.showUpdatePPA)("nzFooter",null),h.Ub(5),h.Mc("ngTemplateOutlet",t),h.Ub(5),h.Mc("nzLoading",e.isLoading)("disabled",e.form.invali
5d)}}function OU(e,t){1&e&&h.nc(0)}function UU(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-mobile-drawer",11),h.zc("showChange",(function(){return h.dd(e),h.Dc().closeUpdatePPAModalAction()})),h.rc(1,"nz-row",12),h.rc(2,"nz-col",13),h.mc(3,"i",14),h.qc(),h.rc(4,"nz-col",15),h.rc(5,"h3"),h.qd(6,"Looks like you do not have your PPA number with us."),h.qc(),h.qc(),h.qc(),h.rc(7,"nz-row",16),h.od(8,OU,1,0,"ng-container",6),h.qc(),h.rc(9,"b2c-floating-bar",17),h.rc(10,"button",18),h.zc("click",(function(){return h.dd(e),h.Dc().closeUpdatePPAModalAction()})),h.qd(11,"Maybe Later "),h.qc(),h.rc(12,"button",19),h.zc("click",(function(){return h.dd(e),h.Dc().updateInfo()})),h.qd(13,"Update PPA Number "),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Mc("show",e.showUpdatePPA)("actionText",null)("hideButtons",!0)("height",320),h.Ub(8),h.Mc("ngTemplateOutlet",t),h.Ub(4),h.Mc("nzLoading",e.isLoading)("disabled",e.form.invalid)}}function xU(e,t){if(1&e&&(h.rc(0,"nz-form-explain"),h.rc(1,"p",27),h.qd(2),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.rd(null==e.ppaNumber?null:e.ppaNumber.getError("invalidPPA"))}}function LU(e,t){if(1&e&&(h.rc(0,"div",20),h.rc(1,"span",21),h.qd(2,"Kindly update it below before placing the purchase order."),h.qc(),h.qc(),h.rc(3,"div",22),h.Ec(4,"async"),h.rc(5,"form",23),h.rc(6,"nz-form-item"),h.rc(7,"nz-form-control"),h.rc(8,"ui-input-group",24),h.mc(9,"input",25),h.qc(),h.qc(),h.od(10,xU,3,1,"nz-form-explain",26),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.Mc("nzSpan",h.Fc(4,5,e.isMobile$)?24:12),h.Ub(2),h.Mc("formGroup",e.form),h.Ub(3),h.Mc("nzLabelPlaceholder","PPA Number"),h.Ub(1),h.Mc("formControl",e.ppaNumber),h.Ub(1),h.Mc("ngIf",(null==e.ppaNumber?null:e.ppaNumber.dirty)&&e.ppaNumber.hasError("invalidPPA"))}}let RU=(()=>{class e{constructor(e,t,n){this.accountRestService=e,this.store=t,this.subHandlingService=n,this.redirectToAccountUpdatePrsNumber=new h.s,this.closeUpdatePPAModal=new h.s,this.updated=new h.s}get ppaNumber(){return this.form.get("ppaNumber")}get ppaNumberValue(){return this.form.get("ppaNumber").value}ngOnInit(){this.form=new oe.k({ppaNumber:new oe.h("",[oe.H.required])})}ngOnChanges(e){this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{this.authenticatedDisplay=Object(g.a)(e)});for(let t of this.authenticatedDisplay)this.refno==t.refno&&(this.accountDataToUpdate=t)}updateInfo(){this.isLoading=!0,this.nric=this.store.selectSnapshot(f.a.getPrimaryAccount).nric,this.subHandlingService.once(this.accountRestService.updatePpaNumber(this.ppaNumberValue).pipe(Object(y.a)(e=>{var t;this.isLoading=!1,M.a.RESPONSE_FAILED!==e.status?this.updated.emit(!0):null===(t=this.ppaNumber)||void 0===t||t.setErrors({invalidPPA:e.errorMessage})})))}closeUpdatePPAModalAction(){this.closeUpdatePPAModal.emit(!0)}}return e.\u0275fac=function(t){return new(t||e)(h.lc(bt.a),h.lc(s.i),h.lc(l.a))},e.\u0275cmp=h.fc({type:e,selectors:[["update-ppa-number-modal"]],inputs:{showUpdatePPA:"showUpdatePPA",refno:"refno"},outputs:{redirectToAccountUpdatePrsNumber:"redirectToAccountUpdatePrsNumber",closeUpdatePPAModal:"closeUpdatePPAModal",updated:"updated"},features:[h.Tb([l.a]),h.Sb],decls:7,vars:6,consts:[["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzOnCancel","nzVisibleChange",4,"ngIf"],[3,"show","actionText","hideButtons","height","showChange",4,"ngIf"],["formTemplate",""],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzOnCancel","nzVisibleChange"],["nz-row","",1,""],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning"],[4,"ngTemplateOutlet"],["nz-row","",1,"text-right","mt-4"],["nz-col","","nzSpan","24"],["nz-button","","nzOutline","",1,"rounded-calertircle","mr-2",3,"click"],["nz-button","","nzType","primary",1,"rounded-calertircle",3,"nzLoading","disabled","click"],[3,"show","actionText","hideButtons","height","showChange"],["nzAlign","middle","nzType","flex"],["nzXs","2","nzSm","1"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-warning","text-lg"],["nzXs","22","nzSm","23"],["nzType","flex"],["nz-row",""],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"nzLoading","disabled","click"],["nz-col","","nzSpan","24",1,"mb-2"],[1,"font-semibold","m-b-md","pt-2","pb-2"],["nz-col","",1,"mb-2",3,"nzSpan"],["nz-form","",3,"formGroup"],[3,"nzLabelPlaceholder"],["type","string","ui-input","",3,"formControl"],[4,"ngIf"],[1,"text-warning"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,FU,12,5,"nz-modal",0),h.Ec(2,"async"),h.qc(),h.od(3,UU,14,7,"b2c-mobile-drawer",1),h.Ec(4,"async"),h.od(5,LU,11,7,"ng-template",null,2,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,2,t.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(4,4,t.isMobile$)))},directives:[B.a,p.t,j.a,P.c,k.b,p.A,P.a,_.a,G.a,Se.a,oe.J,oe.u,se.b,oe.l,se.e,se.a,ae.c,oe.c,ae.b,oe.t,oe.i,se.c],pipes:[p.b],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function NU(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-floating-bar"),h.rc(1,"div",1),h.zc("click",(function(){return h.dd(e),h.Dc().onViewCart()})),h.rc(2,"div",2),h.rc(3,"div",3),h.qd(4,"View Cart"),h.qc(),h.rc(5,"div",4),h.rc(6,"nz-row",5),h.rc(7,"nz-col"),h.mc(8,"i",6),h.qc(),h.rc(9,"div",7),h.rc(10,"p",8),h.qd(11),h.qc(),h.qc(),h.rc(12,"nz-col",9),h.qd(13," Item "),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(11),h.rd(e.itemCount)}}let BU=(()=>{class e{constructor(){this.viewCart=new h.s}ngOnInit(){}onViewCart(){this.viewCart.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-transaction-mobile-view-cart-bar"]],inputs:{itemCount:"itemCount",hideProductList:"hideProductList",previewCart:"previewCart",showPrsNotice:"showPrsNotice"},outputs:{viewCart:"viewCart"},decls:2,vars:1,consts:[[4,"ngIf"],[1,"bg-primary","pointer","py-2","px-3","w-100","rounded",3,"click"],["nz-row","","nzType","flex","nzAlign","middle",1,"text-white"],["nz-col","","nzSpan","12",1,"text-left","font-weight-bold"],["nz-col","","nzSpan","12",1,"position-relative","text-right"],["nzType","flex","nzJustify","end","nzAlign","middle",1,"text-right"],["nz-icon","","nzType","shopping-cart","nzTheme","outline",1,"cart-icon","pt-1","h-100"],["nz-col","",1,"item-count-container","d-inline-flex","rounded-circle","bg-white"],[1,"text-primary","font-weight-bold","m-auto"],["nz-col",""]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,NU,14,1,"b2c-floating-bar",0),h.qc()),2&e&&(h.Ub(1),h.Mc("ngIf",!t.hideProductList&&!t.previewCart&&!t.showPrsNotice&&t.itemCount>0))},directives:[z.a,p.t,Se.a,P.c,P.a,k.b],styles:[".trade-title[_ngcontent-%COMP%]{padding-left:20px}"]}),Object(o.c)([Object(s.e)()],e.prototype,"isMobile$",void 0),e})();function _U(e,t){if(1&e&&h.mc(0,"span",13),2&e){const e=h.Dc(3);h.Mc("innerHTML",e.prsNoticeModel.prsPopupMessage,h.ed)}}function VU(e,t){if(1&e&&h.mc(0,"span",13),2&e){const e=h.Dc(3);h.Mc("innerHTML",e.errorMessage,h.ed)}}function HU(e,t){if(1&e){const e=h.sc();h.rc(0,"button",14),h.zc("click",(function(){h.dd(e);const t=h.Dc(3);return t.newPrsApplicationAction(t.isAdditionalInfoNeed,t.isSupportingDocNeed)})),h.qd(1,"New PRS Application "),h.qc()}}function $U(e,t){if(1&e){const e=h.sc();h.rc(0,"button",15),h.zc("click",(function(){return h.dd(e),h.Dc(3).redirectToAccountUpdatePrsNumberAction(!1)})),h.qd(1,"Update PPA Number "),h.qc()}}function jU(e,t){if(1&e){const e=h.sc();h.rc(0,"button",16),h.zc("click",(function(){return h.dd(e),h.Dc(3).newPrsApplicationAction(!1,!1)})),h.qd(1," OK "),h.qc()}}function GU(e,t){if(1&e){const e=h.sc();h.rc(0,"button",17),h.zc("click",(function(){return h.dd(e),h.Dc(3).redirectToAccountUpdatePrsNumberAction(!1)})),h.qd(1,"Update PPA Number "),h.qc()}}function WU(e,t){if(1&e&&(h.rc(0,"div"),h.od(1,_U,1,1,"span",6),h.od(2,VU,1,1,"span",6),h.rc(3,"div",7),h.rc(4,"div",8),h.od(5,HU,2,0,"button",9),h.od(6,$U,2,0,"button",10),h.od(7,jU,2,0,"button",11),h.od(8,GU,2,0,"button",12),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",e.prsNoticeModel),h.Ub(1),h.Mc("ngIf",e.errorMessage),h.Ub(3),h.Mc("ngIf",e.prsNoticeModel&&e.prsNoticeModel.isFirstTimePrs&&(null==e.prsNoticeModel?null:e.prsNoticeModel.updatePpaNumber)),h.Ub(1),h.Mc("ngIf",e.prsNoticeModel&&(null==e.prsNoticeModel?null:e.prsNoticeModel.updatePpaNumber)),h.Ub(1),h.Mc("ngIf",e.prsNoticeModel&&e.prsNoticeModel.isFirstTimePrs&&!(null!=e.prsNoticeModel&&e.prsNoticeModel.updatePpaNumber)),h.Ub(1),h.Mc("ngIf",e.errorMessage)}}function YU(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",3),h.zc("nzVisibleChange",(function(t){return h.dd(e),h.Dc().showPrsNotice=t}))("nzOnCancel",(function(){return h.dd(e),h.Dc().closePrsNoticeModalAction()})),h.rc(1,"h3"),h.mc(2,"i",4),h.qd(3,"Notices"),h.qc(),h.od(4,WU,9,6,"div",5),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Mc("nzVisible",e.showPrsNotice)("nzFooter",null),h.Ub(4),h.Mc("ngIf",!e.isLoading)("ngIfElse",t)}}function KU(e,t){if(1&e&&h.mc(0,"span",13),2&e){const e=h.Dc(3);h.Mc("innerHTML",e.prsNoticeModel.prsPopupMessage,h.ed)}}function XU(e,t){if(1&e&&h.mc(0,"span",13),2&e){const e=h.Dc(3);h.Mc("innerHTML",e.errorMessage,h.ed)}}function QU(e,t){if(1&e&&(h.rc(0,"div",23),h.od(1,KU,1,1,"span",6),h.od(2,XU,1,1,"span",6),h.qc()),2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngIf",e.prsNoticeModel),h.Ub(1),h.Mc("ngIf",e.errorMessage)}}function ZU(e,t){if(1&e){const e=h.sc();h.rc(0,"button",28),h.zc("click",(function(){h.dd(e);const t=h.Dc(3);return t.fundConstant.NEW_PRS_APPLICATION_ENABLED_MANAGER_CODES.includes(t.managerCode)?t.newPrsApplicationAction(t.isAdditionalInfoNeed,t.isSupportingDocNeed):t.newPrsApplicationAction(!1,!1)})),h.qd(1,"New PRS Application "),h.qc()}}function JU(e,t){if(1&e){const e=h.sc();h.rc(0,"button",29),h.zc("click",(function(){return h.dd(e),h.Dc(3).redirectToAccountUpdatePrsNumberAction(!0)})),h.qd(1," Update PPA Number "),h.qc()}}function ex(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"button",28),h.zc("click",(function(){h.dd(e);const t=h.Dc(3);return t.fundConstant.NEW_PRS_APPLICATION_ENABLED_MANAGER_CODES.includes(t.managerCode)?t.newPrsApplicationAction(t.isAdditionalInfoNeed,t.isSupportingDocNeed):t.newPrsApplicationAction(!1,!1)})),h.qd(2," Ok "),h.qc(),h.qc()}}function tx(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"button",30),h.zc("click",(function(){return h.dd(e),h.Dc(3).redirectToAccountUpdatePrsNumberAction(!0)})),h.qd(2,"Update PPA Number "),h.qc(),h.qc()}}function nx(e,t){if(1&e&&(h.rc(0,"b2c-floating-bar",24),h.rc(1,"div"),h.od(2,ZU,2,0,"button",25),h.od(3,JU,2,0,"button",26),h.qc(),h.od(4,ex,3,0,"div",27),h.od(5,tx,3,0,"div",27),h.qc()),2&e){const e=h.Dc(2);h.Ub(2),h.Mc("ngIf",e.prsNoticeModel&&e.prsNoticeModel.isFirstTimePrs&&(null==e.prsNoticeModel?null:e.prsNoticeModel.updatePpaNumber)),h.Ub(1),h.Mc("ngIf",e.prsNoticeModel&&(null==e.prsNoticeModel?null:e.prsNoticeModel.updatePpaNumber)),h.Ub(1),h.Mc("ngIf",e.prsNoticeModel&&e.prsNoticeModel.isFirstTimePrs&&!(null!=e.prsNoticeModel&&e.prsNoticeModel.updatePpaNumber)),h.Ub(1),h.Mc("ngIf",e.errorMessage)}}function ix(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-mobile-drawer",18),h.zc("showChange",(function(t){return h.dd(e),h.Dc().showPrsNotice=t}))("showChange",(function(){return h.dd(e),h.Dc().closePrsNoticeModalAction()})),h.rc(1,"nz-row",19),h.rc(2,"nz-col",20),h.rc(3,"h3"),h.mc(4,"i",4),h.qd(5,"Notices"),h.qc(),h.qc(),h.qc(),h.od(6,QU,3,2,"div",21),h.od(7,nx,6,4,"b2c-floating-bar",22),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(6);h.Mc("show",e.showPrsNotice)("actionText",null)("hideButtons",!0)("height",400),h.Ub(6),h.Mc("ngIf",!e.isLoading)("ngIfElse",t),h.Ub(1),h.Mc("ngIf",!e.isLoading)}}function cx(e,t){if(1&e&&h.mc(0,"nz-skeleton",31),2&e){const e=h.Dc();h.Mc("nzLoading",e.isLoading)("nzActive",!0)}}let ox=(()=>{class e{constructor(e,t,n){this.transactionRestService=e,this.subHandlingService=t,this.prsRestService=n,this.newPrsApplication=new h.s,this.redirectToAccountUpdatePrsNumber=new h.s,this.closePrsNoticeModal=new h.s,this.accountInfoValidation=new h.s,this.requiredField=new h.s,this.prsAccountInfo={},this.fundConstant=M.c}set showPrsNotice(e){this._showPrsNotice=e,this._showPrsNotice&&this.getPrsAccountInfoAndRequiredField()}get showPrsNotice(){return this._showPrsNotice}ngOnInit(){}ngOnChanges(e){}newPrsApplicationAction(e,t){this.newPrsApplication.emit({isAdditionalInfoNeed:e,isSupportingDocNeed:t}),this.closePrsNoticeModal.emit(!0)}closePrsNotice(){this.closePrsNoticeModal.emit(!0)}redirectToAccountUpdatePrsNumberAction(e){this.closePrsNoticeModal.emit(!1),e&&M.c.NEW_PRS_APPLICATION_ENABLED_MANAGER_CODES.includes(this.managerCode)&&this.newPrsApplication.emit({isAdditionalInfoNeed:this.isAdditionalInfoNeed,isSupportingDocNeed:this.isSupportingDocNeed}
5),this.redirectToAccountUpdatePrsNumber.emit(!0)}closePrsNoticeModalAction(){this.closePrsNoticeModal.emit(!1)}checkSpecificFundHouseAndAccountInfo(){var e,t,n,i,c,o;this.isSpecificFundHouse=M.c.NEW_PRS_APPLICATION_ENABLED_MANAGER_CODES.includes(this.managerCode),this.isAdditionalInfoNeed=""===(null===(e=this.prsAccountInfo)||void 0===e?void 0:e.motherMaidenName)||""===(null===(t=this.prsAccountInfo)||void 0===t?void 0:t.maritalStatus)||""===(null===(n=this.prsAccountInfo)||void 0===n?void 0:n.monthlyHouseholdIncome)||""===(null===(i=this.prsAccountInfo)||void 0===i?void 0:i.natureOccupation)||""===(null===(c=this.prsAccountInfo)||void 0===c?void 0:c.employmentStatus),this.isSupportingDocNeed="Y"===(null===(o=this.prsAccountInfo)||void 0===o?void 0:o.isRequiredSupportingDoc),console.log("specific?",this.isSpecificFundHouse),console.log("add info need?",this.isAdditionalInfoNeed),console.log("sup doc need?",this.isSupportingDocNeed),this.getRequiredField()}getPrsAccountInfoAndRequiredField(){this.isLoading=!0,this.subHandlingService.once(this.prsRestService.getPrsAdditionalInformation(this.refno).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.prsAccountInfo=Object(g.a)(e.data),this.checkSpecificFundHouseAndAccountInfo())})))}getRequiredField(){let e=[];e.push(this.managerCode),this.subHandlingService.once(this.prsRestService.getRequiredField(this.refno,e).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.requiredField.emit(e.data),e.data.length>0&&(this.isAdditionalInfoNeed=!0),this.accountInfoValidation.emit({isAdditionalInfoReady:!this.isAdditionalInfoNeed,isSupportingDocReady:!this.isSupportingDocNeed}))})))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(T.a),h.lc(l.a),h.lc(St.a))},e.\u0275cmp=h.fc({type:e,selectors:[["update-prs-modal"]],inputs:{refno:"refno",sedolnumber:"sedolnumber",managerCode:"managerCode",prsNoticeModel:"prsNoticeModel",errorMessage:"errorMessage",showPrsNotice:"showPrsNotice"},outputs:{newPrsApplication:"newPrsApplication",redirectToAccountUpdatePrsNumber:"redirectToAccountUpdatePrsNumber",closePrsNoticeModal:"closePrsNoticeModal",accountInfoValidation:"accountInfoValidation",requiredField:"requiredField"},features:[h.Tb([l.a]),h.Sb],decls:7,vars:6,consts:[["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzVisibleChange","nzOnCancel",4,"ngIf"],[3,"show","actionText","hideButtons","height","showChange",4,"ngIf"],["loadingTemplate",""],["nzWrapClassName","vertical-center-modal",3,"nzVisible","nzFooter","nzVisibleChange","nzOnCancel"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"mr-2","text-warning"],[4,"ngIf","ngIfElse"],["class","font-semibold m-b-md",3,"innerHTML",4,"ngIf"],["nz-row","","nzType","flex","nzJustify","end",1,"mt-4"],[1,"text-right"],["class","mx-1","nz-button","","nzType","outline",3,"click",4,"ngIf"],["nz-button","","nzType","primary",3,"click",4,"ngIf"],["nz-button","","nzType","outline","class","rounded-calertircle ml-2",3,"click",4,"ngIf"],["class","rounded-calertircle","nz-button","","nzType","primary",3,"click",4,"ngIf"],[1,"font-semibold","m-b-md",3,"innerHTML"],["nz-button","","nzType","outline",1,"mx-1",3,"click"],["nz-button","","nzType","primary",3,"click"],["nz-button","","nzType","outline",1,"rounded-calertircle","ml-2",3,"click"],["nz-button","","nzType","primary",1,"rounded-calertircle",3,"click"],[3,"show","actionText","hideButtons","height","showChange"],["nzType","flex"],["nzSpan","20"],["class","pb-6",4,"ngIf","ngIfElse"],["nz-row","",4,"ngIf"],[1,"pb-6"],["nz-row",""],["class","my-2","nz-button","","nzBlock","","nzType","outline",3,"click",4,"ngIf"],["nz-button","","nzBlock","","nzType","primary","class","my-2",3,"click",4,"ngIf"],[4,"ngIf"],["nz-button","","nzBlock","","nzType","outline",1,"my-2",3,"click"],["nz-button","","nzBlock","","nzType","primary",1,"my-2",3,"click"],["nzBlock","","nz-button","","nzType","primary",1,"rounded-calertircle","my-2",3,"click"],[3,"nzLoading","nzActive"]],template:function(e,t){1&e&&(h.rc(0,"app-web-scaffold"),h.od(1,YU,5,4,"nz-modal",0),h.Ec(2,"async"),h.qc(),h.od(3,ix,8,7,"b2c-mobile-drawer",1),h.Ec(4,"async"),h.od(5,cx,1,2,"ng-template",null,2,h.pd)),2&e&&(h.Ub(1),h.Mc("ngIf",!h.Fc(2,2,t.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(4,4,t.isMobile$)))},directives:[B.a,p.t,j.a,k.b,P.c,_.a,G.a,P.a,Se.a,W.a],pipes:[p.b],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function sx(e,t){1&e&&(h.rc(0,"div",7),h.rc(1,"p"),h.qd(2,"We noticed this is your "),h.rc(3,"b"),h.qd(4,"FIRST TIME"),h.qc(),h.qd(5," placing a PRS purchase order with this PRS Provider. Please proceed to place your PRS purchase order "),h.rc(6,"b"),h.qd(7,"without submitting any forms"),h.qc(),h.qd(8," via "),h.rc(9,"b"),h.qd(10,"FSMOne Mobile Website"),h.qc(),h.qd(11," or "),h.rc(12,"b"),h.qd(13,"Mobile App"),h.qc(),h.qd(14,"."),h.qc(),h.rc(15,"p"),h.qd(16,"You may click "),h.rc(17,"a",8),h.rc(18,"b",9),h.qd(19,"HERE"),h.qc(),h.qc(),h.qd(20," to follow the steps to place a PRS purchase order."),h.qc(),h.qc())}function ax(e,t){if(1&e&&h.qd(0),2&e){const e=h.Dc();h.sd("\n",e.errorMsg,"\n")}}let lx=(()=>{class e{constructor(){this.onClose=new h.s}ngOnInit(){}onCloseModal(){this.onClose.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=h.fc({type:e,selectors:[["app-prs-specific-fund-houses-disable-notice-modal"]],inputs:{showDisablePrsNotice:"showDisablePrsNotice",errorMsg:"errorMsg"},outputs:{onClose:"onClose"},decls:11,vars:4,consts:[["nzWrapClassName","vertical-center-modal",3,"nz
5Visible","nzFooter","nzOnCancel"],[1,"px-3"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"mr-2","text-warning"],["class","font-semibold m-b-md",4,"ngIf","ngIfElse"],[1,"text-right"],["nz-button","","nzType","outline",1,"mx-1",3,"click"],["errorMsgTemplate",""],[1,"font-semibold","m-b-md"],["href","https://www.fsmone.com.my/ext/article/pdf/getting_started_mar_2023/Guide_for_PRS_Buy(Mobile_Apps).pdf"],[1,"text-loss"]],template:function(e,t){if(1&e&&(h.rc(0,"nz-modal",0),h.zc("nzOnCancel",(function(){return t.onCloseModal()})),h.rc(1,"div",1),h.rc(2,"h3"),h.mc(3,"i",2),h.qd(4,"Notices"),h.qc(),h.od(5,sx,21,0,"div",3),h.rc(6,"div",4),h.rc(7,"button",5),h.zc("click",(function(){return t.onCloseModal()})),h.qd(8,"OK"),h.qc(),h.qc(),h.qc(),h.qc(),h.od(9,ax,1,1,"ng-template",null,6,h.pd)),2&e){const e=h.ad(10);h.Mc("nzVisible",t.showDisablePrsNotice)("nzFooter",null),h.Ub(5),h.Mc("ngIf",!t.errorMsg)("ngIfElse",e)}},directives:[j.a,k.b,p.t,_.a],encapsulation:2}),e})();const rx=["tradeProductInfo"];function dx(e,t){if(1&e&&(h.rc(0,"nz-spin",30),h.mc(1,"nz-skeleton",31),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzLoading",e.isLoading)}}function ux(e,t){1&e&&h.mc(0,"investment-account-selector")}function hx(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-option",32),h.rc(1,"div",33),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc().onChangeFundFilterOption(null==n?null:n.value)})),h.qd(2),h.qc(),h.qc()}if(2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value),h.Ub(2),h.sd(" ",null==e?null:e.label," ")}}function px(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-option",36),h.rc(1,"div",33),h.zc("click",(function(){h.dd(e);const n=t.$implicit;return h.Dc(2).onWatchlistSelected(null==n?null:n.listId,null==n?null:n.value)})),h.qd(2),h.qc(),h.qc()}if(2&e){const e=t.$implicit;h.Mc("nzValue",null==e?null:e.listId)("nzLabel",null==e?null:e.label),h.Ub(2),h.sd(" ",null==e?null:e.label," ")}}function mx(e,t){if(1&e&&(h.rc(0,"nz-option-group",34),h.od(1,px,3,3,"nz-option",35),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngForOf",e.userWatchlists)}}function fx(e,t){if(1&e&&h.mc(0,"nz-option",39),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}const gx=function(e){return{"mt-2":e}};function bx(e,t){if(1&e){const e=h.sc();h.rc(0,"div",5),h.rc(1,"nz-select",37),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().onChangeFundManagerOption(t)}))("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedFundManager=t}))("nzOnSearch",(function(t){return h.dd(e),h.Dc().onSearchFundManager(t)})),h.Ec(2,"async"),h.od(3,fx,1,2,"nz-option",38),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("ngModel",e.selectedFundManager)("ngClass",h.Sc(5,gx,h.Fc(2,3,e.isMobile$))),h.Ub(2),h.Mc("ngForOf",e.fundManagerList)}}function Sx(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-auto-option",40),h.zc("click",(function(){h.dd(e);const n=t.$implicit,i=h.Dc();return i.isAddedToCart(n.sedolnumber)?i.closeFundFillDetails():i.onFundSelected(n.sedolnumber,n.paymentMethod)})),h.qd(1),h.qc()}if(2&e){const e=t.$implicit;h.Mc("nzValue",e.fundName),h.Ub(1),h.sd(" ",e.fundName," ")}}function yx(e,t){1&e&&(h.rc(0,"nz-auto-option",41),h.mc(1,"em",42),h.qd(2," Loading Funds... "),h.qc())}function vx(e,t){1&e&&h.mc(0,"i",43)}function Mx(e,t){if(1&e){const e=h.sc();h.rc(0,"i",44),h.zc("click",(function(){return h.dd(e),h.Dc().onClearInput()})),h.qc()}}const Cx=function(e,t){return{"mb-6 pb-3":e,"infinite-container mt-2":t}};function qx(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",45),h.Ec(2,"async"),h.rc(3,"app-trade-product-info",46),h.zc("selectedSedolnumberAdd",(function(t){return h.dd(e),h.Dc().onFundSelected(t.sedolnumber,t.paymentMethod)})),h.qc(),h.rc(4,"div",16),h.zc("visibilityChange",(function(t){return h.dd(e),h.Dc().onVisibilityChanged(t)})),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(9,Cx,h.Fc(2,7,e.isMobile$),(null==e.fundTradeList?null:e.fundTradeList.length)>=7)),h.Ub(2),h.Mc("header1",e.selectedFundFilter===e.transactionConstant.HOLDING?"Min. Subsequent Amt.":"Min. Investment Amt.")("header2","Risk Rating")("showAddToCartBtn",!0)("tradeProductInfoList",e.fundTradeList)("isLoadingProductInfo",e.isLoadingProductInfo),h.Ub(1),h.Mc("intersectionDebounce",0)}}function Tx(e,t){1&e&&h.mc(0,"em",47)}function wx(e,t){if(1&e&&h.mc(0,"img",48),2&e){const e=h.Dc();h.Mc("src",e.transactionImgPath+"filterIcon.svg",h.gd)("alt","filter icon")}}function zx(e,t){if(1&e){const e=h.sc();h.rc(0,"buy-fund-fill-detail",51),h.zc("closeFundFillDetails",(function(){return h.dd(e),h.Dc(2).closeFundFillDetails()}))("closeFundFillDetailsAsPassportExpiry",(function(){return h.dd(e),h.Dc(2).showPassportExpiryNotice()}))("openSiNotice",(function(){return h.dd(e),h.Dc(2).openSiNotice()}))("closeSiNotice",(function(){return h.dd(e),h.Dc(2).closeSiNotice()})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc(2);h.Mc("isNewPrsApplication",e.isNewPrsApplication)("isSupportingDocNeed",e.isSupportingDocNeed)("isAdditionalInfoNeed",e.isAdditionalInfoNeed)("fromEdit",e.fromEdit)("refno",e.refno)("selectedFund",e.selectedFund)("selectedCart",e.selectedCart)("currentCartList",h.Fc(1,14,e.cartList$))("selectedSedol",e.selectedSedol)("showAddFundDetailsModal",e.showAddFundDetailsModal)("holdingPaymentMethod",e.holdingPaymentMethod)("isAdditionalInfoReady",e.isAdditionalInfoReady)("isSupportingDocReady",e.isSupportingDocReady)("requiredField",e.requiredField)}}const Dx=function(){return{}},Px=function(){return{position:"fixed",top:"0",left:"0",width:"100%","z-index":"1050","padding-top":"80px"}};function Ix(e,t){if(1&e&&(h.rc(0,"div",49),h.Ec(1,"async"),h.od(2,zx,2,16,"buy-fund-fill-detail",50),h.qc()),2&e){const e=h.Dc();h.Mc("ngStyle",h.Fc(1,2,e.isMobile$)?h.Rc(4,Dx):h.Rc(5,Px)),h.Ub(2),h.Mc("ngIf",e.selectedCart&&e.selectedFund&&e.showAddFundDetailsModal)}}function kx(e,t){if(1&e){const e=h.sc();h.rc(0,"update-prs-modal",52),h.zc("closePrsNoticeModal",(function(t){return h.dd(e),h.Dc().closePrsNoticeModal(t)}))("newPrsApplication",(function(t){return h.dd(e),h.Dc().newPrsApplication(t.isAdditionalInfoNeed,t.isSupportingDocNeed)}))("redirectToAccountUpdatePrsNumber",(function(){return h.dd(e),h.Dc().redirectToAccountUpdatePrsNumber()}))("accountInfoValidation",(function(t){return h.dd(e),h.Dc().accountInfoValidation(t.isAdditionalInfoReady,t.isSupportingDocReady)}))("requiredField",(function(t){return h.dd(e),h.Dc().getRequiredField(t)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("refno",e.refno)("prsNoticeModel",e.prsNoticeModel)("errorMessage",e.prsModalErrorMessage)("sedolnumber",null==e.selectedFund?null:e.selectedFund.sedolnumber)("showPrsNotice",e.showPrsNotice)("managerCode",e.managerCode)}}function Ax(e,t){if(1&e){const e=h.sc();h.rc(0,"buy-order-cart-sider",53),h.zc("proceedEdit",(function(t){return h.dd(e),h.Dc().checkProceedEdit(t)}))("mobileBack",(function(){return h.dd(e),h.Dc().onAppBarBack()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("mobilePreviewCart",!0)("selectedList",e.selectedList)("checkoutList",e.checkoutList)}}function Ex(e,t){if(1&e){const e=h.sc();h.rc(0,"app-prs-specific-fund-houses-disable-notice-modal",54),h.zc("onClose",(function(t){return h.dd(e),h.Dc().closePrsDisableNoticeModal(t)})),h.qc()}if(2&e){const e=h.Dc();h.Mc("showDisablePrsNotice",e.showDisablePrsNotice)("errorMsg",e.disablePrsNoticeErrorMessage)}}const Fx=function(e){return{"d-none":e}},Ox=function(e,t){return{"bg-lighter border-top":e,"d-none":t}},Ux=function(e){return{"bg-white shadow w-100 container":e}},xx=function(e){return{"pt-3":e}},Lx=function(e){return{"pt-2":e}};let Rx=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l){this.subHandlingService=e,this.transactionRestService=t,this.store=n,this.cdRef=i,this.transactionService=c,this.activatedRoute=o,this.fundRestService=s,this.accountService=a,this.watchlistRestService=l,this.selectedFundOutput=new h.s,this.showAddFundDetailsModal=!1,this.showJpyUnavailableModal=!1,this.selectedFund={},this.showPrsNotice=!1,this.showUpdatePPA=!1,this.checkoutList=[],this.selectedList=[],this.mobileFillDetail=!1,this.defaultTitle="Funds-Buy",this.appBarTitle=this.defaultTitle,this.previewCartTitle="Preview Cart",this.cart=[],this.isLoading=!1,this.show
5FundManager=!1,this.fundFilterOption=U.a.FUND_FILTER_CATEGORY,this.fundTradeList=[],this.allFundList=[],this.selectedFundManager=null,this.page=2,this.isSelectPrs=!1,this.productList=["UT"],this.userWatchlists=[],this.isLoadingProductInfo=!1,this.isFirstLoad=!1,this.prsFundManagerList=[],this.requiredField=[],this.selectedAuthenticatedDisplay=null,this.showDisablePrsNotice=!1,this.passportNoticeVisible=!1,this.transactionConstant=U.a,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH}ngOnInit(){this.refno=this.store.selectSnapshot(f.a.getPrimaryAccount).refno,this.getAllWatchListByAcctId(),this.transactionService.removeBuyOrderPlacedFund(),this.store.dispatch(new u.V(d.d.BUY)),this.form=new oe.k({keyword:new oe.h("")}),this.getFundManagersAndFundsTotalList(),this.subscribeRefnoChange(),this.subscribeIsMobile(),this.subscribeKeyword(),this.subscribeParam(),this.findCurrentPrsHoldings(),this.subscribeSelectedAuthenticatedDisplayChange()}onChangeFundFilterOption(e,t){this.keyword.patchValue(null),this.allFundList=[],this.allFundListTemp=[],this.selectedFundFilter=e,this.selectedFundFilter===U.a.FUND_HOUSE?this.showFundManager=!0:(this.selectedFundFilter===U.a.ALL?(this.isFirstLoad=!0,this.getAllFundList(this.selectedFundFilter,"",0,20)):this.getFundsBuyList(this.selectedFundFilter,"",t),this.showFundManager=!1)}onChangeFundManagerOption(e){this.selectedFundManager=e,this.getFundsBuyList(this.selectedFundFilter,this.selectedFundManager)}getFundsBuyList(e,t,n){this.refno&&(this.isLoading=!0,this.fundList=[],this.subHandlingService.once(this.transactionRestService.getFundsBuyList(e,t,this.refno,n).pipe(Object(E.a)(t=>{if(t.status===M.a.RESPONSE_SUCCESS){if(t){const n=t.data;e===U.a.HOLDING?n.forEach(e=>{for(let t of Object.keys(e.holdingAvailable)){e.paymentMethod=t;let n=Object(g.a)(e);this.fundList.push(n)}}):this.fundList=n,this.markRecommendedFundList(),this.fundTradeList=this.fundList.map(e=>this.mapTradeProductInfo(e)),e!==U.a.ALL&&(this.allFundList=Object(g.a)(this.fundList),this.allFundList.forEach(e=>{Object.keys(e.holdingAvailable).length>1&&(e.paymentMethod===U.a.CHEQUE.toLowerCase()?e.fundName+=" ("+U.a.CASH_INVESTMENTS+")":e.paymentMethod===U.a.EPF_FUNDS.toUpperCase()||e.paymentMethod===U.a.PRS_FUND.toUpperCase()?e.fundName+=" ("+e.paymentMethod+" Investments)":e.fundName+=" ("+e.paymentMethod+")")}),this.allFundListTemp=Object(g.a)(this.allFundList))}return this.isLoading=!1,this.fundTradeList}}))))}findCurrentPrsHoldings(){this.refno&&this.subHandlingService.once(this.transactionRestService.getFundsBuyList(U.a.HOLDING,"",this.refno).pipe(Object(S.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(e.data.forEach(e=>{"PRS"!=e.fundType&&"PRS_GOV"!=e.fundType||this.prsFundManagerList.push(e.managercode)}),this.transactionService.updateBuyUtPrsFundManagerList({refno:this.refno,holdingFundManagerList:this.prsFundManagerList}))})))}mapTradeProductInfo(e){var t;return{paymentMethod:e.paymentMethod,sedolnumber:e.sedolnumber,fundInfoName:e.fundName,minInvestmentAmount:e.userExistingFund?e.paymentMethod===U.a.EPF_FUNDS.toUpperCase()?e.minSubseqNonCash:e.minimumsubsequence:e.minimuminitialinvest,minInvestmentAmountCurrency:e.fundCurrencyCode,riskRating:e.fsmRiskRating,addedToCart:!!(null===(t=this.cart)||void 0===t?void 0:t.find(t=>t.sedolNumber===e.sedolnumber)),profitLossAmount:null,profitLossCurrency:null,profitLossPercentage:null,additionalInfo:e.fundType,syariahEpf:e.syariahFlag,epfApproved:e.cpfapproved,recommendedFund:e.recommendedFund,fundType:e.fundType,paymentMethodForCheck:e.paymentMethod}}getAllFundList(e,t,n,i){this.refno&&(this.isFirstLoad?this.isLoading=!0:this.isLoadingProductInfo=!0,this.subHandlingService.once(this.transactionRestService.getAllFundList(e,t,this.refno,n,i).pipe(Object(y.a)(e=>{this.isFirstLoad=!1,this.isLoading=!1,this.isLoadingProductInfo=!1,e.status===M.a.RESPONSE_SUCCESS&&(e.data.forEach(e=>{this.allFundList.push(e)}),this.allFundListTemp=Object(g.a)(this.allFundList),this.fundList=Object(g.a)(this.allFundListTemp),this.fundTradeList=this.fundList.map(e=>this.mapTradeProductInfo(e)))},e=>
5console.log(e)))))}onSearchFundName(e){this.selectedFundFilter===U.a.ALL?this.keyword.patchValue(e):this.allFundList=e?Object(AU.b)(this.allFundListTemp,e,"fundName"):this.allFundListTemp}onSearchFundManager(e){this.fundManagerList=e?Object(AU.b)(this.fundManagerListTemp,e,"label"):this.fundManagerListTemp}onFundSelected(e,t){this.refno&&this.subHandlingService.once(this.fundRestService.getFundBuyDetailInfo(this.refno,e).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(this.selectedFund=null==e?void 0:e.data,e.data.redemptionCharge&&(this.selectedFund.redemptionFee=e.data.redemptionCharge),this.keyword.reset(),this.keyword.updateValueAndValidity(),this.selectedFundAction(this.selectedFund,t))})))}refreshProductList(){var e;this.fundTradeList=null===(e=this.fundList)||void 0===e?void 0:e.map(e=>this.mapTradeProductInfo(e)).sort((e,t)=>e.fundInfoName>t.fundInfoName?1:t.fundInfoName>e.fundInfoName?-1:0)}subscribeCartList(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.cart=e}),Object(y.a)(()=>this.refreshProductList())))}selectedFundAction(e,t){const n=null==e?void 0:e.fundCurrencyCode;if(n===U.a.PAYMENT_CURRENCY_JPY){if(!this.store.selectSnapshot(a.a.isWhitelistLoaded))return void this.subHandlingService.once(this.store.select(a.a.isWhitelistLoaded).pipe(Object(aa.a)(e=>!!e),Object(y.a)(()=>{this.store.selectSnapshot(a.a.isJpyFundRestricted(n))?this.showJpyUnavailableModal=!0:this.proceedSelectedFundAction(e,t)})));if(this.store.selectSnapshot(a.a.isJpyFundRestricted(n)))return void(this.showJpyUnavailableModal=!0)}this.proceedSelectedFundAction(e,t)}proceedSelectedFundAction(e,t){var n;this.selectedFund=e,this.managerCode=null==e?void 0:e.managercode,this.showDisablePrsNotice=!1,(null===(n=this.selectedFund)||void 0===n?void 0:n.fundType)===U.a.PRS_FUND.toUpperCase()?(this.isSelectPrs=!0,M.c.NEW_PRS_APPLICATION_ENABLED_MANAGER_CODES.includes(null==e?void 0:e.managercode)&&!this.isMobile?this.getPrsFirstBuyAvailableStatus(e):this.getPrsNotice(e)):(this.selectedCart={investAmount:e.userExistingFund?null==e?void 0:e.minimumsubsequence:null==e?void 0:e.minimuminitialinvest,paymentMethod:U.a.CHEQUE_FPX},this.isMobile&&(this.mobileFillDetail=!0),this.showAddFundDetailsModal=!0),this.holdingPaymentMethod=Object(g.a)(t)}onCloseJpyUnavailableModal(){this.showJpyUnavailableModal=!1}closeFundFillDetails(){this.showAddFundDetailsModal=!1,this.fromEdit=!1,this.mobileFillDetail=!1}newPrsApplication(e,t){this.isNewPrsApplication=e||t,this.isAdditionalInfoNeed=e,this.isSupportingDocNeed=t,this.showPrsNotice=!1,this.isMobile&&(this.mobileFillDetail=!0),this.showAddFundDetailsModal=!0}redirectToAccountUpdatePrsNumber(){this.showUpdatePPA=!0}closePrsNoticeModal(e){this.showPrsNotice=!1,this.showAddFundDetailsModal=e}closeUpdatePPAModal(){this.showUpdatePPA=!1,this.showAddFundDetailsModal=!1}onPPAUpdated(){this.showUpdatePPA=!1,this.isMobile&&(this.mobileFillDetail=!0),this.showAddFundDetailsModal=!0}checkProceedEdit(e){var t;(null===(t=null==e?void 0:e.fundInfo)||void 0===t?void 0:t.redemptionCharge)&&(this.selectedFund.redemptionFee=e.fundInfo.redemptionCharge),this.selectedFund=e.fundInfo,this.selectedCart=e,this.selectedSedol=e.sedolNumber,this.fromEdit=!0,this.mobileFillDetail=!0,this.previewCart=!1,this.showAddFundDetailsModal=!0}viewCart(){this.previewCart=!0,this.appBarTitle=this.previewCartTitle}onAppBarBack(){this.mobileFillDetail=!1,this.previewCart=!1,this.campaignCodeInitValue=""}isAddedToCart(e){var t,n;return"addedToCart"===(null===(n=null===(t=this.cart)||void 0===t?void 0:t.find(t=>t.sedolNumber===e))||void 0===n?void 0:n.orderStatus)}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{e&&(this.refno=e),this.cdRef.markForCheck(),this.cartList$=this.store.select(u.l.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeCartList(),this.selectedFundFilter=U.a.ALL,this.allFundList=[],this.allFundListTemp=[],this.getSelectedAcctBuyListing(),this.getAllFundList(U.a.ALL,"",0,20),this.fundFilterOption=U.a.FUND_FILTER_CATEGORY,this.accountService.isBene(this.refno)&&(this.fundFilterOption=this.fundFilterOption.filter(e=>e.value!==U.a.PRS_FUND))})))}subscribeParam(){var e;let t;this.subHandlingService.subscribe(null===(e=this.activatedRoute)||void 0===e?void 0:e.queryParams.pipe(Object(aa.a)(e=>e&&e.sedolnumber||e.refno),Object(S.a)(({sedolnumber:e,refno:n})=>t={refno:n,sedolnumber:e}),Object(y.a)(e=>{e.refno&&this.store.dispatch(new u.N(e.refno))}),Object(E.a)(e=>this.fundRestService.getFundBuyDetailInfo(e.refno?e.refno:this.refno,e.sedolnumber)),Ob
5ject(y.a)(e=>{this.isAddedToCart(e.data.sedolnumber)?this.closeFundFillDetails():this.selectedFundAction(e.data,null)})))}getPrsNotice(e){this.subHandlingService.once(this.transactionRestService.getPrsNotice(this.refno,null==e?void 0:e.sedolnumber).pipe(Object(y.a)(t=>{if(this.selectedCart={investAmount:null==e?void 0:e.minimuminitialinvest,paymentMethod:U.a.CHEQUE_FPX},t.status===M.a.RESPONSE_SUCCESS&&(this.prsNoticeModel=t.data,!this.prsNoticeModel.prsPopupMessage))return this.showAddFundDetailsModal=!0,void(this.isMobile&&(this.mobileFillDetail=!0));t.status===M.a.RESPONSE_FAILED&&(this.prsModalErrorMessage=t.errorMessage),this.showPrsNotice=!0})))}getPrsFirstBuyAvailableStatus(e){this.subHandlingService.once(this.transactionRestService.getPrsFirstBuyAvailableStatus(this.refno,null==e?void 0:e.sedolnumber).pipe(Object(y.a)(t=>{t.status===M.a.RESPONSE_SUCCESS&&(t.data?this.showDisablePrsNotice=!0:this.getPrsNotice(e)),t.status===M.a.RESPONSE_FAILED&&(this.disablePrsNoticeErrorMessage=t.errorMessage,this.showDisablePrsNotice=!0)})))}getSelectedAcctBuyListing(){this.refno&&(this.isFirstLoad=!0,this.isLoading=!0,this.subHandlingService.once(this.transactionRestService.getFundsBuyList(U.a.RECOMMENDED_FUND,"",this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.recommendedFundList=e.data)}))))}markRecommendedFundList(){var e;null===(e=this.recommendedFundList)||void 0===e||e.forEach(e=>{var t;null===(t=this.fundList)||void 0===t||t.forEach(t=>{e.sedolnumber===t.sedolnumber&&(t.recommendedFund=M.a.YES_FLAG)})})}subscribeIsMobile(){this.subHandlingService.subscribe(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e,this.cdRef.markForCheck()})))}loadMore(){!this.keyword.value||this.isLoadingProductInfo||this.isLoadAll||(this.keywordPage+=1,this.searchProductsByKeyword(this.keyword.value)),this.selectedFundFilter!==U.a.ALL||null!==this.keyword.value&&""!==this.keyword.value||(this.getAllFundList(U.a.ALL,"",this.page,10),this.page+=1)}getFundManagersAndFundsTotalList(){this.subHandlingService.once(this.fundRestService.getFundManagersAndFundsTotalList().pipe(Object(S.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e.data&&(this.fundManagerList=e.data.map(e=>({label:e.managername,value:e.managercode})),this.fundManagerListTemp=Object(g.a)(this.fundManagerList))})))}get keyword(){var e;return null===(e=this.form)||void 0===e?void 0:e.get("keyword")}subscribeKeyword(){this.subHandlingService.subscribe(this.keyword.valueChanges.pipe(Object(ce.a)(500),Object(y.a)(e=>{if(e&&!this.allFundList.find(t=>t.sedolnumber===e))return this.isLoadAll=!1,this.allFundList=[],this.keywordPage=0,void this.searchProductsByKeyword(e);this.allFundList=this.allFundListTemp})))}searchProductsByKeyword(e){this.isFirstLoad?this.isSearching=!0:this.isLoadingProductInfo=!0,this.subHandlingService.once(this.transactionRestService.searchProductsByKeyword(this.productList,e,this.keywordPage,10,!0,this.refno).pipe(Object(y.a)(e=>{if(this.isSearching=!1,this.isLoadingProductInfo=!1,e.status!==M.a.RESPONSE_SUCCESS)return;0===e.data.length&&(this.isLoadAll=!0);const t=e.data.map(e=>this.mapFundInfo(e));this.allFundList=[...this.allFundList,...t]})))}mapFundInfo(e){return{sedolnumber:e.productCode,fundName:e.productName}}getAllWatchListByAcctId(){this.userWatchlists=[],this.subHandlingService.once(this.watchlistRestService.findWatchlistByAccountId().pipe(Object(y.a)(e=>{(null==e?void 0:e.status)===M.a.RESPONSE_SUCCESS&&(this.userWatchlists=(null==e?void 0:e.data).map(e=>({label:null==e?void 0:e.listName,value:"fundWatch",listId:null==e?void 0:e.listId})))})))}onWatchlistSelected(e,t){this.listId=e,this.onChangeFundFilterOption(t,e)}onVisibilityChanged(e){this.loadMore()}accountInfoValidation(e,t){this.isAdditionalInfoReady=e,this.isSupportingDocReady=t}goBack(){window.history.back()}getRequiredField(e){this.requiredField=e}subscribeSelectedAuthenticatedDisplayChange(){this.subHandlingService.subscribe(this.selectedAuthenticatedDisplay$.pipe(Object(y.a)(e=>{this.selectedAuthenticatedDisplay=e,this.cdRef.markForCheck()})))}goToAcctBenefitFaq(){Object(pt.a)([M.o.SUPPORT,M.o.FAQ],{faq:"Getting Started",routeFaqId:"6932"})}onClearInput(){this.keyword.patchValue(null)}closePrsDisableNoticeModal(e){this.showDisablePrsNotice=!1}showPassportExpiryNotice(){this.passportNoticeVisible=!0}openSiNotice(){this.keyword.enabled&&this.keyword.disable({emitEvent:!1})}closeSiNotice(){this.keyword.disabled&&this.keyword.enable({emitEvent:!1})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(T.a),h.lc(s.i),h.lc(h.j),h.lc(C.a),h.lc(c.a),h.lc(q.a),h.lc(pm.a),h.lc(Nv.a))},e.\u0275cmp=h.fc({type:e,selectors:[["fund-buy"]],viewQuery:function(e,t){var n;1&e&&h.yd(rx,!0),2&e&&h.Zc(n=h.Ac())&&(t.tradeProductInfo=n.first)},outputs:{selectedFundOutput:"selectedFundOutput"}
5,features:[h.Tb([l.a])],decls:49,vars:67,consts:[["loadingTemplate",""],[3,"ngClass"],[3,"title","back"],[4,"ngIf"],["nz-row","","nzGutter","16",1,"mt-3",3,"ngClass"],["nz-col","","nzXs","24","nzLg","6"],["nzPlaceHolder","Please select",1,"w-100",3,"ngModel","nzLoading","nzSuffixIcon","ngModelChange"],["nzCustomContent","",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],["nzLabel","My Watchlist",4,"ngIf"],["nz-col","","nzXs","24","nzLg","6",4,"ngIf"],["nzXs","24","nz-col","",3,"formGroup","nzLg","ngClass"],[3,"nzSuffix","nzPrefix"],["nz-input","",3,"placeholder","formControl","nzAutocomplete","input"],[3,"nzBackfill"],["auto",""],[3,"nzValue","click",4,"ngFor","ngForOf"],["intersectionObserver","",3,"intersectionDebounce","visibilityChange"],["nzDisabled","","nzCustomContent","",4,"ngIf"],["prefixIconSearch",""],["suffixIconClear",""],[4,"ngIf","ngIfElse"],["prefixIconFilter",""],[3,"ngStyle",4,"ngIf"],[3,"refno","prsNoticeModel","errorMessage","sedolnumber","showPrsNotice","managerCode","closePrsNoticeModal","newPrsApplication","redirectToAccountUpdatePrsNumber","accountInfoValidation","requiredField",4,"ngIf"],[3,"refno","showUpdatePPA","closeUpdatePPAModal","updated","redirectToAccountUpdatePrsNumber"],[3,"mobilePreviewCart","selectedList","checkoutList","proceedEdit","mobileBack",4,"ngIf"],[3,"previewCart","itemCount","hideProductList","showPrsNotice","viewCart"],[3,"showDisablePrsNotice","errorMsg","onClose",4,"ngIf"],[3,"modalVisible","isPopUp","footerFunc","onOkEmit","onUpdateEmit"],[3,"visible","closeModal"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzLoading"],["nzCustomContent","",3,"nzLabel","nzValue"],[3,"click"],["nzLabel","My Watchlist"],["nzCustomContent","",3,"nzValue","nzLabel",4,"ngFor","ngForOf"],["nzCustomContent","",3,"nzValue","nzLabel"],["nzAllowClear","","nzServerSearch","","nzShowSearch","","nzPlaceHolder","Select a fund manager",1,"w-100",3,"ngModel","ngClass","ngModelChange","nzOnSearch"],["class","text-wrap",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],[1,"text-wrap",3,"nzLabel","nzValue"],[3,"nzValue","click"],["nzDisabled","","nzCustomContent",""],["nz-icon","","nzType","loading",1,"loading-icon"],["nz-icon","","nzType","search"],["nz-icon","","nz-tooltip","","nzTheme","fill","nzType","close-circle",1,"ant-input-clear-icon",3,"click"],[1,"pt-2",3,"ngClass"],[3,"header1","header2","showAddToCartBtn","tradeProductInfoList","isLoadingProductInfo","selectedSedolnumberAdd"],["nz-icon","","nzType","search",1,"text-md"],[1,"img-fluid",3,"src","alt"],[3,"ngStyle"],[3,"isNewPrsApplication","isSupportingDocNeed","isAdditionalInfoNeed","fromEdit","refno","selectedFund","selectedCart","currentCartList","selectedSedol","showAddFundDetailsModal","holdingPaymentMethod","isAdditionalInfoReady","isSupportingDocReady","requiredField","closeFundFillDetails","closeFundFillDetailsAsPassportExpiry","openSiNotice","closeSiNotice",4,"ngIf"],[3,"isNewPrsApplication","isSupportingDocNeed","isAdditionalInfoNeed","fromEdit","refno","selectedFund","selectedCart","currentCartList","selectedSedol","showAddFundDetailsModal","holdingPaymentMethod","isAdditionalInfoReady","isSupportingDocReady","requiredField","closeFundFillDetails","closeFundFillDetailsAsPassportExpiry","openSiNotice","closeSiNotice"],[3,"refno","prsNoticeModel","errorMessage","sedolnumber","showPrsNotice","managerCode","closePrsNoticeModal","newPrsApplication","redirectToAccountUpdatePrsNumber","accountInfoValidation","requiredField"],[3,"mobilePreviewCart","selectedList","checkoutList","proceedEdit","mobileBack"],[3,"showDisablePrsNotice","errorMsg","onClose"]],template:function(e,t){if(1&e&&(h.od(0,dx,2,2,"ng-template",null,0,h.pd),h.rc(2,"app-mobile-scaffold"),h.rc(3,"div",1),h.Ec(4,"async"),h.rc(5,"b2c-app-bar-2",2),h.zc("back",(function(){return t.goBack()})),h.qc(),h.qc(),h.qc(),h.rc(6,"div",1),h.Ec(7,"async"),h.Ec(8,"async"),h.rc(9,"app-mobile-scaffold"),h.od(10,ux,1,0,"investment-account-selector",3),h.Ec(11,"async"),h.qc(),h.rc(12,"div",1),h.Ec(13,"async"),h.rc(14,"div",4),h.Ec(15,"async"),h.rc(16,"div",5),h.rc(17,"nz-select",6),h.zc("ngModelChange",(function(e){return t.selectedFundFilter=e})),h.od(18,hx,3,3,"nz-option",7),h.od(19,mx,2,1,"nz-option-group",8),h.qc(),h.qc(),h.od(20,bx,4,7,"div",9),h.rc(21,"div",10),h.Ec(22,"async"),h.rc(23,"nz-input-group",11),h.rc(24,"input",12),h.zc("input",(function(e){return t.onSearchFundName(e.target.value)})),h.qc(),h.qc(),h.rc(25,"nz-autocomplete",13,14),h.od(27,Sx,2,2,"nz-auto-option",15),h.rc(28,"nz-auto-option"),h.rc(29,"div",16),h.zc("visibilityChange",(function(e){return t.onVisibilityChanged(e)})),h.qc(),h.qc(),h.od(30,yx,3,0,"nz-auto-option",17),h.qc(),h.od(31,vx,1,0,"ng-template",null,18,h.pd),h.od(33,Mx,1,0,"ng-template",null,19,h.pd),h.qc(),h.qc(),h.od(35,qx,5,12,"ng-container",20),h.qc(),h.qc(),h.od(36,Tx,1,0,"ng-template",null,18,h.pd),h.od(38,wx,1,2,"ng-template",null,21,h.pd),h.od(40,Ix,3,6,"div",22),h.od(41,kx,1,6,"update-prs-modal",23),h.rc(42,"update-ppa-number-modal",24),h.zc("closeUpdatePPAModal",(function(){return t.closeUpdatePPAModal()}))("updated",(function(){return t.onPPAUpdated()}))("redirectToAccountUpdatePrsNumber",(function(){return t.redirectToAccountUpdatePrsNumber()})),h.qc(),h.od(43,Ax,1,3,"buy-order-cart-sider",25),h.rc(44,"app-transaction-mobile-view-cart-bar",26),h.zc("viewCart",(function(){return t.viewCart()})),h.Ec(45,"async"),h.qc(),h.od(46,Ex,1,2,"app-prs-specific-fund-houses-disable-notice-modal",27),h.rc(47,"passport-expiry-notification",28),h.zc("onOkEmit",(function(){return t.passportNoticeVisible=!1}))("onUpdateEmit",(function(){return t.passportNoticeVisible=!1})),h.qc(),h.rc(48,"app-jpy-fund-unavailable-modal",29),h.zc("closeModal",(function(){return t.onCloseJpyUnavailableModal()})),h.qc()),2&e){const e=h.ad(1),i=h.ad(26),c=h.ad(32),o=h.ad(34),s=h.ad(39);var n;const a=null==(n=h.Fc(45,54,t.cartList$))?null:n.length;h.Ub(3),h.Mc("ngClass",h.Sc(56,Fx,(t.previewCart||t.mobileFillDetail)&&h.Fc(4,40,t.isMobile$))),h.Ub(2),h.Mc("title","Funds-Buy"),h.Ub(1),h.Mc("ngClass",h.Tc(58,Ox,h.Fc(7,42,t.isMobile$),(t.previewCart||t.mobileFillDetail)&&h.Fc(8,44,t.isMobile$))),h.Ub(4),h.Mc("ngIf",h.Fc(11,46,t.isMobile$)),h.Ub(2),h.Mc("ngClass",h.Sc(61,Ux,h.Fc(13,48,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(63,xx,h.Fc(15,50,t.isMobile$)&&!(null!=t.selectedAuthenticatedDisplay&&t.selectedAuthenticatedDisplay.promotionExpiryDate))),h.Ub(3),h.Mc("ngModel",t.selectedFundFilter)("nzLoading",t.isSearching||t.isLoading)("nzSuffixIcon",s),h.Ub(1),h.Mc("ngForOf",t.fundFilterOption),h.Ub(1),h.Mc("ngIf",(null==t.userWatchlists?null:t.userWatchlists.length)>0),h.Ub(1),h.Mc("ngIf",t.showFundManager),h.Ub(1),h.Mc("formGroup",t.form)("nzLg",t.showFundManager?12:18)("ngClass",h.Sc(65,Lx,h.Fc(22,52,t.isMobile$))),h.Ub(2),h.Mc("nzSuffix",o)("nzPrefix",c),h.Ub(1),h.Mc("placeholder","Search all funds")("formControl",t.keyword)("nzAutocomplete",i),h.Ub(1),h.Mc("nzBackfill",!0),h.Ub(2),h.Mc("ngForOf",t.allFundList),h.Ub(2),h.Mc("intersectionDebounce",0),h.Ub(1),h.Mc("ngIf",t.isLoading||t.isLoadingProductInfo),h.Ub(5),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(5),h.Mc("ngIf",t.selectedCart&&t.selectedFund&&t.showAddFundDetailsModal),h.Ub(1),h.Mc("ngIf",t.isSelectPrs),h.Ub(1),h.Mc("refno",t.refno)("showUpdatePPA",t.showU
5pdatePPA),h.Ub(1),h.Mc("ngIf",t.previewCart),h.Ub(1),h.Mc("previewCart",t.previewCart)("itemCount",a)("hideProductList",t.mobileFillDetail)("showPrsNotice",t.showPrsNotice),h.Ub(2),h.Mc("ngIf",t.isSelectPrs&&t.showDisablePrsNotice),h.Ub(1),h.Mc("modalVisible",t.passportNoticeVisible)("isPopUp",!1)("footerFunc",!0),h.Ub(1),h.Mc("visible",t.showJpyUnavailableModal)}},directives:[z.a,p.q,D.a,p.t,P.c,P.a,Xv.d,oe.t,oe.w,p.s,oe.u,oe.l,Pn.c,oe.c,TI.e,Pn.b,oe.i,TI.a,TI.d,aA.a,RU,BU,dt.a,ma.a,Il.a,W.a,ut.a,Xv.a,Xv.c,k.b,xt.e,A.a,p.w,hc,ox,Um,lx],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedAuthenticatedDisplay)],e.prototype,"selectedAuthenticatedDisplay$",void 0),e})();function Nx(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-app-bar-2",20),h.zc("back",(function(){return h.dd(e),h.Dc(2).goBack()})),h.qc()}2&e&&h.Mc("title","Funds - Sell")}function Bx(e,t){if(1&e&&(h.rc(0,"div",18),h.od(1,Nx,1,1,"b2c-app-bar-2",19),h.Ec(2,"async"),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",h.Fc(2,1,e.isMobile$))}}function _x(e,t){if(1&e&&(h.rc(0,"nz-spin",21),h.mc(1,"nz-skeleton",22),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzLoading",e.isLoading)}}function Vx(e,t){1&e&&h.mc(0,"investment-account-selector")}function Hx(e,t){if(1&e&&(h.rc(0,"div",23),h.od(1,Vx,1,0,"investment-account-selector",24),h.Ec(2,"async"),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",h.Fc(2,1,e.isMobile$)&&!e.hideProductList)}}function $x(e,t){if(1&e&&h.mc(0,"nz-option",25),2&e){const e=t.$implicit;h.Mc("nzLabel",e.productNameDisplay)("nzValue",e)("nzDisabled","PRS"===e.paymentMethod||"PRS_GOV"===e.paymentMethod||0===e.availableValue)}}const jx=function(e){return{"infinite-container mt-2":e}};function Gx(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",26),h.rc(2,"app-trade-product-info",27),h.zc("selectedSedolnumberAdd",(function(t){h.dd(e);const n=h.Dc();return n.onShowFillDetails(t.sedolnumber,t.paymentMethod,n.transactionConstant.ADD)}))("sellPrs",(function(){return h.dd(e),h.Dc().onShowSellPrsWarning()})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Sc(6,jx,(null==e.fundTradeList?null:e.fundTradeList.length)>=7)),h.Ub(1),h.Mc("header1","Market Value")("header2","Profit / Loss")("showAddToCartBtn",!0)("showProfitLoss",!0)("tradeProductInfoList",e.fundTradeList)}}function Wx(e,t){1&e&&h.mc(0,"em",28)}function Yx(e,t){if(1&e){const e=h.sc();h.rc(0,"sell-order-cart-sider",29),h.zc("mobileBack",(function(){return h.dd(e),h.Dc().onAppBarBack()})),h.qc()}2&e&&h.Mc("mobilePreviewCart",!0)}function Kx(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",30),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onCloseSellPrsWarning()})),h.mc(1,"i",31),h.rc(2,"h3",32),h.qd(3,"Notices"),h.qc(),h.rc(4,"p"),h.qd(5,"Unable to sell PRS Fund"),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzClosable",!0)("nzFooter",null)("nzVisible",e.showSellPrsWarning)}}const Xx=function(e){return{"text-md":e}};function Qx(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",33),h.zc("nzOnClose",(function(){return h.dd(e),h.Dc().onCloseNoHoldingsDrawer()})),h.rc(1,"nz-row",34),h.rc(2,"nz-col",35),h.mc(3,"i",36),h.qc(),h.rc(4,"nz-col",37),h.rc(5,"h3",38),h.Ec(6,"async"),h.qd(7,"Warning"),h.qc(),h.rc(8,"p"),h.qd(9,"No Available Holdings to Sell"),h.qc(),h.qc(),h.qc(),h.rc(10,"div",39),h.rc(11,"button",40),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseNoHoldingsDrawer()})),h.qd(12,"Done"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",e.showNoHoldingsDrawer)("nzPlacement","bottom")("nzHeight",180),h.Ub(2),h.Mc("nzSpan",2),h.Ub(2),h.Mc("nzSpan",22),h.Ub(1),h.Mc("ngClass",h.Sc(8,Xx,h.Fc(6,6,e.isMobile$)))}}const Zx=function(e,t){return{"shadow px-2":e,"d-none":t}},Jx=function(e){return{"mb-6 py-3":e}},eL=function(e){return{"mt-3":e}};let tL=(()=>{class e{constructor(e,t,n,i,c,o,s){this.subHandlingService=e,this.transactionRestService=t,this.store=n,this.transactionService=i,this.cdRef=c,this.activatedRoute=o,this.router=s,this.selectedFundOutput=new h.s,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.cart=[],this.fundTradeList=[],this.transactionConstant=U.a,this.isUpdate=!1,this.showSellFundFillDetail=!1,this.isMobile=!1,this.hideProductList=!1,this.showCmfFundFillDetail=!1,this.showEpfFundFillDetail=!1,this.isLoading=!1,this.showSellPrsWarning=!1,this.showNoHoldingsDrawer=!1,this.selectedAuthenticatedDisplay=null,this.isMobile=this.store.selectSnapshot(a.a.isMobile)}ngOnInit(){this.store.dispatch(new u.V(d.d.SELL)),this.currentDate=new Date,this.subscribeParam(),this.subscribeRefnoChange(),this.subscribeSelectedAuthenticatedDisplayChange()}mapTradeProductInfo(e){var t;
5return{paymentMethod:e.paymentMethod,sedolnumber:e.productCode,fundInfoName:e.productName,minInvestmentAmount:"MYR"===e.fundCurrencyCode?e.availableValue:e.availableValue/e.fxRate,minInvestmentAmountCurrency:e.fundCurrencyCode,riskRating:"0",addedToCart:!!(null===(t=this.cart)||void 0===t?void 0:t.find(t=>t.sedolNumber===e.productCode&&t.refno===this.refno&&t.sellInfoModel.paymentMethod===e.paymentMethod)),profitLossAmount:"MYR"===e.fundCurrencyCode?e.profitValue:e.profitValueFc,profitLossCurrency:e.fundCurrencyCode,profitLossPercentage:"MYR"===e.fundCurrencyCode?e.profitPercentage.toFixed(2):e.profitPercentageFc.toFixed(2),appliedPromoCode:!1,additionalInfo:e.fundType,isPrs:e.prs,paymentMethodForCheck:e.paymentMethod}}subscribeCartList(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.cart=e,this.cdRef.markForCheck(),this.refreshProductList()})))}refreshProductList(){var e;this.fundTradeList=null===(e=this.fundList)||void 0===e?void 0:e.map(e=>this.mapTradeProductInfo(e)).sort((e,t)=>e.fundInfoName>t.fundInfoName?1:t.fundInfoName>e.fundInfoName?-1:0)}getSellHolding(){this.isLoading=!0,this.subHandlingService.once(this.transactionRestService.getSellHoldingList(this.refno).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(e&&(this.fundList=e.data.sort((e,t)=>e.productName>t.productName?1:t.productName>e.productName?-1:0),this.refreshProductList(),this.fundList.map(e=>{e.productNameDisplay=e.productName}),this.fundList.forEach(e=>{this.fundList.filter(t=>t.productCode===e.productCode).length>1&&(e.productNameDisplay=e.paymentMethod===U.a.CHEQUE.toLowerCase()?e.productName+" ("+U.a.CASH_INVESTMENTS+")":e.paymentMethod===U.a.EPF_FUNDS.toUpperCase()?e.productName+" ("+e.paymentMethod+" Investments)":e.productName+" ("+e.paymentMethod+")")}),this.fundListTemp=Object(g.a)(this.fundList),this.isLoading=!1),this.subscribeParam())},e=>console.log(e))))}onSearchFundName(e){var t,n,i;e?(this.fundList=null===(t=this.fundListTemp)||void 0===t?void 0:t.filter(t=>{var n;return-1!==(null===(n=t.productName)||void 0===n?void 0:n.toLowerCase().indexOf(e.toLowerCase()))}),this.fundTradeList=null===(n=this.fundList)||void 0===n?void 0:n.map(e=>this.mapTradeProductInfo(e))):(this.fundList=this.fundListTemp,this.fundTradeList=null===(i=this.fundList)||void 0===i?void 0:i.map(e=>this.mapTradeProductInfo(e)))}onShowFillDetails(e,t,n){var i,c,o;n===U.a.UPDATE&&(this.isUpdate=!0);for(let s of this.fundList)if(e===s.productCode&&t===s.paymentMethod&&(this.selectedFund=s,this.isMobile$&&0===this.selectedFund.currentValue))return void(this.showNoHoldingsDrawer=!0);"cheque"===(null===(i=this.selectedFund)||void 0===i?void 0:i.paymentMethod)&&((null===(c=this.selectedFund)||void 0===c?void 0:c.cashFund)?this.showCmfFundFillDetail=!0:this.showSellFundFillDetail=!0,this.isMobile&&(this.hideProductList=!0)),(null===(o=this.selectedFund)||void 0===o?void 0:o.paymentMethod)===U.a.EPF_FUNDS.toUpperCase()&&(this.showEpfFundFillDetail=!0,this.isMobile&&(this.hideProductList=!0))}viewCart(){this.hideProductList=!0,this.previewCart=!0}onFundFillDetailClosed(){this.selectedFund=null,this.isUpdate=!1,this.showSellFundFillDetail=!1,this.hideProductList=!1,this.showCmfFundFillDetail=!1,this.showEpfFundFillDetail=!1,this.previewCart=!1}onAppBarBack(){this.previewCart=!1,this.hideProductList=!1}checkExist(e){var t;return(null===(t=this.cart.find(t=>t.sedolNumber===e))||void 0===t?void 0:t.orderStatus)===U.a.ADDED_TO_CART}subscribeRefnoChange(){var e;this.subHandlingService.subscribe(null===(e=this.refno$)||void 0===e?void 0:e.pipe(Object(y.a)(e=>{this.refno=e,this.transactionService.removeSellOrderPlacedFund(this.refno),this.cartList$=this.store.select(u.I.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeCartList(),this.getSellHolding(),this.cdRef.markForCheck()})))}onShowSellPrsWarning(){this.showSellPrsWarning=!0}onCloseSellPrsWarning(){this.showSellPrsWarning=!1}onCloseNoHoldingsDrawer(){this.showNoHoldingsDrawer=!1}subscribeParam(){var e;let t;this.subHandlingService.subscribe(null===(e=this.activatedRoute)||void 0===e?void 0:e.queryParams.pipe(Object(aa.a)(e=>e&&e.sedolnumber||e.refno||e.paymentMethod),Object(S.a)(({sedolnumber:e,refno:n,paymentMethod:i})=>t={refno:n,sedolnumber:e,paymentMethod:i}),Object(y.a)(e=>{e.refno&&this.store.dispatch(new u.N(e.refno)),e.sedolnumber&&this.checkExist(e.sedolnumber)?this.onFundFillDetailClosed():e.sedolnumber&&e.paymentMethod&&this.onShowFillDetails(e.sedolnumber,e.paymentMethod,U.a.ADD)})))}goBack(){this.router.navigate([M.o.TRANSACTION_SELECTOR])}subscribeSelectedAuthenticatedDisplayChange(){this.subHandlingService.subscribe(this.selectedAuthenticatedDisplay$.pipe(Object(y.a)(e=>{this.selectedAuthenticatedDisplay=e,this.cdRef.markForCheck()})))}goToAcctBenefitFaq(){Object(pt.a)([M.o.SUPPORT,M.o.FAQ],{faq:"Getting Started",routeFaqId:"6932"})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(T.a),h.lc(s.i),h.lc(C.a),h.lc(h.j),h.lc(c.a),h.lc(c.e))},e.\u0275cmp=h.fc({type:e,selectors:[["fund-sell"]],inputs:{orderCartSedolnumber:"orderCartSedolnumber"},outputs:{selectedFundOutput:"selectedFundOutput"},features:[h.Tb([l.a])],decls:33,vars:58,consts:[["class","border-bottom",4,"ngIf"],["loadingTemplate",""],["class","mb-3",4,"ngIf"],[1,"bg-white",3,"ngClass"],[1,"",3,"ngClass"],["nz-row","","nzGutter","16",3,"ngClass"],["nz-col","",3,"nzLg"],["nzAllowClear","","nzPlaceHolder","Select the fund you wish to redeem","nzServerSearch","","nzShowSearch","",1,"w-100",3,"ngModel","nzSuffixIcon","ngModelChange","nzOnSearch"],[3,"nzLabel","nzValue","nzDisabled",4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],["prefixIconSearch",""],[3,"isUpdate","selectedFund","show","addedFund","closed"],[3,"selectedFund","show","isUpdate","addedFund","closed"],[3,"selectedFund","isVisible","isUpdate","addedFund","closed"],[3,"previewCart","itemCount","hideProductList","viewCart"],[3,"mobilePreviewCart","mobileBack",4,"ngIf"],["nzWidth","300","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzVisible","nzOnCancel",4,"ngIf"],[3,"nzVisible","nzPlacement","nzHeight","nzOnClose",4,"ngIf"],[1,"border-bottom"],[3,"title","back",4,"ngIf"],[3,"title","back"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzLoading"],[1,"mb-3"],[4,"ngIf"],[3,"nzLabel","nzValue","nzDisabled"],[3,"ngClass"],[3,"header1","header2","showAddToCartBtn","showProfitLoss","tradeProductInfoList","selectedSedolnumberAdd","sellPrs"],["nz-icon","","nzType","search",1,"text-md"],[3,"mobilePreviewCart","mobileBack"],["nzWidth","300","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzVisible","nzOnCancel"],["nz-icon","","nzTheme","fill","nzType","info-circle",1,"text-warning","d-inline-block","text-lg"],[1,"d-inline-block","pt-1","pl-2"],[3,"nzVisible","nzPlacement","nzHeight","nzOnClose"],[1,"pt-2"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-accent-1","text-xl"],[1,"pl-2","mt-1",3,"nzSpan"],[1,"d-inline-block",3,"ngClass"],[1,"d-flex","justify-content-end","p-2","mt-3"],["nz-button","","nzType","primary",3,"click"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,Bx,3,3,"div",0),h.qc(),h.od(2,_x,2,2,"ng-template",null,1,h.pd),h.rc(4,"app-mobile-scaffold"),h.od(5,Hx,3,3,"div",2),h.qc(),h.rc(6,"div",3),h.Ec(7,"async"),h.Ec(8,"async"),h.rc(9,"div",4),h.Ec(10,"async"),h.rc(11,"div",5),h.Ec(12,"async"),h.rc(13,"div",6),h.rc(14,"nz-select",7),h.zc("ngModelChange",(function(e){return t.checkExist(e.productC
5ode)?t.onFundFillDetailClosed():t.onShowFillDetails(e.productCode,e.paymentMethod,t.transactionConstant.ADD)}))("nzOnSearch",(function(e){return t.onSearchFundName(e)}))("ngModelChange",(function(e){return t.searchFundKey=e})),h.od(15,$x,1,3,"nz-option",8),h.qc(),h.qc(),h.qc(),h.od(16,Gx,3,8,"div",9),h.qc(),h.qc(),h.od(17,Wx,1,0,"ng-template",null,10,h.pd),h.rc(19,"app-sell-fund-fill-detail",11),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(20,"async"),h.qc(),h.rc(21,"sell-cmf-fund-fill-detail",12),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(22,"async"),h.qc(),h.rc(23,"sell-epf-fund-fill-detail",13),h.zc("closed",(function(){return t.onFundFillDetailClosed()})),h.Ec(24,"async"),h.qc(),h.rc(25,"app-transaction-mobile-view-cart-bar",14),h.zc("viewCart",(function(){return t.viewCart()})),h.Ec(26,"async"),h.qc(),h.od(27,Yx,1,1,"sell-order-cart-sider",15),h.Ec(28,"async"),h.od(29,Kx,6,3,"nz-modal",16),h.Ec(30,"async"),h.od(31,Qx,13,10,"nz-drawer",17),h.Ec(32,"async")),2&e){const e=h.ad(3),i=h.ad(18);var n;const c=null==(n=h.Fc(26,43,t.cartList$))?null:n.length;h.Ub(1),h.Mc("ngIf",!(t.previewCart||t.hideProductList)),h.Ub(4),h.Mc("ngIf",!(t.previewCart||t.hideProductList)),h.Ub(1),h.Mc("ngClass",h.Tc(51,Zx,h.Fc(7,29,t.isMobile$),(t.previewCart||t.hideProductList)&&h.Fc(8,31,t.isMobile$))),h.Ub(3),h.Mc("ngClass",h.Sc(54,Jx,h.Fc(10,33,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(56,eL,!h.Fc(12,35,t.isMobile$))),h.Ub(2),h.Mc("nzLg",24),h.Ub(1),h.Mc("ngModel",t.searchFundKey)("nzSuffixIcon",i),h.Ub(1),h.Mc("ngForOf",t.fundList),h.Ub(1),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(3),h.Mc("isUpdate",t.isUpdate)("selectedFund",t.selectedFund)("show",t.showSellFundFillDetail)("addedFund",h.Fc(20,37,t.cartList$)),h.Ub(2),h.Mc("selectedFund",t.selectedFund)("show",t.showCmfFundFillDetail)("isUpdate",t.isUpdate)("addedFund",h.Fc(22,39,t.cartList$)),h.Ub(2),h.Mc("selectedFund",t.selectedFund)("isVisible",t.showEpfFundFillDetail)("isUpdate",t.isUpdate)("addedFund",h.Fc(24,41,t.cartList$)),h.Ub(2),h.Mc("previewCart",t.previewCart)("itemCount",c)("hideProductList",t.hideProductList),h.Ub(2),h.Mc("ngIf",h.Fc(28,45,t.isMobile$)&&t.previewCart),h.Ub(2),h.Mc("ngIf",h.Fc(30,47,t.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(32,49,t.isMobile$))}},directives:[z.a,p.t,p.q,P.c,P.a,Xv.d,oe.t,oe.w,p.s,Vo,ws,Gs,BU,D.a,Il.a,W.a,ut.a,Xv.a,A.a,k.b,af,j.a,Eg.a,_.a],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedAuthenticatedDisplay)],e.prototype,"selectedAuthenticatedDisplay$",void 0),e})();function nL(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-app-bar-2",15),h.zc("back",(function(){return h.dd(e),h.Dc().goBack()})),h.qc()}2&e&&h.Mc("title","Funds - Switch")}function iL(e,t){if(1&e&&(h.rc(0,"nz-spin",16),h.mc(1,"nz-skeleton",17),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzLoading",e.isLoading)}}function cL(e,t){if(1&e){const e=h.sc();h.rc(0,"div",26),h.rc(1,"a",27),h.zc("click",(function(){return h.dd(e),h.Dc(2).goToSwitchingCalculator()})),h.rc(2,"b"),h.rc(3,"ins"),h.qd(4,"Switching Calculator"),h.qc(),h.qc(),h.qc(),h.qc()}}function oL(e,t){if(1&e&&h.mc(0,"nz-option",28),2&e){const e=t.$implicit;h.Mc("nzLabel",e.productNameDisplay)("nzValue",e)("nzDisabled",0===e.availableValue)}}const sL=function(e){return{"infinite-container mt-2":e}};function aL(e,t){if(1&e){const e=h.sc();h.rc(0,"div"),h.rc(1,"div",0),h.rc(2,"app-trade-product-info",29),h.zc("selectedSedolnumberAdd",(function(t){h.dd(e);const n=h.Dc(2);return n.onShowFillDetails(t.sedolnumber,t.paymentMethod,n.transactionConstant.ADD)})),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(2);h.Ub(1),h.Mc("ngClass",h.Sc(6,sL,(null==e.fundTradeList?null:e.fundTradeList.length)>=7)),h.Ub(1),h.Mc("header1","Market Value")("header2","Profit / Loss")("showAddToCartBtn",!0)("showProfitLoss",!0)("tradeProductInfoList",e.fundTradeList)}}const lL=function(e,t){return{shadow:e,"d-none":t}},rL=function(e){return{"px-2 mb-6 py-3":e}},dL=function(e){return{"mt-3":e}};function uL(e,t){if(1&e){const e=h.sc();h.rc(0,"div",18),h.Ec(1,"async"),h.Ec(2,"async"),h.od(3,cL,5,0,"div",19),h.Ec(4,"async"),h.rc(5,"div",20),h.Ec(6,"async"),h.rc(7,"div",21),h.Ec(8,"async"),h.rc(9,"div",22),h.rc(10,"nz-select",23),h.zc("ngModelChange",(function(t){h.dd(e);const n=h.Dc();return n.checkExist(t)?n.onFundFillDetailClosed():n.onShowFillDetails(t.productC
5ode,t.paymentMethod,n.transactionConstant.ADD)}))("nzOnSearch",(function(t){return h.dd(e),h.Dc().onSearchFundName(t)}))("ngModelChange",(function(t){return h.dd(e),h.Dc().searchFundKey=t})),h.od(11,oL,1,3,"nz-option",24),h.qc(),h.qc(),h.qc(),h.od(12,aL,3,8,"div",25),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(12),n=h.ad(8);h.Mc("ngClass",h.Tc(20,lL,h.Fc(1,10,e.isMobile$),(e.previewCart||e.hideProductList)&&h.Fc(2,12,e.isMobile$))),h.Ub(3),h.Mc("ngIf",h.Fc(4,14,e.isMobile$)),h.Ub(2),h.Mc("ngClass",h.Sc(23,rL,h.Fc(6,16,e.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(25,dL,!h.Fc(8,18,e.isMobile$))),h.Ub(2),h.Mc("nzLg",24),h.Ub(1),h.Mc("ngModel",e.searchFundKey)("nzSuffixIcon",t),h.Ub(1),h.Mc("ngForOf",e.fundList),h.Ub(1),h.Mc("ngIf",!e.isLoading)("ngIfElse",n)}}function hL(e,t){if(1&e){const e=h.sc();h.rc(0,"app-transaction-mobile-view-cart-bar",30),h.zc("viewCart",(function(){return h.dd(e),h.Dc().viewCart()})),h.Ec(1,"async"),h.qc()}if(2&e){const e=h.Dc();var n;const t=null==(n=h.Fc(1,3,e.cartList$))?null:n.length;h.Mc("previewCart",e.previewCart)("itemCount",t)("hideProductList",e.hideProductList)}}function pL(e,t){1&e&&h.mc(0,"em",31)}function mL(e,t){if(1&e&&h.mc(0,"img",32),2&e){const e=h.Dc();h.Mc("src",e.transactionImgPath+"filterIcon.svg",h.gd)("alt","filter")}}function fL(e,t){if(1&e){const e=h.sc();h.rc(0,"switch-order-cart-sider",33),h.zc("mobileBack",(function(){return h.dd(e),h.Dc().onMobileBack()})),h.qc()}2&e&&h.Mc("mobilePreviewCart",!0)}const gL=function(e){return{"text-md":e}};function bL(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",34),h.zc("nzOnClose",(function(){return h.dd(e),h.Dc().onCloseNoHoldingsDrawer()})),h.rc(1,"nz-row",35),h.rc(2,"nz-col",36),h.mc(3,"i",37),h.qc(),h.rc(4,"nz-col",38),h.rc(5,"h3",39),h.Ec(6,"async"),h.qd(7,"Warning"),h.qc(),h.rc(8,"p"),h.qd(9,"No Available Holdings to Switch"),h.qc(),h.qc(),h.qc(),h.rc(10,"div",40),h.rc(11,"button",41),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseNoHoldingsDrawer()})),h.qd(12,"Done"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",e.showNoHoldingsDrawer)("nzPlacement","bottom")("nzHeight",180),h.Ub(2),h.Mc("nzSpan",2),h.Ub(2),h.Mc("nzSpan",22),h.Ub(1),h.Mc("ngClass",h.Sc(8,gL,h.Fc(6,6,e.isMobile$)))}}const SL=function(e){return{"d-none":e}};let yL=(()=>{class e{constructor(e,t,n,i,c,o){this.subHandlingService=e,this.transactionRestService=t,this.store=n,this.cdRef=i,this.transactionService=c,this.activatedRoute=o,this.selectedFundOutput=new h.s,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.fundTradeList=[],this.cart=[],this.transactionConstant=U.a,this.isLoading=!1,this.isLoadingFundFill=!1,this.isLoadingSalesCharge=!1,this.isUpdate=!1,this.showSwitchFundFillDetail=!1,this.isMobile=!1,this.hideProductList=!1,this.showCmfFundFillDetail=!1,this.showPrsFundFillDetail=!1,this.isInterSwitch=!1,this.previewCart=!1,this.showNoHoldingsDrawer=!1,this.selectedAuthenticatedDisplay=null,this.showEpfAutoSellMsgModal=!1,this.isMobile=this.store.selectSnapshot(a.a.isMobile)}ngOnInit(){this.store.dispatch(new u.V(d.d.SWITCH)),this.subscribeRefno(),this.subscribeSelectedAuthenticatedDisplayChange()}mapTradeProductInfo(e){var t;return{paymentMethod:e.paymentMethod,sedolnumber:e.productCode,fundInfoName:e.productName,minInvestmentAmount:"MYR"===e.fundCurrencyCode?e.availableValue:e.availableValue/e.fxRate,minInvestmentAmountCurrency:e.fundCurrencyCode,riskRating:"0",addedToCart:!!(null===(t=this.cart)||void 0===t?void 0:t.find(t=>{var n;return t.sedolNumber===e.productCode&&t.refno===this.refno&&(null===(n=null==t?void 0:t.fundSwitchTransactionModel)||void 0===n?void 0:n.paymentMethod)===e.paymentMethod})),profitLossAmount:e.profitValue,profitLossCurrency:e.fundCurrencyCode,profitLossPercentage:e.profitPercentage.toFixed(2),appliedPromoCode:!1,additionalInfo:e.fundType,isPrs:"PRS"==e.paymentMethod,isPrsGov:"PRS_GOV"==e.paymentMethod,isSwitch:!0,paymentMethodForCheck:e.paymentMethod}}getSellHolding(){this.isLoading=!0,this.subHandlingService.once(this.transactionRestService.getSellHoldingList(this.refno).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&(e&&(this.fundList=e.data.sort((e,t)=>
5e.productName>t.productName?1:t.productName>e.productName?-1:0),this.fundList=this.fundList.filter(e=>e.productCode!==U.a.RHBCMF2),this.fundList=this.fundList.filter(e=>e.canSwitch===M.a.YES_FLAG),this.refreshProductList(),this.fundList.map(e=>{e.productNameDisplay=e.productName}),this.fundList.forEach(e=>{this.fundList.filter(t=>t.productCode===e.productCode).length>1&&(e.productNameDisplay=e.paymentMethod===U.a.CHEQUE.toLowerCase()?e.productName+" ("+U.a.CASH_INVESTMENTS+")":e.paymentMethod===U.a.EPF_FUNDS.toUpperCase()?e.productName+" ("+e.paymentMethod+" Investments)":e.productName+" ("+e.paymentMethod+")")}),this.fundListTemp=Object(g.a)(this.fundList),this.isLoading=!1),this.subscribeParam())},e=>console.log(e))))}onSearchFundName(e){var t,n,i;e?(this.fundList=null===(t=this.fundListTemp)||void 0===t?void 0:t.filter(t=>{var n;return-1!==(null===(n=t.productName)||void 0===n?void 0:n.toLowerCase().indexOf(e.toLowerCase()))}),this.fundTradeList=null===(n=this.fundList)||void 0===n?void 0:n.map(e=>this.mapTradeProductInfo(e))):(this.fundList=this.fundListTemp,this.fundTradeList=null===(i=this.fundList)||void 0===i?void 0:i.map(e=>this.mapTradeProductInfo(e)))}onShowFillDetails(e,t,n){var i,c,o;n===U.a.UPDATE&&(this.isUpdate=!0);for(let s of this.fundList)if(e===s.productCode&&t==s.paymentMethod){if(this.selectedFund=s,this.isMobile$&&0===this.selectedFund.availableValue)return void(this.showNoHoldingsDrawer=!0);this.sellInfoModel=this.mapSellInfoModel(this.selectedFund),this.getFundSwitchList(),this.isMobile&&(this.hideProductList=!0)}this.duplicateRecord=this.fundList.filter(t=>t.managerCode===M.c.PRINCIPAL_MANAGER_CODE&&t.prs&&t.productCode===e).length>1,this.selectedFund.reloadSwitchBuy=!1,(null===(i=this.selectedFund)||void 0===i?void 0:i.targetSwitchBuy)&&(this.selectedFund.targetSwitchBuy=""),(null===(c=this.selectedFund)||void 0===c?void 0:c.cashFund)?this.showCmfFundFillDetail=!0:(null===(o=this.selectedFund)||void 0===o?void 0:o.prs)?this.showPrsFundFillDetail=!0:this.showSwitchFundFillDetail=!0}onFundFillDetailClosed(){this.selectedFund=null,this.isUpdate=!1,this.showSwitchFundFillDetail=!1,this.hideProductList=!1,this.showCmfFundFillDetail=!1,this.showPrsFundFillDetail=!1}checkExist(e){var t;return"addedToCart"==(null===(t=this.cart.find(t=>t.fundSwitchTransactionModel.switchSellSedolnumber===e))||void 0===t?void 0:t.orderStatus)}subscribeCartList(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.cart=e}),Object(y.a)(()=>this.refreshProductList())))}refreshProductList(){var e;this.fundTradeList=null===(e=this.fundList)||void 0===e?void 0:e.map(e=>this.mapTradeProductInfo(e)).sort((e,t)=>e.fundInfoName>t.fundInfoName?1:t.fundInfoName>e.fundInfoName?-1:0)}getFundSwitchList(){this.isLoadingFundFill=!0,this.subHandlingService.once(this.transactionRestService.getSwitchBuyListingList(this.refno,this.sellInfoModel).pipe(Object(y.a)(e=>{if(e.status===M.a.RESPONSE_SUCCESS)return e?(this.fundSwitchList=e.data,this.fundSwitchList.forEach(e=>{if(this.fundSwitchList.filter(t=>t.sedolnumber===e.sedolnumber).length>1){let t=this.fundSwitchList.filter(t=>t.sedolnumber===e.sedolnumber);this.fundSwitchList=this.fundSwitchList.filter(t=>t.sedolnumber!==e.sedolnumber),this.fundSwitchList.push(t.find(e=>!0===e.interList))}}),this.fundSwitchList=this.fundSwitchList.sort((e,t)=>e.fundName>t.fundName?1:t.fundName>e.fundName?-1:0),void(this.isLoadingFundFill=!1)):void 0},e=>console.log(e))))}mapSellInfoModel(e){return{sedolNumber:e.productCode,redemptionMethod:null,currency:e.fundCurrencyCode,redemptionUnits:null,redemptionAmount:null,isRedeemByAmount:null,ifastStatus:e.ifastStatus,paymentMethod:e.paymentMethod,agentId:null,createdBy:null,emisOrder:null}}getSwitchSalesCharge(){this.isLoadingSalesCharge=!0,this.subHandlingService.once(this.transactionRestService.getSwitchSalesCharge(this.refno,this.fundSwitchTransactionModel).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.switchingCalculatorModel=e.data,this.isLoadingSalesCharge=!1)},e=>console.log(e))))}mapSwitchModel(e){return{ifastStatus:this.selectedFund.ifastStatus,interOrder:e.interList,intraOrder:e.intraList,paymentMethod:this.selectedFund.paymentMethod,refno:this.refno,switchBuySedolnumber:e.sedolnumber,switchSellSedolnumber:this.selectedFund.productC
5ode,switchUnit:0}}onSelectedSwitchBuyFund(e){this.fundSwitchTransactionModel=this.mapSwitchModel(e),this.isInterSwitch=e.interList,this.getSwitchSalesCharge()}onSelectedFundForSwitchBuy(e){let t=this.fundSwitchList.find(t=>t.sedolnumber===e);this.onSelectedSwitchBuyFund(t)}subscribeRefno(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{this.refno=e,this.cartList$=this.store.select(u.W.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeCartList(),this.getSellHolding(),this.cdRef.markForCheck()})))}viewCart(){this.hideProductList=!0,this.previewCart=!0}onMobileBack(){this.hideProductList=!1,this.previewCart=!1}onCloseNoHoldingsDrawer(){this.showNoHoldingsDrawer=!1}subscribeParam(){var e;let t;this.subHandlingService.subscribe(null===(e=this.activatedRoute)||void 0===e?void 0:e.queryParams.pipe(Object(aa.a)(e=>e&&e.sedolnumber||e.refno||e.paymentMethod),Object(S.a)(({sedolnumber:e,refno:n,paymentMethod:i})=>t={refno:n,sedolnumber:e,paymentMethod:i}),Object(y.a)(e=>{e.refno&&this.store.dispatch(new u.N(e.refno)),e.sedolnumber&&this.checkExist(e.sedolnumber)?this.onFundFillDetailClosed():e.sedolnumber&&e.paymentMethod&&this.onShowFillDetails(e.sedolnumber,e.paymentMethod,U.a.ADD)})))}onAppBarBack(){this.previewCart=!1,this.hideProductList=!1}goBack(){window.history.back()}subscribeSelectedAuthenticatedDisplayChange(){this.subHandlingService.subscribe(this.selectedAuthenticatedDisplay$.pipe(Object(y.a)(e=>{this.selectedAuthenticatedDisplay=e,this.cdRef.markForCheck()})))}goToAcctBenefitFaq(){Object(pt.a)([M.o.SUPPORT,M.o.FAQ],{faq:"Getting Started",routeFaqId:"6932"})}goToSwitchingCalculator(){Object(pt.a)([M.o.FUNDS,M.o.TOOLS,M.o.SWITCHING_CALCULATOR])}showEpfAutoSellMsgPopup(e){this.showSwitchFundFillDetail=!1,this.showEpfAutoSellSedol=e,this.showEpfAutoSellMsgModal=!0}closeEpfAutoSellMsgModal(e){this.showEpfAutoSellMsgModal=!1,this.showSwitchFundFillDetail=!0,this.selectedFund.targetSwitchBuy=e,this.selectedFund.reloadSwitchBuy=!0}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(T.a),h.lc(s.i),h.lc(h.j),h.lc(C.a),h.lc(c.a))},e.\u0275cmp=h.fc({type:e,selectors:[["fund-switch"]],inputs:{orderCartSedolnumber:"orderCartSedolnumber"},outputs:{selectedFundOutput:"selectedFundOutput"},features:[h.Tb([l.a])],decls:26,vars:50,consts:[[3,"ngClass"],[1,"border-bottom"],[3,"title","back",4,"ngIf"],[1,"mb-3"],["loadingTemplate",""],["class","bg-white",3,"ngClass",4,"ngIf"],[3,"previewCart","itemCount","hideProductList","viewCart",4,"ngIf"],["prefixIconSearch",""],["prefixIconFilter",""],[3,"addedFund","isUpdate","selectedFund","fundSwitchList","show","isLoadingFundFill","isLoadingSalesCharge","switchingCalculatorModel","isInterSwitch","closed","selectedFundForSwitchBuyChange","appBarBack"],[3,"addedFund","isUpdate","selectedFund","fundSwitchList","show","switchingCalculatorModel","isInterSwitch","isLoadingFundFill","isLoadingSalesCharge","closed","selectedFundForSwitchBuyChange","appBarBack","showAutoSellPopup"],[3,"isVisible","addedFund","isUpdate","selectedFund","isInterSwitch","fundSwitchList","isLoadingFundFill","isLoadingSalesCharge","switchingCalculatorModel","duplicateRecord","closed","selectedFundForSwitchBuyChange","appBarBack"],[3,"mobilePreviewCart","mobileBack",4,"ngIf"],[3,"nzVisible","nzPlacement","nzHeight","nzOnClose",4,"ngIf"],[3,"showModel","targetFund","closeModal"],[3,"title","back"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzLoading"],[1,"bg-white",3,"ngClass"],["class","pt-1 px-2",4,"ngIf"],[1,"",3,"ngClass"],["nz-row","","nzGutter","16",3,"ngClass"],["nz-col","",3,"nzLg"],["nzAllowClear","","nzPlaceHolder","Select the fund you wish to switch","nzServerSearch","","nzShowSearch","",1,"w-100",3,"ngModel","nzSuffixIcon","ngModelChange","nzOnSearch"],[3,"nzLabel","nzValue","nzDisabled",4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[1,"pt-1","px-2"],[1,"text-info","text-sm","sub-text",3,"click"],[3,"nzLabel","nzValue","nzDisabled"],[3,"header1","header2","showAddToCartBtn","showProfitLoss","tradeProductInfoList","selectedSedolnumberAdd"],[3,"previewCart","itemCount","hideProductList","viewCart"],["nz-icon","","nzType","search",1,"text-md"],[1,"img-fluid",3,"src","alt"],[3,"mobilePreviewCart","mobileBack"],[3,"nzVisible","nzPlacement","nzHeight","nzOnClose"],[1,"pt-2"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-accent-1","text-xl"],[1,"pl-2","mt-1",3,"nzSpan"],[1,"d-inline-block",3,"ngClass"],[1,"d-flex","justify-content-end","p-2","mt-3"],["nz-button","","nzType","primary",3,"click"]],template:function(e,t){1&e&&(h.rc(0,"app-mobile-scaffold"),h.rc(1,"div",0),h.rc(2,"div",1),h.od(3,nL,1,1,"b2c-app-bar-2",2),h.Ec(4,"async"),h.qc(),h.rc(5,"div",3),h.mc(6,"investment-account-selector"),h.qc(),h.qc(),h.qc(),h.od(7,iL,2,2,"ng-template",null,4,h.pd),h.od(9,uL,13,27,"div",5),h.od(10,hL,2,5,"app-transaction-mobile-view-cart-bar",6),h.od(11,pL,1,0,"ng-template",null,7,h.pd),h.od(13,mL,1,2,"ng-template",null,8,h.pd),h.rc(15,"switch-cmf-fund-fill-detail",9),h.zc("closed",(function(){return t.onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(e){return t.onSelectedFundForSwitchBuy(e)}))("appBarBack",(function(){return t.onFundFillDetailClosed()})),h.Ec(16,"async"),h.qc(),h.rc(17,"switch-fund-fill-detail",10),h.zc("closed",(function(){return t.onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(e){return t.onSelectedFundForSwitchBuy(e)}))("appBarBack",(function(){return t.onFundFillDetailClosed()}))("showAutoSellPopup",(function(e){return t.showEpfAutoSellMsgPopup(e)})),h.Ec(18,"async"),h.qc(),h.rc(19,"switch-prs-fund-fill-detail",11),h.zc("closed",(function(){return t.onFundFillDetailClosed()}))("selectedFundForSwitchBuyChange",(function(e){return t.onSelectedFundForSwitchBuy(e)}))("appBarBack",(function(){return t.onFundFillDetailClosed()})),h.Ec(20,"async"),h.qc(),h.od(21,fL,1,1,"switch-order-cart-sider",12),h.Ec(22,"async"),h.od(23,bL,13,10,"nz-drawer",13),h.Ec(24,"async"),h.rc(25,"epf-auto-sell-msg-modal",14),h.zc("closeModal",(function(e){return t.closeEpfAutoSellMsgModal(e)})),h.qc()),2&e&&(h.Ub(1),h.Mc("ngClass",h.Sc(48,SL,t.hideProductList||t.previewCart)),h.Ub(2),h.Mc("ngIf",h.Fc(4,36,t.isMobile$)),h.Ub(6),h.Mc("ngIf",!t.hideProductList),h.Ub(1),h.Mc("ngIf",!t.isLoading),h.Ub(5),h.Mc("addedFund",h.Fc(16,38,t.cartList$))("isUpdate",t.isUpdate)("selectedFund",t.selectedFund)("fundSwitchList",t.fundSwitchList)("show",t.showCmfFundFillDetail)("isLoadingFundFill",t.isLoadingFundFill)("isLoadingSalesCharge",t.isLoadingSalesCharge)("switchingCalculatorModel",t.switchingCalculatorModel)("isInterSwitch",t.isInterSwitch),h.Ub(2),h.Mc("addedFund",h.Fc(18,40,t.cartList$))("isUpdate",t.isUpdate)("selectedFund",t.selectedFund)("fundSwitchList",t.fundSwitchList)("show",t.showSwitchFundFillDetail)("switchingCalculatorModel",t.switchingCalculatorModel)("isInterSwitch",t.isInterSwitch)("isLoadingFundFill",t.isLoadingFundFill)("isLoadingSalesCharge",t.isLoadingSalesCharge),h.Ub(2),h.Mc("isVisible",t.showPrsFundFillDetail)("addedFund",h.Fc(20,42,t.cartList$))("isUpdate",t.isUpdate)("selectedFund",t.selectedFund)("isInterSwitch",t.isInterSwitch)("fundSwitchList",t.fundSwitchList)("isLoadingFundFill",t.isLoadingFundFill)("isLoadingSalesCharge",t.isLoadingSalesCharge)("switchingCalculatorModel",t.switchingCalculatorModel)("duplicateRecord",t.duplicateRecord),h.Ub(2),h.Mc("ngIf",h.Fc(22,44,t.isMobile$)&&t.previewCart),h.Ub(2),h.Mc("ngIf",h.Fc(24,46,t.isMobile$)),h.Ub(2),h.Mc("showModel",t.showEpfAutoSellMsgModal)("targetFund",t.showEpfAutoSellSedol))},directives:[z.a,p.q,p.t,ut.a,fr,Pl,Br,df,D.a,Il.a,W.a,P.c,P.a,Xv.d,oe.t,oe.w,p.s,Xv.a,A.a,BU,k.b,Qf,Eg.a,_.a],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedAuthenticatedDisplay)],e.prototype,"selectedAuthenticatedDisplay$",void 0),e})();var vL=n("RDCe"),ML=n("66kx");function CL(e,t){1&e&&h.mc(0,"div")}const qL=function(e){return{bondData:e}};function TL(e,t){if(1&e&&(h.rc(0,"div"),h.od(1,CL,1,0,"div",28),h.qc()),2&e){const e=t.$implicit;h.Dc();const n=h.ad(41);h.Ub(1),h.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",h.Sc(2,qL,e))}}function wL(e,t){if(1&e&&(h.rc(0,"div",29),h.rc(1,"nz-card",30),h.rc(2,"div",31),h.rc(3,"div",32),h.Ec(4,"async"),h.mc(5,"i",33),h.qc(),h.rc(6,"div",32),h.Ec(7,"async"),h.rc(8,"span",34),h.qd(9,"Please proceed to payment to complete your transaction."),h.qc(),h.qc(),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(3),h.Mc("nzSpan",h.Fc(4,2,e.isMobile$)?2:4),h.Ub(3),h.Mc("nzSpan",h.Fc(7,4,e.isMobile$)?22:20)}}function zL(e,t){if(1&e&&(h.qd(0),h.Ec(1,"number")),2&e){const e=h.Dc().$implicit,t=h.Dc(2);h.td(" ",e," ",h.Gc(1,2,null==t.paymentModeCat?null:t.paymentModeCat.paymentByCur[e],"1.2-2")," ")}}function DL(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-order-cart",36),h.zc("payNow",(function(){h.dd(e);
5const n=t.$implicit,i=h.Dc(2);return i.handlePayNow(i.paymentModeCat,n)})),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",37),h.od(3,zL,2,5,"ng-template",null,38,h.pd),h.qc(),h.qc()}if(2&e){const e=t.$implicit,n=h.ad(4),i=h.Dc(2);h.Mc("orderCartType",i.paymentModeCat.isPayment?i.orderCartConstant.PAYMENT:i.orderCartConstant.ORDER_RECEIVED)("isEditOrder",!1)("paymentTitle",i.paymentModeCat.paymentMode===i.transactionConstant.TRUST_ACCOUNT||i.paymentModeCat.paymentMode===i.transactionConstant.AUTO_SWEEP?e+" "+(null==i.paymentModeConstant[i.paymentModeCat.paymentMode]?null:i.paymentModeConstant[i.paymentModeCat.paymentMode].label):i.paymentModeConstant[i.paymentModeCat.paymentMode].label+" Payment - "+e),h.Ub(2),h.Mc("value",n)}}function PL(e,t){if(1&e&&(h.rc(0,"div",29),h.od(1,DL,5,4,"b2c-order-cart",35),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngForOf",null==e.paymentModeCat?null:e.paymentModeCat.paymentCurList)}}function IL(e,t){if(1&e){const e=h.sc();h.rc(0,"div",39),h.rc(1,"div",40),h.rc(2,"button",41),h.zc("click",(function(){return h.dd(e),h.Dc().redirectToTrade()})),h.qd(3,"Place Another Order"),h.qc(),h.qc(),h.rc(4,"div",40),h.rc(5,"button",42),h.zc("click",(function(){return h.dd(e),h.Dc().viewPendingTrade()})),h.qd(6,"View Pending Trade"),h.qc(),h.qc(),h.qc()}}function kL(e,t){if(1&e){const e=h.sc();h.rc(0,"div",43),h.rc(1,"div",44),h.rc(2,"button",41),h.zc("click",(function(){return h.dd(e),h.Dc().redirectToTrade()})),h.qd(3,"Place Another Order"),h.qc(),h.qc(),h.rc(4,"div",44),h.rc(5,"button",42),h.zc("click",(function(){return h.dd(e),h.Dc().viewPendingTrade()})),h.qd(6,"View Pending Trade"),h.qc(),h.qc(),h.qc()}}function AL(e,t){if(1&e&&(h.pc(0),h.qd(1),h.oc()),2&e){const e=h.Dc().bondData,t=h.Dc();h.Ub(1),h.sd(" ",(null==e?null:e.investmentCurrency)+" "+(null==t.paymentModeConstant[null==e?null:e.paymentMode]?null:t.paymentModeConstant[null==e?null:e.paymentMode].label)," ")}}function EL(e,t){if(1&e&&h.qd(0),2&e){const e=h.Dc().bondData,t=h.Dc();h.td(" ",null==t.paymentModeConstant[e.paymentMode]?null:t.paymentModeConstant[e.paymentMode].label," Payment - ",e.investmentCurrency," ")}}function FL(e,t){1&e&&(h.rc(0,"div",56),h.qd(1,"Ind. Principal Amt"),h.qc())}function OL(e,t){1&e&&(h.rc(0,"div",56),h.qd(1,"Principal Amt"),h.qc())}function UL(e,t){1&e&&(h.rc(0,"div",56),h.qd(1,"Ind. Accrued Interest"),h.qc())}function xL(e,t){1&e&&(h.rc(0,"div",56),h.qd(1,"Accrued Interest"),h.qc())}function LL(e,t){1&e&&(h.rc(0,"div",56),h.qd(1,"Est Payable Payment"),h.qc())}function RL(e,t){1&e&&(h.rc(0,"div",56),h.qd(1,"Total Payment"),h.qc())}function NL(e,t){if(1&e&&(h.pc(0),h.qd(1),h.Ec(2,"number"),h.oc()),2&e){const e=h.Dc().bondData;h.Ub(1),h.td(" ",null==e?null:e.investmentCurrency," ",h.Gc(2,2,null==e?null:e.investmentAmountAf,"0.2-2")," ")}}function BL(e,t){if(1&e&&(h.qd(0),h.Ec(1,"number")),2&e){const e=h.Dc().bondData;h.td(" ",e.investmentCurrency," ",h.Gc(1,2,e.estAmtPayable,"0.2-2")," ")}}function _L(e,t){if(1&e&&(h.rc(0,"div",45),h.rc(1,"div",46),h.od(2,AL,2,1,"ng-container",47),h.od(3,EL,1,2,"ng-template",null,48,h.pd),h.qc(),h.rc(5,"div",49),h.rc(6,"span",50),h.qd(7),h.qc(),h.qc(),h.rc(8,"div",51),h.rc(9,"span"),h.qd(10),h.qc(),h.qc(),h.rc(11,"div",52),h.od(12,FL,2,0,"div",53),h.od(13,OL,2,0,"div",53),h.rc(14,"div",54),h.qd(15),h.Ec(16,"number"),h.qc(),h.qc(),h.rc(17,"div",52),h.od(18,UL,2,0,"div",53),h.od(19,xL,2,0,"div",53),h.rc(20,"div",54),h.qd(21),h.Ec(22,"number"),h.qc(),h.qc(),h.rc(23,"div",55),h.rc(24,"div",56),h.qd(25,"Processing Fee"),h.qc(),h.rc(26,"div",54),h.qd(27),h.Ec(28,"number"),h.qc(),h.qc(),h.rc(29,"div",57),h.od(30,LL,2,0,"div",53),h.od(31,RL,2,0,"div",53),h.rc(32,"div",54),h.od(33,NL,3,5,"ng-container",47),h.od(34,BL,2,5,"ng-template",null,58,h.pd),h.qc(),h.qc(),h.qc()),2&e){const e=t.bondData,n=h.ad(4),i=h.ad(35),c=h.Dc();h.Ub(2),h.Mc("ngIf",(null==e?null:e.paymentMode)===c.transactionConstant.TRUST_ACCOUNT||(null==e?null:e.paymentMode)===c.transactionConstant.AUTO_SWEEP)("ngIfElse",n),h.Ub(5),h.sd("[",c.orderTypeConstant[e.orderType].label,"] "),h.Ub(3),h.rd(e.bondName),h.Ub(2),h.Mc("ngIf","Firm"!==e.orderType),h.Ub(1),h.Mc("ngIf","Firm"!==e.orderType),h.Ub(2),h.td("",e.bondCurrency," ",h.Gc(16,18,e.transactedAmt,"0.2-2"),""),h.Ub(3),h.Mc("ngIf","Firm"!==e.orderType),h.Ub(1),h.Mc("ngIf","Firm"===e.orderType),h.Ub(2),h.td("",e.bondCurrency," ",h.Gc(22,21,e.accruedInt,"0.2-2"),""),h.Ub(6),h.td("",e.bondCurrency," ",h.Gc(28,24,e.transactionFee,"0.2-2"),""),h.Ub(3),h.Mc("ngIf","Firm"!==e.orderType),h.Ub(1),h.Mc("ngIf","Firm"===e.orderType),h.Ub(2),h.Mc("ngIf",(null==e?null:e.investmentCurrency)!==(null==e?null:e.bondCurrency))("ngIfElse",i)}}const VL=function(e){return{"bg-white py-3":e}};let HL=(()=>{class e{constructor(e,t,n,i,c,o,s,a,l,u){this.subHandlingService=e,this.transactionBondRestService=t,this.route=n,this.store=i,this.router=c,this.transactionRestService=o,this.paymentRestService=s,this.transactionService=a,this.fpxRestService=l,this.datePipe=u,this.transactionType=d.d,this.isLoading=!1,this.showWarningPaymentLabel=!0,this.product=r.b.BOND,this.orderTypeConstant=vL.a.OrderType,this.paymentModeConstant=vL.a.PaymentMode,this.transactionConstant=U.a,this.orderCartConstant=O.a,this.showLocalPaymentModal=!1,this.show
5ForeignPaymentModal=!1,this.showUploadReceiptModal=!1,this.showSuccessModal=!1,this.showFpxPaymentErrorModal=!1,this.showFpxPaymentSuccessModal=!1,this.initialize(),this.subscribeIsMobile()}subscribeIsMobile(){this.subHandlingService.once(this.isMobile$.pipe(Object(y.a)(e=>{this.isMobile=e})))}initialize(){this.route.queryParams.subscribe(e=>{this.purchaseOrderNo=e.poNumber,e.refno?(this.refno=e.refno,this.getAccountDetails(),this.refno&&this.purchaseOrderNo&&this.getBondContractDetails().subscribe()):this.store.snapshot().trade.lastVisitedUrl&&-1!==this.store.snapshot().trade.lastVisitedUrl.indexOf(M.o.BOND_CHECK_OUT)&&(this.store.dispatch(new f.p(!1)),this.subHandlingService.subscribe(this.fpxRestService.getFpxInfo(this.purchaseOrderNo).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS?(e&&(console.log("this.paymentModeCat 1 ",this.paymentModeCat),this.refno=e.data.buyerRefno,this.purchaseOrderNo=e.data.purchaseOrderNo,this.fpxPaymentContent=this.setFpxPaymentModalContent(e.data),this.refno&&this.purchaseOrderNo&&this.getBondContractDetails().pipe(Object(y.a)(()=>{console.log("this.paymentModeCat 2",this.paymentModeCat),this.receivedPayment()})).subscribe()),"00"===e.data.debitStatusCode?this.showFpxPaymentSuccessModal=!0:this.showFpxPaymentErrorModal=!0):this.router.navigate([M.o.PAGE_NOT_FOUND])}))))})}getAccountDetails(){this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{const t=e.filter(e=>e.refno===this.refno);t.length>0&&(this.selectedAcct=Object(g.a)(t[0]))})}getBondContractDetails(){return this.isLoading=!0,this.transactionBondRestService.findBondContractDetails(this.refno,this.purchaseOrderNo).pipe(Object(y.a)(e=>{e.data&&(this.bondContractList=e.data),this.setPaymentByCurrencyList(),this.isLoading=!1}))}setPaymentByCurrencyList(){var e,t;this.paymentModeCat={},this.bondContractList&&(this.bondContractList.forEach(e=>{let t=[],n={},i=!0;("pending"!==e.transactionStatus||"pending"===e.transactionStatus&&"Y"===e.fpxPaymentSuccessful)&&(i=!1,this.showWarningPaymentLabel=!1),this.paymentModeCat={label:this.paymentModeConstant[e.paymentMode].label+" - "+e.investmentCurrency,paymentMode:e.paymentMode,paymentCurList:[],paymentByCur:{},isPayment:i},t=this.paymentModeCat.paymentCurList,n=this.paymentModeCat.paymentByCur,0===t.filter(t=>e.investmentCurrency===t).length&&t.push(e.investmentCurrency),n[e.investmentCurrency]=n[e.investmentCurrency]?n[e.investmentCurrency]+e.investmentAmountAf:e.investmentAmountAf}),(null===(e=this.bondContractList[0])||void 0===e?void 0:e.costLocal)&&(this.costLocal=null===(t=this.bondContractList[0])||void 0===t?void 0:t.costLocal))}redirectToTrade(){this.router.navigate([M.o.APP,M.o.TRADE,M.o.BONDS,this.transactionType.BUY])}handlePayNow(e,t){t===U.a.PAYMENT_CURRENCY_MYR?this.showLocalPaymentModal=!0:this.showForeignPaymentModal=!0,this.currentPayingPaymentMethod={paymentModePay:e.label,paymentAmtPay:e.paymentByCur[t],paymentCurrency:t}}preSubmitToFPX(e,t){const n={fpxSellerOrderNo:this.purchaseOrderNo,fpxTxnAmount:this.currentPayingPaymentMethod.paymentAmtPay,fpxBuyerBankId:e,fpxBuyerEmail:t,redirectUrl:this.router.url.split("?")[0]};this.store.dispatch(new f.p(!0)),this.subHandlingService.once(this.paymentRestService.preSubmit(this.refno,!0,n).pipe(Object(y.a)(e=>{e.status===M.a.RESPONSE_SUCCESS&&e&&(this.fpxPaymentDetails=Object(g.a)(e.data),this.transactionService.setLastVisitedUrl(this.router.url))},e=>console.log(e))))}onSubmittedToFpx(){}onFinishPayNow(e){this.preSubmitToFPX(e.selectedBank,e.email)}onSubmitProof(){this.showForeignPaymentModal=!1,this.showLocalPaymentModal=!1,this.showUploadReceiptModal=!0}onCancel(){this.showForeignPaymentModal=!1,this.showLocalPaymentModal=!1}onBackFromSubmitReceipt(e){e!==U.a.PAYMENT_CURRENCY_MYR?(this.showUploadReceiptModal=!1,this.showForeignPaymentModal=!0):(this.showUploadReceiptModal=!1,this.showLocalPaymentModal=!0)}
5onSuccess(e){this.isMobile||(this.showForeignPaymentModal=!1,this.showUploadReceiptModal=!1),this.showSuccessModal=!0,this.receivedPayment()}onDoneClick(){this.showUploadReceiptModal=!1,this.showForeignPaymentModal=!1,this.showSuccessModal=!1,this.receivedPayment()}receivedPayment(){this.paymentModeCat.isPayment=!1,this.showWarningPaymentLabel=!1}viewPendingTrade(){this.router.navigate([M.o.APP,M.o.TRANSACTION_RECORD],{queryParams:{refno:this.refno}})}downloadOrderNoForm(){this.subHandlingService.once(this.transactionRestService.downloadOrderNoForm(this.refno,this.purchaseOrderNo,"bondBuy").pipe(Object(y.a)(e=>{e&&this.downloadForm(e)},e=>console.log(e))))}downloadForm(e){const t=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(t,this.purchaseOrderNo+"_Form.pdf")}closeFpxModel(){this.showFpxPaymentSuccessModal=!1,this.showFpxPaymentErrorModal=!1}setFpxPaymentModalContent(e){return[{label:"Account No",value:e.buyerRefno},{label:"Bank Name",value:e.buyerBankName},{label:"FPX Transaction ID",value:e.fpxTransactionId},{label:"Purchase Order No",value:e.purchaseOrderNo},{label:"Transaction Amount",value:""+e.transactionAmount},{label:"Transaction Date & Time",value:this.datePipe.transform(e.txDateTime,"dd MMMM yyyy h:mm:ss a")}]}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(ML.a),h.lc(c.a),h.lc(s.i),h.lc(c.e),h.lc(T.a),h.lc(Au.a),h.lc(C.a),h.lc(Eu.a),h.lc(p.f))},e.\u0275cmp=h.fc({type:e,selectors:[["bond-checkout"]],features:[h.Tb([p.f,l.a])],decls:49,vars:48,consts:[[3,"nzLoading"],[1,"mb-6",3,"ngClass"],["nzType","flex",3,"nzGutter"],["nz-col","","nzLg","18","nzXs","24"],[1,"h-100"],[4,"ngFor","ngForOf"],[1,"px-2","py-3","mb-3","bg-white"],[1,"font-weight-bold","mb-2"],[1,"text-sm","mb-0"],["nz-col","","nzLg","6","nzXs","24",3,"ngClass"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","space-between",1,"py-1","px-2"],["nz-col",""],["nz-row","",1,"font-weight-bold","text-md"],["nz-row","",1,"text-md"],["nz-col","",1,"text-right"],["nz-button","","nzType","outline","nzSize","small","nzOutline","","nzTooltipPlacement","top","nz-tooltip","",3,"click"],["nz-icon","","nzType","printer","nzTheme","outline","nzTooltipTitle","Print","nzTooltipPlacement","top","nz-tooltip",""],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","left","class","py-1 px-2",4,"ngIf"],["class","px-3 mt-2",4,"ngIf"],["class","px-2 mt-3",4,"ngIf"],["productInfoTemplate",""],[3,"showLocalPaymentModal","paymentMethod","totalAmount","closeLocalPaymentModal","upload","payNow"],[3,"show","paymentMethod","currency","totalAmount","refno","product","cancel","submit"],[3,"refno","nricName","paymentMethod","paymentAmount","fromCurrency","purchaseOrderNo","show","success","backed"],[3,"show","cancel","done"],[3,"fpxPaymentDetails","submittedToFpx"],[3,"isVisible","message","content","ok"],[3,"isVisible","content","done"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","left",1,"py-1","px-2"],[1,"border-top-warning","w-100"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","space-between"],["nz-col","",3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"mr-2","text-warning","text-lg"],[1,"text-danger","text-base"],["class","w-100",3,"orderCartType","isEditOrder","paymentTitle","payNow",4,"ngFor","ngForOf"],[1,"w-100",3,"orderCartType","isEditOrder","paymentTitle","payNow"],["horizontal","true","title","Est Total Payment",3,"value"],["valueTemplate",""],[1,"px-3","mt-2"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","left",1,"py-1"],["nz-button","","nzType","primary",1,"w-100",3,"click"],["nz-button","","nzType","outline",1,"w-100",3,"click"],[1,"px-2","mt-3"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","left",1,"my-2"],["nz-row","","nzType","flex","nzGutter","20","nzJustify","space-between","nzAlign","middle",1,"my-2","product-background","py-3","mx-1"],["nz-col","","nzSpan","24",1,"text-sm","font-weight-bold","text-theme","mb-2"],[4,"ngIf","ngIfElse"],["chequePaymentMethod",""],["nz-col","","nzLg","24"],[1,"text-info","text-sm","font-weight-bold"],["nz-col","","nzLg","5",1,"text-sm","font-weight-bold"],["nz-col","","nzLg","4"],["nz-row","","nzAlign","middle","nzJustify","center","class","text-sm",4,"ngIf"],["nz-row","","nzAlign","middle","nzJustify","center",1,"text-base","font-weight-bold"],["nz-col","","nzLg","3"],["nz-row","","nzAlign","middle","nzJustify","center",1,"text-sm"],["nz-col","","nzLg","5"],["sameCurrencyTemplate",""]],template:function(e,t){1&e&&(h.mc(0,"nz-skeleton",0),h.rc(1,"div",1),h.Ec(2,"async"),h.rc(3,"nz-skeleton",0),h.rc(4,"nz-row",2),h.Ec(5,"async"),h.rc(6,"div",3),h.rc(7,"app-web-scaffold"),h.rc(8,"nz-card",4),h.rc(9,"p"),h.qd(10,"Home / Trade"),h.qc(),h.rc(11,"h3"),h.qd(12,"Your Order has been successfully placed."),h.qc(),h.rc(13,"p"),h.qd(14),h.qc(),h.mc(15,"nz-divider"),h.od(16,TL,2,4,"div",5),h.qc(),h.qc(),h.rc(17,"app-mobile-scaffold"),h.rc(18,"div",6),h.rc(19,"p",7),h.qd(20,"Your order has been successfully placed."),h.qc(),h.rc(21,"p",8),h.qd(22),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(23,"div",9),h.Ec(24,"async"),h.rc(25,"div",10),h.rc(26,"div",11),h.rc(27,"div",12),h.qd(28,"Purchase Order No"),h.qc(),h.rc(29,"div",13),h.qd(30),h.qc(),h.qc(),h.rc(31,"div",14),h.rc(32,"button",15),h.zc("click",(function(){return t.downloadOrderNoForm()})),h.mc(33,"i",16),h.qc(),h.qc(),h.qc(),h.od(34,wL,10,6,"div",17),h.od(35,PL,2,1,"div",17),h.od(36,IL,7,0,"div",18),h.Ec(37,"async"),h.qc(),h.qc(),h.qc(),h.qc(),h.od(38,kL,7,0,"div",19),h.Ec(39,"async"),h.od(40,_L,36,27,"ng-template",null,20,h.pd),h.rc(42,"cheque-fpx-local-modal",21),h.zc("closeLocalPaymentModal",(function(){return t.onCancel()}))("upload",(function(){return t.onSubmitProof()}
5))("payNow",(function(e){return t.onFinishPayNow(e)})),h.qc(),h.rc(43,"foreign-payment-modal",22),h.zc("cancel",(function(){return t.onCancel()}))("submit",(function(){return t.onSubmitProof()})),h.qc(),h.rc(44,"app-upload-deposit-receipt-modal",23),h.zc("success",(function(e){return t.onSuccess(e)}))("backed",(function(e){return t.onBackFromSubmitReceipt(e)})),h.qc(),h.rc(45,"app-success-payment-modal",24),h.zc("cancel",(function(){return t.onCancel()}))("done",(function(){return t.onDoneClick()})),h.qc(),h.rc(46,"fpx-submit-form",25),h.zc("submittedToFpx",(function(){return t.onSubmittedToFpx()})),h.qc(),h.rc(47,"app-fpx-transaction-error-modal",26),h.zc("ok",(function(){return t.closeFpxModel()})),h.qc(),h.rc(48,"app-fpx-transaction-success-modal",27),h.zc("done",(function(){return t.closeFpxModel()})),h.qc()),2&e&&(h.Mc("nzLoading",t.isLoading),h.Ub(1),h.Mc("ngClass",h.Fc(2,36,t.isMobile$)?"":"container"),h.Ub(2),h.Mc("nzLoading",t.isLoading),h.Ub(1),h.Mc("nzGutter",h.Fc(5,38,t.isMobile$)?0:20),h.Ub(10),h.rd(null==t.selectedAcct?null:t.selectedAcct.accountTypeDisplay),h.Ub(2),h.Mc("ngForOf",t.bondContractList),h.Ub(6),h.rd(null==t.selectedAcct?null:t.selectedAcct.accountTypeDisplay),h.Ub(1),h.Mc("ngClass",h.Sc(46,VL,h.Fc(24,40,t.isMobile$))),h.Ub(7),h.rd(t.purchaseOrderNo),h.Ub(4),h.Mc("ngIf",t.showWarningPaymentLabel),h.Ub(1),h.Mc("ngIf",t.paymentModeCat),h.Ub(1),h.Mc("ngIf",!h.Fc(37,42,t.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(39,44,t.isMobile$)),h.Ub(4),h.Mc("showLocalPaymentModal",t.showLocalPaymentModal)("paymentMethod",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentModePay)("totalAmount",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentAmtPay),h.Ub(1),h.Mc("show",t.showForeignPaymentModal)("paymentMethod",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentModePay)("currency",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentCurrency)("totalAmount",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentAmtPay)("refno",t.refno)("product",t.product),h.Ub(1),h.Mc("refno",t.refno)("nricName",null==t.selectedAcct?null:t.selectedAcct.nricName)("paymentMethod",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentModePay)("paymentAmount",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentAmtPay)("fromCurrency",null==t.currentPayingPaymentMethod?null:t.currentPayingPaymentMethod.paymentCurrency)("purchaseOrderNo",t.purchaseOrderNo)("show",t.showUploadReceiptModal),h.Ub(1),h.Mc("show",t.showSuccessModal),h.Ub(1),h.Mc("fpxPaymentDetails",t.fpxPaymentDetails),h.Ub(1),h.Mc("isVisible",t.showFpxPaymentErrorModal)("message","We regret to inform that this FPX payment has failed to proceed. Please make other arrangements for payment.")("content",t.fpxPaymentContent),h.Ub(1),h.Mc("isVisible",t.showFpxPaymentSuccessModal)("content",t.fpxPaymentContent))},directives:[W.a,p.q,P.c,P.a,B.a,I.a,Nu.a,p.s,z.a,_.a,xt.e,k.b,p.t,nh.a,Mh.a,ih.a,oh.a,ch.a,Uu.a,Fu.a,p.A,ge.a,be.c],pipes:[p.b,p.g],styles:[".product-background[_ngcontent-%COMP%]{background-color:#f5f8f9}.border-top-red[_ngcontent-%COMP%]{border-top:5px solid red}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();function $L(e,t){if(1&e&&(h.rc(0,"label",6),h.qd(1),h.qc()),2&e){const e=t.$implicit;h.Mc("nzValue",e.value),h.Ub(1),h.rd(e.label)}}function jL(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-radio-group",4),h.zc("ngModelChange",(function(t){return h.dd(e),h.Dc().selectedTransactionType=t}))("ngModelChange",(function(){h.dd(e);const t=h.Dc();return t.onSelectedTransactionTypeChange(t.selectedTransactionType)})),h.od(1,$L,2,2,"label",5),h.qc()}if(2&e){const e=h.Dc();h.Mc("ngModel",e.selectedTransactionType),h.Ub(1),h.Mc("ngForOf",e.transactionTypeOptions)}}function GL(e,t){1&e&&h.nc(0)}function WL(e,t){if(1&e&&(h.pc(0),h.od(1,GL,1,0,"ng-container",7),h.oc()),2&e){h.Dc();const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function YL(e,t){1&e&&h.nc(0)}function KL(e,t){if(1&e&&(h.pc(0),h.od(1,YL,1,0,"ng-container",7),h.oc()),2&e){h.Dc();const e=h.ad(9);h.Ub(1),h.Mc("ngTemplateOutlet",e)}}function XL(e,t){1&e&&h.mc(0,"router-outlet")}let QL=(()=>{class e{constructor(e,t,n,i,c){this.transactionService=e,this.store=t,this.router=n,this.subHandlingService=i,this.cdRef=c,this.ITransactionTypeEnum=d.d,this.transactionTypeOptions=[{value:d.d.BUY,label:"Buy"},{value:d.d.SELL,label:"Sell"}],this.selectedTransactionType=d.d.BUY}ngOnInit(){this.subscribeTransactionTypeChange(),this.store.dispatch(new u.U(r.b.DPMS)),this.forceUpdateRiskProfile=this.store.selectSnapshot(f.a.isForceRiskProfileUpdate),this.forceUpdateRiskProfile&&(this.show
5ForceUpdateModal=!0)}onSelectedTransactionTypeChange(e){this.selectedTransactionType=e,this.router.navigate([M.o.APP,M.o.TRADE,M.o.DPMS,e])}subscribeTransactionTypeChange(){this.subHandlingService.subscribe(this.selectedTransactionType$.pipe(Object(y.a)(e=>{this.selectedTransactionType=e,this.cdRef.markForCheck()})))}}return e.\u0275fac=function(t){return new(t||e)(h.lc(C.a),h.lc(s.i),h.lc(c.e),h.lc(l.a),h.lc(h.j))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-trade"]],decls:11,vars:10,consts:[["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange",4,"ngIf"],[4,"ngIf"],["routerTemplate",""],[3,"showForceUpdateModal"],["nzButtonStyle","solid","nzSize","small",3,"ngModel","ngModelChange"],["class","px-4","nz-radio-button","",3,"nzValue",4,"ngFor","ngForOf"],["nz-radio-button","",1,"px-4",3,"nzValue"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(h.od(0,jL,2,2,"nz-radio-group",0),h.Ec(1,"async"),h.rc(2,"app-web-scaffold"),h.od(3,WL,2,1,"ng-container",1),h.Ec(4,"async"),h.qc(),h.rc(5,"app-mobile-scaffold"),h.od(6,KL,2,1,"ng-container",1),h.Ec(7,"async"),h.qc(),h.od(8,XL,1,0,"ng-template",null,2,h.pd),h.mc(10,"app-risk-profile-required-modal",3)),2&e&&(h.Mc("ngIf",!h.Fc(1,4,t.isMobile$)),h.Ub(3),h.Mc("ngIf",!h.Fc(4,6,t.isMobile$)),h.Ub(3),h.Mc("ngIf",h.Fc(7,8,t.isMobile$)),h.Ub(4),h.Mc("showForceUpdateModal",t.showForceUpdateModal))},directives:[p.t,B.a,z.a,yI.a,Ut.c,oe.t,oe.w,p.s,Ut.a,p.A,c.j],pipes:[p.b],encapsulation:2}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),Object(o.c)([Object(s.e)(u.X.getSelectedTransactionType)],e.prototype,"selectedTransactionType$",void 0),e})(),ZL=(()=>{class e{}return e.RISK_LEVEL_OPTIONS=[{label:"All",value:""},{label:"Aggressive",value:"Aggressive"},{label:"Moderately Aggressive",value:"Moderately Aggressive"},{label:"Balanced",value:"Balanced"},{label:"Moderately Conservative",value:"Moderately Conservative"},{label:"Conservative",value:"Conservative"}],e.RISK_LEVEL=[{label:"Conservative",value:1},{label:"Moderately Conservative",value:2},{label:"Balanced",value:3},{label:"Moderately Aggressive",value:4},{label:"Aggressive",value:5}],e})();var JL=n("DiG0"),eR=n("hguc");function tR(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-app-bar-2",17),h.zc("back",(function(){return h.dd(e),h.Dc().goBack()})),h.qc()}2&e&&h.Mc("title","Managed Portfolio - Buy")}function nR(e,t){if(1&e&&(h.rc(0,"nz-spin",18),h.mc(1,"nz-skeleton",19),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzLoading",e.isLoading)}}function iR(e,t){1&e&&h.mc(0,"investment-account-selector")}function cR(e,t){if(1&e&&h.mc(0,"nz-option",20),2&e){const e=t.$implicit;h.Mc("nzLabel",e.label)("nzValue",e.value)}}const oR=function(e,t){return{"mb-6 pb-6":e,"infinite-container":t}};function sR(e,t){if(1&e){const e=h.sc();h.pc(0),h.rc(1,"div",21),h.Ec(2,"async"),h.rc(3,"app-trade-product-info",22),h.zc("addDpmsAction",(function(t){return h.dd(e),h.Dc().onAddDpmsProduct(t)})),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc();h.Ub(1),h.Mc("ngClass",h.Tc(8,oR,h.Fc(2,6,e.isMobile$),e.dpmsTradeProductInfoList.length>=7)),h.Ub(2),h.Mc("header1","Min Investment Amt")("header2","Portfolio Currency")("isDpms",!0)("showAddToCartBtn",!0)("tradeProductInfoList",e.dpmsTradeProductInfoList)}}function aR(e,t){if(1&e){const e=h.sc();h.rc(0,"dpms-buy-order-cart-sider",24),h.zc("appBarBack",(function(){return h.dd(e),h.Dc(2).onMobileBack()})),h.qc()}}function lR(e,t){if(1&e&&(h.pc(0),h.od(1,aR,1,0,"dpms-buy-order-cart-sider",23),h.oc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("ngIf",e.hideProductList&&e.previewCart)}}function rR(e,t){if(1&e&&h.mc(0,"img",25),2&e){const e=h.Dc();h.Mc("src",e.transactionImgPath+"filterIcon.svg",h.gd)("alt","filter")}}function dR(e,t){1&e&&h.nc(0)}function uR(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-mobile-drawer",26),h.zc("showChange",(function(){return h.dd(e),h.Dc().onRiskModalClosed()}))("showChange",(function(t){return h.dd(e),h.Dc().showRiskModal=t})),h.od(1,dR,1,0,"ng-container",27),h.rc(2,"div",28),h.rc(3,"button",29),h.zc("click",(function(){return h.dd(e),h.Dc().onRiskModalClosed()})),h.qd(4,"Cancel"),h.qc(),h.rc(5,"button",30),h.zc("click",(function(){return h.dd(e),h.Dc().onShowDpmsFillDetail()})),h.qd(6,"Confirm"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(32);h.Mc("show",e.showRiskModal)("hideButtons",!0),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function hR(e,t){1&e&&h.nc(0)}function pR(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",31),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onRiskModalClosed()})),h.rc(1,"div",32),h.od(2,hR,1,0,"ng-container",27),h.qc(),h.rc(3,"div",33),h.rc(4,"button",34),h.zc("click",(function(){return h.dd(e),h.Dc().onRiskModalClosed()})),h.qd(5,"Cancel"),h.qc(),h.rc(6,"button",35),h.zc("click",(function(){return h.dd(e),h.Dc().onShowDpmsFillDetail()})),h.qd(7,"Confirm"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(32);h.Mc("nzFooter",null)("nzTitle",null)("nzVisible",e.showRiskModal),h.Ub(2),h.Mc("ngTemplateOutlet",t)}}function mR(e,t){1&e&&(h.rc(0,"nz-row"),h.rc(1,"nz-col",36),h.mc(2,"i",37),h.qc(),h.rc(3,"nz-col",38),h.rc(4,"span",39),h.qd(5,"You are taking too much risk."),h.qc(),h.qc(),h.qc(),h.rc(6,"nz-row",40),h.rc(7,"nz-col",41),h.qd(8," I/We notice that my/our selected investments belong to a risk class higher than my/our tolerance. FSM has already provided the appropriate and necessary w
5arning on the risks associated with the investments to ensure my/our awareness on the risk mismatch and potential losses. Despite this, I/we consider my/our selected investments are suitable for my/our personal circumstances and decide to proceed with my/our transaction request(s). "),h.qc(),h.qc())}function fR(e,t){if(1&e){const e=h.sc();h.rc(0,"app-transaction-mobile-view-cart-bar",42),h.zc("viewCart",(function(){return h.dd(e),h.Dc().viewCart()})),h.qc()}if(2&e){const e=h.Dc();h.Mc("hideProductList",e.hideProductList)("itemCount",e.cartList.length)("previewCart",e.previewCart)}}const gR=function(e,t){return{"bg-lighter shadow":e,"d-none":t}},bR=function(e){return{"bg-white shadow w-100":e}},SR=function(e){return{"px-2":e}},yR=function(e){return{"pt-3":e}};let vR=(()=>{class e{constructor(e,t,n,i,c,o,s){this.store=e,this.cdRef=t,this.activatedRoute=n,this.mobileBottomNavBarService=i,this.transactionService=c,this.subHandlingService=o,this.transactionDpmsRestService=s,this.riskLevelFilterOptions=ZL.RISK_LEVEL_OPTIONS,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.refno=this.store.selectSnapshot(f.a.getPrimaryAccount).refno,this.cartList=this.store.selectSnapshot(u.k.getCartList)(this.refno),this.dpmsBuyList=[],this.dpmsTradeProductInfoList=[],this.memoDpmsTradeProductInfoList=[],this.selectedRiskLevel="",this.isUpdate=!1,this.showRiskModal=!1,this.showForceUpdateModal=!1,this.incomePortfolioPopUp=!1,this.riskFilterFn=e=>e.riskLevel===this.selectedRiskLevel||""==this.selectedRiskLevel}ngOnInit(){this.mobileBottomNavBarService.showMobileBottomNavBar(!1),this.store.dispatch(new u.V(d.d.BUY));const e=this.activatedRoute.snapshot.queryParams,{refno:t,sedolnumber:n,globalIncomePortfolio:i}=e;t&&(this.refno=t,this.cartList=this.store.selectSnapshot(u.k.getCartList)(t)),this.incomePortfolioPopUp="Y"==i,this.dpmsIdPopUp=n,this.store.dispatch(new u.N(this.refno));const c=this.store.select(u.X.getSelectedRefno).pipe(Object(b.a)(),Object(y.a)(e=>{this.refno=e,this.loadBuyList(),this.transactionService.removeBuyDpmsOrderPlaced(),this.cdRef.markForCheck()})),o=this.store.select(u.k.getCartList).pipe(Object(y.a)(e=>{const t=e(this.refno);this.refreshProductList(t)}));this.subHandlingService.subscribe(c),this.subHandlingService.subscribe(o)}loadBuyList(){const e=this.refno,t=this.transactionDpmsRestService.getDpmsBuyList(e).pipe(Object(y.a)(t=>{if((null==t?void 0:t.status)!==M.a.RESPONSE_SUCCESS)return;const n=null==t?void 0:t.data,{clientRiskProfile:i,dpmsPortfolioList:c}=n,o=[...c].sort((e,t)=>JL.a.PORTFOLIO_SEQUENCE.indexOf(e.dpmsPortfolioName)-JL.a.PORTFOLIO_SEQUENCE.indexOf(t.dpmsPortfolioName));this.dpmsBuyList=o;const s=this.store.selectSnapshot(u.k.getCartList)(e);this.refreshProductList(s),this.userRiskLevel=i;const a=this.store.selectSnapshot(f.a.getPrimaryAccount).refno===e;this.showForceUpdateModal=a&&!i,this.incomePortfolioPopUp&&(this.selectGlobalIncomePortfolio(),this.incomePortfolioPopUp=!1),this.dpmsIdPopUp&&(this.onAddDpmsProduct(this.dpmsIdPopUp),this.dpmsIdPopUp=null)}),Object(uv.a)(()=>this.isLoading=!1));this.isLoading=!0,this.subHandlingService.once(t)}refreshProductList(e){this.cartList=e,this.memoDpmsTradeProductInfoList=this.dpmsBuyList.map(t=>MR(t,e)),this.dpmsTradeProductInfoList=this.memoDpmsTradeProductInfoList.filter(this.riskFilterFn)}onRiskModalClosed(){this.showRiskModal=!1}onShowDpmsFillDetail(){this.showRiskModal=!1,this.showDpmsFillDetail=!0,this.isMobile$&&(this.hideProductList=!0);const e=this.transactionDpmsRestService.getDpmsBuyDetails(this.selectedDpms.dpmsPortfolioId,this.refno).pipe(Object(y.a)(e=>this.selectedDpmsDetail=e.status!==M.a.RESPONSE_SUCCESS?null:e.data),Object(uv.a)(()=>this.isLoadingFillDetail=!1));this.isLoadingFillDetail=!0,this.subHandlingService.once(e)}selectGlobalIncomePortfolio(){var e;const t=null===(e=this.dpmsBuyList.find(e=>"Cash"==e.dividendOption))||void 0===e?void 0:e.dpmsPortfolioId;this.onAddDpmsProduct(t)}onAddDpmsProduct(e){var t,n,i,c;if(this.selectedDpms=this.dpmsBuyList.find(t=>t.dpmsPortfolioId===e),!this.selectedDpms)return;const o=this.refno;this.store.selectSnapshot(u.k.getCartList)(o).find(e=>e.dpmsBuyModel.dpmsPortfolioId==this.selectedDpms.dpmsPortfolioId)||((null!==(n=null===(t=ZL.RISK_LEVEL.find(e=>e.label===this.userRiskLevel))||void 0===t?void 0:t.value)&&void 0!==n?n:0)<(null!==(c=null===(i=ZL.RISK_LEVEL.find(e=>e.label===this.selectedDpms.riskLevel))||void 0===i?void 0:i.value)&&void 0!==c?c:0)?this.showRiskModal=!0:this.onShowDpmsFillDetail())}onFilterSelected(e){this.selectedRiskLevel=e,this.dpmsTradeProductInfoList=this.memoDpmsTradeProductInfoList.filter(this.riskFilterFn)}onDpmsFillDetailClosed(){this.showDpmsFillDetail=!1,this.hideProductList=!1,this.isUpdate=!1}viewCart(){this.hideProductList=!0,this.previewCart=!0}onMobileBack(){this.hideProductList=!1,this.previewCart=!1}goBack(){window.history.back()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(s.i),h.lc(h.j),h.lc(c.a),h.lc(eR.a),h.lc(C.a),h.lc(l.a),h.lc(Hr.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-buy"]],features:[h.Tb([l.a])],decls:35,vars:51,consts:[[3,"title","back",4,"ngIf"],["loadingTemplate",""],[1,"border-top"],[4,"ngIf"],[3,"ngClass"],["nzType","flex",1,"mt-3",3,"ngClass"],["nzSpan","24","nz-col",""],["nzShowSearch","",1,"w-100",3,"nzSuffixIcon","ngModel","ngModelChange"],[3,"nzLabel","nzValue",4,"ngFor","ngForOf"],[4,"ngIf","ngIfElse"],[3,"addedDpms","selectedDpmsName","platformFeeRate","selectedDpmsDetail","refno","show","isLoading","isUpdate","closed"],["suffixFilterIcon",""],[3,"show","hideButtons","showChange",4,"ngIf"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel",4,"ngIf"],["riskModal",""],[3,"hideProductList","itemCount","previewCart","viewCart",4,"ngIf"],[3,"showForceUpdateModal"],[3,"title","back"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzLoading"],[3,"nzLabel","nzValue"],[1,"pt-3",3,"ngClass"],[3,"header1","header2","isDpms","showAddToCartBtn","tradeProductInfoList","addDpmsAction"],[3,"appBarBack",4,"ngIf"],[3,"appBarBack"],[1,"img-fluid",3,"src","alt"],[3,"show","hideButtons","showChange"],[4,"ngTemplateOutlet"],[1,"fixed-bottom","bg-white","shadow","p-2","mt-3"],["nz-button","","nzType","outline",1,"w-100","my-1",3,"click"],["nz-button","","nzType","primary",1,"w-100","my-1",3,"click"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel"],[1,"p-2"],[1,"d-flex","justify-content-end","align-items-center","p-2","mt-3"],["nz-button","","nzType","outline",1,"px-3","mr-2",3,"click"],["nz-button","","nzType","primary",3,"click"],["nzSpan","2"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-warning","mr-2","text-xl"],["nzSpan","22"],[1,"font-weight-bold","text-lg"],[1,"pt-3"],["nzOffset","2","nzSpan","22"],[3,"hideProductList","itemCount","previewCart","viewCart"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.od(1,tR,1,1,"b2c-app-bar-2",0),h.qc(),h.od(2,nR,2,2,"ng-template",null,1,h.pd),h.rc(4,"app-mobile-scaffold"),h.rc(5,"div",2),h.od(6,iR,1,0,"investment-account-selector",3),h.Ec(7,"async"),h.qc(),h.qc(),h.rc(8,"div",4),h.Ec(9,"async"),h.Ec(10,"async"),h.rc(11,"div",4),h.Ec(12,"async"),h.rc(13,"div",4),h.Ec(14,"async"),h.rc(15,"nz-row",5),h.Ec(16,"async"),h.rc(17,"div",6),h.rc(18,"nz-select",7),h.zc("ngModelChange",(function(e){return t.onFilterSelected(e)}))("ngModelChange",(function(e){return t.selectedRiskLevel=e})),h.od(19,cR,1,2,"nz-option",8),h.qc(),h.qc(),h.qc(),h.od(20,sR,4,11,"ng-container",9),h.qc(),h.qc(),h.qc(),h.rc(21,"dpms-buy-fill-detail",10),h.zc("closed",(function(){return t.onDpmsFillDetailClosed()})),h.qc(),h.rc(22,"app-mobile-scaffold"),h.od(23,lR,2,1,"ng-container",3),h.Ec(24,"async"),h.qc(),h.od(25,rR,1,2,"ng-template",null,11,h.pd),h.od(27,uR,7,3,"b2c-mobile-drawer",12),h.Ec(28,"async"),h.od(29,pR,8,4,"nz-modal",13),h.Ec(30,"async"),h.od(31,mR,9,0,"ng-template",null,14,h.pd),h.od(33,fR,1,3,"app-transaction-mobile-view-cart-bar",15),h.mc(34,"app-risk-profile-required-modal",16)),2&e){const e=h.ad(3),n=h.ad(26);h.Ub(1),h.Mc("ngIf",!t.previewCart&&!t.hideProductList),h.Ub(5),h.Mc("ngIf",h.Fc(7,24,t.isMobile$)&&!t.hideProductList),h.Ub(2),h.Mc("ngClass",h.Tc(42,gR,h.Fc(9,26,t.isMobile$),(t.previewCart||t.hideProductList)&&h.Fc(10,28,t.isMobile$))),h.Ub(3),h.Mc("ngClass",h.Sc(45,bR,h.Fc(12,30,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(47,SR,h.Fc(14,32,t.isMobile$))),h.Ub(2),h.Mc("ngClass",h.Sc(49,yR,h.Fc(16,34,t.isMobile$))),h.Ub(3),h.Mc("nzSuffixIcon",
5n)("ngModel",t.selectedRiskLevel),h.Ub(1),h.Mc("ngForOf",t.riskLevelFilterOptions),h.Ub(1),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(1),h.Mc("addedDpms",t.cartList)("selectedDpmsName",null==t.selectedDpms?null:t.selectedDpms.dpmsPortfolioName)("platformFeeRate",null==t.selectedDpms?null:t.selectedDpms.platformFeeRate)("selectedDpmsDetail",t.selectedDpmsDetail)("refno",t.refno)("show",t.showDpmsFillDetail)("isLoading",t.isLoadingFillDetail)("isUpdate",t.isUpdate),h.Ub(2),h.Mc("ngIf",h.Fc(24,36,t.isMobile$)),h.Ub(4),h.Mc("ngIf",h.Fc(28,38,t.isMobile$)),h.Ub(2),h.Mc("ngIf",!h.Fc(30,40,t.isMobile$)),h.Ub(4),h.Mc("ngIf",!t.showRiskModal),h.Ub(1),h.Mc("showForceUpdateModal",t.showForceUpdateModal)}},directives:[z.a,p.t,p.q,P.c,P.a,Xv.d,oe.t,oe.w,p.s,Ld,yI.a,D.a,Il.a,W.a,ut.a,Xv.a,A.a,lg,G.a,p.A,_.a,j.a,k.b,BU],pipes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const MR=(e,t=[])=>({paymentMethod:null,dpmsPortfolioId:e.dpmsPortfolioId,dpmsPortfolioName:e.dpmsPortfolioName,minInvestmentAmount:e.minSubscribeAmt,minInvestmentAmountCurrency:e.currencyCode,addedToCart:t.some(t=>{var n;return(null===(n=t.dpmsBuyModel)||void 0===n?void 0:n.dpmsPortfolioId)===e.dpmsPortfolioId}),appliedPromoCode:null,profitLossAmount:null,profitLossCurrency:null,profitLossPercentage:null,riskLevel:e.riskLevel,rebalancingFlag:e.rebalancingFlag});function CR(e,t){if(1&e){const e=h.sc();h.rc(0,"b2c-app-bar-2",15),h.zc("back",(function(){return h.dd(e),h.Dc().goBack()})),h.qc()}2&e&&h.Mc("title","Managed Portfolio - Sell")}function qR(e,t){1&e&&h.mc(0,"investment-account-selector")}function TR(e,t){if(1&e&&(h.rc(0,"div",19),h.rc(1,"div",20),h.rc(2,"div",21),h.rc(3,"p",22),h.qd(4,"You do not have any Portfolios available for sell."),h.qc(),h.qc(),h.qc(),h.rc(5,"div",23),h.mc(6,"img",24),h.qc(),h.qc()),2&e){const e=h.Dc(2);h.Ub(6),h.Mc("src",e.transactionImgPath+"emptyCart.svg",h.gd)("alt","empty cart")}}function wR(e,t){if(1&e&&h.mc(0,"nz-option",31),2&e){const e=t.$implicit;h.Mc("nzLabel",e.productName)("nzValue",e.productCode)("nzDisabled",0===e.availableValue)}}const zR=function(e,t){return{"mb-6 pb-4":e,"infinite-container mt-2":t}};function DR(e,t){if(1&e){const e=h.sc();h.rc(0,"div",25),h.rc(1,"div",26),h.rc(2,"nz-select",27),h.zc("ngModelChange",(function(t){h.dd(e);const n=h.Dc(2);return n.checkExist(t)?n.onDpmsFillDetailClosed():n.onDpmsSelected(t)}))("nzOnSearch",(function(t){return h.dd(e),h.Dc(2).onSearchDpmsPortfolio(t)}))("ngModelChange",(function(t){return h.dd(e),h.Dc(2).searchDpmsPortfolio=t})),h.od(3,wR,1,3,"nz-option",28),h.qc(),h.qc(),h.qc(),h.pc(4),h.rc(5,"div",29),h.Ec(6,"async"),h.rc(7,"app-trade-product-info",30),h.zc("addDpmsAction",(function(t){return h.dd(e),h.Dc(2).onDpmsSelected(t)})),h.qc(),h.qc(),h.oc()}if(2&e){const e=h.Dc(2),t=h.ad(21);h.Ub(1),h.Mc("nzLg",24),h.Ub(1),h.Mc("ngModel",e.searchDpmsPortfolio)("nzSuffixIcon",t),h.Ub(1),h.Mc("ngForOf",e.dpmsHoldingList),h.Ub(2),h.Mc("ngClass",h.Tc(13,zR,h.Fc(6,11,e.isMobile$),e.dpmsTradeProductInfoList.length>=7)),h.Ub(2),h.Mc("header1","Market Value")("header2","Profit / Loss")("isDpms",!0)("showAddToCartBtn",!0)("showProfitLoss",!0)("tradeProductInfoList",e.dpmsTradeProductInfoList)}}function PR(e,t){if(1&e&&(h.rc(0,"div",16),h.od(1,TR,7,2,"div",17),h.od(2,DR,8,16,"ng-template",null,18,h.pd),h.qc()),2&e){const e=h.ad(3),t=h.Dc();h.Ub(1),h.Mc("ngIf",0===(null==t.dpmsHoldingList?null:t.dpmsHoldingList.length)||null===(null==t.dpmsHoldingList?null:t.dpmsHoldingList.length))("ngIfElse",e)}}function IR(e,t){1&e&&h.nc(0)}function kR(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-modal",32),h.zc("nzOnCancel",(function(){return h.dd(e),h.Dc().onImportantNoteClosed()})),h.od(1,IR,1,0,"ng-container",33),h.rc(2,"div",34),h.rc(3,"button",35),h.zc("click",(function(){return h.dd(e),h.Dc().onShowDpmsFillDetail()})),h.qd(4,"Understand"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(17);h.Mc("nzFooter",null)("nzTitle",null)("nzVisible",e.showImportantNote)("nzWidth",505),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}function AR(e,t){1&e&&h.nc(0)}function ER(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",36),h.zc("nzOnClose",(function(){return h.dd(e),h.Dc().onImportantNoteClosed()})),h.od(1,AR,1,0,"ng-container",33),h.rc(2,"b2c-floating-bar"),h.rc(3,"button",37),h.zc("click",(function(){return h.dd(e),h.Dc().onShowDpmsFillDetail()})),h.qd(4,"Understand"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc(),t=h.ad(17);h.Mc("nzVisible",e.showImportantNote)("nzPlacement","bottom")("nzHeight",300),h.Ub(1),h.Mc("ngTemplateOutlet",t)}}const FR=function(e){return{"text-md":e}},OR=function(e){return{"text-sm":e}};function UR(e,t){if(1&e&&(h.rc(0,"nz-row",38),h.rc(1,"nz-col",39),h.mc(2,"i",40),h.qc(),h.rc(3,"nz-col",41),h.rc(4,"h3",42),h.Ec(5,"async"),h.qd(6,"Important Note"),h.qc(),h.rc(7,"p",43),h.Ec(8,"async"),h.qd(9," Redemption of your portfolio will take place at a time where transactions are currently in progress ("),h.rc(10,"span",44),h.qd(11,"rebalancing, top-up, etc"),h.qc(),h.qd(12,") should we proceed with the redemption now."),h.mc(13,"br"),h.mc(14,"br"),h.qc(),h.rc(15,"p",4),h.Ec(16,"async"),h.qd(17," This may result in redemption amount that is not reflective of the exact value of the portfolio. However, if redemption of portfolio is carried on
5now, the residual units can still be sold post completion of the transactions. "),h.qc(),h.qc(),h.qc()),2&e){const e=h.Dc();h.Ub(1),h.Mc("nzSpan",2),h.Ub(2),h.Mc("nzSpan",22),h.Ub(1),h.Mc("ngClass",h.Sc(11,FR,h.Fc(5,5,e.isMobile$))),h.Ub(3),h.Mc("ngClass",h.Sc(13,OR,h.Fc(8,7,e.isMobile$))),h.Ub(8),h.Mc("ngClass",h.Sc(15,OR,h.Fc(16,9,e.isMobile$)))}}function xR(e,t){if(1&e&&(h.rc(0,"nz-spin",45),h.mc(1,"nz-skeleton",46),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzLoading",e.isLoading)}}function LR(e,t){1&e&&h.mc(0,"em",47)}function RR(e,t){if(1&e){const e=h.sc();h.rc(0,"dpms-sell-order-cart-sider",48),h.zc("mobileBack",(function(){return h.dd(e),h.Dc().onMobileBack()})),h.qc()}2&e&&h.Mc("mobilePreviewCart",!0)}function NR(e,t){if(1&e){const e=h.sc();h.rc(0,"nz-drawer",36),h.zc("nzOnClose",(function(){return h.dd(e),h.Dc().onCloseNoHoldingsDrawer()})),h.rc(1,"nz-row",38),h.rc(2,"nz-col",39),h.mc(3,"i",49),h.qc(),h.rc(4,"nz-col",41),h.rc(5,"h3",42),h.Ec(6,"async"),h.qd(7,"Warning"),h.qc(),h.rc(8,"p"),h.qd(9,"No Available Holdings to Sell"),h.qc(),h.qc(),h.qc(),h.rc(10,"div",34),h.rc(11,"button",35),h.zc("click",(function(){return h.dd(e),h.Dc().onCloseNoHoldingsDrawer()})),h.qd(12,"Done"),h.qc(),h.qc(),h.qc()}if(2&e){const e=h.Dc();h.Mc("nzVisible",e.showNoHoldingsDrawer)("nzPlacement","bottom")("nzHeight",180),h.Ub(2),h.Mc("nzSpan",2),h.Ub(2),h.Mc("nzSpan",22),h.Ub(1),h.Mc("ngClass",h.Sc(8,FR,h.Fc(6,6,e.isMobile$)))}}const BR=function(e){return{"d-none":e}},_R=function(e,t){return{"bg-lighter shadow":e,"d-none":t}},VR=function(e){return{"bg-white pt-3 shadow w-100 container":e}};let HR=(()=>{class e{constructor(e,t,n,i,c,o){this.subHandlingService=e,this.transactionDpmsRestService=t,this.store=n,this.cdRef=i,this.transactionService=c,this.activatedRoute=o,this.transactionImgPath=M.g.TRANSACTION_IMG_PATH,this.dpmsHoldingList=[],this.tempDpmsHoldingList=[],this.cart=[],this.dpmsTradeProductInfoList=[],this.showDpmsFillDetail=!1,this.showNoHoldingsDrawer=!1,this.showErrorMessageModal=!1}ngOnInit(){this.refno=this.store.selectSnapshot(f.a.getPrimaryAccount).refno,this.store.dispatch(new u.V(d.d.SELL)),this.subscribeRefnoChange()}getDpmsHoldingList(){this.refno&&(this.isLoading=!0,this.subHandlingService.once(this.transactionDpmsRestService.getDpmsHoldingList(this.refno).pipe(Object(y.a)(e=>{this.isLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&(this.holdingDisplayModel=e.data,this.dpmsHoldingList=this.holdingDisplayModel,this.tempDpmsHoldingList=Object(g.a)(this.dpmsHoldingList),this.dpmsTradeProductInfoList=this.dpmsHoldingList.map(e=>this.mapTradeProductInfo(e)),this.refreshProductList(),this.subscribeParam())}))))}onImportantNoteClosed(){this.showImportantNote=!1}onShowDpmsFillDetail(){this.showDpmsFillDetail=!0,this.isMobile$&&(this.hideProductList=!0)}subscribeRefnoChange(){this.subHandlingService.subscribe(this.refno$.pipe(Object(y.a)(e=>{e&&(this.refno=e),this.cdRef.markForCheck(),this.getDpmsHoldingList(),this.cartList$=this.store.select(u.H.getCartList).pipe(Object(S.a)(e=>e(this.refno))),this.subscribeCartList(),this.transactionService.removeSellDpmsOrderPlaced()})))}mapTradeProductInfo(e){var t;return{paymentMethod:null,dpmsPortfolioId:e.productCode,dpmsPortfolioName:e.productName,minInvestmentAmount:e.availableValue,minInvestmentAmountCurrency:e.dpmsCurrencyCode,addedToCart:!!(null===(t=this.cart)||void 0===t?void 0:t.find(t=>t.dpmsSellModel.dpmsPortfolioId===e.productCode)),profitLossAmount:e.availableValue/(1+e.profitPercentage/100)*e.profitPercentage/100,profitLossCurrency:e.dpmsCurrencyCode,profitLossPercentage:+Object(p.L)(e.profitPercentage,M.a.LOCALE_EN,"1.2-2"),paymentMethodForCheck:e.paymentMethod}}subscribeCartList(){this.subHandlingService.subscribe(this.cartList$.pipe(Object(y.a)(e=>{this.cart=e,this.cdRef.markForCheck()}),Object(y.a)(()=>this.refreshProductList())))}refreshProductList(){var e;this.dpmsTradeProductInfoList=null===(e=this.dpmsHoldingList)||void 0===e?void 0:e.map(e=>this.mapTradeProductInfo(e)).sort((e,t)=>e.dpmsPortfolioName>t.dpmsPortfolioName?1:t.dpmsPortfolioName>e.dpmsPortfolioName?-1:0)}onDpmsSelected(e){""!==e&&(this.selectedDpms=this.dpmsHoldingList.find(t=>
5t.productCode===e),this.isMobile$&&0===this.selectedDpms.availableValue?this.showNoHoldingsDrawer=!0:(console.log("come in sell part"),console.log(this.selectedDpms),this.selectedDpms.gotProcessBuy||this.selectedDpms.gotProcessSwitch?(this.errorMessage="Please be informed that there are processing transaction i.e, rebalancing or top up. Hence, the redemption amount that you receive may be lesser than your portfolio value for now.",this.selectedDpms.gotProcessBuy&&!this.selectedDpms.gotProcessSwitch?this.errorMessage="Please be informed that your recent top up transaction is being processed. Hence, the redemption amount that you receive from selling your managed portfolio will exclude the top up amount. The top up amount will be reflected in your holding after the transaction is completed.":!this.selectedDpms.gotProcessBuy&&this.selectedDpms.gotProcessSwitch&&(this.errorMessage="Please be informed that we are in the midst of rebalancing FSMOne Managed Portfolios. Hence, the redemption amount that you receive may be lesser than your portfolio value for now. After rebalancing is completed, the remaining balance of the redemption amount will be credited into your cash account. We apologise for any inconvenience caused"),this.showErrorMessageModal=!0):(this.errorMessage="",this.onShowDpmsFillDetail())))}onSearchDpmsPortfolio(e){var t;this.dpmsHoldingList=e?null===(t=this.tempDpmsHoldingList)||void 0===t?void 0:t.filter(t=>{var n;return-1!==(null===(n=t.productName)||void 0===n?void 0:n.toLowerCase().indexOf(e.toLowerCase()))}):this.tempDpmsHoldingList}onDpmsFillDetailClosed(){this.showDpmsFillDetail=!1,this.hideProductList=!1,this.previewCart=!1}checkExist(e){var t;return!e||(null===(t=this.cart.find(t=>t.dpmsSellModel.dpmsPortfolioId===e))||void 0===t?void 0:t.orderStatus)===U.a.ADDED_TO_CART}viewCart(){this.hideProductList=!0,this.previewCart=!0}onMobileBack(){this.hideProductList=!1,this.previewCart=!1}onCloseNoHoldingsDrawer(){this.showNoHoldingsDrawer=!1}subscribeParam(){var e;let t;this.subHandlingService.subscribe(null===(e=this.activatedRoute)||void 0===e?void 0:e.queryParams.pipe(Object(aa.a)(e=>e&&e.sedolnumber||e.refno||e.paymentMethod),Object(S.a)(({sedolnumber:e,refno:n})=>t={refno:n,sedolnumber:e}),Object(y.a)(e=>{e.refno&&this.store.dispatch(new u.N(e.refno)),e.sedolnumber&&this.checkExist(e.sedolnumber)?this.onDpmsFillDetailClosed():e.sedolnumber&&this.onDpmsSelected(e.sedolnumber)})))}goBack(){window.history.back()}onCloseErrorMessage(){this.showErrorMessageModal=!1,this.onShowDpmsFillDetail()}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(Hr.a),h.lc(s.i),h.lc(h.j),h.lc(C.a),h.lc(c.a))},e.\u0275cmp=h.fc({type:e,selectors:[["app-dpms-sell"]],features:[h.Tb([l.a])],decls:31,vars:47,consts:[[1,"border-bottom"],[3,"title","back",4,"ngIf"],[1,"mb-3",3,"ngClass"],[4,"ngIf"],[3,"ngClass"],["class","",4,"ngIf","ngIfElse"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzWidth","nzOnCancel",4,"ngIf"],[3,"nzVisible","nzPlacement","nzHeight","nzOnClose",4,"ngIf"],["importantNote",""],["loadingTemplate",""],["prefixIconSearch",""],[3,"selectedDpms","isUpdate","show","addedDpms","closed","appBarBack"],[3,"mobilePreviewCart","mobileBack",4,"ngIf"],[3,"hideProductList","itemCount","previewCart","viewCart"],[3,"errorMessage","showErrorMessageModal","closeErrorMessageModal"],[3,"title","back"],[1,""],["class","text-center mt-5 pt-5",4,"ngIf","ngIfElse"],["elseBlock",""],[1,"text-center","mt-5","pt-5"],[1,"mt-6"],[1,"mx-5"],[1,"text-black-5"],[1,"text-center","mt-6","mb-3","pb-2"],[1,"img-fluid",3,"src","alt"],["nz-row","","nzGutter","16",1,"mt-3"],["nz-col","",3,"nzLg"],["nzAllowClear","","nzPlaceHolder","Select the portfolio you wish to redeem","nzServerSearch","","nzShowSearch","",1,"w-100",3,"ngModel","nzSuffixIcon","ngModelChange","nzOnSearch"],[3,"nzLabel","nzValue","nzDisabled",4,"ngFor","ngForOf"],[1,"pt-3",3,"ngClass"],[3,"header1","header2","isDpms","showAddToCartBtn","showProfitLoss","tradeProductInfoList","addDpmsAction"],[3,"nzLabel","nzValue","nzDisabled"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzWidth","nzOnCancel"],[4,"ngTemplateOutlet"],[1,"d-flex","justify-content-end","p-2","mt-3"],["nz-button","","nzType","primary",3,"click"],[3,"nzVisible","nzPlacement","nzHeight","nzOnClose"],["nz-button","","nzBlock","","nzType","primary",3,"click"],[1,"pt-2"],[3,"nzSpan"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-warning","text-xl"],[1,"pl-2","mt-1",3,"nzSpan"],[1,"d-inline-block",3,"ngClass"],[1,"mb-0",3,"ngClass"],[1,"font-weight-bold"],["nzTip","Loading...",3,"nzSpinning"],[3,"nzLoading"],["nz-icon","","nzType","search",1,"text-md"],[3,"mobilePreviewCart","mobileBack"],["nz-icon","","nzTheme","fill","nzType","exclamation-circle",1,"text-accent-1","text-xl"]],template:function(e,t){if(1&e&&(h.rc(0,"app-mobile-scaffold"),h.rc(1,"div",0),h.od(2,CR,1,1,"b2c-app-bar-2",1),h.qc(),h.rc(3,"div",2),h.od(4,qR,1,0,"investment-account-selector",3),h.Ec(5,"async"),h.qc(),h.qc(),h.rc(6,"div",4),h.Ec(7,"async"),h.Ec(8,"async"),h.rc(9,"div",4),h.Ec(10,"async"),h.od(11,PR,4,2,"div",5),h.qc(),h.qc(),h.od(12,kR,5,5,"nz-modal",6),h.Ec(13,"async"),h.od(14,ER,5,4,"nz-drawer",7),h.Ec(15,"async"),h.od(16,UR,18,17,"ng-template",null,8,h.pd),h.od(18,xR,2,2,"ng-template",null,9,h.pd),h.od(20,LR,1,0,"ng-template",null,10,h.pd),h.rc(22,"app-dpms-sell-fill-detail",11),h.zc("closed",(function(){return t.onDpmsFillDetailClosed()}))("appBarBack",(function(){return t.onDpmsFillDetailClosed()})),h.Ec(23,"async"),h.qc(),h.od(24,RR,1,1,"dpms-sell-order-cart-sider",12),h.Ec(25,"async"),h.rc(26,"app-transaction-mobile-view-cart-bar",13),h.zc("viewCart",(function(){return t.viewCart()})),h.Ec(27,"async"),h.qc(),h.od(28,NR,13,10,"nz-drawer",7),h.Ec(29,"async"),h.rc(30,"checkout-error-message-modal",14),h.zc("closeErrorMessageModal",(function(){return t.onCloseErrorMessage()})),h.qc()),2&e){const e=h.ad(19);var n;const i=null==(n=h.Fc(27,36,t.cartList$))?null:n.length;h.Ub(2),h.Mc("ngIf",!t.previewCart&&!t.hideProductList),h.Ub(1),h.Mc("ngClass",h.Sc(40,BR,t.hideProductList)),h.Ub(1),h.Mc("ngIf",h.Fc(5,20,t.isMobile$)),h.Ub(2),h.Mc("ngClass",h.Tc(42,_R,h.Fc(7,22,t.isMobile$),(t.previewCart||t.hideProductList)&&h.Fc(8,24,t.isMobile$))),h.Ub(3),h.Mc("ngClass",h.Sc(45,VR,h.Fc(10,26,t.isMobile$))),h.Ub(2),h.Mc("ngIf",!t.isLoading)("ngIfElse",e),h.Ub(1),h.Mc("ngIf",!h.Fc(13,28,t.isMobile$)),h.Ub(2),h.Mc("ngIf",h.Fc(15,30,t.isMobile$)),h.Ub(8),h.Mc("selectedDpms",t.selectedDpms)("isUpdate",!1)("show",t.showDpmsFillDetail)("addedDpms",h.Fc(23,32,t.cartList$)),h.Ub(2),h.Mc("ngIf",h.Fc(25,34,t.isMobile$)&&t.previewCart),h.Ub(2),h.Mc("hideProductList",t.hideProductList)("itemCount",i)("previewCart",t.previewCart),h.Ub(2),h.Mc("ngIf",h.Fc(29,38,t.isMobile$)),h.Ub(2),h.Mc("errorMessage",t.errorMessage)("showErrorMessageModal",t.showErrorMessageModal)}},directives:[z.a,p.t,p.q,vu,BU,ne,D.a,ut.a,P.c,P.a,Xv.d,oe.t,oe.w,p.s,A.a,Xv.a,j.a,p.A,_.a,Eg.a,Se.a,k.b,Il.a,W.a,vg],pi
5pes:[p.b],styles:[".infinite-container[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto;overflow-x:hidden}"]}),Object(o.c)([Object(s.e)(u.X.getSelectedRefno)],e.prototype,"refno$",void 0),Object(o.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})();var $R=n("PE/g");function jR(e,t){if(1&e&&(h.rc(0,"nz-spin",25),h.mc(1,"nz-skeleton",4),h.qc()),2&e){const e=h.Dc();h.Mc("nzSpinning",e.isLoading),h.Ub(1),h.Mc("nzLoading",e.isLoading)}}function GR(e,t){1&e&&h.mc(0,"div")}const WR=function(e){return{bondData:e}};function YR(e,t){if(1&e&&(h.rc(0,"div"),h.od(1,GR,1,0,"div",26),h.qc()),2&e){const e=t.$implicit;h.Dc();const n=h.ad(53);h.Ub(1),h.Mc("ngTemplateOutlet",n)("ngTemplateOutletContext",h.Sc(2,WR,e))}}function KR(e,t){if(1&e&&(h.qd(0),h.Ec(1,"number")),2&e){const e=h.Dc().$implicit,t=h.Dc().$implicit;h.td(" ",e," ",h.Gc(1,2,null==t?null:t.redemptionByCur[e],"1.2-2")," ")}}function XR(e,t){if(1&e&&(h.rc(0,"b2c-order-cart",29),h.rc(1,"nz-row"),h.mc(2,"b2b-statistic",30),h.od(3,KR,2,5,"ng-template",null,31,h.pd),h.qc(),h.qc()),2&e){const e=t.$implicit,n=h.ad(4),i=h.Dc().$implicit,c=h.Dc();h.Mc("orderCartType",c.orderCartConstant.ORDER_RECEIVED)("paymentTitle",null!=i&&i.label?null==i?null:i.label:e+" "+c.paymentModeConstant[i.paymentMode].label),h.Ub(2),h.Mc("value",n)}}function QR(e,t){if(1&e&&(h.rc(0,"div",27),h.od(1,XR,5,3,"b2c-order-cart",28),h.qc()),2&e){const e=t.$implicit;h.Ub(1),h.Mc("ngForOf",null==e?null:e.redemptionCurList)}}function ZR(e,t){1&e&&(h.rc(0,"div",39),h.qd(1,"Ind. Principal Amount"),h.qc())}function JR(e,t){1&e&&(h.rc(0,"div",39),h.qd(1,"Principal Amount"),h.qc())}function eN(e,t){1&e&&(h.rc(0,"div",39),h.qd(1,"Ind. Accrued Interest"),h.qc())}function tN(e,t){1&e&&(h.rc(0,"div",39),h.qd(1,"Accrued Interest"),h.qc())}function nN(e,t){1&e&&(h.rc(0,"div",39),h.qd(1,"Est Redemption Amount"),h.qc())}function iN(e,t){1&e&&(h.rc(0,"div",39),h.qd(1,"Redemption Amount"),h.qc())}function cN(e,t){if(1&e&&(h.rc(0,"div",32),h.rc(1,"div",33),h.qd(2),h.qc(),h.rc(3,"div",34),h.rc(4,"span",35),h.qd(5),h.qc(),h.rc(6,"span"),h.qd(7),h.qc(),h.qc(),h.rc(8,"div",36),h.od(9,ZR,2,0,"div",37),h.od(10,JR,2,0,"div",37),h.rc(11,"div",38),h.qd(12),h.Ec(13,"number"),h.qc(),h.qc(),h.rc(14,"div",36),h.od(15,eN,2,0,"div",37),h.od(16,tN,2,0,"div",37),h.rc(17,"div",38),h.qd(18),h.Ec(19,"number"),h.qc(),h.qc(),h.rc(20,"div",36),h.rc(21,"div",39),h.qd(22,"Processing Fee"),h.qc(),h.rc(23,"div",38),h.qd(24),h.Ec(25,"number"),h.qc(),h.qc(),h.rc(26,"div",36),h.od(27,nN,2,0,"div",37),h.od(28,iN,2,0,"div",37),h.rc(29,"div",38),h.qd(30),h.Ec(31,"number"),h.qc(),h.qc(),h.qc()),2&e){const e=t.bondData,n=h.Dc();h.Ub(2),h.td(" ",e.redemptionCurrency," ",null==n.paymentModeConstant[e.paymentMode]?null:n.paymentModeConstant[e.paymentMode].label," "),h.Ub(3),h.sd("[",n.orderTypeConstant[e.orderType].label,"] "),h.Ub(2),h.rd(e.bondName),h.Ub(2),h.Mc("ngIf","Firm"!==e.orderType),h.Ub(1),h.Mc("ngIf","Firm"===e.orderType),h.Ub(2),h.td("",e.bondCurrency," ",h.Gc(13,18,e.transactedAmt,"0.2-2"),""),h.Ub(3),h.Mc("ngIf","Firm"!==e.orderType),h.Ub(1),h.Mc("ngIf","Firm"===e.orderType),h.Ub(2),h.td("",e.bondCurrency," ",h.Gc(19,21,e.accruedInt,"0.2-2"),""),h.Ub(6),h.td("",e.bondCurrency," ",h.Gc(25,24,e.transactionFee,"0.2-2"),""),h.Ub(3),h.Mc("ngIf","Firm"!==e.orderType),h.Ub(1),h.Mc("ngIf","Firm"===e.orderType),h.Ub(2),h.td("",e.redemptionCurrency," ",h.Gc(31,27,e.redemptionAmount,"0.2-2"),"")}}let oN=(()=>{class e{constructor(e,t,n,i,c,o,s){this.subHandlingService=e,this.transactionBondRestService=t,this.route=n,this.store=i,this.router=c,this.transactionRestService=o,this.accountRestService=s,this.orderCartConstant=O.a,this.transactionType=d.d,this.isLoading=!1,this.paymentModeCat=[],this.orderTypeConstant=vL.a.OrderType,this.paymentModeConstant=vL.a.PaymentMode,this.bankDetailsLoading=!1,this.allAvailableBank=[],this.initialize()}ngOnInit(){this.getAccountDetails(),this.getBondContractDetails()}initialize(){this.route.queryParams.subscribe(e=>{this.saleOrderNo=e.saleOrderNo,this.refno=e.refno})}getAccountDetails(){this.authenticatedDisplay$=this.store.select(f.a.getAccounts),this.authenticatedDisplay$.subscribe(e=>{const t=e.filter(e=>e.refno===this.refno);t.length>0&&(this.selectedAcct=Object(g.a)(t[0]))})}getBondContractDetails(){this.refno&&this.saleOrderNo&&this.subHandlingService.once(this.transactionBondRestService.findBondSellContractDetails(this.refno,this.saleOrderNo).pipe(Object(y.a)(e=>{e.data&&(this.bondContractList=e.data,console.log("bondContractList",this.bondContractList)),this.setPaymentByCurrencyList()}),Object(y.a)(()=>
5{this.getBankDetailsAndInitFormValue()})))}setPaymentByCurrencyList(){this.bondContractList&&this.bondContractList.forEach(e=>{let t=[],n={},i=this.paymentModeCat.filter(t=>t.paymentMode===e.paymentMode);i.length<=0&&(i=[{paymentMode:e.paymentMode,redemptionCurList:[],redemptionByCur:{}}],this.paymentModeCat.push(...i)),t=i[0].redemptionCurList,n=i[0].redemptionByCur,0===t.filter(t=>e.redemptionCurrency===t).length&&t.push(e.redemptionCurrency),n[e.redemptionCurrency]=n[e.redemptionCurrency]?n[e.redemptionCurrency]+e.redemptionAmount:e.redemptionAmount})}redirectToTrade(){this.router.navigate([M.o.APP,M.o.TRADE,M.o.BONDS,this.transactionType.BUY])}downloadOrderNoForm(){this.subHandlingService.once(this.transactionRestService.downloadOrderNoForm(this.refno,this.saleOrderNo,"bondSell").pipe(Object(y.a)(e=>{e&&this.downloadForm(e)},e=>console.log(e))))}getBankDetailsAndInitFormValue(){this.bankDetailsLoading=!0,this.subHandlingService.once(this.accountRestService.getBankDetails(this.refno).pipe(Object(y.a)(e=>{this.bankDetailsLoading=!1,e.status===M.a.RESPONSE_SUCCESS&&e.data&&(this.allAvailableBank=[...e.data.Local,...e.data.Overseas])}),Object(y.a)(()=>{const e=[];this.paymentModeCat.forEach(t=>{t.paymentMode===vL.a.PaymentMode.cheque.value&&t.redemptionCurList.forEach(e=>{const n=this.allAvailableBank.filter(t=>t.currency===e);if(n.length>0){const e=Object(Uc.a)("*",n[0].bankAcctNo);t=Object.assign(Object.assign({},t),{bankInfo:n[0],label:"Credit to "+n[0].bankName+" ["+e+"]"})}}),e.push(t)}),this.paymentModeCat=e})))}downloadForm(e){const t=new Blob([e],{type:"application/pdf"});Object(xu.saveAs)(t,this.saleOrderNo+"_Form.pdf")}viewPendingTrade(){this.router.navigate([M.o.APP,M.o.TRANSACTION_RECORD],{queryParams:{refno:this.refno}})}}return e.\u0275fac=function(t){return new(t||e)(h.lc(l.a),h.lc(ML.a),h.lc(c.a),h.lc(s.i),h.lc(c.e),h.lc(T.a),h.lc(bt.a))},e.\u0275cmp=h.fc({type:e,selectors:[["bond-sell-checkout"]],features:[h.Tb([l.a])],decls:54,vars:19,consts:[["loadingTemplate",""],[1,"border-bottom"],[3,"title"],[3,"ngClass"],[3,"nzLoading"],["nzType","flex",3,"nzGutter"],["nz-col","","nzLg","18","nzXs","24"],[1,"h-100"],[4,"ngFor","ngForOf"],[1,"py-3","px-2","mb-3","bg-white","shadow"],[1,"text-base","font-weight-bold","mb-0"],[1,"text-sm","mb-0"],["nz-col","","nzLg","6","nzXs","24"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","space-between",3,"ngClass"],["nz-col",""],["nz-row","",1,"font-weight-bold","text-md"],["nz-row","",1,"text-md"],["nz-button","","nzSize","small","nzTooltipTitle","Print","nzTooltipPlacement","top","nz-tooltip","","nzType","outline",3,"click"],["nz-icon","","nzType","printer","nzTheme","outline"],[1,"",3,"ngClass"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","left","class","py-1",4,"ngFor","ngForOf"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","left"],["nz-button","","nzType","outline",1,"w-100",3,"click"],[1,"px-2","mt-4"],["productInfoTemplate",""],["nzTip","Loading...",3,"nzSpinning"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nz-row","","nzType","flex","nzAlign","middle","nzJustify","left",1,"py-1"],["class","w-100",3,"orderCartType","paymentTitle",4,"ngFor","ngForOf"],[1,"w-100",3,"orderCartType","paymentTitle"],["horizontal","true","title","Total Redemption Amt",3,"value"],["valueTemplate",""],["nz-row","","nzType","flex","nzJustify","space-between","nzAlign","middle",1,"product-background","p-3"],["nz-col","","nzSpan","24",1,"text-sm","font-weight-bold","text-theme","py-1"],["nz-col","","nzLg","5",1,"text-sm","font-weight-bold"],[1,"text-info","text-sm","font-weight-bold"],["nz-col","","nzLg","4"],["nz-row","","nzAlign","middle","nzJustify","center","class","text-sm",4,"ngIf"],["nz-row","","nzAlign","middle","nzJustify","center",1,"text-base","font-weight-bold"],["nz-row","","nzAlign","middle","nzJustify","center",1,"text-sm"]],template:function(e,t){1&e&&(h.od(0,jR,2,2,"ng-template",null,0,h.pd),h.rc(2,"app-mobile-scaffold"),h.rc(3,"div",1),h.mc(4,"b2c-app-bar-2",2),h.qc(),h.qc(),h.rc(5,"div",3),h.Ec(6,"async"),h.rc(7,"nz-skeleton",4),h.rc(8,"nz-row",5),h.Ec(9,"async"),h.rc(10,"div",6),h.rc(11,"app-web-scaffold"),h.rc(12,"nz-card",7),h.rc(13,"p"),h.qd(14,"Home / Trade / Bonds"),h.qc(),h.rc(15,"h3"),h.qd(16,"Your Order has been successfully placed."),h.qc(),h.rc(17,"h4"),h.qd(18),h.qc(),h.mc(19,"nz-divider"),h.od(20,YR,2,4,"div",8),h.qc(),h.qc(),h.rc(21,"app-mobile-scaffold"),h.rc(22,"div",9),h.rc(23,"p",10),h.qd(24,"Your Order has been successfully placed."),h.qc(),h.rc(25,"p",11),h.qd(26),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(27,"div",12),h.rc(28,"div",13),h.Ec(29,"async"),h.rc(30,"div",14),h.rc(31,"div",15),h.qd(32,"Sales Order No"),h.qc(),h.rc(33,"div",16),h.qd(34),h.qc(),h.qc(),h.rc(35,"div",14),h.rc(36,"button",17),h.zc("click",(function(){return t.downloadOrderNoForm()})),h.mc(37,"i",18),h.qc(),h.qc(),h.qc(),h.rc(38,"div",19),h.Ec(39,"async"),h.od(40,QR,2,1,"div",20),h.qc(),h.rc(41,"app-web-scaffold"),h.rc(42,"div"),h.rc(43,"div",21),h.rc(44,"button",22),h.zc("click",(function(){return t.viewPendingTrade()})),h.qd(45,"View Pending Trade"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.rc(46,"div"),h.rc(47,"app-mobile-scaffold"),h.rc(48,"div",23),h.rc(49,"div",21),h.rc(50,"button",22),h.zc("click",(function(){return t.viewPendingTrade()})),h.qd(51,"View Pending Trade"),h.qc(),h.qc(),h.qc(),h.qc(),h.qc(),h.od(52,cN,32,30,"ng-template",null,24,h.pd)),2&e&&(h.Ub(4),h.Mc("title","Check Out"),h.Ub(1),h.Mc("ngClass",h.Fc(6,11,t.isMobile$)?""
5:"container mt-5 mb-6"),h.Ub(2),h.Mc("nzLoading",t.isLoading),h.Ub(1),h.Mc("nzGutter",h.Fc(9,13,t.isMobile$)?0:20),h.Ub(10),h.rd(t.selectedAcct.accountTypeDisplay),h.Ub(2),h.Mc("ngForOf",t.bondContractList),h.Ub(6),h.rd(t.selectedAcct.accountTypeDisplay),h.Ub(2),h.Mc("ngClass",h.Fc(29,15,t.isMobile$)?"py-3 px-2 bg-white":"py-1 px-2"),h.Ub(6),h.rd(t.saleOrderNo),h.Ub(4),h.Mc("ngClass",h.Fc(39,17,t.isMobile$)?"pb-3 px-2 bg-white":""),h.Ub(2),h.Mc("ngForOf",t.paymentModeCat))},directives:[z.a,D.a,p.q,W.a,P.c,P.a,B.a,I.a,Nu.a,p.s,_.a,xt.e,k.b,Il.a,p.A,ge.a,be.c,p.t],pipes:[p.b,p.g],styles:[".product-background[_ngcontent-%COMP%]{background-color:#f5f8f9}"]}),Object(o.c)([Object(s.e)($R.a.isMobile)],e.prototype,"isMobile$",void 0),e})();const sN=[{path:"",component:vU,children:[{path:"",pathMatch:"full",redirectTo:M.o.FUNDS},{path:M.o.FUNDS,component:IU,data:{nav:{title:"Funds Trade"}},children:[{path:"",redirectTo:M.o.BUY,pathMatch:"full"},{path:M.o.BUY,component:Rx,pathMatch:"full",data:{nav:{title:"Funds Buy"}}},{path:M.o.SELL,pathMatch:"full",component:tL,data:{nav:{title:"Funds Sell"}}},{path:M.o.SWITCH,pathMatch:"full",component:yL,data:{nav:{title:"Funds Switch"}}}]},{path:M.o.STOCKS,canActivate:[(()=>{class e{constructor(e,t){this.store=e,this.router=t}canActivate(){return this.store.selectSnapshot(f.a.getAuthData).accounts.length>0||this.router.navigate([M.o.APP,M.o.TRADE,M.o.TRADE_NOT_ALLOWED])}}return e.\u0275fac=function(t){return new(t||e)(h.vc(s.i),h.vc(c.e))},e.\u0275prov=h.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()],component:SI,data:{nav:{title:"Trade Stocks / ETFs"}},children:[{path:"",pathMatch:"full",data:{nav:{title:"Trade Stocks / ETFs"}}},{path:M.o.STOCKS_PORTFOLIO,pathMatch:"full",data:{nav:{title:"Trade Stocks / ETFs"}}},{path:M.o.STOCKS_ORDERBOOK,pathMatch:"full",data:{nav:{title:"Trade Stocks / ETFs"}}}]},{path:M.o.BONDS,redirectTo:M.o.BONDS_RMO},{path:M.o.BONDS+"/"+M.o.BUY,redirectTo:M.o.BONDS_RMO},{path:M.o.BONDS+"/"+M.o.SELL,redirectTo:M.o.BONDS_RMO},{path:M.o.BONDS_RMO,component:DO,data:{nav:{title:"Trade Bonds"}},children:[{path:"",redirectTo:M.o.BONDS_RMO,pathMatch:"full"},{path:M.o.BONDS_PRICES,component:yE,pathMatch:"full",data:{nav:{title:"Bonds Prices"}}},{path:M.o.BOND_ORDER_BOOK,component:rF,pathMatch:"full",data:{nav:{title:"Bonds Order Book"}}},{path:M.o.BOND_PORTFOLIO,component:jF,pathMatch:"full",data:{nav:{title:"Bonds Portfolio"}}}]},{path:M.o.DPMS,component:QL,children:[{path:"",redirectTo:M.o.BUY},{path:M.o.BUY,component:vR,data:{nav:{title:"Managed Portfolios Buy"}}},{path:M.o.SELL,component:HR,data:{nav:{title:"Managed Portfolios Sell"}}}]},{path:M.o.TRADE_NOT_ALLOWED,pathMatch:"full",component:kU,data:{nav:{title:"Trade Not Allowed"}}}]},{path:M.o.CHECK_OUT,component:ku,canActivate:[am]},{path:M.o.BOND_CHECK_OUT,component:HL,canActivate:[am],pathMatch:"full"},{path:M.o.BOND_SELL_CHECK_OUT,component:oN,pathMatch:"full"},{path:M.o.ORDER_PLACED,component:sm,canActivate:[am]}];let aN=(()=>{class e{}return e.\u0275mod=h.jc({type:e}),e.\u0275inj=h.ic({factory:function(t){return new(t||e)},imports:[[c.i.forChild(sN)],c.i]}),e})();var lN=n("D9mS"),rN=n("m743"),dN=n("Vi40"),uN=n("eqSz"),hN=n("kAuK"),pN=n("AZjM"),mN=n("HoDC"),fN=n("XjH6"),gN=n("iOV1"),bN=n("Wrs7"),SN=n("ncdi"),yN=n("IvDN"),vN=n("Wfee"),MN=n("q0Us"),CN=n("EGpF"),qN=n("z4wI"),TN=n("7vlg"),wN=n("ITs7"),zN=n("Usvm"),DN=n("dCdb"),PN=n("HbSm"),IN=n("D6yL"),kN=n("hnej"),AN=n("yknz"),EN=n("rrvu"),FN=n("TXRc"),ON=n("pidM"),UN=n("4hBO"),xN=n("P2Ma"),LN=n("mn7V"),RN=n("TPIG"),NN=n("h5K5"),BN=n("v08o"),_N=n("0Tf5"),VN=n("SeLP"),HN=n("Cj6e"),$N=n("GRZ8"),jN=n("nb8/"),GN=n("M6vG"),WN=n("bQSL");let YN=(()=>{class e{}return e.\u0275mod=h.jc({type:e}),e.\u0275inj=h.ic({factory:function(t){return new(t||e)},providers:[l.a,hm.a,wn.a,p.d],imports:[[i.a,IN.a,aN,Fg.h,s.d.forFeature([hN.a,pN.a,wN.a,u.X,PN.a,u.k,u.H,AN.a]),SN.c,ge.b,Bt.b,D.b,G.b,le.b,rN.b,lN.b,Eg.b,fN.a,be.b,dN.c,gN.a,bN.a,yN.b,mN.a,Se.b,ff.j,vN.b,MN.b,wv.c,sw.d,CN.b,vM.b,yM.c,xv.e,qN.b,zN.a,ow.c,DN.a,Ag.b,TN.c,kN.a,EN.a,FN.a,uN.b,ON.a,UN.b,xN.a,LN.a,RN.a,NN.a,BN.a,_N.a,VN.a,HN.a,$N.a,GN.a,jN.a,Cg.d,WN.a]]}),e})()},"J7y+":function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var i=n("mrSG"),c=n("fXoL"),o=n("2VHv"),s=n("AcyG"),a=n("gFZo"),l=n("ofXK"),r=n("dEAy"),d=n("FwiY"),u=n("OzZK"),h=n("t7Fq"),p=n("9WYH");function m(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-modal",2),c.zc("nzOnCancel",(function(){return c.dd(e),c.Dc().onClose()})),c.rc(1,"h3"),c.mc(2,"i",3),c.qd(3,"Void Transaction"),c.qc(),c.rc(4,"p"),c.qd(5,"Are you sure you want to void this transaction ?"),c.qc(),c.rc(6,"div",4),c.rc(7,"button",5),c.zc("click",(function(){return c.dd(e),c.Dc().onClose()})),c.qd(8,"Cancel"),c.qc(),c.rc(9,"button",6),c.zc("click",(function(){return c.dd(e),c.Dc().onConfirm()})),c.qd(10,"Confirm"),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Mc("nzFooter",null)("nzTitle",null)("nzVisible",e.show)}}function f(e,t){if(1&e){const e=c.sc();c.rc(0,"b2c-mobile-drawer",7),c.zc("showChange",(function(){return c.dd(e),c.Dc().onClose()}))("showChange",(function(t){return c.dd(e),c.Dc().show=t})),c.rc(1,"h3"),c.mc(2,"i",3),c.qd(3,"Void Transaction"),c.qc(),c.rc(4,"p"),c.qd(5,"Are you sure you want to void this transaction ?"),c.qc(),c.rc(6,"b2c-floating-bar"),c.rc(7,"button",8),c.zc("click",(function(){return c.dd(e),c.Dc().onClose()})),c.qd(8,"Cancel"),c.qc(),c.rc(9,"button",9),c.zc("click",(function(){return c.dd(e),c.Dc().onConfirm()})),c.qd(10,"Confirm"),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Mc("show",e.show)("hideButtons",!0)("height",300)}}let g=(()=>{class e{constructor(){this.close=new c.s,this.confirm=new c.s}ngOnInit(){}onClose(){this.close.emit()}onConfirm(){this.confirm.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.fc({type:e,selectors:[["app-void-confirmation-modal"]],inputs:{show:"show"},outputs:{close:"close",confirm:"confirm"},features:[c.Tb([o.a])],decls:4,vars:6,consts:[["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel",4,"ngIf"],["actionText","Done",3,"show","hideButtons","height","showChange",4,"ngIf"],["nzWrapClassName","vertical-center-modal",3,"nzFooter","nzTitle","nzVisible","nzOnCancel"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",1,"text-danger","mr-2"],[1,"d-flex","justify-content-end","align-items-center","p-3"],["nz-button","","nzType","outline",1,"px-3","mr-2",3,"click"],["nz-button","","nzType","primary",3,"click"],["actionText","Done",3,"show","hideButtons","height","showChange"],["nz-button","","nzType","outline",1,"w-100","mb-2",3,"click"],["nz-button","","nzType","primary",1,"w-100",3,"click"]],template:function(e,t){1&e&&(c.od(0,m,11,3,"nz-modal",0),c.Ec(1,"async"),c.od(2,f,11,3,"b2c-mobile-drawer",1),c.Ec(3,"async")),2&e&&(c.Mc("ngIf",!c.Fc(1,2,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(3,4,t.isMobile$)))},directives:[l.t,r.a,d.b,u.a,h.a,p.a],pipes:[l.b],styles:[""]}),Object(i.c)([Object(s.e)(a.a.isMobile)],e.prototype,"isMobile$",void 0),e})()},PQUx:function(e,t,n){"use strict";n.d(t,"a",(function(){return Je}));var i=n("mrSG"),c=n("fXoL"),o=n("TiNC"),s=n("/gji"),a=n("e1sS"),l=n("2VHv"),r=n("6h7t"),d=n("AcyG"),u=n("gFZo"),h=n("cp0P"),p=n("HDdC"),m=n("+NfP"),f=n("Zk2z"),g=n("LW8c"),b=n("ildK"),S=n("h0sS"),y=n("iEbP"),v=n("cFye"),M=n("vkgz"),C=n("45Og"),q=n("ofXK"),T=n("3Xqx"),w=n("W8w6"),z=n("Lcc6"),D=n("3IYF"),P=n("6l6k"),I=n("HMML"),k=n("dEAy"),A=n("ZyQt"),E=n("Nqz0"),F=n("xzdC"),O=n("TIZK"),U=n("niWF"),x=n("Q3HA"),L=n("7yDB"),R=n("drXJ"),N=n("B+r4"),B=n("OtHt"),_=n("FwiY"),V=n("qAZ0"),H=n("1Z1e"),$=n("Q8Sa"),j=n("rMZv"),G=n("81tN"),W=n("Q8cG"),Y=n("nJia"),K=n("OzZK"),X=n("F6ss"),Q=n("5OP8"),Z=n("TfYK"),J=n("4L+/"),ee=n("WiZ8"),te=n("1HOV"),ne=n("6oRW"),ie=n("3Pt+"),ce=n("t7Fq"),oe=n("vKlF"),se=n("UD+I");function ae(e,t){1&e&&(c.rc(0,"span"),c.qd(1,"\xa0"),c.mc(2,"i",55),c.qc())}function le(e,t){if(1&e&&(c.rc(0,"span"),c.rc(1,"p"),c.qd(2),c.mc(3,"br"),c.qd(4),c.qc(),c.qc()),2&e){const e=c.Dc().$implicit,t=c.Dc(2);c.Ub(2),c.sd("( Best Ask \u2265 ",e.stopPx," "),c.Ub(2),c.sd(" Trigger Limit @ ",e.ordType==t.STOP_ORDER.value?"Market":e.ordPrice," )")}}function re(e,t){if(1&e&&(c.rc(0,"span"),c.rc(1,"p"),c.qd(2),c.mc(3,"br"),c.qd(4),c.qc(),c.qc()),2&e){const e=c.Dc().$implicit,t=c.Dc(2);c.Ub(2),c.sd("( Best Bid \u2264 ",e.stopPx," "),c.Ub(2),c.sd(" Trigger Limit @ ",e.ordType==t.STOP_ORDER.value?"Market":e.ordPrice," )")}}function de(e,t){if(1&e&&(c.rc(0,"td",47),c.qd(1),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.rd(e.currency+" Cash Account")}}function ue(e,t){if(1&e&&(c.rc(0,"td",47),c.qd(1),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.rd(e.autosweepCurrency+" "+e.paymentMode)}}function he(e,t){if(1&e&&(c.rc(0,"td",47),c.qd(1),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.rd(e.paymentMode)}}function pe(e,t){if(1&e){const e=c.sc();c.rc(0,"button",56),c.zc("click",(function(){c.dd(e);const t=c.Dc().$implicit;return c.Dc(2).setSelectedItem(t)})),c.mc(1,"i",57),c.qc()}if(2&e){c.Dc();const e=c.ad(61);c.Mc("nzDropdownMenu",e)}}const me=function(e){return{color:e}};function fe(e,t){if(1&e){const e=c.sc();c.rc(0,"tr",34),c.zc("click",(function(){c.dd(e);
5const n=t.$implicit;return c.Dc(2).onSelectStockInfoRow(n)})),c.rc(1,"td",35),c.rc(2,"nz-row",36),c.rc(3,"a",37),c.zc("click",(function(){c.dd(e);const n=t.$implicit;return c.Dc(2).navigateToStocksFactsheet(n.stockShortName?n.stockShortName:n.stockName,n.exchange,n.stockCode,n.securityType)})),c.qd(4),c.qc(),c.qc(),c.rc(5,"nz-row"),c.rc(6,"nz-col",38),c.qd(7),c.qc(),c.qc(),c.qc(),c.rc(8,"td",39),c.mc(9,"app-stock-exchange-tag",40),c.Ec(10,"displayExchangeName"),c.qc(),c.rc(11,"td",41),c.qd(12),c.mc(13,"br"),c.qd(14),c.Ec(15,"date"),c.qc(),c.rc(16,"td",41),c.qd(17),c.Ec(18,"date"),c.mc(19,"br"),c.qd(20),c.Ec(21,"date"),c.qc(),c.rc(22,"td",41),c.rc(23,"div",42),c.rc(24,"p",43),c.qd(25),c.Ec(26,"titlecase"),c.qc(),c.rc(27,"p",44),c.qd(28),c.Ec(29,"titlecase"),c.qc(),c.od(30,ae,3,0,"span",45),c.qc(),c.od(31,le,5,2,"span",45),c.od(32,re,5,2,"span",45),c.qc(),c.od(33,de,2,1,"td",46),c.od(34,ue,2,1,"td",46),c.od(35,he,2,1,"td",46),c.rc(36,"td",47),c.qd(37),c.Ec(38,"number"),c.qc(),c.rc(39,"td",47),c.qd(40),c.Ec(41,"stockPrice"),c.qc(),c.rc(42,"td",47),c.qd(43),c.Ec(44,"stockPrice"),c.qc(),c.rc(45,"td",47),c.qd(46),c.Ec(47,"number"),c.qc(),c.rc(48,"td",47),c.qd(49),c.Ec(50,"number"),c.qc(),c.rc(51,"td",47),c.qd(52),c.Ec(53,"number"),c.qc(),c.rc(54,"td",48),c.rc(55,"nz-tag",49),c.rc(56,"span",50),c.qd(57),c.qc(),c.qc(),c.qc(),c.rc(58,"td"),c.od(59,pe,2,1,"button",51),c.qc(),c.rc(60,"nz-dropdown-menu",null,52),c.rc(62,"ul",53),c.rc(63,"li",54),c.zc("click",(function(){c.dd(e);const n=t.$implicit,i=c.Dc(2);return n.exchange===i.SSE||n.exchange===i.SZSE?i.showChinaStcokAmendOrder():i.showAmendOrderModal()})),c.qd(64,"Modify Order"),c.qc(),c.rc(65,"li",54),c.zc("click",(function(){return c.dd(e),c.Dc(2).showCancelOrderModal()})),c.qd(66,"Cancel Order"),c.qc(),c.qc(),c.qc(),c.qc()}if(2&e){const e=t.$implicit,n=c.Dc(2);c.Ub(4),c.rd(e.stockShortName?e.stockShortName:e.stockName),c.Ub(3),c.rd(e.stockCode),c.Ub(2),c.Mc("exchange",c.Fc(10,25,null==e?null:e.exchange)),c.Ub(3),c.sd("",n.showValidity(e.timeInForce),", "),c.Ub(2),c.rd(c.Gc(15,27,n.convertToDate(e.expiredDate),"dd MMM yyyy")),c.Ub(3),c.rd(c.Gc(18,30,e.ordTime,"dd MMM yyyy")),c.Ub(3),c.sd(" ",c.Gc(21,33,e.ordTime,"HH:mm:ss"),""),c.Ub(4),c.Mc("ngStyle",c.Sc(56,me,n.determineTypeColor(e.ordSide))),c.Ub(1),c.sd("",c.Fc(26,36,n.changeBidAsk(e.ordSide))," "),c.Ub(3),c.sd("\xa0- ",c.Fc(29,38,n.changeOrderTypeName(e.ordType,e.timeInForce,null==e?null:e.exchange,null==e?null:e.marriedFlag)),""),c.Ub(2),c.Mc("ngIf","Y"===(null==e?null:e.marriedFlag)),c.Ub(1),c.Mc("ngIf",(e.ordType==n.STOP_LIMIT_ORDER.value||e.ordType==n.STOP_ORDER.value)&&"BUY"==e.ordSide),c.Ub(1),c.Mc("ngIf",(e.ordType==n.STOP_LIMIT_ORDER.value||e.ordType==n.STOP_ORDER.value)&&"SELL"==e.ordSide),c.Ub(1),c.Mc("ngIf",e.paymentMode===n.TRUST_ACCOUNT),c.Ub(1),c.Mc("ngIf",e.paymentMode===n.AUTO_SWEEP),c.Ub(1),c.Mc("ngIf",e.paymentMode!=n.AUTO_SWEEP&&e.paymentMode!=n.TRUST_ACCOUNT),c.Ub(2),c.rd(c.Gc(38,40,e.ordQty,"1.0-4")),c.Ub(3),c.sd(" ",n.determinePriceStatus(e.ordPrice,e.ordType)?n.getPriceDisplayText(e.ordType):e.currency+"\xa0"+c.Gc(41,43,e.ordPrice,null==e?null:e.exchange)," "),c.Ub(3),c.rd("Rejected"===e.ordStatusText?"-":e.currency+" "+c.Gc(44,46,e.avgPrice,null==e?null:e.exchange)),c.Ub(3),c.rd("Rejected"===e.ordStatusText?"-":c.Fc(47,49,e.remainingQty)),c.Ub(3),c.rd("Rejected"===e.ordStatusText?"-":c.Fc(50,51,e.filledQty)),c.Ub(3),c.rd("Rejected"===e.ordStatusText?"-":e.currency+" "+c.Gc(53,53,e.matchAmt,"1.2-2")),c.Ub(3),c.Mc("ngClass",n.determineStatusColor(e.ordStatus)),c.Ub(2),c.rd(null==e?null:e.ordStatusText),c.Ub(2),c.Mc("ngIf",!n.hideActionOption(e))}}const ge=function(){return{x:"100%"}};function be(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-table",25,26),c.rc(2,"thead",27),c.zc("nzSortChange",(function(t){return c.dd(e),c.Dc().tableSort(t)})),c.rc(3,"tr",28),c.rc(4,"th",29),c.qd(5,"Stock "),c.mc(6,"br"),c.qd(7," Name"),c.qc(),c.rc(8,"th",30),c.qd(9,"Exchg"),c.qc(),c.rc(10,"th",30),c.qd(11,"Validity"),c.qc(),c.rc(12,"th",30),c.qd(13,"Order Date & Time"),c.qc(),c.rc(14,"th",31),c.qd(15,"Order Type"),c.qc(),c.rc(16,"th",30),c.qd(17,"Payment Method"),c.qc(),c.rc(18,"th",32),c.qd(19,"Qty"),c.qc(),c.rc(20,"th",32),c.qd(21,"Price"),c.qc(),c.rc(22,"th",32),c.qd(23,"Avg Matched Price"),c.qc(),c.rc(24,"th",32),c.qd(25,"Unmatched Qty"),c.qc(),c.rc(26,"th",32),c.qd(27,"Matched Qty"),c.qc(),c.rc(28,"th",32),c.qd(29,"Matched Amt"),c.qc(),c.rc(30,"th",32),c.qd(31,"
5Status"),c.qc(),c.mc(32,"th"),c.qc(),c.qc(),c.rc(33,"tbody"),c.od(34,fe,67,58,"tr",33),c.qc(),c.qc()}if(2&e){const e=c.ad(1),t=c.Dc();c.Mc("nzData",t.tempOrderBookInfos)("nzScroll",c.Rc(18,ge))("nzShowPagination",(null==t.tempOrderBookInfos?null:t.tempOrderBookInfos.length)>10),c.Ub(4),c.Mc("nzSortKey",t.displayCols[0].key),c.Ub(4),c.Mc("nzSortKey",t.displayCols[1].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[3].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[4].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[5].key)("nzWidth","150px"),c.Ub(2),c.Mc("nzSortKey",t.displayCols[6].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[7].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[8].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[9].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[10].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[10].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[11].key),c.Ub(2),c.Mc("nzSortKey",t.displayCols[13].key),c.Ub(4),c.Mc("ngForOf",e.data)}}function Se(e,t){1&e&&(c.rc(0,"p",3),c.qd(1,'Details for "Day Order" will be moved to Historical Transaction after '),c.rc(2,"b"),c.qd(3,"8:30pm"),c.qc(),c.qd(4," (for BURSA, SGX, HKEX, SSE and SZSE stock exchange), "),c.rc(5,"b"),c.qd(6,"7:30am"),c.qc(),c.qd(7," (US stock exchange), "),c.rc(8,"b"),c.qd(9,"6:30am"),c.qc(),c.qd(10," (LSE stock exchange for Daylight Savings) and "),c.rc(11,"b"),c.qd(12,"7:30am"),c.qc(),c.qd(13," (LSE stock exchange for Non Daylight Savings) after the end of its trading session."),c.qc())}function ye(e,t){1&e&&(c.rc(0,"p",3),c.qd(1,'Details for "Day Order" will be moved to Historical Transaction after '),c.rc(2,"b"),c.qd(3,"6:00pm"),c.qc(),c.qd(4," (BURSA stock exchange), "),c.rc(5,"b"),c.qd(6,"8:30pm"),c.qc(),c.qd(7," (for SGX, HKEX, SSE and SZSE stock exchange), "),c.rc(8,"b"),c.qd(9,"7:30am"),c.qc(),c.qd(10," (US stock exchange), "),c.rc(11,"b"),c.qd(12,"6:30am"),c.qc(),c.qd(13," (LSE stock exchange for Daylight Savings) and "),c.rc(14,"b"),c.qd(15,"7:30am"),c.qc(),c.qd(16," (LSE stock exchange for Non Daylight Savings) after the end of its trading session."),c.qc())}function ve(e,t){}function Me(e,t){1&e&&c.nc(0)}function Ce(e,t){1&e&&c.nc(0)}function qe(e,t){if(1&e&&(c.rc(0,"span"),c.qd(1),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.rd(e.currency+" Cash Account")}}function Te(e,t){if(1&e&&(c.rc(0,"span"),c.qd(1),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.rd(e.autosweepCurrency+" "+e.paymentMode)}}function we(e,t){if(1&e&&(c.rc(0,"span"),c.qd(1),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.rd(e.paymentMode)}}function ze(e,t){if(1&e){const e=c.sc();c.rc(0,"i",75),c.zc("click",(function(){c.dd(e);const t=c.Dc().$implicit;return c.Dc(2).showDrawer(t)})),c.qc()}}function De(e,t){if(1&e){const e=c.sc();c.rc(0,"tr"),c.rc(1,"td",66),c.rc(2,"nz-row"),c.rc(3,"nz-col",67),c.qd(4),c.qc(),c.qc(),c.qc(),c.rc(5,"td"),c.rc(6,"nz-row"),c.rc(7,"nz-col",61),c.rc(8,"span",68),c.zc("click",(function(){c.dd(e);const n=t.$implicit;return c.Dc(2).navigateToStocksFactsheet(n.stockShortName?n.stockShortName:n.stockName,n.exchange,n.stockCode,n.securityType)})),c.qd(9),c.qc(),c.rc(10,"span",69),c.mc(11,"app-stock-exchange-tag",70),c.Ec(12,"displayExchangeName"),c.qd(13),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(14,"td"),c.rc(15,"nz-row"),c.rc(16,"nz-col"),c.rc(17,"div",71),c.rc(18,"span",72),c.qd(19),c.Ec(20,"stockPrice"),c.qc(),c.mc(21,"br"),c.qd(22),c.Ec(23,"number"),c.mc(24,"br"),c.qd(25),c.Ec(26,"date"),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(27,"td"),c.rc(28,"nz-row"),c.rc(29,"nz-col"),c.rc(30,"div",71),c.rc(31,"nz-tag",73),c.qd(32),c.qc(),c.mc(33,"br"),c.od(34,qe,2,1,"span",45),c.od(35,Te,2,1,"span",45),c.od(36,we,2,1,"span",45),c.mc(37,"br"),c.qd(38),c.Ec(39,"date"),c.mc(40,"br"),c.qd(41),c.Ec(42,"date"),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(43,"td"),c.od(44,ze,1,0,"i",74),c.qc(),c.qc()}if(2&e){const e=t.$implicit,n=c.Dc(2);c.Ub(1),c.Mc("ngClass",n.mobileDetermineStatusColor(e.ordSide)),c.Ub(3),c.sd(" ",n.mobileChangeBidAsk(e.ordSide)," "),c.Ub(5),c.rd(e.stockShortName?e.stockShortName:e.stockName),c.Ub(2),c.Mc("exchange",c.Fc(12,17,null==e?null:e.exchange)),c.Ub(2),c.rd(e.stockCode),c.Ub(6),c.sd("",n.determinePriceStatus(e.ordPrice,e.ordType)?n.getPriceDisplayText(e.ordType):e.currency+"\xa0"+c.Gc(20,19,e.ordPrice,null==e?null:e.exchange)," "),c.Ub(3),c.sd(" ",c.Gc(23,22,e.ordQty,"1.0-4")," "),c.Ub(3),c.td(" ",n.showValidity(e.timeInForce),", ",c.Gc(26,25,n.convertToDate(e.expiredDate),"dd MMM yyyy")," "),c.Ub(6),c.Mc("ngClass",n.determineStatusColor(e.ordStatus)),c.Ub(1),c.rd(e.ordStatusText),c.Ub(2),c.Mc("ngIf",e.paymentMode===n.TRUST_ACCOUNT),c.Ub(1),c.Mc("ngIf",e.paymentMode===n.AUTO_SWEEP),c.Ub(1),c.Mc("ngIf",e.paymentMode!=n.AUTO_SWEEP&&e.paymentMode!=n.TRUST_ACCOUNT),c.Ub(2),c.sd(" ",c.Gc(39,28,e.ordTime,"dd MMM yyyy"),""),c.Ub(3),c.sd(" ",c.Gc(42,31,e.ordTime,"HH:mm:ss")," "),c.Ub(3),c.Mc("ngIf",!n.hideOrderOption(e))}}function Pe(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-table",58,26),c.rc(2,"thead",27),c.zc("nzSortChange",(function(t){return c.dd(e),c.Dc().tableSort(t)})),c.rc(3,"tr"),c.mc(4,"th",59),c.rc(5,"th",60),c.rc(6,"span",61),c.qd(7,"Stock Name"),c.qc(),c.qc(),c.rc(8,"th",62),c.qd(9,"Price"),c.mc(10,"br"),c.rc(11,"span",63),c.qd(12,"Qty"),c.qc(),c.mc(13,"br"),c.rc(14,"span",63),c.qd(15,"Validity"),c.qc(),c.qc(),c.rc(16,"th",64),c.qd(17,"Status"),c.mc(18,"br"),c.rc(19,"span",63),c.qd(20,"Payment Method"),c.qc(),c.mc(21,"br"),c.rc(22,"span",63),c.qd(23,"Order Date & Time"),c.qc(),c.qc(),c.mc(24,"th",59),c.qc(),c.qc(),c.rc(25,"tbody"),c.od(26,De,45,34,"tr",65),c.qc(),c.qc()}if(2&e){const e=c.ad(1),t=c.Dc();c.Mc("nzData",t.tempOrderBookInfos)("nzScroll",c.Rc(5,ge))("nzFrontPagination",!0)("nzShowPagination",(null==t.tempOrderBookInfos?null:t.tempOrderBookInfos.length)>10),c.Ub(26),c.Mc("ngForOf",e.data)}}function Ie(e,t){1&e&&(c.rc(0,"nz-col",9),c.qd(1,'Details for "Day Order" will be moved to Historical Transaction after '),c.rc(2,"b"),c.qd(3,"6:00pm"),c.qc(),c.qd(4," (BURSA stock exchange), "),c.rc(5,"b"),c.qd(6,"8:30pm"),c.qc(),c.qd(7," (for SGX, HKEX, SSE and
5SZSE stock exchange), "),c.rc(8,"b"),c.qd(9,"7:30am"),c.qc(),c.qd(10," (US stock exchange), "),c.rc(11,"b"),c.qd(12,"6:30am"),c.qc(),c.qd(13," (LSE stock exchange for Daylight Savings) and "),c.rc(14,"b"),c.qd(15,"7:30am"),c.qc(),c.qd(16," (LSE stock exchange for Non Daylight Savings) after the end of its trading session."),c.qc()),2&e&&c.Mc("nzSpan",24)}function ke(e,t){1&e&&(c.rc(0,"nz-col",9),c.qd(1,'Details for "Day Order" will be moved to Historical Transaction after '),c.rc(2,"b"),c.qd(3,"8:30pm"),c.qc(),c.qd(4," (for BURSA, SGX, HKEX, SSE and SZSE stock exchange), "),c.rc(5,"b"),c.qd(6,"7:30am"),c.qc(),c.qd(7," (US stock exchange), "),c.rc(8,"b"),c.qd(9,"6:30am"),c.qc(),c.qd(10," (LSE stock exchange for Daylight Savings) and "),c.rc(11,"b"),c.qd(12,"7:30am"),c.qc(),c.qd(13," (LSE stock exchange for Non Daylight Savings) after the end of its trading session."),c.qc()),2&e&&c.Mc("nzSpan",24)}function Ae(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-drawer",76),c.zc("nzOnClose",(function(){return c.dd(e),c.Dc().closeDrawer()})),c.qc()}if(2&e){const e=c.Dc(),t=c.ad(39);c.Mc("nzClosable",!1)("nzWidth","100%")("nzVisible",e.drawerVisible)("nzWrapClassName","mobile-drawer-no-padding")("nzContent",t)}}function Ee(e,t){1&e&&c.nc(0)}function Fe(e,t){1&e&&c.nc(0)}function Oe(e,t){if(1&e){const e=c.sc();c.rc(0,"app-stock-transaction-modal",77),c.zc("changeVisible",(function(t){return c.dd(e),c.Dc().handleAmendModalVisible(t)}))("emitData",(function(t){return c.dd(e),c.Dc().handlePreviewAmendModalOpen(t)}))("changeSelectedTransactionType",(function(t){return c.dd(e),c.Dc().handleSelectedTransactionType(t)}))("changeSelectedInvestmentAcctType",(function(t){return c.dd(e),c.Dc().handleSelectedInvestmentAcctType(t)}))("changeSelectedPurchasingPowerType",(function(t){return c.dd(e),c.Dc().handleSelectedPurchasingPowerType(t)}))("emitGetFeeDetailAction",(function(t){return c.dd(e),c.Dc().getAmendFeeOrder(t)}))("emitSnapSelectedStockAction",(function(t){return c.dd(e),c.Dc().snapSelectedStock(t)})),c.qc()}if(2&e){const e=c.Dc();c.Mc("isSwitchCurrency",e.isSwitchCurrency)("isCalculator",e.isCalculator)("feeDetailStatus",e.feeDetailStatus)("feeDetail",e.feeDetail)("isModifyOrder",!0)("onlyModifyOrder",!0)("holdingInfo",e.portfolioItems)("visible",e.amendOrderModalVisible)("rspEtfProductInfo",e.rspEtfProductInfo)("selectedStock",e.selectedItem)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("marketDepthDataBid",e.marketDepthDataBid)("marketDepthDataAsk",e.marketDepthDataAsk)}}function Ue(e,t){if(1&e){const e=c.sc();c.rc(0,"app-stock-transaction-modal-revamp",78),c.zc("changeVisible",(function(t){return c.dd(e),c.Dc().handleAmendModalVisible(t)}))("emitData",(function(t){return c.dd(e),c.Dc().handlePreviewAmendModalOpen(t)}))("changeSelectedTransactionType",(function(t){return c.dd(e),c.Dc().handleSelectedTransactionType(t)}))("changeSelectedInvestmentAcctType",(function(t){return c.dd(e),c.Dc().handleSelectedInvestmentAcctType(t)}))("changeSelectedPurchasingPowerType",(function(t){return c.dd(e),c.Dc().handleSelectedPurchasingPowerType(t)}))("emitGetFeeDetailAction",(function(t){return c.dd(e),c.Dc().getAmendFeeOrder(t)}))("emitSnapSelectedStockAction",(function(t){return c.dd(e),c.Dc().snapSelectedStock(t)})),c.qc()}if(2&e){const e=c.Dc();c.Mc("lsClient",e.lsClient)("isSwitchCurrency",e.isSwitchCurrency)("isCalculator",e.isCalculator)("feeDetailStatus",e.feeDetailStatus)("feeNameMap",e.exchangeFeeNameDescMap)("feeDetail",e.feeDetail)("isModifyOrder",!0)("onlyModifyOrder",!0)("holdingInfo",e.portfolioItems)("visible",e.amendOrderModalVisible)("rspEtfProductInfo",e.rspEtfProductInfo)("priceQuote",e.priceQuote)("selectedStock",e.selectedItem)("selectedTransactionType",e.selectedTransactionType)("selectedAccType",e.selectedAcctType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("marketDepthDataBid",e.marketDepthDataBid)("marketDepthDataAsk",e.marketDepthDataAsk)}}function xe(e,t){if(1&e){const e=c.sc();c.rc(0,"app-stock-transaction-preview-modal",79),c.zc("changeVisible",(function(t){return c.dd(e),c.Dc().handlePreviewAmendModalVisible(t)}))("refreshPortfolioAction",(function(t){return c.dd(e),c.Dc().refreshPortfolio(t)}))("readOrderBookAction",(function(){return c.dd(e),c.Dc().readOrderBook(!1)}))("backVisible",(function(t){return c.dd(e),c.Dc().handleTransactionPreviewModalBack(t)})),c.qc()}if(2&e){const e=c.Dc();c.Mc("feeDetailStatus",e.feeDetailStatus)("isSwitchCurrency",e.isSwitchCurrency)("feeDetail",e.feeDetail)("isModifyOrder",!0)("onlyModifyOrder",!0)("visible",e.previewAmendOrderModalVisible)("selectedStock",e.selectedItem)("selectedPurchasingPowerType",e.selectedPurchasingPowerType)("selectedTransactionType",e.selectedTransactionType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("stockPreviewData",e.transactionPreviewData)("isScheduledSellOrder",e.isScheduledSellOrder)("marketOrderTypeSelected",e.marketOrderTypeSelected)}}function Le(e,t){if(1&e){const e=c.sc();c.rc(0,"app-stock-transaction-preview-modal-revamp",80),c.zc("changeVisible",(function(t){return c.dd(e),c.Dc().handlePreviewAmendModalVisible(t)}))("refreshPortfolioAction",(function(t){return c.dd(e),c.Dc().refreshPortfolio(t)}))("readOrderBookAction",(function(){return c.dd(e),c.Dc().readOrderBook(!1)}))("backVisible",(function(t){return c.dd(e),c.Dc().handleTransactionPreviewModalBack(t)})),c.qc()}if(2&e){const e=c.Dc();c.Mc("feeNameMap",e.exchangeFeeNameDescMap)("feeDetailStatus",e.feeDetailStatus)("isSwitchCurrency",e.isSwitchCurrency)("feeDetail",e.feeDetail)("isModifyOrder",!0)("onlyModifyOrder",!0)("visible",e.previewAmendOrderModalVisible)("selectedStock",e.selectedItem)("selectedPurchasingPowerType",e.selectedPurchasingPowerType)("selectedTransactionType",e.selectedTransactionType)("primaryCashAcctAvailableBalance",e.primaryCashAcctAvailableBalance)("stockPreviewData",e.transactionPreviewData)("isScheduledSellOrder",e.isScheduledSellOrder)("marketOrderTypeSelected",e.marketOrderTypeSelected)}}function Re(e,t){1&e&&(c.rc(0,"span",91),c.qd(1," \xa0"),c.mc(2,"i",92),c.qc())}function Ne(e,t){if(1&e&&(c.rc(0,"nz-row"),c.rc(1,"nz-col",9),c.qd(2),c.qc(),c.rc(3,"nz-col",86),c.qd(4),c.Ec(5,"stockPrice"),c.qc(),c.qc()),2&e){const e=c.Dc(2);c.Ub(1),c.Mc("nzSpan",12),c.Ub(1),c.rd(e.selectedItem.ordType==e.STOP_LIMIT_ORDER.value?"Limit Price":"Price"),c.Ub(1),c.Mc("nzSpan",12),c.Ub(1),c.sd(" ",e.determinePriceStatus(e.selectedItem.ordPrice,e.selectedItem.ordType)?e.getPriceDisplayText(e.selectedItem.ordType):((null==e.selectedItem?null:e.selectedItem.currency)===e.GBX_CURRENCY?e.GBP_CURRENCY:null==e.selectedItem?null:e.selectedItem.currency)+"\xa0"+c.Gc(5,4,e.selectedItem.ordPrice,null==e.selectedItem?null:e.selectedItem.exchange)," ")}}function Be(e,t){1&e&&c.mc(0,"hr")}function _e(e,t){if(1&e&&(c.rc(0,"nz-row"),c.rc(1,"nz-col",9),c.qd(2,"Trigger Price"),c.qc(),c.rc(3,"nz-col",86),c.qd(4),c.Ec(5,"stockPrice"),c.qc(),c.qc()),2&e){const e=c.Dc(2);c.Ub(1),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.sd(" ",e.determinePriceStatus(e.selectedItem.stopPx,e.selectedItem.ordType)?e.getPriceDisplayText(e.selectedItem.ordType):e.selectedItem.currency+"\xa0"+c.Gc(5,3,e.selectedItem.stopPx,null==e.selectedItem?null:e.selectedItem.exchange)," ")}}function Ve(e,t){1&e&&c.mc(0,"hr")}function He(e,t){if(1&e){const e=c.sc();c.rc(0,"div"),c.rc(1,"nz-row",93),c.rc(2,"nz-col",9),c.rc(3,"span",94),c.qd(4,"Actions"),c.qc(),c.qc(),c.qc(),c.rc(5,"div",95),c.rc(6,"div",96),c.rc(7,"div",97),c.mc(8,"img",98),c.qc(),c.rc(9,"span",99),c.zc("click",(function(){c.dd(e);const t=c.Dc(2);return t.selectedItem.exchange===t.SSE||t.selectedItem.exchange===t.SZSE?t.showChinaStcokAmendOrder():t.showAmendOrderModal()})),c.qd(10,"Modify"),c.qc(),c.qc(),c.qc(),c.rc(11,"div",95),c.rc(12,"div",96),c.rc(13,"div",97),c.mc(14,"img",98),c.qc(),c.rc(15,"span",99),c.zc("click",(function(){return c.dd(e),c.Dc(2).showCancelOrderModal()})),c.qd(16,"Cancel"),c.qc(),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(2);c.Ub(2),c.Mc("nzSpan",24),c.Ub(6),c.Mc("src",e.imagePath+"amend-stock.svg",c.gd),c.Ub(6),c.Mc("src",e.imagePath+"cancel-stock.svg",c.gd)}}function $e(e,t){if(1&e){const e=c.sc();c.rc(0,"div",81),c.rc(1,"b2c-app-bar-2",82),c.zc("back",(function(){return c.dd(e),c.Dc().closeDrawer()})),c.qc(),c.qc(),c.rc(2,"div",83),c.rc(3,"nz-row"),c.rc(4,"nz-col"),c.rc(5,"span",72),c.qd(6),c.qc(),c.mc(7,"br"),c.mc(8,"app-stock-exchange-tag",70),c.Ec(9,"displayExchangeName"),c.rc(10,"span",84),c.qd(11),c.qc(),c.qc(),c.qc(),c.rc(12,"div",85),c.rc(13,"nz-row"),c.rc(14,"nz-col",9),c.qd(15,"Order ID"),c.qc(),c.rc(16,"nz-col",86),c.qd(17),c.Ec(18,"slice"),c.qc(),c.qc(),c.mc(19,"hr"),c.rc(20,"nz-row"),c.rc(21,"nz-col",9),c.qd(22,"Order Type"),c.qc(),c.rc(23,"nz-col",86),c.rc(24,"span",87),c.qd(25),c.Ec(26,"titlecase"),c.qc(),c.rc(27,"span"),c.qd(28),
5c.Ec(29,"titlecase"),c.qc(),c.od(30,Re,3,0,"span",88),c.qc(),c.qc(),c.mc(31,"hr"),c.od(32,Ne,6,7,"nz-row",45),c.od(33,Be,1,0,"hr",45),c.od(34,_e,6,6,"nz-row",45),c.od(35,Ve,1,0,"hr",45),c.rc(36,"nz-row"),c.rc(37,"nz-col",9),c.qd(38,"Average Matched Price"),c.qc(),c.rc(39,"nz-col",86),c.qd(40),c.Ec(41,"stockPrice"),c.qc(),c.qc(),c.mc(42,"hr"),c.rc(43,"nz-row"),c.rc(44,"nz-col",9),c.qd(45,"Qty"),c.qc(),c.rc(46,"nz-col",86),c.qd(47),c.Ec(48,"number"),c.qc(),c.qc(),c.mc(49,"hr"),c.rc(50,"nz-row"),c.rc(51,"nz-col",9),c.qd(52,"Unmatched Qty"),c.qc(),c.rc(53,"nz-col",86),c.qd(54),c.Ec(55,"number"),c.qc(),c.qc(),c.mc(56,"hr"),c.rc(57,"nz-row"),c.rc(58,"nz-col",9),c.qd(59,"Matched Qty"),c.qc(),c.rc(60,"nz-col",86),c.qd(61),c.Ec(62,"number"),c.qc(),c.qc(),c.mc(63,"hr"),c.rc(64,"nz-row"),c.rc(65,"nz-col",9),c.qd(66,"Matched Amt"),c.qc(),c.rc(67,"nz-col",86),c.qd(68),c.Ec(69,"number"),c.qc(),c.qc(),c.mc(70,"hr"),c.rc(71,"nz-row"),c.rc(72,"nz-col",9),c.qd(73,"Status"),c.qc(),c.rc(74,"nz-col",89),c.rc(75,"nz-tag",73),c.qd(76),c.qc(),c.qc(),c.qc(),c.mc(77,"hr"),c.rc(78,"nz-row"),c.rc(79,"nz-col",9),c.qd(80,"Validity"),c.qc(),c.rc(81,"nz-col",86),c.qd(82),c.Ec(83,"date"),c.qc(),c.qc(),c.mc(84,"hr"),c.rc(85,"nz-row"),c.rc(86,"nz-col",9),c.qd(87,"Order Date & Time"),c.qc(),c.rc(88,"nz-col",86),c.qd(89),c.Ec(90,"date"),c.Ec(91,"lowercase"),c.Ec(92,"date"),c.qc(),c.qc(),c.mc(93,"hr"),c.qc(),c.rc(94,"nz-row"),c.rc(95,"nz-col",90),c.qd(96," Order shown are intra-day of Good-Till-Date trades, details of filled order can be found at Historical Transaction on the next business day. "),c.qc(),c.qc(),c.od(97,He,17,3,"div",45),c.qc()}if(2&e){const e=c.Dc();c.Ub(1),c.Mc("title","Order Details"),c.Ub(5),c.rd(e.selectedItem.stockName),c.Ub(2),c.Mc("exchange",c.Fc(9,46,e.selectedItem.exchange)),c.Ub(3),c.rd(e.selectedItem.stockCode),c.Ub(3),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.rd(c.Hc(18,48,e.selectedItem.orderId,0,-3)),c.Ub(4),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.Mc("ngStyle",c.Sc(81,me,e.determineTypeColor(e.selectedItem.ordSide))),c.Ub(1),c.sd("",c.Fc(26,52,e.changeBidAsk(e.selectedItem.ordSide))," "),c.Ub(3),c.sd("- ",c.Fc(29,54,e.changeOrderTypeName(e.selectedItem.ordType,e.selectedItem.timeInForce,null==e.selectedItem?null:e.selectedItem.exchange,null==e.selectedItem?null:e.selectedItem.marriedFlag)),""),c.Ub(2),c.Mc("ngIf","Y"===(null==e.selectedItem?null:e.selectedItem.marriedFlag)),c.Ub(2),c.Mc("ngIf",e.selectedItem.ordType!=e.STOP_ORDER.value),c.Ub(1),c.Mc("ngIf",e.selectedItem.ordType!=e.STOP_ORDER.value),c.Ub(1),c.Mc("ngIf",e.selectedItem.ordType==e.STOP_LIMIT_ORDER.value||e.selectedItem.ordType==e.STOP_ORDER.value),c.Ub(1),c.Mc("ngIf",e.selectedItem.ordType==e.STOP_LIMIT_ORDER.value||e.selectedItem.ordType==e.STOP_ORDER.value),c.Ub(2),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.rd("Rejected"===e.selectedItem.ordStatusText?"-":((null==e.selectedItem?null:e.selectedItem.currency)===e.GBX_CURRENCY?e.GBP_CURRENCY:null==e.selectedItem?null:e.selectedItem.currency)+" "+c.Gc(41,56,e.selectedItem.avgPrice,null==e.selectedItem?null:e.selectedItem.exchange)),c.Ub(4),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.rd(c.Gc(48,59,e.selectedItem.ordQty,"1.0-4")),c.Ub(4),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.rd("Rejected"===e.selectedItem.ordStatusText?"-":c.Gc(55,62,e.selectedItem.remainingQty,"1.0-4")),c.Ub(4),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.rd("Rejected"===e.selectedItem.ordStatusText?"-":c.Fc(62,65,e.selectedItem.filledQty)),c.Ub(4),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.rd("Rejected"===e.selectedItem.ordStatusText?"-":((null==e.selectedItem?null:e.selectedItem.currency)===e.GBX_CURRENCY?e.GBP_CURRENCY:null==e.selectedItem?null:e.selectedItem.currency)+" "+c.Gc(69,67,e.selectedItem.filledQty*e.selectedItem.avgPrice,"1.2-2")),c.Ub(4),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.Mc("ngClass",e.determineStatusColor(e.selectedItem.ordStatus)),c.Ub(1),c.rd(e.selectedItem.ordStatusText),c.Ub(3),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.td("",e.showValidity(e.selectedItem.timeInForce),", ",c.Gc(83,70,e.convertToDate(e.selectedItem.expiredDate),"dd MMM yyyy")," "),c.Ub(4),c.Mc("nzSpan",12),c.Ub(2),c.Mc("nzSpan",12),c.Ub(1),c.td("",c.Gc(90,73,e.selectedItem.ordTime,"dd MMM yyyy HH:mm:ss"),"",c.Fc(91,76,c.Gc(92,78,e.selectedItem.ordTime,"a")),""),c.Ub(6),c.Mc("nzSpan",24),c.Ub(2),c.Mc("ngIf",!e.hideActionOption(e.selectedItem))}}function je(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-modal",101),c.zc("nzVisibleChange",(function(t){return c.dd(e),c.Dc(2).cancelOrderModalVisible=t}))("nzOnCancel",(function(){return c.dd(e),c.Dc(2).handleCancelModalCancel()})),c.rc(1,"nz-row"),c.rc(2,"nz-col",9),c.mc(3,"i",102),c.qc(),c.rc(4,"nz-col",9),c.rc(5,"h4",103),c.qd(6,"Order Cancellation"),c.qc(),c.qc(),c.qc(),c.rc(7,"nz-row"),c.mc(8,"nz-col",9),c.rc(9,"nz-col",9),c.rc(10,"p",103),c.qd(11,"This action will cancel your trade action."),c.qc(),c.qc(),c.qc(),c.rc(12,"nz-row"),c.mc(13,"nz-col",9),c.rc(14,"nz-col",9),c.rc(15,"ui-input-group",104),c.rc(16,"input",105),c.zc("ngModelChange",(function(t){return c.dd(e),c.Dc(2).password=t})),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(17,"nz-row"),c.rc(18,"div",106),c.rc(19,"button",107),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleCancelModalCancel()})),c.qd(20,"Maybe Later"),c.qc(),c.rc(21,"button",108),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleCancelModalOk()})),c.qd(22,"Confirm"),c.qc(),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(2);c.Mc("nzVisible",e.cancelOrderModalVisible)("nzFooter",null)("nzWrapClassName","vertical-center-modal"),c.Ub(2),c.Mc("nzSpan",2),c.Ub(2),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(2),c.Mc("type","password")("ngModel",e.password),c.Ub(3),c.Mc("nzLoading",e.modalButtonLoading),c.Ub(2),c.Mc("nzLoading",e.modalButtonLoading)}}function Ge(e,t){if(1&e&&(c.od(0,je,23,13,"nz-modal",100),c.Ec(1,"async")),2&e){const e=c.Dc();c.Mc("ngIf",!c.Fc(1,1,e.isMobile$))}}function We(e,t){if(1&e){const e=c.sc();c.rc(0,"b2c-mobile-drawer",110),c.zc("showChange",(function(){return c.dd(e),c.Dc(2).handleCancelModalCancel()}))("showChange",(function(t){return c.dd(e),c.Dc(2).cancelOrderModalVisible=t})),c.rc(1,"nz-row"),c.rc(2,"nz-col",9),c.mc(3,"i",102),c.qc(),c.rc(4,"nz-col",9),c.rc(5,"h4",103),c.qd(6,"Order Cancellation"),c.qc(),c.qc(),c.qc(),c.rc(7,"nz-row"),c.mc(8,"nz-col",9),c.rc(9,"nz-col",9),c.rc(10,"p",103),c.qd(11,"This action will cancel your trade action."),c.qc(),c.qc(),c.qc(),c.rc(12,"nz-row"),c.mc(13,"nz-col",9),c.rc(14,"nz-col",9),c.rc(15,"ui-input-group",104),c.rc(16,"input",105),c.zc("ngModelChange",(function(t){return c.dd(e),c.Dc(2).password=t})),c.qc(),c.qc(),c.qc(),c.qc(),c.rc(17,"div",111),c.rc(18,"button",112),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleCancelModalCancel()})),c.qd(19,"Maybe Later"),c.qc(),c.rc(20,"button",113),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleCancelModalOk()})),c.qd(21,"Confirm"),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(2);c.Mc("show",e.cancelOrderModalVisible)("hideButtons",!0)("height",350),c.Ub(2),c.Mc("nzSpan",2),c.Ub(2),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(2),c.Mc("type","password")("ngModel",e.password),c.Ub(2),c.Mc("nzLoading",e.modalButtonLoading),c.Ub(2),c.Mc("nzLoading",e.modalButtonLoading)}}function Ye(e,t){if(1&e&&(c.od(0,We,22,13,"b2c-mobile-drawer",109),c.Ec(1,"async")),2&e){const e=c.Dc();c.Mc("ngIf",c.Fc(1,1,e.isMobile$))}}function Ke(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-modal",115),c.zc("nzVisibleChange",(function(t){return c.dd(e),c.Dc(2).chinaStockModifyModalVisible=t})),c.rc(1,"nz-row"),c.rc(2,"nz-col",9),c.mc(3,"i",102),c.qc(),c.rc(4,"nz-col",9),c.rc(5,"h4",103),c.qd(6," Amendment of order is not allowed"),c.qc(),c.qc(),c.qc(),c.rc(7,"nz-row"),c.mc(8,"nz-col",9),c.rc(9,"nz-col",9),c.rc(10,"p",103),c.qd(11,"As prescribed by the Exchange, amendment of order is not allowed for Shanghai and Shenzhen Stock Exchange. You may cancel and place a new order."),c.qc(),c.qc(),c.qc(),c.rc(12,"nz-row"),c.rc(13,"div",106),c.rc(14,"button",107),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleChinaStockModifyModalCancel()})),c.qd(15,"Maybe Later"),c.qc(),c.rc(16,"button",108),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleChinaStockModifyModalOk()})),c.qd(17,"Cancel Order"),c.qc(),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(2);c.Mc("nzVisible",e.chinaStockModifyModalVisible)("nzFooter",null)("nzClosable",!1)("nzWrapClassName","vertical-center-modal"),c.Ub(2),c.Mc("nzSpan",2),c.Ub(2),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(5),c.Mc("nzLoading",e.modalButtonLoading),c.Ub(2),c.Mc("nzLoading",e.modalButtonLoading)}}function Xe(e,t){if(1&e&&(c.od(0,Ke,18,10,"nz-modal",114),c.Ec(1,"async")),2&e){const e=c.Dc();c.Mc("ngIf",!c.Fc(1,1,e.isMobile$))}}function Qe(e,t){if(1&e){const e=c.sc();c.rc(0,"b2c-mobile-drawer",110),c.zc("showChange",(function(t){return c.dd(e),c.Dc(2).chinaStockModifyModalVisible=t})),c.rc(1,"nz-row"),c.rc(2,"nz-col",9),c.mc(3,"i",102),c.qc(),c.rc(4,"nz-col",9),c.rc(5,"h4",103),c.qd(6,"Amendment of order is not allowed"),c.qc(),c.qc(),c.qc(),c.rc(7,"nz-row"),c.mc(8,"nz-col",9),c.rc(9,"nz-col",9),c.rc(10,"p",103),c.qd(11,"As prescribed by the Exchange, amendment of order is not allowed for Shanghai and Shenzhen Stock Exchange. You may cancel and place a new order."),c.qc(),c.qc(),c.qc(),c.rc(12,"div",111),c.rc(13,"button",112),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleChinaStockModifyModalCancel()})),c.qd(14,"Maybe Later"),c.qc(),c.rc(15,"button",113),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleChinaStockModifyModalOk()})),c.qd(16,"Cancel Order"),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(2);c.Mc("show",e.chinaStockModifyModalVisible)("hideButtons",!0)("height",350),c.Ub(2),c.Mc("nzSpan",2),c.Ub(2),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzSpan",2),c.Ub(1),c.Mc("nzSpan",22),c.Ub(4),c.Mc("nzLoading",e.modalButtonLoading),c.Ub(2),c.Mc("nzLoading",e.modalButtonLoading)}}function Ze(e,t){if(1&e&&(c.od(0,Qe,17,9,"b2c-mobile-drawer",109),c.Ec(1,"async")),2&e){const e=c.Dc();c.Mc("ngIf",c.Fc(1,1,e.isMobile$))}}let Je=(()=>{class e{constructor(e,t,n,i,o,s,a,l,d,u,h,p,m,f,g){this.store=e,this.authService=t,this.stockTransactionRestService=n,this.orderBookService=i,this.accountService=o,this.accountRestService=s,this.modalService=a,this.liveFeedService=l,this.ref=d,this.portfolioService=u,this.stockInfoRestService=h,this.lightStreamerHelperService=p,this.scheduledSellRestService=m,this.subHandlingService=f,this.stocksFactsheetRestService=g,this.CNH="CNH",this.CNY="CNY",this.isCalculator=!1,this.isSwitchCurrency=!0,this.MARKET_DEPTH_FIELDS=["symbol","exchange","stockCode","level","type","volume","price","numberOfTrade","brokerQueue"],this.PRICE_DELAY="PRICE-DELAY-",this.PRICE_QUOTE_FIELDS=["symbol","exchange","stockCode","stockName","currency","lastPrice","cumulativeVolume","bidPrice","bidQuantity","askPrice","askQuantity","openPrice","closePrice","dayHigh","dayLow","change","changePercentage"],this.SNAP_INFO_NONE="SNAP_INFO-NONE-",this.KLSE="KLSE",this.BURSA="BURSA",this.SSE=r.q.SSE,this.SZSE=r.q.SZSE,this.BUY="BUY",this.SELL="SELL",this.lotSize=100,this.imagePath=r.g.STOCKS_IMG_PATH,this.displayCols=[{key:"stockName",colName:"Stock Name"}
5,{key:"exchange",colName:"Exchange"},{key:"investmentAcctType",colName:"Account"},{key:"ordDate",colName:"Validity"},{key:"ordTime",colName:"Order Time"},{key:"ordSide",colName:"Type"},{key:"ordQty",colName:"Qty"},{key:"ordPrice",colName:"Price"},{key:"avgPrice",colName:"W.A.C"},{key:"remainingQty",colName:"Unmatched Qty"},{key:"filledQty",colName:"Matched Qty"},{key:"matchAmt",colName:"Matched Amt"},{key:"orderId",colName:"Contract ID"},{key:"ordStatusText",colName:"Status"},{key:"",colName:""}],this.MARKET_ORDER=r.q.ORDER_TYPE.MARKET_ORDER,this.MARKET_TO_LIMIT_ORDER=r.q.ORDER_TYPE.MARKET_TO_LIMIT_ORDER,this.LIMIT_ORDER=r.q.ORDER_TYPE.LIMIT_ORDER,this.SCHEDULED_SELL=r.q.ORDER_TYPE.SCHEDULED_SELL,this.STOP_ORDER=r.q.ORDER_TYPE.STOP_ORDER,this.STOP_LIMIT_ORDER=r.q.ORDER_TYPE.STOP_LIMIT_ORDER,this.MARRIED_TRADE=r.q.MARRIED_TRADE,this.TRUST_ACCOUNT=r.q.TRUST_ACCOUNT,this.AUTO_SWEEP=r.q.AUTO_SWEEP,this.isCdsAccountOpeningReactivationSuccessModalVisible=!1,this.cdsAccountOpeningReactivationSuccessModalContent=[],this.isLoading=!1,this.isCashAccountPayment=!1,this.FPX_SUCCESS_CODE=r.a.FPX_SUCCESS_CODE,this.noActionStatus=["2","3","4","7","8","9","C","X"],this.blackl
5istedStatus=["7","9"],this.cdsStatus="",this.hasProcessingCdsAccountReactivation=!1,this.hideAppBar=new c.s,this.emitMarketDepth=new c.s,this.handleCdsAccountReactivation=new c.s,this.modalClosed=new c.s,this.successVoid=new c.s,this.liveStreamDate=new Date,this.GBX_CURRENCY=r.q.LSE_GBX_CURRENCY,this.GBP_CURRENCY=r.q.LSE_GBP_CURRENCY,this.e2eeObj={},this.selectedItem={ordPrice:0},this.orderBookLoading=!0,this.modalButtonLoading=!1,this.orderBookInfos=[],this.tempOrderBookInfos=[],this.todayDate=new Date,this.transactionPreviewData={},this.amendOrderModalVisible=!1,this.priceQuote={},this.previewAmendOrderModalVisible=!1,this.cancelOrderModalVisible=!1,this.qty=1,this.password="",this.selectedTransactionType=!0,this.marketDepthDataBid=[],this.marketDepthDataAsk=[],this.tempSubMarketDepth=[],this.drawerVisible=!1,this.exchangeFeeNameDescMap=new Map,this.orderBookUpdateInteral=1e4,this.isHkexLivestreaming=!1,this.isScheduledSellOrder=!1,this.chinaStockModifyModalVisible=!1,this.isNewTradingHourStart=!1,this.isStopOrder=!1,this.isStopLimitOrder=!1,this.cdsVisible=!1,this.cdsStatusConstant=r.q.CDS_STATUS,this.isNewOrderpadEnabled=!1,this.isInitialized=!1}ngOnInit(){this.accountRestService.getFactsheetRevampEnabledProperties().subscribe(e=>{!0===(null==e?void 0:e.data)&&(this.isNewOrderpadEnabled=!0),this.isInitialized=!0,this.onChangesAfterViewInit()}),this.readOrderBook(!1),this.readPortfolio(),this.orderBookPolling=setInterval(()=>{this.readOrderBook()},this.orderBookUpdateInteral),this.isHkexLivestreaming=this.liveFeedService.checkStreaming(r.q.HKEX);const e=new Date,t=new Date("2023-04-15 00:00:00");e.getTime()>=t.getTime()&&(this.isNewTradingHourStart=!0)}onChangesAfterViewInit(){}ngOnChanges(e){var t;this.filter(),(null===(t=null==e?void 0:e.cdsAccountPendingTrigger)||void 0===t?void 0:t.currentValue)&&(this.cdsVisible=!0)}ngOnDestroy(){clearInterval(this.orderBookPolling),this.snapStocksSubscription&&this.snapStocksSubscription.unsubscribe()}tableSort(e){this.tempOrderBookInfos=Object(o.c)(e,this.tempOrderBookInfos)}determineTypeColor(e){return"BUY"===e?"#009933":"#FF333A"}changeBidAsk(e){return"BUY"===e?"Buy":"Sell"}changeOrderTypeName(e,t,n,i){return"Y"===i?this.MARRIED_TRADE:"LIMIT"===e||"ELO"===e||"AL"===e?this.LIMIT_ORDER.label:e===this.MARKET_ORDER.value&&t===this.MARKET_TO_LIMIT_ORDER.timeInForce&&n===r.q.KLSE?this.MARKET_TO_LIMIT_ORDER.label:e===this.SCHEDULED_SELL.value?this.SCHEDULED_SELL.value:e===this.STOP_LIMIT_ORDER.value?this.STOP_LIMIT_ORDER.label:e===this.STOP_ORDER.value?this.STOP_ORDER.label:this.MARKET_ORDER.label}determinePriceStatus(e,t){return(0===e||null===e)&&"LIMIT"!==t}getPriceDisplayText(e){return e===this.SCHEDULED_SELL.value?"-":"Market Price"}determineStatusColor(e){return 0==e||1==e||3==e||5==e||6==e||9==e||"A"==e||"B"==e||"C"==e||"D"==e||"E"==e?"ant-tag-blue":2==e?"tag-received":"tag-terminated"}hideOrderOption(e){return this.blacklistedStatus.includes(e.ordStatus)}hideActionOption(e){return this.noActionStatus.includes(e.ordStatus)||"Y"===e.marriedFlag}showAmendOrderModal(){console.log("[showAmendOrderModal] selected Item = ",this.selectedItem);let e={orderId:this.selectedItem.orderId,stockCode:this.selectedItem.code,price:this.selectedItem.ordPrice,quantity:this.selectedItem.ordQty,orderType:this.selectedItem.ordType,refno:this.accountService.getTradableAccountRefno};if(console.log("amend order details",e),this.selectedItem.exchange!==this.KLSE||this.cdsStatus!==this.cdsStatusConstant[1]&&this.cdsStatus!==this.cdsStatusConstant[2]){const t=this.selectedItem.code?this.selectedItem.code:this.selectedItem.stockCode;this.getGeneralFeeDetails(t,this.selectedItem.exchange),this.processStopOrderTrxnRequestModel(e),this.getAmendFeeOrder(e,!0),this.selectedTransactionType=this.selectedItem.ordSide===this.BUY,this.stocksFactsheetRestService.readStocksTickerAndPriceInfo(t,this.selectedItem.exchange===r.q.BURSA?r.q.KLSE:this.selectedItem.exchange).subscribe(e=>{e.status===r.a.RESPONSE_SUCCESS&&e.data&&e.data.priceQuote&&e.data.priceQuote[0]&&(this.priceQuote=e.data.priceQuote[0])}),Promise.resolve().then(()=>{console.log("Trigger amend order = ",this.amendOrderModalVisible),this.amendOrderModalVisible=!0,this.ref.detectChanges(),console.log("Trigger changes = ",this.amendOrderModalVisible)}),this.closeDrawer(),this.isAcctAllowScheduledSell&&this.getEnabledProduct()}else this.cdsVisible=!0,this.closeDrawer()}showChinaStcokAmendOrder(){this.chinaStockModifyModalVisible=!0,this.closeDrawer()}showCancelOrderModal(){this.closeDrawer(),this.cancelOrderModalVisible=!0}setSelectedItem(e){this.feeDetail=null,this.feeDetailStatus=null,this.selectedItem=Object(m.a)(e),this.selectedTransactionType=e.ordSide===this.BUY,e.exchange!==r.q.KLSE&&e.exchange!==r.q.BURSA&&e.exchange!==r.q.HKEX&&e.exchange!==r.q.SSE&&e.exchange!==r.q.SZSE||this.handleSelectedStockForMarketDepth(this.selectedItem),this.handleSelectedStockFoPriceQuote(this.selectedItem),this.getGeneralFeeDetails(this.selectedItem.code?this.selectedItem.code:this.selectedItem.stockCode,this.selectedItem.exchange),this.selectedItem.exchange!==r.q.HKEX||this.isHkexLivestreaming||(this.patchFromExistingSnap(),this.listenToSnapChange())}patchFromExistingSnap(){console.log(this.selectedItem);let e=this.liveFeedService.getSnapStocks(this.selectedItem.symbol);return e&&e.endSnapDate>(new Date).getTime()?(this.mapDesiredDataFromSnap(this.selectedItem,e),!1):(e&&e.endSnapDate<=(new Date).getTime()&&this.liveFeedService.removeSnapStock(this.selectedItem.symbol),!0)}listenToSnapChange(){this.snapStocksSubscription=this.liveFeedService.getSnapStocksObservable().subscribe(e=>{if(e&&0!=e.size){let t=e.get(this.selectedItem.symbol);t&&t.endSnapDate>(new Date).getTime()&&this.mapDesiredDataFromSnap(this.selectedItem,t),t&&t.endSnapDate<=(new Date).getTime()&&this.liveFeedService.removeSnapStock(this.selectedItem.symbol)}})}mapDesiredDataFromSnap(e,t){e.lastPrice=parseFloat(t.lastPrice),e.changePercentage=parseFloat(t.changePercentage),e.change=parseFloat(t.change),e.dayHigh=parseFloat(t.dayHigh),e.dayLow=parseFloat(t.dayLow),e.o
5penPrice=parseFloat(t.openPrice),e.cumulativeVolume=parseFloat(t.cumulativeVolume),e.lastSnapDate=t.updateTime,e.updateTime=t.updateTime}readOrderBook(e){this.todayDate=new Date;const t=this.scheduledSellRestService.readOrderBook(this.accountService.getTradableAccountRefno),n=this.orderBookService.readOrderBook(this.accountService.getTradableAccountRefno,r.q.allExchangeStr(),e);this.subHandlingService.once(Object(h.a)([t,n]).pipe(Object(M.a)(e=>{if("FAILED"===e[0].status||"FAILED"===e[1].status)this.createNotification("error","Fail to read order book. Please try again later.");else{let t=[];t.push(...e[0].data,...e[1].data),this.orderBookInfos=t,this.tempOrderBookInfos=t,this.refactorOrderBookInfos(this.orderBookInfos),this.refactorOrderBookInfos(this.tempOrderBookInfos),this.filter(),this.tableSort({key:this.displayCols[3].key,value:"descend"}),this.orderBookLoading=!1}})))}refactorOrderBookInfos(e){e.forEach(e=>{e.securityType=e.exchangeSubType,e.name=e.stockName,e.code=e.stockCode,e.matchAmt=e.filledQty*e.avgPrice})}filter(){this.tempOrderBookInfos=this.orderBookInfos,this.filterStatus&&"ALL"!==this.filterStatus&&(this.tempOrderBookInfos=this.orderBookInfos.filter(e=>e.exchange===this.filterStatus)),this.filterSearchText&&(this.tempOrderBookInfos=this.tempOrderBookInfos.filter(e=>e.stockName.toLowerCase().includes(this.filterSearchText.toLowerCase())||e.stockCode.toLowerCase().includes(this.filterSearchText.toLowerCase()))),this.filterAccount&&(this.tempOrderBookInfos=this.tempOrderBookInfos.filter(e=>e.refno.toLowerCase().includes(this.filterAccount.toLowerCase())||e.refno.toLowerCase().includes(this.filterAccount.toLowerCase())))}handleCancelModalCancel(){this.cancelOrderModalVisible=!1,this.showDrawer(this.selectedItem),this.hideModal(this.cancelOrderModalVisible)}handleCancelModalOk(){const e=this.accountService.getTradableAccountRefno;if(!this.password)return void this.createNotification("error","Please enter your password");this.modalButtonLoading=!0;const t={orderId:this.selectedItem.orderId,refno:e};this.authService.getPresessionModel().subscribe(n=>{this.e2eeObj=n,this.e2eeObj.hashedPassword=this.authService.getHashPassword(this.e2eeObj,this.password);const i={orderId:this.selectedItem.orderId,refno:e,password:this.e2eeObj.hashedPassword,e2eeRandom:this.e2eeObj.e2eeRandom};let c;this.selectedItem.ordType===r.q.SCHEDULED_SELL?(c=this.scheduledSellRestService.cancelOrder(i),this.cancelOrder(c)):this.stockTransactionRestService.precheckCancelOrder(t).subscribe(e=>{e.success||e.status===s.a.SUCCESS?(c=this.stockTransactionRestService.cancelOrder(i),this.cancelOrder(c)):(this.createNotification("error",e.errorMessage),this.password=null,this.modalButtonLoading=!1,this.cancelOrderModalVisible=!1,this.hideModal(this.cancelOrderModalVisible))})})}handleChinaStockModifyModalOk(){this.chinaStockModifyModalVisible=!1,this.cancelOrderModalVisible=!0,this.hideModal(this.chinaStockModifyModalVisible)}handleChinaStockModifyModalCancel(){this.chinaStockModifyModalVisible=!1,this.hideModal(this.chinaStockModifyModalVisible)}cancelOrder(e){this.subHandlingService.once(Object(h.a)([e]).pipe(Object(M.a)(e=>{e[0].success||e[0].status===s.a.SUCCESS?(this.createNotification("success","Success"),this.cancelOrderModalVisible=!1,this.hideModal(this.cancelOrderModalVisible),this.onSuccessVoid(),this.password=null,this.refreshPortfolio(!0),setTimeout(()=>{this.readOrderBook(),this.store.dispatch(new y.O(!0))},3e3)):(this.createNotification("error",e[0].errorMessage),this.password=null),this.modalButtonLoading=!1})))}validate(){return!(!this.priceAllow||!this.quantityAllow)}createNotification(e,t){if("success"===e){const e=this.modalService.success({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}else if("error"===e){const e=this.modalService.error({nzTitle:null,nzContent:t,nzWrapClassName:"vertical-center-modal"});setTimeout(()=>e.destroy(),5e3)}}mobileDetermineStatusColor(e){return"BUY"===e?"bg-profit":"bg-loss"}mobileChangeBidAsk(e){return"BUY"===e?"B":"A"}handleSelectedStockForMarketDepth(e){this.unsubscribeMarketDepthLS();let t=Object(m.a)(e);this.marketDepthDataBid=[],this.marketDepthDataAsk=[];const n=this.liveFeedService.checkLiveStreamingMarketDepth(e.exchange);let i=this.liveFeedService.subscribeMarketDepth(this.lsClient,this.MARKET_DEPTH_FIELDS,t,n);null!=i&&(this.tempSubMarketDepth.push(i),this.tempSubMarketDepth.forEach(t=>{t.addListener({onItemUpdate:t=>{let n=[],i=parseInt(this.liveFeedService.checkLiveStreamingMarketDepth(e.exchange));"bid"===t.updateValues[6]&&"ADD"===t.updateValues[12]?(n=this.marketDepthDataBid.length>=i?[]:Object(m.a)(this.marketDepthDataBid),n.push(t.updateValues),this.marketDepthDataBid=Object(m.a)(n)):"ask"===t.updateValues[6]&&"ADD"===t.updateValues[12]?(n=this.marketDepthDataAsk.length>=i?[]:Object(m.a)(this.marketDepthDataAsk),n.push(t.updateValues),this.marketDepthDataAsk=Object(m.a)(n)):"bid"===t.updateValues[6]&&"UPDATE"===t.updateValues[12]?(n=Object(m.a)(this.marketDepthDataBid),n[parseInt(t.updateValues[11])]=t.updateValues,this.marketDepthDataBid=Object(m.a)(n)):"ask"===t.updateValues[6]&&"UPDATE"===t.updateValues[12]&&(n=Object(m.a)(this.marketDepthDataAsk),n[parseInt(t.updateValues[11])-i]=t.updateValues,this.marketDepthDataAsk=Object(m.a)(n)),this.ref.markForCheck()}})}))}handleAmendModalVisible(e){this.amendOrderModalVisible=e,this.showDrawer(this.selectedItem),this.previewAmendOrderModalVisible||this.hideModal(e)}handlePreviewAmendModalVisible(e){this.previewAmendOrderModalVisible=e,this.closeDrawer(),setTimeout(()=>{this.readOrderBook()},3e3),this.amendOrderModalVisible||this.hideModal(e)}handlePreviewAmendModalOpen(e){this.previewAmendOrderModalVisible=!0,this.transactionPreviewData.qty=e.qty,this.transactionPreviewData.lotSize=e.lotSize,this.selectedTransactionType=e.transactionType,this.transactionPreviewData.price=e.price,this.transactionPreviewData.expireDate=e.expireDate,this.transactionPreviewData.validity=e.validity,this.transactionPreviewData.originalNetAmount=e.originalNetAmount,this.isScheduledSellOrder=e.isScheduledSellOrder,this.transactionPreviewData.nextScheduledSellDate=e.nextScheduledSellDate,this.transactionPreviewData.orderType=e.orderType,this.transactionPreviewData.timeInForce=e.timeInForce,this.transactionPreviewData.stopPx=e.stopPx,this.transactionPreviewData.previewMarginOrder=e.previewMarginOrder,this.marketOrderTypeSelected=e.orderType===this.MARKET_ORDER.value&&e.timeInForce===this.MARKET_ORDER.timeInForce?this.MARKET_ORDER.label:e.orderType===this.MARKET_ORDER.value&&e.timeInForce===this.MARKET_TO_LIMIT_ORDER.timeInForce?r.q.US_EXCHANGES.includes(this.selectedItem.exchange)?this.MARKET_ORDER.label:this.MARKET_TO_LIMIT_ORDER.label:"",this.readPortfolio()}handleSelectedTransactionType(e){this.selectedTransactionType=e}findStockPosition(e){for(let t=0;t<this.orderBookInfos.length;t++)if(e.includes(this.orderBookInfos[t].stockCode))return t;return-1}handleTransactionPreviewModalBack(e){this.selectedItem.qty=this.transactionPreviewData.qty,this.selectedTransactionType?this.selectedItem.askPrice=this.transactionPreviewData.price:this.selectedItem.bidPrice=this.transactionPreviewData.price,this.selectedItem.ordPrice=this.transactionPreviewData.price,this.marketOrderTypeSelected===this.MARKET_ORDER.label?(this.selectedItem.orderType=this.MARKET_ORDER.value,this.selectedItem.timeInForce=this.MARKET_ORDER.timeInForce):this.marketOrderTypeSelected===this.MARKET_TO_LIMIT_ORDER.label?(this.selectedItem.orderType=this.MARKET_ORDER.value,this.selectedItem.timeInForce=this.MARKET_TO_LIMIT_ORDER.timeInForce):(this.selectedItem.orderType="",this.selectedItem.timeInForce=this.transactionPreviewData.validity),this.previewAmendOrderModalVisible=e,this.amendOrderModalVisible=!0}showDrawer(e){this.setSelectedItem(e),this.drawerVisible=!0,this.hideAppBar.emit(!0)}closeDrawer(){this.drawerVisible=!1,this.hideAppBar.emit(!1)}readPortfolio(){this.portfolioService.readPortfolio(this.accountService.getTradableAccountRefno,r.q.allExchangeStr()).subscribe(e=>{this.portfolioItems=e.data})}refreshPortfolio(e){e?setTimeout(()=>{this.readPortfolio()},3e3):this.readPortfolio()}processStopOrderTrxnRequestModel(e){this.selectedItem.ordType===this.STOP_ORDER.value?(e.price=0,e.orderType=this.STOP_ORDER.value,e.stopPx=this.selectedItem.stopPx):this.selectedItem.ordType===this.STOP_LIMIT_ORDER.value&&(e.orderType=this.STOP_LIMIT_ORDER.value,e.stopPx=this.selectedItem.stopPx,e.price=this.selectedItem.ordPrice)}getAmendFeeOrder(e,t=!1){var n;let i,c=e.orderType===r.q.SCHEDULED_SELL||!0===e.orderType;if(c){if(i=e,i.orderType=null,null==i.exchange)return}else i={orderId:this.selectedItem.orderId,stockCode:this.selectedItem.code,price:t||this.selectedItem.currency!==r.q.LSE_GBX_CURRENCY?e.price:e.price/r.q.LSE_GBX_TO_GBP_MULTIPLIER,quantity:e.quantity,orderType:this.selectedItem.ordType===this.MARKET_ORDER.value?e.orderType:this.selectedItem.ordType,timeInForce:e.timeInForce,refno:this.accountService.getTradableAccountRefno};if(this.processStopOrderTrxnRequestModel(i),!isNaN(i.price)&&!isNaN(i.quantity)&&i.stockCode){this.feeDetailStatus=S.a.LOADING,r.q.LSE_GBX_CURRENCY===(null===(n=this.selectedItem)||void 0===n?void 0:n.currency)&&(e.price=e.price/r.q.LSE_GBX_TO_GBP_MULTIPLIER);let t=c?this.scheduledSellRestService.getScheduledSellFee(i):this.stockInfoRestService.getFeeAmendOrder(i);try{this.subHandlingService.once(Object(h.a)([t]).pipe(Object(M.a)(e=>{(e[0].success||e[0].status===s.a.SUCCESS)&&(e[0].data.tradingReference=c?r.q.SCHEDULED_SELL:e[0].data.tradingReference,this.feeDetail=Object(m.a)(e[0].data),this.feeDetailStatus=S.a.COMPLETED,this.addSstToFeeDetails(this.feeDetail))})))}catch(o){console.error(o),this.feeDetailStatus=S.a.ERROR}}}navigateToStocksFactsheet(e,t,n,i){let c;"BURSA"===t&&(t="KLSE"),c="ETF"==i?Object(f.f)(g.b.ETF,n,"",e,t):Object(f.f)(g.b.STOCK_AND_ETF,n,"",e,t),Object(b.a)(c.route,c.params)}determineSedolNumberExchg(e){return e.exchange===r.q.KLSE||e.exchange===r.q.BURSA?"135:"+e.stockCode:"126:"+e.stockCode}handleSelectedStockFoPriceQuote(e){this.unsubscribePriceQuoteLS();let t=this;e.sedolnumber=this.determineSedolNumberExchg(e),console.log("Symbol for LS Subscription:",e.symbol),console.log("Symbol for LS Subscription 2:",this.lsClient.connectionDetail
5s),this.tempSubPriceQuote=this.liveFeedService.subscribePriceQuote(this.lsClient,this.PRICE_QUOTE_FIELDS,[e])[0],this.tempSubPriceQuote.addListener({onItemUpdate:e=>{let n=[];if(!this.patchFromExistingSnap())return;let i=!1;"GBX"===e.getValue("currency")&&(i=!0),e.forEachChangedField((e,c,o)=>{const s=this.PRICE_QUOTE_FIELDS.indexOf(e);let a=o;this.isConvertFieldRequired(e,i)&&o&&(a=parseFloat(o)/r.q.LSE_GBX_TO_GBP_MULTIPLIER),n[s]=a,"exchange"===e&&(n[s]=a===r.q.BURSA?r.q.KLSE:a),"currency"===e&&(n[s]=a===t.CNH?t.CNY:a),t.selectedItem[e]=n[s]})}})}isConvertFieldRequired(e,t){return!("lastPrice"!==e&&"bidPrice"!==e&&"askPrice"!==e&&"openPrice"!==e&&"closePrice"!==e&&"dayHigh"!==e&&"dayLow"!==e&&"change"!==e||!t)}handleSubscribeDelayedSnap(e){return new Promise(t=>{const n=this;console.log(e),(null==e?void 0:e.symbol)&&null!=(null==e?void 0:e.symbol)&&null!=(null==e?void 0:e.symbol)&&!(null==e?void 0:e.symbol.includes("undefined"))?(this.tempSnapSub=this.liveFeedService.getSNAP(this.lsClient),this.tempSnapSub.addListener({onItemUpdate(i){let c=JSON.parse(i.updateValues[3]);n.selectedItem=Object.assign(Object.assign({},e),c[e.symbol]),n.unsubscribeSnapOnly(),t(n.selectedItem)},onSubscription(){n.lsClient.sendMessage(n.liveFeedService.constructMessage(v.a.PRICE,n.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20","UNORDERED_MESSAGES",0,{})}})):console.log("Invalid symbol found for LS Subscription : "+(null==e?void 0:e.symbol))})}unsubscribeSnapOnly(){this.tempSnapSub&&(this.lsClient.unsubscribe(this.tempSnapSub),this.tempSnapSub.getListeners().forEach(e=>{this.tempSnapSub.removeListener(e)}),this.tempSnapSub=null)}unsubscribePriceQuoteLS(){this.tempSubPriceQuote&&(this.lsClient.unsubscribe(this.tempSubPriceQuote),this.tempSubPriceQuote=null)}unsubscribeMarketDepthLS(){this.tempSubMarketDepth.length>0&&(this.tempSubMarketDepth.forEach(e=>{this.lsClient.unsubscribe(e)}),this.tempSubMarketDepth=[]),this.marketDepthDataAsk=[],this.marketDepthDataBid=[]}getGeneralFeeDetails(e,t){e&&t&&this.subHandlingService.subscribe(this.stockInfoRestService.getFeeDetails(e,t).pipe(Object(M.a)(e=>{e.status===r.a.RESPONSE_SUCCESS&&(this.generalStockBuyFeeDetails=e.data.buyFeeDetails,this.generalStockSellFeeDetails=e.data.sellFeeDetails,t===r.q.HKEX&&(this.generalStockBuyFeeDetails.exchangeFees=Object(o.b)(this.generalStockBuyFeeDetails.exchangeFees,r.q.EXCHANGE_FEE_ORDER,"exchangeFeeName"),this.generalStockSellFeeDetails.exchangeFees=Object(o.b)(this.generalStockSellFeeDetails.exchangeFees,r.q.EXCHANGE_FEE_ORDER,"exchangeFeeName")),this.updateExchangeFeeNameDescMap())})))}updateExchangeFeeNameDescMap(){this.exchangeFeeNameDescMap.clear();const e=this.selectedTransactionType?this.generalStockBuyFeeDetails:this.generalStockSellFeeDetails;if(e&&e.exchangeFees){const t=new Map;e.exchangeFees.forEach(e=>{e.exchangeFeeName&&""!==e.exchangeFeeName&&(t.set(e.exchangeFeeName,e.feeDesc),null!=e.taxRate&&e.taxRate>0)&&t.set(e.exchangeFeeName+"_SST",e.feeDesc+" SST")}),e.taxRate&&e.taxRate>0&&t.set("COMMISSION_SST","Processing Fee SST"),this.exchangeFeeNameDescMap=new Map(t)}}addSstToFeeDetails(e){const t=this.selectedTransactionType?this.generalStockBuyFeeDetails:this.generalStockSellFeeDetails,n=[];e.feeDetails.map(e=>{const i=parseFloat(e.feeAmount);let c=0;if("COMMISSION"===e.feeName&&t.taxRate&&t.taxRate>0)c=(null==t?void 0:t.taxRate)||0;else{const n=t.exchangeFees.find(t=>t.exchangeFeeName===e.feeName);n&&n.taxRate&&n.taxRate>0&&(c=n.taxRate)}if(c>0){const t=Object(T.a)(i,c);n.push({currency:e.currency,feeAmount:t.toFixed(2),feeName:e.feeName+"_SST"})}}),(null==n?void 0:n.length)>0&&e.feeDetails.push(...n)}jsonConcat(e,t){for(let n in t)e[n]=t[n];return e}exchangeColor(e){return e===r.q.BURSA||e===r.q.KLSE?"#003A8C":e===r.q.HKEX?"#34B78A":"#D02A2D"}snapSelectedStock(e){let t=this.liveFeedService.constructMessage(v.a.PRICE,this.liveFeedService.checkPermissionForSnap(e.exchange),e.symbol)+"-TS=20,MD=20",n=new p.a(n=>{this.liveFeedService.subscribeSnap(this.lsClient,t,n,e.exchange)}).subscribe(t=>{var i,c;if(n.unsubscribe(),!t)return;const o=JSON.parse(t.updateValues[3]);this.selectedItem.lastPrice=parseFloat(o[e.symbol].lastPrice),this.selectedItem.changePercentage=parseFloat(o[e.symbol].changePercentage),this.selectedItem.change=parseFloat(o[e.symbol].change),this.selectedItem.dayHigh=parseFloat(o[e.symbol].dayHigh),this.selectedItem.dayLow=parseFloat(o[e.symbol].dayLow),this.selectedItem.openPrice=parseFloat(o[e.symbol].openPrice),this.selectedItem.cumulativeVolume=parseFloat(o[e.symbol].cumulativeVolume),(null===(i=this.selectedItem)||void 0===i?void 0:i.exchange)===r.q.HKEX&&(this.selectedItem.lastSnapDate=o[e.symbol].updateTime,this.selectedItem.updateTime=o[e.symbol].updateTime,(null===(c=o[e.symbol])||void 0===c?void 0:c.updateTime)&&(this.selectedItem.endSnapDate=Number(o[e.symbol].updateTime)+9e5)),this.liveFeedService.storeSnapStocks(e.symbol,Object.assign(Object.assign({},this.selectedItem),o[e.symbol]))})}convertToDate(e){return new Date(e.replace(/(\d{4})(\d{2})(\d{2})/,"$1-$2-$3"))}showValidity(e){return"GTD"===e?"GTD":e===this.SCHEDULED_SELL.value?this.SCHEDULED_SELL.value:"DAY"}onSelectStockInfoRow(e){return Object(i.b)(this,void 0,void 0,(function*(){e.exchange===r.q.BURSA&&(e.exchange=r.q.KLSE),this.selectedItem=Object(m.a)(e),this.handleSelectedStockFoPriceQuote(this.selectedItem),this.emitMarketDepth.emit
5(this.selectedItem)}))}getEnabledProduct(){this.scheduledSellRestService.getEnabledProduct(this.selectedItem.code,this.selectedItem.exchange).subscribe(e=>{this.rspEtfProductInfo=e.data})}handleSelectedInvestmentAcctType(e){this.selectedAcctType=e}handleSelectedPurchasingPowerType(e){this.selectedPurchasingPowerType=e}handleCdsModalVisible(e){this.cdsVisible=e,this.showDrawer(this.selectedItem)}handleCdsReactivation(e){this.handleCdsAccountReactivation.emit(e)}hideModal(e){e||this.modalClosed.emit(e)}onSuccessVoid(){this.successVoid.emit()}}return e.\u0275fac=function(t){return new(t||e)(c.lc(d.i),c.lc(w.a),c.lc(z.a),c.lc(D.a),c.lc(P.a),c.lc(I.a),c.lc(k.e),c.lc(F.a),c.lc(c.j),c.lc(O.a),c.lc(U.a),c.lc(a.a),c.lc(x.a),c.lc(l.a),c.lc(L.a))},e.\u0275cmp=c.fc({type:e,selectors:[["app-order-book-your-order"]],inputs:{primaryCashAcctAvailableBalance:"primaryCashAcctAvailableBalance",lsClient:"lsClient",filterStatus:"filterStatus",filterSearchText:"filterSearchText",filterAccount:"filterAccount",isAcctAllowScheduledSell:"isAcctAllowScheduledSell",cdsStatus:"cdsStatus",hasProcessingCdsAccountReactivation:"hasProcessingCdsAccountReactivation",cdsAccountPendingTrigger:"cdsAccountPendingTrigger"},outputs:{hideAppBar:"hideAppBar",emitMarketDepth:"emitMarketDepth",handleCdsAccountReactivation:"handleCdsAccountReactivation",modalClosed:"modalClosed",successVoid:"successVoid"},features:[c.Tb([l.a,a.a,C.a,q.f,q.g]),c.Sb],decls:48,vars:36,consts:[[3,"nzActive","nzLoading"],["class","order-book-your-order-table",3,"nzData","nzScroll","nzShowPagination",4,"ngIf"],[1,"pt-3","text-sm"],[1,"text-xs","text-body","ml-2"],["nz-icon","","nzType","reload","nzTheme","outline",1,"pointer",3,"click"],["class","text-xs text-body ml-2",4,"ngIf"],["indicatorTemplateSpin",""],["nzSimple","",3,"nzIndicator"],[4,"ngTemplateOutlet"],[3,"nzSpan"],[3,"nzData","nzScroll","nzFrontPagination","nzShowPagination",4,"ngIf"],[1,"text-sm","my-2"],[1,"py-2",3,"nzSpan"],[3,"nzSpan",4,"ngIf"],["nzHeight","100%","nzPlacement","right",3,"nzClosable","nzWidth","nzVisible","nzWrapClassName","nzContent","nzOnClose",4,"ngIf"],[3,"isSwitchCurrency","isCalculator","feeDetailStatus","feeDetail","isModifyOrder","onlyModifyOrder","holdingInfo","visible","rspEtfProductInfo","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","changeVisible","emitData","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitGetFeeDetailAction","emitSnapSelectedStockAction",4,"ngIf"],[3,"lsClient","isSwitchCurrency","isCalculator","feeDetailStatus","feeNameMap","feeDetail","isModifyOrder","onlyModifyOrder","holdingInfo","visible","rspEtfProductInfo","priceQuote","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","changeVisible","emitData","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitGetFeeDetailAction","emitSnapSelectedStockAction",4,"ngIf"],[3,"isVisible","cdsStatus","selectedAcctType","hasProcessingCdsAccountReactivation","changeVisible","handleCdsAccountReactivation"],[3,"feeDetailStatus","isSwitchCurrency","feeDetail","isModifyOrder","onlyModifyOrder","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","readOrderBookAction","backVisible",4,"ngIf"],[3,"feeNameMap","feeDetailStatus","isSwitchCurrency","feeDetail","isModifyOrder","onlyModifyOrder","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","readOrderBookAction","backVisible",4,"ngIf"],["orderBookDetailsDrawer",""],["cancelModalTemplate",""],["cancelModalDrawer",""],["chinaConnectModifyModal",""],["chinaConnectModifyDrawer",""],[1,"order-book-your-order-table",3,"nzData","nzScroll","nzShowPagination"],["orderBookTable",""],[3,"nzSortChange"],[1,"text-xs"],["nzShowSort","","nzLeft","0","nzWidth","5%",1,"text-left",3,"nzSortKey"],["nzShowSort","",1,"text-left",3,"nzSortKey"],["nzShowSort","",1,"text-left",3,"nzSortKey","nzWidth"],["nzShowSort","",1,"text-right",3,"nzSortKey"],["class","pointer",3,"click",4,"ngFor","ngForOf"],[1,"pointer",3,"click"],["nzLeft","0"],[1,"ellipsis-stock-name"],[1,"font-weight-bold","text-xs",3,"click"],[1,"text-xs","text-right"],[1,"text-sm","align-middle"],[1,"ml-2",3,"exchange"],[1,"text-xs","align-middle"],[1,"d-flex","flex-wrap"],[1,"font-weight-bold","mb-0",3,"ngStyle"],[1,"mb-0"],[4,"ngIf"],["class","text-right text-xs align-middle",4,"ngIf"],[1,"text-right","text-xs","align-middle"],[1,"text-right","align-middle"],[1,"text-center","m-0",3,"ngClass"],[1,"order-book-order-status"],["nz-button","","nzType","circle","nz-dropdown","","nzTrigger","click",3,"nzDropdownMenu","click",4,"ngIf"],["menu","nzDropdownMenu"],["nz-menu",""],["nz-menu-item","",3,"click"],["nz-icon","","nzType","question-circle","nzTheme","outline","nz-tooltip","","nzTooltipTitle","Married Trade refers to a pre-arranged buy and sell transaction executed simultaneously."],["nz-button","","nzType","circle","nz-dropdown","","nzTrigger","click",3,"nzDropdownMenu","click"],["nz-icon","","nzType","more","nzTheme","outline",1,"pointer"],[3,"nzData","nzScroll","nzFrontPagination","nzShowPagination"],["nzWidth","5%"],["nzWidth","30%"],[1,"text-sm"],["nzWidth","35%",1,"text-right","text-sm"],[1,"font-weight-normal"],["nzWidth","25%",1,"text-right","text-sm"],[4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-sm","font-weight-bold","text-white"],[1,"text-info","font-weight-bold","ellipsis-stock-name",3,"click"],[1,"text-black-6"],[1,"mr-2",3,"exchange"],[1,"text-right","text-sm"],[1,"font-weight-bold"],[1,"m-0",3,"ngClass"],["nz-icon","","nzType","right","nzTheme","outline",3,"click",4,"ngIf"],["nz-icon","","nzType","right","nzTheme","outline",3,"click"],["nzHeight","100%","nzPlacement","right",3,"nzClosable","nzWidth","nzVisible","nzWrapClassName","nzContent","nzOnClose"],[3,"isSwitchCurrency","isCalculator","feeDetailStatus","feeDetail","isModifyOrder","onlyModifyOrder","holdingInfo","visible","rspEtfProductInfo","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","changeVisible","emitData","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitGetFeeDetailAction","emitSnapSelectedStockAction"],[3,"lsClient","
5isSwitchCurrency","isCalculator","feeDetailStatus","feeNameMap","feeDetail","isModifyOrder","onlyModifyOrder","holdingInfo","visible","rspEtfProductInfo","priceQuote","selectedStock","selectedTransactionType","selectedAccType","primaryCashAcctAvailableBalance","marketDepthDataBid","marketDepthDataAsk","changeVisible","emitData","changeSelectedTransactionType","changeSelectedInvestmentAcctType","changeSelectedPurchasingPowerType","emitGetFeeDetailAction","emitSnapSelectedStockAction"],[3,"feeDetailStatus","isSwitchCurrency","feeDetail","isModifyOrder","onlyModifyOrder","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","readOrderBookAction","backVisible"],[3,"feeNameMap","feeDetailStatus","isSwitchCurrency","feeDetail","isModifyOrder","onlyModifyOrder","visible","selectedStock","selectedPurchasingPowerType","selectedTransactionType","primaryCashAcctAvailableBalance","stockPreviewData","isScheduledSellOrder","marketOrderTypeSelected","changeVisible","refreshPortfolioAction","readOrderBookAction","backVisible"],[1,"border-bottom"],[3,"title","back"],[1,"p-2"],[1,"text-sm","text-black-6"],[1,"bg-black-2","p-2","mt-2"],[1,"text-right","font-weight-bold",3,"nzSpan"],[1,"mb-0",3,"ngStyle"],["nzTooltipTitle","Married Trade refers to a pre-arranged buy and sell transaction executed simultaneously.","nz-tooltip","",4,"ngIf"],[1,"text-right",3,"nzSpan"],[1,"pt-3",3,"nzSpan"],["nzTooltipTitle","Married Trade refers to a pre-arranged buy and sell transaction executed simultaneously.","nz-tooltip",""],["nz-icon","","nzType","question-circle","nzTheme","outline"],[1,"mt-4"],[1,"pt-2","font-weight-bold"],[1,"pt-2"],[1,"d-flex","align-items-center"],[1,"img-wrapper"],[1,"circle-button",3,"src"],[1,"ml-3",3,"click"],["class","model-cancel-order",3,"nzVisible","nzFooter","nzWrapClassName","nzVisibleChange","nzOnCancel",4,"ngIf"],[1,"model-cancel-order",3,"nzVisible","nzFooter","nzWrapClassName","nzVisibleChange","nzOnCancel"],["nz-icon","","nzType","exclamation-circle","nzTheme","fill",2,"color","#fd7800","font-size","25px"],["nz-typography",""],["nzLabelPlaceholder","Password","nzSize","small"],["ui-input","",2,"width","100%",3,"type","ngModel","ngModelChange"],[1,"text-right","mt-2","pt-3"],["nz-button","","nzType","outline",1,"mr-3",3,"nzLoading","click"],["nz-button","","nzType","primary",3,"nzLoading","click"],[3,"show","hideButtons","height","showChange",4,"ngIf"],[3,"show","hideButtons","height","showChange"],[1,"fixed-bottom","bg-white","shadow","p-3"],["nz-button","","nzBlock","","nzType","outline",1,"my-1",3,"nzLoading","click"],["nz-button","","nzBlock","","nzType","primary",1,"my-1",3,"nzLoading","click"],["class","model-cancel-order",3,"nzVisible","nzFooter","nzClosable","nzWrapClassName","nzVisibleChange",4,"ngIf"],[1,"model-cancel-order",3,"nzVisible","nzFooter","nzClosable","nzWrapClassName","nzVisibleChange"]],template:function(e,t){if(1&e&&(c.rc(0,"app-web-scaffold"),c.rc(1,"nz-row"),c.mc(2,"nz-skeleton",0),c.od(3,be,35,19,"nz-table",1),c.qc(),c.rc(4,"nz-row",2),c.rc(5,"p",3),c.qd(6),c.Ec(7,"date"),c.rc(8,"i",4),c.zc("click",(function(){return t.readOrderBook(!1)})),c.qc(),c.qc(),c.od(9,Se,14,0,"p",5),c.od(10,ye,17,0,"p",5),c.qc(),c.rc(11,"nz-row",2),c.od(12,ve,0,0,"ng-template",null,6,c.pd),c.mc(14,"nz-spin",7),c.qc(),c.od(15,Me,1,0,"ng-container",8),c.od(16,Ce,1,0,"ng-container",8),c.qc(),c.rc(17,"app-mobile-scaffold"),c.rc(18,"nz-row"),c.rc(19,"nz-col",9),c.mc(20,"nz-skeleton",0),c.od(21,Pe,27,6,"nz-table",10),c.qc(),c.qc(),c.rc(22,"nz-row",11),c.rc(23,"nz-col",12),c.qd(24),c.Ec(25,"date"),c.rc(26,"i",4),c.zc("click",(function(){return t.readOrderBook(!1)})),c.qc(),c.qc(),c.od(27,Ie,17,1,"nz-col",13),c.od(28,ke,14,1,"nz-col",13),c.qc(),c.od(29,Ae,1,5,"nz-drawer",14),c.Ec(30,"async"),c.od(31,Ee,1,0,"ng-container",8),c.od(32,Fe,1,0,"ng-container",8),c.qc(),c.od(33,Oe,1,15,"app-stock-transaction-modal",15),c.od(34,Ue,1,18,"app-stock-transaction-modal-revamp",16),c.rc(35,"cds-account-modal",17),c.zc("changeVisible",(function(e){return t.handleCdsModalVisible(e)}))("handleCdsAccountReactivation",(function(e){return t.handleCdsReactivation(e)})),c.qc(),c.od(36,xe,1,13,"app-stock-transaction-preview-modal",18),c.od(37,Le,1,14,"app-stock-transaction-preview-modal-revamp",19),c.od(38,$e,98,83,"ng-template",null,20,c.pd),c.od(40,Ge,2,3,"ng-template",null,21,c.pd),c.od(42,Ye,2,3,"ng-template",null,22,c.pd),c.od(44,Xe,2,3,"ng-template",null,23,c.pd),c.od(46,Ze,2,3,"ng-template",null,24,c.pd)),2&e){const e=c.ad(13),n=c.ad(41),i=c.ad(43),o=c.ad(45),s=c.ad(47);c.Ub(2),c.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),c.Ub(1),c.Mc("ngIf",!t.orderBookLoading),c.Ub(3),c.sd("Last Update: ",c.Gc(7,28,t.liveStreamDate,"HH:mm")," "),c.Ub(3),c.Mc("ngIf",!t.isNewTradingHourStart),c.Ub(1),c.Mc("ngIf",t.isNewTradingHourStart),c.Ub(4),c.Mc("nzIndicator",e),c.Ub(1),c.Mc("ngTemplateOutlet",n),c.Ub(1),c.Mc("ngTemplateOutlet",o),c.Ub(3),c.Mc("nzSpan",24),c.Ub(1),c.Mc("nzActive",!0)("nzLoading",t.orderBookLoading),c.Ub(1),c.Mc("ngIf",!t.orderBookLoading),c.Ub(2),c.Mc("nzSpan",24),c.Ub(1),c.sd(" Last Update : ",c.Gc(25,31,t.todayDate,"dd MMM yyyy HH:mm")," "),c.Ub(3),c.Mc("ngIf",t.isNewTradingHourStart),c.Ub(1),c.Mc("ngIf",!t.isNewTradingHourStart),c.Ub(1),c.Mc("ngIf",c.Fc(30,34,t.isMobile$)&&t.drawerVisible),c.Ub(2),c.Mc("ngTemplateOutlet",i),c.Ub(1),c.Mc("ngTemplateOutlet",s),c.Ub(1),c.Mc("ngIf",!t.isNewOrderpadEnabled),c.Ub(1),c.Mc("ngIf",t.isNewOrderpadEnabled),c.Ub(1),c.Mc("isVisible",t.cdsVisible)("cdsStatus",t.cdsStatus)("selectedAcctType",t.selectedAcctType)("hasProcessingCdsAccountReactivation",t.hasProcessingCdsAccountReactivation),c.Ub(1),c.Mc("ngIf",!t.isNewOrderpadEnabled),c.Ub(1),c.Mc("ngIf",t.isNewOrderpadEnabled)}},directives:[R.a,N.c,B.a,q.t,_.b,V.a,q.A,H.a,N.a,$.a,j.a,j.f,j.g,j.e,j.c,q.s,j.d,G.a,q.w,A.a,q.q,E.f,W.a,W.d,Y.e,K.a,E.d,X.a,Q.a,Z.a,J.a,ee.a,te.a,k.a,ne.c,ie.c,ne.b,ie.t,ie.w,ce.a],pipes:[q.f,q.b,oe.a,q.G,q.g,se.a,q.F,q.p],styles:[".ant-dropdown-menu-item[_ngcontent-%COMP%], .ant-dropdown-menu-submenu-title[_ngcontent-%COMP%]{color:#000} .ant-modal-footer, .model-cancel-order{border-top:0!important} .img-wrapper{width:27px;margin:5px;text-align:center}.order-book-your-order-table[_ngcontent-%COMP%] .ant-table-thead>tr>th .ant-table-column-sorter .ant-table-column-sorter-inner-full{margin-top:-
57px}.order-book-your-order-table[_ngcontent-%COMP%] .ant-table-thead>tr>th{padding:4px}.order-book-your-order-table[_ngcontent-%COMP%] .ant-table-tbody>tr>td{padding:4px}.order-book-order-status[_ngcontent-%COMP%]{max-width:60px;white-space:normal;display:inline-block}.ellipsis-stock-name[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;max-width:100%;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}"]}),Object(i.c)([Object(d.e)(u.a.isMobile)],e.prototype,"isMobile$",void 0),e})()},SeLP:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n("ofXK"),c=n("3Pt+"),o=n("Nqz0"),s=n("5vDB"),a=n("QlLE"),l=n("TaO5"),r=n("FwiY"),d=n("NMKc"),u=n("VnIy"),h=n("fXoL");let p=(()=>{class e{}return e.\u0275mod=h.jc({type:e}),e.\u0275inj=h.ic({factory:function(t){return new(t||e)},imports:[[c.n,i.c,o.e,s.b,a.c,l.c,r.c,d.a,u.a]]}),e})()},W1dw:function(e,t,n){"use strict";n.d(t,"a",(function(){return nt}));var i=n("mrSG"),c=n("fXoL"),o=n("cp0P"),s=n("vkgz"),a=n("nYR2"),l=n("lJxs"),r=n("TiNC"),d=n("2VHv"),u=n("AcyG"),h=n("gFZo"),p=n("H8v0"),m=n("iEbP"),f=n("P+IN"),g=n("G/fY"),b=n("6h7t"),S=n("k+8e"),y=n("nhH0"),v=n("6l6k"),M=n("Lcc6"),C=n("OAAr"),q=n("EFAh"),T=n("tyNb"),w=n("bz11"),z=n("JZDV"),D=n("H2Td"),P=n("Jxbx"),I=n("yPVp"),k=n("ofXK"),A=n("PpG7"),E=n("3Pt+"),F=n("B+r4"),O=n("5vDB"),U=n("drXJ"),x=n("dEAy"),L=n("dQG0"),R=n("1Z1e"),N=n("F6ss"),B=n("rMZv"),_=n("m743"),V=n("OzZK"),H=n("OtHt"),$=n("FwiY"),j=n("nJia"),G=n("h76Y");function W(e,t){if(1&e&&c.mc(0,"ui-option",20),2&e){const e=t.$implicit,n=c.Dc(3);c.Mc("nzLabel",null==e?null:e.accountTypeDisplay)("nzValue",null==e?null:e.refno)("nzDisabled","buy"==n.module&&"Y"==(null==e?null:e.buyDisabled)&&!("expired"===(null==e||null==e.passportExpiryStatus?null:e.passportExpiryStatus.toLowerCase()))||"sell"==n.module&&"Y"==(null==e?null:e.sellDisabled)||"switch"==n.module&&"Y"==(null==e?null:e.sellDisabled))}}function Y(e,t){if(1&e&&(c.rc(0,"nz-row",23),c.rc(1,"nz-col",24),c.rc(2,"h5"),c.qd(3,"CMF 2"),c.qc(),c.qc(),c.rc(4,"nz-col",25),c.rc(5,"div",26),c.rc(6,"h5",27),c.qd(7),c.Ec(8,"currencyFormat"),c.qc(),c.qc(),c.qc(),c.qc()),2&e){const e=c.Dc(4);c.Ub(7),c.sd(" ",c.Gc(8,1,e.cashFundBalance,e.transactionConstant.PAYMENT_CURRENCY_MYR)," ")}}function K(e,t){1&e&&c.mc(0,"nz-row")}function X(e,t){if(1&e&&(c.rc(0,"nz-row"),c.od(1,K,1,0,"nz-row",28),c.qc()),2&e){const e=c.Dc(4),t=c.ad(17),n=c.ad(19);c.Ub(1),c.Mc("ngIf",e.isStockPage)("ngIfThen",t)("ngIfElse",n)}}const Q=function(e){return{"bg-white pt-2 px-2 pb-1 mb-2 border":e}};function Z(e,t){if(1&e&&(c.rc(0,"div",21),c.od(1,Y,9,4,"nz-row",22),c.od(2,X,2,3,"nz-row",3),c.qc()),2&e){const e=c.Dc(3);c.Mc("ngClass",c.Sc(3,Q,e.cashFundBalance||(null==e.consolidatedTrustAccount?null:e.consolidatedTrustAccount.consolidatedAvailableBalance)||e.isStockPage)),c.Ub(1),c.Mc("ngIf",e.cashFundBalance&&!e.isStockPage),c.Ub(1),c.Mc("ngIf",(null==e.consolidatedTrustAccount?null:e.consolidatedTrustAccount.consolidatedAvailableBalance)||e.isStockPage)}}function J(e,t){if(1&e){const e=c.sc();c.rc(0,"div"),c.rc(1,"ui-select",17),c.zc("ngModelChange",(function(t){return c.dd(e),c.Dc(2).selectedAcctRefno=t}))("ngModelChange",(function(){return c.dd(e),c.Dc(2).switchInvestmentAcct()})),c.od(2,W,1,3,"ui-option",18),c.qc(),c.od(3,Z,3,5,"div",19),c.qc()}if(2&e){const e=c.Dc(2),t=c.ad(15);c.Ub(1),c.Mc("ngModel",e.selectedAcctRefno)("nzDisabled",e.authenticatedDisplay.length<2||e.isStockPage||e.isUpdate||e.isRspEtf)("nzDropdownMatchSelectWidth",!1)("nzPlaceHolder","Investment Account")("nzCustomTemplate",t),c.Ub(1),c.Mc("ngForOf",e.authenticatedDisplay),c.Ub(1),c.Mc("ngIf",!e.inFillDetail&&!e.hidePP)}}function ee(e,t){if(1&e&&c.od(0,J,4,7,"div",16),2&e){const e=c.Dc(),t=c.ad(13);c.Mc("ngIf",!e.isLoading)("ngIfElse",t)}}function te(e,t){1&e&&c.mc(0,"nz-divider",39)}function ne(e,t){if(1&e&&(c.pc(0),c.rc(1,"nz-row"),c.rc(2,"nz-col",30),c.rc(3,"span"),c.qd(4),c.qc(),c.qc(),c.qc(),c.rc(5,"nz-row",31),c.rc(6,"nz-col",32),c.rc(7,"span"),c.qd(8,"Purchasing Power"),c.qc(),c.qc(),c.rc(9,"nz-col",33),c.rc(10,"div",34),c.qd(11),c.Ec(12,"number"),c.qc(),c.qc(),c.qc(),c.rc(13,"nz-row",31),c.rc(14,"nz-col",32),c.rc(15,"span"),c.qd(16,"= Cash Account Balance"),c.qc(),c.qc(),c.rc(17,"nz-col",33),c.rc(18,"div",35),c.qd(19),c.Ec(20,"number"),c.qc(),c.qc(),c.qc(),c.rc(21,"nz-row",31),c.rc(22,"nz-col",32),c.rc(23,"span"),c.qd(24,"+ Unsettled Trade(s)"),c.qc(),c.qc(),c.rc(25,"nz-col",33),c.rc(26,"div",36),c.qd(27),c.Ec(28,"number"),c.qc(),c.qc(),c.rc(29,"nz-col",37),c.od(30,te,1,0,"nz-divider",38),c.qc(),c.qc(),c.oc()),2&e){const e=t.$implicit,n=t.index,i=c.Dc(2);c.Ub(4),c.rd(e.currency),c.Ub(7),c.td(" ",e.currency," ",c.Gc(12,8,null==e?null:e.purchasingPower,"1.2-2")," "),c.Ub(8),c.td(" ",e.currency," ",c.Gc(20,11,null==e?null:e.twAvailableBalance,"1.2-2")," "),c.Ub(8),c.td(" ",e.currency," ",c.Gc(28,14,null==e?null:e.twTotalUnsettledSell,"1.2-2")," "),c.Ub(3),c.Mc("ngIf",n+1!=i.cashBalanceModels.length)}}const ie=function(e){return{"stock-tooltip":e}};function ce(e,t){if(1&e&&(c.rc(0,"div",21),c.Ec(1,"async"),c.od(2,ne,31,17,"ng-container",29),c.qc()),2&e){const e=c.Dc();c.Mc("ngClass",c.Sc(4,ie,!c.Fc(1,2,e.isMobile$))),c.Ub(2),c.Mc("ngForOf",e.cashBalanceModels)}}function oe(e,t){if(1&e&&(c.rc(0,"div"),c.rc(1,"span"),c.qd(2),c.Ec(3,"number"),c.qc(),c.qc()),2&e){const e=t.$implicit;c.Ub(2),c.td("",null==e?null:e.code," 1 = MYR ",c.Gc(3,2,null==e?null:e.system,"1.6-6"),"")}}function se(e,t){if(1&e&&(c.rc(0,"div",31),c.qd(1," Consolidated Cash Account balance in MYR equivalent, based on latest indicative FX rates. "),c.od(2,oe,4,5,"div",29),c.qc()),2&e){const e=c.Dc();c.Ub(2),c.Mc("ngForOf",e.systemRateList)}}function ae(e,t){1&e&&c.nc(0)}function le(e,t){1&e&&c.nc(0)}const re=function(){return{padding:"30px"}};function de(e,t){if(1&e){const e=c.sc();c.rc(0,"app-web-scaffold"),c.od(1,ae,1,0,"ng-container",40),c.rc(2,"nz-modal",41),c.zc("nzOnCancel",(function(){return c.dd(e),c.Dc().onCloseCashSummary()})),c.od(3,le,1,0,"ng-container",40),c.qc(),c.rc(4,"nz-modal",42),c.zc("nzOnCancel",(function(){return c.dd(e),c.Dc().onClosePPSummary()})),c.pc(5),c.rc(6,"purchasing-power-modal",43),c.zc("changeCurrency",(function(t){return c.dd(e),c.Dc().getUnsettledTrades(t)})),c.qc(),c.oc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(),t=c.ad(1),n=c.ad(11);c.Ub(1),c.Mc("ngTemplateOutlet",t),c.Ub(1),c.Mc("nzFooter",null)("nzClosable",!0)("nzVisible",e.showCashSummary)("nzBodyStyle",c.Rc(14,re)),c.Ub(1),c.Mc("ngTemplateOutlet",n),c.Ub(1),c.Mc("nzFooter",null)("nzClosable",!0)("nzVisible",e.showPPSummary)("nzBodyStyle",c.Rc(15,re)),c.Ub(2),c.Mc("currencyList",e.currencyList)("unsettledTradeModel",e.stockUnsettledTrade)("selectedCurrency",e.selectedCurrency)("loading",e.unsettledTradeL
5oading)}}function ue(e,t){1&e&&c.nc(0)}function he(e,t){1&e&&c.nc(0)}const pe=function(e){return{"pt-3 pb-2 w-100 bg-white px-2":e}},me=function(){return{"padding-top":"15px","padding-bottom":"35px","overflow-y":"auto"}};function fe(e,t){if(1&e){const e=c.sc();c.rc(0,"app-mobile-scaffold"),c.rc(1,"div",21),c.od(2,ue,1,0,"ng-container",40),c.rc(3,"nz-drawer",44),c.zc("nzOnClose",(function(){return c.dd(e),c.Dc().onCloseCashSummary()})),c.od(4,he,1,0,"ng-container",40),c.qc(),c.qc(),c.rc(5,"nz-drawer",45),c.zc("nzOnClose",(function(){return c.dd(e),c.Dc().onClosePPSummary()})),c.pc(6),c.rc(7,"purchasing-power-modal",43),c.zc("changeCurrency",(function(t){return c.dd(e),c.Dc().getUnsettledTrades(t)})),c.qc(),c.oc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(),t=c.ad(1),n=c.ad(11);c.Ub(1),c.Mc("ngClass",c.Sc(14,pe,!e.inFillDetail)),c.Ub(1),c.Mc("ngTemplateOutlet",t),c.Ub(1),c.Mc("nzVisible",e.showCashSummary)("nzPlacement","bottom")("nzHeight",450),c.Ub(1),c.Mc("ngTemplateOutlet",n),c.Ub(1),c.Mc("nzVisible",e.showPPSummary)("nzPlacement","bottom")("nzHeight","80%")("nzBodyStyle",c.Rc(16,me)),c.Ub(2),c.Mc("currencyList",e.currencyList)("unsettledTradeModel",e.stockUnsettledTrade)("selectedCurrency",e.selectedCurrency)("loading",e.unsettledTradeLoading)}}const ge=function(e){return{h6:e}};function be(e,t){if(1&e&&(c.rc(0,"th",54),c.Ec(1,"async"),c.qd(2),c.qc()),2&e){const e=t.$implicit,n=c.Dc(2);c.Mc("nzSortKey",e.field)("ngClass",c.Sc(5,ge,c.Fc(1,3,n.isMobile$))),c.Ub(2),c.sd(" ",e.title," ")}}function Se(e,t){if(1&e&&(c.rc(0,"tr"),c.rc(1,"td",55),c.Ec(2,"async"),c.mc(3,"b2c-country-flag",56),c.qd(4),c.qc(),c.rc(5,"td",57),c.Ec(6,"async"),c.qd(7),c.Ec(8,"currencyFormat"),c.qc(),c.qc()),2&e){const e=t.$implicit,n=c.Dc(2);c.Ub(1),c.Mc("ngClass",c.Sc(14,ge,c.Fc(2,7,n.isMobile$))),c.Ub(2),c.Mc("country",null==e?null:e.country)("isLink",!1)("showName",!1),c.Ub(1),c.sd(" ",e.currency," "),c.Ub(1),c.Mc("ngClass",c.Sc(16,ge,c.Fc(6,9,n.isMobile$))),c.Ub(2),c.rd(c.Gc(8,11,null==e?null:e.availableBalance,null==e?null:e.currency))}}function ye(e,t){if(1&e){const e=c.sc();c.rc(0,"div",26),c.rc(1,"button",58),c.zc("click",(function(){return c.dd(e),c.Dc(2).onCloseCashSummary()})),c.qd(2,"Done"),c.qc(),c.qc()}}const ve=function(e){return{base:e}};function Me(e,t){if(1&e){const e=c.sc();c.rc(0,"div",46),c.rc(1,"h3",47),c.Ec(2,"async"),c.qd(3,"Cash Account Summary"),c.qc(),c.rc(4,"nz-table",48,49),c.rc(6,"thead",50),c.zc("nzSortChange",(function(t){c.dd(e);const n=c.ad(5);return c.Dc().sort(t,n)})),c.rc(7,"tr"),c.od(8,be,3,7,"th",51),c.qc(),c.qc(),c.rc(9,"tbody"),c.od(10,Se,9,18,"tr",29),c.qc(),c.qc(),c.rc(11,"h6",52),c.qd(12," *Available Balance"),c.mc(13,"br"),c.qd(14," The available balance is amount of money that is available for you to utilise from your Cash Account.\n"),c.qc(),c.od(15,ye,3,0,"div",53),c.Ec(16,"async"),c.qc()}if(2&e){const e=c.ad(5),t=c.Dc();c.Ub(1),c.Mc("ngClass",c.Sc(10,ve,c.Fc(2,6,t.isMobile$))),c.Ub(3),c.Mc("nzData",t.activeTrustAccountList)("nzShowPagination",!1),c.Ub(4),c.Mc("ngForOf",t.listOfColumn),c.Ub(2),c.Mc("ngForOf",e.data),c.Ub(5),c.Mc("ngIf",!c.Fc(16,8,t.isMobile$))}}function Ce(e,t){if(1&e&&c.mc(0,"nz-skeleton",59),2&e){const e=c.Dc();c.Mc("nzActive",!0)("nzLoading",e.isLoading)}}function qe(e,t){if(1&e&&(c.rc(0,"strong",60),c.qd(1),c.qc()),2&e){const e=t.$implicit;c.Ub(1),c.rd(null==e?null:e.nzLabel)}}function Te(e,t){if(1&e){const e=c.sc();c.rc(0,"i",78),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleOtherPpDisplay(!0)})),c.qc()}}function we(e,t){if(1&e){const e=c.sc();c.rc(0,"i",79),c.zc("click",(function(){return c.dd(e),c.Dc(2).handleOtherPpDisplay(!1)})),c.qc()}}function ze(e,t){if(1&e&&(c.rc(0,"h5",27),c.qd(1),c.Ec(2,"number"),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.td(" ",e.currency," ",c.Gc(2,2,null==e?null:e.amount,"1.2-2")," ")}}function De(e,t){if(1&e&&(c.pc(0),c.od(1,ze,3,5,"h5",82),c.oc()),2&e){const e=t.$implicit,n=c.Dc().$implicit;c.Ub(1),c.Mc("ngIf",n.autosweepCurrency===e.currency)}}function Pe(e,t){if(1&e&&(c.pc(0),c.od(1,De,2,1,"ng-container",29),c.oc()),2&e){const e=t.$implicit;c.Ub(1),c.Mc("ngForOf",e.autosweepPp)}}function Ie(e,t){if(1&e&&(c.rc(0,"div",26),c.od(1,Pe,2,1,"ng-container",29),c.qc()),2&e){const e=c.Dc(3);c.Ub(1),c.Mc("ngForOf",e.autoSweepCreditBalanceModels)}}function ke(e,t){if(1&e&&(c.rc(0,"h5",27),c.qd(1),c.Ec(2,"number"),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.td(" ",e.currency," ",c.Gc(2,2,null==e?null:e.amount,"1.2-2")," ")}}function Ae(e,t){if(1&e&&(c.pc(0),c.od(1,ke,3,5,"h5",82),c.oc()),2&e){const e=t.$implicit,n=c.Dc(),i=n.$implicit,o=n.first;c.Ub(1),c.Mc("ngIf",i.autosweepCurrency===e.currency&&o)}}function Ee(e,t){if(1&e&&(c.pc(0),c.od(1,Ae,2,1,"ng-container",29),c.oc()),2&e){const e=t.$implicit;c.Ub(1),c.Mc("ngForOf",e.autosweepPp)}}function Fe(e,t){if(1&e&&(c.rc(0,"div",26),c.od(1,Ee,2,1,"ng-container",29),c.qc()),2&e){const e=c.Dc(3);c.Ub(1),c.Mc("ngForOf",e.autoSweepCreditBalanceModels)}}function Oe(e,t){if(1&e&&(c.rc(0,"nz-row",80),c.rc(1,"nz-col",67),c.rc(2,"h5",81),c.qd(3," Auto-Sweep "),c.qc(),c.qc(),c.rc(4,"nz-col",67),c.od(5,Ie,2,1,"div",53),c.od(6,Fe,2,1,"div",53),c.qc(),c.qc()),2&e){const e=c.Dc(2);c.Ub(5),c.Mc("ngIf",e.isOtherPpDisplay),c.Ub(1),c.Mc("ngIf",!e.isOtherPpDisplay)}}function Ue(e,t){if(1&e&&(c.pc(0),c.rc(1,"h5",83),c.qd(2),c.Ec(3,"number"),c.qc(),c.oc()),2&e){const e=t.$implicit;c.Ub(2),c.td(" ",e.currency," ",c.Gc(3,2,null==e?null:e.purchasingPower,"1.2-2")," ")}}function xe(e,t){if(1&e&&(c.rc(0,"div",26),c.od(1,Ue,4,5,"ng-container",29),c.qc()),2&e){const e=c.Dc(2);c.Ub(1),c.Mc("ngForOf",e.cashBalanceModels)}}function Le(e,t){if(1&e&&(c.rc(0,"h5",83),c.qd(1),c.Ec(2,"number"),c.qc()),2&e){const e=c.Dc().$implicit;c.Ub(1),c.td(" ",e.currency," ",c.Gc(2,2,null==e?null:e.purchasingPower,"1.2-2")," ")}}function Re(e,t){if(1&e&&(c.pc(0),c.od(1,Le,3,5,"h5",84),c.oc()),2&e){const e=t.$implicit,n=c.Dc(3);c.Ub(1),c.Mc("ngIf",(null==e?null:e.currency)===n.stockShowCurrency)}}function Ne(e,t){if(1&e&&(c.rc(0,"div",26),c.od(1,Re,2,1,"ng-container",29),c.qc()),2&e){const e=c.Dc(2);c.Ub(1),c.Mc("ngForOf",e.cashBalanceModels)}}function Be(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-row"),c.rc(1,"nz-col",61),c.rc(2,"h4",62),c.qd(3," Purchasing Power "),c.qc(),c.qc(),c.rc(4,"nz-col",63),c.od(5,Te,1,0,"i",64),c.od(6,we,1,0,"i",65),c.qc(),c.qc(),c.od(7,Oe,7,2,"nz-row",66),c.rc(8,"nz-row"),c.rc(9,"nz-col",67),c.rc(10,"h5",68),c.qd(11," Cash Account "),c.qc(),c.qc(),c.rc(12,"nz-col",67),c.od(13,xe,2,1,"div",53),c.od(14,Ne,2,1,"div",53),c.qc(),c.qc(),c.rc(15,"nz-row",69),c.rc(16,"nz-col",70),c.rc(17,"button",71),c.zc("click",(function(){return c.dd(e),c.Dc().onCashSummary()})),c.Ec(18,"async"),c.qd(19," PP BREAKDOWN "),c.qc(),c.qc(),c.rc(20,"nz-col",72),c.rc(21,"button",73),c.zc("click",(function(){c.dd(e);const t=c.Dc();return t.redirectToTopUpCashAcct(t.selectedAcctRefno)})),c.Ec(22,"async"),c.mc(23,"i",74),c.qd(24," TOP UP "),c.qc(),c.qc(),c.rc(25,"nz-col",75),c.rc(26,"span",76),c.zc("click",(function(){return c.dd(e),c.Dc().checkCashBalance()})),c.Ec(27,"async"),c.mc(28,"i",77),c.qd(29," Refresh "),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Ub(5),c.Mc("ngIf",!e.isOtherPpDisplay),c.Ub(1),c.Mc("ngIf",e.isOtherPpDisplay),c.Ub(1),c.Mc("ngIf",(null==e.autoSweepCreditBalanceModels?null:e.autoSweepCreditBalanceModels.length)>0),c.Ub(6),c.Mc("ngIf",e.isOtherPpDisplay),c.Ub(1),c.Mc("ngIf",!e.isOtherPpDisplay),c.Ub(3),c.Mc("ngClass",c.Fc(18,8,e.isMobile$)?"mobile-button-font-scale":"web-button-font-scale"),c.Ub(4),c.Mc("ngClass",c.Fc(22,10,e.isMobile$)?"mobile-button-font-scale":"web-button-font-scale"),c.Ub(5),c.Mc("ngClass",c.Fc(27,12,e.isMobile$)?"mobile-button-font-scale":"web-button-font-scale")}}function _e(e,t){1&e&&c.nc(0)}function Ve(e,t){1&e&&c.nc(0)}const He=function(e,t){return{column1:e,column2:t}};function $e(e,t){if(1&e&&(c.pc(0),c.od(1,Ve,1,0,"ng-container",85),c.oc()),2&e){c.Dc(2);const e=c.ad(21),t=c.ad(27),n=c.ad(29);c.Ub(1),c.Mc("ngTemplateOutlet",e)("ngTemplateOutletContext",c.Tc(2,He,t,n))}}function je(e,t){1&e&&c.nc(0)}function Ge(e,t){if(1&e&&(c.od(0,_e,1,0,"ng-container",85),c.od(1,$e,2,5,"ng-container",3),c.Ec(2,"async"),c.od(3,je,1,0,"ng-container",85)),2&e){const e=c.Dc(),t=c.ad(21),n=c.ad(23),i=c.ad(25),o=c.ad(31),s=c.ad(33);c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Tc(7,He,n,i)),c.Ub(1),c.Mc("ngIf",e.isRspEtf&&c.Fc(2,5,e.showRspAs$)),c.Ub(2),c.Mc("ngTemplateOutlet",t)("ngTemplateOutletContext",c.Tc(10,He,o,s))}}function We(e,t){1&e&&c.nc(0)}function Ye(e,t){1&e&&c.nc(0)}function Ke(e,t){if(1&e&&(c.rc(0,"nz-row"),c.rc(1,"nz-col",70),c.od(2,We,1,0,"ng-container",40),c.qc(),c.rc(3,"nz-col",86),c.rc(4,"nz-row"),c.rc(5,"div",26),c.pc(6),c.od(7,Ye,1,0,"ng-container",40),c.oc(),c.qc(),c.qc(),c.qc(),c.qc()),2&e){const e=t.column1,n=t.column2;c.Ub(2),c.Mc("ngTemplateOutlet",e),c.Ub(5),c.Mc("ngTemplateOutlet",n)}}function Xe(e,t){if(1&e){const e=c.sc();c.rc(0,"h5",87),c.zc("click",(function(){return c.dd(e),c.Dc().onCashSummary()})),c.qd(1," Total Cash Account "),c.mc(2,"i",88),c.qc()}if(2&e){c.Dc();const e=c.ad(5);c.Ub(2),c.Mc("nzTooltipTitle",e)}}function Qe(e,t){if(1&e&&(c.rc(0,"h5",27),c.qd(1),c.Ec(2,"currencyFormat"),c.qc()),2&e){const e=c.Dc();c.Ub(1),c.sd(" ",c.Gc(2,1,null==e.consolidatedTrustAccount?null:e.consolidatedTrustAccount.consolidatedAvailableBalance,e.transactionConstant.PAYMENT_CURRENCY_MYR)," ")}}function Ze(e,t){1&e&&(c.rc(0,"h5"),c.qd(1," Total Auto-Sweep "),c.qc())}function Je(e,t){if(1&e&&(c.rc(0,"h5",27),c.qd(1),c.Ec(2,"currencyFormat"),c.qc()),2&e){const e=c.Dc();c.Ub(1),c.sd(" ",c.Gc(2,1,e.autoSweepBalanceInUsd,e.transactionConstant.PAYMENT_CURRENCY_USD)," ")}}function et(e,t){if(1&e){const e=c.sc();c.rc(0,"h5",89),c.zc("click",(function(){c.dd(e);const t=c.Dc();return t.redirectToTopUpCashAcct(t.selectedAcctRefno)})),c.qd(1," Top up Now "),c.qc()}}function tt(e,t){if(1&e){const e=c.sc();c.rc(0,"h5",90),c.qd(1,"Refresh "),c.rc(2,"i",91),c.zc("click",(function(){return c.dd(e),c.Dc().checkCashBalance()})),c.qc(),c.qc()}}let nt=(()=>{class e{constructor(e,t,n,i,o,s,a,l,r,d,u,h,p){this.accountService=e,this.stockTransactionRestService=t,this.subHandlingService=n,this.trustAccountRestService=i,this.securityRestService=o,this.store=s,this.router=a,this.activatedRoute=l,this.transactionService=r,this.transactionRestService=d,this.holdingRestService=u,this.stockHoldingRestService=h,this.utilityRestService=p,this.onlyPersonal=!1,this.isUpdate=!1,this.onSwitchInvestmentAcct=new c.s,this.selectedExchange=b.q.KLSE,this.isRspEtf=!1,this.showCashSummary=!1,this.isLoading=!1,this.listOfColumn=[{title:"Currency",field:"currency"},{title:"Available Balance",field:"availableBalance"}],this.KLSE="KLSE",this.transactionConstant=g.a,this.prsFundManagerList=[],this.stockShowCurrency=g.a.PAYMENT_CURRENCY_MYR,this.isOtherPpDisplay=!1,this.unsettledTradeL
5oading=!1,this.showPPSummary=!1,this.currencyList=[],this.selectedCurrency=g.a.PAYMENT_CURRENCY_MYR,this.autoSweepBalanceInUsd=0,this.systemRateList=[]}ngOnChanges(e){e.isStockPage&&this.selectedAcctRefno&&this.getStockCashAndAutoSweepBalance(this.selectedAcctRefno,this.selectedCurrency)}ngOnInit(){this.store.select(m.X).subscribe(e=>{e.refreshPurchasingPower&&setTimeout(()=>{this.checkCashBalance()},3e3)}),this.authenticatedDisplay=this.store.selectSnapshot(p.a.getAccounts),this.onlyPersonal&&(this.authenticatedDisplay=this.authenticatedDisplay.filter(e=>e.accountType===f.a.ACCOUNT_TYPE_PERSONAL)),this.subHandlingService.subscribe(this.refno$.pipe(Object(s.a)(e=>{if(e)return this.selectedAcctRefno=e,this.findActiveTrustAccount(this.selectedAcctRefno),this.getTrustAccountConsolidatedAndAutoSweepBalance(this.selectedAcctRefno),this.getCashFundBalance(this.selectedAcctRefno),this.findCurrentPrsHoldings(),void this.onSwitchInvestmentAcct.emit(this.selectedAcctRefno);this.selectedAcctRefno=this.store.selectSnapshot(p.a.getPrimaryAccount).refno}))),this.store.dispatch(new m.N(this.selectedAcctRefno)),this.module=window.location.href.split("/").slice(-1)[0],this.router.events.subscribe(e=>{this.module=window.location.href.split("/").slice(-1)[0]}),this.setSelectedAuthenticatedDisplay(this.selectedAcctRefno),this.getSystemCurrencyRates()}checkCashBalance(){this.selectedAcctRefno&&(this.isLoading=!0,this.isStockPage?this.get
5StockCashAndAutoSweepBalance(this.selectedAcctRefno,this.selectedCurrency):this.getTrustAccountConsolidatedAndAutoSweepBalance(this.selectedAcctRefno))}redirectToTopUpCashAcct(e){this.router.navigateByUrl(Object(y.c)({action:y.a.TOP_UP,refno:e}))}findActiveTrustAccount(e){this.isLoading=!0,this.subHandlingService.once(this.trustAccountRestService.findActiveTrustAccount(e).pipe(Object(s.a)(e=>{e&&(this.activeTrustAccountList=e,this.setTrustAccountCountryByCurrency())}),Object(a.a)(()=>{this.checkCashBalance()})))}setTrustAccountCountryByCurrency(){for(let e of Object.values(this.activeTrustAccountList))switch(e.currency){case"MYR":e.country="Malaysia";break;case"SGD":e.country="Singapore";break;case"USD":e.country="United State";break;case"AUD":e.country="Australia";break;case"GBP":e.country="GBP";break;case"CNY":e.country="China";break;case"EUR":e.country="Europe";break;case"HKD":e.country="Hong Kong";break;case"JPY":e.country="Japan"}}getTrustAccountConsolidatedAndAutoSweepBalance(e){Object(o.a)([this.stockTransactionRestService.readRspAutoSweepAb(e,"USD"),this.trustAccountRestService.getTrustAccountConsolidatedBalance(e)]).subscribe(([e,t])=>{this.isLoading=!1,b.a.RESPONSE_SUCCESS===(null==e?void 0:e.status)&&(null==e?void 0:e.data)&&(this.autoSweepBalanceInUsd=null==e?void 0:e.data),t&&(this.consolidatedTrustAccount=t)})}getStockCashAndAutoSweepBalance(e,t){this.stockShowCurrency=this.getStockShowCurrency(),Object(o.a)([this.stockHoldingRestService.getAllAutoSweepBalance(e),this.stockTransactionRestService.checkCashBalance(e,t)]).subscribe(([e,t])=>{if(this.store.dispatch(new m.O(!1)),e&&e.data&&t&&t.data){this.isLoading=!1,this.autoSweepCreditBalanceModels=S.a.getSortedASList(e.data,"autosweepCurrency");const n=this.autoSweepCreditBalanceModels.map(e=>e.autosweepCurrency+" "+b.q.AUTO_SWEEP);this.cashBalanceModels=t.data;let i=new Date;i.getHours()>6&&i.getHours()<17?this.cashBalanceModels.sort((e,t)=>b.q.ALL_CURRENCIES.indexOf(e.currency)-b.q.ALL_CURRENCIES.indexOf(t.currency)):this.cashBalanceModels.sort((e,t)=>b.q.USD_ALL_CURRENCIES.indexOf(e.currency)-b.q.USD_ALL_CURRENCIES.indexOf(t.currency));const c=this.cashBalanceModels.map(e=>e.currency);this.currencyList=n.concat(c).sort((e,t)=>b.q.ALL_CURRENCIES.indexOf(e)-b.q.ALL_CURRENCIES.indexOf(t)),this.selectedCurrency=this.currencyList[0]}})}getUnsettledTrades(e){if(e.includes(b.q.AUTO_SWEEP)){let t=e.split(" ");this.getStockAutoSweepUnsettledTrades(t[0])}else this.getStockUnsettledTrades(e)}getStockUnsettledTrades(e){this.selectedCurrency=e,this.unsettledTradeLoading=!0,this.stockTransactionRestService.getStockUnsettledTrades(this.selectedAcctRefno,e).subscribe(e=>{e.data&&(this.stockUnsettledTrade=e.data),this.unsettledTradeLoading=!1})}getStockAutoSweepUnsettledTrades(e){this.selectedCurrency=e+" Auto-Sweep",this.unsettledTradeLoading=!0,this.stockTransactionRestService.getStockAutoSweepUnsettledTrades(this.selectedAcctRefno,e).subscribe(e=>{e.data&&(this.stockUnsettledTrade=e.data),this.unsettledTradeLoading=!1})}onClosePPSummary(){this.showPPSummary=!1}getStockShowCurrency(){let e=new Date;return e.getHours()>6&&e.getHours()<17?g.a.PAYMENT_CURRENCY_MYR:g.a.PAYMENT_CURRENCY_USD}handleOtherPpDisplay(e){this.isOtherPpDisplay=e}getCashFundBalance(e){this.subHandlingService.once(this.holdingRestService.getCashFundBalanceByRefno(e).pipe(Object(s.a)(e=>{e&&(this.cashFundBalance=e.data)})))}onCashSummary(){if(this.isStockPage){if(this.showPPSummary=!0,this.selectedCurrency.includes(b.q.AUTO_SWEEP)){let e=this.selectedCurrency.split(" ");return void this.getStockAutoSweepUnsettledTrades(e[0])}this.getStockUnsettledTrades(this.selectedCurrency)}else this.showCashSummary=!0}onCloseCashSummary(){this.showCashSummary=!1}sort(e,t){t.data=Object(r.c)(e,t.data)}switchInvestmentAcct(){this.findActiveTrustAccount(this.selectedAcctRefno),this.getTrustAccountConsolidatedAndAutoSweepBalance(this.selectedAcctRefno),this.getCashFundBalance(this.selectedAcctRefno),this.findCurrentPrsHoldings(),this.onSwitchInvestmentAcct.emit(this.selectedAcctRefno),this.store.dispatch(new m.N(this.selectedAcctRefno)),this.setSelectedAuthenticatedDisplay(this.selectedAcctRefno)}findCurrentPrsHoldings(){this.subHandlingService.once(this.transactionRestService.getFundsBuyList(g.a.HOLDING,"",this.selectedAcctRefno).pipe(Object(l.a)(e=>
5{e.status===b.a.RESPONSE_SUCCESS&&(e.data.forEach(e=>{"PRS"!=e.fundType&&"PRS_GOV"!=e.fundType||this.prsFundManagerList.push(e.managercode)}),this.transactionService.updateBuyUtPrsFundManagerList({refno:this.selectedAcctRefno,holdingFundManagerList:this.prsFundManagerList}))})))}setSelectedAuthenticatedDisplay(e){for(let t of Object.values(this.authenticatedDisplay))t.refno===e&&this.store.dispatch(new m.M(t))}getSystemCurrencyRates(){const e=["USD","SGD","HKD","CNY","AUD","EUR","GBP"];this.subHandlingService.once(this.utilityRestService.getAllSystemRate().pipe(Object(s.a)(t=>{t.status===b.a.RESPONSE_SUCCESS&&e.forEach(e=>{var n;null===(n=t.data)||void 0===n||n.forEach(t=>{e===t.code&&this.systemRateList.push(t)})})})))}}return e.\u0275fac=function(t){return new(t||e)(c.lc(v.a),c.lc(M.a),c.lc(d.a),c.lc(C.a),c.lc(q.a),c.lc(u.i),c.lc(T.e),c.lc(T.a),c.lc(w.a),c.lc(z.a),c.lc(D.a),c.lc(P.a),c.lc(I.a))},e.\u0275cmp=c.fc({type:e,selectors:[["investment-account-selector"]],inputs:{inFillDetail:"inFillDetail",onlyPersonal:"onlyPersonal",isUpdate:"isUpdate",isStockPage:"isStockPage",selectedExchange:"selectedExchange",hidePP:"hidePP",isRspEtf:"isRspEtf"},outputs:{onSwitchInvestmentAcct:"onSwitchInvestmentAcct"},features:[c.Tb([d.a]),c.Sb],decls:34,vars:6,consts:[["investmentAccSelector",""],["tooltipsForStock",""],["tooltipsForNonStockStock",""],[4,"ngIf"],["cashAccountSummary",""],["loadingTemplate",""],["custom",""],["stockPage",""],["nonStockPage",""],["nonStockPageRowLayout",""],["nonStockPageR1C1",""],["nonStockPageR1C2",""],["nonStockPageR2C1",""],["nonStockPageR2C2",""],["nonStockPageR3C1",""],["nonStockPageR3C2",""],[4,"ngIf","ngIfElse"],["nzSize","default",1,"w-100","mb-2",3,"ngModel","nzDisabled","nzDropdownMatchSelectWidth","nzPlaceHolder","nzCustomTemplate","ngModelChange"],[3,"nzLabel","nzValue","nzDisabled",4,"ngFor","ngForOf"],[3,"ngClass",4,"ngIf"],[3,"nzLabel","nzValue","nzDisabled"],[3,"ngClass"],["class","bg-light-blue-info",4,"ngIf"],[1,"bg-light-blue-info"],["nzSpan","8"],["nzSpan","16"],[1,"text-right"],[1,"text-black-7","font-weight-bold"],[4,"ngIf","ngIfThen","ngIfElse"],[4,"ngFor","ngForOf"],["nzSpan","24",1,"text-sm","font-weight-bold"],[1,"text-sm"],["nzSpan","11"],["nzSpan","13"],[1,"ml-2","font-weight-bold"],[1,"ml-2","font-weight-lighter"],[1,"ml-2"],["nzSpan","23"],["class","my-2 bg-white",4,"ngIf"],[1,"my-2","bg-white"],[4,"ngTemplateOutlet"],["nzWrapClassName","vertical-center-modal","nzWidth","500",3,"nzFooter","nzClosable","nzVisible","nzBodyStyle","nzOnCancel"],["nzWrapClassName","vertical-center-modal","nzWidth","800",3,"nzFooter","nzClosable","nzVisible","nzBodyStyle","nzOnCancel"],[3,"currencyList","unsettledTradeModel","selectedCurrency","loading","changeCurrency"],[3,"nzVisible","nzPlacement","nzHeight","nzOnClose"],[3,"nzVisible","nzPlacement","nzHeight","nzBodyStyle","nzOnClose"],[1,"p-2"],[1,"mt-2",3,"ngClass"],[1,"w-100","mt-3",3,"nzData","nzShowPagination"],["CashSummaryTable",""],["nzSingleSort","",3,"nzSortChange"],["nzShowSort","","class","font-weight-bold h5",3,"nzSortKey","ngClass",4,"ngFor","ngForOf"],[1,"mt-3"],["class","text-right",4,"ngIf"],["nzShowSort","",1,"font-weight-bold","h5",3,"nzSortKey","ngClass"],[1,"h5","font-weight-bold",3,"ngClass"],[1,"d-inline-block",3,"country","isLink","showName"],[1,"h5",3,"ngClass"],["nz-button","","nzType","primary",1,"mt-4",3,"click"],[3,"nzActive","nzLoading"],[1,"text-black-7"],["nzSpan","22"],[1,"bold","text-14px"],["nzSpan","2"],["class","float-right pointer","nz-icon","","nzType","down","nzTheme","outline",3,"click",4,"ngIf"],["class","float-right pointer","nz-icon","","nzType","up","nzTheme","outline",3,"click",4,"ngIf"],["class","pb border-bottom",4,"ngIf"],["nzSpan","12"],[1,"w-100","mt-2","mb-2","text-12px","text-black-6"],["nzType","flex","nzAlign","middle",2,"margin-top","9px"],["nzSpan","10"],["nz-button","","nzBlock","","nzType","Primary",1,"px-1","mr-2",3,"ngClass","click"],["nzSpan","7"],["nz-button","","nzBlock","","nzType","Primary",1,"px-1","ml-2",3,"ngClass","click"],["nz-icon","","nzType","plus","nzTheme","outline",2,"font-size","13px"],["nzSpan","7",1,"text-right"],[1,"text-info","pointer","text-black-7","ml-auto",3,"ngClass","click"],["nz-icon","","nzType","reload",1,"pointer"],["nz-icon","","nzType","down","nzTheme","outline",1,"float-right","pointer",3,"click"],["nz-icon","","nzType","up","nzTheme","outline",1,"float-right","pointer",3,"click"],[1,"pb","border-bottom"],[1,"w-100","mb-2","text-12px","text-black-6"],["class","text-black-7 font-weight-bold",4,"ngIf"],[1,"text-black-7","font-weight-bold","mt-2"],["class","text-black-7 font-weight-bold mt-2",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["nzSpan","14"],[1,"text-info","pointer",3,"click"],["nz-icon","","nz-tooltip","","nzTheme","outline","nzTooltipPlacement","top","nzType","info-circle",1,"text-warning","pointer",3,"nzOverlayClassName","nzTooltipTitle"],[1,"text-info","pointer","text-black-7",3,"click"],[1,"text-info","pointer","text-black-7"],["nz-icon","","nzType","reload",1,"text-sm","pointer",3,"click"]],template:function(e,t){1&e&&(c.od(0,ee,1,2,"ng-template",null,0,c.pd),c.od(2,ce,3,6,"ng-template",null,1,c.pd),c.od(4,se,3,1,"ng-template",null,2,c.pd),c.od(6,de,7,
516,"app-web-scaffold",3),c.Ec(7,"async"),c.od(8,fe,8,17,"app-mobile-scaffold",3),c.Ec(9,"async"),c.od(10,Me,17,12,"ng-template",null,4,c.pd),c.od(12,Ce,1,2,"ng-template",null,5,c.pd),c.od(14,qe,2,1,"ng-template",null,6,c.pd),c.od(16,Be,30,14,"ng-template",null,7,c.pd),c.od(18,Ge,4,13,"ng-template",null,8,c.pd),c.od(20,Ke,8,2,"ng-template",null,9,c.pd),c.od(22,Xe,3,1,"ng-template",null,10,c.pd),c.od(24,Qe,3,4,"ng-template",null,11,c.pd),c.od(26,Ze,2,0,"ng-template",null,12,c.pd),c.od(28,Je,3,4,"ng-template",null,13,c.pd),c.od(30,et,2,0,"ng-template",null,14,c.pd),c.od(32,tt,3,0,"ng-template",null,15,c.pd)),2&e&&(c.Ub(6),c.Mc("ngIf",!c.Fc(7,2,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(9,4,t.isMobile$)))},directives:[k.t,A.d,E.t,E.w,k.s,A.a,k.q,F.c,F.a,O.a,U.a,k.A,x.a,L.a,R.a,N.a,B.a,B.f,B.g,B.c,B.e,B.d,_.a,V.a,H.a,$.b,j.e],pipes:[k.b,G.a,k.g],styles:[".stock-tooltip-wrapper.ant-tooltip{max-width:none} .stock-tooltip-wrapper.ant-tooltip .ant-tooltip-inner{width:400px;max-width:none;line-height:1.5em}.mobile-button-font-scale[_ngcontent-%COMP%]{font-size:3.5vw}.web-button-font-scale[_ngcontent-%COMP%]{font-size:.75vw}@media screen and (min-width:1901px){.web-button-font-scale[_ngcontent-%COMP%]{font-size:14px}}@media screen and (min-width:486px){.mobile-button-font-scale[_ngcontent-%COMP%]{font-size:14px}}.stock-tooltip[_ngcontent-%COMP%]{width:400px}"]}),Object(i.c)([Object(u.e)(h.a.isMobile)],e.prototype,"isMobile$",void 0),Object(i.c)([Object(u.e)(m.X.getSelectedRefno)],e.prototype,"refno$",void 0),Object(i.c)([Object(u.e)(p.a.getShowRspAs)],e.prototype,"showRspAs$",void 0),e})()},aCXV:function(e,t,n){"use strict";n.d(t,"b",(function(){return ae})),n.d(t,"d",(function(){return O})),n.d(t,"c",(function(){return le})),n.d(t,"a",(function(){return ie}));var i=n("LSvS"),c=n("dEu6"),o=n("XNiG"),s=n("quSY"),a=n("l5mm"),l=n("eNwd"),r=n("HDdC"),d=n("VRyK"),u=n("JX91"),h=n("1G5W"),p=n("lJxs"),m=n("IzEk"),f=n("vkgz"),g=n("eIep"),b=n("fXoL"),S=n("ofXK"),y=n("+J/9"),v=n("FWMu"); 6/** 7 * @license 8 * Copyright Google LLC All Rights Reserved. 9 * 10 * Use of this source code is governed by an MIT-style license that can be 11 * found in the LICENSE file at https://angular.io/license 12 */function M(e,t){for(let n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function C(e,t){const n=t?"":"none";M(e.style,{touchAction:t?"":"none",webkitUserDrag:t?"":"none",webkitTapHighlightColor:t?"":"transparent",userSelect:n,msUserSelect:n,webkitUserSelect:n,MozUserSelect:n})}function q(e){const t=e.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(e)*t}function T(e,t){return e.getPropertyValue(t).split(",").map(e=>e.trim())}const w=Object(i.g)({passive:!0}),z=Object(i.g)({passive:!1});class D{constructor(e,t,n,i,c,a){this._config=t,this._document=n,this._ngZone=i,this._viewportRuler=c,this._dragDropRegistry=a,this._passiveTransform={x:0,y:0},this._activeTransform={x:0,y:0},this._moveEvents=new o.a,this._pointerMoveSubscription=s.a.EMPTY,this._pointerUpSubscription=s.a.EMPTY,this._scrollSubscription=s.a.EMPTY,this._resizeSubscription=s.a.EMPTY,this._boundaryElement=null,this._nativeInteractionsEnabled=!0,this._handles=[],this._disabledHandles=new Set,this._direction="ltr",this.dragStartDelay=0,this._disabled=!1,this.beforeStarted=new o.a,this.started=new o.a,this.released=new o.a,this.ended=new o.a,this.entered=new o.a,this.exited=new o.a,this.dropped=new o.a,this.moved=this._moveEvents.asObservable(),this._pointerDown=e=>{if(this.beforeStarted.next(),this._handles.length){const t=this._handles.find(t=>{const n=e.target;return!!n&&(n===t||t.contains(n))});!t||this._disabledHandles.has(t)||this.disabled||this._initializeDragSequence(t,e)}else this.disabled||this._initializeDragSequence(this._rootElement,e)},this._pointerMove=e=>{if(!this._hasStartedDragging){const t=this._getPointerPositionOnPage(e);if(Math.abs(t.x-this._pickupPositionOnPage.x)+Math.abs(t.y-this._pickupPositionOnPage.y)>=this._config.dragStartThreshold){if(!(Date.now()>=this._dragStartTime+(this.dragStartDelay||0)))return void this._endDragSequence(e);this._dropContainer&&this._dropContainer.isDragging()||(this._hasStartedDragging=!0,this._ngZone.run(()=>this._startDragSequence(e)))}return}this._boundaryElement&&(this._previewRect&&(this._previewRect.width||this._previewRect.height)||(this._previewRect=(this._preview||this._rootElement).getBoundingClientRect()));const t=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,e.preventDefault(),this._updatePointerDirectionDelta(t),this._dropContainer)this._updateActiveDropContainer(t);else{const e=this._activeTransform;e.x=t.x-this._pickupPositionOnPage.x+this._passiveTransform.x,e.y=t.y-this._pickupPositionOnPage.y+this._passiveTransform.y,this._applyRootElementTransform(e.x,e.y),"undefined"!=typeof SVGElement&&this._rootElement instanceof SVGElement&&this._rootElement.setAttribute("transform",`translate(${e.x} ${e.y})`)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:t,event:e,distance:this._getDragDistance(t),delta:this._pointerDirectionDelta})})},this._pointerUp=e=>{this._endDragSequence(e)},this.withRootElement(e),a.registerDragItem(this)}get disabled(){return this._disabled||!(!this._dropContainer||!this._dropContainer.disabled)}set disabled(e){const t=Object(c.c)(e);t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions())}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}withHandles(e){return this._handles=e.map(e=>
12Object(c.e)(e)),this._handles.forEach(e=>C(e,!1)),this._toggleNativeDragInteractions(),this}withPreviewTemplate(e){return this._previewTemplate=e,this}withPlaceholderTemplate(e){return this._placeholderTemplate=e,this}withRootElement(e){const t=Object(c.e)(e);return t!==this._rootElement&&(this._rootElement&&this._removeRootElementListeners(this._rootElement),t.addEventListener("mousedown",this._pointerDown,z),t.addEventListener("touchstart",this._pointerDown,w),this._initialTransform=void 0,this._rootElement=t),this}withBoundaryElement(e){return this._boundaryElement=e?Object(c.e)(e):null,this._resizeSubscription.unsubscribe(),e&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}dispose(){this._removeRootElementListeners(this._rootElement),this.isDragging()&&A(this._rootElement),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeSubscriptions(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._boundaryElement=this._rootElement=this._placeholderTemplate=this._previewTemplate=this._nextSibling=null}isDragging(){return this._hasStartedDragging&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}disableHandle(e){this._handles.indexOf(e)>-1&&this._disabledHandles.add(e)}enableHandle(e){this._disabledHandles.delete(e)}withDirection(e){return this._direction=e,this}_withDropContainer(e){this._dropContainer=e}getFreeDragPosition(){const e=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:e.x,y:e.y}}setFreeDragPosition(e){return this._activeTransform={x:0,y:0},this._passiveTransform.x=e.x,this._passiveTransform.y=e.y,this._dropContainer||this._applyRootElementTransform(e.x,e.y),this}_sortFromLastPointerPosition(){const e=this._pointerPositionAtLastDirectionChange;e&&this._dropContainer&&this._updateActiveDropContainer(e)}_removeSubscriptions(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe()}_destroyPreview(){this._preview&&A(this._preview),this._previewRef&&this._previewRef.destroy(),this._preview=this._previewRef=null}_destroyPlaceholder(){this._placeholder&&A(this._placeholder),this._placeholderRef&&this._placeholderRef.destroy(),this._placeholder=this._placeholderRef=null}_endDragSequence(e){this._dragDropRegistry.isDragging(this)&&(this._removeSubscriptions(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),this._hasStartedDragging&&(this.released.next({source:this}),this._dropContainer?(this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(e),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)})):(this._passiveTransform.x=this._activeTransform.x,this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(this._getPointerPositionOnPage(e))})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this))))}_startDragSequence(e){if(this.started.next({source:this}),E(e)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions(),this._dropContainer){const e=this._rootElement;this._nextSibling=e.nextSibling;const n=this._preview=this._createPreviewElement(),i=this._placeholder=this._createPlaceholderElement();e.style.display="none",this._document.body.appendChild(e.parentNode.replaceChild(i,e)),(t=this._document,t.fullscreenElement||t.webkitFullscreenElement||t.mozFullScreenElement||t.msFullscreenElement||t.body).appendChild(n),this._dropContainer.start()}var t}_initializeDragSequence(e,t){t.stopPropagation();const n=this.isDragging(),i=E(t),c=!i&&0!==t.button,o=this._rootElement,s=!i&&this._lastTouchEventTime&&this._lastTouchEventTime+800>Date.now();if(t.target&&t.target.draggable&&"mousedown"===t.type&&t.preventDefault(),n||c||s)return;this._handles.length&&(this._rootElementTapHighlight=o.style.webkitTapHighlightColor,o.style.webkitTapHighlightColor="transparent"),this._hasStartedDragging=this._hasMoved=!1,this._initialContainer=this._dropContainer,this._removeSubscriptions(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scroll.pipe(Object(u.a)(null)).subscribe(()=>{this._scrollPosition=this._viewportRuler.getViewportScrollPosition()}),this._boundaryElement&&(this._boundaryRect=this._boundaryElement.getBoundingClientRect()),this._pickupPositionInElement=this._previewTemplate&&this._previewTemplate.template?{x:0,y:0}:this._getPointerPositionInElement(e,t);const a=this._pickupPositionOnPage=this._getPointerPositionOnPage(t);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:a.x,y:a.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,t)}_cleanupDragArtifacts(e){this._rootElement.style.display="",this._nextSibling?this._nextSibling.parentNode.insertBefore(this._rootElement,this._nextSibling):Object(c.e)(this._initialContainer.element).appendChild(this._rootElement),this._destroyPreview(),this._destroyPlaceholder(),this._boundaryRect=this._previewRect=void 0,this._ngZone.run(()=>{const t=this._dropContainer,n=t.getItemIndex(this),i=this._getPointerPositionOnPage(e),c=this._getDragDistance(this._getPointerPositionOnPage(e)),o=t._isOverContainer(i.x,i.y);this.ended.next({source:this,distance:c}),this.dropped.next({item:this,currentIndex:n,previousIndex:this._initialContainer.getItemIndex(this),container:t,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:c}),t.drop(this,n,this._initialContainer,o,c),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:e,y:t}){let n=this._initialContainer._getSiblingContainerFromPosition(this,e,t);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(e,t)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._dropContainer=n,this._dropContainer.enter(this,e,t),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this._dropContainer._startScrollingIfNecessary(e,t),this._dropContainer._sortItem(this,e,t,this._pointerDirectionDelta),this._preview.style.transform=P(e-this._pickupPositionInElement.x,t-this._pickupPositionInElement.y)}_createPreviewElement(){const e=this._previewTemplate,t=e?e.template:null;let n;if(t){const i=e.viewContainer.createEmbeddedView(t,e.context);n=F(i,this._document),this._previewRef=i,n.style.transform=P(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else{const e=this._rootElement,t=e.getBoundingClientRect();n=I(e),n.style.width=t.width+"px",n.style.height=t.height+"px",n.style.transform=P(t.left,t.top)}return M(n.style,{pointerEvents:"none",margin:"0",position:"fixed",top:"0",left:"0",zIndex:"1000"}),C(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("dir",this._direction),n}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();const e=this._placeholder.getBoundingClientRect();this._preview.classList.add("cdk-drag-animating"),this._preview.style.transform=P(e.left,e.top);const t=function(e){const t=getComputedStyle(e),n=T(t,"transition-property"),i=n.find(e=>"transform"===e||"all"===e);if(!i)return 0;const c=n.indexOf(i),o=T(t,"transition-duration"),s=T(t,"transition-delay");return q(o[c])+q(s[c])}(this._preview);return 0===t?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(e=>{const n=t=>{(!t||t.target===this._preview&&"transform"===t.propertyName)&&(this._preview.removeEventListener("transitionend",n),e(),clearTimeout(i))},i=setTimeout(n,1.5*t);this._preview.addEventListener("transitionend",n)}
12))}_createPlaceholderElement(){const e=this._placeholderTemplate,t=e?e.template:null;let n;return t?(this._placeholderRef=e.viewContainer.createEmbeddedView(t,e.context),n=F(this._placeholderRef,this._document)):n=I(this._rootElement),n.classList.add("cdk-drag-placeholder"),n}_getPointerPositionInElement(e,t){const n=this._rootElement.getBoundingClientRect(),i=e===this._rootElement?null:e,c=i?i.getBoundingClientRect():n,o=E(t)?t.targetTouches[0]:t;return{x:c.left-n.left+(o.pageX-c.left-this._scrollPosition.left),y:c.top-n.top+(o.pageY-c.top-this._scrollPosition.top)}}_getPointerPositionOnPage(e){const t=E(e)?e.touches[0]||e.changedTouches[0]:e;return{x:t.pageX-this._scrollPosition.left,y:t.pageY-this._scrollPosition.top}}_getConstrainedPointerPosition(e){const t=this._getPointerPositionOnPage(e),n=this.constrainPosition?this.constrainPosition(t,this):t,i=this._dropContainer?this._dropContainer.lockAxis:null;if("x"===this.lockAxis||"x"===i?n.y=this._pickupPositionOnPage.y:"y"!==this.lockAxis&&"y"!==i||(n.x=this._pickupPositionOnPage.x),this._boundaryRect){const{x:e,y:t}=this._pickupPositionInElement,i=this._boundaryRect,c=this._previewRect,o=i.top+t,s=i.bottom-(c.height-t);n.x=k(n.x,i.left+e,i.right-(c.width-e)),n.y=k(n.y,o,s)}return n}_updatePointerDirectionDelta(e){const{x:t,y:n}=e,i=this._pointerDirectionDelta,c=this._pointerPositionAtLastDirectionChange,o=Math.abs(t-c.x),s=Math.abs(n-c.y);return o>this._config.pointerDirectionChangeThreshold&&(i.x=t>c.x?1:-1,c.x=t),s>this._config.pointerDirectionChangeThreshold&&(i.y=n>c.y?1:-1,c.y=n),i}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;const e=this._handles.length>0||!this.isDragging();e!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=e,C(this._rootElement,e))}_removeRootElementListeners(e){e.removeEventListener("mousedown",this._pointerDown,z),e.removeEventListener("touchstart",this._pointerDown,w)}_applyRootElementTransform(e,t){const n=P(e,t);null==this._initialTransform&&(this._initialTransform=this._rootElement.style.transform||""),this._rootElement.style.transform=this._initialTransform?n+" "+this._initialTransform:n}_getDragDistance(e){const t=this._pickupPositionOnPage;return t?{x:e.x-t.x,y:e.y-t.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0}_containInsideBoundaryOnResize(){let{x:e,y:t}=this._passiveTransform;if(0===e&&0===t||this.isDragging()||!this._boundaryElement)return;const n=this._boundaryElement.getBoundingClientRect(),i=this._rootElement.getBoundingClientRect(),c=n.left-i.left,o=i.right-n.right,s=n.top-i.top,a=i.bottom-n.bottom;n.width>i.width?(c>0&&(e+=c),o>0&&(e-=o)):e=0,n.height>i.height?(s>0&&(t+=s),a>0&&(t-=a)):t=0,e===this._passiveTransform.x&&t===this._passiveTransform.y||this.setFreeDragPosition({y:t,x:e})}}function P(e,t){return`translate3d(${Math.round(e)}px, ${Math.round(t)}px, 0)`}function I(e){const t=e.cloneNode(!0),n=t.querySelectorAll("[id]"),i=e.querySelectorAll("canvas");t.removeAttribute("id");for(let c=0;c<n.length;c++)n[c].removeAttribute("id");if(i.length){const e=t.querySelectorAll("canvas");for(let t=0;t<i.length;t++){const n=e[t].getContext("2d");n&&n.drawImage(i[t],0,0)}}return t}function k(e,t,n){return Math.max(t,Math.min(n,e))}function A(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function E(e){return"t"===e.type[0]}function F(e,t){const n=e.rootNodes[0];if(n.nodeType!==t.ELEMENT_NODE){const e=t.createElement("div");return e.appendChild(n),e}return n}function O(e,t,n){const i=U(t,e.length-1),c=U(n,e.length-1);if(i===c)return;const o=e[i],s=c<i?-1:1;for(let a=i;a!==c;a+=s)e[a]=e[a+s];e[c]=o}function U(e,t){return Math.max(0,Math.min(t,e))}let x=0;class L{constructor(e,t,n,r,d){this._dragDropRegistry=t,this._ngZone=r,this._viewportRuler=d,this.id="cdk-drop-list-ref-"+x++,this.disabled=!1,this.sortingDisabled=!1,this.autoScrollDisabled=!1,this.enterPredicate=()=>!0,this.beforeStarted=new o.a,this.entered=new o.a,this.exited=new o.a,this.dropped=new o.a,this.sorted=new o.a,this._isDragging=!1,this._itemPositions=[],this._scrollPosition={top:0,left:0},this._viewportScrollPosition={top:0,left:0},this._previousSwap={drag:null,delta:0},this._siblings=[],this._orientation="vertical",this._activeSiblings=new Set,this._direction="ltr",this._viewportScrollSubscription=s.a.EMPTY,this._verticalScrollDirection=0,this._horizontalScrollDirection=0,this._stopScrollTimers=new o.a,this._handleScroll=()=>{if(!this.isDragging())return;const e=Object(c.e)(this.element);this._updateAfterScroll(this._scrollPosition,e.scrollTop,e.scrollLeft)},this._startScrollInterval=()=>{this._stopScrolling(),Object(a.a)(0,l.a).pipe(Object(h.a)(this._stopScrollTimers)).subscribe(()=>{const e=this._scrollNode;1===this._verticalScrollDirection?V(e,-2):2===this._verticalScrollDirection&&V(e,2),1===this._horizontalScrollDirection?H(e,-2):2===this._horizontalScrollDirection&&H(e,2)})};const u=this.element=Object(c.e)(e);this._shadowRoot=function(e){if(Object(i.d)()){const t=e.getRootNode?e.getRootNode():null;if(t instanceof ShadowRoot)return t}return null}(u)||n,t.registerDropContainer(this)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._removeListeners(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){const e=Object(c.e)(this.element);this.beforeStarted.next(),this._isDragging=!0,this._cacheItems(),this._siblings.forEac
12h(e=>e._startReceiving(this)),this._removeListeners(),this._ngZone?this._ngZone.runOutsideAngular(()=>e.addEventListener("scroll",this._handleScroll)):e.addEventListener("scroll",this._handleScroll),this._viewportRuler&&this._listenToScrollEvents()}enter(e,t,n){this.start();let i=this.sortingDisabled?this._draggables.indexOf(e):-1;-1===i&&(i=this._getItemIndexFromPointerPosition(e,t,n));const o=this._activeDraggables,s=o.indexOf(e),a=e.getPlaceholderElement();let l=o[i];if(l===e&&(l=o[i+1]),s>-1&&o.splice(s,1),l&&!this._dragDropRegistry.isDragging(l)){const t=l.getRootElement();t.parentElement.insertBefore(a,t),o.splice(i,0,e)}else Object(c.e)(this.element).appendChild(a),o.push(e);a.style.transform="",this._cacheItemPositions(),this.entered.next({item:e,container:this,currentIndex:this.getItemIndex(e)})}exit(e){this._reset(),this.exited.next({item:e,container:this})}drop(e,t,n,i,c={x:0,y:0}){this._reset(),this.dropped.next({item:e,currentIndex:t,previousIndex:n.getItemIndex(e),container:this,previousContainer:n,isPointerOverContainer:i,distance:c})}withItems(e){return this._draggables=e,e.forEach(e=>e._withDropContainer(this)),this.isDragging()&&this._cacheItems(),this}withDirection(e){return this._direction=e,this}connectedTo(e){return this._siblings=e.slice(),this}withOrientation(e){return this._orientation=e,this}getItemIndex(e){return this._isDragging?N("horizontal"===this._orientation&&"rtl"===this._direction?this._itemPositions.slice().reverse():this._itemPositions,t=>t.drag===e):this._draggables.indexOf(e)}isReceiving(){return this._activeSiblings.size>0}_sortItem(e,t,n,i){if(this.sortingDisabled||!this._isPointerNearDropContainer(t,n))return;const c=this._itemPositions,o=this._getItemIndexFromPointerPosition(e,t,n,i);if(-1===o&&c.length>0)return;const s="horizontal"===this._orientation,a=N(c,t=>t.drag===e),l=c[o],r=c[a].clientRect,d=l.clientRect,u=a>o?1:-1;this._previousSwap.drag=l.drag,this._previousSwap.delta=s?i.x:i.y;const h=this._getItemOffsetPx(r,d,u),p=this._getSiblingOffsetPx(a,c,u),m=c.slice();O(c,a,o),this.sorted.next({previousIndex:a,currentIndex:o,container:this,item:e}),c.forEach((t,n)=>{if(m[n]===t)return;const i=t.drag===e,c=i?h:p,o=i?e.getPlaceholderElement():t.drag.getRootElement();t.offset+=c,s?(o.style.transform=`translate3d(${Math.round(t.offset)}px, 0, 0)`,R(t.clientRect,0,c)):(o.style.transform=`translate3d(0, ${Math.round(t.offset)}px, 0)`,R(t.clientRect,c,0))})}_startScrollingIfNecessary(e,t){if(this.autoScrollDisabled)return;let n,i=0,o=0;if(this._isPointerNearDropContainer(e,t)){const s=Object(c.e)(this.element);[i,o]=function(e,t,n,i){const c=$(t,i),o=j(t,n);let s=0,a=0;if(c){const t=e.scrollTop;1===c?t>0&&(s=1):e.scrollHeight-t>e.clientHeight&&(s=2)}if(o){const t=e.scrollLeft;1===o?t>0&&(a=1):e.scrollWidth-t>e.clientWidth&&(a=2)}return[s,a]}(s,this._clientRect,e,t),(i||o)&&(n=s)}if(this._viewportRuler&&!i&&!o){const{width:c,height:s}=this._viewportRuler.getViewportSize(),a={width:c,height:s,top:0,right:c,bottom:s,left:0};i=$(a,t),o=j(a,e),n=window}!n||i===this._verticalScrollDirection&&o===this._horizontalScrollDirection&&n===this._scrollNode||(this._verticalScrollDirection=i,this._horizontalScrollDirection=o,this._scrollNode=n,(i||o)&&n?this._ngZone?this._ngZone.runOutsideAngular(this._startScrollInterval):this._startScrollInterval():this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_cacheOwnPosition(){const e=Object(c.e)(this.element);this._clientRect=_(e),this._scrollPosition={top:e.scrollTop,left:e.scrollLeft}}_cacheItemPositions(){const e="horizontal"===this._orientation;this._itemPositions=this._activeDraggables.map(e=>{const t=this._dragDropRegistry.isDragging(e)?e.getPlaceholderElement():e.getRootElement();return{drag:e,offset:0,clientRect:_(t)}}).sort((t,n)=>e?t.clientRect.left-n.clientRect.left:t.clientRect.top-n.clientRect.top)}_reset(){this._isDragging=!1,this._activeDraggables.forEach(e=>e.getRootElement().style.transform=""),this._siblings.forEach(e=>e._stopReceiving(this)),this._activeDraggables=[],this._itemPositions=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._stopScrolling(),this._removeListeners()}_getSiblingOffsetPx(e,t,n){const i="horizontal"===this._orientation,c=t[e].clientRect,o=t[e+-1*n];let s=c[i?"width":"height"]*n;if(o){const e=i?"left":"top",t=i?"right":"bottom";-1===n?s-=o.clientRect[e]-c[t]:s+=c[e]-o.clientRect[t]}return s}
12_isPointerNearDropContainer(e,t){const{top:n,right:i,bottom:c,left:o,width:s,height:a}=this._clientRect,l=.05*s,r=.05*a;return t>n-r&&t<c+r&&e>o-l&&e<i+l}_getItemOffsetPx(e,t,n){const i="horizontal"===this._orientation;let c=i?t.left-e.left:t.top-e.top;return-1===n&&(c+=i?t.width-e.width:t.height-e.height),c}_getItemIndexFromPointerPosition(e,t,n,i){const c="horizontal"===this._orientation;return N(this._itemPositions,({drag:o,clientRect:s},a,l)=>{if(o===e)return l.length<2;if(i){const e=c?i.x:i.y;if(o===this._previousSwap.drag&&e===this._previousSwap.delta)return!1}return c?t>=Math.floor(s.left)&&t<=Math.floor(s.right):n>=Math.floor(s.top)&&n<=Math.floor(s.bottom)})}_cacheItems(){this._activeDraggables=this._draggables.slice(),this._cacheItemPositions(),this._cacheOwnPosition()}_updateAfterScroll(e,t,n,i){const c=e.top-t,o=e.left-n;i&&R(i,c,o),this._itemPositions.forEach(({clientRect:e})=>{R(e,c,o)}),this._itemPositions.forEach(({drag:e})=>{this._dragDropRegistry.isDragging(e)&&e._sortFromLastPointerPosition()}),e.top=t,e.left=n}_removeListeners(){Object(c.e)(this.element).removeEventListener("scroll",this._handleScroll),this._viewportScrollSubscription.unsubscribe()}_isOverContainer(e,t){return B(this._clientRect,e,t)}_getSiblingContainerFromPosition(e,t,n){return this._siblings.find(i=>i._canReceive(e,t,n))}_canReceive(e,t,n){if(!this.enterPredicate(e,this)||!B(this._clientRect,t,n))return!1;const i=this._shadowRoot.elementFromPoint(t,n);if(!i)return!1;const o=Object(c.e)(this.element);return i===o||o.contains(i)}_startReceiving(e){const t=this._activeSiblings;t.has(e)||(t.add(e),this._cacheOwnPosition(),this._listenToScrollEvents())}_stopReceiving(e){this._activeSiblings.delete(e),this._viewportScrollSubscription.unsubscribe()}_listenToScrollEvents(){this._viewportScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._viewportScrollSubscription=this._dragDropRegistry.scroll.subscribe(()=>{if(this.isDragging()){const e=this._viewportRuler.getViewportScrollPosition();this._updateAfterScroll(this._viewportScrollPosition,e.top,e.left,this._clientRect)}else this.isReceiving()&&this._cacheOwnPosition()})}}function R(e,t,n){e.top+=t,e.bottom=e.top+e.height,e.left+=n,e.right=e.left+e.width}function N(e,t){for(let n=0;n<e.length;n++)if(t(e[n],n,e))return n;return-1}function B(e,t,n){const{top:i,bottom:c,left:o,right:s}=e;return n>=i&&n<=c&&t>=o&&t<=s}function _(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}function V(e,t){e===window?e.scrollBy(0,t):e.scrollTop+=t}function H(e,t){e===window?e.scrollBy(t,0):e.scrollLeft+=t}function $(e,t){const{top:n,bottom:i,height:c}=e,o=.05*c;return t>=n-o&&t<=n+o?1:t>=i-o&&t<=i+o?2:0}function j(e,t){const{left:n,right:i,width:c}=e,o=.05*c;return t>=n-o&&t<=n+o?1:t>=i-o&&t<=i+o?2:0}const G=Object(i.g)({passive:!1,capture:!0});let W=(()=>{class e{constructor(e,t){this._ngZone=e,this._dropInstances=new Set,this._dragInstances=new Set,this._activeDragInstances=new Set,this._globalListeners=new Map,this.pointerMove=new o.a,this.pointerUp=new o.a,this.scroll=new o.a,this._preventDefaultWhileDragging=e=>{this._activeDragInstances.size&&e.preventDefault()},this._document=t}registerDropContainer(e){if(!this._dropInstances.has(e)){if(this.getDropContainer(e.id))throw Error(`Drop instance with id "${e.id}" has already been registered.`);this._dropInstances.add(e)}}registerDragItem(e){this._dragInstances.add(e),1===this._dragInstances.size&&this._ngZone.runOutsideAngular(()=>{this._document.addEventListener("touchmove",this._preventDefaultWhileDragging,G)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),0===this._dragInstances.size&&this._document.removeEventListener("touchmove",this._preventDefaultWhileDragging,G)}startDragging(e,t){if(!this._activeDragInstances.has(e)&&(this._activeDragInstances.add(e),1===this._activeDragInstances.size)){const e=t.type.startsWith("touch"),n=e?"touchend":"mouseup";this._globalListeners.set(e?"touchmove":"mousemove",{handler:e=>this.pointerMove.next(e),options:G}).set(n,{handler:e=>this.pointerUp.next(e),options:!0}).set("scroll",{handler:e=>this.scroll.next(e),options:!0}).set("selectstart",{handler:this._preventDefaultWhileDragging,options:G}),this._ngZone.runOutsideAngular(()=>
12{this._globalListeners.forEach((e,t)=>{this._document.addEventListener(t,e.handler,e.options)})})}}stopDragging(e){this._activeDragInstances.delete(e),0===this._activeDragInstances.size&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances.has(e)}getDropContainer(e){return Array.from(this._dropInstances).find(t=>t.id===e)}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_clearGlobalListeners(){this._globalListeners.forEach((e,t)=>{this._document.removeEventListener(t,e.handler,e.options)}),this._globalListeners.clear()}}return e.\u0275fac=function(t){return new(t||e)(b.vc(b.J),b.vc(S.e))},e.\u0275prov=b.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e.ngInjectableDef=Object(b.hc)({factory:function(){return new e(Object(b.vc)(b.J),Object(b.vc)(S.e))},token:e,providedIn:"root"}),e})();const Y={dragStartThreshold:5,pointerDirectionChangeThreshold:5};let K=(()=>{class e{constructor(e,t,n,i){this._document=e,this._ngZone=t,this._viewportRuler=n,this._dragDropRegistry=i}createDrag(e,t=Y){return new D(e,t,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry)}createDropList(e){return new L(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}}return e.\u0275fac=function(t){return new(t||e)(b.vc(S.e),b.vc(b.J),b.vc(y.g),b.vc(W))},e.\u0275prov=b.hc({token:e,factory:e.\u0275fac,providedIn:"root"}),e.ngInjectableDef=Object(b.hc)({factory:function(){return new e(Object(b.vc)(S.e),Object(b.vc)(b.J),Object(b.vc)(y.g),Object(b.vc)(W))},token:e,providedIn:"root"}),e})();const X=new b.y("CDK_DROP_LIST"),Q=X,Z=new b.y("CDK_DRAG_PARENT");let J=(()=>{class e{constructor(e,t){this.element=e,this._stateChanges=new o.a,this._disabled=!1,this._parentDrag=t,C(e.nativeElement,!1)}get disabled(){return this._disabled}set disabled(e){this._disabled=Object(c.c)(e),this._stateChanges.next(this)}ngOnDestroy(){this._stateChanges.complete()}}return e.\u0275fac=function(t){return new(t||e)(b.lc(b.q),b.lc(Z,8))},e.\u0275dir=b.gc({type:e,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:["cdkDragHandleDisabled","disabled"]}}),e})(),ee=(()=>{class e{constructor(e){this.templateRef=e}}return e.\u0275fac=function(t){return new(t||e)(b.lc(b.Y))},e.\u0275dir=b.gc({type:e,selectors:[["ng-template","cdkDragPlaceholder",""]],inputs:{data:"data"}}),e})(),te=(()=>{class e{constructor(e){this.templateRef=e}}return e.\u0275fac=function(t){return new(t||e)(b.lc(b.Y))},e.\u0275dir=b.gc({type:e,selectors:[["ng-template","cdkDragPreview",""]],inputs:{data:"data"}}),e})();const ne=new b.y("CDK_DRAG_CONFIG",{providedIn:"root",factory:function(){return{dragStartThreshold:5,pointerDirectionChangeThreshold:5}}});let ie=(()=>{class e{constructor(e,t,n,i,c,s,a,l,d){this.element=e,this.dropContainer=t,this._document=n,this._ngZone=i,this._viewContainerRef=c,this._dir=a,this._changeDetectorRef=d,this._destroyed=new o.a,this.dragStartDelay=0,this._disabled=!1,this.started=new b.s,this.released=new b.s,this.ended=new b.s,this.entered=new b.s,this.exited=new b.s,this.dropped=new b.s,this.moved=new r.a(e=>{const t=this._dragRef.moved.pipe(Object(p.a)(e=>({source:this,pointerPosition:e.pointerPosition,event:e.event,delta:e.delta,distance:e.distance}))).subscribe(e);return()=>{t.unsubscribe()}}),this._dragRef=l.createDrag(e,s),this._dragRef.data=this,this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}get boundaryElementSelector(){return"string"==typeof this.boundaryElement?this.boundaryElement:void 0}set boundaryElementSelector(e){this.boundaryElement=e}get disabled(){return this._disabled||this.dropContainer&&this.dropContainer.disabled}set disabled(e){this._disabled=Object(c.c)(e),this._dragRef.disabled=this._disabled}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}ngAfterViewInit(){this._ngZone.onStable.asObservable().pipe(Object(m.a)(1),Object(h.a)(this._destroyed)).subscribe(()=>{this._updateRootElement(),this._handles.changes.pipe(Object(u.a)(this._handles),Object(f.a)(e=>{const t=e.filter(e=>e._parentDrag===this).map(e=>e.element);this._dragRef.withHandles(t)}),Object(g.a)(e=>Object(d.a)(...e.map(e=>e._stateChanges))),Object(h.a)(this._destroyed)).subscribe(e=>{const t=this._dragRef,n=e.element.nativeElement;e.disabled?t.disableHandle(n):t.enableHandle(n)}),this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)})}ngOnChanges(e){const t=e.rootElementSelector,n=e.freeDragPosition;t&&!t.firstChange&&this._updateRootElement(),n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()}_updateRootElement(){const e=this.element.nativeElement,t=this.rootElementSelector?ce(e,this.rootElementSelector):e;if(t&&t.nodeType!==this._document.ELEMENT_NODE)throw Error(`cdkDrag must be attached to an element node. Currently attached to "${t.nodeName}".`);this._dragRef.withRootElement(t||e)}_getBoundaryElement(){const e=this.boundaryElement;if(!e)return null;if("string"==typeof e)return ce(this.element.nativeElement,e);const t=Object(c.e)(e);
12if(Object(b.nb)()&&!t.contains(this.element.nativeElement))throw Error("Draggable element is not inside of the node passed into cdkDragBoundary.");return t}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){const t=this._dir,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,i=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.dragStartDelay=Object(c.f)(this.dragStartDelay),e.constrainPosition=this.constrainPosition,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(i),t&&e.withDirection(t.value)}})}_handleEvents(e){e.started.subscribe(()=>{this.started.emit({source:this}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(()=>{this.released.emit({source:this})}),e.ended.subscribe(e=>{this.ended.emit({source:this,distance:e.distance}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(e=>{this.entered.emit({container:e.container.data,item:this,currentIndex:e.currentIndex})}),e.exited.subscribe(e=>{this.exited.emit({container:e.container.data,item:this})}),e.dropped.subscribe(e=>{this.dropped.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,previousContainer:e.previousContainer.data,container:e.container.data,isPointerOverContainer:e.isPointerOverContainer,item:this,distance:e.distance})})}}return e.\u0275fac=function(t){return new(t||e)(b.lc(b.q),b.lc(X,12),b.lc(S.e),b.lc(b.J),b.lc(b.fb),b.lc(ne),b.lc(v.b,8),b.lc(K),b.lc(b.j))},e.\u0275dir=b.gc({type:e,selectors:[["","cdkDrag",""]],contentQueries:function(e,t,n){var i;1&e&&(b.dc(n,te,!0),b.dc(n,ee,!0),b.dc(n,J,!0)),2&e&&(b.Zc(i=b.Ac())&&(t._previewTemplate=i.first),b.Zc(i=b.Ac())&&(t._placeholderTemplate=i.first),b.Zc(i=b.Ac())&&(t._handles=i))},hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(e,t){2&e&&b.bc("cdk-drag-disabled",t.disabled)("cdk-drag-dragging",t._dragRef.isDragging())},inputs:{dragStartDelay:["cdkDragStartDelay","dragStartDelay"],boundaryElement:["cdkDragBoundary","boundaryElement"],disabled:["cdkDragDisabled","disabled"],data:["cdkDragData","data"],lockAxis:["cdkDragLockAxis","lockAxis"],rootElementSelector:["cdkDragRootElement","rootElementSelector"],freeDragPosition:["cdkDragFreeDragPosition","freeDragPosition"],constrainPosition:["cdkDragConstrainPosition","constrainPosition"]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[b.Tb([{provide:Z,useExisting:e}]),b.Sb]}),e})();function ce(e,t){let n=e.parentElement;for(;n;){if(n.matches?n.matches(t):n.msMatchesSelector(t))return n;n=n.parentElement}return null}let oe=(()=>{class e{constructor(){this._items=new Set,this._disabled=!1}get disabled(){return this._disabled}set disabled(e){this._disabled=Object(c.c)(e)}ngOnDestroy(){this._items.clear()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275dir=b.gc({type:e,selectors:[["","cdkDropListGroup",""]],inputs:{disabled:["cdkDropListGroupDisabled","disabled"]},exportAs:["cdkDropListGroup"]}),e})(),se=0,ae=(()=>{class e{constructor(t,n,i,c,s){this.element=t,this._changeDetectorRef=i,this._dir=c,this._group=s,this._destroyed=new o.a,this.connectedTo=[],this.orientation="vertical",this.id="cdk-drop-list-"+se++,this._disabled=!1,this._sortingDisabled=!1,this.enterPredicate=()=>!0,this.autoScrollDisabled=!1,this.dropped=new b.s,this.entered=new b.s,this.exited=new b.s,this.sorted=new b.s,this._dropListRef=n.createDropList(t),this._dropListRef.data=this,this._dropListRef.enterPredicate=(e,t)=>this.enterPredicate(e.data,t.data),this._syncInputs(this._dropListRef),this._handleEvents(this._dropListRef),e._dropLists.push(this),s&&s._items.add(this)}get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._disabled=Object(c.c)(e)}get sortingDisabled(){return this._sortingDisabled}set sortingDisabled(e){this._sortingDisabled=Object(c.c)(e)}ngAfterContentInit(){this._draggables.changes.pipe(Object(u.a)(this._draggables),Object(h.a)(this._destroyed)).subscribe(e=>{this._dropListRef.withItems(e.map(e=>e._dragRef))})}ngOnDestroy(){const t=e._dropLists.indexOf(this);t>-1&&e._dropLists.splice(t,1),this._group&&this._group._items.delete(this),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}start(){this._dropListRef.start()}drop(e,t,n,i){this._dropListRef.drop(e._dragRef,t,n._dropListRef,i)}
12enter(e,t,n){this._dropListRef.enter(e._dragRef,t,n)}exit(e){this._dropListRef.exit(e._dragRef)}getItemIndex(e){return this._dropListRef.getItemIndex(e._dragRef)}_sortItem(e,t,n,i){return this._dropListRef._sortItem(e._dragRef,t,n,i)}_getSiblingContainerFromPosition(e,t,n){const i=this._dropListRef._getSiblingContainerFromPosition(e._dragRef,t,n);return i?i.data:null}_isOverContainer(e,t){return this._dropListRef._isOverContainer(e,t)}_syncInputs(t){this._dir&&this._dir.change.pipe(Object(u.a)(this._dir.value),Object(h.a)(this._destroyed)).subscribe(e=>t.withDirection(e)),t.beforeStarted.subscribe(()=>{const n=Object(c.b)(this.connectedTo).map(t=>"string"==typeof t?e._dropLists.find(e=>e.id===t):t);this._group&&this._group._items.forEach(e=>{-1===n.indexOf(e)&&n.push(e)}),t.disabled=this.disabled,t.lockAxis=this.lockAxis,t.sortingDisabled=this.sortingDisabled,t.autoScrollDisabled=this.autoScrollDisabled,t.connectedTo(n.filter(e=>e&&e!==this).map(e=>e._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._changeDetectorRef.markForCheck()}),e.entered.subscribe(e=>{this.entered.emit({container:this,item:e.item.data,currentIndex:e.currentIndex})}),e.exited.subscribe(e=>{this.exited.emit({container:this,item:e.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(e=>{this.sorted.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,container:this,item:e.item.data})}),e.dropped.subscribe(e=>{this.dropped.emit({previousIndex:e.previousIndex,currentIndex:e.currentIndex,previousContainer:e.previousContainer.data,container:e.container.data,item:e.item.data,isPointerOverContainer:e.isPointerOverContainer,distance:e.distance}),this._changeDetectorRef.markForCheck()})}}return e.\u0275fac=function(t){return new(t||e)(b.lc(b.q),b.lc(K),b.lc(b.j),b.lc(v.b,8),b.lc(oe,12))},e.\u0275dir=b.gc({type:e,selectors:[["","cdkDropList",""],["cdk-drop-list"]],contentQueries:function(e,t,n){var i;1&e&&b.dc(n,ie,!1),2&e&&b.Zc(i=b.Ac())&&(t._draggables=i)},hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(e,t){2&e&&(b.uc("id",t.id),b.bc("cdk-drop-list-disabled",t.disabled)("cdk-drop-list-dragging",t._dropListRef.isDragging())("cdk-drop-list-receiving",t._dropListRef.isReceiving()))},inputs:{connectedTo:["cdkDropListConnectedTo","connectedTo"],orientation:["cdkDropListOrientation","orientation"],id:"id",enterPredicate:["cdkDropListEnterPredicate","enterPredicate"],autoScrollDisabled:["cdkDropListAutoScrollDisabled","autoScrollDisabled"],disabled:["cdkDropListDisabled","disabled"],sortingDisabled:["cdkDropListSortingDisabled","sortingDisabled"],data:["cdkDropListData","data"],lockAxis:["cdkDropListLockAxis","lockAxis"]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[b.Tb([{provide:oe,useValue:void 0},{provide:Q,useExisting:e}])]}),e._dropLists=[],e})(),le=(()=>{class e{}return e.\u0275mod=b.jc({type:e}),e.\u0275inj=b.ic({factory:function(t){return new(t||e)},providers:[K]}),e})()},dQG0:function(e,t,n){"use strict";n.d(t,"a",(function(){return H}));var i=n("mrSG"),c=n("fXoL"),o=n("gFZo"),s=n("AcyG"),a=n("6h7t"),l=n("ofXK"),r=n("drXJ"),d=n("oyxB"),u=n("FwiY"),h=n("m743"),p=n("rMZv"),m=n("OtHt"),f=n("1Z1e"),g=n("zAKX"),b=n("3Pt+"),S=n("qAZ0"),y=n("h76Y");function v(e,t){if(1&e&&(c.rc(0,"div",13),c.mc(1,"b2c-country-flag",14),c.qd(2),c.qc()),2&e){const e=c.Dc().$implicit,t=c.Dc(2);c.Ub(1),c.Mc("country",t.exchangeCountry[e.split(" ")[0]])("isLink",!1)("showName",!1),c.Ub(1),c.sd(" ",e," ")}}function M(e,t){if(1&e&&(c.rc(0,"span"),c.qd(1),c.Ec(2,"currencyFormat"),c.qc()),2&e){const e=c.Dc(5);c.Ub(1),c.rd(c.Gc(2,1,null==e.unsettledTradeModel?null:e.unsettledTradeModel.purchasingPower,null==e.unsettledTradeModel?null:e.unsettledTradeModel.selectedCurrency))}}function C(e,t){if(1&e&&(c.rc(0,"th"),c.od(1,M,3,4,"span",0),c.qc()),2&e){const e=t.index;c.Ub(1),c.Mc("ngIf",0==e)}}function q(e,t){if(1&e&&(c.rc(0,"span"),c.qd(1),c.Ec(2,"currencyFormat"),c.qc()),2&e){const e=c.Dc(5);c.Ub(1),c.rd(c.Gc(2,1,null==e.unsettledTradeModel?null:e.unsettledTradeModel.twAvailableBalance,null==e.unsettledTradeModel?null:e.unsettledTradeModel.selectedCurrency))}}function T(e,t){if(1&e&&(c.rc(0,"td"),c.od(1,q,3,4,"span",0),c.qc()),2&e){const e=t.index;c.Ub(1),c.Mc("ngIf",0==e)}}function w(e,t){if(1&e&&(c.rc(0,"a"),c.qd(1),c.Ec(2,"currencyFormat"),c.qc()),2&e){const e=c.Dc(5);c.Ub(1),c.rd(c.Gc(2,1,null==e.unsettledTradeModel?null:e.unsettledTradeModel.twTotalUnsettledSell,null==e.unsettledTradeModel?null:e.unsettledTradeModel.selectedCurrency))}}function z(e,t){if(1&e&&(c.rc(0,"td"),c.od(1,w,3,4,"a",0),c.qc()),2&e){const e=t.index;c.Ub(1),c.Mc("ngIf",0==e)}}function D(e,t){if(1&e&&(c.rc(0,"td"),c.qd(1),c.Ec(2,"date"),c.qc()),2&e){const e=t.$implicit;c.Ub(1),c.sd(" ",c.Gc(2,1,null==e?null:e.settlementDate,"dd MMM yyyy")," ")}}function P(e,t){if(1&e&&(c.rc(0,"td"),c.qd(1),c.Ec(2,"currencyFormat"),c.qc()),2&e){const e=t.$implicit,n=c.Dc(4);c.Ub(1),c.sd(" ",c.Gc(2,1,null==e?null:e.nettAmount,null==n.unsettledTradeModel?null:n.unsettledTradeModel.selectedCurrency)," ")}}const I=function(){return[""]},k=function(e){return{h6:e}};function A(e,t){if(1&e&&(c.rc(0,"nz-table",15),c.rc(1,"thead"),c.rc(2,"tr"),c.rc(3,"th"),c.qd(4,"Purchasing Power"),c.qc(),c.od(5,C,2,1,"th",16),c.qc(),c.qc(),c.rc(6,"tbody"),c.rc(7,"tr"),c.rc(8,"td",17),c.qd(9),c.qc(),c.od(10,T,2,1,"td",16),c.qc(),c.rc(11,"tr"),c.rc(12,"td",17),c.rc(13,"a"),c.qd(14," Unsettled Trades(s)"),c.qc(),c.qc(),c.od(15,z,2,1,"td",16),c.qc(),c.rc(16,"tr"),c.rc(17,"td",18),c.Ec(18,"async"),c.rc(19,"span"),c.qd(20,"\u2003Date"),c.qc(),c.qc(),c.od(21,D,3,4,"td",16),c.qc(),c.rc(22,"tr"),c.rc(23,"td",18),c.Ec(24,"async"),c.rc(25,"span"),c.qd(26,"\u2003Amount"),c.qc(),c.qc(),c.od(27,P,3,4,"td",16),c.qc(),c.qc(),c.qc()),2&e){const e=c.Dc(3);c.Mc("nzData",c.Rc(14,I))("nzShowPagination",!1),c.Ub(5),c.Mc("ngForOf",null==e.unsettledTradeModel?null:e.unsettledTradeModel.stockUnsettledTradeModels),c.Ub(4),c.rd(e.isAutoSweep?"= Auto-Sweep Balance ":"= Cash Account Balance "),c.Ub(1),c.Mc("ngForOf",null==e.unsettledTradeModel?null:e.unsettledTradeModel.stockUnsettledTradeModels),c.Ub(5),c.Mc("ngForOf",null==e.unsettledTradeModel?null:e.unsettledTradeModel.stockUnsettledTradeModels),c.Ub(2),c.Mc("ngClass",c.Sc(15,k,c.Fc(18,10,e.isMobile$))),c.Ub(4),c.Mc("ngForOf",null==e.unsettledTradeModel?null:e.unsettledTradeModel.stockUnsettledTradeModels),c.Ub(2),c.Mc("ngClass",c.Sc(17,k,c.Fc(24,12,e.isMobile$))),c.Ub(4),c.Mc("ngForOf",null==e.unsettledTradeModel?null:e.unsettledTradeModel.stockUnsettledTradeModels)}}function E(e,t){if(1&e){const e=c.sc();c.rc(0,"nz-tab",10),c.zc("nzSelect",(function(){c.dd(e);
12const n=t.$implicit;return c.Dc(2).changeCurrencyTab(n)})),c.od(1,v,3,4,"ng-template",null,11,c.pd),c.od(3,A,28,19,"nz-table",12),c.qc()}if(2&e){const e=c.ad(2);c.Dc();const t=c.ad(16),n=c.Dc();c.Mc("nzTitle",e),c.Ub(3),c.Mc("ngIf",!n.loading)("ngIfElse",t)}}function F(e,t){1&e&&(c.rc(0,"ol",19),c.rc(1,"li",20),c.rc(2,"span",17),c.qd(3,"Purchasing Power"),c.qc(),c.qd(4,": Amount available to purchase Stock & ETF"),c.qc(),c.rc(5,"li",20),c.rc(6,"span",17),c.qd(7,"Unsettled trade"),c.qc(),c.qd(8,": Sales Proceed from unsettled trade of Stock & ETF with respective exchanges"),c.qc(),c.rc(9,"li"),c.rc(10,"span",17),c.qd(11,"Cash Account Balance"),c.qc(),c.qd(12,": Amount available to purchase other products and withdrawal to a registered bank account with us"),c.qc(),c.qc())}const O=function(){return{rows:4}};function U(e,t){1&e&&c.mc(0,"nz-skeleton",21),2&e&&c.Mc("nzActive",!0)("nzParagraph",c.Rc(2,O))}const x=function(e){return{base:e}};function L(e,t){if(1&e){const e=c.sc();c.rc(0,"app-web-scaffold"),c.rc(1,"h3",2),c.Ec(2,"async"),c.qd(3,"Purchasing Power"),c.qc(),c.rc(4,"nz-tabset",3),c.zc("nzSelectedIndexChange",(function(t){return c.dd(e),c.Dc().currencyTab=t})),c.Ec(5,"async"),c.od(6,E,4,3,"nz-tab",4),c.qc(),c.rc(7,"h5",5),c.rc(8,"div",6),c.mc(9,"i",7),c.rc(10,"div"),c.rc(11,"b"),c.qd(12,"Notes"),c.qc(),c.mc(13,"br"),c.od(14,F,13,0,"ol",8),c.qc(),c.qc(),c.qc(),c.od(15,U,1,3,"ng-template",null,9,c.pd),c.qc()}if(2&e){const e=c.Dc(),t=c.ad(5);c.Ub(1),c.Mc("ngClass",c.Sc(11,x,c.Fc(2,7,e.isMobile$))),c.Ub(3),c.Mc("nzSelectedIndex",e.currencyTab)("nzTabBarGutter",0)("nzSize",c.Fc(5,9,e.isMobile$)?"small":"default"),c.Ub(2),c.Mc("ngForOf",e.currencyList),c.Ub(8),c.Mc("ngIf",!e.isAutoSweep)("ngIfElse",t)}}function R(e,t){if(1&e&&(c.rc(0,"nz-option",28),c.mc(1,"b2c-country-flag",14),c.qd(2),c.qc()),2&e){const e=t.$implicit,n=c.Dc(2);c.Mc("nzLabel",e)("nzValue",e),c.Ub(1),c.Mc("country",n.exchangeCountry[e.split(" ")[0]])("isLink",!1)("showName",!1),c.Ub(1),c.sd(" ",e," ")}}function N(e,t){if(1&e&&(c.rc(0,"tr"),c.rc(1,"td"),c.qd(2),c.Ec(3,"date"),c.qc(),c.rc(4,"td"),c.qd(5),c.Ec(6,"currencyFormat"),c.qc(),c.qc()),2&e){const e=t.$implicit,n=c.Dc(2);c.Ub(2),c.rd(c.Gc(3,2,null==e?null:e.settlementDate,"dd MMM yyyy")),c.Ub(3),c.rd(c.Gc(6,5,null==e?null:e.nettAmount,null==n.unsettledTradeModel?null:n.unsettledTradeModel.selectedCurrency))}}function B(e,t){1&e&&(c.rc(0,"ol",19),c.rc(1,"li",20),c.rc(2,"span",17),c.qd(3,"Purchasing Power"),c.qc(),c.qd(4,": Amount available to purchase Stock & ETF"),c.qc(),c.rc(5,"li",20),c.rc(6,"span",17),c.qd(7,"Unsettled trade"),c.qc(),c.qd(8,": Sales Proceed from unsettled trade of Stock & ETF with respective exchanges"),c.qc(),c.rc(9,"li"),c.rc(10,"span",17),c.qd(11,"Cash Account Balance"),c.qc(),c.qd(12,": Amount available to purchase other products and withdrawal to a registered bank account with us"),c.qc(),c.qc())}function _(e,t){if(1&e){const e=c.sc();c.rc(0,"app-mobile-scaffold"),c.rc(1,"div",22),c.rc(2,"h3",2),c.Ec(3,"async"),c.qd(4,"Purchasing Power"),c.qc(),c.rc(5,"nz-select",23),c.zc("ngModelChange",(function(t){return c.dd(e),c.Dc().selectedCurrency=t}))("ngModelChange",(function(t){return c.dd(e),c.Dc().changeCurrencyTab(t)})),c.od(6,R,3,6,"nz-option",24),c.qc(),c.rc(7,"nz-spin",25),c.rc(8,"nz-table",26),c.rc(9,"thead"),c.rc(10,"tr"),c.rc(11,"th"),c.qd(12,"Purchasing Power"),c.qc(),c.rc(13,"th"),c.qd(14),c.Ec(15,"currencyFormat"),c.qc(),c.qc(),c.qc(),c.rc(16,"tbody"),c.rc(17,"tr"),c.rc(18,"td",17),c.qd(19),c.qc(),c.rc(20,"td"),c.qd(21),c.Ec(22,"currencyFormat"),c.qc(),c.qc(),c.rc(23,"tr"),c.rc(24,"td"),c.rc(25,"a",17),c.qd(26,"+ Unsettled Trade(s)"),c.qc(),c.qc(),c.rc(27,"td"),c.rc(28,"a"),c.qd(29),c.Ec(30,"currencyFormat"),c.qc(),c.qc(),c.qc(),c.od(31,N,7,8,"tr",16),c.qc(),c.qc(),c.qc(),c.rc(32,"div",27),c.mc(33,"i",7),c.rc(34,"div"),c.rc(35,"b"),c.qd(36,"Notes"),c.qc(),c.mc(37,"br"),c.od(38,B,13,0,"ol",8),c.qc(),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc(),t=c.ad(5);c.Ub(2),c.Mc("ngClass",c.Sc(24,x,c.Fc(3,13,e.isMobile$))),c.Ub(3),c.Mc("ngModel",e.selectedCurrency),c.Ub(1),c.Mc("ngForOf",e.currencyList),c.Ub(1),c.Mc("nzSpinning",e.loading),c.Ub(1),c.Mc("nzData",c.Rc(26,I))("nzShowPagination",!1),c.Ub(6),c.rd(c.Gc(15,15,null==e.unsettledTradeModel?null:e.unsettledTradeModel.purchasingPower,null==e.unsettledTradeModel?null:e.unsettledTradeModel.selectedCurrency)),c.Ub(5),c.rd(e.isAutoSweep?"= Auto-Sweep Balance ":"= Cash Account Balance "),c.Ub(2),c.rd(c.Gc(22,18,null==e.unsettledTradeModel?null:e.unsettledTradeModel.twAvailableBalance,null==e.unsettledTradeModel?null:e.unsettledTradeModel.selectedCurrency)),c.Ub(8),c.rd(c.Gc(30,21,null==e.unsettledTradeModel?null:e.unsettledTradeModel.twTotalUnsettledSell,null==e.unsettledTradeModel?null:e.unsettledTradeModel.selectedCurrency)),c.Ub(2),c.Mc("ngForOf",null==e.unsettledTradeModel?null:e.unsettledTradeModel.stockUnsettledTradeModels),c.Ub(7),c.Mc("ngIf",!e.isAutoSweep)("ngIfElse",t)}}function V(e,t){if(1&e&&(c.rc(0,"ol",19),c.rc(1,"li",20),c.rc(2,"span",17),c.qd(3,"Available Balance"),c.qc(),c.qd(4,": Existing Balance + Incoming Deposits \u2013 Withdrawals \u2013 Monies earmarked for product investments"),c.qc(),c.rc(5,"li",20),c.rc(6,"span",17),c.qd(7,"Purchasing Power"),c.qc(),c.qd(8),c.qc(),c.rc(9,"li"),c.rc(10,"span",17),c.qd(11,"Unsettled Trade"),c.qc(),c.qd(12),c.qc(),c.qc()),2&e){const e=c.Dc();c.Ub(8),c.sd(": (99% x Available Balance) + Unsettled trades from ",e.autoSweepCurrency," Stocks/ETFs Sell"),c.Ub(4),c.sd(": Sales proceed from unsettled trades of ",e.autoSweepCurrency,"-denominated Stocks/ETFs")}}let H=(()=>{class e{constructor(){this.loading=!1,this.changeCurrency=new c.s,this.currencyTab=0,this.isAutoSweep=!1,this.autoSweepCurrency="USD",this.exchangeCountry={MYR:"Malaysia",HKD:"Hong Kong",CNH:"China",CNY:"China",AUD:"Australia",USD:"United State",SGD:"Singapore",GBP:"GBP",EUR:"Europe",JPY:"Japan"}}ngOnChanges(e){var t,n,i,c;this.currencyTab=null===(t=this.currencyList)||void 0===t?void 0:t.indexOf(this.selectedCurrency),e.selectedCurrency&&null!=e.selectedCurrency&&(this.isAutoSweep=this.selectedCurrency.includes(a.q.AUTO_SWEEP),this.currencyTab=null===(n=this.currencyList)||void 0===n?void 0:n.indexOf(e.selectedCurrency.currentValue),this.autoSweepCurrency=null===(c=null===(i=this.selectedCurrency)||void 0===i?void 0:i.split(" "))||void 0===c?void 0:c[0])}ngOnInit(){}changeCurrencyTab(e){this.changeCurrency.emit(e)}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.fc({type:e,selectors:[["purchasing-power-modal"]],inputs:{currencyList:"currencyList",unsettledTradeModel:"unsettledTradeModel",loading:"loading",selectedCurrency:"selectedCurrency"},outputs:{changeCurrency:"changeCurrency"},features:[c.Sb],decls:6,vars:6,consts:[[4,"ngIf"],["asNotesTemplate",""],[1,"mt-2",3,"ngClass"],[1,"tabs-remove-bottom",3,"nzSelectedIndex","nzTabBarGutter","nzSize","nzSelectedIndexChange"],[3,"nzTitle","nzSelect",4,"ngFor","ngForOf"],[1,"mt-3"],[1,"d-flex","mt-2"],["nz-icon","","nzType","info-circle",1,"text-base","text-warning","mr-2"],["class","pl-3",4,"ngIf","ngIfElse"],["loadingTemplate",""],[3,"nzTitle","nzSelect"],["titleTemplate",""],["class","w-100 mt-3",3,"nzData","nzShowPagination",4,"ngIf","ngIfElse"],[1,"px-1"],[1,"d-inline-block",3,"country","isLink","
12showName"],[1,"w-100","mt-3",3,"nzData","nzShowPagination"],[4,"ngFor","ngForOf"],[1,"font-weight-bold"],[1,"font-weight-bold",3,"ngClass"],[1,"pl-3"],[1,"mb-1"],[3,"nzActive","nzParagraph"],[1,"p-1"],["nzPlaceHolder","Select Currency","nzLabelPlaceholder","",1,"w-100","mb-4",3,"ngModel","ngModelChange"],["nzCustomContent","",3,"nzLabel","nzValue",4,"ngFor","ngForOf"],[3,"nzSpinning"],[1,"w-100",3,"nzData","nzShowPagination"],[1,"d-flex","mt-2","mb-4"],["nzCustomContent","",3,"nzLabel","nzValue"]],template:function(e,t){1&e&&(c.od(0,L,17,13,"app-web-scaffold",0),c.Ec(1,"async"),c.od(2,_,39,27,"app-mobile-scaffold",0),c.Ec(3,"async"),c.od(4,V,13,2,"ng-template",null,1,c.pd)),2&e&&(c.Mc("ngIf",!c.Fc(1,2,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(3,4,t.isMobile$)))},directives:[l.t,r.a,l.q,d.f,l.s,u.b,d.b,h.a,p.a,p.f,p.g,p.e,p.c,p.d,m.a,f.a,g.d,b.t,b.w,S.a,g.a],pipes:[l.b,y.a,l.f],encapsulation:2}),Object(i.c)([Object(s.e)(o.a.isMobile)],e.prototype,"isMobile$",void 0),e})()},oyiF:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var i=n("mrSG"),c=n("fXoL"),o=n("AcyG"),s=n("gFZo"),a=n("ofXK"),l=n("drXJ"),r=n("dEAy"),d=n("t7Fq");function u(e,t){if(1&e){const e=c.sc();c.rc(0,"app-web-scaffold"),c.rc(1,"nz-modal",2),c.zc("nzOnCancel",(function(){return c.dd(e),c.Dc().onClose()})),c.rc(2,"div",3),c.rc(3,"h3"),c.qd(4,"UNIT TRUST LOAN FINANCING RISK DISCLOSURE STATEMENT"),c.qc(),c.rc(5,"p"),c.rc(6,"span",4),c.qd(7," Investing in a unit trust scheme with borrowed money is more risky than investing with your own savings. "),c.qc(),c.mc(8,"br"),c.mc(9,"br"),c.qd(10," You should assess if loan financing is suitable for you in light of your objectives, attitude to risk and financial circumstances. You should be aware of the risks, which would include the following: "),c.qc(),c.rc(11,"ol",5),c.rc(12,"li"),c.qd(13,"\xa0The higher the margin of financing (that is, the amount of money you borrow for every Ringgit of your own money that you put in as deposit or down payment) the greater the potential for losses as well as gains. "),c.qc(),c.rc(14,"li",6),c.qd(15,"\xa0You should assess whether you have the ability to service the repayments on the proposed loan. If your loan is a variable rate loan, and if interest rates rise, your total repayment amount will be increased. "),c.qc(),c.rc(16,"li",6),c.qd(17,"\xa0If unit prices fall beyond a certain level, you may be asked to provide additional acceptable collateral or pay additional amounts on top of your normal instalments. If you fail to comply within the time prescribed, your units may be sold to settle your loan. "),c.qc(),c.rc(18,"li",6),c.qd(19,"\xa0Returns on unit trusts are not guaranteed and may not be earned evenly over time. This means that there may be some years where returns are high and other years where losses are experienced instead. Whether you eventually realise a gain or loss may be affected by the timing of the sale of your units. The value of units may fall just when you want your money back even though the investment may have done well in the past. "),c.qc(),c.qc(),c.mc(20,"br"),c.rc(21,"p"),
12c.qd(22,"This brief statement cannot disclose all the risk and other aspects of loan financing. You should therefore carefully study the terms and conditions before you decide to take the loan. If you are in doubt in respect of any aspect of this Risk Disclosure Statement or the terms of the loan financing, you should consult the institution offering the loan. "),c.qc(),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Ub(1),c.Mc("nzClosable",!0)("nzFooter",null)("nzTitle",null)("nzVisible",e.isModalVisible)}}function h(e,t){if(1&e){const e=c.sc();c.rc(0,"b2c-mobile-drawer",7),c.zc("showChange",(function(){return c.dd(e),c.Dc().onClose()}))("showChange",(function(t){return c.dd(e),c.Dc().isModalVisible=t})),c.rc(1,"div",3),c.rc(2,"h3"),c.qd(3,"UNIT TRUST LOAN FINANCING RISK DISCLOSURE STATEMENT"),c.qc(),c.rc(4,"p"),c.rc(5,"span",4),c.qd(6," Investing in a unit trust scheme with borrowed money is more risky than investing with your own savings. "),c.qc(),c.mc(7,"br"),c.mc(8,"br"),c.qd(9," You should assess if loan financing is suitable for you in light of your objectives, attitude to risk and financial circumstances. You should be aware of the risks, which would include the following: "),c.qc(),c.rc(10,"ol",5),c.rc(11,"li"),c.qd(12,"\xa0The higher the margin of financing (that is, the amount of money you borrow for every Ringgit of your own money that you put in as deposit or down payment) the greater the potential for losses as well as gains. "),c.qc(),c.rc(13,"li",6),c.qd(14,"\xa0You should assess whether you have the ability to service the repayments on the proposed loan. If your loan is a variable rate loan, and if interest rates rise, your total repayment amount will be increased. "),c.qc(),c.rc(15,"li",6),c.qd(16,"\xa0If unit prices fall beyond a certain level, you may be asked to provide additional acceptable collateral or pay additional amounts on top of your normal instalments. If you fail to comply within the time prescribed, your units may be sold to settle your loan. "),c.qc(),c.rc(17,"li",6),c.qd(18,"\xa0Returns on unit trusts are not guaranteed and may not be earned evenly over time. This means that there may be some years where returns are high and other years where losses are experienced instead. Whether you eventually realise a gain or loss may be affected by the timing of the sale of your units. The value of units may fall just when you want your money back even though the investment may have done well in the past. "),c.qc(),c.qc(),c.mc(19,"br"),c.rc(20,"p"),c.qd(21,"This brief statement cannot disclose all the risk and other aspects of loan financing. You should therefore carefully study the terms and conditions before you decide to take the loan. If you are in doubt in respect of any aspect of this Risk Disclosure Statement or the terms of the loan financing, you should consult the institution offering the loan. "),c.qc(),c.qc(),c.qc()}if(2&e){const e=c.Dc();c.Mc("show",e.isModalVisible)}}let p=(()=>{class e{constructor(){this.onCloseModal=new c.s}ngOnInit(){}onClose(){this.onCloseModal.emit()}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=c.fc({type:e,selectors:[["ut-disclosure-statement-modal"]],inputs:{isModalVisible:"isModalVisible"},outputs:{onCloseModal:"onCloseModal"},decls:4,vars:6,consts:[[4,"ngIf"],["actionText","Close",3,"show","showChange",4,"ngIf"],["nzWidth","800","nzWrapClassName","vertical-center-modal",3,"nzClosable","nzFooter","nzTitle","nzVisible","nzOnCancel"],[1,"p-2","h5","text-black-7"],[1,"font-italic","font-weight-bold"],["type","a",1,"mb-3"],[1,"mt-1"],["actionText","Close",3,"show","showChange"]],template:function(e,t){1&e&&(c.od(0,u,23,4,"app-web-scaffold",0),c.Ec(1,"async"),c.od(2,h,22,1,"b2c-mobile-drawer",1),c.Ec(3,"async")),2&e&&(c.Mc("ngIf",!c.Fc(1,2,t.isMobile$)),c.Ub(2),c.Mc("ngIf",c.Fc(3,4,t.isMobile$)))},directives:[a.t,l.a,r.a,d.a],pipes:[a.b],styles:[""]}),Object(i.c)([Object(o.e)(s.a.isMobile)],e.prototype,"isMobile$",void 0),e})()}}]);
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.