You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RTL/frontend/258.74bd2ac767e7a584.js

1 line
333 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[258],{7258:(Np,$t,_)=>{_.r($t),_.d($t,{ECLModule:()=>ot});var c=_(6895),x=_(9116),Ce=_(8878),t=_(4650),p=_(1576),J=_(3162);function xe(i,n){1&i&&t._UZ(0,"mat-progress-bar",3)}class W{constructor(n){this.router=n,this.loading=!1,this.router.events.subscribe(e=>{switch(!0){case e instanceof x.OD:this.loading=!0;break;case e instanceof x.m2:case e instanceof x.gk:case e instanceof x.Q3:this.loading=!1}})}}W.\u0275fac=function(n){return new(n||W)(t.Y36(x.F0))},W.\u0275cmp=t.Xpm({type:W,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(n,e){1&n&&(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&n&&(t.xp6(1),t.Q6J("ngIf",e.loading))},dependencies:[c.O5,p.xw,p.Wh,p.yH,J.pW,x.lC],data:{animation:[Ce.g]}});var u=_(7579),h=_(2722),Mt=_(1365),Xt=_(3396),T=_(2687),s=_(7731),g=_(2501),P=_(5043),E=_(9653),U=_(62),N=_(2216),v=_(5829),w=_(4859),L=_(3546),jt=_(782),te=_(7392),Qt=_(8255),I=_(3848);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 Le(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"))}}function be(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 ve(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)}}st.\u0275fac=function(n){return new(n||st)(t.Y36(U.v))},st.\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(n,e){1&n&&(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,Le,2,1,"span",5),t.qZA()()),2&n&&(t.xp6(5),t.hij(" ",null==e.information?null:e.information.alias," "),t.xp6(1),t.Q6J("ngIf",!e.showColorFieldSeparately),t.xp6(1),t.Q6J("ngIf",e.showColorFieldSeparately),t.xp6(5),t.Oqu(null!=e.information&&e.information.lnImplementation||null!=e.information&&e.information.version?(null==e.information?null:e.information.lnImplementation)+" "+(null==e.information?null:e.information.version):""),t.xp6(4),t.Q6J("ngForOf",e.chains))},dependencies:[c.sg,c.O5,c.PC,p.xw,p.Wh,p.yH,v.Zl,c.gd]});class lt{constructor(){this.balances={onchain:0,lightning:0,total:0}}}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)}}lt.\u0275fac=function(n){return new(n||lt)},lt.\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(n,e){if(1&n&&(t.YNc(0,be,21,11,"div",0),t.YNc(1,ve,3,1,"ng-template",null,1,t.W1O)),2&n){const a=t.MAs(2);t.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",a)}},dependencies:[c.O5,p.xw,p.Wh,p.yH,J.pW,c.JJ]});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)}}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)}}rt.\u0275fac=function(n){return new(n||rt)},rt.\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(n,e){if(1&n&&(t.YNc(0,Se,39,18,"div",0),t.YNc(1,Ze,3,1,"ng-template",null,1,t.W1O)),2&n){const a=t.MAs(2);t.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",a)}},dependencies:[c.O5,p.xw,p.Wh,p.yH,c.JJ]});class ct{constructor(){this.channelsStatus={}}}ct.\u0275fac=function(n){return new(n||ct)},ct.\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(n,e){if(1&n&&(t.YNc(0,Ae,42,18,"div",0),t.YNc(1,Ee,3,1,"ng-template",null,1,t.W1O)),2&n){const a=t.MAs(2);t.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",a)}},dependencies:[c.O5,p.xw,p.Wh,p.yH,c.JJ]});var f=_(9549),$=_(4850),V=_(266),O=_(6839);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")}}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 De(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 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.toRemote||0)/a.totalLiquidity*100:0)}}function ke(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)}}ut.\u0275fac=function(n){return new(n||ut)(t.Y36(x.F0))},ut.\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","8","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(n,e){if(1&n&&(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&n){const a=t.MAs(4);t.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",a)}},dependencies:[c.sg,c.O5,N.BN,p.xw,p.Wh,p.yH,w.lW,f.bx,$.d,J.pW,V.gM,O.$V,x.rH,c.OU,c.JJ],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]});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,De,5,4,"mat-hint",17),t.qZA(),t.YNc(7,Re,1,1,"mat-progress-bar",18),t.YNc(8,ke,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")}}pt.\u0275fac=function(n){return new(n||pt)(t.Y36(x.F0),t.Y36(U.v))},pt.\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","8","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(n,e){if(1&n&&(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&n){const a=t.MAs(4);t.Q6J("ngIf",""===(null==e.errorMessage?null:e.errorMessage.trim()))("ngIfElse",a)}},dependencies:[c.mk,c.sg,c.O5,p.xw,p.Wh,p.yH,v.oO,w.lW,f.bx,$.d,J.pW,V.gM,O.$V,x.rH,c.OU,c.JJ]});var z=_(5698),S=_(8739),b=_(6308),r=_(671),M=_(9300),D=_(2994),k=_(5412),Yt=_(3289),G=_(493),ne=_(8104),m=_(4006),Q=_(4144),X=_(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,"mat-label"),t._uU(2,"Amount (Sats)"),t.qZA(),t.TgZ(3,"input",18,19),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(5,"mat-hint"),t._uU(6,"It is a zero amount invoice, enter amount to be paid."),t.qZA(),t.YNc(7,je,2,0,"mat-error",12),t.qZA()}if(2&i){const e=t.oxw();t.xp6(3),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",20),t._UZ(1,"fa-icon",21),t.YNc(2,en,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.paymentError)}}class mt{constructor(n,e,a,o,l,d,y,C){this.dialogRef=n,this.store=e,this.eclEffects=a,this.logger=o,this.commonService=l,this.decimalPipe=d,this.actions=y,this.dataService=C,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,M.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.store.dispatch((0,D.oV)(this.zeroAmtInvoice&&this.paymentAmount?{payload:{invoice:this.paymentRequest,amountMsat:1e3*this.paymentAmount,fromDialog:!0}}:{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()})}}mt.\u0275fac=function(n){return new(n||mt)(t.Y36(k.so),t.Y36(E.yh),t.Y36(Yt.o),t.Y36(P.mQ),t.Y36(U.v),t.Y36(c.JJ),t.Y36(G.eX),t.Y36(ne.D))},mt.\u0275cmp=t.Xpm({type:mt,selectors:[["rtl-ecl-lightning-send-payments"]],viewQuery:function(n,e){if(1&n&&t.Gf(Ke,5),2&n){let a;t.iGM(a=t.CRH())&&(e.paymentReq=a.first)}},decls:26,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 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"],["fxLayout","column","fxFlex","100"],["autoFocus","","matInput","","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","","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(n,e){if(1&n&&(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",9)(12,"mat-label"),t._uU(13,"Payment Request"),t.qZA(),t.TgZ(14,"textarea",10,11),t.NdJ("ngModelChange",function(o){return e.onPaymentRequestEntry(o)})("matTextareaAutosize",function(){return!0}),t.qZA(),t.YNc(16,We,2,1,"mat-hint",12),t.YNc(17,$e,2,0,"mat-error",12),t.YNc(18,Xe,2,1,"mat-error",12),t.qZA(),t.YNc(19,tn,8,2,"mat-form-field",13),t.YNc(20,nn,3,2,"div",14),t.TgZ(21,"div",15)(22,"button",16),t.NdJ("click",function(){return e.resetData()}),t._uU(23,"Clear Fields"),t.qZA(),t.TgZ(24,"button",17),t.NdJ("click",function(){return e.onSendPayment()}),t._uU(25,"Send Payment"),t.qZA()()()()()()),2&n){const a=t.MAs(15);t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(8),t.Q6J("ngModel",e.paymentRequest),t.xp6(2),t.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),t.xp6(1),t.Q6J("ngIf",!e.paymentRequest),t.xp6(1),t.Q6J("ngIf",null==a.errors?null:a.errors.decodeError),t.xp6(1),t.Q6J("ngIf",e.zeroAmtInvoice),t.xp6(1),t.Q6J("ngIf",""!==e.paymentError)}},dependencies:[c.O5,m._Y,m.Fj,m.JJ,m.JL,m.Q7,m.On,m.F,N.BN,p.xw,p.Wh,p.yH,k.ZT,w.lW,L.dn,L.dk,Q.Nt,f.KE,f.hX,f.bx,f.TO,X.h]});var Y=_(752);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)}}dt.\u0275fac=function(n){return new(n||dt)(t.Y36(k.so),t.Y36(k.WI))},dt.\u0275cmp=t.Xpm({type:dt,selectors:[["rtl-ecl-payment-information"]],viewQuery:function(n,e){if(1&n&&t.Gf(an,5),2&n){let a;t.iGM(a=t.CRH())&&(e.scrollContainer=a.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 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(n,e){1&n&&(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 e.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 e.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&n&&(t.xp6(16),t.Oqu(t.lcZ(17,10,e.payment.recipientAmount)),t.xp6(6),t.Oqu(t.xi3(23,12,e.payment.firstPartTimestamp,"dd/MMM/y HH:mm")),t.xp6(8),t.Oqu(e.payment.id),t.xp6(7),t.Oqu(e.payment.paymentHash),t.xp6(7),t.Oqu(e.payment.paymentPreimage),t.xp6(7),t.Oqu(e.payment.recipientNodeAlias),t.xp6(2),t.Q6J("ngIf",e.description),t.xp6(1),t.Q6J("ngIf",e.description),t.xp6(4),t.Q6J("ngForOf",e.payment.parts),t.xp6(6),t.Q6J("mat-dialog-close",!1))},dependencies:[c.sg,c.O5,p.xw,p.Wh,p.yH,k.ZT,w.lW,w.nh,L.dn,L.dk,Y.pp,Y.ib,Y.yz,Y.yK,te.Hw,$.d,O.$V,c.JJ,c.uU]});var Z=_(7861),A=_(4385),Rt=_(3093),H=_(9445),B=_(3238);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,"mat-label"),t._uU(4,"Payment Request"),t.qZA(),t.TgZ(5,"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(7,cn,2,1,"mat-hint",9),t.YNc(8,un,2,0,"mat-error",9),t.qZA(),t.TgZ(9,"div",10)(10,"button",11),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(11,"Clear Field"),t.qZA(),t.TgZ(12,"button",12),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSendPayment())}),t._uU(13,"Send Payment"),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(5),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 R=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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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 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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.recipientNodeAlias)}}function bn(i,n){1&i&&(t.TgZ(0,"th",61),t._uU(1,"Description"),t.qZA())}function vn(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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,d=t.oxw(2);return t.KtG(d.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 Dn(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 Rn(i,n){if(1&i&&(t.ynx(0),t.YNc(1,Dn,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 kn(i,n){if(1&i&&(t.TgZ(0,"td",62)(1,"span",74),t._uU(2),t.qZA(),t.YNc(3,Rn,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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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,R,a.screenSize===a.screenSizeEnum.XS?"6rem":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",82)(1,"button",83),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw(2).$implicit,y=t.oxw(2);return t.KtG(y.onPartClick(l,d))}),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",84)}const pi=function(i){return{"display-none":i}};function mi(i,n){if(1&i&&t._UZ(0,"tr",85),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",86)}function hi(i,n){1&i&&t._UZ(0,"tr",84)}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-label"),t._uU(9,"Filter By"),t.qZA(),t.TgZ(10,"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.TgZ(11,"perfect-scrollbar"),t.YNc(12,dn,2,2,"mat-option",22),t.qZA()()(),t.TgZ(13,"mat-form-field",20)(14,"mat-label"),t._uU(15,"Filter"),t.qZA(),t.TgZ(16,"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(17,"div",24)(18,"div",25),t.YNc(19,hn,1,0,"mat-progress-bar",26),t.TgZ(20,"table",27,28),t.ynx(22,29),t.YNc(23,_n,2,0,"th",30),t.YNc(24,gn,3,4,"td",31),t.BQk(),t.ynx(25,32),t.YNc(26,fn,2,0,"th",30),t.YNc(27,Cn,4,4,"td",31),t.BQk(),t.ynx(28,33),t.YNc(29,xn,2,0,"th",30),t.YNc(30,yn,4,4,"td",31),t.BQk(),t.ynx(31,34),t.YNc(32,Tn,2,0,"th",30),t.YNc(33,Ln,4,4,"td",31),t.BQk(),t.ynx(34,35),t.YNc(35,bn,2,0,"th",30),t.YNc(36,vn,4,4,"td",31),t.BQk(),t.ynx(37,36),t.YNc(38,Sn,2,0,"th",30),t.YNc(39,Zn,4,4,"td",31),t.BQk(),t.ynx(40,37),t.YNc(41,An,2,0,"th",30),t.YNc(42,En,4,4,"td",31),t.BQk(),t.ynx(43,38),t.YNc(44,wn,2,0,"th",39),t.YNc(45,In,4,3,"td",31),t.BQk(),t.ynx(46,40),t.YNc(47,Fn,6,0,"th",41),t.YNc(48,qn,3,0,"td",42),t.BQk(),t.ynx(49,43),t.YNc(50,Un,4,3,"td",44),t.BQk(),t.ynx(51,45),t.YNc(52,kn,4,2,"td",31),t.BQk(),t.ynx(53,46),t.YNc(54,Qn,5,5,"td",31),t.BQk(),t.ynx(55,47),t.YNc(56,Hn,5,5,"td",31),t.BQk(),t.ynx(57,48),t.YNc(58,Gn,5,5,"td",31),t.BQk(),t.ynx(59,49),t.YNc(60,$n,5,5,"td",31),t.BQk(),t.ynx(61,50),t.YNc(62,ti,5,5,"td",31),t.BQk(),t.ynx(63,51),t.YNc(64,ii,5,5,"td",31),t.BQk(),t.ynx(65,52),t.YNc(66,si,5,5,"td",31),t.BQk(),t.ynx(67,53),t.YNc(68,ci,5,2,"td",31),t.BQk(),t.YNc(69,ui,1,0,"tr",54),t.YNc(70,mi,1,3,"tr",55),t.YNc(71,di,1,0,"tr",56),t.YNc(72,hi,1,0,"tr",57),t.qZA()()(),t._UZ(73,"mat-paginator",58),t.qZA()}if(2&i){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(17,_i).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(3),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.payments)("ngClass",t.VKq(18,gi,""!==e.errorMessage)),t.xp6(49),t.Q6J("matRowDefColumns",e.partColumns)("matRowDefWhen",e.is_group),t.xp6(1),t.Q6J("matFooterRowDef",t.DdM(20,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 j{constructor(n,e,a,o,l,d,y,C){this.logger=n,this.commonService=e,this.store=a,this.rtlEffects=o,this.decimalPipe=l,this.dataService=d,this.datePipe=y,this.camelCaseWithSpaces=C,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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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=new r.by(n?[...n]:[]),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.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(){this.newlyAddedPayment=this.paymentDecoded.paymentHash||"",this.paymentDecoded.amount&&0!==this.paymentDecoded.amount?(this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Confirm Send Payment",noBtnText:"Cancel",yesBtnText:"Send Payment",message:[[{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.rtlEffects.closeConfirm.pipe((0,z.q)(1)).subscribe(e=>{e&&(this.store.dispatch((0,D.oV)({payload:{invoice:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",message:[[{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}]],noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,titleMessage:"It is a zero amount invoice. Enter the amount (Sats) to pay.",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,D.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,d)=>{l.length>0&&l[0].paymentRequest&&l[0].paymentRequest.description&&""!==l[0].paymentRequest.description&&(n[d].description=l[0].paymentRequest.description)});const o=n?.reduce((l,d)=>l.concat(d),[]);this.commonService.downloadFile(o,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}}j.\u0275fac=function(n){return new(n||j)(t.Y36(P.mQ),t.Y36(U.v),t.Y36(E.yh),t.Y36(Rt.V),t.Y36(c.JJ),t.Y36(ne.D),t.Y36(c.uU),t.Y36(H.i1))},j.\u0275cmp=t.Xpm({type:j,selectors:[["rtl-ecl-lightning-payments"]],viewQuery:function(n,e){if(1&n&&(t.Gf(rn,5),t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.form=a.first),t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{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"],["fxLayout","column","fxFlex","100"],["matInput","","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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","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-cell","","colspan","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 center",1,"part-group-head"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-part-expand",3,"click"],["class","part-group-details","fxLayoutAlign","end center",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"part-group-details"],["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(n,e){1&n&&(t.TgZ(0,"div",0),t.YNc(1,pn,14,3,"form",1),t.YNc(2,mn,3,0,"div",2),t.YNc(3,Ci,74,21,"div",3),t.qZA()),2&n&&(t.xp6(1),t.Q6J("ngIf","home"===e.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===e.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===e.calledFrom))},dependencies:[c.mk,c.sg,c.O5,c.PC,m._Y,m.Fj,m.JJ,m.JL,m.Q7,m.On,m.F,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,w.lW,Q.Nt,f.KE,f.hX,f.bx,f.TO,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,S.NW,O.Vv,O.$V,c.JJ,c.uU],styles:[".mat-column-group_actions[_ngcontent-%COMP%] .part-group-head[_ngcontent-%COMP%], .mat-column-group_actions[_ngcontent-%COMP%] .part-group-details[_ngcontent-%COMP%]{min-height:3rem}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-expand[_ngcontent-%COMP%]{min-width:7rem;width:7rem;margin:0}.mat-column-group_actions[_ngcontent-%COMP%] .btn-part-info[_ngcontent-%COMP%]{min-width:6rem;margin:0}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%] .part-row-span[_ngcontent-%COMP%]:not(:first-of-type){padding-left:2rem}.part-row-span[_ngcontent-%COMP%]{min-height:3rem}.mat-column-group_firstPartTimestamp[_ngcontent-%COMP%]{min-width:11rem}"]});var tt=_(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 Li(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 ht{constructor(n,e,a,o,l,d){this.dialogRef=n,this.data=e,this.store=a,this.decimalPipe=o,this.commonService=l,this.actions=d,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,M.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:s.$Y;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,D.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()})}}ht.\u0275fac=function(n){return new(n||ht)(t.Y36(k.so),t.Y36(k.WI),t.Y36(E.yh),t.Y36(c.JJ),t.Y36(U.v),t.Y36(G.eX))},ht.\u0275cmp=t.Xpm({type:ht,selectors:[["rtl-ecl-create-invoices"]],decls:41,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 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"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["matInput","","autoFocus","","tabindex","2","name","description","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","space-between start","fxFlex","100"],["fxLayout","column","fxFlex","40"],["matInput","","type","number","tabindex","3","name","invValue",3,"step","min","ngModel","ngModelChange","keyup"],["matSuffix",""],["fxLayout","column","fxFlex","30"],["matInput","","type","number","name","exp","tabindex","4",3,"step","min","ngModel","ngModelChange"],["fxLayout","column","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(n,e){if(1&n){const a=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,"mat-label"),t._uU(13,"Description"),t.qZA(),t.TgZ(14,"input",10),t.NdJ("ngModelChange",function(l){return e.description=l}),t.qZA(),t.YNc(15,xi,2,0,"mat-error",11),t.qZA(),t.TgZ(16,"div",12)(17,"mat-form-field",13)(18,"mat-label"),t._uU(19,"Amount"),t.qZA(),t.TgZ(20,"input",14),t.NdJ("ngModelChange",function(l){return e.invoiceValue=l})("keyup",function(){return e.onInvoiceValueChange()}),t.qZA(),t.TgZ(21,"span",15),t._uU(22," Sats "),t.qZA(),t.TgZ(23,"mat-hint"),t._uU(24),t.qZA()(),t.TgZ(25,"mat-form-field",16)(26,"mat-label"),t._uU(27,"Expiry"),t.qZA(),t.TgZ(28,"input",17),t.NdJ("ngModelChange",function(l){return e.expiry=l}),t.qZA(),t.TgZ(29,"span",15),t._uU(30),t.ALo(31,"titlecase"),t.qZA()(),t.TgZ(32,"mat-form-field",18)(33,"mat-select",19),t.NdJ("selectionChange",function(l){return e.onTimeUnitChange(l)}),t.YNc(34,yi,3,4,"mat-option",20),t.qZA()()(),t.YNc(35,Li,3,2,"div",21),t.TgZ(36,"div",22)(37,"button",23),t.NdJ("click",function(){return e.resetData()}),t._uU(38,"Clear Field"),t.qZA(),t.TgZ(39,"button",24),t.NdJ("click",function(){t.CHM(a);const l=t.MAs(10);return t.KtG(e.onAddInvoice(l))}),t._uU(40,"Create Invoice"),t.qZA()()()()()()}2&n&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(8),t.Q6J("ngModel",e.description),t.xp6(1),t.Q6J("ngIf",!e.description),t.xp6(5),t.Q6J("step",100)("min",1)("ngModel",e.invoiceValue),t.xp6(4),t.Oqu(e.invoiceValueHint),t.xp6(4),t.Q6J("step",e.selTimeUnit===e.timeUnitEnum.SECS?300:e.selTimeUnit===e.timeUnitEnum.MINS?10:e.selTimeUnit===e.timeUnitEnum.HOURS?2:1)("min",1)("ngModel",e.expiry),t.xp6(2),t.hij("",t.lcZ(31,14,e.selTimeUnit)," "),t.xp6(3),t.Q6J("value",e.selTimeUnit),t.xp6(1),t.Q6J("ngForOf",e.timeUnits),t.xp6(1),t.Q6J("ngIf",""!==e.invoiceError))},dependencies:[c.sg,c.O5,m._Y,m.Fj,m.wV,m.JJ,m.JL,m.Q7,m.qQ,m.On,m.F,N.BN,p.xw,p.Wh,p.yH,k.ZT,w.lW,L.dn,L.dk,Q.Nt,f.KE,f.hX,f.bx,f.TO,f.R9,A.gD,B.ey,X.h,tt.q,c.rS]});var bi=_(7766);function vi(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,"mat-label"),t._uU(4,"Description"),t.qZA(),t.TgZ(5,"input",7),t.NdJ("ngModelChange",function(o){t.CHM(e);const l=t.oxw();return t.KtG(l.description=o)}),t.qZA(),t.YNc(6,vi,2,0,"mat-error",8),t.qZA(),t.TgZ(7,"mat-form-field",9)(8,"mat-label"),t._uU(9,"Amount"),t.qZA(),t.TgZ(10,"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(12,"span",12),t._uU(13," Sats "),t.qZA(),t.TgZ(14,"mat-hint"),t._uU(15),t.qZA()(),t.TgZ(16,"div",13)(17,"button",14),t.NdJ("click",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.resetData())}),t._uU(18,"Clear Field"),t.qZA(),t.TgZ(19,"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(20,"Create Invoice"),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(5),t.Q6J("ngModel",e.description),t.xp6(1),t.Q6J("ngIf",!e.description),t.xp6(4),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 Di(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 Ri(i,n){1&i&&(t.TgZ(0,"th",65),t._uU(1,"Date Settled"),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.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?"6rem":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?"6rem":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?"6rem":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,d=t.oxw(2);return t.KtG(d.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,d=t.oxw(2);return t.KtG(d.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-label"),t._uU(9,"Filter By"),t.qZA(),t.TgZ(10,"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.TgZ(11,"perfect-scrollbar"),t.YNc(12,Ai,2,2,"mat-option",26),t.qZA()()(),t.TgZ(13,"mat-form-field",24)(14,"mat-label"),t._uU(15,"Filter"),t.qZA(),t.TgZ(16,"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(17,"div",28),t.YNc(18,Ei,1,0,"mat-progress-bar",29),t.TgZ(19,"table",30,31),t.ynx(21,32),t.YNc(22,wi,1,0,"th",33),t.YNc(23,Ni,4,3,"td",34),t.BQk(),t.ynx(24,35),t.YNc(25,Oi,2,0,"th",36),t.YNc(26,Pi,3,4,"td",34),t.BQk(),t.ynx(27,37),t.YNc(28,Ui,2,0,"th",36),t.YNc(29,Di,3,4,"td",34),t.BQk(),t.ynx(30,38),t.YNc(31,Ri,2,0,"th",36),t.YNc(32,ki,3,4,"td",34),t.BQk(),t.ynx(33,39),t.YNc(34,Ji,2,0,"th",36),t.YNc(35,Mi,4,4,"td",34),t.BQk(),t.ynx(36,40),t.YNc(37,Qi,2,0,"th",36),t.YNc(38,Yi,4,4,"td",34),t.BQk(),t.ynx(39,41),t.YNc(40,Bi,2,0,"th",36),t.YNc(41,Hi,4,4,"td",34),t.BQk(),t.ynx(42,42),t.YNc(43,zi,2,0,"th",43),t.YNc(44,Vi,4,4,"td",34),t.BQk(),t.ynx(45,44),t.YNc(46,Gi,2,0,"th",45),t.YNc(47,Ki,4,4,"td",34),t.BQk(),t.ynx(48,46),t.YNc(49,Wi,6,0,"th",47),t.YNc(50,$i,8,0,"td",48),t.BQk(),t.ynx(51,49),t.YNc(52,ea,4,3,"td",50),t.BQk(),t.YNc(53,ia,1,3,"tr",51),t.YNc(54,aa,1,0,"tr",52),t.YNc(55,oa,1,0,"tr",53),t.qZA()(),t._UZ(56,"mat-paginator",54),t.qZA()}if(2&i){const e=t.oxw();t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(15,sa).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.invoices)("ngClass",t.VKq(16,la,""!==e.errorMessage)),t.xp6(34),t.Q6J("matFooterRowDef",t.DdM(18,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,d,y){this.logger=n,this.store=e,this.decimalPipe=a,this.commonService=o,this.datePipe=l,this.actions=d,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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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,M.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:ht}}}))}onAddInvoice(n){if(!this.description)return!0;const e=this.expiry?this.expiry:s.$Y;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,D.Z$)({payload:a})),this.resetData()}onInvoiceClick(n){this.store.dispatch((0,Z.qR)({payload:{data:{invoice:n,newlyAdded:!1,component:bi.R}}}))}onRefreshInvoice(n){this.store.dispatch((0,D.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=new r.by(n?[...n]:[]),this.invoices.sort=this.sort,this.invoices.sortingDataAccessor=(e,a)=>e[a]&&isNaN(e[a])?e[a].toLocaleLowerCase():e[a]?+e[a]:null,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()})}}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,d=t.oxw().$implicit,y=t.oxw(2);return t.KtG(y.onNavigateTo(d.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())}et.\u0275fac=function(n){return new(n||et)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(c.JJ),t.Y36(U.v),t.Y36(c.uU),t.Y36(G.eX),t.Y36(H.i1))},et.\u0275cmp=t.Xpm({type:et,selectors:[["rtl-ecl-lightning-invoices"]],viewQuery:function(n,e){if(1&n&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},inputs:{calledFrom:"calledFrom"},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{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"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["matInput","","tabindex","2","name","description","required","true",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end"],["matInput","","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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","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-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,e){1&n&&(t.TgZ(0,"div",0),t.YNc(1,Si,21,6,"form",1),t.YNc(2,Zi,3,0,"div",2),t.YNc(3,ca,57,19,"div",3),t.qZA()),2&n&&(t.xp6(1),t.Q6J("ngIf","home"===e.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===e.calledFrom),t.xp6(1),t.Q6J("ngIf","transactions"===e.calledFrom))},dependencies:[c.mk,c.sg,c.O5,c.PC,m._Y,m.Fj,m.wV,m.JJ,m.JL,m.Q7,m.qQ,m.On,m.F,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,w.lW,Q.Nt,f.KE,f.hX,f.bx,f.TO,f.R9,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,V.gM,S.NW,O.Vv,O.$V,tt.q,c.JJ,c.uU],styles:[".mat-column-status[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]});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 La(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 ba(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"button",27),t.NdJ("click",function(){const l=t.CHM(e).index,d=t.oxw(2).$implicit,y=t.oxw(2);return t.KtG(y.onNavigateTo(d.links[l]))}),t._uU(1),t.qZA()}if(2&i){const e=n.$implicit;t.xp6(1),t.Oqu(e)}}function va(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,La,3,1,"button",12),t.TgZ(8,"mat-menu",13,42),t.YNc(10,ba,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,d=t.oxw(2).$implicit,y=t.oxw(2);return t.KtG(y.onNavigateTo(d.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,"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,"div",51)(7,"button",26)(8,"mat-icon"),t._uU(9,"more_vert"),t.qZA()(),t.TgZ(10,"mat-menu",13,52),t.YNc(12,Ia,2,1,"button",15),t.qZA()()()),2&i){const e=t.MAs(11),a=t.oxw().$implicit;t.xp6(3),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("calledFrom","home"),t.xp6(2),t.Q6J("matMenuTriggerFor",e),t.xp6(5),t.Q6J("ngForOf",a.goToOptions)}}function qa(i,n){1&i&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find information!"),t.qZA())}const Na=function(i){return{"p-0":i}};function Oa(i,n){if(1&i&&(t.TgZ(0,"mat-grid-tile",8)(1,"mat-card",36),t.YNc(2,va,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,Fa,13,4,"span",41),t.YNc(11,qa,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,Na,"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 Pa(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,Oa,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 _t{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="390px",this.merchantCardHeight="62px",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;this.channelBalances={localBalance:a,remoteBalance:o,balancedness:+(1-Math.abs((a-o)/(a+o))).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(d=>(d.toRemote||0)>0),"toRemote"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.channels?.filter(d=>(d.toLocal||0)>0),"toLocal"))),this.channels.forEach(d=>{this.totalInboundLiquidity=this.totalInboundLiquidity+Math.ceil(d.toRemote||0),this.totalOutboundLiquidity=this.totalOutboundLiquidity+Math.floor(d.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()})}}_t.\u0275fac=function(n){return new(n||_t)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(U.v),t.Y36(x.F0))},_t.\u0275cmp=t.Xpm({type:_t,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","row","fxFlex","100","fxLayoutAlign","space-between start",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start"],["mat-stretch-tabs","false","mat-align-tabs","start","fxLayout","column",1,"dashboard-tabs-group"],["label","Receive"],[1,"h-100",3,"calledFrom"],["label","Pay"],[3,"calledFrom"],[1,"underline"],["menuTransactions","matMenu"]],template:function(n,e){if(1&n&&(t.YNc(0,Ta,7,4,"div",0),t.YNc(1,Pa,6,4,"ng-template",null,1,t.W1O)),2&n){const a=t.MAs(2);t.Q6J("ngIf",(null==e.selNode?null:e.selNode.userPersona)===e.userPersonaEnum.OPERATOR)("ngIfElse",a)}},dependencies:[c.mk,c.sg,c.O5,c.RF,c.n9,c.ED,N.BN,p.xw,p.Wh,p.yH,v.oO,w.RK,L.a8,L.dn,L.dk,L.n5,jt.Il,jt.DX,te.Hw,Qt.VK,Qt.OP,Qt.p6,J.pW,I.uX,I.SP,st,lt,rt,ct,ut,pt,j,et]});var Ua=_(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 ka(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 Ja(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 Ma(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Target Confirmation Blocks is required."),t.qZA())}function Qa(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 Ya(i,n){if(1&i&&(t.TgZ(0,"div",30),t._UZ(1,"fa-icon",31),t.YNc(2,Qa,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,d){this.dialogRef=n,this.logger=e,this.store=a,this.commonService=o,this.decimalPipe=l,this.actions=d,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(Ua.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,M.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,D.Iy)({payload:this.transaction}))},error:n=>{this.selAmountUnit=s.NT.SATS,this.amountError="Conversion Error: "+n}}):this.store.dispatch((0,D.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()})}}nt.\u0275fac=function(n){return new(n||nt)(t.Y36(k.so),t.Y36(P.mQ),t.Y36(E.yh),t.Y36(U.v),t.Y36(c.JJ),t.Y36(G.eX))},nt.\u0275cmp=t.Xpm({type:nt,selectors:[["rtl-ecl-on-chain-send-modal"]],viewQuery:function(n,e){if(1&n&&t.Gf(Da,7),2&n){let a;t.iGM(a=t.CRH())&&(e.form=a.first)}},decls:42,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 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"],["fxLayout","column","fxFlex","55"],["matInput","","autoFocus","","tabindex","1","name","addr","required","",3,"ngModel","ngModelChange"],["addrs","ngModel"],[4,"ngIf"],["fxLayout","column","fxFlex","30"],["matInput","","name","amt","type","number","tabindex","2","required","",3,"step","min","ngModel","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxLayout","column","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"],["fxLayout","column","fxFlex","48","fxLayoutAlign","start center"],["matInput","","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(n,e){1&n&&(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 e.onSendFunds()})("reset",function(){return e.resetData()}),t.TgZ(11,"mat-form-field",9)(12,"mat-label"),t._uU(13,"Bitcoin Address"),t.qZA(),t.TgZ(14,"input",10,11),t.NdJ("ngModelChange",function(o){return e.transaction.address=o}),t.qZA(),t.YNc(16,Ra,2,0,"mat-error",12),t.qZA(),t.TgZ(17,"mat-form-field",13)(18,"mat-label"),t._uU(19,"Amount"),t.qZA(),t.TgZ(20,"input",14,15),t.NdJ("ngModelChange",function(o){return e.transaction.amount=o}),t.qZA(),t.TgZ(22,"span",16),t._uU(23),t.qZA(),t.YNc(24,ka,2,1,"mat-error",12),t.qZA(),t.TgZ(25,"mat-form-field",17)(26,"mat-select",18),t.NdJ("selectionChange",function(o){return e.onAmountUnitChange(o)}),t.YNc(27,Ja,2,2,"mat-option",19),t.qZA()(),t.TgZ(28,"div",20)(29,"mat-form-field",21)(30,"mat-label"),t._uU(31,"Target Confirmation Blocks"),t.qZA(),t.TgZ(32,"input",22,23),t.NdJ("ngModelChange",function(o){return e.transaction.blocks=o}),t.qZA(),t.YNc(34,Ma,2,0,"mat-error",12),t.qZA()(),t._UZ(35,"div",24),t.YNc(36,Ya,3,2,"div",25),t.TgZ(37,"div",26)(38,"button",27),t._uU(39,"Clear Fields"),t.qZA(),t.TgZ(40,"button",28),t._uU(41,"Send Funds"),t.qZA()()()()()()),2&n&&(t.xp6(6),t.Q6J("mat-dialog-close",!1),t.xp6(8),t.Q6J("ngModel",e.transaction.address),t.xp6(2),t.Q6J("ngIf",!e.transaction.address),t.xp6(4),t.Q6J("step",100)("min",0)("ngModel",e.transaction.amount),t.xp6(3),t.hij("",e.selAmountUnit," "),t.xp6(1),t.Q6J("ngIf",!e.transaction.amount),t.xp6(2),t.Q6J("value",e.selAmountUnit),t.xp6(1),t.Q6J("ngForOf",e.amountUnits),t.xp6(5),t.Q6J("step",1)("min",0)("ngModel",e.transaction.blocks),t.xp6(2),t.Q6J("ngIf",!e.transaction.blocks),t.xp6(2),t.Q6J("ngIf",""!==e.sendFundError))},dependencies:[c.sg,c.O5,m._Y,m.Fj,m.wV,m.JJ,m.JL,m.Q7,m.qQ,m.On,m.F,N.BN,p.xw,p.Wh,p.yH,k.ZT,w.lW,L.dn,L.dk,Q.Nt,f.KE,f.hX,f.TO,f.R9,A.gD,B.ey,X.h,tt.q]});var zt=_(1203);function Ba(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 Ha(i,n){1&i&&t._UZ(0,"mat-progress-bar",35)}function za(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Date/Time"),t.qZA())}function Va(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 Ga(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Address"),t.qZA())}const Vt=function(i){return{width:i}};function Ka(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.address)}}function Wa(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Blockhash"),t.qZA())}function $a(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.blockHash)}}function Xa(i,n){1&i&&(t.TgZ(0,"th",36),t._uU(1,"Transaction ID"),t.qZA())}function ja(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.txid)}}function to(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1,"Amount (Sats)"),t.qZA())}function eo(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 no(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 io(i,n){if(1&i&&(t.TgZ(0,"td",37),t.YNc(1,eo,3,3,"span",41),t.YNc(2,no,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 ao(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1,"Fees (Sats)"),t.qZA())}function oo(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 so(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1,"Confirmations"),t.qZA())}function lo(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 ro(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 co(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",49)(1,"button",50),t.NdJ("click",function(o){const d=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onTransactionClick(d,o))}),t._uU(2,"View Info"),t.qZA()()}}function uo(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No transaction available."),t.qZA())}function po(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting transactions..."),t.qZA())}function mo(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 ho(i,n){if(1&i&&(t.TgZ(0,"td",51),t.YNc(1,uo,2,0,"p",52),t.YNc(2,po,2,0,"p",52),t.YNc(3,mo,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 _o=function(i){return{"display-none":i}};function go(i,n){if(1&i&&t._UZ(0,"tr",53),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,_o,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function fo(i,n){1&i&&t._UZ(0,"tr",54)}function Co(i,n){1&i&&t._UZ(0,"tr",55)}const xo=function(){return["all"]},yo=function(i){return{"error-border":i}},To=function(){return["no_transaction"]};class gt{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,D.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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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.sort&&this.paginator&&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){this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Transaction Information",message:[[{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}]]}}}))}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.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()})}}function Lo(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.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)}}gt.\u0275fac=function(n){return new(n||gt)(t.Y36(P.mQ),t.Y36(U.v),t.Y36(E.yh),t.Y36(c.uU),t.Y36(H.i1))},gt.\u0275cmp=t.Xpm({type:gt,selectors:[["rtl-ecl-on-chain-transaction-history"]],viewQuery:function(n,e){if(1&n&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:S.ye,useValue:(0,s.pt)("Transactions")}])],decls:52,vars:19,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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","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-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,e){1&n&&(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-label"),t._uU(9,"Filter By"),t.qZA(),t.TgZ(10,"mat-select",7),t.NdJ("ngModelChange",function(o){return e.selFilterBy=o})("selectionChange",function(){return e.selFilter="",e.applyFilter()}),t.TgZ(11,"perfect-scrollbar"),t.YNc(12,Ba,2,2,"mat-option",8),t.qZA()()(),t.TgZ(13,"mat-form-field",6)(14,"mat-label"),t._uU(15,"Filter"),t.qZA(),t.TgZ(16,"input",9),t.NdJ("ngModelChange",function(o){return e.selFilter=o})("input",function(){return e.applyFilter()})("keyup",function(){return e.applyFilter()}),t.qZA()()()(),t.TgZ(17,"div",10)(18,"div",11),t.YNc(19,Ha,1,0,"mat-progress-bar",12),t.TgZ(20,"table",13,14),t.ynx(22,15),t.YNc(23,za,2,0,"th",16),t.YNc(24,Va,3,4,"td",17),t.BQk(),t.ynx(25,18),t.YNc(26,Ga,2,0,"th",16),t.YNc(27,Ka,4,4,"td",17),t.BQk(),t.ynx(28,19),t.YNc(29,Wa,2,0,"th",16),t.YNc(30,$a,4,4,"td",17),t.BQk(),t.ynx(31,20),t.YNc(32,Xa,2,0,"th",16),t.YNc(33,ja,4,4,"td",17),t.BQk(),t.ynx(34,21),t.YNc(35,to,2,0,"th",22),t.YNc(36,io,3,2,"td",17),t.BQk(),t.ynx(37,23),t.YNc(38,ao,2,0,"th",22),t.YNc(39,oo,4,3,"td",17),t.BQk(),t.ynx(40,24),t.YNc(41,so,2,0,"th",22),t.YNc(42,lo,4,3,"td",17),t.BQk(),t.ynx(43,25),t.YNc(44,ro,6,0,"th",26),t.YNc(45,co,3,0,"td",27),t.BQk(),t.ynx(46,28),t.YNc(47,ho,4,3,"td",29),t.BQk(),t.YNc(48,go,1,3,"tr",30),t.YNc(49,fo,1,0,"tr",31),t.YNc(50,Co,1,0,"tr",32),t.qZA(),t._UZ(51,"mat-paginator",33),t.qZA()()()),2&n&&(t.xp6(3),t.Q6J("icon",e.faHistory),t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(15,xo).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(3),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.listTransactions)("ngClass",t.VKq(16,yo,""!==e.errorMessage)),t.xp6(28),t.Q6J("matFooterRowDef",t.DdM(18,To)),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))},dependencies:[c.mk,c.sg,c.O5,c.PC,m.Fj,m.JJ,m.On,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,w.lW,Q.Nt,f.KE,f.hX,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,S.NW,O.Vv,O.$V,c.JJ,c.uU]});class ft{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,M.h)(e=>e instanceof x.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()})}}ft.\u0275fac=function(n){return new(n||ft)(t.Y36(E.yh),t.Y36(x.F0))},ft.\u0275cmp=t.Xpm({type:ft,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","","mat-stretch-tabs","false","mat-align-tabs","start",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"],["fxLayout","row","fxFlex","100"],["mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(n,e){if(1&n&&(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,Lo,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",10),t._UZ(22,"rtl-ecl-on-chain-transaction-history",11),t.qZA()()()()),2&n){const a=t.MAs(18);t.xp6(1),t.Q6J("icon",e.faChartPie),t.xp6(6),t.Q6J("values",e.balances),t.xp6(2),t.Q6J("icon",e.faExchangeAlt),t.xp6(6),t.Q6J("tabPanel",a),t.xp6(1),t.Q6J("ngForOf",e.links)}},dependencies:[c.sg,N.BN,p.xw,p.Wh,p.yH,L.a8,L.dn,I.BU,I.sW,I.Nj,zt.D,x.lC,x.rH,gt]});var ae=_(2673);function bo(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 vo(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 Ct{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,M.h)(n=>n instanceof x.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()})}}function So(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",12),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.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)}}Ct.\u0275fac=function(n){return new(n||Ct)(t.Y36(E.yh),t.Y36(x.F0))},Ct.\u0275cmp=t.Xpm({type:Ct,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"],["mat-stretch-tabs","false","mat-align-tabs","start",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(n,e){1&n&&(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(o){return e.activeLink=o})("selectedTabChange",function(o){return e.onSelectedTabChange(o)}),t.TgZ(16,"mat-tab"),t.YNc(17,bo,2,1,"ng-template",8),t.qZA(),t.TgZ(18,"mat-tab"),t.YNc(19,vo,2,1,"ng-template",8),t.qZA()(),t.TgZ(20,"div",9),t._UZ(21,"router-outlet"),t.qZA()()()()),2&n&&(t.xp6(1),t.Q6J("icon",e.faChartPie),t.xp6(6),t.Q6J("values",e.balances),t.xp6(2),t.Q6J("icon",e.faUsers),t.xp6(6),t.Q6J("selectedIndex",e.activeLink))},dependencies:[N.BN,p.xw,p.Wh,p.yH,L.a8,L.dn,ae.k,I.uD,I.uX,I.SP,zt.D,x.lC]});class xt{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,M.h)(e=>e instanceof x.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||[],this.balances=a&&a.userPersona===s.ol.OPERATOR?[{title:"Local Capacity",dataValue:e.lightningBalance.localBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:e.lightningBalance.remoteBalance,tooltip:"Amount you can receive"}]:[{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()})}}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,d=t.oxw();return t.KtG(d.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)}}xt.\u0275fac=function(n){return new(n||xt)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(x.F0))},xt.\u0275cmp=t.Xpm({type:xt,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","","mat-stretch-tabs","false","mat-align-tabs","start",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(n,e){if(1&n&&(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,So,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&n){const a=t.MAs(18);t.xp6(1),t.Q6J("icon",e.faChartPie),t.xp6(6),t.Q6J("values",e.balances),t.xp6(2),t.Q6J("icon",e.faExchangeAlt),t.xp6(6),t.Q6J("tabPanel",a),t.xp6(1),t.Q6J("ngForOf",e.links)}},dependencies:[c.sg,N.BN,p.xw,p.Wh,p.yH,L.a8,L.dn,I.BU,I.sW,I.Nj,zt.D,x.lC,x.rH]});class yt{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,M.h)(e=>e instanceof x.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()})}}yt.\u0275fac=function(n){return new(n||yt)(t.Y36(x.F0))},yt.\u0275cmp=t.Xpm({type:yt,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","","mat-stretch-tabs","false","mat-align-tabs","start","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(n,e){if(1&n&&(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,Zo,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&n){const a=t.MAs(12);t.xp6(2),t.Q6J("icon",e.faMapSigns),t.xp6(7),t.Q6J("tabPanel",a),t.xp6(1),t.Q6J("ngForOf",e.links)}},dependencies:[c.sg,N.BN,p.xw,p.Wh,p.yH,L.a8,L.dn,I.BU,I.sW,I.Nj,x.lC,x.rH]});var kt=_(1948),oe=_(7009),se=_(5199);function Ao(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 Eo(i,n){1&i&&(t.TgZ(0,"th",23),t._uU(1,"Address"),t.qZA())}function wo(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 Io(i,n){1&i&&(t.TgZ(0,"th",25)(1,"div",26),t._uU(2,"Actions"),t.qZA()())}function Fo(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 qo(i,n){1&i&&t._UZ(0,"tr",29)}function No(i,n){1&i&&t._UZ(0,"tr",30)}const Oo=function(i){return{"background-color":i}};function Po(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,Ao,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,Eo,2,0,"th",17),t.YNc(44,wo,2,1,"td",18),t.BQk(),t.ynx(45,19),t.YNc(46,Io,3,0,"th",20),t.YNc(47,Fo,4,1,"td",18),t.BQk(),t.YNc(48,qo,1,0,"tr",21),t.YNc(49,No,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,Oo,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 Tt{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=new r.by(this.lookupResult.addresses?[...this.lookupResult.addresses]:[]),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)}}Tt.\u0275fac=function(n){return new(n||Tt)(t.Y36(P.mQ),t.Y36(oe.ux))},Tt.\u0275cmp=t.Xpm({type:Tt,selectors:[["rtl-ecl-node-lookup"]],viewQuery:function(n,e){if(1&n&&t.Gf(b.YE,5),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.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(n,e){1&n&&t.YNc(0,Po,50,21,"div",0),2&n&&t.Q6J("ngIf",e.lookupResult)},dependencies:[c.sg,c.O5,c.PC,p.xw,p.Wh,p.yH,v.Zl,w.lW,$.d,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.ge,r.ev,r.XQ,r.Gk,O.$V,se.y,c.rS,c.uU,c.Nd]});const Uo=["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 ko(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 Jo(i,n){if(1&i&&(t.TgZ(0,"span",23),t.YNc(1,ko,2,1,"div",24),t.qZA()),2&i){const e=t.oxw(2),a=t.MAs(23);t.xp6(1),t.Q6J("ngIf",e.nodeLookupValue.nodeId)("ngIfElse",a)}}function Mo(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 Qo(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,Jo,2,2,"span",21),t.YNc(6,Mo,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 Yo(i,n){1&i&&(t.TgZ(0,"h3"),t._uU(1,"Error! Unable to find details!"),t.qZA())}const Bo=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 m.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,M.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(){return this.lookupKeyCtrl.value?this.lookupKeyCtrl.value&&(this.lookupKeyCtrl.value.includes("@")||this.lookupKeyCtrl.value.includes(","))?(this.lookupKeyCtrl.setErrors({invalid:!0}),!0):void(0===(this.selectedFieldId||(this.selectedFieldId=0),this.flgSetLookupValue=!1,this.nodeLookupValue={},this.channelLookupValue=[],this.selectedFieldId)&&this.store.dispatch((0,D.Sf)({payload:this.lookupKeyCtrl.value.trim()}))):(this.lookupKeyCtrl.setErrors({required:!0}),!0)}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()})}}Lt.\u0275fac=function(n){return new(n||Lt)(t.Y36(P.mQ),t.Y36(U.v),t.Y36(E.yh),t.Y36(G.eX))},Lt.\u0275cmp=t.Xpm({type:Lt,selectors:[["rtl-ecl-lookups"]],viewQuery:function(n,e){if(1&n&&t.Gf(Uo,7),2&n){let a;t.iGM(a=t.CRH())&&(e.form=a.first)}},decls:24,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"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"formControl"],["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(n,e){1&n&&(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)(10,"mat-label"),t._uU(11),t.qZA(),t._UZ(12,"input",9,10),t.YNc(14,Do,2,1,"mat-error",11),t.YNc(15,Ro,2,1,"mat-error",11),t.qZA(),t.TgZ(16,"div",12)(17,"button",13),t.NdJ("click",function(){return e.resetData()}),t._uU(18,"Clear"),t.qZA(),t.TgZ(19,"button",14),t.NdJ("click",function(){return e.onLookup()}),t._uU(20,"Lookup"),t.qZA()()(),t.YNc(21,Qo,7,3,"div",15),t.qZA()()(),t.YNc(22,Yo,2,0,"ng-template",null,16,t.W1O)),2&n&&(t.xp6(7),t.Q6J("value",0),t.xp6(2),t.Q6J("ngClass",t.VKq(7,Bo,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM)),t.xp6(2),t.Oqu((null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder)||"Lookup Key"),t.xp6(1),t.Q6J("formControl",e.lookupKeyCtrl),t.xp6(2),t.Q6J("ngIf",null==e.lookupKeyCtrl.errors?null:e.lookupKeyCtrl.errors.required),t.xp6(1),t.Q6J("ngIf",null==e.lookupKeyCtrl.errors?null:e.lookupKeyCtrl.errors.invalid),t.xp6(6),t.Q6J("ngIf",e.flgSetLookupValue))},dependencies:[c.mk,c.O5,c.RF,c.n9,c.ED,m._Y,m.Fj,m.JJ,m.JL,m.Q7,m.F,m.oH,p.xw,p.Wh,p.yH,v.oO,w.lW,L.dn,Q.Nt,f.KE,f.hX,f.TO,kt.VQ,kt.U0,Tt],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 Ho=_(9122);class bt{constructor(n,e){this.store=n,this.eclEffects=e,this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,D._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:Ho.n}}}))},0)})}}bt.\u0275fac=function(n){return new(n||bt)(t.Y36(E.yh),t.Y36(Yt.o))},bt.\u0275cmp=t.Xpm({type:bt,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(n,e){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return e.onGenerateAddress()}),t._uU(3,"Generate Address"),t.qZA()()())},dependencies:[p.xw,p.Wh,p.yH,w.lW]});class vt{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()})}}vt.\u0275fac=function(n){return new(n||vt)(t.Y36(E.yh),t.Y36(x.gz))},vt.\u0275cmp=t.Xpm({type:vt,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(n,e){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return e.openSendFundsModal()}),t._uU(3),t.qZA()()()),2&n&&(t.xp6(3),t.Oqu(e.sweepAll?"Sweep All":"Send Funds"))},dependencies:[p.xw,p.Wh,p.yH,w.lW]});var zo=_(8675),le=_(4004),re=_(455),ce=_(7957),Vo=_(9843);const Go=["form"];function Ko(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 Wo(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer alias is required."),t.qZA())}function $o(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Peer not found in the list."),t.qZA())}function Xo(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"mat-form-field",1)(1,"mat-label"),t._uU(2,"Peer Alias"),t.qZA(),t.TgZ(3,"input",31),t.NdJ("change",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.qZA(),t.TgZ(4,"mat-autocomplete",32,33),t.NdJ("optionSelected",function(){t.CHM(e);const o=t.oxw();return t.KtG(o.onSelectedPeerChanged())}),t.YNc(6,Ko,2,2,"mat-option",34),t.ALo(7,"async"),t.qZA(),t.YNc(8,Wo,2,0,"mat-error",17),t.YNc(9,$o,2,0,"mat-error",17),t.qZA()}if(2&i){const e=t.MAs(5),a=t.oxw();t.xp6(3),t.Q6J("formControl",a.selectedPeer)("matAutocomplete",e),t.xp6(1),t.Q6J("displayWith",a.displayFn),t.xp6(2),t.Q6J("ngForOf",t.lcZ(7,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 jo(i,n){1&i&&t.GkF(0)}function ts(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function es(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 ns(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 is(i,n){if(1&i&&(t.TgZ(0,"div",36),t._UZ(1,"fa-icon",37),t.YNc(2,ns,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 as(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 os(i,n){if(1&i&&t.YNc(0,as,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 m.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,M.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,zo.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.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}: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,D.YX)({payload:n}))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}}function ss(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 ls(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 rs(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)}}it.\u0275fac=function(n){return new(n||it)(t.Y36(k.so),t.Y36(k.WI),t.Y36(E.yh),t.Y36(G.eX))},it.\u0275cmp=t.Xpm({type:it,selectors:[["rtl-ecl-open-channel"]],viewQuery:function(n,e){if(1&n&&t.Gf(Go,7),2&n){let a;t.iGM(a=t.CRH())&&(e.form=a.first)}},decls:52,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 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"],["fxLayout","column","fxFlex","70","fxLayoutAlign","start end"],["matInput","","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"],["fxLayout","column","fxFlex","49"],["matInput","","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","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(n,e){if(1&n&&(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 e.onClose()}),t._uU(7,"X"),t.qZA()(),t.TgZ(8,"mat-card-content",6)(9,"form",7,8),t.NdJ("submit",function(){return e.onOpenChannel()})("reset",function(){return e.resetData()}),t.TgZ(11,"div",9),t.YNc(12,Xo,10,8,"mat-form-field",10),t.qZA(),t.YNc(13,jo,1,0,"ng-container",11),t.TgZ(14,"div",9)(15,"div",12)(16,"mat-form-field",13)(17,"mat-label"),t._uU(18,"Amount"),t.qZA(),t.TgZ(19,"input",14,15),t.NdJ("ngModelChange",function(o){return e.fundingAmount=o}),t.qZA(),t.TgZ(21,"mat-hint"),t._uU(22),t.ALo(23,"number"),t.qZA(),t.TgZ(24,"span",16),t._uU(25," Sats "),t.qZA(),t.YNc(26,ts,2,0,"mat-error",17),t.YNc(27,es,2,1,"mat-error",17),t.qZA(),t.TgZ(28,"div",18)(29,"mat-slide-toggle",19),t.NdJ("ngModelChange",function(o){return e.isPrivate=o}),t._uU(30,"Private Channel"),t.qZA()()(),t.TgZ(31,"mat-expansion-panel",20),t.NdJ("closed",function(){return e.onAdvancedPanelToggle(!0)})("opened",function(){return e.onAdvancedPanelToggle(!1)}),t.TgZ(32,"mat-expansion-panel-header")(33,"mat-panel-title")(34,"span"),t._uU(35),t.qZA()()(),t.TgZ(36,"div",21)(37,"div",12)(38,"div",22)(39,"mat-form-field",23)(40,"mat-label"),t._uU(41,"Fee (Sats/vByte)"),t.qZA(),t.TgZ(42,"input",24,25),t.NdJ("ngModelChange",function(o){return e.feeRate=o}),t.qZA()()()()()()(),t.YNc(44,is,3,2,"div",26),t.TgZ(45,"div",27)(46,"button",28),t._uU(47,"Clear Fields"),t.qZA(),t.TgZ(48,"button",29),t._uU(49,"Open Channel"),t.qZA()()()()()(),t.YNc(50,os,1,1,"ng-template",null,30,t.W1O)),2&n){const a=t.MAs(20),o=t.MAs(51);t.xp6(5),t.Oqu(e.alertTitle),t.xp6(7),t.Q6J("ngIf",!e.peer&&e.peers&&e.peers.length>0),t.xp6(1),t.Q6J("ngTemplateOutlet",o),t.xp6(6),t.Q6J("step",1e3)("min",1)("max",e.totalBalance)("ngModel",e.fundingAmount),t.xp6(3),t.hij("Remaining: ",t.lcZ(23,16,e.totalBalance-(e.fundingAmount?e.fundingAmount:0)),""),t.xp6(4),t.Q6J("ngIf",null==a.errors?null:a.errors.required),t.xp6(1),t.Q6J("ngIf",null==a.errors?null:a.errors.max),t.xp6(2),t.Q6J("ngModel",e.isPrivate),t.xp6(6),t.Oqu(e.advancedTitle),t.xp6(7),t.Q6J("step",1)("min",0)("ngModel",e.feeRate),t.xp6(2),t.Q6J("ngIf",""!==e.channelConnectionError)}},dependencies:[c.sg,c.O5,c.tP,m._Y,m.Fj,m.wV,m.JJ,m.JL,m.Q7,m.qQ,m.Fd,m.On,m.F,m.oH,N.BN,p.xw,p.Wh,p.yH,w.lW,L.dn,L.dk,Y.ib,Y.yz,Y.yK,Q.Nt,f.KE,f.hX,f.bx,f.TO,f.R9,$.d,B.ey,re.Rr,ce.XC,ce.ZL,X.h,Vo.F,tt.q,c.Ov,c.JJ,c.rS],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]});class St{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,M.h)(n=>n instanceof x.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(){this.store.dispatch((0,Z.qR)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},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()})}}function cs(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 us(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 ps(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 ms(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Show Advanced"),t.qZA())}function ds(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Hide Advanced"),t.qZA())}function hs(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,ms,2,0,"p",22),t.YNc(2,ds,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 _s(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 gs(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)}}St.\u0275fac=function(n){return new(n||St)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(x.F0))},St.\u0275cmp=t.Xpm({type:St,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,"bordered-box"],["mat-stretch-tabs","false","mat-align-tabs","start",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(n,e){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"button",2),t.NdJ("click",function(){return e.onOpenChannel()}),t._uU(3,"Open Channel"),t.qZA()(),t.TgZ(4,"div",3)(5,"mat-tab-group",4),t.NdJ("selectedIndexChange",function(o){return e.activeLink=o})("selectedTabChange",function(o){return e.onSelectedTabChange(o)}),t.TgZ(6,"mat-tab"),t.YNc(7,ss,2,1,"ng-template",5),t.qZA(),t.TgZ(8,"mat-tab"),t.YNc(9,ls,2,1,"ng-template",5),t.qZA(),t.TgZ(10,"mat-tab"),t.YNc(11,rs,2,1,"ng-template",5),t.qZA()(),t.TgZ(12,"div",6),t._UZ(13,"router-outlet"),t.qZA()()()),2&n&&(t.xp6(5),t.Q6J("selectedIndex",e.activeLink))},dependencies:[p.xw,p.Wh,p.yH,w.lW,ae.k,I.uD,I.uX,I.SP,x.lC]});const fs=function(i){return{"xs-scroll-y":i}},Cs=function(i,n){return{"mt-2":i,"mt-1":n}};class K{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)}}function xs(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 ys(i,n){1&i&&t._UZ(0,"mat-progress-bar",39)}function Ts(i,n){1&i&&t._UZ(0,"th",40)}function Ls(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 bs(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 vs(i,n){if(1&i&&(t.TgZ(0,"td",41),t.YNc(1,Ls,2,1,"span",42),t.YNc(2,bs,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 Ss(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Short Channel ID"),t.qZA())}function Zs(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 As(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Channel ID"),t.qZA())}K.\u0275fac=function(n){return new(n||K)(t.Y36(k.so),t.Y36(k.WI),t.Y36(P.mQ),t.Y36(U.v),t.Y36(oe.ux))},K.\u0275cmp=t.Xpm({type:K,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 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(n,e){1&n&&(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 e.onClose()}),t._uU(8,"X"),t.qZA()(),t.TgZ(9,"mat-card-content",7)(10,"div",8)(11,"div",9),t.YNc(12,cs,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,us,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,ps,29,14,"div",16),t.TgZ(60,"div",17),t.YNc(61,hs,4,2,"button",18),t.YNc(62,_s,2,1,"button",19),t.YNc(63,gs,2,1,"button",20),t.qZA()()()()()),2&n&&(t.xp6(4),t.Q6J("icon",e.faReceipt),t.xp6(5),t.Q6J("ngClass",t.VKq(23,fs,e.screenSize===e.screenSizeEnum.XS)),t.xp6(3),t.Q6J("ngIf","open"===e.channelsType),t.xp6(5),t.Oqu(e.channel.alias),t.xp6(1),t.Q6J("ngIf","open"!==e.channelsType),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(e.channel.channelId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(e.channel.nodeId),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(e.channel.announceChannel?"No":"Yes"),t.xp6(5),t.Oqu(e.channel.isFunder?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(6),t.Oqu(t.lcZ(52,21,e.channel.state)),t.xp6(6),t.Oqu(e.channel.buried?"Yes":"No"),t.xp6(1),t.Q6J("inset",!0),t.xp6(1),t.Q6J("ngIf",e.showAdvanced&&"open"===e.channelsType),t.xp6(1),t.Q6J("ngClass",t.WLB(25,Cs,!e.showAdvanced,e.showAdvanced)),t.xp6(1),t.Q6J("ngIf","open"===e.channelsType),t.xp6(1),t.Q6J("ngIf","open"===e.channelsType),t.xp6(1),t.Q6J("ngIf","open"!==e.channelsType))},dependencies:[c.mk,c.O5,N.BN,p.xw,p.Wh,p.yH,v.oO,w.lW,L.dn,L.dk,$.d,se.y,X.h,c.JJ,c.rS]});const Gt=function(i){return{width:i}};function Es(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function ws(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Alias"),t.qZA())}function Is(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Fs(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Node ID"),t.qZA())}function qs(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function Ns(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Funder"),t.qZA())}function Os(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 Ps(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Buried"),t.qZA())}function Us(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 ks(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Fee Rate (mili mSats)"),t.qZA())}function Js(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 Ms(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Local Balance (Sats)"),t.qZA())}function Qs(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 Ys(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Bs(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 Hs(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Fee/KW"),t.qZA())}function zs(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 Vs(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Balance Score"),t.qZA())}function Gs(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 Ks(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 Ws(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 d=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onChannelClick(d,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",58),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.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,d=t.oxw();return t.KtG(d.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,d=t.oxw();return t.KtG(d.onChannelClose(l,!0))}),t._uU(11,"Force Close"),t.qZA()()()()}}function $s(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 Xs(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No channel available."),t.qZA())}function js(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting channels..."),t.qZA())}function tl(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 el(i,n){if(1&i&&(t.TgZ(0,"td",61),t.YNc(1,$s,2,0,"p",62),t.YNc(2,Xs,2,0,"p",62),t.YNc(3,js,2,0,"p",62),t.YNc(4,tl,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 nl=function(i){return{"display-none":i}};function il(i,n){if(1&i&&t._UZ(0,"tr",63),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,nl,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function al(i,n){1&i&&t._UZ(0,"tr",64)}function ol(i,n){1&i&&t._UZ(0,"tr",65)}const sl=function(){return["all"]},ll=function(i){return{"error-border":i}},rl=function(){return["no_peer"]};class Zt{constructor(n,e,a,o,l,d){this.logger=n,this.store=e,this.rtlEffects=a,this.commonService=o,this.router=l,this.camelCaseWithSpaces=d,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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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){"all"!==n&&n?.state&&"NORMAL"!==n?.state||(this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update",message:[],titleMessage:"string"==typeof n&&"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),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,d=o[1].inputValue;let y=null;if(this.commonService.isVersionCompatible(this.information.version,"0.6.2")){let C="";"all"===n?(this.activeChannels.forEach(q=>{C=C+","+q.nodeId}),C=C.substring(1),y={baseFeeMsat:l,feeRate:d,nodeIds:C}):y={baseFeeMsat:l,feeRate:d,nodeId:n?.nodeId}}else{let C="";"all"===n?(this.activeChannels.forEach(q=>{C=C+","+q.channelId}),C=C.substring(1),y={baseFeeMsat:l,feeRate:d,channelIds:C}):y={baseFeeMsat:l,feeRate:d,channelId:n?.channelId}}this.store.dispatch((0,D.pW)({payload:y}))}}),this.applyFilter())}percentHintFunction(n){return(n/1e4).toString()+"%"}onChannelClose(n,e){this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:e?"Force Close Channel":"Close Channel",titleMessage: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),noBtnText:"Cancel",yesBtnText:e?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[6])).subscribe(d=>{d&&this.store.dispatch((0,D.BL)({payload:{channelId:n.channelId,force:e}}))})}onChannelClick(n,e){this.store.dispatch((0,Z.qR)({payload:{data:{channel:n,channelsType:"open",component:K}}}))}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.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()})}}function cl(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 ul(i,n){1&i&&t._UZ(0,"mat-progress-bar",36)}function pl(i,n){1&i&&t._UZ(0,"th",37)}function ml(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 dl(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 hl(i,n){if(1&i&&(t.TgZ(0,"td",38),t.YNc(1,ml,2,1,"span",39),t.YNc(2,dl,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 _l(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"State"),t.qZA())}function gl(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 fl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Channel ID"),t.qZA())}Zt.\u0275fac=function(n){return new(n||Zt)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(Rt.V),t.Y36(U.v),t.Y36(x.F0),t.Y36(H.i1))},Zt.\u0275cmp=t.Xpm({type:Zt,selectors:[["rtl-ecl-channel-open-table"]],viewQuery:function(n,e){if(1&n&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:66,vars:18,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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","5",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-cell","","colspan","5"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,e){1&n&&(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-label"),t._uU(6,"Filter By"),t.qZA(),t.TgZ(7,"mat-select",5),t.NdJ("ngModelChange",function(o){return e.selFilterBy=o})("selectionChange",function(){return e.selFilter="",e.applyFilter()}),t.TgZ(8,"perfect-scrollbar"),t.YNc(9,xs,2,2,"mat-option",6),t.qZA()()(),t.TgZ(10,"mat-form-field",4)(11,"mat-label"),t._uU(12,"Filter"),t.qZA(),t.TgZ(13,"input",7),t.NdJ("ngModelChange",function(o){return e.selFilter=o})("input",function(){return e.applyFilter()})("keyup",function(){return e.applyFilter()}),t.qZA()()()(),t.TgZ(14,"div",8),t.YNc(15,ys,1,0,"mat-progress-bar",9),t.TgZ(16,"table",10,11),t.ynx(18,12),t.YNc(19,Ts,1,0,"th",13),t.YNc(20,vs,3,2,"td",14),t.BQk(),t.ynx(21,15),t.YNc(22,Ss,2,0,"th",16),t.YNc(23,Zs,2,1,"td",14),t.BQk(),t.ynx(24,17),t.YNc(25,As,2,0,"th",16),t.YNc(26,Es,4,4,"td",14),t.BQk(),t.ynx(27,18),t.YNc(28,ws,2,0,"th",16),t.YNc(29,Is,4,4,"td",14),t.BQk(),t.ynx(30,19),t.YNc(31,Fs,2,0,"th",16),t.YNc(32,qs,4,4,"td",14),t.BQk(),t.ynx(33,20),t.YNc(34,Ns,2,0,"th",16),t.YNc(35,Os,2,1,"td",14),t.BQk(),t.ynx(36,21),t.YNc(37,Ps,2,0,"th",16),t.YNc(38,Us,2,1,"td",14),t.BQk(),t.ynx(39,22),t.YNc(40,Ds,2,0,"th",23),t.YNc(41,Rs,4,4,"td",14),t.BQk(),t.ynx(42,24),t.YNc(43,ks,2,0,"th",23),t.YNc(44,Js,4,4,"td",14),t.BQk(),t.ynx(45,25),t.YNc(46,Ms,2,0,"th",23),t.YNc(47,Qs,4,4,"td",14),t.BQk(),t.ynx(48,26),t.YNc(49,Ys,2,0,"th",23),t.YNc(50,Bs,4,4,"td",14),t.BQk(),t.ynx(51,27),t.YNc(52,Hs,2,0,"th",23),t.YNc(53,zs,4,4,"td",14),t.BQk(),t.ynx(54,28),t.YNc(55,Vs,2,0,"th",16),t.YNc(56,Gs,6,4,"td",14),t.BQk(),t.ynx(57,29),t.YNc(58,Ks,8,0,"th",30),t.YNc(59,Ws,12,0,"td",31),t.BQk(),t.ynx(60,32),t.YNc(61,el,5,4,"td",33),t.BQk(),t.YNc(62,il,1,3,"tr",34),t.YNc(63,al,1,0,"tr",35),t.YNc(64,ol,1,0,"tr",36),t.qZA()(),t._UZ(65,"mat-paginator",37),t.qZA()),2&n&&(t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(14,sl).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.channels)("ngClass",t.VKq(15,ll,""!==e.errorMessage)),t.xp6(46),t.Q6J("matFooterRowDef",t.DdM(17,rl)),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))},dependencies:[c.mk,c.sg,c.O5,c.PC,m.Fj,m.JJ,m.On,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,Q.Nt,f.KE,f.hX,f.bx,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,V.gM,S.NW,O.Vv,O.$V,c.JJ],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:2rem;min-width:15rem;max-width:30rem}"]});const ue=function(i){return{width:i}};function Cl(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function xl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Alias"),t.qZA())}function yl(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 Tl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Node ID"),t.qZA())}function Ll(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function bl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Funder"),t.qZA())}function vl(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 Sl(i,n){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Buried"),t.qZA())}function Zl(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 Al(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Local Balance (Sats)"),t.qZA())}function El(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 wl(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function Il(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 Fl(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Fee/KW"),t.qZA())}function ql(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 Nl(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 Ol(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",53)(1,"button",54),t.NdJ("click",function(o){const d=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onChannelClick(d,o))}),t._uU(2,"View Info"),t.qZA()()}}function Pl(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No pending channel available."),t.qZA())}function Ul(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,Pl,2,0,"p",56),t.YNc(2,Ul,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 kl=function(i){return{"display-none":i}};function Jl(i,n){if(1&i&&t._UZ(0,"tr",57),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,kl,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Ml(i,n){1&i&&t._UZ(0,"tr",58)}function Ql(i,n){1&i&&t._UZ(0,"tr",59)}const Yl=function(){return["all"]},Bl=function(i){return{"error-border":i}},Hl=function(){return["no_channel"]};class At{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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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:K}}}))}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.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()})}}At.\u0275fac=function(n){return new(n||At)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(U.v),t.Y36(H.i1))},At.\u0275cmp=t.Xpm({type:At,selectors:[["rtl-ecl-channel-pending-table"]],viewQuery:function(n,e){if(1&n&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:57,vars:18,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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","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-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,e){1&n&&(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-label"),t._uU(6,"Filter By"),t.qZA(),t.TgZ(7,"mat-select",5),t.NdJ("ngModelChange",function(o){return e.selFilterBy=o})("selectionChange",function(){return e.selFilter="",e.applyFilter()}),t.TgZ(8,"perfect-scrollbar"),t.YNc(9,cl,2,2,"mat-option",6),t.qZA()()(),t.TgZ(10,"mat-form-field",4)(11,"mat-label"),t._uU(12,"Filter"),t.qZA(),t.TgZ(13,"input",7),t.NdJ("ngModelChange",function(o){return e.selFilter=o})("input",function(){return e.applyFilter()})("keyup",function(){return e.applyFilter()}),t.qZA()()()(),t.TgZ(14,"div",8),t.YNc(15,ul,1,0,"mat-progress-bar",9),t.TgZ(16,"table",10,11),t.ynx(18,12),t.YNc(19,pl,1,0,"th",13),t.YNc(20,hl,3,2,"td",14),t.BQk(),t.ynx(21,15),t.YNc(22,_l,2,0,"th",16),t.YNc(23,gl,3,3,"td",14),t.BQk(),t.ynx(24,17),t.YNc(25,fl,2,0,"th",16),t.YNc(26,Cl,4,4,"td",14),t.BQk(),t.ynx(27,18),t.YNc(28,xl,2,0,"th",16),t.YNc(29,yl,2,1,"td",14),t.BQk(),t.ynx(30,19),t.YNc(31,Tl,2,0,"th",16),t.YNc(32,Ll,4,4,"td",14),t.BQk(),t.ynx(33,20),t.YNc(34,bl,2,0,"th",16),t.YNc(35,vl,2,1,"td",14),t.BQk(),t.ynx(36,21),t.YNc(37,Sl,2,0,"th",16),t.YNc(38,Zl,2,1,"td",14),t.BQk(),t.ynx(39,22),t.YNc(40,Al,2,0,"th",23),t.YNc(41,El,4,4,"td",14),t.BQk(),t.ynx(42,24),t.YNc(43,wl,2,0,"th",23),t.YNc(44,Il,4,4,"td",14),t.BQk(),t.ynx(45,25),t.YNc(46,Fl,2,0,"th",23),t.YNc(47,ql,4,4,"td",14),t.BQk(),t.ynx(48,26),t.YNc(49,Nl,6,0,"th",27),t.YNc(50,Ol,3,0,"td",28),t.BQk(),t.ynx(51,29),t.YNc(52,Rl,4,3,"td",30),t.BQk(),t.YNc(53,Jl,1,3,"tr",31),t.YNc(54,Ml,1,0,"tr",32),t.YNc(55,Ql,1,0,"tr",33),t.qZA()(),t._UZ(56,"mat-paginator",34),t.qZA()),2&n&&(t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(14,Yl).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.channels)("ngClass",t.VKq(15,Bl,""!==e.errorMessage)),t.xp6(37),t.Q6J("matFooterRowDef",t.DdM(17,Hl)),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))},dependencies:[c.mk,c.sg,c.O5,c.PC,m.Fj,m.JJ,m.On,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,w.lW,Q.Nt,f.KE,f.hX,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,V.gM,S.NW,O.Vv,O.$V,c.JJ,c.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]});var Kt=_(8425);const zl=["peersForm"],Vl=["stepper"];function Gl(i,n){if(1&i&&t._uU(0),2&i){const e=t.oxw();t.Oqu(e.peerFormLabel)}}function Kl(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Address is required."),t.qZA())}function Wl(i,n){if(1&i&&(t.TgZ(0,"div",33),t._UZ(1,"fa-icon",34),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 $l(i,n){if(1&i&&t._uU(0),2&i){const e=t.oxw();t.Oqu(e.channelFormLabel)}}function Xl(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function jl(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount must be a positive number."),t.qZA())}function tr(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 er(i,n){if(1&i&&(t.TgZ(0,"div",33),t._UZ(1,"fa-icon",34),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 Et{constructor(n,e,a,o,l,d){this.dialogRef=n,this.data=e,this.store=a,this.formBuilder=o,this.actions=l,this.logger=d,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:["",[m.kI.required]],peerAddress:[this.peerAddress,[m.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[m.kI.required,m.kI.min(1),m.kI.max(this.totalBalance)]],isPrivate:[!!this.selNode?.unannouncedChannels],feeRate:[null],hiddenAmount:["",[m.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,M.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,D.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,D.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.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer?.nodeId):"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+(this.newlyAddedPeer?.alias?this.newlyAddedPeer.alias:this.newlyAddedPeer?.nodeId):"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"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()})}}function nr(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 ir(i,n){1&i&&t._UZ(0,"mat-progress-bar",36)}function ar(i,n){1&i&&t._UZ(0,"th",37)}Et.\u0275fac=function(n){return new(n||Et)(t.Y36(k.so),t.Y36(k.WI),t.Y36(E.yh),t.Y36(m.QS),t.Y36(G.eX),t.Y36(P.mQ))},Et.\u0275cmp=t.Xpm({type:Et,selectors:[["rtl-ecl-connect-peer"]],viewQuery:function(n,e){if(1&n&&(t.Gf(zl,5),t.Gf(Vl,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.form=a.first),t.iGM(a=t.CRH())&&(e.stepper=a.first)}},decls:55,vars:22,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 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",""],["fxLayout","column","fxFlex","100"],["autoFocus","","matInput","","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"],["fxLayout","column","fxFlex","30","fxLayoutAlign","start end"],["matInput","","autoFocus","","formControlName","fundingAmount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxLayout","column","fxFlex","30"],["matInput","","formControlName","feeRate","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(n,e){1&n&&(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 e.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(o){return e.stepSelectionChanged(o)}),t.TgZ(12,"mat-step",10)(13,"form",11),t.YNc(14,Gl,1,1,"ng-template",12),t.TgZ(15,"mat-form-field",13)(16,"mat-label"),t._uU(17,"Lightning Address (pubkey OR pubkey@ip:port)"),t.qZA(),t._UZ(18,"input",14),t.YNc(19,Kl,2,0,"mat-error",15),t.qZA(),t.YNc(20,Wl,4,2,"div",16),t.TgZ(21,"div",17)(22,"button",18),t.NdJ("click",function(){return e.onConnectPeer()}),t._uU(23),t.qZA()()()(),t.TgZ(24,"mat-step",10)(25,"form",19),t.YNc(26,$l,1,1,"ng-template",20),t.TgZ(27,"div",21)(28,"div",22)(29,"mat-form-field",23)(30,"mat-label"),t._uU(31,"Amount"),t.qZA(),t._UZ(32,"input",24),t.TgZ(33,"mat-hint"),t._uU(34),t.ALo(35,"number"),t.qZA(),t.TgZ(36,"span",25),t._uU(37," Sats "),t.qZA(),t.YNc(38,Xl,2,0,"mat-error",15),t.YNc(39,jl,2,0,"mat-error",15),t.YNc(40,tr,2,1,"mat-error",15),t.qZA(),t.TgZ(41,"mat-form-field",26)(42,"mat-label"),t._uU(43,"Fee (Sats/vByte)"),t.qZA(),t._UZ(44,"input",27),t.qZA(),t.TgZ(45,"div",28)(46,"mat-slide-toggle",29),t._uU(47,"Private Channel"),t.qZA()()()(),t.YNc(48,er,4,2,"div",16),t.TgZ(49,"div",17)(50,"button",30),t.NdJ("click",function(){return e.onOpenChannel()}),t._uU(51),t.qZA()()()()(),t.TgZ(52,"div",31)(53,"button",32),t.NdJ("click",function(){return e.onClose()}),t._uU(54),t.qZA()()()()()()),2&n&&(t.xp6(10),t.Q6J("linear",!0),t.xp6(2),t.Q6J("stepControl",e.peerFormGroup)("editable",e.flgEditable),t.xp6(1),t.Q6J("formGroup",e.peerFormGroup),t.xp6(6),t.Q6J("ngIf",null==e.peerFormGroup.controls.peerAddress.errors?null:e.peerFormGroup.controls.peerAddress.errors.required),t.xp6(1),t.Q6J("ngIf",""!==e.peerConnectionError),t.xp6(3),t.Oqu(""!==e.peerConnectionError?"Retry":"Add Peer"),t.xp6(1),t.Q6J("stepControl",e.channelFormGroup)("editable",e.flgEditable),t.xp6(1),t.Q6J("formGroup",e.channelFormGroup),t.xp6(7),t.Q6J("step",1e3),t.xp6(2),t.hij("Remaining: ",t.lcZ(35,20,e.totalBalance-(e.channelFormGroup.controls.fundingAmount.value?e.channelFormGroup.controls.fundingAmount.value:0)),""),t.xp6(4),t.Q6J("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.required),t.xp6(1),t.Q6J("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.min),t.xp6(1),t.Q6J("ngIf",null==e.channelFormGroup.controls.fundingAmount.errors?null:e.channelFormGroup.controls.fundingAmount.errors.max),t.xp6(4),t.Q6J("step",1)("min",0),t.xp6(4),t.Q6J("ngIf",""!==e.channelConnectionError),t.xp6(3),t.Oqu(""!==e.channelConnectionError?"Retry":"Open Channel"),t.xp6(3),t.Oqu(null!=e.newlyAddedPeer&&e.newlyAddedPeer.nodeId?"Do It Later":"Close"))},dependencies:[c.O5,m._Y,m.Fj,m.wV,m.JJ,m.JL,m.Q7,m.qQ,m.sg,m.u,N.BN,p.xw,p.Wh,p.yH,w.lW,L.dn,L.dk,Q.Nt,f.KE,f.hX,f.bx,f.TO,f.R9,re.Rr,Kt.C0,Kt.VY,Kt.Vq,X.h,tt.q,c.JJ]});const pe=function(i){return{"mr-0":i}};function or(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 sr(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 lr(i,n){if(1&i&&(t.TgZ(0,"td",38),t.YNc(1,or,1,3,"span",39),t.YNc(2,sr,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 rr(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Alias"),t.qZA())}const me=function(i){return{width:i}};function cr(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function ur(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Node ID"),t.qZA())}function pr(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function mr(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Network Address"),t.qZA())}function dr(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 hr(i,n){1&i&&(t.TgZ(0,"th",43),t._uU(1,"Channels"),t.qZA())}function _r(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 gr(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 fr(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 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.onConnectPeer(o))}),t._uU(1,"Reconnect"),t.qZA()}}function xr(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 d=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onPeerClick(d,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",49),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.onOpenChannel(l))}),t._uU(7,"Open Channel"),t.qZA(),t.YNc(8,fr,2,0,"mat-option",51),t.YNc(9,Cr,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 yr(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No connected peer."),t.qZA())}function Tr(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting peers..."),t.qZA())}function Lr(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 br(i,n){if(1&i&&(t.TgZ(0,"td",52),t.YNc(1,yr,2,0,"p",53),t.YNc(2,Tr,2,0,"p",53),t.YNc(3,Lr,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 vr=function(i){return{"display-none":i}};function Sr(i,n){if(1&i&&t._UZ(0,"tr",54),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,vr,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function Zr(i,n){1&i&&t._UZ(0,"tr",55)}function Ar(i,n){1&i&&t._UZ(0,"tr",56)}const Er=function(){return["all"]},wr=function(i){return{"error-border":i}},Ir=function(){return["no_peer"]};class wt{constructor(n,e,a,o,l,d){this.logger=n,this.store=e,this.rtlEffects=a,this.actions=o,this.commonService=l,this.camelCaseWithSpaces=d,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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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,M.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:Et}}}))}onOpenChannel(n){this.store.dispatch((0,Z.qR)({payload:{data:{alertTitle:"Open Channel",message:{peer:n,information:this.information,balance:this.availableBalance},newlyAdded:!1,component:it}}}))}onPeerDetach(n){this.store.dispatch(n&&n.channels&&n.channels>0?(0,Z.qR)({payload:{data:{type:s.n_.ERROR,alertTitle:"Disconnect Not Allowed",titleMessage:"Channel active with this peer."}}}):(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,D.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=new r.by(n?[...n]:[]),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.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()})}}wt.\u0275fac=function(n){return new(n||wt)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(Rt.V),t.Y36(G.eX),t.Y36(U.v),t.Y36(H.i1))},wt.\u0275cmp=t.Xpm({type:wt,selectors:[["rtl-ecl-peers"]],viewQuery:function(n,e){if(1&n&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:S.ye,useValue:(0,s.pt)("Peers")}])],decls:50,vars:19,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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","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-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,e){1&n&&(t.TgZ(0,"div",0)(1,"form",1,2)(3,"button",3),t.NdJ("click",function(){return e.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-label"),t._uU(14,"Filter By"),t.qZA(),t.TgZ(15,"mat-select",11),t.NdJ("ngModelChange",function(o){return e.selFilterBy=o})("selectionChange",function(){return e.selFilter="",e.applyFilter()}),t.TgZ(16,"perfect-scrollbar"),t.YNc(17,nr,2,2,"mat-option",12),t.qZA()()(),t.TgZ(18,"mat-form-field",10)(19,"mat-label"),t._uU(20,"Filter"),t.qZA(),t.TgZ(21,"input",13),t.NdJ("ngModelChange",function(o){return e.selFilter=o})("input",function(){return e.applyFilter()})("keyup",function(){return e.applyFilter()}),t.qZA()()()(),t.TgZ(22,"div",14),t.YNc(23,ir,1,0,"mat-progress-bar",15),t.TgZ(24,"table",16,17),t.ynx(26,18),t.YNc(27,ar,1,0,"th",19),t.YNc(28,lr,3,2,"td",20),t.BQk(),t.ynx(29,21),t.YNc(30,rr,2,0,"th",22),t.YNc(31,cr,4,4,"td",20),t.BQk(),t.ynx(32,23),t.YNc(33,ur,2,0,"th",22),t.YNc(34,pr,4,4,"td",20),t.BQk(),t.ynx(35,24),t.YNc(36,mr,2,0,"th",22),t.YNc(37,dr,2,1,"td",20),t.BQk(),t.ynx(38,25),t.YNc(39,hr,2,0,"th",22),t.YNc(40,_r,2,1,"td",20),t.BQk(),t.ynx(41,26),t.YNc(42,gr,6,0,"th",27),t.YNc(43,xr,10,2,"td",28),t.BQk(),t.ynx(44,29),t.YNc(45,br,4,3,"td",30),t.BQk(),t.YNc(46,Sr,1,3,"tr",31),t.YNc(47,Zr,1,0,"tr",32),t.YNc(48,Ar,1,0,"tr",33),t.qZA()(),t._UZ(49,"mat-paginator",34),t.qZA()()),2&n&&(t.xp6(8),t.Q6J("icon",e.faUsers),t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(15,Er).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.peers)("ngClass",t.VKq(16,wr,""!==e.errorMessage)),t.xp6(22),t.Q6J("matFooterRowDef",t.DdM(18,Ir)),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))},dependencies:[c.mk,c.sg,c.O5,c.PC,m._Y,m.Fj,m.JJ,m.JL,m.On,m.F,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,w.lW,Q.Nt,f.KE,f.hX,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,V.gM,S.NW,O.Vv,O.$V],styles:[".mat-column-state[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]});const Fr=["queryRoutesForm"];function qr(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Destination Node ID is required."),t.qZA())}function Nr(i,n){1&i&&(t.TgZ(0,"mat-error"),t._uU(1,"Amount is required."),t.qZA())}function Or(i,n){1&i&&t._UZ(0,"mat-progress-bar",22)}function Pr(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1," Alias"),t.qZA())}const de=function(i){return{"max-width":i}};function Ur(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"span",42)(2,"span",43),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?"6rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Dr(i,n){1&i&&(t.TgZ(0,"th",40),t._uU(1," ID"),t.qZA())}function Rr(i,n){if(1&i&&(t.TgZ(0,"td",41)(1,"span",42)(2,"span",43),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?"6rem":"30rem")),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function kr(i,n){1&i&&(t.TgZ(0,"th",40)(1,"div",44),t._uU(2,"Actions"),t.qZA()())}function Jr(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",45)(1,"button",46),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw(2);return t.KtG(d.onHopClick(l))}),t._uU(2,"View Info"),t.qZA()()}}function Mr(i,n){1&i&&t._UZ(0,"tr",47)}function Qr(i,n){1&i&&t._UZ(0,"tr",48)}const Yr=function(i){return{"overflow-auto error-border":i,"overflow-auto":!0}};function Br(i,n){if(1&i&&(t.TgZ(0,"div",23)(1,"mat-expansion-panel",24)(2,"mat-expansion-panel-header")(3,"mat-panel-title",25)(4,"span",26),t._uU(5),t.qZA(),t.TgZ(6,"span",27),t._uU(7),t.ALo(8,"number"),t.qZA()()(),t.TgZ(9,"mat-panel-description",28)(10,"div",29)(11,"table",30,31),t.ynx(13,32),t.YNc(14,Pr,2,0,"th",33),t.YNc(15,Ur,4,4,"td",34),t.BQk(),t.ynx(16,35),t.YNc(17,Dr,2,0,"th",33),t.YNc(18,Rr,4,4,"td",34),t.BQk(),t.ynx(19,36),t.YNc(20,kr,3,0,"th",33),t.YNc(21,Jr,3,0,"td",37),t.BQk(),t.YNc(22,Mr,1,0,"tr",38),t.YNc(23,Qr,1,0,"tr",39),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,Yr,"error"===o.flgLoading[0])),t.xp6(11),t.Q6J("matHeaderRowDef",o.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",o.displayedColumns)}}class It{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,D.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){this.store.dispatch((0,Z.qR)({payload:{data:{type:s.n_.INFORMATION,alertTitle:"Route Information",message:[[{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}]]}}}))}ngOnDestroy(){this.unSubs.forEach(n=>{n.next(null),n.complete()})}}function Hr(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 zr(i,n){1&i&&t._UZ(0,"mat-progress-bar",38)}function Vr(i,n){1&i&&t._UZ(0,"th",39)}function Gr(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 Kr(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 Wr(i,n){if(1&i&&(t.TgZ(0,"td",40),t.YNc(1,Gr,2,1,"span",41),t.YNc(2,Kr,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 $r(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"State"),t.qZA())}function Xr(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 jr(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Short Channel ID"),t.qZA())}function tc(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 ec(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Channel ID"),t.qZA())}It.\u0275fac=function(n){return new(n||It)(t.Y36(E.yh),t.Y36(Yt.o),t.Y36(U.v))},It.\u0275cmp=t.Xpm({type:It,selectors:[["rtl-ecl-query-routes"]],viewQuery:function(n,e){if(1&n&&t.Gf(Fr,7),2&n){let a;t.iGM(a=t.CRH())&&(e.form=a.first)}},decls:32,vars:10,consts:[["fxLayout","column"],["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"],["fxLayout","column","fxFlex","69","fxLayoutAlign","start end"],["matInput","","name","nodeId","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxLayout","column","fxFlex","29","fxLayoutAlign","start end"],["matInput","","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","column","fxLayoutAlign","start stretch","fxLayout.gt-sm","row wrap",1,"page-sub-title-container","mt-3","mb-1"],["fxFlex","70","fxLayoutAlign","start center"],[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"],["fxLayout","column","fxFlex","100"],["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.gt-xs","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(n,e){if(1&n){const a=t.EpF();t.TgZ(0,"div",0)(1,"form",1,2),t.NdJ("ngSubmit",function(){t.CHM(a);const l=t.MAs(2);return t.KtG(l.form.valid&&e.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,"mat-label"),t._uU(9,"Destination Node ID"),t.qZA(),t.TgZ(10,"input",6,7),t.NdJ("ngModelChange",function(l){return e.nodeId=l}),t.qZA(),t.YNc(12,qr,2,0,"mat-error",8),t.qZA(),t.TgZ(13,"mat-form-field",9)(14,"mat-label"),t._uU(15,"Amount (Sats)"),t.qZA(),t.TgZ(16,"input",10),t.NdJ("ngModelChange",function(l){return e.amount=l}),t.qZA(),t.YNc(17,Nr,2,0,"mat-error",8),t.qZA(),t.TgZ(18,"div",11)(19,"button",12),t.NdJ("click",function(){return e.resetData()}),t._uU(20,"Clear"),t.qZA(),t.TgZ(21,"button",13),t._uU(22,"Query Route"),t.qZA()()(),t.TgZ(23,"div",14)(24,"div",15),t._UZ(25,"fa-icon",16),t.TgZ(26,"span",17),t._uU(27,"Transaction Route"),t.qZA()()(),t.YNc(28,Or,1,0,"mat-progress-bar",18),t.TgZ(29,"div",19)(30,"div",20),t.YNc(31,Br,24,10,"div",21),t.qZA()()()}2&n&&(t.xp6(4),t.Q6J("icon",e.faExclamationTriangle),t.xp6(6),t.Q6J("ngModel",e.nodeId),t.xp6(2),t.Q6J("ngIf",!e.nodeId),t.xp6(4),t.Q6J("step",1e3)("min",0)("ngModel",e.amount),t.xp6(1),t.Q6J("ngIf",!e.amount),t.xp6(8),t.Q6J("icon",e.faRoute),t.xp6(3),t.Q6J("ngIf",!0===e.flgLoading[0]),t.xp6(3),t.Q6J("ngForOf",e.allQRoutes))},dependencies:[c.mk,c.sg,c.O5,c.PC,m._Y,m.Fj,m.wV,m.JJ,m.JL,m.Q7,m.qQ,m.On,m.F,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,w.lW,Y.ib,Y.yz,Y.yK,Y.u4,Q.Nt,f.KE,f.hX,f.TO,J.pW,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.ge,r.ev,r.XQ,r.Gk,O.$V,tt.q,c.JJ]});const Wt=function(i){return{width:i}};function nc(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function ic(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Alias"),t.qZA())}function ac(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(e.alias)}}function oc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Node ID"),t.qZA())}function sc(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?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.nodeId)}}function lc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Funder"),t.qZA())}function rc(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 cc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Buried"),t.qZA())}function uc(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 pc(i,n){1&i&&(t.TgZ(0,"th",49),t._uU(1,"Local Balance (Sats)"),t.qZA())}function mc(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 dc(i,n){1&i&&(t.TgZ(0,"th",49),t._uU(1,"Remote Balance (Sats)"),t.qZA())}function hc(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 _c(i,n){1&i&&(t.TgZ(0,"th",49),t._uU(1,"Local Fee/KW"),t.qZA())}function gc(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 fc(i,n){1&i&&(t.TgZ(0,"th",46),t._uU(1,"Balance Score"),t.qZA())}function Cc(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 xc(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 yc(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 d=t.CHM(e).$implicit,y=t.oxw();return t.KtG(y.onChannelClick(d,o))}),t._uU(5,"View Info"),t.qZA(),t.TgZ(6,"mat-option",57),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.onChannelClose(l,!0))}),t._uU(7,"Force Close"),t.qZA()()()()}}function Tc(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No inactive channel available."),t.qZA())}function Lc(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting inactive channels..."),t.qZA())}function bc(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 vc(i,n){if(1&i&&(t.TgZ(0,"td",60),t.YNc(1,Tc,2,0,"p",61),t.YNc(2,Lc,2,0,"p",61),t.YNc(3,bc,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 Sc=function(i){return{"display-none":i}};function Zc(i,n){if(1&i&&t._UZ(0,"tr",62),2&i){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,Sc,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Ac(i,n){1&i&&t._UZ(0,"tr",63)}function Ec(i,n){1&i&&t._UZ(0,"tr",64)}const wc=function(){return["all"]},Ic=function(i){return{"error-border":i}},Fc=function(){return["no_channel"]};class Ft{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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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){this.store.dispatch((0,Z.c1)({payload:{data:{type:s.n_.CONFIRM,alertTitle:e?"Force Close Channel":"Close Channel",titleMessage: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),noBtnText:"Cancel",yesBtnText:e?"Force Close":"Close Channel"}}})),this.rtlEffects.closeConfirm.pipe((0,h.R)(this.unSubs[5])).subscribe(d=>{d&&this.store.dispatch((0,D.BL)({payload:{channelId:n.channelId||"",force:e}}))})}onChannelClick(n,e){this.store.dispatch((0,Z.qR)({payload:{data:{channel:n,channelsType:"inactive",component:K}}}))}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.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()})}}function qc(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 Nc(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))}}Ft.\u0275fac=function(n){return new(n||Ft)(t.Y36(P.mQ),t.Y36(E.yh),t.Y36(Rt.V),t.Y36(U.v),t.Y36(H.i1))},Ft.\u0275cmp=t.Xpm({type:Ft,selectors:[["rtl-ecl-channel-inactive-table"]],viewQuery:function(n,e){if(1&n&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{provide:S.ye,useValue:(0,s.pt)("Channels")}])],decls:63,vars:18,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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","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-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,e){1&n&&(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-label"),t._uU(6,"Filter By"),t.qZA(),t.TgZ(7,"mat-select",5),t.NdJ("ngModelChange",function(o){return e.selFilterBy=o})("selectionChange",function(){return e.selFilter="",e.applyFilter()}),t.TgZ(8,"perfect-scrollbar"),t.YNc(9,Hr,2,2,"mat-option",6),t.qZA()()(),t.TgZ(10,"mat-form-field",4)(11,"mat-label"),t._uU(12,"Filter"),t.qZA(),t.TgZ(13,"input",7),t.NdJ("ngModelChange",function(o){return e.selFilter=o})("input",function(){return e.applyFilter()})("keyup",function(){return e.applyFilter()}),t.qZA()()()(),t.TgZ(14,"div",8),t.YNc(15,zr,1,0,"mat-progress-bar",9),t.TgZ(16,"table",10,11),t.ynx(18,12),t.YNc(19,Vr,1,0,"th",13),t.YNc(20,Wr,3,2,"td",14),t.BQk(),t.ynx(21,15),t.YNc(22,$r,2,0,"th",16),t.YNc(23,Xr,3,3,"td",14),t.BQk(),t.ynx(24,17),t.YNc(25,jr,2,0,"th",16),t.YNc(26,tc,2,1,"td",14),t.BQk(),t.ynx(27,18),t.YNc(28,ec,2,0,"th",16),t.YNc(29,nc,4,4,"td",14),t.BQk(),t.ynx(30,19),t.YNc(31,ic,2,0,"th",16),t.YNc(32,ac,4,4,"td",14),t.BQk(),t.ynx(33,20),t.YNc(34,oc,2,0,"th",16),t.YNc(35,sc,4,4,"td",14),t.BQk(),t.ynx(36,21),t.YNc(37,lc,2,0,"th",16),t.YNc(38,rc,2,1,"td",14),t.BQk(),t.ynx(39,22),t.YNc(40,cc,2,0,"th",16),t.YNc(41,uc,2,1,"td",14),t.BQk(),t.ynx(42,23),t.YNc(43,pc,2,0,"th",24),t.YNc(44,mc,4,4,"td",14),t.BQk(),t.ynx(45,25),t.YNc(46,dc,2,0,"th",24),t.YNc(47,hc,4,4,"td",14),t.BQk(),t.ynx(48,26),t.YNc(49,_c,2,0,"th",24),t.YNc(50,gc,4,4,"td",14),t.BQk(),t.ynx(51,27),t.YNc(52,fc,2,0,"th",16),t.YNc(53,Cc,6,4,"td",14),t.BQk(),t.ynx(54,28),t.YNc(55,xc,6,0,"th",29),t.YNc(56,yc,8,0,"td",30),t.BQk(),t.ynx(57,31),t.YNc(58,vc,4,3,"td",32),t.BQk(),t.YNc(59,Zc,1,3,"tr",33),t.YNc(60,Ac,1,0,"tr",34),t.YNc(61,Ec,1,0,"tr",35),t.qZA()(),t._UZ(62,"mat-paginator",36),t.qZA()),2&n&&(t.xp6(7),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(14,wc).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter),t.xp6(2),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.channels)("ngClass",t.VKq(15,Ic,""!==e.errorMessage)),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(17,Fc)),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))},dependencies:[c.mk,c.sg,c.O5,c.PC,m.Fj,m.JJ,m.On,N.BN,p.xw,p.Wh,p.yH,v.oO,v.Zl,Q.Nt,f.KE,f.hX,f.bx,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,V.gM,S.NW,O.Vv,O.$V,c.JJ,c.rS],styles:[".mat-column-announceChannel[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-balancedness[_ngcontent-%COMP%]{padding-left:3rem;min-width:15rem;max-width:30rem}"]});const Oc=function(){return["all"]};function Pc(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-label"),t._uU(5,"Filter By"),t.qZA(),t.TgZ(6,"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.TgZ(7,"perfect-scrollbar"),t.YNc(8,Nc,2,2,"mat-option",11),t.qZA()()(),t.TgZ(9,"mat-form-field",9)(10,"mat-label"),t._uU(11,"Filter"),t.qZA(),t.TgZ(12,"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(6),t.Q6J("ngModel",e.selFilterBy),t.xp6(2),t.Q6J("ngForOf",t.DdM(3,Oc).concat(e.displayedColumns.slice(0,-1))),t.xp6(4),t.Q6J("ngModel",e.selFilter)}}function Uc(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 kc(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 Jc(i,n){if(1&i&&(t.TgZ(0,"td",44),t.YNc(1,kc,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 Mc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Date/Time"),t.qZA())}function Qc(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 Yc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"In Channel ID"),t.qZA())}const qt=function(i){return{width:i}};function Bc(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,qt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelId)}}function Hc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"In Channel Short ID"),t.qZA())}function zc(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 Vc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"In Channel"),t.qZA())}function Gc(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,qt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.fromChannelAlias)}}function Kc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel ID"),t.qZA())}function Wc(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,qt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelId)}}function $c(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel Short ID"),t.qZA())}function Xc(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 jc(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Out Channel"),t.qZA())}function tu(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,qt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.toChannelAlias)}}function eu(i,n){1&i&&(t.TgZ(0,"th",47),t._uU(1,"Payment Hash"),t.qZA())}function nu(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,qt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.paymentHash)}}function iu(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Amount In (Sats)"),t.qZA())}function au(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 ou(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Amount Out (Sats)"),t.qZA())}function su(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 lu(i,n){1&i&&(t.TgZ(0,"th",50),t._uU(1,"Fee Earned (Sats)"),t.qZA())}function ru(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 cu(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 uu(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"td",56)(1,"button",57),t.NdJ("click",function(o){const d=t.CHM(e).$implicit,y=t.oxw(2);return t.KtG(y.onForwardingEventClick(d,o))}),t._uU(2,"View Info"),t.qZA()()}}function pu(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No forwarding history available."),t.qZA())}function mu(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting forwarding history..."),t.qZA())}function du(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 hu(i,n){if(1&i&&(t.TgZ(0,"td",58),t.YNc(1,pu,2,0,"p",59),t.YNc(2,mu,2,0,"p",59),t.YNc(3,du,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 _u=function(i){return{"display-none":i}};function gu(i,n){if(1&i&&t._UZ(0,"tr",60),2&i){const e=t.oxw(2);t.Q6J("ngClass",t.VKq(1,_u,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function fu(i,n){1&i&&t._UZ(0,"tr",61)}function Cu(i,n){1&i&&t._UZ(0,"tr",62)}const xu=function(){return["no_event"]};function yu(i,n){if(1&i&&(t.TgZ(0,"div",14),t.YNc(1,Uc,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,Jc,2,1,"td",20),t.BQk(),t.ynx(7,21),t.YNc(8,Mc,2,0,"th",22),t.YNc(9,Qc,3,4,"td",20),t.BQk(),t.ynx(10,23),t.YNc(11,Yc,2,0,"th",22),t.YNc(12,Bc,4,4,"td",20),t.BQk(),t.ynx(13,24),t.YNc(14,Hc,2,0,"th",22),t.YNc(15,zc,2,1,"td",20),t.BQk(),t.ynx(16,25),t.YNc(17,Vc,2,0,"th",22),t.YNc(18,Gc,4,4,"td",20),t.BQk(),t.ynx(19,26),t.YNc(20,Kc,2,0,"th",22),t.YNc(21,Wc,4,4,"td",20),t.BQk(),t.ynx(22,27),t.YNc(23,$c,2,0,"th",22),t.YNc(24,Xc,2,1,"td",20),t.BQk(),t.ynx(25,28),t.YNc(26,jc,2,0,"th",22),t.YNc(27,tu,4,4,"td",20),t.BQk(),t.ynx(28,29),t.YNc(29,eu,2,0,"th",22),t.YNc(30,nu,4,4,"td",20),t.BQk(),t.ynx(31,30),t.YNc(32,iu,2,0,"th",31),t.YNc(33,au,4,3,"td",20),t.BQk(),t.ynx(34,32),t.YNc(35,ou,2,0,"th",31),t.YNc(36,su,4,3,"td",20),t.BQk(),t.ynx(37,33),t.YNc(38,lu,2,0,"th",31),t.YNc(39,ru,4,3,"td",20),t.BQk(),t.ynx(40,34),t.YNc(41,cu,6,0,"th",35),t.YNc(42,uu,3,0,"td",36),t.BQk(),t.ynx(43,37),t.YNc(44,hu,4,3,"td",38),t.BQk(),t.YNc(45,gu,1,3,"tr",39),t.YNc(46,fu,1,0,"tr",40),t.YNc(47,Cu,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("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.forwardingHistoryEvents),t.xp6(43),t.Q6J("matFooterRowDef",t.DdM(7,xu)),t.xp6(1),t.Q6J("matHeaderRowDef",e.displayedColumns),t.xp6(1),t.Q6J("matRowDefColumns",e.displayedColumns)}}function Tu(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 at{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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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/14+"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.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.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()})}}at.\u0275fac=function(n){return new(n||at)(t.Y36(P.mQ),t.Y36(U.v),t.Y36(E.yh),t.Y36(c.uU),t.Y36(H.i1))},at.\u0275cmp=t.Xpm({type:at,selectors:[["rtl-ecl-forwarding-history"]],viewQuery:function(n,e){if(1&n&&(t.Gf(b.YE,5),t.Gf(S.NW,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sort=a.first),t.iGM(a=t.CRH())&&(e.paginator=a.first)}},inputs:{pageId:"pageId",tableId:"tableId",eventsData:"eventsData",selFilter:"selFilter"},features:[t._Bn([{provide:A.PG,useValue:{overlayPanelClass:"rtl-select-overlay"}},{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"],["fxLayout","column","fxFlex","49"],["tabindex","1","name","filterBy",3,"ngModel","ngModelChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","name","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,"matSortActive","matSortDirection","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-cell","","colspan","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-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"]],template:function(n,e){1&n&&(t.TgZ(0,"div",0),t.YNc(1,qc,2,1,"div",1),t.YNc(2,Pc,13,4,"div",2),t.YNc(3,yu,48,8,"div",3),t.YNc(4,Tu,1,3,"mat-paginator",4),t.qZA()),2&n&&(t.xp6(1),t.Q6J("ngIf",""!==e.errorMessage),t.xp6(1),t.Q6J("ngIf",""===e.errorMessage),t.xp6(1),t.Q6J("ngIf",""===e.errorMessage),t.xp6(1),t.Q6J("ngIf",""===e.errorMessage))},dependencies:[c.mk,c.sg,c.O5,c.PC,m.Fj,m.JJ,m.On,p.xw,p.Wh,p.yH,v.oO,v.Zl,w.lW,Q.Nt,f.KE,f.hX,J.pW,A.gD,A.$L,B.ey,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,V.gM,S.NW,O.Vv,O.$V,c.JJ,c.uU,H.h9],styles:[".mat-column-type[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}.mat-column-type[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{max-width:2.2rem;width:2.2rem;text-overflow:unset}"]});const Lu=["tableIn"],bu=["tableOut"],vu=["paginatorIn"],Su=["paginatorOut"];function Zu(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 Au(i,n){1&i&&t._UZ(0,"mat-progress-bar",34)}function Eu(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}const Jt=function(i){return{width:i}};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,Jt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Iu(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Fu(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,Jt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function qu(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function Nu(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 Ou(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function Pu(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 Uu(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 ku(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting incoming routing peers..."),t.qZA())}function Ju(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 Mu(i,n){if(1&i&&(t.TgZ(0,"td",41),t.YNc(1,Ru,2,0,"p",42),t.YNc(2,ku,2,0,"p",42),t.YNc(3,Ju,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 Qu(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 Yu(i,n){1&i&&t._UZ(0,"tr",44)}function Bu(i,n){1&i&&t._UZ(0,"tr",45)}function Hu(i,n){1&i&&t._UZ(0,"mat-progress-bar",34)}function zu(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Channel ID"),t.qZA())}function Vu(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,Jt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.channelId)}}function Gu(i,n){1&i&&(t.TgZ(0,"th",35),t._uU(1,"Peer Alias"),t.qZA())}function Ku(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,Jt,a.screenSize===a.screenSizeEnum.XS?"6rem":a.colWidth)),t.xp6(2),t.Oqu(null==e?null:e.alias)}}function Wu(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Events"),t.qZA())}function $u(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 Xu(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Amount (Sats)"),t.qZA())}function ju(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 tp(i,n){1&i&&(t.TgZ(0,"th",39),t._uU(1,"Fee (Sats)"),t.qZA())}function ep(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 np(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"No outgoing routing peer available."),t.qZA())}function ip(i,n){1&i&&(t.TgZ(0,"p"),t._uU(1,"Getting outgoing routing peers..."),t.qZA())}function ap(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 op(i,n){if(1&i&&(t.TgZ(0,"td",41),t.YNc(1,np,2,0,"p",42),t.YNc(2,ip,2,0,"p",42),t.YNc(3,ap,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 sp(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 lp(i,n){1&i&&t._UZ(0,"tr",44)}function rp(i,n){1&i&&t._UZ(0,"tr",45)}const cp=function(i,n){return{"mt-2":i,"mt-1":n}},up=function(){return["no_incoming_event"]},pp=function(i){return{"mt-2":i}},mp=function(){return["no_outgoing_event"]};function dp(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,Au,1,0,"mat-progress-bar",10),t.TgZ(8,"table",11,12),t.ynx(10,13),t.YNc(11,Eu,2,0,"th",14),t.YNc(12,wu,4,4,"td",15),t.BQk(),t.ynx(13,16),t.YNc(14,Iu,2,0,"th",14),t.YNc(15,Fu,4,4,"td",15),t.BQk(),t.ynx(16,17),t.YNc(17,qu,2,0,"th",18),t.YNc(18,Nu,4,3,"td",15),t.BQk(),t.ynx(19,19),t.YNc(20,Ou,2,0,"th",18),t.YNc(21,Pu,4,3,"td",15),t.BQk(),t.ynx(22,20),t.YNc(23,Uu,2,0,"th",18),t.YNc(24,Du,4,3,"td",15),t.BQk(),t.ynx(25,21),t.YNc(26,Mu,4,3,"td",22),t.BQk(),t.YNc(27,Qu,1,3,"tr",23),t.YNc(28,Yu,1,0,"tr",24),t.YNc(29,Bu,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,Hu,1,0,"mat-progress-bar",10),t.TgZ(39,"table",30,31),t.ynx(41,13),t.YNc(42,zu,2,0,"th",14),t.YNc(43,Vu,4,4,"td",15),t.BQk(),t.ynx(44,16),t.YNc(45,Gu,2,0,"th",14),t.YNc(46,Ku,4,4,"td",15),t.BQk(),t.ynx(47,17),t.YNc(48,Wu,2,0,"th",18),t.YNc(49,$u,4,3,"td",15),t.BQk(),t.ynx(50,19),t.YNc(51,Xu,2,0,"th",18),t.YNc(52,ju,4,3,"td",15),t.BQk(),t.ynx(53,20),t.YNc(54,tp,2,0,"th",18),t.YNc(55,ep,4,3,"td",15),t.BQk(),t.ynx(56,32),t.YNc(57,op,4,3,"td",22),t.BQk(),t.YNc(58,sp,1,3,"tr",23),t.YNc(59,lp,1,0,"tr",24),t.YNc(60,rp,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(22,cp,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("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.routingPeersIncoming),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(25,up)),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(26,pp,e.screenSize!==e.screenSizeEnum.LG)),t.xp6(5),t.Q6J("ngIf",e.apiCallStatus.status===e.apiCallStatusEnum.INITIATED),t.xp6(1),t.Q6J("matSortActive",e.tableSetting.sortBy)("matSortDirection",e.tableSetting.sortOrder)("dataSource",e.routingPeersOutgoing),t.xp6(19),t.Q6J("matFooterRowDef",t.DdM(28,mp)),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 Nt{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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):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)/14+"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="";return a="all"===this.selFilterByIn?JSON.stringify(n).toLowerCase():"string"==typeof n[this.selFilterByIn]?n[this.selFilterByIn].toLowerCase():"boolean"==typeof n[this.selFilterByIn]?n[this.selFilterByIn]?"yes":"no":n[this.selFilterByIn].toString(),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.paginator=this.paginatorIn,this.logger.info(this.routingPeersIncoming),this.routingPeersOutgoing=new r.by(e[1]),this.routingPeersOutgoing.sort=this.sortOut,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),d=a.find(y=>y.channelId===o.toChannelId);l?(l.events++,l.totalAmount=+l.totalAmount+ +o.amountIn,l.totalFee=o.amountIn-o.amountOut+ +l.totalFee):e.push({channelId:o.fromChannelId,alias:o.fromChannelAlias,events:1,totalAmount:+o.amountIn,totalFee:o.amountIn-o.amountOut}),d?(d.events++,d.totalAmount=+d.totalAmount+ +o.amountOut,d.totalFee=o.amountIn-o.amountOut+ +d.totalFee):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()})}}function hp(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",8),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.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)}}Nt.\u0275fac=function(n){return new(n||Nt)(t.Y36(P.mQ),t.Y36(U.v),t.Y36(E.yh),t.Y36(H.i1))},Nt.\u0275cmp=t.Xpm({type:Nt,selectors:[["rtl-ecl-routing-peers"]],viewQuery:function(n,e){if(1&n&&(t.Gf(Lu,5,b.YE),t.Gf(bu,5,b.YE),t.Gf(vu,5),t.Gf(Su,5)),2&n){let a;t.iGM(a=t.CRH())&&(e.sortIn=a.first),t.iGM(a=t.CRH())&&(e.sortOut=a.first),t.iGM(a=t.CRH())&&(e.paginatorIn=a.first),t.iGM(a=t.CRH())&&(e.paginatorOut=a.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,"matSortActive","matSortDirection","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-cell","","colspan","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,"matSortActive","matSortDirection","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-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(n,e){1&n&&(t.TgZ(0,"div",0),t.YNc(1,Zu,2,1,"div",1),t.YNc(2,dp,63,29,"div",2),t.qZA()),2&n&&(t.xp6(1),t.Q6J("ngIf",""!==e.errorMessage),t.xp6(1),t.Q6J("ngIf",""===e.errorMessage))},dependencies:[c.mk,c.O5,c.PC,p.xw,p.Wh,p.yH,v.oO,v.Zl,J.pW,b.YE,b.nU,r.BZ,r.fO,r.as,r.w1,r.Dz,r.nj,r.mD,r.Ke,r.ge,r.ev,r.yh,r.XQ,r.Gk,r.Q2,S.NW,O.$V,c.JJ]});class Ot{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,M.h)(e=>e instanceof x.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()})}}Ot.\u0275fac=function(n){return new(n||Ot)(t.Y36(x.F0))},Ot.\u0275cmp=t.Xpm({type:Ot,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","","mat-stretch-tabs","false","mat-align-tabs","start",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(n,e){if(1&n&&(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,hp,2,3,"div",6),t.qZA(),t._UZ(9,"mat-tab-nav-panel",null,7)(11,"router-outlet"),t.qZA()()()),2&n){const a=t.MAs(10);t.xp6(1),t.Q6J("icon",e.faChartBar),t.xp6(6),t.Q6J("tabPanel",a),t.xp6(1),t.Q6J("ngForOf",e.links)}},dependencies:[c.sg,N.BN,p.xw,p.Wh,L.a8,L.dn,I.BU,I.sW,I.Nj,x.lC,x.rH]});var _e=_(7772),ge=_(2213),fe=_(7671);function _p(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 gp(i,n){1&i&&(t.TgZ(0,"div",14),t._uU(1,"No routing report for the selected period"),t.qZA())}function fp(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 Cp(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,fp,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 xp(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 Pt{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.eventFilterValue=this.reportPeriod===s.op[1]?n.name+"/"+this.startDate.getFullYear():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()})}}Pt.\u0275fac=function(n){return new(n||Pt)(t.Y36(P.mQ),t.Y36(U.v),t.Y36(E.yh))},Pt.\u0275cmp=t.Xpm({type:Pt,selectors:[["rtl-ecl-routing-report"]],hostBindings:function(n,e){1&n&&t.NdJ("mouseup",function(o){return e.onChartMouseUp(o)})},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 center",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(n,e){1&n&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(o){return e.onSelectionChange(o)}),t.qZA(),t.TgZ(2,"div",2)(3,"mat-radio-group",3),t.NdJ("ngModelChange",function(o){return e.selReportBy=o})("change",function(){return e.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,_p,4,8,"div",8),t.YNc(12,gp,2,0,"div",9),t.TgZ(13,"div",10),t.YNc(14,Cp,3,11,"ngx-charts-bar-vertical",11),t.qZA(),t.TgZ(15,"div",10),t.YNc(16,xp,1,4,"rtl-ecl-forwarding-history",12),t.qZA()()()),2&n&&(t.xp6(3),t.Q6J("ngModel",e.selReportBy),t.xp6(3),t.s9C("value",e.reportBy.FEES),t.xp6(2),t.s9C("value",e.reportBy.EVENTS),t.xp6(3),t.Q6J("ngIf",e.routingReportData.length>0&&e.filteredEventsBySelectedPeriod.length>0),t.xp6(1),t.Q6J("ngIf",e.routingReportData.length<=0||e.filteredEventsBySelectedPeriod.length<=0),t.xp6(2),t.Q6J("ngIf",e.routingReportData.length>0&&e.filteredEventsBySelectedPeriod.length>0),t.xp6(2),t.Q6J("ngIf",e.filteredEventsBySelectedPeriod.length>0))},dependencies:[c.O5,m.JJ,m.On,p.xw,p.Wh,p.yH,kt.VQ,kt.U0,ge.K$,fe.D,at,c.JJ],data:{animation:[_e.J]}});var yp=_(165);function Tp(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 Lp(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 bp(i,n){if(1&i&&(t.TgZ(0,"div",8),t.YNc(1,Tp,4,7,"div",9),t.YNc(2,Lp,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 vp(i,n){1&i&&(t.TgZ(0,"div",11),t._uU(1,"No transactions report for the selected period"),t.qZA())}function Sp(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 Zp(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,Sp,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 Ap(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 Ut{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.displayedColumns=this.screenSize===s.cu.XS||this.screenSize===s.cu.SM?JSON.parse(JSON.stringify(this.tableSetting.columnSelectionSM)):JSON.parse(JSON.stringify(this.tableSetting.columnSelection)),this.displayedColumns.push("actions"),this.colWidth=this.displayedColumns.length?this.commonService.getContainerSize().width/this.displayedColumns.length/14+"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.transactionFilterValue=this.reportPeriod===s.op[1]?n.series.toString()+"/"+this.startDate.getFullYear():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 d=this.payments?.filter(C=>C.firstPartTimestamp&&Math.floor(C.firstPartTimestamp/1e3)>=a&&Math.floor(C.firstPartTimestamp/1e3)<o),y=this.invoices?.filter(C=>"received"===C.status&&C.timestamp&&C.timestamp>=a&&C.timestamp<o);if(this.transactionsReportSummary.paymentsSelectedPeriod=d.length,this.transactionsReportSummary.invoicesSelectedPeriod=y.length,this.reportPeriod===s.op[1]){for(let C=0;C<12;C++)l.push({name:s.gg[C].name,date:new Date(n.getFullYear(),C,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});d?.map(C=>{const q=new Date(C.firstPartTimestamp||0).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(C.recipientAmount||0),l[q].series[0].value=l[q].series[0].value+C.recipientAmount,l[q].series[0].extra.total=l[q].series[0].extra.total+1,this.transactionsReportSummary}),y?.map(C=>{const q=new Date(1e3*(C.timestamp||0)).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(C.amountSettled||0),l[q].series[1].value=l[q].series[1].value+C.amountSettled,l[q].series[1].extra.total=l[q].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let C=0;C<this.getMonthDays(n.getMonth(),n.getFullYear());C++)l.push({name:(C+1).toString(),date:new Date(1e3*(C*this.secondsInADay+a)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});d?.map(C=>{const q=Math.floor((Math.floor((C.firstPartTimestamp||0)/1e3)-a)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+(C.recipientAmount||0),l[q].series[0].value=l[q].series[0].value+C.recipientAmount,l[q].series[0].extra.total=l[q].series[0].extra.total+1,this.transactionsReportSummary}),y?.map(C=>{const q=Math.floor(((C.timestamp||0)-a)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+(C.amountSettled||0),l[q].series[1].value=l[q].series[1].value+C.amountSettled,l[q].series[1].extra.total=l[q].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()})}}Ut.\u0275fac=function(n){return new(n||Ut)(t.Y36(P.mQ),t.Y36(U.v),t.Y36(E.yh))},Ut.\u0275cmp=t.Xpm({type:Ut,selectors:[["rtl-ecl-transactions-report"]],hostBindings:function(n,e){1&n&&t.NdJ("mouseup",function(o){return e.onChartMouseUp(o)})},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(n,e){1&n&&(t.TgZ(0,"div",0)(1,"rtl-horizontal-scroller",1),t.NdJ("stepChanged",function(o){return e.onSelectionChange(o)}),t.qZA(),t.TgZ(2,"div",2),t.YNc(3,bp,3,3,"div",3),t.YNc(4,vp,2,0,"div",4),t.TgZ(5,"div",5),t.YNc(6,Zp,3,13,"ngx-charts-bar-vertical-2d",6),t.qZA(),t.TgZ(7,"div",5),t.YNc(8,Ap,1,5,"rtl-transactions-report-table",7),t.qZA()()()),2&n&&(t.xp6(3),t.Q6J("ngIf",e.transactionsNonZeroReportData.length>0),t.xp6(1),t.Q6J("ngIf",e.transactionsNonZeroReportData.length<=0),t.xp6(2),t.Q6J("ngIf",e.transactionsNonZeroReportData.length>0),t.xp6(2),t.Q6J("ngIf",e.transactionsNonZeroReportData.length>0))},dependencies:[c.O5,p.xw,p.Wh,p.yH,ge.H5,fe.D,yp.g,c.JJ],data:{animation:[_e.J]}});var F=_(1643),Ep=_(9442);function wp(i,n){if(1&i){const e=t.EpF();t.TgZ(0,"div",9),t.NdJ("click",function(){const l=t.CHM(e).$implicit,d=t.oxw();return t.KtG(d.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 Dt{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,M.h)(e=>e instanceof x.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()})}}Dt.\u0275fac=function(n){return new(n||Dt)(t.Y36(x.F0))},Dt.\u0275cmp=t.Xpm({type:Dt,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","","mat-stretch-tabs","false","mat-align-tabs","start",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(n,e){if(1&n&&(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,wp,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&n){const a=t.MAs(10);t.xp6(1),t.Q6J("icon",e.faSearch),t.xp6(6),t.Q6J("tabPanel",a),t.xp6(1),t.Q6J("ngForOf",e.links)}},dependencies:[c.sg,N.BN,p.xw,p.Wh,p.yH,L.a8,L.dn,I.BU,I.sW,I.Nj,x.lC,x.rH]});const Fp=x.Bz.forChild([{path:"",component:W,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:_t,canActivate:[F.fY]},{path:"onchain",component:ft,canActivate:[F.fY],children:[{path:"",pathMatch:"full",redirectTo:"receive"},{path:"receive",component:bt,canActivate:[F.fY]},{path:"send",component:vt,canActivate:[F.fY]}]},{path:"connections",component:Ct,canActivate:[F.fY],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:St,canActivate:[F.fY],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Zt,canActivate:[F.fY]},{path:"pending",component:At,canActivate:[F.fY]},{path:"inactive",component:Ft,canActivate:[F.fY]}]},{path:"peers",component:wt,data:{sweepAll:!1},canActivate:[F.fY]}]},{path:"transactions",component:xt,canActivate:[F.fY],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:j,canActivate:[F.fY]},{path:"invoices",component:et,canActivate:[F.fY]}]},{path:"routing",component:yt,canActivate:[F.fY],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:at,canActivate:[F.fY]},{path:"peers",component:Nt,canActivate:[F.fY]}]},{path:"reports",component:Ot,canActivate:[F.fY],children:[{path:"",pathMatch:"full",redirectTo:"routingreport"},{path:"routingreport",component:Pt,canActivate:[F.fY]},{path:"transactions",component:Ut,canActivate:[F.fY]}]},{path:"graph",component:Dt,canActivate:[F.fY],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:Lt,canActivate:[F.fY]},{path:"queryroutes",component:It,canActivate:[F.fY]}]},{path:"**",component:Ep.w}]}]);var qp=_(9470);class ot{}ot.\u0275fac=function(n){return new(n||ot)},ot.\u0275mod=t.oAB({type:ot,bootstrap:[W]}),ot.\u0275inj=t.cJS({providers:[F.fY],imports:[c.ez,qp.m,Fp]})}}]);