2
0
mirror of https://github.com/Ride-The-Lightning/RTL synced 2024-11-13 07:10:40 +00:00
RTL/frontend/src_app_eclair_ecl_module_ts.2266e5b7139d698d.js
ShahanaFarooqui 9141658976 Downgrading material to 14 due to flex layout
Downgrading material to 14 due to flex layout
2022-12-01 18:27:14 -08:00

2 lines
331 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([["src_app_eclair_ecl_module_ts"],{7258:(Op,$t,_)=>{_.r($t),_.d($t,{ECLModule:()=>Jt});var c=_(4666),C=_(3547),Ce=_(8878),t=_(2560),p=_(6722),R=_(1294);function xe(i,n){1&i&&t._UZ(0,"mat-progress-bar",3)}class j{constructor(n){this.router=n,this.loading=!1,this.router.events.subscribe(e=>{switch(!0){case e instanceof C.OD:this.loading=!0;break;case e instanceof C.m2:case e instanceof C.gk:case e instanceof C.Q3:this.loading=!1}})}static#t=this.\u0275fac=function(e){return new(e||j)(t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:j,selectors:[["rtl-ecl-root"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"inner-sidenav-content"],["color","primary","mode","indeterminate",4,"ngIf"],["outlet","outlet"],["color","primary","mode","indeterminate"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0),t.YNc(1,xe,1,0,"mat-progress-bar",1),t._UZ(2,"router-outlet",null,2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",a.loading))},dependencies:[c.O5,p.xw,p.Wh,p.yH,R.pW,C.lC],data:{animation:[Ce.g]}})}var u=_(253),h=_(8951),Mt=_(538),Xt=_(2898),T=_(9306),s=_(7731),g=_(2501),N=_(5043),A=_(9263),O=_(62),F=_(3505),L=_(3704),q=_(4522),b=_(2156),jt=_(2642),te=_(7822),Qt=_(8589),E=_(5892);const ee=function(i){return{backgroundColor:i}};function ye(i,n){if(1&i&&t._UZ(0,"span",6),2&i){const e=t.oxw();t.Q6J("ngStyle",t.VKq(1,ee,null==e.information?null:e.information.color))}}function Te(i,n){if(1&i&&(t.TgZ(0,"div")(1,"h4",1),t._uU(2,"Color"),t.qZA(),t.TgZ(3,"div",2),t._UZ(4,"span",7),t._uU(5),t.ALo(6,"uppercase"),t.qZA()()),2&i){const e=t.oxw();t.xp6(4),t.Q6J("ngStyle",t.VKq(4,ee,null==e.information?null:e.information.color)),t.xp6(1),t.hij(" ",t.lcZ(6,2,null==e.information?null:e.information.color)," ")}}function be(i,n){if(1&i&&(t.TgZ(0,"span",2),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(e)}}class st{constructor(n){this.commonService=n,this.chains=[""]}ngOnChanges(){this.chains=[],this.chains.push("Bitcoin "+(this.information.network?this.commonService.titleCase(this.information.network):"Testnet"))}static#t=this.\u0275fac=function(e){return new(e||st)(t.Y36(O.v))};static#e=this.\u0275cmp=t.Xpm({type:st,selectors:[["rtl-ecl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[t.TTD],decls:17,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["class","dashboard-node-dot dot",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","overflow-wrap dashboard-info-value",4,"ngFor","ngForOf"],[1,"dashboard-node-dot","dot",3,"ngStyle"],[1,"dashboard-node-square",3,"ngStyle"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div")(2,"h4",1),t._uU(3,"Alias"),t.qZA(),t.TgZ(4,"div",2),t._uU(5),t.YNc(6,ye,1,3,"span",3),t.qZA()(),t.YNc(7,Te,7,6,"div",4),t.TgZ(8,"div")(9,"h4",1),t._uU(10,"Implementation"),t.qZA(),t.TgZ(11,"div",2),t._uU(12),t.qZA()(),t.TgZ(13,"div")(14,"h4",1),t._uU(15,"Chain"),t.qZA(),t.YNc(16,be,2,1,"span",5),t.qZA()()),2&e&&(t.xp6(5),t.hij(" ",null==a.information?null:a.information.alias," "),t.xp6(1),t.Q6J("ngIf",!a.showColorFieldSeparately),t.xp6(1),t.Q6J("ngIf",a.showColorFieldSeparately),t.xp6(5),t.Oqu(null!=a.information&&a.information.lnImplementation||null!=a.information&&a.information.version?(null==a.information?null:a.information.lnImplementation)+" "+(null==a.information?null:a.information.version):""),t.xp6(4),t.Q6J("ngForOf",a.chains))},dependencies:[c.sg,c.O5,c.PC,p.xw,p.Wh,p.yH,L.Zl,c.gd]})}function ve(i,n){if(1&i&&(t.TgZ(0,"div",2)(1,"div")(2,"h4",3),t._uU(3,"Lightning"),t.qZA(),t.TgZ(4,"div",4),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",5),t.qZA(),t.TgZ(8,"div")(9,"h4",3),t._uU(10,"On-chain"),t.qZA(),t.TgZ(11,"div",4),t._uU(12),t.ALo(13,"number"),t.qZA(),t._UZ(14,"mat-progress-bar",5),t.qZA(),t.TgZ(15,"div")(16,"h4",3),t._uU(17,"Total"),t.qZA(),t.TgZ(18,"div",4),t._uU(19),t.ALo(20,"number"),t.qZA()()()),2&i){const e=t.oxw();t.xp6(5),t.hij("",t.lcZ(6,5,e.balances.lightning)," Sats"),t.xp6(2),t.s9C("value",e.balances.lightning/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(13,7,e.balances.onchain)," Sats"),t.xp6(2),t.s9C("value",e.balances.onchain/e.balances.total*100),t.xp6(5),t.hij("",t.lcZ(20,9,e.balances.total)," Sats")}}function Le(i,n){if(1&i&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}class lt{constructor(){this.balances={onchain:0,lightning:0,total:0}}static#t=this.\u0275fac=function(e){return new(e||lt)};static#e=this.\u0275cmp=t.Xpm({type:lt,selectors:[["rtl-ecl-balances-info"]],inputs:{balances:"balances",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,a){if(1&e&&(t.YNc(0,ve,21,11,"div",0),t.YNc(1,Le,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},dependencies:[c.O5,p.xw,p.Wh,p.yH,R.pW,c.JJ]})}function Se(i,n){if(1&i&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Daily"),t.qZA(),t.TgZ(5,"div",5),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div")(9,"h4",4),t._uU(10,"Weekly"),t.qZA(),t.TgZ(11,"div",5),t._uU(12),t.ALo(13,"number"),t.qZA()(),t.TgZ(14,"div")(15,"h4",4),t._uU(16,"Monthly"),t.qZA(),t.TgZ(17,"div",5),t._uU(18),t.ALo(19,"number"),t.qZA()()(),t.TgZ(20,"div",3)(21,"div")(22,"h4",4),t._uU(23,"Transactions"),t.qZA(),t.TgZ(24,"div",5),t._uU(25),t.ALo(26,"number"),t.qZA()(),t.TgZ(27,"div")(28,"h4",4),t._uU(29,"Transactions"),t.qZA(),t.TgZ(30,"div",5),t._uU(31),t.ALo(32,"number"),t.qZA()(),t.TgZ(33,"div")(34,"h4",4),t._uU(35,"Transactions"),t.qZA(),t.TgZ(36,"div",5),t._uU(37),t.ALo(38,"number"),t.qZA()()()()),2&i){const e=t.oxw();t.xp6(6),t.hij("",t.lcZ(7,6,null==e.fees?null:e.fees.daily_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(13,8,null==e.fees?null:e.fees.weekly_fee)," Sats"),t.xp6(6),t.hij("",t.lcZ(19,10,null==e.fees?null:e.fees.monthly_fee)," Sats"),t.xp6(7),t.Oqu(t.lcZ(26,12,null==e.fees?null:e.fees.daily_txs)),t.xp6(6),t.Oqu(t.lcZ(32,14,null==e.fees?null:e.fees.weekly_txs)),t.xp6(6),t.Oqu(t.lcZ(38,16,null==e.fees?null:e.fees.monthly_txs))}}function Ze(i,n){if(1&i&&(t.TgZ(0,"div",6)(1,"p"),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}class rt{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){if(this.fees?.monthly_fee){this.totalFees=[{name:"Monthly",value:this.fees.monthly_fee},{name:"Weekly",value:this.fees.weekly_fee||0},{name:"Daily ",value:this.fees.daily_fee||0}];const e=10**(Math.ceil(Math.log(this.fees.monthly_fee+1)/Math.LN10)-1);this.maxFeeValue=Math.ceil(this.fees.monthly_fee/e)*e/5||100,Object.assign(this,this.totalFees)}else this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100,Object.assign(this,this.totalFees)}static#t=this.\u0275fac=function(e){return new(e||rt)};static#e=this.\u0275cmp=t.Xpm({type:rt,selectors:[["rtl-ecl-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},features:[t.TTD],decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,a){if(1&e&&(t.YNc(0,Se,39,18,"div",0),t.YNc(1,Ze,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},dependencies:[c.O5,p.xw,p.Wh,p.yH,c.JJ]})}function Ae(i,n){if(1&i&&(t.TgZ(0,"div",2)(1,"div",3)(2,"div")(3,"h4",4),t._uU(4,"Active"),t.qZA(),t.TgZ(5,"div",5),t._UZ(6,"span",6),t._uU(7),t.ALo(8,"number"),t.qZA()(),t.TgZ(9,"div")(10,"h4",4),t._uU(11,"Pending"),t.qZA(),t.TgZ(12,"div",5),t._UZ(13,"span",7),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div")(17,"h4",4),t._uU(18,"Inactive"),t.qZA(),t.TgZ(19,"div",5),t._UZ(20,"span",8),t._uU(21),t.ALo(22,"number"),t.qZA()()(),t.TgZ(23,"div",3)(24,"div")(25,"h4",4),t._uU(26,"Capacity"),t.qZA(),t.TgZ(27,"div",5),t._uU(28),t.ALo(29,"number"),t.qZA()(),t.TgZ(30,"div")(31,"h4",4),t._uU(32,"Capacity"),t.qZA(),t.TgZ(33,"div",5),t._uU(34),t.ALo(35,"number"),t.qZA()(),t.TgZ(36,"div")(37,"h4",4),t._uU(38,"Capacity"),t.qZA(),t.TgZ(39,"div",5),t._uU(40),t.ALo(41,"number"),t.qZA()()()()),2&i){const e=t.oxw();t.xp6(7),t.Oqu(t.lcZ(8,6,(null==e.channelsStatus.active?null:e.channelsStatus.active.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(15,8,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.channels)||0)),t.xp6(7),t.Oqu(t.lcZ(22,10,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.channels)||0)),t.xp6(7),t.hij("",t.lcZ(29,12,(null==e.channelsStatus.active?null:e.channelsStatus.active.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(35,14,(null==e.channelsStatus.pending?null:e.channelsStatus.pending.capacity)||0)," Sats"),t.xp6(6),t.hij("",t.lcZ(41,16,(null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.capacity)||0)," Sats")}}function Ee(i,n){if(1&i&&(t.TgZ(0,"div",9)(1,"p"),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}class ct{constructor(){this.channelsStatus={}}static#t=this.\u0275fac=function(e){return new(e||ct)};static#e=this.\u0275cmp=t.Xpm({type:ct,selectors:[["rtl-ecl-channel-status-info"]],inputs:{channelsStatus:"channelsStatus",errorMessage:"errorMessage"},decls:3,vars:2,consts:[["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf","ngIfElse"],["errorBlock",""],["fxLayout","row","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","column","fxFlex","50","fxLayoutAlign","space-between stretch"],["fxLayoutAlign","start",1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],[1,"dot","tiny-dot","green"],[1,"dot","tiny-dot","yellow"],[1,"dot","tiny-dot","grey"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,a){if(1&e&&(t.YNc(0,Ae,42,18,"div",0),t.YNc(1,Ee,3,1,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},dependencies:[c.O5,p.xw,p.Wh,p.yH,c.JJ]})}var x=_(5074),K=_(1528),V=_(6896),Q=_(8822);const we=function(){return["../connections/channels/open"]},Ie=function(i){return{filter:i}};function Fe(i,n){if(1&i&&(t.TgZ(0,"div",19)(1,"a",20),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",21)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",22),t._UZ(11,"fa-icon",23),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",24)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",25),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(23,we))("state",t.VKq(24,Ie,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,11,(null==e?null:e.alias)||(null==e?null:e.shortChannelId),0,24),"",((null==e?null:e.alias)||(null==e?null:e.shortChannelId)).length>25?"...":""," "),t.xp6(6),t.hij("",t.xi3(9,15,(null==e?null:e.toLocal)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",a.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,18,(null==e?null:e.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,20,(null==e?null:e.toRemote)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function qe(i,n){if(1&i&&(t.TgZ(0,"div",17),t.YNc(1,Fe,20,26,"div",18),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}function Ne(i,n){if(1&i&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"div",6)(5,"mat-hint",7)(6,"strong",8),t._uU(7,"Local:"),t.qZA(),t._uU(8),t.ALo(9,"number"),t.qZA(),t.TgZ(10,"mat-hint",9),t._UZ(11,"fa-icon",10),t._uU(12),t.ALo(13,"number"),t.qZA(),t.TgZ(14,"mat-hint",11)(15,"strong",8),t._uU(16,"Remote:"),t.qZA(),t._uU(17),t.ALo(18,"number"),t.qZA()(),t._UZ(19,"mat-progress-bar",12),t.qZA(),t.TgZ(20,"div",13),t._UZ(21,"mat-divider",14),t.qZA(),t.TgZ(22,"div",15),t.YNc(23,qe,2,1,"div",16),t.qZA()()),2&i){const e=t.oxw(),a=t.MAs(2);t.xp6(8),t.hij("",t.xi3(9,7,(null==e.channelBalances?null:e.channelBalances.localBalance)||0,"1.0-0")," Sats"),t.xp6(3),t.Q6J("icon",e.faBalanceScale),t.xp6(1),t.hij(" (",t.lcZ(13,10,(null==e.channelBalances?null:e.channelBalances.balancedness)||0),") "),t.xp6(5),t.hij("",t.xi3(18,12,(null==e.channelBalances?null:e.channelBalances.remoteBalance)||0,"1.0-0")," Sats"),t.xp6(2),t.s9C("value",null!=e.channelBalances&&e.channelBalances.localBalance&&(null==e.channelBalances?null:e.channelBalances.localBalance)>0?+(null==e.channelBalances?null:e.channelBalances.localBalance)/(+(null==e.channelBalances?null:e.channelBalances.localBalance)+ +(null==e.channelBalances?null:e.channelBalances.remoteBalance))*100:0),t.xp6(4),t.Q6J("ngIf",e.allChannels&&(null==e.allChannels?null:e.allChannels.length)>0)("ngIfElse",a)}}function Oe(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",26),t._uU(1," No channels available. "),t.TgZ(2,"button",27),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.goToChannels())}),t._uU(3,"Open Channel"),t.qZA()()}}function Pe(i,n){if(1&i&&(t.TgZ(0,"div",28)(1,"p"),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}class ut{constructor(n){this.router=n,this.faBalanceScale=T.DL8,this.faDumbbell=T.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/ecl/connections")}static#t=this.\u0275fac=function(e){return new(e||ut)(t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:ut,selectors:[["rtl-ecl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90"],[1,"font-weight-900","mr-5px"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90"],["matTooltip","Balance Score",1,"mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90"],["mode","determinate","color","accent",1,"dashboard-progress-bar","this-channel-bar",3,"value"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[1,"channels-capacity-scroll",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90","color-primary"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90","color-primary"],["matTooltip","Balance Score",1,"color-primary","mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90","color-primary"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1","w-100"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,a){if(1&e&&(t.YNc(0,Ne,24,15,"div",0),t.YNc(1,Oe,4,0,"ng-template",null,1,t.W1O),t.YNc(3,Pe,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},dependencies:[c.sg,c.O5,F.BN,p.xw,p.Wh,p.yH,q.lW,x.bx,K.d,R.pW,V.gM,Q.$V,C.rH,c.OU,c.JJ],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]})}function Ue(i,n){if(1&i&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toRemote||0,"1.0-0")," Sats")}}function ke(i,n){if(1&i&&(t.TgZ(0,"mat-hint",19)(1,"strong",20),t._uU(2,"Capacity: "),t.qZA(),t._uU(3),t.ALo(4,"number"),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(3),t.hij("",t.xi3(4,1,e.toLocal||0,"1.0-0")," Sats")}}function De(i,n){if(1&i&&t._UZ(0,"mat-progress-bar",21),2&i){const e=t.oxw().$implicit,a=t.oxw(3);t.s9C("value",a.totalLiquidity>0?(+e.toRemote||0)/a.totalLiquidity*100:0)}}function Re(i,n){if(1&i&&t._UZ(0,"mat-progress-bar",21),2&i){const e=t.oxw().$implicit,a=t.oxw(3);t.s9C("value",a.totalLiquidity>0?(+e.toLocal||0)/a.totalLiquidity*100:0)}}const Je=function(){return["../connections/channels/open"]},Me=function(i){return{filter:i}};function Qe(i,n){if(1&i&&(t.TgZ(0,"div",14)(1,"a",15),t._uU(2),t.ALo(3,"slice"),t.qZA(),t.TgZ(4,"div",16),t.YNc(5,Ue,5,4,"mat-hint",17),t.YNc(6,ke,5,4,"mat-hint",17),t.qZA(),t.YNc(7,De,1,1,"mat-progress-bar",18),t.YNc(8,Re,1,1,"mat-progress-bar",18),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(3);t.xp6(1),t.s9C("matTooltip",e.alias||e.shortChannelId),t.s9C("matTooltipDisabled",(e.alias||e.shortChannelId).length<26),t.Q6J("routerLink",t.DdM(14,Je))("state",t.VKq(15,Me,e.channelId)),t.xp6(1),t.AsE(" ",t.Dn7(3,10,e.alias||e.shortChannelId,0,24),"",(e.alias||e.shortChannelId).length>25?"...":""," "),t.xp6(3),t.Q6J("ngIf","In"===a.direction),t.xp6(1),t.Q6J("ngIf","Out"===a.direction),t.xp6(1),t.Q6J("ngIf","In"===a.direction),t.xp6(1),t.Q6J("ngIf","Out"===a.direction)}}function Ye(i,n){if(1&i&&(t.TgZ(0,"div",12),t.YNc(1,Qe,9,17,"div",13),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngForOf",e.allChannels)}}const Be=function(i,n,e){return{"mb-4":i,"mb-2":n,"mb-1":e}};function He(i,n){if(1&i&&(t.TgZ(0,"div",3)(1,"div",4)(2,"span",5),t._uU(3,"Total Capacity"),t.qZA(),t.TgZ(4,"mat-hint",6),t._uU(5),t.ALo(6,"number"),t.qZA(),t._UZ(7,"mat-progress-bar",7),t.qZA(),t.TgZ(8,"div",8),t._UZ(9,"mat-divider",9),t.qZA(),t.TgZ(10,"div",10),t.YNc(11,Ye,2,1,"div",11),t.qZA()()),2&i){const e=t.oxw(),a=t.MAs(2);t.Q6J("ngClass",t.kEZ(7,Be,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM,e.screenSize===e.screenSizeEnum.MD,e.screenSize===e.screenSizeEnum.LG||e.screenSize===e.screenSizeEnum.XL)),t.xp6(5),t.hij("",t.xi3(6,4,e.totalLiquidity,"1.0-0")," Sats"),t.xp6(6),t.Q6J("ngIf",e.allChannels&&e.allChannels.length>0)("ngIfElse",a)}}function ze(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.goToChannels())}),t._uU(1,"Open Channel"),t.qZA()}}function Ve(i,n){if(1&i&&(t.TgZ(0,"div",22),t._uU(1," No channels available. "),t.YNc(2,ze,2,0,"button",23),t.qZA()),2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngIf","Out"===e.direction)}}function Ge(i,n){if(1&i&&(t.TgZ(0,"div",25)(1,"p"),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.errorMessage)}}class pt{constructor(n,e){this.router=n,this.commonService=e,this.screenSize="",this.screenSizeEnum=s.cu}ngOnInit(){this.screenSize=this.commonService.getScreenSize()}goToChannels(){this.router.navigateByUrl("/ecl/connections")}static#t=this.\u0275fac=function(e){return new(e||pt)(t.Y36(C.F0),t.Y36(O.v))};static#e=this.\u0275cmp=t.Xpm({type:pt,selectors:[["rtl-ecl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",3,"ngClass"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],[1,"font-size-90"],["mode","determinate","color","accent","value","100",1,"dashboard-progress-bar","this-channel-bar"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],["fxLayout","column","fxFlex.gt-sm","88","fxFlex","84","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100","class","w-100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100",1,"w-100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","100","fxLayoutAlign","start center","class","font-size-90 color-primary",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","1",3,"click",4,"ngIf"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,a){if(1&e&&(t.YNc(0,He,12,11,"div",0),t.YNc(1,Ve,3,1,"ng-template",null,1,t.W1O),t.YNc(3,Ge,3,1,"ng-template",null,2,t.W1O)),2&e){const o=t.MAs(4);t.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},dependencies:[c.mk,c.sg,c.O5,p.xw,p.Wh,p.yH,L.oO,q.lW,x.bx,K.d,R.pW,V.gM,Q.$V,C.rH,c.OU,c.JJ]})}var z=_(9295),S=_(6060),v=_(2197),r=_(8711),J=_(116),P=_(2994),D=_(640),Yt=_(3289),G=_(3599),ne=_(8104),d=_(2508),M=_(1267),W=_(3390);const Ke=["paymentReq"];function We(i,n){if(1&i&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function $e(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function Xe(i,n){if(1&i&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function je(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment amount is required."),t.qZA())}function tn(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"input",17,18),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.paymentAmount=o)})("change",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onAmountChange(o))}),t.qZA(),t.TgZ(3,"mat-hint"),t._uU(4,"It is a zero amount invoice, enter amount to be paid."),t.qZA(),t.YNc(5,je,2,0,"mat-error",11),t.qZA()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.paymentAmount),t.xp6(4),t.Q6J("ngIf",!e.paymentAmount)}}function en(i,n){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentError)}}function nn(i,n){if(1&i&&(t.TgZ(0,"div",19),t._UZ(1,"fa-icon",20),t.YNc(2,en,2,1,"span",11),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.paymentError)}}class mt{constructor(n,e,a,o,l,m,y,f){this.dialogRef=n,this.store=e,this.eclEffects=a,this.logger=o,this.commonService=l,this.decimalPipe=m,this.actions=y,this.dataService=f,this.faExclamationTriangle=T.eHv,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.selActiveChannel={},this.activeChannels={},this.feeLimit=null,this.selFeeLimitType=s.Vc[0],this.feeLimitTypes=s.Vc,this.paymentError="",this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){this.store.select(g.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.selNode=n}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.activeChannels=n.activeChannels,this.logger.info(n)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,J.h)(n=>n.type===s.lr.UPDATE_API_CALL_STATUS_ECL||n.type===s.lr.SEND_PAYMENT_STATUS_ECL)).subscribe(n=>{n.type===s.lr.SEND_PAYMENT_STATUS_ECL&&this.dialogRef.close(),n.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&n.payload.status===s.Bn.ERROR&&"SendPayment"===n.payload.action&&(delete this.paymentDecoded.amount,this.paymentError=n.payload.message)})}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():(this.paymentAmount=null,this.paymentError="",this.paymentDecodedHint="",this.paymentReq.control.setErrors(null),this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,z.q)(1)).subscribe({next:n=>{this.paymentDecoded=n,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[2])).subscribe({next:e=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,s.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:e=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount/1e3:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:n=>{this.logger.error(n),this.paymentDecodedHint="ERROR: "+(n.message?n.message:"string"==typeof n?n:JSON.stringify(n)),this.paymentReq.control.setErrors({decodeError:!0})}}))}sendPayment(){this.zeroAmtInvoice&&this.paymentAmount?this.store.dispatch((0,P.oV)({payload:{invoice:this.paymentRequest,amountMsat:1e3*this.paymentAmount,fromDialog:!0}})):this.store.dispatch((0,P.oV)({payload:{invoice:this.paymentRequest,fromDialog:!0}}))}onPaymentRequestEntry(n){this.paymentRequest=n&&"string"==typeof n?n.trim():n,this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1,this.paymentRequest&&this.paymentRequest.length>100&&(this.paymentReq.control.setErrors(null),this.zeroAmtInvoice=!1,this.dataService.decodePayment(this.paymentRequest,!0).pipe((0,z.q)(1)).subscribe({next:e=>{this.paymentDecoded=e,this.paymentDecoded.timestamp&&!this.paymentDecoded.amount?(this.paymentDecoded.amount=0,this.zeroAmtInvoice=!0,this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description):(this.zeroAmtInvoice=!1,this.selNode&&this.selNode.fiatConversion&&this.paymentDecoded.amount?this.commonService.convertCurrency(+this.paymentDecoded.amount,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[3])).subscribe({next:a=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+a.symbol+this.decimalPipe.transform(a.OTHER?a.OTHER:0,s.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:a=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description)},error:e=>{this.logger.error(e),this.paymentDecodedHint="ERROR: "+(e.message?e.message:"string"==typeof e?e:JSON.stringify(e)),this.paymentReq.control.setErrors({decodeError:!0})}}))}onAmountChange(n){delete this.paymentDecoded.amount,this.paymentDecoded.amount=n}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selActiveChannel=null,this.feeLimit=null,this.selFeeLimitType=s.Vc[0],this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint="",this.zeroAmtInvoice=!1}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||mt)(t.Y36(D.so),t.Y36(A.yh),t.Y36(Yt.o),t.Y36(N.mQ),t.Y36(O.v),t.Y36(c.JJ),t.Y36(G.eX),t.Y36(ne.D))};static#e=this.\u0275cmp=t.Xpm({type:mt,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(e,a){if(1&e&&t.Gf(Ke,5),2&e){let o;t.iGM(o=t.CRH())&&(a.paymentReq=o.first)}},decls:24,vars:7,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayoutAlign","space-between stretch","fxLayout","column"],["sendPaymentForm","ngForm"],["autoFocus","","matInput","","placeholder","Payment Request","name","paymentRequest","rows","4","tabindex","1","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","3",3,"click"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",1)(12,"textarea",9,10),t.NdJ("ngModelChange",function(l){return a.onPaymentRequestEntry(l)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(14,We,2,1,"mat-hint",11),t.YNc(15,$e,2,0,"mat-error",11),t.YNc(16,Xe,2,1,"mat-error",11),t.qZA(),t.YNc(17,tn,6,2,"mat-form-field",12),t.YNc(18,nn,3,2,"div",13),t.TgZ(19,"div",14)(20,"button",15),t.NdJ("click",function(){return a.resetData()}),t._uU(21,"Clear Fields"),t.qZA(),t.TgZ(22,"button",16),t.NdJ("click",function(){return a.onSendPayment()}),t._uU(23,"Send Payment"),t.qZA()()()()()()),2&e){const o=t.MAs(13);t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",a.paymentRequest),t.xp6(2),t.Q6J("ngIf",a.paymentRequest&&""!==a.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!a.paymentRequest),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.decodeError),t.xp6(1),t.Q6J("ngIf",a.zeroAmtInvoice),t.xp6(1),t.Q6J("ngIf",""!==a.paymentError)}},dependencies:[c.O5,d._Y,d.Fj,d.JJ,d.JL,d.Q7,d.On,d.F,F.BN,p.xw,p.Wh,p.yH,D.ZT,q.lW,b.dk,b.dn,x.TO,x.KE,x.bx,M.Nt,W.h]})}var Y=_(3012);const an=["scrollContainer"];function on(i,n){if(1&i&&(t.TgZ(0,"div",9)(1,"div",1)(2,"h4",11),t._uU(3,"Description"),t.qZA(),t.TgZ(4,"span",12),t._uU(5),t.qZA()()()),2&i){const e=t.oxw();t.xp6(5),t.Oqu(e.description)}}function sn(i,n){1&i&&t._UZ(0,"mat-divider",14)}function ln(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"mat-expansion-panel",23),t.NdJ("opened",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onExpansionOpen(!0))})("closed",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onExpansionOpen(!1))}),t.TgZ(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"h4",24),t._uU(4),t.qZA(),t.TgZ(5,"h4",25),t._uU(6),t.ALo(7,"number"),t.qZA()()(),t.TgZ(8,"div",8)(9,"div",9)(10,"div",26)(11,"h4",11),t._uU(12,"Fees (mSats)"),t.qZA(),t.TgZ(13,"span",12),t._uU(14),t.ALo(15,"number"),t.qZA()(),t.TgZ(16,"div",26)(17,"h4",11),t._uU(18,"Date/Time"),t.qZA(),t.TgZ(19,"span",12),t._uU(20),t.ALo(21,"date"),t.qZA()()(),t._UZ(22,"mat-divider",14),t.TgZ(23,"div",9)(24,"div",1)(25,"h4",11),t._uU(26,"ID"),t.qZA(),t.TgZ(27,"span",27),t._uU(28),t.qZA()()(),t._UZ(29,"mat-divider",14),t.TgZ(30,"div",9)(31,"div",1)(32,"h4",11),t._uU(33,"To Channel"),t.qZA(),t.TgZ(34,"span",27),t._uU(35),t.qZA()()()()()}if(2&i){const e=n.$implicit,a=n.index,o=t.oxw();t.Q6J("expanded",o.expansionOpen),t.xp6(4),t.hij("Part ",a+1,""),t.xp6(2),t.hij("",t.lcZ(7,7,e.amount)," (Sats)"),t.xp6(8),t.Oqu(t.lcZ(15,9,e.feesPaid)),t.xp6(6),t.Oqu(t.xi3(21,11,e.timestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(e.id),t.xp6(7),t.Oqu(e.toChannelAlias)}}class dt{constructor(n,e){this.dialogRef=n,this.data=e,this.description=null,this.shouldScroll=!0,this.expansionOpen=!0}ngOnInit(){this.payment=this.data.payment,this.data.sentPaymentInfo.length>0&&this.data.sentPaymentInfo[0].paymentRequest&&this.data.sentPaymentInfo[0].paymentRequest.description&&""!==this.data.sentPaymentInfo[0].paymentRequest.description&&(this.description=this.data.sentPaymentInfo[0].paymentRequest.description)}ngAfterViewChecked(){this.shouldScroll=this.scrollContainer.nativeElement.classList.value.includes("ps--active-y")}onScrollDown(){this.scrollContainer.nativeElement.scrollTop=this.scrollContainer.nativeElement.scrollTop+62.6}onExpansionOpen(n){this.expansionOpen=n}onClose(){this.dialogRef.close(!1)}static#t=this.\u0275fac=function(e){return new(e||dt)(t.Y36(D.so),t.Y36(D.WI))};static#e=this.\u0275cmp=t.Xpm({type:dt,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(e,a){if(1&e&&t.Gf(an,5),2&e){let o;t.iGM(o=t.CRH())&&(a.scrollContainer=o.first)}},decls:66,vars:15,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"h-40","padding-gap-x-large",3,"perfectScrollbar"],["scrollContainer",""],["fxLayout","column"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],["fxFlex","70"],[1,"w-100","my-1"],["fxLayout","row",4,"ngIf"],["class","w-100 my-1",4,"ngIf"],["class","flat-expansion-panel my-1",3,"expanded","opened","closed",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start end",1,"btn-sticky-container","padding-gap-x-large"],["mat-mini-fab","","aria-label","Scroll Down","fxLayoutAlign","center center",3,"click"],["fxLayoutAlign","center center"],["fxLayout","row","fxLayoutAlign","end center",1,"padding-gap-x-large","padding-gap-bottom-large"],["fxLayoutAlign","center center","tabindex","1","mat-button","","color","primary","type","button","default","",1,"mr-1",3,"mat-dialog-close"],[1,"flat-expansion-panel","my-1",3,"expanded","opened","closed"],["fxFlex","30","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","70","fxLayoutAlign","start",1,"font-bold-500"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Payment Information"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return a.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6,7)(10,"div",8)(11,"div",9)(12,"div",10)(13,"h4",11),t._uU(14,"Amount (Sats)"),t.qZA(),t.TgZ(15,"span",12),t._uU(16),t.ALo(17,"number"),t.qZA()(),t.TgZ(18,"div",13)(19,"h4",11),t._uU(20,"Date/Time"),t.qZA(),t.TgZ(21,"span",12),t._uU(22),t.ALo(23,"date"),t.qZA()()(),t._UZ(24,"mat-divider",14),t.TgZ(25,"div",9)(26,"div",1)(27,"h4",11),t._uU(28,"ID"),t.qZA(),t.TgZ(29,"span",12),t._uU(30),t.qZA()()(),t._UZ(31,"mat-divider",14),t.TgZ(32,"div",9)(33,"div",1)(34,"h4",11),t._uU(35,"Payment Hash"),t.qZA(),t.TgZ(36,"span",12),t._uU(37),t.qZA()()(),t._UZ(38,"mat-divider",14),t.TgZ(39,"div",9)(40,"div",1)(41,"h4",11),t._uU(42,"Payment Preimage"),t.qZA(),t.TgZ(43,"span",12),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",1)(48,"h4",11),t._uU(49,"Recipient Node"),t.qZA(),t.TgZ(50,"span",12),t._uU(51),t.qZA()()(),t._UZ(52,"mat-divider",14),t.YNc(53,on,6,1,"div",15),t.YNc(54,sn,1,0,"mat-divider",16),t.TgZ(55,"div",9)(56,"div",1)(57,"mat-accordion"),t.YNc(58,ln,36,14,"mat-expansion-panel",17),t.qZA()()()()(),t.TgZ(59,"div",18)(60,"button",19),t.NdJ("click",function(){return a.onScrollDown()}),t.TgZ(61,"mat-icon",20),t._uU(62,"arrow_downward"),t.qZA()()(),t.TgZ(63,"div",21)(64,"button",22),t._uU(65,"OK"),t.qZA()()()()),2&e&&(t.xp6(16),t.Oqu(t.lcZ(17,10,a.payment.recipientAmount)),t.xp6(6),t.Oqu(t.xi3(23,12,a.payment.firstPartTimestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(a.payment.id),t.xp6(7),t.Oqu(a.payment.paymentHash),t.xp6(7),t.Oqu(a.payment.paymentPreimage),t.xp6(7),t.Oqu(a.payment.recipientNodeAlias),t.xp6(2),t.Q6J("ngIf",a.description),t.xp6(1),t.Q6J("ngIf",a.description),t.xp6(4),t.Q6J("ngForOf",a.payment.parts),t.xp6(6),t.Q6J("mat-dialog-close",!1))},dependencies:[c.sg,c.O5,p.xw,p.Wh,p.yH,D.ZT,q.lW,b.dk,b.dn,Y.pp,Y.ib,Y.yz,Y.yK,te.Hw,K.d,Q.$V,c.JJ,c.uU]})}var Z=_(7861),ht=_(3093),H=_(9445),U=_(7371),B=_(207);const rn=["sendPaymentForm"];function cn(i,n){if(1&i&&(t.TgZ(0,"mat-hint"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.paymentDecodedHint)}}function un(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Payment request is required."),t.qZA())}function pn(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"textarea",7,8),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onPaymentRequestEntry(o))})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(5,cn,2,1,"mat-hint",9),t.YNc(6,un,2,0,"mat-error",9),t.qZA(),t.TgZ(7,"div",10)(8,"button",11),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(9,"Clear Field"),t.qZA(),t.TgZ(10,"button",12),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSendPayment())}),t._uU(11,"Send Payment"),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.paymentRequest),t.xp6(2),t.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!e.paymentRequest)}}function mn(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",13)(1,"button",12),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.openSendPaymentModal())}),t._uU(2,"Send Payment"),t.qZA()()}}function dn(i,n){if(1&i&&(t.TgZ(0,"mat-option",59),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}function hn(i,n){1&i&&t._UZ(0,"mat-progress-bar",60)}function _n(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"Date/Time"),t.qZA())}function gn(i,n){if(1&i&&(t.TgZ(0,"td",62),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,null==e?null:e.firstPartTimestamp,"dd/MMM/y HH:mm"))}}function fn(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"ID"),t.qZA())}const k=function(i){return{width:i}};function Cn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id)}}function xn(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"Destination Node ID"),t.qZA())}function yn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId)}}function Tn(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"Destination"),t.qZA())}function bn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias)}}function vn(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"Description"),t.qZA())}function Ln(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function Sn(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"Payment Hash"),t.qZA())}function Zn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function An(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"Preimage"),t.qZA())}function En(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",63)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage)}}function wn(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Amount (Sats)"),t.qZA())}function In(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"span",66),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.recipientAmount))}}function Fn(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",67)(1,"div",68)(2,"mat-select",69),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",70),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function qn(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",71)(1,"button",72),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw(2);return t.KtG(m.onPaymentClick(l))}),t._uU(2,"View Info"),t.qZA()()}}function Nn(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No payment available."),t.qZA())}function On(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting payments..."),t.qZA())}function Pn(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Un(i,n){if(1&i&&(t.TgZ(0,"td",73),t.YNc(1,Nn,2,0,"p",9),t.YNc(2,On,2,0,"p",9),t.YNc(3,Pn,2,1,"p",9),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function kn(i,n){if(1&i&&(t.TgZ(0,"span",74),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.timestamp,"dd/MMM/y HH:mm")," ")}}function Dn(i,n){if(1&i&&(t.ynx(0),t.YNc(1,kn,3,4,"span",75),t.BQk()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Rn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"span",74),t._uU(2),t.qZA(),t.YNc(3,Dn,2,1,"ng-container",9),t.qZA()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" Total Attempts: ",(null==e||null==e.parts?null:e.parts.length)||0," "),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Jn(i,n){if(1&i&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(e.id)}}function Mn(i,n){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,Jn,4,4,"span",75),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Qn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Mn,2,1,"span",9),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.id),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Yn(i,n){if(1&i&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(e.toChannelId)}}function Bn(i,n){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,Yn,4,4,"span",75),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Hn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Bn,2,1,"span",9),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeId),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function zn(i,n){if(1&i&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(e.toChannelAlias)}}function Vn(i,n){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,zn,4,4,"span",75),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function Gn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,Vn,2,1,"span",9),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Kn(i,n){if(1&i&&(t.TgZ(0,"span",77),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,e.amount,"1.0-0")," ")}}function Wn(i,n){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,Kn,3,4,"span",78),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function $n(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"span",77),t._uU(2),t.ALo(3,"number"),t.qZA(),t.YNc(4,Wn,2,1,"span",9),t.qZA()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.xi3(3,2,null==e?null:e.recipientAmount,"1.0-0")),t.xp6(2),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function Xn(i,n){if(1&i&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function jn(i,n){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,Xn,5,7,"span",75),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function ti(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,jn,2,1,"span",9),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function ei(i,n){if(1&i&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function ni(i,n){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,ei,5,7,"span",75),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function ii(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,ni,2,1,"span",9),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function ai(i,n){if(1&i&&(t.TgZ(0,"span",74)(1,"span",76)(2,"span",64),t._uU(3),t.ALo(4,"number"),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(4);t.xp6(1),t.Q6J("ngStyle",t.VKq(5,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.hij("Fee Paid: ",t.xi3(4,2,e.feesPaid,"1.0-0")," (Sats)")}}function oi(i,n){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,ai,5,7,"span",75),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function si(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"div",76)(2,"span",64),t._uU(3),t.qZA()(),t.YNc(4,oi,2,1,"span",9),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(3,k,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentPreimage),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function li(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",79)(1,"button",82),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw(2).$implicit,y=t.oxw(2);return t.KtG(y.onPartClick(l,m))}),t._uU(2),t.qZA()()}if(2&i){const e=n.index;t.xp6(2),t.hij("View ",e+1,"")}}function ri(i,n){if(1&i&&(t.TgZ(0,"div"),t.YNc(1,li,3,1,"div",81),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngForOf",null==e?null:e.parts)}}function ci(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",62)(1,"span",79)(2,"button",80),t.NdJ("click",function(){const l=t.CHM(e).$implicit;return t.KtG(l.is_expanded=!l.is_expanded)}),t._uU(3),t.qZA()(),t.YNc(4,ri,2,1,"div",9),t.qZA()}if(2&i){const e=n.$implicit;t.xp6(3),t.Oqu(null!=e&&e.is_expanded?"Hide":"Show"),t.xp6(1),t.Q6J("ngIf",null==e?null:e.is_expanded)}}function ui(i,n){1&i&&t._UZ(0,"tr",83)}const pi=function(i){return{"display-none":i}};function mi(i,n){if(1&i&&t._UZ(0,"tr",84),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,pi,(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function di(i,n){1&i&&t._UZ(0,"tr",85)}function hi(i,n){1&i&&t._UZ(0,"tr",83)}const _i=function(){return["all"]},gi=function(i){return{"error-border":i}},fi=function(){return["no_payment"]};function Ci(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",14)(1,"div",15)(2,"div",16),t._UZ(3,"fa-icon",17),t.TgZ(4,"span",18),t._uU(5,"Payments History"),t.qZA()(),t.TgZ(6,"div",19)(7,"mat-form-field",20)(8,"mat-select",21),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.YNc(9,dn,2,2,"mat-option",22),t.qZA()(),t.TgZ(10,"mat-form-field",20)(11,"input",23),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()(),t.TgZ(12,"div",24)(13,"div",25),t.YNc(14,hn,1,0,"mat-progress-bar",26),t.TgZ(15,"table",27,28),t.ynx(17,29),t.YNc(18,_n,2,0,"th",30),t.YNc(19,gn,3,4,"td",31),t.BQk(),t.ynx(20,32),t.YNc(21,fn,2,0,"th",30),t.YNc(22,Cn,4,4,"td",31),t.BQk(),t.ynx(23,33),t.YNc(24,xn,2,0,"th",30),t.YNc(25,yn,4,4,"td",31),t.BQk(),t.ynx(26,34),t.YNc(27,Tn,2,0,"th",30),t.YNc(28,bn,4,4,"td",31),t.BQk(),t.ynx(29,35),t.YNc(30,vn,2,0,"th",30),t.YNc(31,Ln,4,4,"td",31),t.BQk(),t.ynx(32,36),t.YNc(33,Sn,2,0,"th",30),t.YNc(34,Zn,4,4,"td",31),t.BQk(),t.ynx(35,37),t.YNc(36,An,2,0,"th",30),t.YNc(37,En,4,4,"td",31),t.BQk(),t.ynx(38,38),t.YNc(39,wn,2,0,"th",39),t.YNc(40,In,4,3,"td",31),t.BQk(),t.ynx(41,40),t.YNc(42,Fn,6,0,"th",41),t.YNc(43,qn,3,0,"td",42),t.BQk(),t.ynx(44,43),t.YNc(45,Un,4,3,"td",44),t.BQk(),t.ynx(46,45),t.YNc(47,Rn,4,2,"td",31),t.BQk(),t.ynx(48,46),t.YNc(49,Qn,5,5,"td",31),t.BQk(),t.ynx(50,47),t.YNc(51,Hn,5,5,"td",31),t.BQk(),t.ynx(52,48),t.YNc(53,Gn,5,5,"td",31),t.BQk(),t.ynx(54,49),t.YNc(55,$n,5,5,"td",31),t.BQk(),t.ynx(56,50),t.YNc(57,ti,5,5,"td",31),t.BQk(),t.ynx(58,51),t.YNc(59,ii,5,5,"td",31),t.BQk(),t.ynx(60,52),t.YNc(61,si,5,5,"td",31),t.BQk(),t.ynx(62,53),t.YNc(63,ci,5,2,"td",31),t.BQk(),t.YNc(64,ui,1,0,"tr",54),t.YNc(65,mi,1,3,"tr",55),t.YNc(66,di,1,0,"tr",56),t.YNc(67,hi,1,0,"tr",57),t.qZA()()(),t._UZ(68,"mat-paginator",58),t.qZA()}if(2&i){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(5),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(15,_i).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter),t.xp6(3),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.payments)("ngClass",t.VKq(16,gi,""!==e.errorMessage)),t.xp6(49),t.Q6J("matRowDefColumns",e.partColumns)("matRowDefWhen",e.is_group),t.xp6(1),t.Q6J("matFooterRowDef",t.DdM(18,fi)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}class tt{constructor(n,e,a,o,l,m,y,f){this.logger=n,this.commonService=e,this.store=a,this.rtlEffects=o,this.decimalPipe=l,this.dataService=m,this.datePipe=y,this.camelCaseWithSpaces=f,this.calledFrom="transactions",this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"payments",recordsPerPage:s.IV,sortBy:"firstPartTimestamp",sortOrder:s.Pi.DESCENDING},this.faHistory=T.qO$,this.newlyAddedPayment="",this.selNode={},this.information={},this.payments=new r.by([]),this.paymentJSONArr=[],this.paymentDecoded={},this.displayedColumns=[],this.partColumns=[],this.paymentRequest="",this.paymentDecodedHint="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(g.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.selNode=n}),this.store.select(g.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.information=n}),this.store.select(g.nF).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.partColumns=[],this.displayedColumns.map(e=>this.partColumns.push("group_"+e)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.PP).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.paymentJSONArr=n.payments&&n.payments.sent&&n.payments.sent.length>0?n.payments.sent:[],this.paymentJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadPaymentsTable(this.paymentJSONArr),this.logger.info(n)})}ngAfterViewInit(){this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}applyFilter(){this.payments.filter=this.selFilter.trim().toLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):this.commonService.titleCase(n)}setFilterPredicate(){this.payments.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=(n.firstPartTimestamp?this.datePipe.transform(new Date(n.firstPartTimestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(n).toLowerCase();break;case"firstPartTimestamp":a=this.datePipe.transform(new Date(n.firstPartTimestamp||0),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return a.includes(e)}}loadPaymentsTable(n){this.payments=n?new r.by([...n]):new r.by([]),this.payments.sort=this.sort,this.payments.sortingDataAccessor=(e,a)=>{switch(a){case"firstPartTimestamp":return this.commonService.sortByKey(e.parts,"timestamp","number",this.sort?.direction),e.firstPartTimestamp;case"id":return this.commonService.sortByKey(e.parts,"id","string",this.sort?.direction),e.id;case"recipientNodeAlias":return this.commonService.sortByKey(e.parts,"toChannelAlias","string",this.sort?.direction),e.recipientNodeAlias;case"recipientAmount":return this.commonService.sortByKey(e.parts,"amount","number",this.sort?.direction),e.recipientAmount;default:return e[a]&&isNaN(e[a])?e[a].toLocaleLowerCase():e[a]?+e[a]:null}},this.payments.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.payments.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,z.q)(1)).subscribe(n=>{this.paymentDecoded=n,this.paymentDecoded.timestamp?(this.paymentDecoded.amount||(this.paymentDecoded.amount=0),this.sendPayment()):this.resetData()})}sendPayment(){if(this.newlyAddedPayment=this.paymentDecoded.paymentHash||"",this.paymentDecoded.amount&&0!==this.paymentDecoded.amount){const n=[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:50,type:s.Gi.DATE_TIME},{key:"amount",value:this.paymentDecoded.amount,title:"Amount (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:s.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:50}]];this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Confirm Send Payment",noBtnText:"Cancel",yesBtnText:"Send Payment",message:n}}})),this.rtlEffects.closeConfirm.pipe((0,z.q)(1)).subscribe(e=>{e&&(this.store.dispatch((0,P.oV)({payload:{invoice:this.paymentRequest,fromDialog:!1}})),this.resetData())})}else{const n=[[{key:"paymentHash",value:this.paymentDecoded.paymentHash,title:"Payment Hash",width:100}],[{key:"nodeId",value:this.paymentDecoded.nodeId,title:"Payee",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:40,type:s.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:s.Gi.NUMBER},{key:"minFinalCltvExpiry",value:this.paymentDecoded.minFinalCltvExpiry,title:"CLTV Expiry",width:30}]],e="It is a zero amount invoice. Enter the amount (Sats) to pay.";this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",message:n,noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,titleMessage:e,getInputs:[{placeholder:"Amount (Sats)",inputType:s.Gi.NUMBER,inputValue:"",width:30}]}}})),this.rtlEffects.closeConfirm.pipe((0,z.q)(1)).subscribe(a=>{a&&(this.paymentDecoded.amount=a[0].inputValue,this.store.dispatch((0,P.oV)({payload:{invoice:this.paymentRequest,amountMsat:1e3*a[0].inputValue,fromDialog:!1}})),this.resetData())})}}onPaymentRequestEntry(n){this.paymentRequest=n,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,z.q)(1)).subscribe(e=>{this.paymentDecoded=e,this.paymentDecoded.amount?this.selNode&&this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.amount,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[4])).subscribe({next:a=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats ("+a.symbol+this.decimalPipe.transform(a.OTHER?a.OTHER:0,s.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:a=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.amount?this.paymentDecoded.amount:0)+" Sats | Memo: "+this.paymentDecoded.description:this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description})}openSendPaymentModal(){this.store.dispatch((0,Z.qR)({payload:{data:{component:mt}}}))}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}is_group(n,e){return e.parts&&e.parts.length>1}onPaymentClick(n){n.paymentHash&&""!==n.paymentHash.trim()?this.dataService.decodePayments(n.paymentHash).pipe((0,z.q)(1)).subscribe({next:e=>{setTimeout(()=>{this.showPaymentView(n,e.length&&e.length>0?e[0]:[])},0)},error:e=>{this.showPaymentView(n,[])}}):this.showPaymentView(n,[])}showPaymentView(n,e){this.store.dispatch((0,Z.qR)({payload:{data:{sentPaymentInfo:e,payment:n,component:dt}}}))}onPartClick(n,e){e.paymentHash&&""!==e.paymentHash.trim()?this.dataService.decodePayments(e.paymentHash).pipe((0,z.q)(1)).subscribe({next:a=>{setTimeout(()=>{this.showPartView(n,e,a.length&&a.length>0?a[0]:[])},0)},error:a=>{this.showPartView(n,e,[])}}):this.showPartView(n,e,[])}showPartView(n,e,a){const o=[[{key:"paymentHash",value:e.paymentHash,title:"Payment Hash",width:100,type:s.Gi.STRING}],[{key:"paymentPreimage",value:e.paymentPreimage,title:"Payment Preimage",width:100,type:s.Gi.STRING}],[{key:"toChannelId",value:n.toChannelId,title:"Channel",width:100,type:s.Gi.STRING}],[{key:"id",value:n.id,title:"Part ID",width:50,type:s.Gi.STRING},{key:"timestamp",value:n.timestamp,title:"Time",width:50,type:s.Gi.DATE_TIME}],[{key:"amount",value:n.amount,title:"Amount (Sats)",width:50,type:s.Gi.NUMBER},{key:"feesPaid",value:n.feesPaid,title:"Fee (Sats)",width:50,type:s.Gi.NUMBER}]];a&&a.length>0&&a[0].paymentRequest&&a[0].paymentRequest.description&&""!==a[0].paymentRequest.description&&o.splice(3,0,[{key:"description",value:a[0].paymentRequest.description,title:"Description",width:100,type:s.Gi.STRING}]),this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Payment Part Information",message:o}}}))}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const n=JSON.parse(JSON.stringify(this.payments.data)),e=n?.reduce((a,o)=>(o.paymentHash&&""!==o.paymentHash.trim()&&(a=""===a?o.paymentHash:a+","+o.paymentHash),a),"");this.dataService.decodePayments(e).pipe((0,h.R)(this.unSubs[5])).subscribe(a=>{a.forEach((l,m)=>{l.length>0&&l[0].paymentRequest&&l[0].paymentRequest.description&&""!==l[0].paymentRequest.description&&(n[m].description=l[0].paymentRequest.description)});const o=n?.reduce((l,m)=>l.concat(m),[]);this.commonService.downloadFile(o,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||tt)(t.Y36(N.mQ),t.Y36(O.v),t.Y36(A.yh),t.Y36(ht.V),t.Y36(c.JJ),t.Y36(ne.D),t.Y36(c.uU),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:tt,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(e,a){if(1&e&&(t.Gf(rn,5),t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.form=o.first),t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","colWidth","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["sendPaymentForm","ngForm"],["fxFlex","colWidth"],["matInput","","placeholder","Payment Request","name","paymentRequest","tabindex","1","required","",3,"perfectScrollbar","ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["fxLayout","row"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","colWidth",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","colWidth","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","firstPartTimestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","id"],["matColumnDef","recipientNodeId"],["matColumnDef","recipientNodeAlias"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","paymentPreimage"],["matColumnDef","recipientAmount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["matColumnDef","group_firstPartTimestamp"],["matColumnDef","group_id"],["matColumnDef","group_recipientNodeId"],["matColumnDef","group_recipientNodeAlias"],["matColumnDef","group_recipientAmount"],["matColumnDef","group_description"],["matColumnDef","group_paymentHash"],["matColumnDef","group_paymentPreimage"],["matColumnDef","group_actions"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cellcolspan","4"],["fxLayoutAlign","start center",1,"part-row-span"],["fxLayoutAlign","start center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"ellipsis-parent","part-row-span",3,"ngStyle"],["fxLayoutAlign","end center",1,"part-row-span"],["fxLayoutAlign","end center","class","part-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end start"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-part-expand",3,"click"],["fxLayoutAlign","end start",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-part-info",3,"click"],["mat-row",""],["mat-footer-row","",3,"ngClass"],["mat-header-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0),t.YNc(1,pn,12,3,"form",1),t.YNc(2,mn,3,0,"div",2),t.YNc(3,Ci,69,19,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===a.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===a.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===a.calledFrom))},dependencies:[c.mk,c.sg,c.O5,c.PC,d._Y,d.Fj,d.JJ,d.JL,d.Q7,d.On,d.F,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,q.lW,x.TO,x.KE,x.bx,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,S.NW,Q.$V,c.JJ,c.uU],styles:[".mat-column-group_actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{min-width:10rem;width:10rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{margin-top:.5rem;min-width:9rem;width:9rem}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%] .part-row-span[_ngcontent-%COMP%]:not(:first-of-type){padding-left:3rem}.part-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%]{min-width:17rem}"]})}var $=_(6534);function xi(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function yi(i,n){if(1&i&&(t.TgZ(0,"mat-option",25),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&i){const e=n.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(t.lcZ(2,2,e))}}function Ti(i,n){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.invoiceError)}}function bi(i,n){if(1&i&&(t.TgZ(0,"div",26),t._UZ(1,"fa-icon",27),t.YNc(2,Ti,2,1,"span",11),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.invoiceError)}}class _t{constructor(n,e,a,o,l,m){this.dialogRef=n,this.data=e,this.store=a,this.decimalPipe=o,this.commonService=l,this.actions=m,this.faExclamationTriangle=T.eHv,this.selNode={},this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=s.IV,this.timeUnitEnum=s.Qk,this.timeUnits=s.LO,this.selTimeUnit=s.Qk.SECS,this.invoiceError="",this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(g.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.selNode=n}),this.store.select(g.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.information=n}),this.actions.pipe((0,h.R)(this.unSubs[2]),(0,J.h)(n=>n.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(n=>{n.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&"CreateInvoice"===n.payload.action&&(n.payload.status===s.Bn.ERROR&&(this.invoiceError=n.payload.message),n.payload.status===s.Bn.COMPLETED&&this.dialogRef.close())})}onAddInvoice(n){if(this.invoiceError="",!this.description)return!0;let e=this.expiry?this.expiry:3600;this.expiry&&this.selTimeUnit!==s.Qk.SECS&&(e=this.commonService.convertTime(this.expiry,this.selTimeUnit,s.Qk.SECS));let a=null;a=this.invoiceValue?{description:this.description,expireIn:e,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:e},this.store.dispatch((0,P.Z$)({payload:a}))}resetData(){this.description="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=s.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[3])).subscribe({next:n=>{this.invoiceValueHint="= "+n.symbol+this.decimalPipe.transform(n.OTHER,s.Xz.OTHER)+" "+n.unit},error:n=>{this.invoiceValueHint="Conversion Error: "+n}}))}onTimeUnitChange(n){this.expiry&&this.selTimeUnit!==n.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,n.value)),this.selTimeUnit=n.value}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||_t)(t.Y36(D.so),t.Y36(D.WI),t.Y36(A.yh),t.Y36(c.JJ),t.Y36(O.v),t.Y36(G.eX))};static#e=this.\u0275cmp=t.Xpm({type:_t,selectors:[["rtl-ecl-create-invoices"]],decls:35,vars:16,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","start space-between","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","placeholder","Description","tabindex","2","name","description","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxFlex","40"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"step","min","ngModel","ngModelChange","keyup"],["matSuffix",""],["fxFlex","30"],["matInput","","placeholder","Expiry","type","number","name","exp","tabindex","4",3,"step","min","ngModel","ngModelChange"],["fxFlex","26"],["tabindex","5","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","8",3,"click"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,a){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Create Invoice"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8)(11,"mat-form-field",9)(12,"input",10),t.NdJ("ngModelChange",function(m){return a.description=m}),t.qZA(),t.YNc(13,xi,2,0,"mat-error",11),t.qZA(),t.TgZ(14,"div",12)(15,"mat-form-field",13)(16,"input",14),t.NdJ("ngModelChange",function(m){return a.invoiceValue=m})("keyup",function(){return a.onInvoiceValueChange()}),t.qZA(),t.TgZ(17,"span",15),t._uU(18," Sats "),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.qZA()(),t.TgZ(21,"mat-form-field",16)(22,"input",17),t.NdJ("ngModelChange",function(m){return a.expiry=m}),t.qZA(),t.TgZ(23,"span",15),t._uU(24),t.ALo(25,"titlecase"),t.qZA()(),t.TgZ(26,"mat-form-field",18)(27,"mat-select",19),t.NdJ("selectionChange",function(m){return a.onTimeUnitChange(m)}),t.YNc(28,yi,3,4,"mat-option",20),t.qZA()()(),t.YNc(29,bi,3,2,"div",21),t.TgZ(30,"div",22)(31,"button",23),t.NdJ("click",function(){return a.resetData()}),t._uU(32,"Clear Field"),t.qZA(),t.TgZ(33,"button",24),t.NdJ("click",function(){t.CHM(o);const m=t.MAs(10);return t.KtG(a.onAddInvoice(m))}),t._uU(34,"Create Invoice"),t.qZA()()()()()()}2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",a.description),t.xp6(1),t.Q6J("ngIf",!a.description),t.xp6(3),t.Q6J("step",100)("min",1)("ngModel",a.invoiceValue),t.xp6(4),t.Oqu(a.invoiceValueHint),t.xp6(2),t.Q6J("step",a.selTimeUnit===a.timeUnitEnum.SECS?300:a.selTimeUnit===a.timeUnitEnum.MINS?10:a.selTimeUnit===a.timeUnitEnum.HOURS?2:1)("min",1)("ngModel",a.expiry),t.xp6(2),t.hij("",t.lcZ(25,14,a.selTimeUnit)," "),t.xp6(3),t.Q6J("value",a.selTimeUnit),t.xp6(1),t.Q6J("ngForOf",a.timeUnits),t.xp6(1),t.Q6J("ngIf",""!==a.invoiceError))},dependencies:[c.sg,c.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,F.BN,p.xw,p.Wh,p.yH,D.ZT,q.lW,b.dk,b.dn,x.TO,x.KE,x.bx,x.R9,M.Nt,U.gD,B.ey,W.h,$.q,c.rS]})}var vi=_(7766);function Li(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Description is required."),t.qZA())}function Si(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"form",4,5)(2,"mat-form-field",6)(3,"input",7),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.description=o)}),t.qZA(),t.YNc(4,Li,2,0,"mat-error",8),t.qZA(),t.TgZ(5,"mat-form-field",9)(6,"input",10,11),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.invoiceValue=o)})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onInvoiceValueChange())}),t.qZA(),t.TgZ(8,"span",12),t._uU(9," Sats "),t.qZA(),t.TgZ(10,"mat-hint"),t._uU(11),t.qZA()(),t.TgZ(12,"div",13)(13,"button",14),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(14,"Clear Field"),t.qZA(),t.TgZ(15,"button",15),t.NdJ("click",function(){t.CHM(e);const o=t.MAs(1),l=t.oxw();return t.KtG(l.onAddInvoice(o))}),t._uU(16,"Create Invoice"),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(3),t.Q6J("ngModel",e.description),t.xp6(1),t.Q6J("ngIf",!e.description),t.xp6(2),t.Q6J("step",100)("min",1)("ngModel",e.invoiceValue),t.xp6(5),t.Oqu(e.invoiceValueHint)}}function Zi(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",16)(1,"button",17),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.openCreateInvoiceModal())}),t._uU(2,"Create Invoice"),t.qZA()()}}function Ai(i,n){if(1&i&&(t.TgZ(0,"mat-option",55),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}function Ei(i,n){1&i&&t._UZ(0,"mat-progress-bar",56)}function wi(i,n){1&i&&t._UZ(0,"th",57)}const Bt=function(i){return{"mr-0":i}};function Ii(i,n){if(1&i&&t._UZ(0,"span",62),2&i){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,Bt,e.screenSize===e.screenSizeEnum.XS))}}function Fi(i,n){if(1&i&&t._UZ(0,"span",63),2&i){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,Bt,e.screenSize===e.screenSizeEnum.XS))}}function qi(i,n){if(1&i&&t._UZ(0,"span",64),2&i){const e=t.oxw(3);t.Q6J("ngClass",t.VKq(1,Bt,e.screenSize===e.screenSizeEnum.XS))}}function Ni(i,n){if(1&i&&(t.TgZ(0,"td",58),t.YNc(1,Ii,1,3,"span",59),t.YNc(2,Fi,1,3,"span",60),t.YNc(3,qi,1,3,"span",61),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Q6J("ngIf","received"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf","unpaid"===(null==e?null:e.status)),t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.status)||"expired"===(null==e?null:e.status)||"unknown"===(null==e?null:e.status))}}function Oi(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Date Created"),t.qZA())}function Pi(i,n){if(1&i&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function Ui(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Date Expiry"),t.qZA())}function ki(i,n){if(1&i&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.expiresAt),"dd/MMM/y HH:mm")||"-")}}function Di(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Date Settled"),t.qZA())}function Ri(i,n){if(1&i&&(t.TgZ(0,"td",58),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.receivedAt),"dd/MMM/y HH:mm")||"-")}}function Ji(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Node ID"),t.qZA())}const Ht=function(i){return{width:i}};function Mi(i,n){if(1&i&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ht,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Qi(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Description"),t.qZA())}function Yi(i,n){if(1&i&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ht,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.description)}}function Bi(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Payment Hash"),t.qZA())}function Hi(i,n){if(1&i&&(t.TgZ(0,"td",58)(1,"div",66)(2,"span",67),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ht,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function zi(i,n){1&i&&(t.TgZ(0,"th",68),t._uU(1,"Amount (Sats)"),t.qZA())}function Vi(i,n){if(1&i&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amount?t.xi3(3,1,null==e?null:e.amount,"1.0-0"):"-")}}function Gi(i,n){1&i&&(t.TgZ(0,"th",70),t._uU(1," Amount Settled (Sats)"),t.qZA())}function Ki(i,n){if(1&i&&(t.TgZ(0,"td",58)(1,"span",69),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(null!=e&&e.amountSettled?t.xi3(3,1,null==e?null:e.amountSettled,"1.0-0"):"-")}}function Wi(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",71)(1,"div",72)(2,"mat-select",73),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function $i(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",75)(1,"div",72)(2,"mat-select",76),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",74),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw(2);return t.KtG(m.onInvoiceClick(l))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",74),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw(2);return t.KtG(m.onRefreshInvoice(l))}),t._uU(7,"Refresh"),t.qZA()()()()}}function Xi(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No invoice available."),t.qZA())}function ji(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting invoices..."),t.qZA())}function ta(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function ea(i,n){if(1&i&&(t.TgZ(0,"td",77),t.YNc(1,Xi,2,0,"p",8),t.YNc(2,ji,2,0,"p",8),t.YNc(3,ta,2,1,"p",8),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const na=function(i){return{"display-none":i}};function ia(i,n){if(1&i&&t._UZ(0,"tr",78),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,na,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function aa(i,n){1&i&&t._UZ(0,"tr",79)}function oa(i,n){1&i&&t._UZ(0,"tr",80)}const sa=function(){return["all"]},la=function(i){return{"error-border":i}},ra=function(){return["no_invoice"]};function ca(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",18)(1,"div",19)(2,"div",20),t._UZ(3,"fa-icon",21),t.TgZ(4,"span",22),t._uU(5,"Invoices History"),t.qZA()(),t.TgZ(6,"div",23)(7,"mat-form-field",24)(8,"mat-select",25),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.YNc(9,Ai,2,2,"mat-option",26),t.qZA()(),t.TgZ(10,"mat-form-field",24)(11,"input",27),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()(),t.TgZ(12,"div",28),t.YNc(13,Ei,1,0,"mat-progress-bar",29),t.TgZ(14,"table",30,31),t.ynx(16,32),t.YNc(17,wi,1,0,"th",33),t.YNc(18,Ni,4,3,"td",34),t.BQk(),t.ynx(19,35),t.YNc(20,Oi,2,0,"th",36),t.YNc(21,Pi,3,4,"td",34),t.BQk(),t.ynx(22,37),t.YNc(23,Ui,2,0,"th",36),t.YNc(24,ki,3,4,"td",34),t.BQk(),t.ynx(25,38),t.YNc(26,Di,2,0,"th",36),t.YNc(27,Ri,3,4,"td",34),t.BQk(),t.ynx(28,39),t.YNc(29,Ji,2,0,"th",36),t.YNc(30,Mi,4,4,"td",34),t.BQk(),t.ynx(31,40),t.YNc(32,Qi,2,0,"th",36),t.YNc(33,Yi,4,4,"td",34),t.BQk(),t.ynx(34,41),t.YNc(35,Bi,2,0,"th",36),t.YNc(36,Hi,4,4,"td",34),t.BQk(),t.ynx(37,42),t.YNc(38,zi,2,0,"th",43),t.YNc(39,Vi,4,4,"td",34),t.BQk(),t.ynx(40,44),t.YNc(41,Gi,2,0,"th",45),t.YNc(42,Ki,4,4,"td",34),t.BQk(),t.ynx(43,46),t.YNc(44,Wi,6,0,"th",47),t.YNc(45,$i,8,0,"td",48),t.BQk(),t.ynx(46,49),t.YNc(47,ea,4,3,"td",50),t.BQk(),t.YNc(48,ia,1,3,"tr",51),t.YNc(49,aa,1,0,"tr",52),t.YNc(50,oa,1,0,"tr",53),t.qZA()(),t._UZ(51,"mat-paginator",54),t.qZA()}if(2&i){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(5),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,sa).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.invoices)("ngClass",t.VKq(14,la,""!==e.errorMessage)),t.xp6(34),t.Q6J("matFooterRowDef",t.DdM(16,ra)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}class et{constructor(n,e,a,o,l,m,y){this.logger=n,this.store=e,this.decimalPipe=a,this.commonService=o,this.datePipe=l,this.actions=m,this.camelCaseWithSpaces=y,this.calledFrom="transactions",this.faHistory=T.qO$,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="transactions",this.tableSetting={tableId:"invoices",recordsPerPage:s.IV,sortBy:"expiresAt",sortOrder:s.Pi.DESCENDING},this.selNode={},this.newlyAddedInvoiceMemo="",this.newlyAddedInvoiceValue=0,this.description="",this.invoiceValue=null,this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoices=new r.by([]),this.invoiceJSONArr=[],this.information={},this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(g.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.selNode=n}),this.store.select(g.yD).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.information=n}),this.store.select(g.nF).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("status"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.Ef).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.invoiceJSONArr=n.invoices&&n.invoices.length>0?n.invoices:[],this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr),this.logger.info(n)}),this.actions.pipe((0,h.R)(this.unSubs[4]),(0,J.h)(n=>n.type===s.lr.SET_LOOKUP_ECL||n.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(n=>{n.type===s.lr.SET_LOOKUP_ECL&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&n.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(n.payload))),this.loadInvoicesTable(this.invoiceJSONArr))})}ngAfterViewInit(){this.invoiceJSONArr&&this.invoiceJSONArr.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadInvoicesTable(this.invoiceJSONArr)}openCreateInvoiceModal(){this.store.dispatch((0,Z.qR)({payload:{data:{pageSize:this.pageSize,component:_t}}}))}onAddInvoice(n){if(!this.description)return!0;const e=this.expiry?this.expiry:3600;this.newlyAddedInvoiceMemo="ulbl"+Math.random().toString(36).slice(2)+Date.now(),this.newlyAddedInvoiceValue=this.invoiceValue;let a=null;a=this.invoiceValue?{description:this.description,expireIn:e,amountMsat:1e3*this.invoiceValue}:{description:this.description,expireIn:e},this.store.dispatch((0,P.Z$)({payload:a})),this.resetData()}onInvoiceClick(n){this.store.dispatch((0,Z.qR)({payload:{data:{invoice:n,newlyAdded:!1,component:vi.R}}}))}onRefreshInvoice(n){this.store.dispatch((0,P.n7)({payload:n.paymentHash}))}updateInvoicesData(n){this.invoiceJSONArr=this.invoiceJSONArr?.map(e=>e.paymentHash===n.paymentHash?n:e)}applyFilter(){this.invoices.filter=this.selFilter.trim().toLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):this.commonService.titleCase(n)}setFilterPredicate(){this.invoices.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=(n.timestamp?this.datePipe.transform(new Date(1e3*n.timestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(n).toLowerCase();break;case"status":a=n?.status&&"expired"!==n?.status&&"unknown"!==n?.status?n.status?.toLowerCase():"expired/unknown";break;case"timestamp":case"expiresAt":case"receivedAt":a=this.datePipe.transform(new Date(1e3*(n[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"amount":case"amountSettled":a=n[this.selFilterBy]?.toString()||"-";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return"status"===this.selFilterBy?0===a.indexOf(e):a.includes(e)}}loadInvoicesTable(n){this.invoices=n?new r.by([...n]):new r.by([]),this.invoices.sortingDataAccessor=(e,a)=>e[a]&&isNaN(e[a])?e[a].toLocaleLowerCase():e[a]?+e[a]:null,this.invoices.sort=this.sort,this.invoices.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.invoices.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}resetData(){this.description="",this.invoiceValue=null,this.expiry=null,this.invoiceValueHint=""}onInvoiceValueChange(){this.selNode&&this.selNode.fiatConversion&&this.invoiceValue&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,s.NT.SATS,s.NT.OTHER,this.selNode.currencyUnits&&this.selNode.currencyUnits.length>2?this.selNode.currencyUnits[2]:"",this.selNode.fiatConversion).pipe((0,h.R)(this.unSubs[5])).subscribe({next:n=>{this.invoiceValueHint="= "+n.symbol+this.decimalPipe.transform(n.OTHER,s.Xz.OTHER)+" "+n.unit},error:n=>{this.invoiceValueHint="Conversion Error: "+n}}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||et)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(c.JJ),t.Y36(O.v),t.Y36(c.uU),t.Y36(G.eX),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:et,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(e,a){if(1&e&&(t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Invoices")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","space-between stretch"],["matInput","","placeholder","Description","tabindex","2","name","description","required","true",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","3","name","invValue",3,"step","min","ngModel","ngModelChange","keyup"],["invcVal","ngModel"],["matSuffix",""],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","9","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","10",3,"click"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","8",3,"click"],["fxLayout","column","fxLayoutAlign","start stretch"],["fxLayout","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-1"],["fxFlex","70","fxLayoutAlign","start start","fxLayoutAlign.gt-sm","start center"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","status"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","expiresAt"],["matColumnDef","receivedAt"],["matColumnDef","nodeId"],["matColumnDef","description"],["matColumnDef","paymentHash"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountSettled"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","p1-3",4,"matHeaderCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Status"],["mat-cell",""],["class","dot green","matTooltip","Received","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unpaid","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Expired/Unknown","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Received","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Unpaid","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],["matTooltip","Expired/Unknown","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"p1-3"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cellcolspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Si,17,6,"form",1),t.YNc(2,Zi,3,0,"div",2),t.YNc(3,ca,52,17,"div",3),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf","home"===a.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===a.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===a.calledFrom))},dependencies:[c.mk,c.sg,c.O5,c.PC,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,q.lW,x.TO,x.KE,x.bx,x.R9,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,V.gM,S.NW,Q.$V,$.q,c.JJ,c.uU],styles:[".mat-column-status[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]})}function ua(i,n){if(1&i&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&i){t.oxw();const e=t.MAs(11);t.Q6J("matMenuTriggerFor",e)}}function pa(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const l=t.CHM(e).index,m=t.oxw().$implicit,y=t.oxw(2);return t.KtG(y.onNavigateTo(m.links[l]))}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit;t.xp6(1),t.Oqu(e)}}function ma(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(3);return t.KtG(o.onsortChannelsBy())}),t._uU(1),t.qZA()}if(2&i){const e=t.oxw(3);t.xp6(1),t.hij("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score","")}}function da(i,n){1&i&&t._UZ(0,"mat-progress-bar",28)}function ha(i,n){if(1&i&&t._UZ(0,"rtl-ecl-node-info",29),2&i){const e=t.oxw(3);t.Q6J("information",e.information)("showColorFieldSeparately",!1)}}function _a(i,n){if(1&i&&t._UZ(0,"rtl-ecl-balances-info",30),2&i){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function ga(i,n){if(1&i&&t._UZ(0,"rtl-ecl-channel-capacity-info",31),2&i){const e=t.oxw(3);t.Q6J("sortBy",e.sortField)("channelBalances",e.channelBalances)("allChannels",e.allChannelsCapacity)("errorMessage",e.errorMessages[2])}}function fa(i,n){if(1&i&&t._UZ(0,"rtl-ecl-fee-info",32),2&i){const e=t.oxw(3);t.Q6J("fees",e.fees)("errorMessage",e.errorMessages[1])}}function Ca(i,n){if(1&i&&t._UZ(0,"rtl-ecl-channel-status-info",33),2&i){const e=t.oxw(3);t.Q6J("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[2])}}function xa(i,n){1&i&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const ie=function(i){return{"dashboard-card-content":!0,"error-border":i}};function ya(i,n){if(1&i&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",9)(2,"mat-card-header")(3,"mat-card-title",10)(4,"div"),t._UZ(5,"fa-icon",11),t.TgZ(6,"span"),t._uU(7),t.qZA()(),t.TgZ(8,"div"),t.YNc(9,ua,3,1,"button",12),t.TgZ(10,"mat-menu",13,14),t.YNc(12,pa,2,1,"button",15),t.YNc(13,ma,2,1,"button",16),t.qZA()()()(),t.TgZ(14,"mat-card-content",17),t.YNc(15,da,1,0,"mat-progress-bar",18),t.TgZ(16,"div",19),t.YNc(17,ha,1,2,"rtl-ecl-node-info",20),t.YNc(18,_a,1,2,"rtl-ecl-balances-info",21),t.YNc(19,ga,1,4,"rtl-ecl-channel-capacity-info",22),t.YNc(20,fa,1,2,"rtl-ecl-fee-info",23),t.YNc(21,Ca,1,2,"rtl-ecl-channel-status-info",24),t.YNc(22,xa,2,0,"h3",25),t.qZA()()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(5),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions),t.xp6(1),t.Q6J("ngIf","capacity"===e.id),t.xp6(1),t.s9C("fxFlex","capacity"===e.id?90:70),t.Q6J("ngClass",t.VKq(16,ie,"node"===e.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.ERROR||"balance"===e.id&&(a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.ERROR||a.apiCallStatusOCBal.status===a.apiCallStatusEnum.ERROR)||("capacity"===e.id||"status"===e.id)&&a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.ERROR||"fee"===e.id&&a.apiCallStatusFees.status===a.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.INITIATED||"balance"===e.id&&(a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.INITIATED||a.apiCallStatusOCBal.status===a.apiCallStatusEnum.INITIATED)||("capacity"===e.id||"status"===e.id)&&a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.INITIATED||"fee"===e.id&&a.apiCallStatusFees.status===a.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","capacity"),t.xp6(1),t.Q6J("ngSwitchCase","fee"),t.xp6(1),t.Q6J("ngSwitchCase","status")}}function Ta(i,n){if(1&i&&(t.TgZ(0,"div",2)(1,"div",3),t._UZ(2,"fa-icon",4),t.TgZ(3,"span",5),t._uU(4),t.qZA()(),t.TgZ(5,"mat-grid-list",6),t.YNc(6,ya,23,18,"mat-grid-tile",7),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Q6J("icon",e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.ERROR?e.faFrown:e.faSmile),t.xp6(2),t.Oqu(e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.COMPLETED?"Welcome "+e.information.alias+"! Your node is up and running.":e.apiCallStatusNodeInfo.status===e.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),t.xp6(1),t.Q6J("rowHeight",e.operatorCardHeight),t.xp6(1),t.Q6J("ngForOf",e.operatorCards)}}function ba(i,n){if(1&i&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()()),2&i){t.oxw();const e=t.MAs(9);t.Q6J("matMenuTriggerFor",e)}}function va(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const l=t.CHM(e).index,m=t.oxw(2).$implicit,y=t.oxw(2);return t.KtG(y.onNavigateTo(m.links[l]))}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit;t.xp6(1),t.Oqu(e)}}function La(i,n){if(1&i&&(t.TgZ(0,"mat-card-header")(1,"mat-card-title",10)(2,"div"),t._UZ(3,"fa-icon",11),t.TgZ(4,"span"),t._uU(5),t.qZA()(),t.TgZ(6,"div"),t.YNc(7,ba,3,1,"button",12),t.TgZ(8,"mat-menu",13,42),t.YNc(10,va,2,1,"button",15),t.qZA()()()()),2&i){const e=t.oxw().$implicit;t.xp6(3),t.Q6J("icon",e.icon),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.links[0]),t.xp6(3),t.Q6J("ngForOf",e.goToOptions)}}function Sa(i,n){1&i&&t._UZ(0,"mat-progress-bar",28)}function Za(i,n){if(1&i&&t._UZ(0,"rtl-ecl-node-info",43),2&i){const e=t.oxw(3);t.Q6J("information",e.information)}}function Aa(i,n){if(1&i&&t._UZ(0,"rtl-ecl-balances-info",30),2&i){const e=t.oxw(3);t.Q6J("balances",e.balances)("errorMessage",e.errorMessages[2]+" "+e.errorMessages[3])}}function Ea(i,n){if(1&i&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&i){const e=t.oxw(3);t.Q6J("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("errorMessage",e.errorMessages[2])}}function wa(i,n){if(1&i&&t._UZ(0,"rtl-ecl-channel-liquidity-info",44),2&i){const e=t.oxw(3);t.Q6J("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("errorMessage",e.errorMessages[2])}}function Ia(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const l=t.CHM(e).index,m=t.oxw(3).$implicit,y=t.oxw(2);return t.KtG(y.onNavigateTo(m.links[l]))}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit;t.xp6(1),t.Oqu(e)}}function Fa(i,n){if(1&i&&(t.TgZ(0,"button",26)(1,"mat-icon"),t._uU(2,"more_vert"),t.qZA()(),t.TgZ(3,"mat-menu",13,53),t.YNc(5,Ia,2,1,"button",15),t.qZA()),2&i){const e=t.MAs(4),a=t.oxw(2).$implicit;t.Q6J("matMenuTriggerFor",e),t.xp6(5),t.Q6J("ngForOf",a.goToOptions)}}function qa(i,n){1&i&&(t.TgZ(0,"span",45)(1,"mat-tab-group",46)(2,"mat-tab",47),t._UZ(3,"rtl-ecl-lightning-invoices",48),t.qZA(),t.TgZ(4,"mat-tab",49),t._UZ(5,"rtl-ecl-lightning-payments",50),t.qZA(),t.TgZ(6,"mat-tab",51),t.YNc(7,Fa,6,2,"ng-template",52),t.qZA()()()),2&i&&(t.xp6(3),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("calledFrom","home"),t.xp6(1),t.Q6J("disabled",!0))}function Na(i,n){1&i&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const Oa=function(i){return{"p-0":i}};function Pa(i,n){if(1&i&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",36),t.YNc(2,La,11,4,"mat-card-header",37),t.TgZ(3,"mat-card-content",38),t.YNc(4,Sa,1,0,"mat-progress-bar",18),t.TgZ(5,"div",19),t.YNc(6,Za,1,1,"rtl-ecl-node-info",39),t.YNc(7,Aa,1,2,"rtl-ecl-balances-info",21),t.YNc(8,Ea,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(9,wa,1,4,"rtl-ecl-channel-liquidity-info",40),t.YNc(10,qa,8,3,"span",41),t.YNc(11,Na,2,0,"h3",25),t.qZA()()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.Q6J("colspan",e.cols)("rowspan",e.rows),t.xp6(1),t.Q6J("ngClass",t.VKq(13,Oa,"transactions"===e.id)),t.xp6(1),t.Q6J("ngIf","transactions"!==e.id),t.xp6(1),t.s9C("fxFlex","transactions"===e.id?100:"balance"===e.id?70:90),t.Q6J("ngClass",t.VKq(15,ie,"node"===e.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.ERROR||"balance"===e.id&&(a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.ERROR||a.apiCallStatusOCBal.status===a.apiCallStatusEnum.ERROR)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.ERROR)),t.xp6(1),t.Q6J("ngIf","node"===e.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.INITIATED||"balance"===e.id&&(a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.INITIATED||a.apiCallStatusOCBal.status===a.apiCallStatusEnum.INITIATED)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&a.apiCallStatusAllChannels.status===a.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngSwitch",e.id),t.xp6(1),t.Q6J("ngSwitchCase","node"),t.xp6(1),t.Q6J("ngSwitchCase","balance"),t.xp6(1),t.Q6J("ngSwitchCase","inboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","outboundLiq"),t.xp6(1),t.Q6J("ngSwitchCase","transactions")}}function Ua(i,n){if(1&i&&(t.TgZ(0,"div",34),t._UZ(1,"fa-icon",4),t.TgZ(2,"span",5),t._uU(3),t.qZA()(),t.TgZ(4,"mat-grid-list",35),t.YNc(5,Pa,12,17,"mat-grid-tile",7),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faSmile),t.xp6(2),t.hij("Welcome ",e.information.alias,"! Your node is up and running."),t.xp6(1),t.Q6J("rowHeight",e.merchantCardHeight),t.xp6(1),t.Q6J("ngForOf",e.merchantCards)}}class gt{constructor(n,e,a,o){this.logger=n,this.store=e,this.commonService=a,this.router=o,this.faSmile=Xt.ctA,this.faFrown=Xt.KfU,this.faAngleDoubleDown=T.Sbq,this.faAngleDoubleUp=T.Vfw,this.faChartPie=T.OS1,this.faBolt=T.BDt,this.faServer=T.xf3,this.faNetworkWired=T.kXW,this.userPersonaEnum=s.ol,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.selNode={},this.information={},this.channels=[],this.onchainBalance={},this.balances={onchain:-1,lightning:-1,total:0},this.channelsStatus={},this.allChannelsCapacity=[],this.allInboundChannels=[],this.allOutboundChannels=[],this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="405px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.errorMessages=["","","",""],this.apiCallStatusNodeInfo={status:s.Bn.COMPLETED},this.apiCallStatusFees={status:s.Bn.COMPLETED},this.apiCallStatusOCBal={status:s.Bn.COMPLETED},this.apiCallStatusAllChannels={status:s.Bn.COMPLETED},this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===s.cu.XS?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:6,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}]):this.screenSize===s.cu.SM||this.screenSize===s.cu.MD?(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:3,rows:4},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}]):(this.operatorCards=[{id:"node",goToOptions:[],links:[],icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goToOptions:["Channels"],links:["connections"],icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goToOptions:["Routing","Fees Summary"],links:["routing","reports"],icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goToOptions:["Channels","Inactive Channels"],links:["connections","connections/channels/inactive"],icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goToOptions:["On-Chain"],links:["onchain"],icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goToOptions:["Channels"],links:["connections"],icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goToOptions:["Transactions","Transactions Summary"],links:["transactions","reports/transactions"],title:"",cols:2,rows:5}])}ngOnInit(){this.store.select(g.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.selNode=n}),this.store.select(g.T$).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.errorMessages[0]="",this.apiCallStatusNodeInfo=n.apiCallStatus,this.apiCallStatusNodeInfo.status===s.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message?this.apiCallStatusNodeInfo.message:""),this.information=n.information}),this.store.select(g.JG).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.errorMessages[1]="",this.apiCallStatusFees=n.apiCallStatus,this.apiCallStatusFees.status===s.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apiCallStatusFees.message?JSON.stringify(this.apiCallStatusFees.message):this.apiCallStatusFees.message?this.apiCallStatusFees.message:""),this.fees=n.fees}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[3]),(0,Mt.M)(this.store.select(g.kY))).subscribe(([n,e])=>{this.errorMessages[2]="",this.errorMessages[3]="",this.apiCallStatusAllChannels=n.apiCallStatus,this.apiCallStatusOCBal=e.apiCallStatus,this.apiCallStatusAllChannels.status===s.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apiCallStatusAllChannels.message?JSON.stringify(this.apiCallStatusAllChannels.message):this.apiCallStatusAllChannels.message?this.apiCallStatusAllChannels.message:""),this.apiCallStatusOCBal.status===s.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusOCBal.message?JSON.stringify(this.apiCallStatusOCBal.message):this.apiCallStatusOCBal.message?this.apiCallStatusOCBal.message:""),this.channels=n.activeChannels,this.onchainBalance=e.onchainBalance,this.balances.onchain=this.onchainBalance.total||0,this.balances.lightning=n.lightningBalance.localBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances);const a=n.lightningBalance.localBalance?+n.lightningBalance.localBalance:0,o=n.lightningBalance.remoteBalance?+n.lightningBalance.remoteBalance:0,l=a+o;this.channelBalances={localBalance:a,remoteBalance:o,balancedness:+(1-Math.abs((a-o)/l)).toFixed(3)},this.channelsStatus=n.channelsStatus,this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))),this.allInboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels?.filter(m=>(m.toRemote||0)>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels?.filter(m=>(m.toLocal||0)>0),"toLocal"))),this.channels.forEach(m=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(m.toRemote||0),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(m.toLocal||0)}),this.logger.info(n)})}onNavigateTo(n){this.router.navigateByUrl("/ecl/"+n)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.channels.sort((n,e)=>{const a=+(n.toLocal||0)+ +(n.toRemote||0),o=+(e.toLocal||0)+ +(e.toRemote||0);return a>o?-1:a<o?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||gt)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(O.v),t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:gt,selectors:[["rtl-ecl-home"]],decls:3,vars:2,consts:[["fxLayout","column",4,"ngIf","ngIfElse"],["merchantDashboard",""],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-2"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan",4,"ngFor","ngForOf"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card"],["fxLayoutAlign","space-between center"],[1,"mr-1",3,"icon"],["mat-icon-button","","class","more-button","aria-label","Toggle menu",3,"matMenuTriggerFor",4,"ngIf"],["xPosition","before",1,"dashboard-vert-menu"],["menuOperator","matMenu"],["mat-menu-item","",3,"click",4,"ngFor","ngForOf"],["mat-menu-item","",3,"click",4,"ngIf"],["fxLayout","column",3,"fxFlex","ngClass"],["mode","indeterminate",4,"ngIf"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately",4,"ngSwitchCase"],["fxFlex","100",3,"balances","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"fees","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","errorMessage",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["mat-icon-button","","aria-label","Toggle menu",1,"more-button",3,"matMenuTriggerFor"],["mat-menu-item","",3,"click"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"balances","errorMessage"],["fxFlex","100",3,"sortBy","channelBalances","allChannels","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container","mb-2"],["cols","6","gutterSize","20px",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",3,"fxFlex","ngClass"],["fxFlex","100",3,"information",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between start"],["fxLayout","column",1,"w-100","dashboard-tabs-group"],["label","Receive"],[1,"h-100",3,"calledFrom"],["label","Pay"],[3,"calledFrom"],[3,"disabled"],["mat-tab-label",""],["menuTransactions","matMenu"]],template:function(e,a){if(1&e&&(t.YNc(0,Ta,7,4,"div",0),t.YNc(1,Ua,6,4,"ng-template",null,1,t.W1O)),2&e){const o=t.MAs(2);t.Q6J("ngIf",(null==a.selNode?null:a.selNode.userPersona)===a.userPersonaEnum.OPERATOR)("ngIfElse",o)}},dependencies:[c.mk,c.sg,c.O5,c.RF,c.n9,c.ED,F.BN,p.xw,p.Wh,p.yH,L.oO,q.lW,b.a8,b.dk,b.dn,b.n5,jt.Il,jt.DX,te.Hw,Qt.VK,Qt.OP,Qt.p6,R.pW,E.SP,E.uD,E.uX,st,lt,rt,ct,ut,pt,tt,et]})}var ka=_(8377);const Da=["form"];function Ra(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Bitcoin address is required."),t.qZA())}function Ja(i,n){if(1&i&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Oqu(e.amountError)}}function Ma(i,n){if(1&i&&(t.TgZ(0,"mat-option",29),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e)}}function Qa(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Target Confirmation Blocks is required."),t.qZA())}function Ya(i,n){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.sendFundError)}}function Ba(i,n){if(1&i&&(t.TgZ(0,"div",30),t._UZ(1,"fa-icon",31),t.YNc(2,Ya,2,1,"span",12),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.sendFundError)}}class nt{constructor(n,e,a,o,l,m){this.dialogRef=n,this.logger=e,this.store=a,this.commonService=o,this.decimalPipe=l,this.actions=m,this.faExclamationTriangle=T.eHv,this.selNode={},this.addressTypes=[],this.selectedAddress=s._t[1],this.blockchainBalance={},this.information={},this.newAddress="",this.transaction={},this.sendFundError="",this.fiatConversion=!1,this.amountUnits=s.uA,this.selAmountUnit=s.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=s.Xz,this.amountError="Amount is Required.",this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x]}ngOnInit(){this.store.select(ka.dT).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.fiatConversion=n.settings.fiatConversion,this.amountUnits=n.settings.currencyUnits,this.logger.info(n)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,J.h)(n=>n.type===s.lr.UPDATE_API_CALL_STATUS_ECL||n.type===s.lr.SEND_ONCHAIN_FUNDS_RES_ECL)).subscribe(n=>{n.type===s.lr.SEND_ONCHAIN_FUNDS_RES_ECL&&(this.store.dispatch((0,Z.jW)({payload:"Fund Sent Successfully!"})),this.dialogRef.close()),n.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&n.payload.status===s.Bn.ERROR&&"SendOnchainFunds"===n.payload.action&&(this.sendFundError=n.payload.message)})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="",this.transaction.amount&&this.selAmountUnit!==s.NT.SATS?this.commonService.convertCurrency(this.transaction.amount,this.selAmountUnit===this.amountUnits[2]?s.NT.OTHER:this.selAmountUnit,s.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,h.R)(this.unSubs[2])).subscribe({next:n=>{this.transaction.amount=parseInt(n[s.NT.SATS]),this.selAmountUnit=s.NT.SATS,this.store.dispatch((0,P.Iy)({payload:this.transaction}))},error:n=>{this.selAmountUnit=s.NT.SATS,this.amountError="Conversion Error: "+n}}):this.store.dispatch((0,P.Iy)({payload:this.transaction}))}get invalidValues(){return!this.transaction.address||""===this.transaction.address||!this.transaction.amount||this.transaction.amount<=0||!this.transaction.blocks||this.transaction.blocks<=0}resetData(){this.sendFundError="",this.transaction={}}onAmountUnitChange(n){const e=this,a=this.selAmountUnit===this.amountUnits[2]?s.NT.OTHER:this.selAmountUnit;let o=n.value===this.amountUnits[2]?s.NT.OTHER:n.value;this.transaction.amount&&this.selAmountUnit!==n.value&&this.commonService.convertCurrency(this.transaction.amount,a,o,this.amountUnits[2],this.fiatConversion).pipe((0,h.R)(this.unSubs[3])).subscribe({next:l=>{this.selAmountUnit=n.value,e.transaction.amount=+e.decimalPipe.transform(l[o],e.currencyUnitFormats[o]).replace(/,/g,"")},error:l=>{this.amountError="Conversion Error: "+l,this.selAmountUnit=a,o=a}})}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||nt)(t.Y36(D.so),t.Y36(N.mQ),t.Y36(A.yh),t.Y36(O.v),t.Y36(c.JJ),t.Y36(G.eX))};static#e=this.\u0275cmp=t.Xpm({type:nt,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(e,a){if(1&e&&t.Gf(Da,7),2&e){let o;t.iGM(o=t.CRH())&&(a.form=o.first)}},decls:36,vars:15,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between start",1,"overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex","55"],["matInput","","autoFocus","","placeholder","Bitcoin Address","tabindex","1","name","addr","required","",3,"ngModel","ngModelChange"],["addrs","ngModel"],[4,"ngIf"],["fxFlex","30"],["matInput","","placeholder","Amount","name","amt","type","number","tabindex","2","required","",3,"step","min","ngModel","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxFlex","10","fxLayoutAlign","start end"],["tabindex","3","required","","name","amountUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","60","fxLayoutAlign","space-between stretch","fxLayout","row wrap"],["fxFlex","48","fxLayout","row","fxLayoutAlign","start center"],["matInput","","placeholder","Target Confirmation Blocks","type","number","name","blocks","tabindex","8","required","true",3,"step","min","ngModel","ngModelChange"],["blocks","ngModel"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-button","","color","primary","type","submit","tabindex","8"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Send Payment"),t.qZA()(),t.TgZ(6,"button",5),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return a.onSendFunds()})("reset",function(){return a.resetData()}),t.TgZ(11,"mat-form-field",9)(12,"input",10,11),t.NdJ("ngModelChange",function(l){return a.transaction.address=l}),t.qZA(),t.YNc(14,Ra,2,0,"mat-error",12),t.qZA(),t.TgZ(15,"mat-form-field",13)(16,"input",14,15),t.NdJ("ngModelChange",function(l){return a.transaction.amount=l}),t.qZA(),t.TgZ(18,"span",16),t._uU(19),t.qZA(),t.YNc(20,Ja,2,1,"mat-error",12),t.qZA(),t.TgZ(21,"mat-form-field",17)(22,"mat-select",18),t.NdJ("selectionChange",function(l){return a.onAmountUnitChange(l)}),t.YNc(23,Ma,2,2,"mat-option",19),t.qZA()(),t.TgZ(24,"div",20)(25,"mat-form-field",21)(26,"input",22,23),t.NdJ("ngModelChange",function(l){return a.transaction.blocks=l}),t.qZA(),t.YNc(28,Qa,2,0,"mat-error",12),t.qZA()(),t._UZ(29,"div",24),t.YNc(30,Ba,3,2,"div",25),t.TgZ(31,"div",26)(32,"button",27),t._uU(33,"Clear Fields"),t.qZA(),t.TgZ(34,"button",28),t._uU(35,"Send Funds"),t.qZA()()()()()()),2&e&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(6),t.Q6J("ngModel",a.transaction.address),t.xp6(2),t.Q6J("ngIf",!a.transaction.address),t.xp6(2),t.Q6J("step",100)("min",0)("ngModel",a.transaction.amount),t.xp6(3),t.hij("",a.selAmountUnit," "),t.xp6(1),t.Q6J("ngIf",!a.transaction.amount),t.xp6(2),t.Q6J("value",a.selAmountUnit),t.xp6(1),t.Q6J("ngForOf",a.amountUnits),t.xp6(3),t.Q6J("step",1)("min",0)("ngModel",a.transaction.blocks),t.xp6(2),t.Q6J("ngIf",!a.transaction.blocks),t.xp6(2),t.Q6J("ngIf",""!==a.sendFundError))},dependencies:[c.sg,c.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,F.BN,p.xw,p.Wh,p.yH,D.ZT,q.lW,b.dk,b.dn,x.TO,x.KE,x.R9,M.Nt,U.gD,B.ey,W.h,$.q]})}var zt=_(9637);function Ha(i,n){if(1&i&&(t.TgZ(0,"mat-option",34),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}function za(i,n){1&i&&t._UZ(0,"mat-progress-bar",35)}function Va(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Date/Time"),t.qZA())}function Ga(i,n){if(1&i&&(t.TgZ(0,"td",37),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(t.xi3(2,1,1e3*(null==e?null:e.timestamp),"dd/MMM/y HH:mm"))}}function Ka(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Address"),t.qZA())}const Vt=function(i){return{width:i}};function Wa(i,n){if(1&i&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Vt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.address)}}function $a(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Blockhash"),t.qZA())}function Xa(i,n){if(1&i&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Vt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.blockHash)}}function ja(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Transaction ID"),t.qZA())}function to(i,n){if(1&i&&(t.TgZ(0,"td",37)(1,"div",38)(2,"span",39),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Vt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.txid)}}function eo(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1,"Amount (Sats)"),t.qZA())}function no(i,n){if(1&i&&(t.TgZ(0,"span",43),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.amount))}}function io(i,n){if(1&i&&(t.TgZ(0,"span",44),t._uU(1),t.ALo(2,"number"),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.hij("(",t.lcZ(2,1,-1*(null==e?null:e.amount)),")")}}function ao(i,n){if(1&i&&(t.TgZ(0,"td",37),t.YNc(1,no,3,3,"span",41),t.YNc(2,io,3,3,"span",42),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)>0||0===(null==e?null:e.amount)),t.xp6(1),t.Q6J("ngIf",(null==e?null:e.amount)<0)}}function oo(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1,"Fees (Sats)"),t.qZA())}function so(i,n){if(1&i&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.fees))}}function lo(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1,"Confirmations"),t.qZA())}function ro(i,n){if(1&i&&(t.TgZ(0,"td",37)(1,"span",43),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.lcZ(3,1,null==e?null:e.confirmations)," ")}}function co(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",45)(1,"div",46)(2,"mat-select",47),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",48),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function uo(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",49)(1,"button",50),t.NdJ("click",function(o){const m=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onTransactionClick(m,o))}),t._uU(2,"View Info"),t.qZA()()}}function po(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No transaction available."),t.qZA())}function mo(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting transactions..."),t.qZA())}function ho(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function _o(i,n){if(1&i&&(t.TgZ(0,"td",51),t.YNc(1,po,2,0,"p",52),t.YNc(2,mo,2,0,"p",52),t.YNc(3,ho,2,1,"p",52),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const go=function(i){return{"display-none":i}};function fo(i,n){if(1&i&&t._UZ(0,"tr",53),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,go,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function Co(i,n){1&i&&t._UZ(0,"tr",54)}function xo(i,n){1&i&&t._UZ(0,"tr",55)}const yo=function(){return["all"]},To=function(i){return{"error-border":i}},bo=function(){return["no_transaction"]};class ft{constructor(n,e,a,o,l){this.logger=n,this.commonService=e,this.store=a,this.datePipe=o,this.camelCaseWithSpaces=l,this.faHistory=T.qO$,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="on_chain",this.tableSetting={tableId:"transaction",recordsPerPage:s.IV,sortBy:"timestamp",sortOrder:s.Pi.DESCENDING},this.displayedColumns=[],this.listTransactions=new r.by([]),this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch((0,P.mC)()),this.store.select(g.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.dx).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),n.transactions&&this.loadTransactionsTable(n.transactions),this.logger.info(n)})}applyFilter(){this.listTransactions.filter=this.selFilter.trim().toLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):this.commonService.titleCase(n)}setFilterPredicate(){this.listTransactions.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=(n.timestamp?this.datePipe.transform(new Date(1e3*n.timestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(n).toLowerCase();break;case"timestamp":a=this.datePipe.transform(new Date(1e3*(n[this.selFilterBy]||0)),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return a.includes(e)}}onTransactionClick(n,e){const a=[[{key:"blockHash",value:n.blockHash,title:"Block Hash",width:100}],[{key:"txid",value:n.txid,title:"Transaction ID",width:100}],[{key:"timestamp",value:n.timestamp,title:"Date/Time",width:50,type:s.Gi.DATE_TIME},{key:"confirmations",value:n.confirmations,title:"Number of Confirmations",width:50,type:s.Gi.NUMBER}],[{key:"fees",value:n.fees,title:"Fees (Sats)",width:50,type:s.Gi.NUMBER},{key:"amount",value:n.amount,title:"Amount (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"address",value:n.address,title:"Address",width:100,type:s.Gi.STRING}]];this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Transaction Information",message:a}}}))}loadTransactionsTable(n){this.listTransactions=new r.by([...n]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(e,a)=>e[a]&&isNaN(e[a])?e[a].toLocaleLowerCase():e[a]?+e[a]:null,this.listTransactions.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.listTransactions.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.listTransactions)}onDownloadCSV(){this.listTransactions.data&&this.listTransactions.data.length>0&&this.commonService.downloadFile(this.listTransactions.data,"Transactions")}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||ft)(t.Y36(N.mQ),t.Y36(O.v),t.Y36(A.yh),t.Y36(c.uU),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:ft,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(e,a){if(1&e&&(t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Transactions")}])],decls:47,vars:17,consts:[["fxLayout","row wrap","fxLayoutAlign","start start","fxLayout.gt-sm","column","fxFlex","100","fxLayoutAlign.gt-sm","start stretch"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","address"],["matColumnDef","blockHash"],["matColumnDef","txid"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","fees"],["matColumnDef","confirmations"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_transaction"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",4,"ngIf"],["fxLayoutAlign","end center","class","red",4,"ngIf"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",1,"red"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cellcolspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"fa-icon",3),t.TgZ(4,"span",4),t._uU(5,"Transaction History"),t.qZA()(),t.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-select",7),t.NdJ("ngModelChange",function(l){return a.selFilterBy=l})("selectionChange",function(){return a.selFilter="",a.applyFilter()}),t.YNc(9,Ha,2,2,"mat-option",8),t.qZA()(),t.TgZ(10,"mat-form-field",6)(11,"input",9),t.NdJ("ngModelChange",function(l){return a.selFilter=l})("input",function(){return a.applyFilter()})("keyup",function(){return a.applyFilter()}),t.qZA()()()(),t.TgZ(12,"div",10)(13,"div",11),t.YNc(14,za,1,0,"mat-progress-bar",12),t.TgZ(15,"table",13,14),t.ynx(17,15),t.YNc(18,Va,2,0,"th",16),t.YNc(19,Ga,3,4,"td",17),t.BQk(),t.ynx(20,18),t.YNc(21,Ka,2,0,"th",16),t.YNc(22,Wa,4,4,"td",17),t.BQk(),t.ynx(23,19),t.YNc(24,$a,2,0,"th",16),t.YNc(25,Xa,4,4,"td",17),t.BQk(),t.ynx(26,20),t.YNc(27,ja,2,0,"th",16),t.YNc(28,to,4,4,"td",17),t.BQk(),t.ynx(29,21),t.YNc(30,eo,2,0,"th",22),t.YNc(31,ao,3,2,"td",17),t.BQk(),t.ynx(32,23),t.YNc(33,oo,2,0,"th",22),t.YNc(34,so,4,3,"td",17),t.BQk(),t.ynx(35,24),t.YNc(36,lo,2,0,"th",22),t.YNc(37,ro,4,3,"td",17),t.BQk(),t.ynx(38,25),t.YNc(39,co,6,0,"th",26),t.YNc(40,uo,3,0,"td",27),t.BQk(),t.ynx(41,28),t.YNc(42,_o,4,3,"td",29),t.BQk(),t.YNc(43,fo,1,3,"tr",30),t.YNc(44,Co,1,0,"tr",31),t.YNc(45,xo,1,0,"tr",32),t.qZA(),t._UZ(46,"mat-paginator",33),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("icon",a.faHistory),t.xp6(5),t.Q6J("ngModel",a.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,yo).concat(a.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",a.selFilter),t.xp6(3),t.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",a.listTransactions)("ngClass",t.VKq(14,To,""!==a.errorMessage)),t.xp6(28),t.Q6J("matFooterRowDef",t.DdM(16,bo)),t.xp6(1),t.Q6J("matHeaderRowDef",a.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",a.displayedColumns),t.xp6(1),t.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},dependencies:[c.mk,c.sg,c.O5,c.PC,d.Fj,d.JJ,d.On,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,q.lW,x.KE,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,S.NW,Q.$V,c.JJ,c.uU]})}function vo(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",13),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit,a=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",a.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}class Ct{constructor(n,e){this.store=n,this.router=e,this.selNode={},this.faExchangeAlt=T.Ssp,this.faChartPie=T.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"receive",name:"Receive"},{link:"send",name:"Send"}],this.activeLink=this.links[0].link,this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){const n=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=n?n.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(e=>e instanceof C.Av)).subscribe({next:e=>{const a=this.links.find(o=>e.urlAfterRedirects.includes(o.link));this.activeLink=a?a.link:this.links[0].link}}),this.store.select(g.LR).pipe((0,h.R)(this.unSubs[1])).subscribe(e=>{this.selNode=e}),this.store.select(g.kY).pipe((0,h.R)(this.unSubs[2])).subscribe(e=>{this.balances=[{title:"Total Balance",dataValue:e.onchainBalance.total||0},{title:"Confirmed",dataValue:e.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:e.onchainBalance.unconfirmed||0}]})}openSendFundsModal(){this.store.dispatch((0,Z.qR)({payload:{data:{component:nt}}}))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Ct)(t.Y36(A.yh),t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:Ct,selectors:[["rtl-ecl-on-chain"]],decls:23,vars:5,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar","",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large","mt-2"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row","fxFlex","100"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"On-chain Transactions"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",7),t.YNc(16,vo,2,3,"div",8),t.qZA(),t._UZ(17,"mat-tab-nav-panel",null,9),t.TgZ(19,"div",10),t._UZ(20,"router-outlet"),t.qZA(),t.TgZ(21,"div",11),t._UZ(22,"rtl-ecl-on-chain-transaction-history",12),t.qZA()()()()),2&e){const o=t.MAs(18);t.xp6(1),t.Q6J("icon",a.faChartPie),t.xp6(6),t.Q6J("values",a.balances),t.xp6(2),t.Q6J("icon",a.faExchangeAlt),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",a.links)}},dependencies:[c.sg,F.BN,p.xw,p.Wh,p.yH,b.a8,b.dn,E.BU,E.sW,E.Nj,zt.D,C.lC,C.rH,ft]})}var ae=_(3335);function Lo(i,n){if(1&i&&(t.TgZ(0,"span",10),t._uU(1,"Channels"),t.qZA()),2&i){const e=t.oxw();t.s9C("matBadge",e.activeChannels)}}function So(i,n){if(1&i&&(t.TgZ(0,"span",10),t._uU(1,"Peers"),t.qZA()),2&i){const e=t.oxw();t.s9C("matBadge",e.activePeers)}}class xt{constructor(n,e){this.store=n,this.router=e,this.activePeers=0,this.activeChannels=0,this.faUsers=T.FVb,this.faChartPie=T.OS1,this.balances=[{title:"Total Balance",dataValue:0},{title:"Confirmed",dataValue:0},{title:"Unconfirmed",dataValue:0}],this.links=[{link:"channels",name:"Channels"},{link:"peers",name:"Peers"}],this.activeLink=0,this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){this.activeLink=this.links.findIndex(n=>n.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(n=>n instanceof C.Av)).subscribe({next:n=>{this.activeLink=this.links.findIndex(e=>e.link===n.urlAfterRedirects.substring(n.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(g.Bo).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.activePeers=n.peers&&n.peers.length?n.peers.length:0}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.activeChannels=n.channelsStatus&&n.channelsStatus.active&&n.channelsStatus.active.channels?n.channelsStatus.active.channels:0}),this.store.select(g.kY).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.balances=[{title:"Total Balance",dataValue:n.onchainBalance.total||0},{title:"Confirmed",dataValue:n.onchainBalance.confirmed||0},{title:"Unconfirmed",dataValue:n.onchainBalance.unconfirmed||0}]})}onSelectedTabChange(n){this.router.navigateByUrl("/ecl/connections/"+this.links[n.index].link)}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||xt)(t.Y36(A.yh),t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:xt,selectors:[["rtl-ecl-connections"]],decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"On-chain Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",0),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Connections"),t.qZA()(),t.TgZ(12,"div",6)(13,"mat-card")(14,"mat-card-content",4)(15,"mat-tab-group",7),t.NdJ("selectedIndexChange",function(l){return a.activeLink=l})("selectedTabChange",function(l){return a.onSelectedTabChange(l)}),t.TgZ(16,"mat-tab"),t.YNc(17,Lo,2,1,"ng-template",8),t.qZA(),t.TgZ(18,"mat-tab"),t.YNc(19,So,2,1,"ng-template",8),t.qZA()(),t.TgZ(20,"div",9),t._UZ(21,"router-outlet"),t.qZA()()()()),2&e&&(t.xp6(1),t.Q6J("icon",a.faChartPie),t.xp6(6),t.Q6J("values",a.balances),t.xp6(2),t.Q6J("icon",a.faUsers),t.xp6(6),t.Q6J("selectedIndex",a.activeLink))},dependencies:[F.BN,p.xw,p.Wh,p.yH,b.a8,b.dn,ae.k,E.SP,E.uD,E.uX,zt.D,C.lC]})}function Zo(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit,a=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",a.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}class yt{constructor(n,e,a){this.logger=n,this.store=e,this.router=a,this.faExchangeAlt=T.Ssp,this.faChartPie=T.OS1,this.currencyUnits=[],this.balances=[{title:"Local Capacity",dataValue:0,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:0,tooltip:"Amount you can receive"}],this.links=[{link:"payments",name:"Payments"},{link:"invoices",name:"Invoices"}],this.activeLink=this.links[0].link,this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){const n=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=n?n.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(e=>e instanceof C.Av)).subscribe({next:e=>{const a=this.links.find(o=>e.urlAfterRedirects.includes(o.link));this.activeLink=a?a.link:this.links[0].link}}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[1]),(0,Mt.M)(this.store.select(g.LR))).subscribe(([e,a])=>{this.currencyUnits=a?.currencyUnits||[],a&&a.userPersona===s.ol.OPERATOR?this.balances=[{title:"Local Capacity",dataValue:e.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:e.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}]:this.balances=[{title:"Outbound Capacity",dataValue:e.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:e.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}],this.logger.info(e)})}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||yt)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:yt,selectors:[["rtl-ecl-transactions"]],decls:21,vars:5,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],["fxLayout","column",1,"padding-gap-x"],["mat-tab-nav-bar","",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Lightning Balance"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4),t._UZ(7,"rtl-currency-unit-converter",5),t.qZA()()(),t.TgZ(8,"div",6),t._UZ(9,"fa-icon",1),t.TgZ(10,"span",2),t._uU(11,"Lightning Transactions"),t.qZA()(),t.TgZ(12,"div",7)(13,"mat-card")(14,"mat-card-content",4)(15,"nav",8),t.YNc(16,Zo,2,3,"div",9),t.qZA(),t._UZ(17,"mat-tab-nav-panel",null,10),t.TgZ(19,"div",11),t._UZ(20,"router-outlet"),t.qZA()()()()),2&e){const o=t.MAs(18);t.xp6(1),t.Q6J("icon",a.faChartPie),t.xp6(6),t.Q6J("values",a.balances),t.xp6(2),t.Q6J("icon",a.faExchangeAlt),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",a.links)}},dependencies:[c.sg,F.BN,p.xw,p.Wh,p.yH,b.a8,b.dn,E.BU,E.sW,E.Nj,zt.D,C.lC,C.rH]})}function Ao(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit,a=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",a.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}class Tt{constructor(n){this.router=n,this.faMapSigns=T.SuH,this.events=[],this.flgLoading=[!0],this.errorMessage="",this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"peers",name:"Routing Peers"}],this.activeLink=this.links[0].link,this.unSubs=[new u.x,new u.x,new u.x]}ngOnInit(){const n=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=n?n.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(e=>e instanceof C.Av)).subscribe({next:e=>{const a=this.links.find(o=>e.urlAfterRedirects.includes(o.link));this.activeLink=a?a.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Tt)(t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:Tt,selectors:[["rtl-ecl-routing"]],decls:15,vars:3,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxLayout","row","fxFlex","100"],["mat-tab-nav-bar","","fxFlex","100",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"fa-icon",2),t.TgZ(3,"span",3),t._uU(4,"Routing"),t.qZA()(),t.TgZ(5,"div",4)(6,"mat-card",5)(7,"mat-card-content",6)(8,"div",7)(9,"nav",8),t.YNc(10,Ao,2,3,"div",9),t.qZA(),t._UZ(11,"mat-tab-nav-panel",null,10),t.qZA(),t.TgZ(13,"div",11),t._UZ(14,"router-outlet"),t.qZA()()()()()),2&e){const o=t.MAs(12);t.xp6(2),t.Q6J("icon",a.faMapSigns),t.xp6(7),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",a.links)}},dependencies:[c.sg,F.BN,p.xw,p.Wh,p.yH,b.a8,b.dn,E.BU,E.sW,E.Nj,C.lC,C.rH]})}var bt=_(2922),oe=_(930),se=_(6895);function Eo(i,n){if(1&i&&(t.TgZ(0,"span",9)(1,"div"),t._uU(2),t.ALo(3,"titlecase"),t.qZA()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(2),t.AsE("",a.nodeFeaturesEnum[e.key]||e.key,": ",t.lcZ(3,2,e.value),"")}}function wo(i,n){1&i&&(t.TgZ(0,"th",23),t._uU(1,"Address"),t.qZA())}function Io(i,n){if(1&i&&(t.TgZ(0,"td",24),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(e)}}function Fo(i,n){1&i&&(t.TgZ(0,"th",25)(1,"div",26),t._uU(2,"Actions"),t.qZA()())}function qo(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",24)(1,"span",27)(2,"button",28),t.NdJ("copied",function(o){t.CHM(e);const l=t.oxw(2);return t.KtG(l.onCopyNodeURI(o))}),t._uU(3,"Copy Node URI"),t.qZA()()()}if(2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(2),t.Q6J("payload",(null==a.lookupResult?null:a.lookupResult.nodeId)+"@"+e)}}function No(i,n){1&i&&t._UZ(0,"tr",29)}function Oo(i,n){1&i&&t._UZ(0,"tr",30)}const Po=function(i){return{"background-color":i}};function Uo(i,n){if(1&i&&(t.TgZ(0,"div",1),t._UZ(1,"mat-divider",2),t.TgZ(2,"div",3)(3,"div",4)(4,"h4",5),t._uU(5,"Alias"),t.qZA(),t.TgZ(6,"span",6),t._uU(7),t.TgZ(8,"span",7),t._uU(9),t.qZA()()(),t.TgZ(10,"div",8)(11,"h4",5),t._uU(12,"Pub Key"),t.qZA(),t.TgZ(13,"span",9),t._uU(14),t.qZA()()(),t._UZ(15,"mat-divider",2),t.TgZ(16,"div",3)(17,"div",4)(18,"h4",5),t._uU(19,"Date/Time"),t.qZA(),t.TgZ(20,"span",6),t._uU(21),t.ALo(22,"date"),t.qZA()(),t.TgZ(23,"div",8)(24,"h4",5),t._uU(25,"Features"),t.qZA(),t.YNc(26,Eo,4,4,"span",10),t.ALo(27,"keyvalue"),t.qZA()(),t._UZ(28,"mat-divider",2),t.TgZ(29,"div",3)(30,"div",11)(31,"h4",5),t._uU(32,"Signature"),t.qZA(),t.TgZ(33,"span",6),t._uU(34),t.qZA()()(),t._UZ(35,"mat-divider",2),t.TgZ(36,"div",1)(37,"h4",12),t._uU(38,"Addresses"),t.qZA(),t.TgZ(39,"div",13)(40,"table",14,15),t.ynx(42,16),t.YNc(43,wo,2,0,"th",17),t.YNc(44,Io,2,1,"td",18),t.BQk(),t.ynx(45,19),t.YNc(46,Fo,3,0,"th",20),t.YNc(47,qo,4,1,"td",18),t.BQk(),t.YNc(48,No,1,0,"tr",21),t.YNc(49,Oo,1,0,"tr",22),t.qZA()()()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.alias),t.xp6(1),t.Q6J("ngStyle",t.VKq(19,Po,null==e.lookupResult?null:e.lookupResult.rgbColor)),t.xp6(1),t.Oqu(null!=e.lookupResult&&e.lookupResult.rgbColor?null==e.lookupResult?null:e.lookupResult.rgbColor:""),t.xp6(5),t.Oqu(null==e.lookupResult?null:e.lookupResult.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.xi3(22,14,1e3*(null==e.lookupResult?null:e.lookupResult.timestamp),"dd/MMM/y HH:mm")),t.xp6(5),t.Q6J("ngForOf",t.lcZ(27,17,null==e.lookupResult?null:e.lookupResult.features.activated)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(null==e.lookupResult?null:e.lookupResult.signature),t.xp6(1),t.Q6J("inset",!0),t.xp6(5),t.Q6J("dataSource",e.addresses),t.xp6(8),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}class vt{constructor(n,e){this.logger=n,this.snackBar=e,this.lookupResult={},this.addresses=new r.by([]),this.displayedColumns=["address","actions"],this.nodeFeaturesEnum=s.H_}ngOnInit(){this.addresses=this.lookupResult.addresses?new r.by([...this.lookupResult.addresses]):new r.by([]),this.addresses.data=this.lookupResult.addresses||[],this.addresses.sort=this.sort,this.addresses.sortingDataAccessor=(n,e)=>n[e]&&isNaN(n[e])?n[e].toLocaleLowerCase():n[e]?+n[e]:null}onCopyNodeURI(n){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+n)}static#t=this.\u0275fac=function(e){return new(e||vt)(t.Y36(N.mQ),t.Y36(oe.ux))};static#e=this.\u0275cmp=t.Xpm({type:vt,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(e,a){if(1&e&&t.Gf(v.YE,5),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first)}},inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column",4,"ngIf"],["fxLayout","column"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxFlex","30"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxFlex","70"],[1,"foreground-secondary-text","w-100"],["class","foreground-secondary-text w-100",4,"ngFor","ngForOf"],["fxFlex","100"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","address"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select","btn-action"],["fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",1,"btn-action-copy",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&t.YNc(0,Uo,50,21,"div",0),2&e&&t.Q6J("ngIf",a.lookupResult)},dependencies:[c.sg,c.O5,c.PC,p.xw,p.Wh,p.yH,L.Zl,q.lW,K.d,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.ge,r.ev,r.XQ,r.Gk,Q.$V,se.y,c.rS,c.uU,c.Nd],styles:["div.bordered-box.table-actions-select.btn-action[_ngcontent-%COMP%]{min-width:13rem;width:13rem;min-height:3.6rem}button.mat-stroked-button.btn-action-copy[_ngcontent-%COMP%]{min-width:13rem;width:13rem}"]})}const ko=["form"];function Do(i,n){if(1&i&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.hij("",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder," is required.")}}function Ro(i,n){if(1&i&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.hij("Invalid ",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder,".")}}function Jo(i,n){if(1&i&&(t.TgZ(0,"div"),t._UZ(1,"rtl-ecl-node-lookup",25),t.qZA()),2&i){const e=t.oxw(3);t.xp6(1),t.Q6J("lookupResult",e.nodeLookupValue)}}function Mo(i,n){if(1&i&&(t.TgZ(0,"span",23),t.YNc(1,Jo,2,1,"div",24),t.qZA()),2&i){const e=t.oxw(2),a=t.MAs(21);t.xp6(1),t.Q6J("ngIf",e.nodeLookupValue.nodeId)("ngIfElse",a)}}function Qo(i,n){1&i&&(t.TgZ(0,"span"),t._uU(1,' fxFlex="100"'),t.TgZ(2,"h3"),t._uU(3,"Error! Unable to find details!"),t.qZA()())}function Yo(i,n){if(1&i&&(t.TgZ(0,"div",17)(1,"div",18)(2,"span",19),t._uU(3),t.qZA()(),t.TgZ(4,"div",20),t.YNc(5,Mo,2,2,"span",21),t.YNc(6,Qo,4,0,"span",22),t.qZA()()),2&i){const e=t.oxw();t.xp6(3),t.hij("",e.lookupFields[e.selectedFieldId].name," Details"),t.xp6(1),t.Q6J("ngSwitch",e.selectedFieldId),t.xp6(1),t.Q6J("ngSwitchCase",0)}}function Bo(i,n){1&i&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find details!"),t.qZA())}const Ho=function(i){return{"mt-1":!0,"mt-2":i}};class Lt{constructor(n,e,a,o){this.logger=n,this.commonService=e,this.store=a,this.actions=o,this.lookupKeyCtrl=new d.p4,this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Node ID"},{id:1,name:"Channel",placeholder:"Short Channel ID"}],this.flgLoading=[!0],this.faSearch=T.wn1,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(n=>n.type===s.lr.SET_LOOKUP_ECL||n.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(n=>{if(n.type===s.lr.SET_LOOKUP_ECL){switch(this.flgLoading[0]=!0,this.selectedFieldId){case 0:this.nodeLookupValue=n.payload[0]?JSON.parse(JSON.stringify(n.payload[0])):{nodeid:""};break;case 1:this.channelLookupValue=JSON.parse(JSON.stringify(n.payload))||[]}this.flgSetLookupValue=!0,this.logger.info(this.nodeLookupValue),this.logger.info(this.channelLookupValue)}n.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&n.payload.status===s.Bn.ERROR&&"Lookup"===n.payload.action&&(this.flgLoading[0]="error")}),this.lookupKeyCtrl.valueChanges.pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1})}onLookup(){if(!this.lookupKeyCtrl.value)return this.lookupKeyCtrl.setErrors({required:!0}),!0;if(this.lookupKeyCtrl.value&&(this.lookupKeyCtrl.value.includes("@")||this.lookupKeyCtrl.value.includes(",")))return this.lookupKeyCtrl.setErrors({invalid:!0}),!0;if(0===(this.selectedFieldId||(this.selectedFieldId=0),this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.selectedFieldId))this.store.dispatch((0,P.Sf)({payload:this.lookupKeyCtrl.value.trim()}))}onSelectChange(n){this.resetData(),this.selectedFieldId=n.value}resetData(){this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.lookupKeyCtrl.setValue(""),this.lookupKeyCtrl.setErrors(null),this.form.resetForm()}clearLookupValue(){this.nodeLookupValue={},this.channelLookupValue=[],this.flgSetLookupValue=!1}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Lt)(t.Y36(N.mQ),t.Y36(O.v),t.Y36(A.yh),t.Y36(G.eX))};static#e=this.\u0275cmp=t.Xpm({type:Lt,selectors:[["rtl-ecl-lookups"]],viewQuery:function(e,a){if(1&e&&t.Gf(ko,7),2&e){let o;t.iGM(o=t.CRH())&&(a.form=o.first)}},decls:22,vars:9,consts:[["fxLayout","column"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start space-between",1,"w-100"],["form","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField"],["checked","",1,"mr-4",3,"value"],["fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl","placeholder"],["key",""],[4,"ngIf"],["fxLayout","row","fxFlex","100",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","button",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch","class","w-100 mt-2",4,"ngIf"],["errorBlock",""],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mt-2"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],[1,"page-title","font-bold-500"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",3,"ngSwitch"],["fxFlex","100",4,"ngSwitchCase"],[4,"ngSwitchDefault"],["fxFlex","100"],[4,"ngIf","ngIfElse"],[3,"lookupResult"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-content",2)(3,"form",3,4)(5,"div",5)(6,"mat-radio-group",6)(7,"mat-radio-button",7),t._uU(8,"Node"),t.qZA()()(),t.TgZ(9,"mat-form-field",8),t._UZ(10,"input",9,10),t.YNc(12,Do,2,1,"mat-error",11),t.YNc(13,Ro,2,1,"mat-error",11),t.qZA(),t.TgZ(14,"div",12)(15,"button",13),t.NdJ("click",function(){return a.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",14),t.NdJ("click",function(){return a.onLookup()}),t._uU(18,"Lookup"),t.qZA()()(),t.YNc(19,Yo,7,3,"div",15),t.qZA()()(),t.YNc(20,Bo,2,0,"ng-template",null,16,t.W1O)),2&e&&(t.xp6(7),t.Q6J("value",0),t.xp6(2),t.Q6J("ngClass",t.VKq(7,Ho,a.screenSize===a.screenSizeEnum.XS||a.screenSize===a.screenSizeEnum.SM)),t.xp6(1),t.Q6J("formControl",a.lookupKeyCtrl)("placeholder",(null==a.lookupFields[a.selectedFieldId]?null:a.lookupFields[a.selectedFieldId].placeholder)||"Lookup Key"),t.xp6(2),t.Q6J("ngIf",null==a.lookupKeyCtrl.errors?null:a.lookupKeyCtrl.errors.required),t.xp6(1),t.Q6J("ngIf",null==a.lookupKeyCtrl.errors?null:a.lookupKeyCtrl.errors.invalid),t.xp6(6),t.Q6J("ngIf",a.flgSetLookupValue))},dependencies:[c.mk,c.O5,c.RF,c.n9,c.ED,d._Y,d.Fj,d.JJ,d.JL,d.Q7,d.F,d.oH,p.xw,p.Wh,p.yH,L.oO,q.lW,b.dn,x.TO,x.KE,M.Nt,bt.VQ,bt.U0,vt],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}"]})}var zo=_(9122);class St{constructor(n,e){this.store=n,this.eclEffects=e,this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,P._E)()),this.eclEffects.setNewAddress.pipe((0,z.q)(1)).subscribe(n=>{this.newAddress=n,setTimeout(()=>{this.store.dispatch((0,Z.qR)({payload:{data:{address:this.newAddress,addressType:"",component:zo.n}}}))},0)})}static#t=this.\u0275fac=function(e){return new(e||St)(t.Y36(A.yh),t.Y36(Yt.o))};static#e=this.\u0275cmp=t.Xpm({type:St,selectors:[["rtl-ecl-on-chain-receive"]],decls:4,vars:0,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","1",3,"click"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return a.onGenerateAddress()}),t._uU(3,"Generate Address"),t.qZA()()())},dependencies:[p.xw,p.Wh,p.yH,q.lW]})}class Zt{constructor(n,e){this.store=n,this.activatedRoute=e,this.sweepAll=!1,this.unSubs=[new u.x,new u.x]}ngOnInit(){this.activatedRoute.data.pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.sweepAll=n.sweepAll})}openSendFundsModal(){this.store.dispatch((0,Z.qR)({payload:{data:{sweepAll:this.sweepAll,component:nt}}}))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Zt)(t.Y36(A.yh),t.Y36(C.gz))};static#e=this.\u0275cmp=t.Xpm({type:Zt,selectors:[["rtl-ecl-on-chain-send"]],decls:4,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","button","tabindex","1",3,"click"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return a.openSendFundsModal()}),t._uU(3),t.qZA()()()),2&e&&(t.xp6(3),t.Oqu(a.sweepAll?"Sweep All":"Send Funds"))},dependencies:[p.xw,p.Wh,p.yH,q.lW]})}var Vo=_(4874),le=_(635),re=_(4714),ce=_(8550),Go=_(9843);const Ko=["form"];function Wo(i,n){if(1&i&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.Q6J("value",e),t.xp6(1),t.Oqu(e.alias?e.alias:e.nodeId?e.nodeId:"")}}function $o(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer alias is required."),t.qZA())}function Xo(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer not found in the list."),t.qZA())}function jo(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"input",31),t.NdJ("change",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.qZA(),t.TgZ(2,"mat-autocomplete",32,33),t.NdJ("optionSelected",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.YNc(4,Wo,2,2,"mat-option",34),t.ALo(5,"async"),t.qZA(),t.YNc(6,$o,2,0,"mat-error",17),t.YNc(7,Xo,2,0,"mat-error",17),t.qZA()}if(2&i){const e=t.MAs(3),a=t.oxw();t.xp6(1),t.Q6J("formControl",a.selectedPeer)("matAutocomplete",e),t.xp6(1),t.Q6J("displayWith",a.displayFn),t.xp6(2),t.Q6J("ngForOf",t.lcZ(5,6,a.filteredPeers)),t.xp6(2),t.Q6J("ngIf",null==a.selectedPeer.errors?null:a.selectedPeer.errors.required),t.xp6(1),t.Q6J("ngIf",null==a.selectedPeer.errors?null:a.selectedPeer.errors.notfound)}}function ts(i,n){1&i&&t.GkF(0)}function es(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function ns(i,n){if(1&i&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function is(i,n){if(1&i&&(t.TgZ(0,"span"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.channelConnectionError)}}function as(i,n){if(1&i&&(t.TgZ(0,"div",36),t._UZ(1,"fa-icon",37),t.YNc(2,is,2,1,"span",17),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(1),t.Q6J("ngIf",""!==e.channelConnectionError)}}function os(i,n){if(1&i&&(t.TgZ(0,"mat-expansion-panel",39)(1,"mat-expansion-panel-header")(2,"mat-panel-title")(3,"span"),t._uU(4,"Peer: \xa0"),t.qZA(),t.TgZ(5,"strong",40),t._uU(6),t.qZA()()(),t.TgZ(7,"div",9)(8,"div",0)(9,"div",1)(10,"h4",41),t._uU(11,"Pubkey"),t.qZA(),t.TgZ(12,"span",42),t._uU(13),t.qZA()()(),t._UZ(14,"mat-divider",43),t.TgZ(15,"div",0)(16,"div",44)(17,"h4",41),t._uU(18,"Address"),t.qZA(),t.TgZ(19,"span",45),t._uU(20),t.qZA()(),t.TgZ(21,"div",44)(22,"h4",41),t._uU(23,"State"),t.qZA(),t.TgZ(24,"span",45),t._uU(25),t.ALo(26,"titlecase"),t.qZA()()()()()),2&i){const e=t.oxw(2);t.xp6(6),t.Oqu((null==e.peer?null:e.peer.alias)||(null==e.peer?null:e.peer.nodeId)),t.xp6(7),t.Oqu(e.peer.nodeId),t.xp6(7),t.Oqu(null==e.peer?null:e.peer.address),t.xp6(5),t.Oqu(t.lcZ(26,4,null==e.peer?null:e.peer.state))}}function ss(i,n){if(1&i&&t.YNc(0,os,27,6,"mat-expansion-panel",38),2&i){const e=t.oxw();t.Q6J("ngIf",e.peer)}}class it{constructor(n,e,a,o){this.dialogRef=n,this.data=e,this.store=a,this.actions=o,this.selNode={},this.selectedPeer=new d.p4,this.faExclamationTriangle=T.eHv,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.feeRate=null,this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){this.data.message?(this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.peer=this.data.message.peer||null,this.peers=this.data.message.peers||[]):(this.information={},this.totalBalance=0,this.peer=null,this.peers=[]),this.alertTitle=this.data.alertTitle||"Alert",this.store.select(g.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(a=>{this.selNode=a,this.isPrivate=!!a?.unannouncedChannels}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,J.h)(a=>a.type===s.lr.UPDATE_API_CALL_STATUS_ECL||a.type===s.lr.FETCH_CHANNELS_ECL)).subscribe(a=>{a.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&a.payload.status===s.Bn.ERROR&&"SaveNewChannel"===a.payload.action&&(this.channelConnectionError=a.payload.message),a.type===s.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close()});let n="",e="";this.sortedPeers=this.peers.sort((a,o)=>(n=a.alias?a.alias.toLowerCase():a.nodeId?a.nodeId.toLowerCase():"",e=o.alias?o.alias.toLowerCase():a.nodeId?a.nodeId.toLowerCase():"",n<e?-1:n>e?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,h.R)(this.unSubs[2]),(0,Vo.O)(""),(0,le.U)(a=>"string"==typeof a?a:a.alias?a.alias:a.nodeId),(0,le.U)(a=>a?this.filterPeers(a):this.sortedPeers.slice()))}filterPeers(n){return this.sortedPeers?.filter(e=>0===e.alias?.toLowerCase().indexOf(n?n.toLowerCase():""))}displayFn(n){return n&&n.alias?n.alias:n&&n.nodeId?n.nodeId:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.nodeId?this.selectedPeer.value.nodeId:null,"string"==typeof this.selectedPeer.value){const n=this.peers?.filter(e=>e.alias?.length===this.selectedPeer.value.length&&0===e.alias?.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===n.length&&n[0].nodeId&&(this.selectedPubkey=n[0].nodeId)}this.selectedPeer.value&&!this.selectedPubkey?this.selectedPeer.setErrors({notfound:!0}):this.selectedPeer.setErrors(null)}onClose(){this.dialogRef.close(!1)}resetData(){this.feeRate=null,this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!!this.selNode?.unannouncedChannels,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onAdvancedPanelToggle(n){this.advancedTitle="Advanced Options",n&&this.feeRate&&this.feeRate>0&&(this.advancedTitle=this.advancedTitle+" | Fee (Sats/vByte): "+this.feeRate)}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0)return!0;const n={nodeId:this.peer&&this.peer.nodeId?this.peer.nodeId:this.selectedPubkey,amount:this.fundingAmount,private:this.isPrivate};this.feeRate&&(n.feeRate=this.feeRate),this.store.dispatch((0,P.YX)({payload:n}))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||it)(t.Y36(D.so),t.Y36(D.WI),t.Y36(A.yh),t.Y36(G.eX))};static#e=this.\u0275cmp=t.Xpm({type:it,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(e,a){if(1&e&&t.Gf(Ko,7),2&e){let o;t.iGM(o=t.CRH())&&(a.form=o.first)}},decls:48,vars:18,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","11","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column",3,"submit","reset"],["form","ngForm"],["fxLayout","column"],["fxFlex","100",4,"ngIf"],[4,"ngTemplateOutlet"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","70","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","1","required","","name","amount",3,"step","min","max","ngModel","ngModelChange"],["amount","ngModel"],["matSuffix",""],[4,"ngIf"],["fxFlex","25","fxLayoutAlign","start center"],["tabindex","2","color","primary","name","isPrivate",3,"ngModel","ngModelChange"],["expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["fxFlex","100","fxLayout","row","fxLayoutAlign","space-between center"],["fxFlex","49"],["matInput","","placeholder","Fee (Sats/vByte)","type","number","name","fee","tabindex","7",3,"step","min","ngModel","ngModelChange"],["fee","ngModel"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","9","type","reset",1,"mr-1"],["autoFocus","","mat-button","","color","primary","type","submit","tabindex","10"],["peerDetailsExpansionBlock",""],["type","text","placeholder","Peer Alias","aria-label","Peers","matInput","","tabindex","1","required","",3,"formControl","matAutocomplete","change"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["class","flat-expansion-panel my-1","expanded","false",4,"ngIf"],["expanded","false",1,"flat-expansion-panel","my-1"],[1,"font-weight-900"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"w-100","my-1"],["fxFlex","50"],[1,"overflow-wrap","foreground-secondary-text"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return a.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return a.onOpenChannel()})("reset",function(){return a.resetData()}),t.TgZ(11,"div",9),t.YNc(12,jo,8,8,"mat-form-field",10),t.qZA(),t.YNc(13,ts,1,0,"ng-container",11),t.TgZ(14,"div",9)(15,"div",12)(16,"mat-form-field",13)(17,"input",14,15),t.NdJ("ngModelChange",function(l){return a.fundingAmount=l}),t.qZA(),t.TgZ(19,"mat-hint"),t._uU(20),t.ALo(21,"number"),t.qZA(),t.TgZ(22,"span",16),t._uU(23," Sats "),t.qZA(),t.YNc(24,es,2,0,"mat-error",17),t.YNc(25,ns,2,1,"mat-error",17),t.qZA(),t.TgZ(26,"div",18)(27,"mat-slide-toggle",19),t.NdJ("ngModelChange",function(l){return a.isPrivate=l}),t._uU(28,"Private Channel"),t.qZA()()(),t.TgZ(29,"mat-expansion-panel",20),t.NdJ("closed",function(){return a.onAdvancedPanelToggle(!0)})("opened",function(){return a.onAdvancedPanelToggle(!1)}),t.TgZ(30,"mat-expansion-panel-header")(31,"mat-panel-title")(32,"span"),t._uU(33),t.qZA()()(),t.TgZ(34,"div",21)(35,"div",12)(36,"div",22)(37,"mat-form-field",23)(38,"input",24,25),t.NdJ("ngModelChange",function(l){return a.feeRate=l}),t.qZA()()()()()()(),t.YNc(40,as,3,2,"div",26),t.TgZ(41,"div",27)(42,"button",28),t._uU(43,"Clear Fields"),t.qZA(),t.TgZ(44,"button",29),t._uU(45,"Open Channel"),t.qZA()()()()()(),t.YNc(46,ss,1,1,"ng-template",null,30,t.W1O)),2&e){const o=t.MAs(18),l=t.MAs(47);t.xp6(5),t.Oqu(a.alertTitle),t.xp6(7),t.Q6J("ngIf",!a.peer&&a.peers&&a.peers.length>0),t.xp6(1),t.Q6J("ngTemplateOutlet",l),t.xp6(4),t.Q6J("step",1e3)("min",1)("max",a.totalBalance)("ngModel",a.fundingAmount),t.xp6(3),t.hij("Remaining Bal: ",t.lcZ(21,16,a.totalBalance-(a.fundingAmount?a.fundingAmount:0)),""),t.xp6(4),t.Q6J("ngIf",null==o.errors?null:o.errors.required),t.xp6(1),t.Q6J("ngIf",null==o.errors?null:o.errors.max),t.xp6(2),t.Q6J("ngModel",a.isPrivate),t.xp6(6),t.Oqu(a.advancedTitle),t.xp6(5),t.Q6J("step",1)("min",0)("ngModel",a.feeRate),t.xp6(2),t.Q6J("ngIf",""!==a.channelConnectionError)}},dependencies:[c.sg,c.O5,c.tP,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.Fd,d.On,d.F,d.oH,F.BN,p.xw,p.Wh,p.yH,q.lW,b.dk,b.dn,Y.ib,Y.yz,Y.yK,x.TO,x.KE,x.bx,x.R9,M.Nt,K.d,B.ey,re.Rr,ce.XC,ce.ZL,W.h,Go.F,$.q,c.Ov,c.JJ,c.rS],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]})}function ls(i,n){if(1&i&&(t.TgZ(0,"span",7),t._uU(1,"Open"),t.qZA()),2&i){const e=t.oxw();t.s9C("matBadge",e.numOfOpenChannels)}}function rs(i,n){if(1&i&&(t.TgZ(0,"span",7),t._uU(1,"Pending"),t.qZA()),2&i){const e=t.oxw();t.s9C("matBadge",e.numOfPendingChannels)}}function cs(i,n){if(1&i&&(t.TgZ(0,"span",7),t._uU(1,"Inactive"),t.qZA()),2&i){const e=t.oxw();t.s9C("matBadge",e.numOfInactiveChannels)}}class At{constructor(n,e,a){this.logger=n,this.store=e,this.router=a,this.numOfOpenChannels=0,this.numOfPendingChannels=0,this.numOfInactiveChannels=0,this.selNode={},this.information={},this.peers=[],this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending"},{link:"inactive",name:"Inactive"}],this.activeLink=0,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x]}ngOnInit(){this.activeLink=this.links.findIndex(n=>n.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(n=>n instanceof C.Av)).subscribe({next:n=>{this.activeLink=this.links.findIndex(e=>e.link===n.urlAfterRedirects.substring(n.urlAfterRedirects.lastIndexOf("/")+1))}}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.numOfOpenChannels=n.channelsStatus&&n.channelsStatus.active&&n.channelsStatus.active.channels?n.channelsStatus.active.channels:0,this.numOfPendingChannels=n.channelsStatus&&n.channelsStatus.pending&&n.channelsStatus.pending.channels?n.channelsStatus.pending.channels:0,this.numOfInactiveChannels=n.channelsStatus&&n.channelsStatus.inactive&&n.channelsStatus.inactive.channels?n.channelsStatus.inactive.channels:0,this.logger.info(n)}),this.store.select(g.LR).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.selNode=n}),this.store.select(g.yD).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.information=n}),this.store.select(g.Bo).pipe((0,h.R)(this.unSubs[4])).subscribe(n=>{this.peers=n.peers}),this.store.select(g.kY).pipe((0,h.R)(this.unSubs[5])).subscribe(n=>{this.totalBalance=n.onchainBalance.total||0})}onOpenChannel(){const n={peers:this.peers,information:this.information,balance:this.totalBalance};this.store.dispatch((0,Z.qR)({payload:{data:{alertTitle:"Open Channel",message:n,component:it}}}))}onSelectedTabChange(n){this.router.navigateByUrl("/ecl/connections/channels/"+this.links[n.index].link)}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||At)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:At,selectors:[["rtl-ecl-channels-tables"]],decls:14,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"my-2","bordered-box"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return a.onOpenChannel()}),t._uU(3,"Open Channel"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-tab-group",4),t.NdJ("selectedIndexChange",function(l){return a.activeLink=l})("selectedTabChange",function(l){return a.onSelectedTabChange(l)}),t.TgZ(6,"mat-tab"),t.YNc(7,ls,2,1,"ng-template",5),t.qZA(),t.TgZ(8,"mat-tab"),t.YNc(9,rs,2,1,"ng-template",5),t.qZA(),t.TgZ(10,"mat-tab"),t.YNc(11,cs,2,1,"ng-template",5),t.qZA()(),t.TgZ(12,"div",6),t._UZ(13,"router-outlet"),t.qZA()()()),2&e&&(t.xp6(5),t.Q6J("selectedIndex",a.activeLink))},dependencies:[p.xw,p.Wh,p.yH,q.lW,ae.k,E.SP,E.uD,E.uX,C.lC]})}function us(i,n){if(1&i&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"Short Channel ID"),t.qZA(),t.TgZ(3,"span",13),t._uU(4),t.qZA()()),2&i){const e=t.oxw();t.xp6(4),t.Oqu(e.channel.shortChannelId)}}function ps(i,n){if(1&i&&(t.TgZ(0,"div",11)(1,"h4",12),t._uU(2,"State"),t.qZA(),t.TgZ(3,"span",15),t._uU(4),t.ALo(5,"titlecase"),t.qZA()()),2&i){const e=t.oxw();t.xp6(4),t.Oqu(t.lcZ(5,1,e.channel.state))}}function ms(i,n){if(1&i&&(t.TgZ(0,"div")(1,"div",9)(2,"div",11)(3,"h4",12),t._uU(4,"Local Balance (Sats)"),t.qZA(),t.TgZ(5,"span",15),t._uU(6),t.ALo(7,"number"),t.qZA()(),t.TgZ(8,"div",11)(9,"h4",12),t._uU(10,"Remote Balance (Sats)"),t.qZA(),t.TgZ(11,"span",15),t._uU(12),t.ALo(13,"number"),t.qZA()()(),t._UZ(14,"mat-divider",14),t.TgZ(15,"div",9)(16,"div",11)(17,"h4",12),t._uU(18,"Base Fee (mSats)"),t.qZA(),t.TgZ(19,"span",15),t._uU(20),t.ALo(21,"number"),t.qZA()(),t.TgZ(22,"div",11)(23,"h4",12),t._uU(24,"Fee Rate (mili mSats)"),t.qZA(),t.TgZ(25,"span",15),t._uU(26),t.ALo(27,"number"),t.qZA()()(),t._UZ(28,"mat-divider",14),t.qZA()),2&i){const e=t.oxw();t.xp6(6),t.Oqu(t.lcZ(7,6,e.channel.toLocal)),t.xp6(6),t.Oqu(t.lcZ(13,8,e.channel.toRemote)),t.xp6(2),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(21,10,e.channel.feeBaseMsat)),t.xp6(6),t.Oqu(t.lcZ(27,12,e.channel.feeProportionalMillionths)),t.xp6(2),t.Q6J("inset",!0)}}function ds(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Show Advanced"),t.qZA())}function hs(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Hide Advanced"),t.qZA())}function _s(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",21),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onShowAdvanced())}),t.YNc(1,ds,2,0,"p",22),t.YNc(2,hs,2,0,"ng-template",null,23,t.W1O),t.qZA()}if(2&i){const e=t.MAs(3),a=t.oxw();t.xp6(1),t.Q6J("ngIf",!a.showAdvanced)("ngIfElse",e)}}function gs(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",24),t.NdJ("copied",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onCopyChanID(o))}),t._uU(1,"Copy Short Channel ID"),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("payload",e.channel.shortChannelId)}}function fs(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",25),t.NdJ("copied",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onCopyChanID(o))}),t._uU(1,"Copy Channel ID"),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("payload",e.channel.channelId)}}const Cs=function(i){return{"xs-scroll-y":i}},xs=function(i,n){return{"mt-2":i,"mt-1":n}};class X{constructor(n,e,a,o,l){this.dialogRef=n,this.data=e,this.logger=a,this.commonService=o,this.snackBar=l,this.faReceipt=T.dLy,this.showAdvanced=!1,this.channelsType="open",this.screenSize="",this.screenSizeEnum=s.cu}ngOnInit(){this.channel=this.data.channel,this.channelsType=this.data.channelsType||"",this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onShowAdvanced(){this.showAdvanced=!this.showAdvanced}onCopyChanID(n){this.snackBar.open("open"===this.channelsType?"Short channel ID "+n+" copied.":"Channel ID copied."),this.logger.info("Copied Text: "+n)}static#t=this.\u0275fac=function(e){return new(e||X)(t.Y36(D.so),t.Y36(D.WI),t.Y36(N.mQ),t.Y36(O.v),t.Y36(oe.ux))};static#e=this.\u0275cmp=t.Xpm({type:X,selectors:[["rtl-ecl-channel-information"]],decls:64,vars:28,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large",3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50",4,"ngIf"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],[1,"overflow-wrap","foreground-secondary-text"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","100",3,"ngClass"],["mat-button","","color","primary","type","reset","tabindex","1","class","mr-1",3,"click",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["mat-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-button","","color","primary","tabindex","3","type","submit","rtlClipboard","",3,"payload","copied"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span",5),t._uU(6,"Channel Information"),t.qZA()(),t.TgZ(7,"button",6),t.NdJ("click",function(){return a.onClose()}),t._uU(8,"X"),t.qZA()(),t.TgZ(9,"mat-card-content",7)(10,"div",8)(11,"div",9),t.YNc(12,us,5,1,"div",10),t.TgZ(13,"div",11)(14,"h4",12),t._uU(15,"Peer Alias"),t.qZA(),t.TgZ(16,"span",13),t._uU(17),t.qZA()(),t.YNc(18,ps,6,3,"div",10),t.qZA(),t._UZ(19,"mat-divider",14),t.TgZ(20,"div",9)(21,"div",1)(22,"h4",12),t._uU(23,"Channel ID"),t.qZA(),t.TgZ(24,"span",13),t._uU(25),t.qZA()()(),t._UZ(26,"mat-divider",14),t.TgZ(27,"div",9)(28,"div",1)(29,"h4",12),t._uU(30,"Peer Public Key"),t.qZA(),t.TgZ(31,"span",13),t._uU(32),t.qZA()()(),t._UZ(33,"mat-divider",14),t.TgZ(34,"div",9)(35,"div",11)(36,"h4",12),t._uU(37,"Private"),t.qZA(),t.TgZ(38,"span",15),t._uU(39),t.qZA()(),t.TgZ(40,"div",11)(41,"h4",12),t._uU(42,"Funder"),t.qZA(),t.TgZ(43,"span",15),t._uU(44),t.qZA()()(),t._UZ(45,"mat-divider",14),t.TgZ(46,"div",9)(47,"div",11)(48,"h4",12),t._uU(49,"State"),t.qZA(),t.TgZ(50,"span",15),t._uU(51),t.ALo(52,"titlecase"),t.qZA()(),t.TgZ(53,"div",11)(54,"h4",12),t._uU(55,"Buried"),t.qZA(),t.TgZ(56,"span",15),t._uU(57),t.qZA()()(),t._UZ(58,"mat-divider",14),t.YNc(59,ms,29,14,"div",16),t.TgZ(60,"div",17),t.YNc(61,_s,4,2,"button",18),t.YNc(62,gs,2,1,"button",19),t.YNc(63,fs,2,1,"button",20),t.qZA()()()()()),2&e&&(t.xp6(4),t.Q6J("icon",a.faReceipt),t.xp6(5),t.Q6J("ngClass",t.VKq(23,Cs,a.screenSize===a.screenSizeEnum.XS)),t.xp6(3),t.Q6J("ngIf","open"===a.channelsType),t.xp6(5),t.Oqu(a.channel.alias),t.xp6(1),t.Q6J("ngIf","open"!==a.channelsType),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(a.channel.channelId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(a.channel.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(a.channel.announceChannel?"No":"Yes"),t.xp6(5),t.Oqu(a.channel.isFunder?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(52,21,a.channel.state)),t.xp6(6),t.Oqu(a.channel.buried?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(1),t.Q6J("ngIf",a.showAdvanced&&"open"===a.channelsType),t.xp6(1),t.Q6J("ngClass",t.WLB(25,xs,!a.showAdvanced,a.showAdvanced)),t.xp6(1),t.Q6J("ngIf","open"===a.channelsType),t.xp6(1),t.Q6J("ngIf","open"===a.channelsType),t.xp6(1),t.Q6J("ngIf","open"!==a.channelsType))},dependencies:[c.mk,c.O5,F.BN,p.xw,p.Wh,p.yH,L.oO,q.lW,b.dk,b.dn,K.d,se.y,W.h,c.JJ,c.rS]})}function ys(i,n){if(1&i&&(t.TgZ(0,"mat-option",38),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}function Ts(i,n){1&i&&t._UZ(0,"mat-progress-bar",39)}function bs(i,n){1&i&&t._UZ(0,"th",40)}function vs(i,n){if(1&i&&(t.TgZ(0,"span",44),t._UZ(1,"fa-icon",45),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function Ls(i,n){if(1&i&&(t.TgZ(0,"span",46),t._UZ(1,"fa-icon",45),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function Ss(i,n){if(1&i&&(t.TgZ(0,"td",41),t.YNc(1,vs,2,1,"span",42),t.YNc(2,Ls,2,1,"span",43),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function Zs(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Short Channel ID"),t.qZA())}function As(i,n){if(1&i&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function Es(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Channel ID"),t.qZA())}const Gt=function(i){return{width:i}};function ws(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Gt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Is(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Alias"),t.qZA())}function Fs(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Gt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function qs(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Node ID"),t.qZA())}function Ns(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Gt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Os(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Funder"),t.qZA())}function Ps(i,n){if(1&i&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function Us(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Buried"),t.qZA())}function ks(i,n){if(1&i&&(t.TgZ(0,"td",41),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function Ds(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Base Fee (mSats)"),t.qZA())}function Rs(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeBaseMsat,"1.0-0")," ")}}function Js(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Fee Rate (mili mSats)"),t.qZA())}function Ms(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeProportionalMillionths,"1.0-0")," ")}}function Qs(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Local Balance (Sats)"),t.qZA())}function Ys(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function Bs(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Hs(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function zs(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Fee/KW"),t.qZA())}function Vs(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Gs(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Balance Score"),t.qZA())}function Ks(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"div",52)(2,"mat-hint",53),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",54),t.qZA()),2&i){const e=n.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",null!=e&&e.toLocal&&(null==e?null:e.toLocal)>0?+(null==e?null:e.toLocal)/(+(null==e?null:e.toLocal)+ +(null==e?null:e.toRemote))*100:0)}}function Ws(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",55)(1,"div",56)(2,"mat-select",57),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onChannelUpdate("all"))}),t._uU(5,"Update Fee Policy"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(7,"Download CSV"),t.qZA()()()()}}function $s(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",59)(1,"div",56)(2,"mat-select",60),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",58),t.NdJ("click",function(o){const m=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onChannelClick(m,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.onChannelUpdate(l))}),t._uU(7,"Update Fee Policy"),t.qZA(),t.TgZ(8,"mat-option",58),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.onChannelClose(l,!1))}),t._uU(9,"Close Channel"),t.qZA(),t.TgZ(10,"mat-option",58),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.onChannelClose(l,!0))}),t._uU(11,"Force Close"),t.qZA()()()()}}function Xs(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No peers connected. Add a peer in order to open a channel?."),t.qZA())}function js(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No channel available."),t.qZA())}function tl(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting channels..."),t.qZA())}function el(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function nl(i,n){if(1&i&&(t.TgZ(0,"td",61),t.YNc(1,Xs,2,0,"p",62),t.YNc(2,js,2,0,"p",62),t.YNc(3,tl,2,0,"p",62),t.YNc(4,el,2,1,"p",62),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const il=function(i){return{"display-none":i}};function al(i,n){if(1&i&&t._UZ(0,"tr",63),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,il,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function ol(i,n){1&i&&t._UZ(0,"tr",64)}function sl(i,n){1&i&&t._UZ(0,"tr",65)}const ll=function(){return["all"]},rl=function(i){return{"error-border":i}},cl=function(){return["no_peer"]};class Et{constructor(n,e,a,o,l,m){this.logger=n,this.store=e,this.rtlEffects=a,this.commonService=o,this.router=l,this.camelCaseWithSpaces=m,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"open_channels",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=s.vn,this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize(),this.selFilter=this.router.getCurrentNavigation()?.extras?.state?.filter?this.router.getCurrentNavigation()?.extras?.state?.filter:""}ngOnInit(){this.store.select(g.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.activeChannels=n.activeChannels,this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable(),this.logger.info(n)}),this.store.select(g.yD).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.information=n}),this.store.select(g.Bo).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.numPeers=n.peers&&n.peers.length?n.peers.length:0}),this.store.select(g.kY).pipe((0,h.R)(this.unSubs[4])).subscribe(n=>{this.totalBalance=n.onchainBalance.total||0})}ngAfterViewInit(){this.activeChannels.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadChannelsTable()}onChannelUpdate(n){if("all"!==n&&"NORMAL"!==n.state)return;const e="all"===n?"Update fee policy for all channels":"Update fee policy for Channel: "+(n.alias||n.shortChannelId?n.alias&&n.shortChannelId?n.alias+" ("+n.shortChannelId+")":n.alias?n.alias:n.shortChannelId:n.channelId);this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:e,flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSats)",inputType:s.Gi.NUMBER,inputValue:n&&typeof n.feeBaseMsat<"u"?n.feeBaseMsat:1e3,step:100,width:48},{placeholder:"Fee Rate (mili mSats)",inputType:s.Gi.NUMBER,inputValue:n&&typeof n.feeProportionalMillionths<"u"?n.feeProportionalMillionths:100,min:1,width:48,hintFunction:this.percentHintFunction}]}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[5])).subscribe(o=>{if(o){const l=o[0].inputValue,m=o[1].inputValue;let y=null;if(this.commonService.isVersionCompatible(this.information.version,"0.6.2")){let f="";"all"===n?(this.activeChannels.forEach(I=>{f=f+","+I.nodeId}),f=f.substring(1),y={baseFeeMsat:l,feeRate:m,nodeIds:f}):y={baseFeeMsat:l,feeRate:m,nodeId:n.nodeId}}else{let f="";"all"===n?(this.activeChannels.forEach(I=>{f=f+","+I.channelId}),f=f.substring(1),y={baseFeeMsat:l,feeRate:m,channelIds:f}):y={baseFeeMsat:l,feeRate:m,channelId:n.channelId}}this.store.dispatch((0,P.pW)({payload:y}))}}),this.applyFilter()}percentHintFunction(n){return(n/1e4).toString()+"%"}onChannelClose(n,e){const a=e?"Force Close Channel":"Close Channel",o=e?"Force Close":"Close Channel",l=e?"Force closing channel: "+(n.alias||n.shortChannelId?n.alias&&n.shortChannelId?n.alias+" ("+n.shortChannelId+")":n.alias?n.alias:n.shortChannelId:n.channelId):"Closing channel: "+(n.alias||n.shortChannelId?n.alias&&n.shortChannelId?n.alias+" ("+n.shortChannelId+")":n.alias?n.alias:n.shortChannelId:n.channelId);this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:a,titleMessage:l,noBtnText:"Cancel",yesBtnText:o}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[6])).subscribe(m=>{m&&this.store.dispatch((0,P.BL)({payload:{channelId:n.channelId,force:e}}))})}onChannelClick(n,e){this.store.dispatch((0,Z.qR)({payload:{data:{channel:n,channelsType:"open",component:X}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):"announceChannel"===n?"Private":this.commonService.titleCase(n)}setFilterPredicate(){this.channels.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=JSON.stringify(n).toLowerCase();break;case"announceChannel":a=n?.announceChannel?"public":"private";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return a.includes(e)}}loadChannelsTable(){this.channels=new r.by([...this.activeChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(n,e)=>n[e]&&isNaN(n[e])?n[e].toLocaleLowerCase():n[e]?+n[e]:null,this.channels.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"ActiveChannels")}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Et)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(ht.V),t.Y36(O.v),t.Y36(C.F0),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:Et,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(e,a){if(1&e&&(t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:61,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","shortChannelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","feeBaseMsat"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","feeProportionalMillionths"],["matColumnDef","toLocal"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cellcolspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(l){return a.selFilterBy=l})("selectionChange",function(){return a.selFilter="",a.applyFilter()}),t.YNc(6,ys,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(l){return a.selFilter=l})("input",function(){return a.applyFilter()})("keyup",function(){return a.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,Ts,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,bs,1,0,"th",13),t.YNc(15,Ss,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,Zs,2,0,"th",16),t.YNc(18,As,2,1,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,Es,2,0,"th",16),t.YNc(21,ws,4,4,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,Is,2,0,"th",16),t.YNc(24,Fs,4,4,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,qs,2,0,"th",16),t.YNc(27,Ns,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,Os,2,0,"th",16),t.YNc(30,Ps,2,1,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,Us,2,0,"th",16),t.YNc(33,ks,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,Ds,2,0,"th",23),t.YNc(36,Rs,4,4,"td",14),t.BQk(),t.ynx(37,24),t.YNc(38,Js,2,0,"th",23),t.YNc(39,Ms,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,Qs,2,0,"th",23),t.YNc(42,Ys,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,Bs,2,0,"th",23),t.YNc(45,Hs,4,4,"td",14),t.BQk(),t.ynx(46,27),t.YNc(47,zs,2,0,"th",23),t.YNc(48,Vs,4,4,"td",14),t.BQk(),t.ynx(49,28),t.YNc(50,Gs,2,0,"th",16),t.YNc(51,Ks,6,4,"td",14),t.BQk(),t.ynx(52,29),t.YNc(53,Ws,8,0,"th",30),t.YNc(54,$s,12,0,"td",31),t.BQk(),t.ynx(55,32),t.YNc(56,nl,5,4,"td",33),t.BQk(),t.YNc(57,al,1,3,"tr",34),t.YNc(58,ol,1,0,"tr",35),t.YNc(59,sl,1,0,"tr",36),t.qZA()(),t._UZ(60,"mat-paginator",37),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",a.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,ll).concat(a.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",a.selFilter),t.xp6(2),t.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",a.channels)("ngClass",t.VKq(13,rl,""!==a.errorMessage)),t.xp6(46),t.Q6J("matFooterRowDef",t.DdM(15,cl)),t.xp6(1),t.Q6J("matHeaderRowDef",a.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",a.displayedColumns),t.xp6(1),t.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},dependencies:[c.mk,c.sg,c.O5,c.PC,d.Fj,d.JJ,d.On,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,x.KE,x.bx,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,V.gM,S.NW,Q.$V,c.JJ],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;min-width:15rem;max-width:30rem}"]})}function ul(i,n){if(1&i&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}function pl(i,n){1&i&&t._UZ(0,"mat-progress-bar",36)}function ml(i,n){1&i&&t._UZ(0,"th",37)}function dl(i,n){if(1&i&&(t.TgZ(0,"span",41),t._UZ(1,"fa-icon",42),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function hl(i,n){if(1&i&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",42),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function _l(i,n){if(1&i&&(t.TgZ(0,"td",38),t.YNc(1,dl,2,1,"span",39),t.YNc(2,hl,2,1,"span",40),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Q6J("ngIf",!(null!=e&&e.announceChannel)),t.xp6(1),t.Q6J("ngIf",null==e?null:e.announceChannel)}}function gl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"State"),t.qZA())}function fl(i,n){if(1&i&&(t.TgZ(0,"td",38),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function Cl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Channel ID"),t.qZA())}const ue=function(i){return{width:i}};function xl(i,n){if(1&i&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ue,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function yl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Alias"),t.qZA())}function Tl(i,n){if(1&i&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null==e?null:e.alias)}}function bl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Node ID"),t.qZA())}function vl(i,n){if(1&i&&(t.TgZ(0,"td",38)(1,"div",45)(2,"span",46),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,ue,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Ll(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Funder"),t.qZA())}function Sl(i,n){if(1&i&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function Zl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Buried"),t.qZA())}function Al(i,n){if(1&i&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function El(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Local Balance (Sats)"),t.qZA())}function wl(i,n){if(1&i&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function Il(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Fl(i,n){if(1&i&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function ql(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Fee/KW"),t.qZA())}function Nl(i,n){if(1&i&&(t.TgZ(0,"td",38)(1,"span",48),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Ol(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",49)(1,"div",50)(2,"mat-select",51),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",52),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Pl(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",53)(1,"button",54),t.NdJ("click",function(o){const m=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onChannelClick(m,o))}),t._uU(2,"View Info"),t.qZA()()}}function Ul(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No pending channel available."),t.qZA())}function kl(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting pending channels..."),t.qZA())}function Dl(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Rl(i,n){if(1&i&&(t.TgZ(0,"td",55),t.YNc(1,Ul,2,0,"p",56),t.YNc(2,kl,2,0,"p",56),t.YNc(3,Dl,2,1,"p",56),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Jl=function(i){return{"display-none":i}};function Ml(i,n){if(1&i&&t._UZ(0,"tr",57),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Jl,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Ql(i,n){1&i&&t._UZ(0,"tr",58)}function Yl(i,n){1&i&&t._UZ(0,"tr",59)}const Bl=function(){return["all"]},Hl=function(i){return{"error-border":i}},zl=function(){return["no_channel"]};class wt{constructor(n,e,a,o){this.logger=n,this.store=e,this.commonService=a,this.camelCaseWithSpaces=o,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"pending_channels",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=s.vn,this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(g.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.pendingChannels=n.pendingChannels,this.loadChannelsTable(),this.logger.info(n)}),this.store.select(g.yD).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.information=n}),this.store.select(g.Bo).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.numPeers=n.peers&&n.peers.length?n.peers.length:0}),this.store.select(g.kY).pipe((0,h.R)(this.unSubs[4])).subscribe(n=>{this.totalBalance=n.onchainBalance.total||0})}ngAfterViewInit(){this.pendingChannels.length>0&&this.loadChannelsTable()}onChannelClick(n,e){this.store.dispatch((0,Z.qR)({payload:{data:{channel:n,channelsType:"pending",component:X}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):"announceChannel"===n?"Private":this.commonService.titleCase(n)}setFilterPredicate(){this.channels.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=JSON.stringify(n).toLowerCase();break;case"announceChannel":a=n?.announceChannel?"public":"private";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return a.includes(e)}}loadChannelsTable(){this.channels=new r.by([...this.pendingChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(n,e)=>n[e]&&isNaN(n[e])?n[e].toLocaleLowerCase():n[e]?+n[e]:null,this.channels.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"PendingChannels")}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||wt)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(O.v),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:wt,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(e,a){if(1&e&&(t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:52,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cellcolspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(l){return a.selFilterBy=l})("selectionChange",function(){return a.selFilter="",a.applyFilter()}),t.YNc(6,ul,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(l){return a.selFilter=l})("input",function(){return a.applyFilter()})("keyup",function(){return a.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,pl,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,ml,1,0,"th",13),t.YNc(15,_l,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,gl,2,0,"th",16),t.YNc(18,fl,3,3,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,Cl,2,0,"th",16),t.YNc(21,xl,4,4,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,yl,2,0,"th",16),t.YNc(24,Tl,2,1,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,bl,2,0,"th",16),t.YNc(27,vl,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,Ll,2,0,"th",16),t.YNc(30,Sl,2,1,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,Zl,2,0,"th",16),t.YNc(33,Al,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,El,2,0,"th",23),t.YNc(36,wl,4,4,"td",14),t.BQk(),t.ynx(37,24),t.YNc(38,Il,2,0,"th",23),t.YNc(39,Fl,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,ql,2,0,"th",23),t.YNc(42,Nl,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,Ol,6,0,"th",27),t.YNc(45,Pl,3,0,"td",28),t.BQk(),t.ynx(46,29),t.YNc(47,Rl,4,3,"td",30),t.BQk(),t.YNc(48,Ml,1,3,"tr",31),t.YNc(49,Ql,1,0,"tr",32),t.YNc(50,Yl,1,0,"tr",33),t.qZA()(),t._UZ(51,"mat-paginator",34),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",a.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,Bl).concat(a.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",a.selFilter),t.xp6(2),t.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",a.channels)("ngClass",t.VKq(13,Hl,""!==a.errorMessage)),t.xp6(37),t.Q6J("matFooterRowDef",t.DdM(15,zl)),t.xp6(1),t.Q6J("matHeaderRowDef",a.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",a.displayedColumns),t.xp6(1),t.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},dependencies:[c.mk,c.sg,c.O5,c.PC,d.Fj,d.JJ,d.On,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,q.lW,x.KE,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,V.gM,S.NW,Q.$V,c.JJ,c.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]})}var Kt=_(4193);const Vl=["peersForm"],Gl=["stepper"];function Kl(i,n){if(1&i&&t._uU(0),2&i){const e=t.oxw();t.Oqu(e.peerFormLabel)}}function Wl(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Address is required."),t.qZA())}function $l(i,n){if(1&i&&(t.TgZ(0,"div",32),t._UZ(1,"fa-icon",33),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.peerConnectionError)}}function Xl(i,n){if(1&i&&t._uU(0),2&i){const e=t.oxw();t.Oqu(e.channelFormLabel)}}function jl(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function tr(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount must be a positive number."),t.qZA())}function er(i,n){if(1&i&&(t.TgZ(0,"mat-error"),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function nr(i,n){if(1&i&&(t.TgZ(0,"div",32),t._UZ(1,"fa-icon",33),t.TgZ(2,"span"),t._uU(3),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("icon",e.faExclamationTriangle),t.xp6(2),t.Oqu(e.channelConnectionError)}}class It{constructor(n,e,a,o,l,m){this.dialogRef=n,this.data=e,this.store=a,this.formBuilder=o,this.actions=l,this.logger=m,this.faExclamationTriangle=T.eHv,this.selNode={},this.peerAddress="",this.totalBalance=0,this.flgChannelOpened=!1,this.channelOpenStatus=null,this.newlyAddedPeer=null,this.flgEditable=!0,this.peerConnectionError="",this.channelConnectionError="",this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)",this.unSubs=[new u.x,new u.x]}ngOnInit(){this.data.message?(this.totalBalance=this.data.message.balance,this.peerAddress=this.data.message.peer&&this.data.message.peer.nodeId&&this.data.message.peer.address?this.data.message.peer.nodeId+"@"+this.data.message.peer.address:this.data.message.peer&&this.data.message.peer.nodeId&&!this.data.message.peer.address?this.data.message.peer.nodeId:""):(this.totalBalance=0,this.peerAddress=""),this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[d.kI.required]],peerAddress:[this.peerAddress,[d.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[d.kI.required,d.kI.min(1),d.kI.max(this.totalBalance)]],isPrivate:[!!this.selNode?.unannouncedChannels],feeRate:[null],hiddenAmount:["",[d.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select(g.LR).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.selNode=n,this.channelFormGroup.controls.isPrivate.setValue(!!n?.unannouncedChannels)}),this.actions.pipe((0,h.R)(this.unSubs[1]),(0,J.h)(n=>n.type===s.lr.NEWLY_ADDED_PEER_ECL||n.type===s.lr.FETCH_CHANNELS_ECL||n.type===s.lr.UPDATE_API_CALL_STATUS_ECL)).subscribe(n=>{n.type===s.lr.NEWLY_ADDED_PEER_ECL&&(this.logger.info(n.payload),this.flgEditable=!1,this.newlyAddedPeer=n.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),n.type===s.lr.FETCH_CHANNELS_ECL&&this.dialogRef.close(),n.type===s.lr.UPDATE_API_CALL_STATUS_ECL&&n.payload.status===s.Bn.ERROR&&("SaveNewPeer"===n.payload.action?this.peerConnectionError=n.payload.message:"SaveNewChannel"===n.payload.action&&(this.channelConnectionError=n.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="",this.store.dispatch((0,P.El)({payload:{id:this.peerFormGroup.controls.peerAddress.value}}))}onOpenChannel(){if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0)return!0;this.channelConnectionError="",this.store.dispatch((0,P.YX)({payload:{nodeId:this.newlyAddedPeer?.nodeId,amount:this.channelFormGroup.controls.fundingAmount.value,private:this.channelFormGroup.controls.isPrivate.value,feeRate:this.channelFormGroup.controls.feeRate.value}}))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(n){switch(n.selectedIndex){case 0:default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 1:this.peerFormGroup.controls.peerAddress.value?this.peerFormLabel="Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer?.nodeId):this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormGroup.controls.peerAddress.value?this.peerFormLabel="Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer?.nodeId):this.peerFormLabel="Peer Details",this.channelFormGroup.controls.fundingAmount.value?this.channelFormLabel="Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":this.channelFormLabel="Open Channel (Optional)"}n.selectedIndex<n.previouslySelectedIndex&&(0===n.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===n.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||It)(t.Y36(D.so),t.Y36(D.WI),t.Y36(A.yh),t.Y36(d.QS),t.Y36(G.eX),t.Y36(N.mQ))};static#e=this.\u0275cmp=t.Xpm({type:It,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(e,a){if(1&e&&(t.Gf(Vl,5),t.Gf(Gl,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.form=o.first),t.iGM(o=t.CRH())&&(a.stepper=o.first)}},decls:48,vars:20,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],[3,"linear","selectionChange"],["stepper",""],[3,"stepControl","editable"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"my-1",3,"formGroup"],["matStepLabel",""],["autoFocus","","matInput","","placeholder","Lightning Address (pubkey OR pubkey@ip:port)","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","30","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","30"],["matInput","","formControlName","feeRate","placeholder","Fee (Sats/vByte)","type","number","name","feeRate","tabindex","7",3,"step","min"],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["mat-button","","color","primary","tabindex","8","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","12","type","button","default","",3,"click"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"mat-card-header",2)(3,"div",3)(4,"span",4),t._uU(5,"Connect to a new peer"),t.qZA()(),t.TgZ(6,"button",5),t.NdJ("click",function(){return a.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"div",7)(10,"mat-vertical-stepper",8,9),t.NdJ("selectionChange",function(l){return a.stepSelectionChanged(l)}),t.TgZ(12,"mat-step",10)(13,"form",11),t.YNc(14,Kl,1,1,"ng-template",12),t.TgZ(15,"mat-form-field",1),t._UZ(16,"input",13),t.YNc(17,Wl,2,0,"mat-error",14),t.qZA(),t.YNc(18,$l,4,2,"div",15),t.TgZ(19,"div",16)(20,"button",17),t.NdJ("click",function(){return a.onConnectPeer()}),t._uU(21),t.qZA()()()(),t.TgZ(22,"mat-step",10)(23,"form",18),t.YNc(24,Xl,1,1,"ng-template",19),t.TgZ(25,"div",20)(26,"div",21)(27,"mat-form-field",22),t._UZ(28,"input",23),t.TgZ(29,"mat-hint"),t._uU(30),t.qZA(),t.TgZ(31,"span",24),t._uU(32," Sats "),t.qZA(),t.YNc(33,jl,2,0,"mat-error",14),t.YNc(34,tr,2,0,"mat-error",14),t.YNc(35,er,2,1,"mat-error",14),t.qZA(),t.TgZ(36,"mat-form-field",25),t._UZ(37,"input",26),t.qZA(),t.TgZ(38,"div",27)(39,"mat-slide-toggle",28),t._uU(40,"Private Channel"),t.qZA()()()(),t.YNc(41,nr,4,2,"div",15),t.TgZ(42,"div",16)(43,"button",29),t.NdJ("click",function(){return a.onOpenChannel()}),t._uU(44),t.qZA()()()()(),t.TgZ(45,"div",30)(46,"button",31),t.NdJ("click",function(){return a.onClose()}),t._uU(47),t.qZA()()()()()()),2&e&&(t.xp6(10),t.Q6J("linear",!0),t.xp6(2),t.Q6J("stepControl",a.peerFormGroup)("editable",a.flgEditable),t.xp6(1),t.Q6J("formGroup",a.peerFormGroup),t.xp6(4),t.Q6J("ngIf",null==a.peerFormGroup.controls.peerAddress.errors?null:a.peerFormGroup.controls.peerAddress.errors.required),t.xp6(1),t.Q6J("ngIf",""!==a.peerConnectionError),t.xp6(3),t.Oqu(""!==a.peerConnectionError?"Retry":"Add Peer"),t.xp6(1),t.Q6J("stepControl",a.channelFormGroup)("editable",a.flgEditable),t.xp6(1),t.Q6J("formGroup",a.channelFormGroup),t.xp6(5),t.Q6J("step",1e3),t.xp6(2),t.hij("Remaining Bal: ",a.totalBalance-(a.channelFormGroup.controls.fundingAmount.value?a.channelFormGroup.controls.fundingAmount.value:0),""),t.xp6(3),t.Q6J("ngIf",null==a.channelFormGroup.controls.fundingAmount.errors?null:a.channelFormGroup.controls.fundingAmount.errors.required),t.xp6(1),t.Q6J("ngIf",null==a.channelFormGroup.controls.fundingAmount.errors?null:a.channelFormGroup.controls.fundingAmount.errors.min),t.xp6(1),t.Q6J("ngIf",null==a.channelFormGroup.controls.fundingAmount.errors?null:a.channelFormGroup.controls.fundingAmount.errors.max),t.xp6(2),t.Q6J("step",1)("min",0),t.xp6(4),t.Q6J("ngIf",""!==a.channelConnectionError),t.xp6(3),t.Oqu(""!==a.channelConnectionError?"Retry":"Open Channel"),t.xp6(3),t.Oqu(null!=a.newlyAddedPeer&&a.newlyAddedPeer.nodeId?"Do It Later":"Close"))},dependencies:[c.O5,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.sg,d.u,F.BN,p.xw,p.Wh,p.yH,q.lW,b.dk,b.dn,x.TO,x.KE,x.bx,x.R9,M.Nt,re.Rr,Kt.C0,Kt.VY,Kt.Vq,W.h,$.q]})}function ir(i,n){if(1&i&&(t.TgZ(0,"mat-option",35),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}function ar(i,n){1&i&&t._UZ(0,"mat-progress-bar",36)}function or(i,n){1&i&&t._UZ(0,"th",37)}const pe=function(i){return{"mr-0":i}};function sr(i,n){if(1&i&&t._UZ(0,"span",41),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,pe,e.screenSize===e.screenSizeEnum.XS))}}function lr(i,n){if(1&i&&t._UZ(0,"span",42),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,pe,e.screenSize===e.screenSizeEnum.XS))}}function rr(i,n){if(1&i&&(t.TgZ(0,"td",38),t.YNc(1,sr,1,3,"span",39),t.YNc(2,lr,1,3,"span",40),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function cr(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Alias"),t.qZA())}const me=function(i){return{width:i}};function ur(i,n){if(1&i&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,me,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function pr(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Node ID"),t.qZA())}function mr(i,n){if(1&i&&(t.TgZ(0,"td",38)(1,"div",44)(2,"span",45),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,me,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function dr(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Network Address"),t.qZA())}function hr(i,n){if(1&i&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.hij(" ",null==e?null:e.address," ")}}function _r(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Channels"),t.qZA())}function gr(i,n){if(1&i&&(t.TgZ(0,"td",38),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null==e?null:e.channels)}}function fr(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",46)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Cr(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit,l=t.oxw();return t.KtG(l.onPeerDetach(o))}),t._uU(1,"Disconnect"),t.qZA()}}function xr(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"mat-option",49),t.NdJ("click",function(){t.CHM(e);const o=t.oxw().$implicit,l=t.oxw();return t.KtG(l.onConnectPeer(o))}),t._uU(1,"Reconnect"),t.qZA()}}function yr(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",50)(1,"div",47)(2,"mat-select",48),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",49),t.NdJ("click",function(o){const m=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onPeerClick(m,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",49),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.onOpenChannel(l))}),t._uU(7,"Open Channel"),t.qZA(),t.YNc(8,Cr,2,0,"mat-option",51),t.YNc(9,xr,2,0,"mat-option",51),t.qZA()()()}if(2&i){const e=n.$implicit;t.xp6(8),t.Q6J("ngIf","CONNECTED"===e.state),t.xp6(1),t.Q6J("ngIf","DISCONNECTED"===e.state)}}function Tr(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No connected peer."),t.qZA())}function br(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting peers..."),t.qZA())}function vr(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Lr(i,n){if(1&i&&(t.TgZ(0,"td",52),t.YNc(1,Tr,2,0,"p",53),t.YNc(2,br,2,0,"p",53),t.YNc(3,vr,2,1,"p",53),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers||null==e.peers.data?null:e.peers.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Sr=function(i){return{"display-none":i}};function Zr(i,n){if(1&i&&t._UZ(0,"tr",54),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Sr,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function Ar(i,n){1&i&&t._UZ(0,"tr",55)}function Er(i,n){1&i&&t._UZ(0,"tr",56)}const wr=function(){return["all"]},Ir=function(i){return{"error-border":i}},Fr=function(){return["no_peer"]};class Ft{constructor(n,e,a,o,l,m){this.logger=n,this.store=e,this.rtlEffects=a,this.actions=o,this.commonService=l,this.camelCaseWithSpaces=m,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"peers",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.faUsers=T.FVb,this.newlyAddedPeer="",this.displayedColumns=[],this.peerAddress="",this.peersData=[],this.peers=new r.by([]),this.information={},this.availableBalance=0,this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(g.yD).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.information=n}),this.store.select(g.nF).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("state"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.Bo).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.peersData=n.peers,this.loadPeersTable(this.peersData),this.logger.info(n)}),this.store.select(g.kY).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.availableBalance=n.onchainBalance.total||0}),this.actions.pipe((0,h.R)(this.unSubs[4]),(0,J.h)(n=>n.type===s.lr.SET_PEERS_ECL)).subscribe(n=>{this.peerAddress=null})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(n,e){const a=[[{key:"nodeId",value:n.nodeId,title:"Public Key",width:100}],[{key:"address",value:n.address,title:"Address",width:50},{key:"alias",value:n.alias,title:"Alias",width:50}],[{key:"state",value:this.commonService.titleCase(n.state||""),title:"State",width:50},{key:"channels",value:n.channels,title:"Channels",width:50}]];this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:n.nodeId,message:a}}}))}onConnectPeer(n){this.store.dispatch((0,Z.qR)({payload:{data:{message:{peer:n.nodeId?n:null,information:this.information,balance:this.availableBalance},component:It}}}))}onOpenChannel(n){const e={peer:n,information:this.information,balance:this.availableBalance};this.store.dispatch((0,Z.qR)({payload:{data:{alertTitle:"Open Channel",message:e,newlyAdded:!1,component:it}}}))}onPeerDetach(n){n&&n.channels&&n.channels>0?this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}})):this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(n.alias?n.alias:n.nodeId),noBtnText:"Cancel",yesBtnText:"Disconnect"}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[5])).subscribe(e=>{e&&this.store.dispatch((0,P.GD)({payload:{nodeId:n.nodeId||""}}))})}applyFilter(){this.peers.filter=this.selFilter.trim().toLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):this.commonService.titleCase(n)}setFilterPredicate(){this.peers.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=JSON.stringify(n).toLowerCase();break;case"state":a=n?.state?.toLowerCase()||"";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return"state"===this.selFilterBy?0===a.indexOf(e):a.includes(e)}}loadPeersTable(n){this.peers=n?new r.by([...n]):new r.by([]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(e,a)=>e[a]&&isNaN(e[a])?e[a].toLocaleLowerCase():e[a]?+e[a]:null,this.peers.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.peers.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter()}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Ft)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(ht.V),t.Y36(G.eX),t.Y36(O.v),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:Ft,selectors:[["rtl-ecl-peers"]],viewQuery:function(e,a){if(1&e&&(t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Peers")}])],decls:45,vars:17,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["peersForm","ngForm"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","nodeId"],["matColumnDef","address"],["matColumnDef","channels"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","State"],["mat-cell",""],["class","dot green","matTooltip","Connected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Disconnected","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Connected","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Disconnected","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],[3,"click",4,"ngIf"],["mat-footer-cellcolspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"form",1,2)(3,"button",3),t.NdJ("click",function(){return a.onConnectPeer({})}),t._uU(4,"Add Peer"),t.qZA()(),t.TgZ(5,"div",4)(6,"div",5)(7,"div",6),t._UZ(8,"fa-icon",7),t.TgZ(9,"span",8),t._uU(10,"Peers"),t.qZA()(),t.TgZ(11,"div",9)(12,"mat-form-field",10)(13,"mat-select",11),t.NdJ("ngModelChange",function(l){return a.selFilterBy=l})("selectionChange",function(){return a.selFilter="",a.applyFilter()}),t.YNc(14,ir,2,2,"mat-option",12),t.qZA()(),t.TgZ(15,"mat-form-field",10)(16,"input",13),t.NdJ("ngModelChange",function(l){return a.selFilter=l})("input",function(){return a.applyFilter()})("keyup",function(){return a.applyFilter()}),t.qZA()()()(),t.TgZ(17,"div",14),t.YNc(18,ar,1,0,"mat-progress-bar",15),t.TgZ(19,"table",16,17),t.ynx(21,18),t.YNc(22,or,1,0,"th",19),t.YNc(23,rr,3,2,"td",20),t.BQk(),t.ynx(24,21),t.YNc(25,cr,2,0,"th",22),t.YNc(26,ur,4,4,"td",20),t.BQk(),t.ynx(27,23),t.YNc(28,pr,2,0,"th",22),t.YNc(29,mr,4,4,"td",20),t.BQk(),t.ynx(30,24),t.YNc(31,dr,2,0,"th",22),t.YNc(32,hr,2,1,"td",20),t.BQk(),t.ynx(33,25),t.YNc(34,_r,2,0,"th",22),t.YNc(35,gr,2,1,"td",20),t.BQk(),t.ynx(36,26),t.YNc(37,fr,6,0,"th",27),t.YNc(38,yr,10,2,"td",28),t.BQk(),t.ynx(39,29),t.YNc(40,Lr,4,3,"td",30),t.BQk(),t.YNc(41,Zr,1,3,"tr",31),t.YNc(42,Ar,1,0,"tr",32),t.YNc(43,Er,1,0,"tr",33),t.qZA()(),t._UZ(44,"mat-paginator",34),t.qZA()()),2&e&&(t.xp6(8),t.Q6J("icon",a.faUsers),t.xp6(5),t.Q6J("ngModel",a.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(13,wr).concat(a.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",a.selFilter),t.xp6(2),t.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",a.peers)("ngClass",t.VKq(14,Ir,""!==a.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(16,Fr)),t.xp6(1),t.Q6J("matHeaderRowDef",a.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",a.displayedColumns),t.xp6(1),t.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},dependencies:[c.mk,c.sg,c.O5,c.PC,d._Y,d.Fj,d.JJ,d.JL,d.On,d.F,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,q.lW,x.KE,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,V.gM,S.NW,Q.$V],styles:[".mat-column-state[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}"]})}const qr=["queryRoutesForm"];function Nr(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Destination Node ID is required."),t.qZA())}function Or(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Pr(i,n){1&i&&t._UZ(0,"mat-progress-bar",21)}function Ur(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1," Alias"),t.qZA())}const de=function(i){return{"max-width":i}};function kr(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"span",41)(2,"span",42),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,de,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Dr(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1," ID"),t.qZA())}function Rr(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"span",41)(2,"span",42),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,de,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Jr(i,n){1&i&&(t.TgZ(0,"th",39)(1,"div",43),t._uU(2,"Actions"),t.qZA()())}function Mr(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",44)(1,"button",45),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw(2);return t.KtG(m.onHopClick(l))}),t._uU(2,"View Info"),t.qZA()()}}function Qr(i,n){1&i&&t._UZ(0,"tr",46)}function Yr(i,n){1&i&&t._UZ(0,"tr",47)}const Br=function(i){return{"overflow-auto error-border":i,"overflow-auto":!0}};function Hr(i,n){if(1&i&&(t.TgZ(0,"div",22)(1,"mat-expansion-panel",23)(2,"mat-expansion-panel-header")(3,"mat-panel-title",24)(4,"span",25),t._uU(5),t.qZA(),t.TgZ(6,"span",26),t._uU(7),t.ALo(8,"number"),t.qZA()()(),t.TgZ(9,"mat-panel-description",27)(10,"div",28)(11,"table",29,30),t.ynx(13,31),t.YNc(14,Ur,2,0,"th",32),t.YNc(15,kr,4,4,"td",33),t.BQk(),t.ynx(16,34),t.YNc(17,Dr,2,0,"th",32),t.YNc(18,Rr,4,4,"td",33),t.BQk(),t.ynx(19,35),t.YNc(20,Jr,3,0,"th",32),t.YNc(21,Mr,3,0,"td",36),t.BQk(),t.YNc(22,Qr,1,0,"tr",37),t.YNc(23,Yr,1,0,"tr",38),t.qZA()()()()()),2&i){const e=n.$implicit,a=n.index,o=t.oxw();t.xp6(5),t.hij("Route ",a+1,""),t.xp6(2),t.Oqu(t.lcZ(8,6,e.amount/1e3)),t.xp6(4),t.Q6J("dataSource",o.qrHops[a])("ngClass",t.VKq(8,Br,"error"===o.flgLoading[0])),t.xp6(11),t.Q6J("matHeaderRowDef",o.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",o.displayedColumns)}}class qt{constructor(n,e,a){this.store=n,this.eclEffects=e,this.commonService=a,this.allQRoutes=[],this.nodeId="",this.amount=0,this.qrHops=[],this.displayedColumns=["alias","nodeId","actions"],this.flgLoading=[!1],this.faRoute=T.FpQ,this.faExclamationTriangle=T.eHv,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.qrHops[0]=new r.by([]),this.qrHops[0].data=[],this.eclEffects.setQueryRoutes.pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{n&&n.routes&&n.routes.length?(this.flgLoading[0]=!1,this.allQRoutes=n.routes,this.allQRoutes.forEach((e,a)=>{this.qrHops[a]=new r.by([...e.nodeIds])})):(this.flgLoading[0]="error",this.allQRoutes=[],this.qrHops=[])})}onQueryRoutes(){if(!this.nodeId||!this.amount)return!0;this.qrHops=[],this.flgLoading[0]=!0,this.store.dispatch((0,P.WO)({payload:{nodeId:this.nodeId,amount:1e3*this.amount}}))}resetData(){this.allQRoutes=[],this.nodeId="",this.amount=0,this.flgLoading[0]=!1,this.qrHops=[],this.form.resetForm()}onHopClick(n){const e=[[{key:"alias",value:n.alias,title:"Alias",width:100,type:s.Gi.STRING}],[{key:"nodeId",value:n.nodeId,title:"Node ID",width:100,type:s.Gi.STRING}]];this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Route Information",message:e}}}))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||qt)(t.Y36(A.yh),t.Y36(Yt.o),t.Y36(O.v))};static#e=this.\u0275cmp=t.Xpm({type:qt,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(e,a){if(1&e&&t.Gf(qr,7),2&e){let o;t.iGM(o=t.CRH())&&(a.form=o.first)}},decls:28,vars:10,consts:[["fxLayout","column","fxFlex","100"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",3,"ngSubmit"],["queryRoutesForm","ngForm"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","69","fxLayoutAlign","start end"],["matInput","","placeholder","Destination Node ID","name","nodeId","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxFlex","29","fxLayoutAlign","start end"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","type","number","required","",3,"step","min","ngModel","ngModelChange"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4"],["fxLayout","row","fxLayoutAlign","start center",1,"page-sub-title-container","mt-2","mb-1"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["mode","indeterminate",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start",1,"padding-gap-x"],["fxFlex","100",4,"ngFor","ngForOf"],["mode","indeterminate"],["fxFlex","100"],[1,"flat-expansion-panel","help-expansion","mb-2px"],["fxLayout","row","fxLayoutAlign","space-between start"],["fxFlex","50","fxLayoutAlign","start start"],["fxFlex","50","fxLayoutAlign","end end"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"table-container","mb-2",3,"perfectScrollbar"],["mat-table","",3,"dataSource","ngClass"],["table[i]",""],["matColumnDef","alias"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","nodeId"],["matColumnDef","actions"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell",""],["mat-cell",""],["fxLayout","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(e,a){if(1&e){const o=t.EpF();t.TgZ(0,"div",0)(1,"form",1,2),t.NdJ("ngSubmit",function(){t.CHM(o);const m=t.MAs(2);return t.KtG(m.form.valid&&a.onQueryRoutes())}),t.TgZ(3,"div",3),t._UZ(4,"fa-icon",4),t.TgZ(5,"span"),t._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),t.qZA()(),t.TgZ(7,"mat-form-field",5)(8,"input",6,7),t.NdJ("ngModelChange",function(m){return a.nodeId=m}),t.qZA(),t.YNc(10,Nr,2,0,"mat-error",8),t.qZA(),t.TgZ(11,"mat-form-field",9)(12,"input",10),t.NdJ("ngModelChange",function(m){return a.amount=m}),t.qZA(),t.YNc(13,Or,2,0,"mat-error",8),t.qZA(),t.TgZ(14,"div",11)(15,"button",12),t.NdJ("click",function(){return a.resetData()}),t._uU(16,"Clear"),t.qZA(),t.TgZ(17,"button",13),t._uU(18,"Query Route"),t.qZA()()(),t.TgZ(19,"div",14)(20,"div",15),t._UZ(21,"fa-icon",16),t.TgZ(22,"span",17),t._uU(23,"Transaction Route"),t.qZA()()(),t.YNc(24,Pr,1,0,"mat-progress-bar",18),t.TgZ(25,"div",19)(26,"div",0),t.YNc(27,Hr,24,10,"div",20),t.qZA()()()}2&e&&(t.xp6(4),t.Q6J("icon",a.faExclamationTriangle),t.xp6(4),t.Q6J("ngModel",a.nodeId),t.xp6(2),t.Q6J("ngIf",!a.nodeId),t.xp6(2),t.Q6J("step",1e3)("min",0)("ngModel",a.amount),t.xp6(1),t.Q6J("ngIf",!a.amount),t.xp6(8),t.Q6J("icon",a.faRoute),t.xp6(3),t.Q6J("ngIf",!0===a.flgLoading[0]),t.xp6(3),t.Q6J("ngForOf",a.allQRoutes))},dependencies:[c.mk,c.sg,c.O5,c.PC,d._Y,d.Fj,d.wV,d.JJ,d.JL,d.Q7,d.qQ,d.On,d.F,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,q.lW,Y.ib,Y.yz,Y.yK,Y.u4,x.TO,x.KE,M.Nt,R.pW,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.ge,r.ev,r.XQ,r.Gk,Q.$V,$.q,c.JJ]})}function zr(i,n){if(1&i&&(t.TgZ(0,"mat-option",37),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw();t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}function Vr(i,n){1&i&&t._UZ(0,"mat-progress-bar",38)}function Gr(i,n){1&i&&t._UZ(0,"th",39)}function Kr(i,n){if(1&i&&(t.TgZ(0,"span",43),t._UZ(1,"fa-icon",44),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEyeSlash)}}function Wr(i,n){if(1&i&&(t.TgZ(0,"span",45),t._UZ(1,"fa-icon",44),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("icon",e.faEye)}}function $r(i,n){if(1&i&&(t.TgZ(0,"td",40),t.YNc(1,Kr,2,1,"span",41),t.YNc(2,Wr,2,1,"span",42),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Q6J("ngIf",!e.announceChannel),t.xp6(1),t.Q6J("ngIf",e.announceChannel)}}function Xr(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"State"),t.qZA())}function jr(i,n){if(1&i&&(t.TgZ(0,"td",40),t._uU(1),t.ALo(2,"titlecase"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(t.lcZ(2,1,null==e?null:e.state))}}function tc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Short Channel ID"),t.qZA())}function ec(i,n){if(1&i&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null==e?null:e.shortChannelId)}}function nc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Channel ID"),t.qZA())}const Wt=function(i){return{width:i}};function ic(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Wt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function ac(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Alias"),t.qZA())}function oc(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Wt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(e.alias)}}function sc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Node ID"),t.qZA())}function lc(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"div",47)(2,"span",48),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw();t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Wt,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function rc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Funder"),t.qZA())}function cc(i,n){if(1&i&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null!=e&&e.isFunder?"Yes":"No")}}function uc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Buried"),t.qZA())}function pc(i,n){if(1&i&&(t.TgZ(0,"td",40),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null!=e&&e.buried?"Yes":"No")}}function mc(i,n){1&i&&(t.TgZ(0,"th",49),t._uU(1,"Local Balance (Sats)"),t.qZA())}function dc(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toLocal,"1.0-0")," ")}}function hc(i,n){1&i&&(t.TgZ(0,"th",49),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function _c(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.toRemote,"1.0-0")," ")}}function gc(i,n){1&i&&(t.TgZ(0,"th",49),t._uU(1,"Local Fee/KW"),t.qZA())}function fc(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"span",50),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.hij(" ",t.xi3(3,1,null==e?null:e.feeRatePerKw,"1.0-0")," ")}}function Cc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Balance Score"),t.qZA())}function xc(i,n){if(1&i&&(t.TgZ(0,"td",40)(1,"div",51)(2,"mat-hint",52),t._uU(3),t.ALo(4,"number"),t.qZA()(),t._UZ(5,"mat-progress-bar",53),t.qZA()),2&i){const e=n.$implicit;t.xp6(3),t.Oqu(t.lcZ(4,2,(null==e?null:e.balancedness)||0)),t.xp6(2),t.s9C("value",e.toLocal&&e.toLocal>0?+e.toLocal/(+e.toLocal+ +e.toRemote)*100:0)}}function yc(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",54)(1,"div",55)(2,"mat-select",56),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function Tc(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",58)(1,"div",55)(2,"mat-select",59),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",57),t.NdJ("click",function(o){const m=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onChannelClick(m,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",57),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.onChannelClose(l,!0))}),t._uU(7,"Force Close"),t.qZA()()()()}}function bc(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No inactive channel available."),t.qZA())}function vc(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting inactive channels..."),t.qZA())}function Lc(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Oqu(e.errorMessage)}}function Sc(i,n){if(1&i&&(t.TgZ(0,"td",60),t.YNc(1,bc,2,0,"p",61),t.YNc(2,vc,2,0,"p",61),t.YNc(3,Lc,2,1,"p",61),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const Zc=function(i){return{"display-none":i}};function Ac(i,n){if(1&i&&t._UZ(0,"tr",62),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Zc,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Ec(i,n){1&i&&t._UZ(0,"tr",63)}function wc(i,n){1&i&&t._UZ(0,"tr",64)}const Ic=function(){return["all"]},Fc=function(i){return{"error-border":i}},qc=function(){return["no_channel"]};class Nt{constructor(n,e,a,o,l){this.logger=n,this.store=e,this.rtlEffects=a,this.commonService=o,this.camelCaseWithSpaces=l,this.faEye=T.Mdf,this.faEyeSlash=T.Aq,this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.PAGE_ID="peers_channels",this.tableSetting={tableId:"inactive_channels",recordsPerPage:s.IV,sortBy:"alias",sortOrder:s.Pi.DESCENDING},this.totalBalance=0,this.displayedColumns=[],this.channels=new r.by([]),this.myChanPolicy={},this.information={},this.numPeers=-1,this.feeRateTypes=s.vn,this.selFilter="",this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(g.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("announceChannel"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.Xz).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.inactiveChannels=n.inactiveChannels,this.loadChannelsTable(),this.logger.info(n)}),this.store.select(g.yD).pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{this.information=n}),this.store.select(g.Bo).pipe((0,h.R)(this.unSubs[3])).subscribe(n=>{this.numPeers=n.peers&&n.peers.length?n.peers.length:0}),this.store.select(g.kY).pipe((0,h.R)(this.unSubs[4])).subscribe(n=>{this.totalBalance=n.onchainBalance.total||0})}ngAfterViewInit(){this.inactiveChannels.length>0&&this.loadChannelsTable()}onChannelClose(n,e){const a=e?"Force Close Channel":"Close Channel",o=e?"Force Close":"Close Channel",l=e?"Force closing channel: "+(n.alias||n.shortChannelId?n.alias&&n.shortChannelId?n.alias+" ("+n.shortChannelId+")":n.alias?n.alias:n.shortChannelId:n.channelId):"Closing channel: "+(n.alias||n.shortChannelId?n.alias&&n.shortChannelId?n.alias+" ("+n.shortChannelId+")":n.alias?n.alias:n.shortChannelId:n.channelId);this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:a,titleMessage:l,noBtnText:"Cancel",yesBtnText:o}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[5])).subscribe(m=>{m&&this.store.dispatch((0,P.BL)({payload:{channelId:n.channelId||"",force:e}}))})}onChannelClick(n,e){this.store.dispatch((0,Z.qR)({payload:{data:{channel:n,channelsType:"inactive",component:X}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLocaleLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):"announceChannel"===n?"Private":this.commonService.titleCase(n)}setFilterPredicate(){this.channels.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=JSON.stringify(n).toLowerCase();break;case"announceChannel":a=n?.announceChannel?"public":"private";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return a.includes(e)}}loadChannelsTable(){this.channels=new r.by([...this.inactiveChannels]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(n,e)=>n[e]&&isNaN(n[e])?n[e].toLocaleLowerCase():n[e]?+n[e]:null,this.channels.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.channels.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.channels)}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"InactiveChannels")}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Nt)(t.Y36(N.mQ),t.Y36(A.yh),t.Y36(ht.V),t.Y36(O.v),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:Nt,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(e,a){if(1&e&&(t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:58,vars:16,consts:[["fxLayout","column",1,"padding-gap"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","announceChannel"],["mat-header-cell","","mat-sort-header","","matTooltip","Private",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","state"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","shortChannelId"],["matColumnDef","channelId"],["matColumnDef","alias"],["matColumnDef","nodeId"],["matColumnDef","isFunder"],["matColumnDef","buried"],["matColumnDef","toLocal"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","toRemote"],["matColumnDef","feeRatePerKw"],["matColumnDef","balancedness"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],[3,"value"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","matTooltip","Private"],["mat-cell",""],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cellcolspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"div",1),t._UZ(2,"div",2),t.TgZ(3,"div",3)(4,"mat-form-field",4)(5,"mat-select",5),t.NdJ("ngModelChange",function(l){return a.selFilterBy=l})("selectionChange",function(){return a.selFilter="",a.applyFilter()}),t.YNc(6,zr,2,2,"mat-option",6),t.qZA()(),t.TgZ(7,"mat-form-field",4)(8,"input",7),t.NdJ("ngModelChange",function(l){return a.selFilter=l})("input",function(){return a.applyFilter()})("keyup",function(){return a.applyFilter()}),t.qZA()()()(),t.TgZ(9,"div",8),t.YNc(10,Vr,1,0,"mat-progress-bar",9),t.TgZ(11,"table",10,11),t.ynx(13,12),t.YNc(14,Gr,1,0,"th",13),t.YNc(15,$r,3,2,"td",14),t.BQk(),t.ynx(16,15),t.YNc(17,Xr,2,0,"th",16),t.YNc(18,jr,3,3,"td",14),t.BQk(),t.ynx(19,17),t.YNc(20,tc,2,0,"th",16),t.YNc(21,ec,2,1,"td",14),t.BQk(),t.ynx(22,18),t.YNc(23,nc,2,0,"th",16),t.YNc(24,ic,4,4,"td",14),t.BQk(),t.ynx(25,19),t.YNc(26,ac,2,0,"th",16),t.YNc(27,oc,4,4,"td",14),t.BQk(),t.ynx(28,20),t.YNc(29,sc,2,0,"th",16),t.YNc(30,lc,4,4,"td",14),t.BQk(),t.ynx(31,21),t.YNc(32,rc,2,0,"th",16),t.YNc(33,cc,2,1,"td",14),t.BQk(),t.ynx(34,22),t.YNc(35,uc,2,0,"th",16),t.YNc(36,pc,2,1,"td",14),t.BQk(),t.ynx(37,23),t.YNc(38,mc,2,0,"th",24),t.YNc(39,dc,4,4,"td",14),t.BQk(),t.ynx(40,25),t.YNc(41,hc,2,0,"th",24),t.YNc(42,_c,4,4,"td",14),t.BQk(),t.ynx(43,26),t.YNc(44,gc,2,0,"th",24),t.YNc(45,fc,4,4,"td",14),t.BQk(),t.ynx(46,27),t.YNc(47,Cc,2,0,"th",16),t.YNc(48,xc,6,4,"td",14),t.BQk(),t.ynx(49,28),t.YNc(50,yc,6,0,"th",29),t.YNc(51,Tc,8,0,"td",30),t.BQk(),t.ynx(52,31),t.YNc(53,Sc,4,3,"td",32),t.BQk(),t.YNc(54,Ac,1,3,"tr",33),t.YNc(55,Ec,1,0,"tr",34),t.YNc(56,wc,1,0,"tr",35),t.qZA()(),t._UZ(57,"mat-paginator",36),t.qZA()),2&e&&(t.xp6(5),t.Q6J("ngModel",a.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(12,Ic).concat(a.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",a.selFilter),t.xp6(2),t.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",a.channels)("ngClass",t.VKq(13,Fc,""!==a.errorMessage)),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(15,qc)),t.xp6(1),t.Q6J("matHeaderRowDef",a.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",a.displayedColumns),t.xp6(1),t.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},dependencies:[c.mk,c.sg,c.O5,c.PC,d.Fj,d.JJ,d.On,F.BN,p.xw,p.Wh,p.yH,L.oO,L.Zl,x.KE,x.bx,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,V.gM,S.NW,Q.$V,c.JJ,c.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;min-width:15rem;max-width:30rem}"]})}function Nc(i,n){if(1&i&&(t.TgZ(0,"div",5),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function Oc(i,n){if(1&i&&(t.TgZ(0,"mat-option",13),t._uU(1),t.qZA()),2&i){const e=n.$implicit,a=t.oxw(2);t.Q6J("value",e),t.xp6(1),t.Oqu(a.getLabel(e))}}const Pc=function(){return["all"]};function Uc(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",6),t._UZ(1,"div",7),t.TgZ(2,"div",8)(3,"mat-form-field",9)(4,"mat-select",10),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilterBy=o)})("selectionChange",function(){t.CHM(e);const o=t.oxw();return o.selFilter="",t.KtG(o.applyFilter())}),t.YNc(5,Oc,2,2,"mat-option",11),t.qZA()(),t.TgZ(6,"mat-form-field",9)(7,"input",12),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.selFilter=o)})("input",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())})("keyup",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.applyFilter())}),t.qZA()()()()}if(2&i){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.selFilterBy),t.xp6(1),t.Q6J("ngForOf",t.DdM(3,Pc).concat(e.displayedColumns.slice(0,-1))),t.xp6(2),t.Q6J("ngModel",e.selFilter)}}function kc(i,n){1&i&&t._UZ(0,"mat-progress-bar",42)}function Dc(i,n){1&i&&t._UZ(0,"th",43)}const Rc=function(i){return{"ml-0":i}};function Jc(i,n){if(1&i&&(t._UZ(0,"span",46),t.ALo(1,"camelcase")),2&i){const e=t.oxw().$implicit,a=t.oxw(2);t.s9C("matTooltip",t.lcZ(1,2,null==e?null:e.type)),t.Q6J("ngClass",t.VKq(4,Rc,a.screenSize===a.screenSizeEnum.XS))}}function Mc(i,n){if(1&i&&(t.TgZ(0,"td",44),t.YNc(1,Jc,2,6,"span",45),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Q6J("ngIf","payment-relayed"!==(null==e?null:e.type))}}function Qc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Date/Time"),t.qZA())}function Yc(i,n){if(1&i&&(t.TgZ(0,"td",44),t._uU(1),t.ALo(2,"date"),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.hij(" ",t.xi3(2,1,null==e?null:e.timestamp,"dd/MMM/y HH:mm")," ")}}function Bc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"In Channel ID"),t.qZA())}const at=function(i){return{width:i}};function Hc(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelId)}}function zc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"In Channel Short ID"),t.qZA())}function Vc(i,n){if(1&i&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null==e?null:e.fromShortChannelId)}}function Gc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"In Channel"),t.qZA())}function Kc(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelAlias)}}function Wc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel ID"),t.qZA())}function $c(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelId)}}function Xc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel Short ID"),t.qZA())}function jc(i,n){if(1&i&&(t.TgZ(0,"td",44),t._uU(1),t.qZA()),2&i){const e=n.$implicit;t.xp6(1),t.Oqu(null==e?null:e.toShortChannelId)}}function tu(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel"),t.qZA())}function eu(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelAlias)}}function nu(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Payment Hash"),t.qZA())}function iu(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"div",48)(2,"span",49),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,at,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function au(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Amount In (Sats)"),t.qZA())}function ou(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountIn))}}function su(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Amount Out (Sats)"),t.qZA())}function lu(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,null==e?null:e.amountOut))}}function ru(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Fee Earned (Sats)"),t.qZA())}function cu(i,n){if(1&i&&(t.TgZ(0,"td",44)(1,"span",51),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,(null==e?null:e.amountIn)-(null==e?null:e.amountOut)))}}function uu(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"th",52)(1,"div",53)(2,"mat-select",54),t._UZ(3,"mat-select-trigger"),t.TgZ(4,"mat-option",55),t.NdJ("click",function(){t.CHM(e);const o=t.oxw(2);return t.KtG(o.onDownloadCSV())}),t._uU(5,"Download CSV"),t.qZA()()()()}}function pu(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",56)(1,"button",57),t.NdJ("click",function(o){const m=t.CHM(e).$implicit,y=t.oxw(2);return t.KtG(y.onForwardingEventClick(m,o))}),t._uU(2,"View Info"),t.qZA()()}}function mu(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No forwarding history available."),t.qZA())}function du(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting forwarding history..."),t.qZA())}function hu(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function _u(i,n){if(1&i&&(t.TgZ(0,"td",58),t.YNc(1,mu,2,0,"p",59),t.YNc(2,du,2,0,"p",59),t.YNc(3,hu,2,1,"p",59),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const gu=function(i){return{"display-none":i}};function fu(i,n){if(1&i&&t._UZ(0,"tr",60),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,gu,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function Cu(i,n){1&i&&t._UZ(0,"tr",61)}function xu(i,n){1&i&&t._UZ(0,"tr",62)}const yu=function(){return["no_event"]};function Tu(i,n){if(1&i&&(t.TgZ(0,"div",14),t.YNc(1,kc,1,0,"mat-progress-bar",15),t.TgZ(2,"table",16,17),t.ynx(4,18),t.YNc(5,Dc,1,0,"th",19),t.YNc(6,Mc,2,1,"td",20),t.BQk(),t.ynx(7,21),t.YNc(8,Qc,2,0,"th",22),t.YNc(9,Yc,3,4,"td",20),t.BQk(),t.ynx(10,23),t.YNc(11,Bc,2,0,"th",22),t.YNc(12,Hc,4,4,"td",20),t.BQk(),t.ynx(13,24),t.YNc(14,zc,2,0,"th",22),t.YNc(15,Vc,2,1,"td",20),t.BQk(),t.ynx(16,25),t.YNc(17,Gc,2,0,"th",22),t.YNc(18,Kc,4,4,"td",20),t.BQk(),t.ynx(19,26),t.YNc(20,Wc,2,0,"th",22),t.YNc(21,$c,4,4,"td",20),t.BQk(),t.ynx(22,27),t.YNc(23,Xc,2,0,"th",22),t.YNc(24,jc,2,1,"td",20),t.BQk(),t.ynx(25,28),t.YNc(26,tu,2,0,"th",22),t.YNc(27,eu,4,4,"td",20),t.BQk(),t.ynx(28,29),t.YNc(29,nu,2,0,"th",22),t.YNc(30,iu,4,4,"td",20),t.BQk(),t.ynx(31,30),t.YNc(32,au,2,0,"th",31),t.YNc(33,ou,4,3,"td",20),t.BQk(),t.ynx(34,32),t.YNc(35,su,2,0,"th",31),t.YNc(36,lu,4,3,"td",20),t.BQk(),t.ynx(37,33),t.YNc(38,ru,2,0,"th",31),t.YNc(39,cu,4,3,"td",20),t.BQk(),t.ynx(40,34),t.YNc(41,uu,6,0,"th",35),t.YNc(42,pu,3,0,"td",36),t.BQk(),t.ynx(43,37),t.YNc(44,_u,4,3,"td",38),t.BQk(),t.YNc(45,fu,1,3,"tr",39),t.YNc(46,Cu,1,0,"tr",40),t.YNc(47,xu,1,0,"tr",41),t.qZA()()),2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.forwardingHistoryEvents),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(5,yu)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}function bu(i,n){if(1&i&&t._UZ(0,"mat-paginator",63),2&i){const e=t.oxw();t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}class ot{constructor(n,e,a,o,l){this.logger=n,this.commonService=e,this.store=a,this.datePipe=o,this.camelCaseWithSpaces=l,this.pageId="routing",this.tableId="forwarding_history",this.eventsData=[],this.selFilter="",this.nodePageDefs=s.Xk,this.selFilterBy="all",this.colWidth="20rem",this.tableSetting={tableId:"forwarding_history",recordsPerPage:s.IV,sortBy:"timestamp",sortOrder:s.Pi.DESCENDING},this.displayedColumns=[],this.forwardingHistoryEvents=new r.by([]),this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(g.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting.tableId=this.tableId,this.tableSetting=n.pageSettings.find(e=>e.pageId===this.pageId)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.pageId)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.unshift("type"),this.displayedColumns.push("actions"),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.PP).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{0===this.eventsData.length&&(this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.eventsData=n.payments&&n.payments.relayed?n.payments.relayed:[],this.eventsData.length>0&&this.sort&&this.paginator&&this.displayedColumns.length>0&&this.loadForwardingEventsTable(this.eventsData),this.logger.info(this.eventsData))})}ngAfterViewInit(){setTimeout(()=>{this.eventsData.length>0&&this.loadForwardingEventsTable(this.eventsData)},0)}ngOnChanges(n){n.eventsData&&(this.apiCallStatus={status:s.Bn.COMPLETED,action:"FetchPayments"},this.eventsData=n.eventsData.currentValue,n.eventsData.firstChange||this.loadForwardingEventsTable(this.eventsData)),n.selFilter&&!n.selFilter.firstChange&&(this.selFilterBy="all",this.applyFilter())}onForwardingEventClick(n,e){const a=[[{key:"paymentHash",value:n.paymentHash,title:"Payment Hash",width:100,type:s.Gi.STRING}],[{key:"timestamp",value:Math.round((n.timestamp||0)/1e3),title:"Date/Time",width:50,type:s.Gi.DATE_TIME},{key:"fee",value:(n.amountIn||0)-(n.amountOut||0),title:"Fee Earned (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"amountIn",value:n.amountIn,title:"Amount In (Sats)",width:50,type:s.Gi.NUMBER},{key:"amountOut",value:n.amountOut,title:"Amount Out (Sats)",width:50,type:s.Gi.NUMBER}],[{key:"fromChannelAlias",value:n.fromChannelAlias,title:"From Channel Alias",width:50,type:s.Gi.STRING},{key:"fromShortChannelId",value:n.fromShortChannelId,title:"From Short Channel ID",width:50,type:s.Gi.STRING}],[{key:"fromChannelId",value:n.fromChannelId,title:"From Channel ID",width:100,type:s.Gi.STRING}],[{key:"toChannelAlias",value:n.toChannelAlias,title:"To Channel Alias",width:50,type:s.Gi.STRING},{key:"toShortChannelId",value:n.toShortChannelId,title:"To Short Channel ID",width:50,type:s.Gi.STRING}],[{key:"toChannelId",value:n.toChannelId,title:"To Channel ID",width:100,type:s.Gi.STRING}]];"payment-relayed"!==n.type&&a?.unshift([{key:"type",value:this.commonService.camelCase(n.type),title:"Relay Type",width:100,type:s.Gi.STRING}]),this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Event Information",message:a}}}))}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.selFilter.trim().toLowerCase())}getLabel(n){const e=this.nodePageDefs[this.pageId][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column):this.commonService.titleCase(n)}setFilterPredicate(){this.forwardingHistoryEvents.filterPredicate=(n,e)=>{let a="";switch(this.selFilterBy){case"all":a=(n.timestamp?this.datePipe.transform(new Date(n.timestamp),"dd/MMM/y HH:mm")?.toLowerCase():"")+JSON.stringify(n).toLowerCase();break;case"timestamp":a=this.datePipe.transform(new Date(n.timestamp||0),"dd/MMM/y HH:mm")?.toLowerCase()||"";break;case"fee":a=(n.amountIn-n.amountOut).toString()||"0";break;default:a=typeof n[this.selFilterBy]>"u"?"":"string"==typeof n[this.selFilterBy]?n[this.selFilterBy].toLowerCase():"boolean"==typeof n[this.selFilterBy]?n[this.selFilterBy]?"yes":"no":n[this.selFilterBy].toString()}return a.includes(e)}}loadForwardingEventsTable(n){this.forwardingHistoryEvents=new r.by([...n]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(e,a)=>"fee"===a?e.amountIn-e.amountOut:e[a]&&isNaN(e[a])?e[a].toLocaleLowerCase():e[a]?+e[a]:null,this.forwardingHistoryEvents.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.forwardingHistoryEvents.paginator=this.paginator,this.setFilterPredicate(),this.applyFilter(),this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents&&this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||ot)(t.Y36(N.mQ),t.Y36(O.v),t.Y36(A.yh),t.Y36(c.uU),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:ot,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(e,a){if(1&e&&(t.Gf(v.YE,5),t.Gf(S.NW,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sort=o.first),t.iGM(o=t.CRH())&&(a.paginator=o.first)}},inputs:{pageId:"pageId",tableId:"tableId",eventsData:"eventsData",selFilter:"selFilter"},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Events")}]),t.TTD],decls:5,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch","class","page-sub-title-container",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100","class","table-container",3,"perfectScrollbar",4,"ngIf"],["class","mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxFlex","49"],["placeholder","Filter By","tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],[3,"value"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","type"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","fromChannelId"],["matColumnDef","fromShortChannelId"],["matColumnDef","fromChannelAlias"],["matColumnDef","toChannelId"],["matColumnDef","toShortChannelId"],["matColumnDef","toChannelAlias"],["matColumnDef","paymentHash"],["matColumnDef","amountIn"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amountOut"],["matColumnDef","fee"],["matColumnDef","actions"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_event"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","matTooltip","Type (if not payment relayed)"],["mat-cell",""],["class","dot yellow","matTooltipPosition","right",3,"matTooltip","ngClass",4,"ngIf"],["matTooltipPosition","right",1,"dot","yellow",3,"matTooltip","ngClass"],["mat-header-cell","","mat-sort-header",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell",""],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center"],["mat-stroked-button","","color","primary","type","button","tabindex","4",1,"table-actions-button",3,"click"],["mat-footer-cellcolspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Nc,2,1,"div",1),t.YNc(2,Uc,8,4,"div",2),t.YNc(3,Tu,48,6,"div",3),t.YNc(4,bu,1,3,"mat-paginator",4),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==a.errorMessage),t.xp6(1),t.Q6J("ngIf",""===a.errorMessage),t.xp6(1),t.Q6J("ngIf",""===a.errorMessage),t.xp6(1),t.Q6J("ngIf",""===a.errorMessage))},dependencies:[c.mk,c.sg,c.O5,c.PC,d.Fj,d.JJ,d.On,p.xw,p.Wh,p.yH,L.oO,L.Zl,q.lW,x.KE,M.Nt,R.pW,U.gD,U.$L,B.ey,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,V.gM,S.NW,Q.$V,c.JJ,c.uU,H.h9],styles:[".mat-column-type[_ngcontent-%COMP%]{max-width:1.2rem;width:1.2rem}.mat-column-type[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{max-width:1.6rem;width:1.6rem}"]})}const vu=["tableIn"],Lu=["tableOut"],Su=["paginatorIn"],Zu=["paginatorOut"];function Au(i,n){if(1&i&&(t.TgZ(0,"div",3),t._uU(1),t.qZA()),2&i){const e=t.oxw();t.xp6(1),t.Oqu(e.errorMessage)}}function Eu(i,n){1&i&&t._UZ(0,"mat-progress-bar",34)}function wu(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}const Ot=function(i){return{width:i}};function Iu(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ot,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Fu(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function qu(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ot,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Nu(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Ou(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function Pu(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Uu(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function ku(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function Du(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function Ru(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No incoming routing peer available."),t.qZA())}function Ju(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting incoming routing peers..."),t.qZA())}function Mu(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function Qu(i,n){if(1&i&&(t.TgZ(0,"td",41),t.YNc(1,Ru,2,0,"p",42),t.YNc(2,Ju,2,0,"p",42),t.YNc(3,Mu,2,1,"p",42),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersIncoming&&e.routingPeersIncoming.data)||(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}const he=function(i){return{"display-none":i}};function Yu(i,n){if(1&i&&t._UZ(0,"tr",43),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,he,(null==e.routingPeersIncoming?null:e.routingPeersIncoming.data)&&(null==e.routingPeersIncoming||null==e.routingPeersIncoming.data?null:e.routingPeersIncoming.data.length)>0))}}function Bu(i,n){1&i&&t._UZ(0,"tr",44)}function Hu(i,n){1&i&&t._UZ(0,"tr",45)}function zu(i,n){1&i&&t._UZ(0,"mat-progress-bar",34)}function Vu(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}function Gu(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ot,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Ku(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Wu(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"div",37)(2,"span",38),t._uU(3),t.qZA()()()),2&i){const e=n.$implicit,a=t.oxw(2);t.xp6(1),t.Q6J("ngStyle",t.VKq(2,Ot,a.screenSize===a.screenSizeEnum.XS?"10rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function $u(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Xu(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.events))}}function ju(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function tp(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalAmount))}}function ep(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function np(i,n){if(1&i&&(t.TgZ(0,"td",36)(1,"span",40),t._uU(2),t.ALo(3,"number"),t.qZA()()),2&i){const e=n.$implicit;t.xp6(2),t.Oqu(t.lcZ(3,1,e.totalFee))}}function ip(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No outgoing routing peer available."),t.qZA())}function ap(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting outgoing routing peers..."),t.qZA())}function op(i,n){if(1&i&&(t.TgZ(0,"p"),t._uU(1),t.qZA()),2&i){const e=t.oxw(3);t.xp6(1),t.Oqu(e.errorMessage)}}function sp(i,n){if(1&i&&(t.TgZ(0,"td",41),t.YNc(1,ip,2,0,"p",42),t.YNc(2,ap,2,0,"p",42),t.YNc(3,op,2,1,"p",42),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.COMPLETED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("ngIf",(!(null!=e.routingPeersOutgoing&&e.routingPeersOutgoing.data)||(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)<1)&&e.apiCallStatus.status===e.apiCallStatusEnum.ERROR)}}function lp(i,n){if(1&i&&t._UZ(0,"tr",43),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,he,(null==e.routingPeersOutgoing?null:e.routingPeersOutgoing.data)&&(null==e.routingPeersOutgoing||null==e.routingPeersOutgoing.data?null:e.routingPeersOutgoing.data.length)>0))}}function rp(i,n){1&i&&t._UZ(0,"tr",44)}function cp(i,n){1&i&&t._UZ(0,"tr",45)}const up=function(i,n){return{"mt-2":i,"mt-1":n}},pp=function(){return["no_incoming_event"]},mp=function(i){return{"mt-2":i}},dp=function(){return["no_outgoing_event"]};function hp(i,n){if(1&i&&(t.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7),t._uU(4,"Incoming"),t.qZA(),t._UZ(5,"div",8),t.qZA(),t.TgZ(6,"div",9),t.YNc(7,Eu,1,0,"mat-progress-bar",10),t.TgZ(8,"table",11,12),t.ynx(10,13),t.YNc(11,wu,2,0,"th",14),t.YNc(12,Iu,4,4,"td",15),t.BQk(),t.ynx(13,16),t.YNc(14,Fu,2,0,"th",14),t.YNc(15,qu,4,4,"td",15),t.BQk(),t.ynx(16,17),t.YNc(17,Nu,2,0,"th",18),t.YNc(18,Ou,4,3,"td",15),t.BQk(),t.ynx(19,19),t.YNc(20,Pu,2,0,"th",18),t.YNc(21,Uu,4,3,"td",15),t.BQk(),t.ynx(22,20),t.YNc(23,ku,2,0,"th",18),t.YNc(24,Du,4,3,"td",15),t.BQk(),t.ynx(25,21),t.YNc(26,Qu,4,3,"td",22),t.BQk(),t.YNc(27,Yu,1,3,"tr",23),t.YNc(28,Bu,1,0,"tr",24),t.YNc(29,Hu,1,0,"tr",25),t.qZA()(),t._UZ(30,"mat-paginator",26,27),t.qZA(),t.TgZ(32,"div",28)(33,"div",6)(34,"div",7),t._uU(35,"Outgoing"),t.qZA(),t._UZ(36,"div",8),t.qZA(),t.TgZ(37,"div",29),t.YNc(38,zu,1,0,"mat-progress-bar",10),t.TgZ(39,"table",30,31),t.ynx(41,13),t.YNc(42,Vu,2,0,"th",14),t.YNc(43,Gu,4,4,"td",15),t.BQk(),t.ynx(44,16),t.YNc(45,Ku,2,0,"th",14),t.YNc(46,Wu,4,4,"td",15),t.BQk(),t.ynx(47,17),t.YNc(48,$u,2,0,"th",18),t.YNc(49,Xu,4,3,"td",15),t.BQk(),t.ynx(50,19),t.YNc(51,ju,2,0,"th",18),t.YNc(52,tp,4,3,"td",15),t.BQk(),t.ynx(53,20),t.YNc(54,ep,2,0,"th",18),t.YNc(55,np,4,3,"td",15),t.BQk(),t.ynx(56,32),t.YNc(57,sp,4,3,"td",22),t.BQk(),t.YNc(58,lp,1,3,"tr",23),t.YNc(59,rp,1,0,"tr",24),t.YNc(60,cp,1,0,"tr",25),t.qZA(),t._UZ(61,"mat-paginator",26,33),t.qZA()()()),2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngClass",t.WLB(18,up,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.routingPeersIncoming),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(21,pp)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS),t.xp6(3),t.Q6J("ngClass",t.VKq(22,mp,e.screenSize!==e.screenSizeEnum.LG)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("dataSource",e.routingPeersOutgoing),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(24,dp)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns),t.xp6(1),t.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}class Pt{constructor(n,e,a,o){this.logger=n,this.commonService=e,this.store=a,this.camelCaseWithSpaces=o,this.nodePageDefs=s.Xk,this.selFilterByIn="all",this.selFilterByOut="all",this.colWidth="20rem",this.PAGE_ID="routing",this.tableSetting={tableId:"routing_peers",recordsPerPage:s.IV,sortBy:"totalFee",sortOrder:s.Pi.DESCENDING},this.routingPeersData=[],this.displayedColumns=[],this.routingPeersIncoming=new r.by([]),this.routingPeersOutgoing=new r.by([]),this.pageSize=s.IV,this.pageSizeOptions=s.TJ,this.screenSize="",this.screenSizeEnum=s.cu,this.errorMessage="",this.filterIn="",this.filterOut="",this.apiCallStatus=null,this.apiCallStatusEnum=s.Bn,this.unSubs=[new u.x,new u.x,new u.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(g.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message||""),this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.pageSize=this.tableSetting.recordsPerPage?+this.tableSetting.recordsPerPage:s.IV,this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/(2*this.displayedColumns.length)/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.PP).pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{this.errorMessage="",this.apiCallStatus=n.apiCallStatus,this.apiCallStatus.status===s.Bn.ERROR&&(this.errorMessage=this.apiCallStatus.message?"object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message:""),this.routingPeersData=n.payments&&n.payments.relayed?n.payments.relayed:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(n)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData)}applyFilterIncoming(){this.routingPeersIncoming.filter=this.filterIn.trim().toLowerCase()}applyFilterOutgoing(){this.routingPeersOutgoing.filter=this.filterOut.trim().toLowerCase()}getLabel(n){const e=this.nodePageDefs[this.PAGE_ID][this.tableSetting.tableId].allowedColumns.find(a=>a.column===n);return e?e.label?e.label:this.camelCaseWithSpaces.transform(e.column,"_"):this.commonService.titleCase(n)}setFilterPredicate(){this.routingPeersIncoming.filterPredicate=(n,e)=>{let a="";if("all"===this.selFilterByIn)a=JSON.stringify(n).toLowerCase();else a="string"==typeof n[this.selFilterByIn]?n[this.selFilterByIn].toLowerCase():"boolean"==typeof n[this.selFilterByIn]?n[this.selFilterByIn]?"yes":"no":n[this.selFilterByIn].toString();return a.includes(e)},this.routingPeersOutgoing.filterPredicate=(n,e)=>{let a="";switch(this.selFilterByOut){case"all":a=JSON.stringify(n).toLowerCase();break;case"total_amount":case"total_fee":a=(+(n[this.selFilterByOut]||0)/1e3).toString()||"";break;default:a="string"==typeof n[this.selFilterByOut]?n[this.selFilterByOut].toLowerCase():"boolean"==typeof n[this.selFilterByOut]?n[this.selFilterByOut]?"yes":"no":n[this.selFilterByOut].toString()}return a.includes(e)}}loadRoutingPeersTable(n){if(n.length>0){const e=this.groupRoutingPeers(n);this.routingPeersIncoming=new r.by(e[0]),this.routingPeersIncoming.sort=this.sortIn,this.routingPeersIncoming.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.routingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.routingPeersIncoming),this.routingPeersOutgoing=new r.by(e[1]),this.routingPeersOutgoing.sort=this.sortOut,this.routingPeersOutgoing.sort?.sort({id:this.tableSetting.sortBy,start:this.tableSetting.sortOrder,disableClear:!0}),this.routingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.routingPeersOutgoing)}else this.routingPeersIncoming=new r.by([]),this.routingPeersOutgoing=new r.by([]);this.setFilterPredicate(),this.applyFilterIncoming(),this.applyFilterOutgoing()}groupRoutingPeers(n){const e=[],a=[];return n.forEach(o=>{const l=e.find(y=>y.channelId===o.fromChannelId),m=a.find(y=>y.channelId===o.toChannelId);l?(l.events++,l.totalAmount=+l.totalAmount+ +o.amountIn,l.totalFee=+l.totalFee+(o.amountIn-o.amountOut)):e.push({channelId:o.fromChannelId,alias:o.fromChannelAlias,events:1,totalAmount:+o.amountIn,totalFee:o.amountIn-o.amountOut}),m?(m.events++,m.totalAmount=+m.totalAmount+ +o.amountOut,m.totalFee=+m.totalFee+(o.amountIn-o.amountOut)):a.push({channelId:o.toChannelId,alias:o.toChannelAlias,events:1,totalAmount:+o.amountOut,totalFee:o.amountIn-o.amountOut})}),[this.commonService.sortDescByKey(e,"totalFee"),this.commonService.sortDescByKey(a,"totalFee")]}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Pt)(t.Y36(N.mQ),t.Y36(O.v),t.Y36(A.yh),t.Y36(H.i1))};static#e=this.\u0275cmp=t.Xpm({type:Pt,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(e,a){if(1&e&&(t.Gf(vu,5,v.YE),t.Gf(Lu,5,v.YE),t.Gf(Su,5),t.Gf(Zu,5)),2&e){let o;t.iGM(o=t.CRH())&&(a.sortIn=o.first),t.iGM(o=t.CRH())&&(a.sortOut=o.first),t.iGM(o=t.CRH())&&(a.paginatorIn=o.first),t.iGM(o=t.CRH())&&(a.paginatorOut=o.first)}},features:[t._Bn([{provide:S.ye,useValue:(0,s.pt)("Peers")}])],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch","class","page-sub-title-container mt-2",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between stretch",1,"page-sub-title-container","mt-2"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start stretch",1,"mb-4"],["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"page-sub-title-container","w-100",3,"ngClass"],["fxFlex","70"],["fxFlex.gt-xs","30","fxLayoutAlign.gt-xs","space-between center","fxLayout","row","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","start start","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","channelId"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","totalAmount"],["matColumnDef","totalFee"],["matColumnDef","no_incoming_event"],["mat-footer-cellcolspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginatorIn",""],["fxLayout","column","fxFlex","49","fxLayoutAlign","end stretch",1,"mb-4"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",1,"overflow-auto","outgoing-table",3,"dataSource"],["tableOut",""],["matColumnDef","no_outgoing_event"],["paginatorOut",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-footer-cellcolspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(e,a){1&e&&(t.TgZ(0,"div",0),t.YNc(1,Au,2,1,"div",1),t.YNc(2,hp,63,25,"div",2),t.qZA()),2&e&&(t.xp6(1),t.Q6J("ngIf",""!==a.errorMessage),t.xp6(1),t.Q6J("ngIf",""===a.errorMessage))},dependencies:[c.mk,c.O5,c.PC,p.xw,p.Wh,p.yH,L.oO,L.Zl,R.pW,v.YE,v.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.XQ,r.Gk,r.Q2,S.NW,Q.$V,c.JJ]})}function _p(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",8),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit,a=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",a.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}class Ut{constructor(n){this.router=n,this.faChartBar=T.koM,this.links=[{link:"routingreport",name:"Routing"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){const n=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=n?n.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(e=>e instanceof C.Av)).subscribe({next:e=>{const a=this.links.find(o=>e.urlAfterRedirects.includes(o.link));this.activeLink=a?a.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Ut)(t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:Ut,selectors:[["rtl-ecl-reports"]],decls:12,vars:3,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar","",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Reports"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,_p,2,3,"div",6),t.qZA(),t._UZ(9,"mat-tab-nav-panel",null,7)(11,"router-outlet"),t.qZA()()()),2&e){const o=t.MAs(10);t.xp6(1),t.Q6J("icon",a.faChartBar),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",a.links)}},dependencies:[c.sg,F.BN,p.xw,p.Wh,b.a8,b.dn,E.BU,E.sW,E.Nj,C.lC,C.rH]})}var _e=_(7772),ge=_(8182),fe=_(7671);function gp(i,n){if(1&i&&(t.TgZ(0,"div",13),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&i){const e=t.oxw();t.Q6J("@fadeIn",e.totalFeeSat),t.xp6(1),t.AsE("",t.xi3(2,3,e.totalFeeSat||0,"1.0-2")," Sats/",t.lcZ(3,6,e.filteredEventsBySelectedPeriod.length||0)," Events")}}function fp(i,n){1&i&&(t.TgZ(0,"div",14),t._uU(1,"No routing report for the selected period"),t.qZA())}function Cp(i,n){if(1&i&&(t.TgZ(0,"span")(1,"span",17),t._uU(2),t.ALo(3,"number"),t.qZA(),t.TgZ(4,"span",17),t._uU(5),t.ALo(6,"number"),t.qZA()()),2&i){const e=n.model,a=t.oxw(2);t.xp6(2),t.hij("Events: ",t.lcZ(3,2,(a.selReportBy===a.reportBy.EVENTS?e.value:e.extra.totalEvents)||0),""),t.xp6(3),t.hij("Fee: ",t.xi3(6,4,(a.selReportBy===a.reportBy.EVENTS?e.extra.totalFees:e.value)||0,"1.0-2"),"")}}function xp(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical",15),t.NdJ("select",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartBarSelected(o))})("mouseup",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartMouseUp(o))}),t.YNc(1,Cp,7,7,"ng-template",null,16,t.W1O),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("view",e.view)("results",e.routingReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function yp(i,n){if(1&i&&t._UZ(0,"rtl-ecl-forwarding-history",18),2&i){const e=t.oxw();t.Q6J("pageId","reports")("tableId","routing")("eventsData",e.filteredEventsBySelectedPeriod)("selFilter",e.eventFilterValue)}}class kt{constructor(n,e,a){this.logger=n,this.commonService=e,this.store=a,this.reportPeriod=s.op[0],this.secondsInADay=86400,this.events=[],this.filteredEventsBySelectedPeriod=[],this.eventFilterValue="",this.reportBy=s.Xr,this.selReportBy=s.Xr.FEES,this.totalFeeSat=null,this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.routingReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new u.x,new u.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===s.cu.XS||this.screenSize===s.cu.SM),this.store.select(g.PP).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.events=n.payments&&n.payments.relayed?n.payments.relayed:[],this.filterForwardingEvents(this.startDate,this.endDate),this.logger.info(n)}),this.commonService.containerSizeUpdated.pipe((0,h.R)(this.unSubs[1])).subscribe(n=>{switch(this.screenSize){case s.cu.MD:this.screenPaddingX=n.width/10;break;case s.cu.LG:this.screenPaddingX=n.width/16;break;default:this.screenPaddingX=n.width/20}this.view=[n.width-this.screenPaddingX,n.height/2.2],this.logger.info("Container Size: "+JSON.stringify(n)),this.logger.info("View: "+JSON.stringify(this.view))})}filterForwardingEvents(n,e){const a=Math.round(n.getTime()/1e3),o=Math.round(e.getTime()/1e3);this.logger.info("Filtering Forwarding Events Starting at "+new Date(Date.now()).toLocaleString()+" From "+n.toLocaleString()+" To "+e.toLocaleString()),this.filteredEventsBySelectedPeriod=[],this.routingReportData=[],this.totalFeeSat=null,this.events&&this.events.length>0&&(this.events.forEach(l=>{Math.floor((l.timestamp||0)/1e3)>=a&&Math.floor((l.timestamp||0)/1e3)<o&&this.filteredEventsBySelectedPeriod.push(l)}),this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(n):this.prepareFeeReport(n)),this.logger.info("Filtering Forwarding Events Finished at "+new Date(Date.now()).toLocaleString())}onChartMouseUp(n){"svg"===n.srcElement.tagName&&n.srcElement.classList.length>0&&"ngx-charts"===n.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(n){this.reportPeriod===s.op[1]?this.eventFilterValue=n.name+"/"+this.startDate.getFullYear():this.eventFilterValue=n.name.toString().padStart(2,"0")+"/"+s.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(n){const e=Math.round(n.getTime()/1e3),a=[];if(this.totalFeeSat=0,this.logger.info("Fee Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+n.toLocaleString()),this.reportPeriod===s.op[1]){for(let o=0;o<12;o++)a.push({name:s.gg[o].name,value:0,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod?.map(o=>{const l=new Date(o.timestamp||0).getMonth();return a[l].value=a[l].value+((o.amountIn||0)-(o.amountOut||0)),a[l].extra.totalEvents=a[l].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((o.amountIn||0)-(o.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let o=0;o<this.getMonthDays(n.getMonth(),n.getFullYear());o++)a.push({name:o+1,value:0,extra:{totalEvents:0}});this.filteredEventsBySelectedPeriod?.map(o=>{const l=Math.floor((Math.floor((o.timestamp||0)/1e3)-e)/this.secondsInADay);return a[l].value=a[l].value+((o.amountIn||0)-(o.amountOut||0)),a[l].extra.totalEvents=a[l].extra.totalEvents+1,this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((o.amountIn||0)-(o.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Fee Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),a}prepareEventsReport(n){const e=Math.round(n.getTime()/1e3),a=[];if(this.totalFeeSat=0,this.logger.info("Events Report Prepare Starting at "+new Date(Date.now()).toLocaleString()+" From "+n.toLocaleString()),this.reportPeriod===s.op[1]){for(let o=0;o<12;o++)a.push({name:s.gg[o].name,value:0,extra:{totalFees:0}});this.filteredEventsBySelectedPeriod?.map(o=>{const l=new Date(o.timestamp||0).getMonth();return a[l].value=a[l].value+1,a[l].extra.totalFees=a[l].extra.totalFees+((o.amountIn||0)-(o.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((o.amountIn||0)-(o.amountOut||0)),this.filteredEventsBySelectedPeriod})}else{for(let o=0;o<this.getMonthDays(n.getMonth(),n.getFullYear());o++)a.push({name:o+1,value:0,extra:{totalFees:0}});this.filteredEventsBySelectedPeriod?.map(o=>{const l=Math.floor((Math.floor((o.timestamp||0)/1e3)-e)/this.secondsInADay);return a[l].value=a[l].value+1,a[l].extra.totalFees=a[l].extra.totalFees+((o.amountIn||0)-(o.amountOut||0)),this.totalFeeSat=(this.totalFeeSat?this.totalFeeSat:0)+((o.amountIn||0)-(o.amountOut||0)),this.filteredEventsBySelectedPeriod})}return this.logger.info("Events Report Prepare Finished at "+new Date(Date.now()).toLocaleString()),a}onSelectionChange(n){const e=n.selDate.getMonth(),a=n.selDate.getFullYear();this.reportPeriod=n.selScrollRange,this.reportPeriod===s.op[1]?(this.startDate=new Date(a,0,1,0,0,0),this.endDate=new Date(a,11,31,23,59,59)):(this.startDate=new Date(a,e,1,0,0,0),this.endDate=new Date(a,e,this.getMonthDays(e,a),23,59,59)),this.filterForwardingEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(n,e){return 1===n&&e%4==0?s.gg[n].days+1:s.gg[n].days}onSelReportByChange(){this.yAxisLabel=this.selReportBy===this.reportBy.EVENTS?"Events":"Fee (Sats)",this.routingReportData=this.selReportBy===this.reportBy.EVENTS?this.prepareEventsReport(this.startDate):this.prepareFeeReport(this.startDate)}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||kt)(t.Y36(N.mQ),t.Y36(O.v),t.Y36(A.yh))};static#e=this.\u0275cmp=t.Xpm({type:kt,selectors:[["rtl-ecl-routing-report"]],hostBindings:function(e,a){1&e&&t.NdJ("mouseup",function(l){return a.onChartMouseUp(l)})},decls:17,vars:7,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","center center",1,"padding-gap-x"],["color","primary","name","selReportBy","fxFlex","100","fxLayoutAlign","start start",1,"my-1",3,"ngModel","ngModelChange","change"],[1,"mr-2"],["tabindex","1",1,"mr-2",3,"value"],["tabindex","2",3,"value"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup",4,"ngIf"],[3,"pageId","tableId","eventsData","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"pageId","tableId","eventsData","selFilter"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(l){return a.onSelectionChange(l)}),t.qZA(),t.TgZ(2,"div",2)(3,"mat-radio-group",3),t.NdJ("ngModelChange",function(l){return a.selReportBy=l})("change",function(){return a.onSelReportByChange()}),t.TgZ(4,"span",4),t._uU(5,"Report By: "),t.qZA(),t.TgZ(6,"mat-radio-button",5),t._uU(7,"Fees"),t.qZA(),t.TgZ(8,"mat-radio-button",6),t._uU(9,"Events"),t.qZA()()(),t.TgZ(10,"div",7),t.YNc(11,gp,4,8,"div",8),t.YNc(12,fp,2,0,"div",9),t.TgZ(13,"div",10),t.YNc(14,xp,3,11,"ngx-charts-bar-vertical",11),t.qZA(),t.TgZ(15,"div",10),t.YNc(16,yp,1,4,"rtl-ecl-forwarding-history",12),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngModel",a.selReportBy),t.xp6(3),t.s9C("value",a.reportBy.FEES),t.xp6(2),t.s9C("value",a.reportBy.EVENTS),t.xp6(3),t.Q6J("ngIf",a.routingReportData.length>0&&a.filteredEventsBySelectedPeriod.length>0),t.xp6(1),t.Q6J("ngIf",a.routingReportData.length<=0||a.filteredEventsBySelectedPeriod.length<=0),t.xp6(2),t.Q6J("ngIf",a.routingReportData.length>0&&a.filteredEventsBySelectedPeriod.length>0),t.xp6(2),t.Q6J("ngIf",a.filteredEventsBySelectedPeriod.length>0))},dependencies:[c.O5,d.JJ,d.On,p.xw,p.Wh,p.yH,bt.VQ,bt.U0,ge.K$,fe.D,ot,c.JJ],data:{animation:[_e.J]}})}var Tp=_(165);function bp(i,n){if(1&i&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.AsE(" Paid ",t.xi3(2,2,e.transactionsReportSummary.amountPaidSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function vp(i,n){if(1&i&&(t.TgZ(0,"div",10),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.AsE(" Received ",t.xi3(2,2,e.transactionsReportSummary.amountReceivedSelectedPeriod||0,"1.0-2")," Sats/",t.lcZ(3,5,e.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function Lp(i,n){if(1&i&&(t.TgZ(0,"div",8),t.YNc(1,bp,4,7,"div",9),t.YNc(2,vp,4,7,"div",9),t.qZA()),2&i){const e=t.oxw();t.Q6J("@fadeIn",e.transactionsReportSummary),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.paymentsSelectedPeriod),t.xp6(1),t.Q6J("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function Sp(i,n){1&i&&(t.TgZ(0,"div",11),t._uU(1,"No transactions report for the selected period"),t.qZA())}function Zp(i,n){if(1&i&&(t.TgZ(0,"span",14),t._uU(1),t.ALo(2,"number"),t.ALo(3,"number"),t.qZA()),2&i){const e=n.model;t.xp6(1),t.HOy("",e.name,": ",t.xi3(2,4,e.value||0,"1.0-2"),"/# ","Paid"===e.name?"Payments":"Invoices",": ",t.lcZ(3,7,(null==e.extra?null:e.extra.total)||0),"")}}function Ap(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"ngx-charts-bar-vertical-2d",12),t.NdJ("select",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartBarSelected(o))})("mouseup",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.onChartMouseUp(o))}),t.YNc(1,Zp,4,9,"ng-template",null,13,t.W1O),t.qZA()}if(2&i){const e=t.oxw();t.Q6J("view",e.view)("results",e.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",e.reportPeriod===e.scrollRanges[0]?2:8)}}function Ep(i,n){if(1&i&&t._UZ(0,"rtl-transactions-report-table",15),2&i){const e=t.oxw();t.Q6J("displayedColumns",e.displayedColumns)("tableSetting",e.tableSetting)("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("selFilter",e.transactionFilterValue)}}class Dt{constructor(n,e,a){this.logger=n,this.commonService=e,this.store=a,this.scrollRanges=s.op,this.reportPeriod=s.op[0],this.secondsInADay=86400,this.payments=[],this.invoices=[],this.colWidth="20rem",this.PAGE_ID="reports",this.tableSetting={tableId:"transactions",recordsPerPage:s.IV,sortBy:"date",sortOrder:s.Pi.DESCENDING},this.displayedColumns=["date","amount_paid","num_payments","amount_received","num_invoices"],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0},this.transactionFilterValue="",this.today=new Date(Date.now()),this.startDate=new Date(this.today.getFullYear(),this.today.getMonth(),1,0,0,0),this.endDate=new Date(this.today.getFullYear(),this.today.getMonth(),this.getMonthDays(this.today.getMonth(),this.today.getFullYear()),23,59,59),this.transactionsReportData=[],this.transactionsNonZeroReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Amount (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=s.cu,this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===s.cu.XS||this.screenSize===s.cu.SM),this.store.select(g.nF).pipe((0,h.R)(this.unSubs[0])).subscribe(n=>{this.tableSetting=n.pageSettings.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId)||s.c3.find(e=>e.pageId===this.PAGE_ID)?.tables.find(e=>e.tableId===this.tableSetting.tableId),this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):this.displayedColumns=JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/10+"rem":"20rem",this.logger.info(this.displayedColumns)}),this.store.select(g.PP).pipe((0,h.R)(this.unSubs[1]),(0,Mt.M)(this.store.select(g.Ef))).subscribe(([n,e])=>{this.payments=n.payments.sent?n.payments.sent:[],this.invoices=e.invoices?e.invoices:[],(this.payments.length>0||this.invoices.length>0)&&(this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData())}),this.commonService.containerSizeUpdated.pipe((0,h.R)(this.unSubs[2])).subscribe(n=>{switch(this.screenSize){case s.cu.MD:this.screenPaddingX=n.width/10;break;case s.cu.LG:this.screenPaddingX=n.width/16;break;default:this.screenPaddingX=n.width/20}this.view=[n.width-this.screenPaddingX,n.height/2.2],this.logger.info("Container Size: "+JSON.stringify(n)),this.logger.info("View: "+JSON.stringify(this.view))})}onChartMouseUp(n){"svg"===n.srcElement.tagName&&n.srcElement.classList.length>0&&"ngx-charts"===n.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(n){this.reportPeriod===s.op[1]?this.transactionFilterValue=n.series.toString()+"/"+this.startDate.getFullYear():this.transactionFilterValue=n.series.toString().padStart(2,"0")+"/"+s.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(n,e){const a=Math.round(n.getTime()/1e3),o=Math.round(e.getTime()/1e3),l=[];this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const m=this.payments?.filter(f=>f.firstPartTimestamp&&Math.floor(f.firstPartTimestamp/1e3)>=a&&Math.floor(f.firstPartTimestamp/1e3)<o),y=this.invoices?.filter(f=>"received"===f.status&&f.timestamp&&f.timestamp>=a&&f.timestamp<o);if(this.transactionsReportSummary.paymentsSelectedPeriod=m.length,this.transactionsReportSummary.invoicesSelectedPeriod=y.length,this.reportPeriod===s.op[1]){for(let f=0;f<12;f++)l.push({name:s.gg[f].name,date:new Date(n.getFullYear(),f,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});m?.map(f=>{const I=new Date(f.firstPartTimestamp||0).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(f.recipientAmount||0),l[I].series[0].value=l[I].series[0].value+f.recipientAmount,l[I].series[0].extra.total=l[I].series[0].extra.total+1,this.transactionsReportSummary}),y?.map(f=>{const I=new Date(1e3*(f.timestamp||0)).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(f.amountSettled||0),l[I].series[1].value=l[I].series[1].value+f.amountSettled,l[I].series[1].extra.total=l[I].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let f=0;f<this.getMonthDays(n.getMonth(),n.getFullYear());f++)l.push({name:(f+1).toString(),date:new Date(1e3*(f*this.secondsInADay+a)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});m?.map(f=>{const I=Math.floor((Math.floor((f.firstPartTimestamp||0)/1e3)-a)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(f.recipientAmount||0),l[I].series[0].value=l[I].series[0].value+f.recipientAmount,l[I].series[0].extra.total=l[I].series[0].extra.total+1,this.transactionsReportSummary}),y?.map(f=>{const I=Math.floor(((f.timestamp||0)-a)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(f.amountSettled||0),l[I].series[1].value=l[I].series[1].value+f.amountSettled,l[I].series[1].extra.total=l[I].series[1].extra.total+1,this.transactionsReportSummary})}return l}prepareTableData(){return this.transactionsReportData?.reduce((n,e)=>e.series[0].extra.total>0||e.series[1].extra.total>0?n.concat({date:e.date,amount_paid:e.series[0].value,num_payments:e.series[0].extra.total,amount_received:e.series[1].value,num_invoices:e.series[1].extra.total}):n,[])}onSelectionChange(n){const e=n.selDate.getMonth(),a=n.selDate.getFullYear();this.reportPeriod=n.selScrollRange,this.reportPeriod===s.op[1]?(this.startDate=new Date(a,0,1,0,0,0),this.endDate=new Date(a,11,31,23,59,59)):(this.startDate=new Date(a,e,1,0,0,0),this.endDate=new Date(a,e,this.getMonthDays(e,a),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(n,e){return 1===n&&e%4==0?s.gg[n].days+1:s.gg[n].days}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Dt)(t.Y36(N.mQ),t.Y36(O.v),t.Y36(A.yh))};static#e=this.\u0275cmp=t.Xpm({type:Dt,selectors:[["rtl-ecl-transactions-report"]],hostBindings:function(e,a){1&e&&t.NdJ("mouseup",function(l){return a.onChartMouseUp(l)})},decls:9,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 font-bold-700 mt-1",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",4,"ngIf"],[1,"mt-1"],["class","two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup",4,"ngIf"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter",4,"ngIf"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","font-bold-700","mt-1"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start stretch","fxFlex","100"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1"],[1,"two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"displayedColumns","tableSetting","dataList","dataRange","selFilter"]],template:function(e,a){1&e&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(l){return a.onSelectionChange(l)}),t.qZA(),t.TgZ(2,"div",2),t.YNc(3,Lp,3,3,"div",3),t.YNc(4,Sp,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,Ap,3,13,"ngx-charts-bar-vertical-2d",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Ep,1,5,"rtl-transactions-report-table",7),t.qZA()()()),2&e&&(t.xp6(3),t.Q6J("ngIf",a.transactionsNonZeroReportData.length>0),t.xp6(1),t.Q6J("ngIf",a.transactionsNonZeroReportData.length<=0),t.xp6(2),t.Q6J("ngIf",a.transactionsNonZeroReportData.length>0),t.xp6(2),t.Q6J("ngIf",a.transactionsNonZeroReportData.length>0))},dependencies:[c.O5,p.xw,p.Wh,p.yH,ge.H5,fe.D,Tp.g,c.JJ],data:{animation:[_e.J]}})}var w=_(1643),wp=_(9442);function Ip(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",9),t.NdJ("click",function(){const l=t.CHM(e).$implicit,m=t.oxw();return t.KtG(m.activeLink=l.link)}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit,a=t.oxw();t.s9C("routerLink",e.link),t.Q6J("active",a.activeLink===e.link),t.xp6(1),t.Oqu(e.name)}}class Rt{constructor(n){this.router=n,this.faSearch=T.wn1,this.links=[{link:"lookups",name:"Lookup"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new u.x,new u.x,new u.x,new u.x]}ngOnInit(){const n=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=n?n.link:this.links[0].link,this.router.events.pipe((0,h.R)(this.unSubs[0]),(0,J.h)(e=>e instanceof C.Av)).subscribe({next:e=>{const a=this.links.find(o=>e.urlAfterRedirects.includes(o.link));this.activeLink=a?a.link:this.links[0].link}})}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}static#t=this.\u0275fac=function(e){return new(e||Rt)(t.Y36(C.F0))};static#e=this.\u0275cmp=t.Xpm({type:Rt,selectors:[["rtl-ecl-graph"]],decls:13,vars:3,consts:[["fxLayout","row wrap","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x"],["fxLayout","column"],["mat-tab-nav-bar","",3,"tabPanel"],["mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["tabPanel",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(e,a){if(1&e&&(t.TgZ(0,"div",0),t._UZ(1,"fa-icon",1),t.TgZ(2,"span",2),t._uU(3,"Graph Lookups"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-card")(6,"mat-card-content",4)(7,"nav",5),t.YNc(8,Ip,2,3,"div",6),t.qZA(),t._UZ(9,"mat-tab-nav-panel",null,7),t.TgZ(11,"div",8),t._UZ(12,"router-outlet"),t.qZA()()()()),2&e){const o=t.MAs(10);t.xp6(1),t.Q6J("icon",a.faSearch),t.xp6(6),t.Q6J("tabPanel",o),t.xp6(1),t.Q6J("ngForOf",a.links)}},dependencies:[c.sg,F.BN,p.xw,p.Wh,p.yH,b.a8,b.dn,E.BU,E.sW,E.Nj,C.lC,C.rH]})}const Fp=[{path:"",component:j,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:gt,canActivate:[w.fY]},{path:"onchain",component:Ct,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:St,canActivate:[w.fY]},{path:"send",component:Zt,canActivate:[w.fY]}]},{path:"connections",component:xt,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:At,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Et,canActivate:[w.fY]},{path:"pending",component:wt,canActivate:[w.fY]},{path:"inactive",component:Nt,canActivate:[w.fY]}]},{path:"peers",component:Ft,data:{sweepAll:!1},canActivate:[w.fY]}]},{path:"transactions",component:yt,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:tt,canActivate:[w.fY]},{path:"invoices",component:et,canActivate:[w.fY]}]},{path:"routing",component:Tt,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:ot,canActivate:[w.fY]},{path:"peers",component:Pt,canActivate:[w.fY]}]},{path:"reports",component:Ut,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingreport"},{path:"routingreport",component:kt,canActivate:[w.fY]},{path:"transactions",component:Dt,canActivate:[w.fY]}]},{path:"graph",component:Rt,canActivate:[w.fY],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:Lt,canActivate:[w.fY]},{path:"queryroutes",component:qt,canActivate:[w.fY]}]},{path:"**",component:wp.w}]}],qp=C.Bz.forChild(Fp);var Np=_(6165);class Jt{static#t=this.\u0275fac=function(e){return new(e||Jt)};static#e=this.\u0275mod=t.oAB({type:Jt,bootstrap:[j]});static#n=this.\u0275inj=t.cJS({providers:[w.fY],imports:[c.ez,Np.m,qp]})}}}]);
//# sourceMappingURL=src_app_eclair_ecl_module_ts.2266e5b7139d698d.js.map