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/37.d8c372593cfce7d0.js

1 line
508 KiB
JavaScript

"use strict";(self.webpackChunkRTLApp=self.webpackChunkRTLApp||[]).push([[37],{9037:(kg,be,h)=>{h.r(be),h.d(be,{LNDModule:()=>Lg});var m=h(9808),T=h(9291),je=h(8878),e=h(5e3),_=h(7093),M=h(5899);function Ke(n,i){1&n&&e._UZ(0,"mat-progress-bar",3)}let Ae=(()=>{class n{constructor(t){this.router=t,this.loading=!1,this.router.events.subscribe(a=>{switch(!0){case a instanceof T.OD:this.loading=!0;break;case a instanceof T.m2:case a instanceof T.gk:case a instanceof T.Q3:this.loading=!1}})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-lnd-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(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,Ke,1,0,"mat-progress-bar",1),e._UZ(2,"router-outlet",null,2),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf",a.loading))},directives:[_.xw,_.yH,_.Wh,m.O5,T.lC,M.pW],styles:[""],data:{animation:[je.g]}}),n})();var p=h(7579),d=h(2722),Q=h(9300),ve=h(534),y=h(801),l=h(7731),C=h(6529),F=h(5043),w=h(5620),z=h(6642),P=h(62),I=h(9444),le=h(3954),A=h(9224),_e=h(2181),S=h(3322),L=h(7423),j=h(5245);const we=function(n){return{backgroundColor:n}};function et(n,i){if(1&n&&e._UZ(0,"span",6),2&n){const t=e.oxw();e.Q6J("ngStyle",e.VKq(1,we,null==t.information?null:t.information.color))}}function tt(n,i){if(1&n&&(e.TgZ(0,"div"),e.TgZ(1,"h4",1),e._uU(2,"Color"),e.qZA(),e.TgZ(3,"div",2),e._UZ(4,"span",7),e._uU(5),e.ALo(6,"uppercase"),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(4),e.Q6J("ngStyle",e.VKq(4,we,null==t.information?null:t.information.color)),e.xp6(1),e.hij(" ",e.lcZ(6,2,null==t.information?null:t.information.color)," ")}}function nt(n,i){if(1&n&&(e.TgZ(0,"span",2),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t)}}let qe=(()=>{class n{constructor(t){this.commonService=t,this.chains=[""]}ngOnChanges(){this.information&&this.information.chains&&this.information.chains.length>0&&(this.chains=[""],this.information.chains.forEach(t=>{this.chains.push(this.commonService.titleCase(t.chain)+" "+this.commonService.titleCase(t.network))}))}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[e.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(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div"),e.TgZ(2,"h4",1),e._uU(3,"Alias"),e.qZA(),e.TgZ(4,"div",2),e._uU(5),e.YNc(6,et,1,3,"span",3),e.qZA(),e.qZA(),e.YNc(7,tt,7,6,"div",4),e.TgZ(8,"div"),e.TgZ(9,"h4",1),e._uU(10,"Implementation"),e.qZA(),e.TgZ(11,"div",2),e._uU(12),e.qZA(),e.qZA(),e.TgZ(13,"div"),e.TgZ(14,"h4",1),e._uU(15,"Chain"),e.qZA(),e.YNc(16,nt,2,1,"span",5),e.qZA(),e.qZA()),2&t&&(e.xp6(5),e.hij(" ",null==a.information?null:a.information.alias," "),e.xp6(1),e.Q6J("ngIf",!a.showColorFieldSeparately),e.xp6(1),e.Q6J("ngIf",a.showColorFieldSeparately),e.xp6(5),e.Oqu(null!=a.information&&a.information.lnImplementation||null!=a.information&&a.information.version?(null==a.information?null:a.information.lnImplementation)+" "+(null==a.information?null:a.information.version):""),e.xp6(4),e.Q6J("ngForOf",a.chains))},directives:[_.xw,_.yH,_.Wh,m.O5,m.sg,m.PC,S.Zl],pipes:[m.gd],styles:[""]}),n})();function at(n,i){if(1&n&&(e.TgZ(0,"div",2),e.TgZ(1,"div"),e.TgZ(2,"h4",3),e._uU(3,"Lightning"),e.qZA(),e.TgZ(4,"div",4),e._uU(5),e.ALo(6,"number"),e.qZA(),e._UZ(7,"mat-progress-bar",5),e.qZA(),e.TgZ(8,"div"),e.TgZ(9,"h4",3),e._uU(10,"On-chain"),e.qZA(),e.TgZ(11,"div",4),e._uU(12),e.ALo(13,"number"),e.qZA(),e._UZ(14,"mat-progress-bar",5),e.qZA(),e.TgZ(15,"div"),e.TgZ(16,"h4",3),e._uU(17,"Total"),e.qZA(),e.TgZ(18,"div",4),e._uU(19),e.ALo(20,"number"),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(5),e.hij("",e.lcZ(6,5,null==t.balances?null:t.balances.lightning)," Sats"),e.xp6(2),e.s9C("value",(null==t.balances?null:t.balances.lightning)/(null==t.balances?null:t.balances.total)*100),e.xp6(5),e.hij("",e.lcZ(13,7,null==t.balances?null:t.balances.onchain)," Sats"),e.xp6(2),e.s9C("value",(null==t.balances?null:t.balances.onchain)/(null==t.balances?null:t.balances.total)*100),e.xp6(5),e.hij("",e.lcZ(20,9,null==t.balances?null:t.balances.total)," Sats")}}function it(n,i){if(1&n&&(e.TgZ(0,"div",6),e.TgZ(1,"p"),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.errorMessage)}}let ot=(()=>{class n{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-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(t,a){if(1&t&&(e.YNc(0,at,21,11,"div",0),e.YNc(1,it,3,1,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf"," "===a.errorMessage)("ngIfElse",o)}},directives:[m.O5,_.xw,_.yH,_.Wh,M.pW],pipes:[m.JJ],styles:[""]}),n})();var f=h(7322),W=h(7238),X=h(4834),Y=h(644);const st=function(){return["../connections/channels/open"]},lt=function(n){return{filter:n}};function rt(n,i){if(1&n&&(e.TgZ(0,"div",19),e.TgZ(1,"a",20),e._uU(2),e.ALo(3,"slice"),e.qZA(),e.TgZ(4,"div",6),e.TgZ(5,"mat-hint",21),e.TgZ(6,"strong",8),e._uU(7,"Local:"),e.qZA(),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"mat-hint",22),e._UZ(11,"fa-icon",23),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"mat-hint",24),e.TgZ(15,"strong",8),e._uU(16,"Remote:"),e.qZA(),e._uU(17),e.ALo(18,"number"),e.qZA(),e.qZA(),e._UZ(19,"mat-progress-bar",25),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(3);e.xp6(1),e.s9C("matTooltip",t.remote_alias||t.remote_pubkey),e.s9C("matTooltipDisabled",(t.remote_alias||t.remote_pubkey).length<26),e.Q6J("routerLink",e.DdM(21,st))("state",e.VKq(22,lt,t.chan_id)),e.xp6(1),e.AsE(" ",e.Dn7(3,11,t.remote_alias||t.remote_pubkey,0,24),"",(t.remote_alias||t.remote_pubkey).length>25?"...":""," "),e.xp6(6),e.hij("",e.lcZ(9,15,t.local_balance||0)," Sats"),e.xp6(3),e.Q6J("icon",a.faBalanceScale),e.xp6(1),e.hij(" (",e.lcZ(13,17,t.balancedness||0),") "),e.xp6(5),e.hij("",e.lcZ(18,19,t.remote_balance||0)," Sats"),e.xp6(2),e.s9C("value",t.local_balance&&t.local_balance>0?+t.local_balance/(+t.local_balance+ +t.remote_balance)*100:0)}}function ct(n,i){if(1&n&&(e.TgZ(0,"div",17),e.YNc(1,rt,20,24,"div",18),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.allChannels)}}function ut(n,i){if(1&n&&(e.TgZ(0,"div",3),e.TgZ(1,"div",4),e.TgZ(2,"span",5),e._uU(3,"Total Capacity"),e.qZA(),e.TgZ(4,"div",6),e.TgZ(5,"mat-hint",7),e.TgZ(6,"strong",8),e._uU(7,"Local:"),e.qZA(),e._uU(8),e.ALo(9,"number"),e.qZA(),e.TgZ(10,"mat-hint",9),e._UZ(11,"fa-icon",10),e._uU(12),e.ALo(13,"number"),e.qZA(),e.TgZ(14,"mat-hint",11),e.TgZ(15,"strong",8),e._uU(16,"Remote:"),e.qZA(),e._uU(17),e.ALo(18,"number"),e.qZA(),e.qZA(),e._UZ(19,"mat-progress-bar",12),e.qZA(),e.TgZ(20,"div",13),e._UZ(21,"mat-divider",14),e.qZA(),e.TgZ(22,"div",15),e.YNc(23,ct,2,1,"div",16),e.qZA(),e.qZA()),2&n){const t=e.oxw(),a=e.MAs(2);e.xp6(8),e.hij("",e.lcZ(9,7,(null==t.channelBalances?null:t.channelBalances.localBalance)||0)," Sats"),e.xp6(3),e.Q6J("icon",t.faBalanceScale),e.xp6(1),e.hij(" (",e.lcZ(13,9,(null==t.channelBalances?null:t.channelBalances.balancedness)||0),") "),e.xp6(5),e.hij("",e.lcZ(18,11,(null==t.channelBalances?null:t.channelBalances.remoteBalance)||0)," Sats"),e.xp6(2),e.s9C("value",null!=t.channelBalances&&t.channelBalances.localBalance&&(null==t.channelBalances?null:t.channelBalances.localBalance)>0?+(null==t.channelBalances?null:t.channelBalances.localBalance)/(+(null==t.channelBalances?null:t.channelBalances.localBalance)+ +(null==t.channelBalances?null:t.channelBalances.remoteBalance))*100:0),e.xp6(4),e.Q6J("ngIf",t.allChannels&&t.allChannels.length>0)("ngIfElse",a)}}function pt(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",26),e._uU(1," No channels available. "),e.TgZ(2,"button",27),e.NdJ("click",function(){return e.CHM(t),e.oxw().goToChannels()}),e._uU(3,"Open Channel"),e.qZA(),e.qZA()}}function mt(n,i){if(1&n&&(e.TgZ(0,"div",28),e.TgZ(1,"p"),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.errorMessage)}}let _t=(()=>{class n{constructor(t){this.router=t,this.faBalanceScale=y.DL8,this.faDumbbell=y.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/lnd/connections")}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-capacity-info"]],inputs:{channelBalances:"channelBalances",allChannels:"allChannels",sortBy:"sortBy",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","space-between stretch","fxFlex","100"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],["fxLayout","row","fxLayoutAlign","space-between start",1,"w-100"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90"],[1,"font-weight-900","mr-5px"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90"],["matTooltip","Balance Score",1,"mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90"],["mode","determinate","color","accent",1,"dashboard-progress-bar","this-channel-bar",3,"value"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[1,"channels-capacity-scroll",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",4,"ngIf","ngIfElse"],["fxLayout","column","fxFlex","100"],["class","mt-2",4,"ngFor","ngForOf"],[1,"mt-2"],[1,"dashboard-capacity-header",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90","color-primary"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90","color-primary"],["matTooltip","Balance Score",1,"color-primary","mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90","color-primary"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1","w-100"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(t,a){if(1&t&&(e.YNc(0,ut,24,13,"div",0),e.YNc(1,pt,4,0,"ng-template",null,1,e.W1O),e.YNc(3,mt,3,1,"ng-template",null,2,e.W1O)),2&t){const o=e.MAs(4);e.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},directives:[m.O5,_.xw,_.Wh,_.yH,f.bx,I.BN,W.gM,M.pW,X.d,Y.$V,m.sg,T.yS,L.lW],pipes:[m.JJ,m.OU],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),n})();function dt(n,i){if(1&n&&(e.TgZ(0,"div",2),e.TgZ(1,"div",3),e.TgZ(2,"div"),e.TgZ(3,"h4",4),e._uU(4,"Daily"),e.qZA(),e.TgZ(5,"div",5),e._uU(6),e.ALo(7,"number"),e.qZA(),e.qZA(),e.TgZ(8,"div"),e.TgZ(9,"h4",4),e._uU(10,"Weekly"),e.qZA(),e.TgZ(11,"div",5),e._uU(12),e.ALo(13,"number"),e.qZA(),e.qZA(),e.TgZ(14,"div"),e.TgZ(15,"h4",4),e._uU(16,"Monthly"),e.qZA(),e.TgZ(17,"div",5),e._uU(18),e.ALo(19,"number"),e.qZA(),e.qZA(),e.TgZ(20,"div",6),e._UZ(21,"h4",7),e._UZ(22,"span",5),e.qZA(),e.qZA(),e.TgZ(23,"div",3),e.TgZ(24,"div"),e.TgZ(25,"h4",4),e._uU(26,"Transactions"),e.qZA(),e.TgZ(27,"div",5),e._uU(28),e.ALo(29,"number"),e.qZA(),e.qZA(),e.TgZ(30,"div"),e.TgZ(31,"h4",4),e._uU(32,"Transactions"),e.qZA(),e.TgZ(33,"div",5),e._uU(34),e.ALo(35,"number"),e.qZA(),e.qZA(),e.TgZ(36,"div"),e.TgZ(37,"h4",4),e._uU(38,"Transactions"),e.qZA(),e.TgZ(39,"div",5),e._uU(40),e.ALo(41,"number"),e.qZA(),e.qZA(),e.TgZ(42,"div",6),e._UZ(43,"h4",7),e._UZ(44,"span",5),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(6),e.hij("",e.lcZ(7,6,null==t.fees?null:t.fees.day_fee_sum)," Sats"),e.xp6(6),e.hij("",e.lcZ(13,8,null==t.fees?null:t.fees.week_fee_sum)," Sats"),e.xp6(6),e.hij("",e.lcZ(19,10,null==t.fees?null:t.fees.month_fee_sum)," Sats"),e.xp6(10),e.Oqu(e.lcZ(29,12,null==t.fees?null:t.fees.daily_tx_count)),e.xp6(6),e.Oqu(e.lcZ(35,14,null==t.fees?null:t.fees.weekly_tx_count)),e.xp6(6),e.Oqu(e.lcZ(41,16,null==t.fees?null:t.fees.monthly_tx_count))}}function ht(n,i){if(1&n&&(e.TgZ(0,"div",8),e.TgZ(1,"p"),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.errorMessage)}}let Se=(()=>{class n{constructor(){this.totalFees=[{name:"Monthly",value:0},{name:"Weekly",value:0},{name:"Daily",value:0}],this.maxFeeValue=100}ngOnChanges(){if(this.fees.month_fee_sum){this.totalFees=[{name:"Monthly",value:this.fees.month_fee_sum},{name:"Weekly",value:this.fees.week_fee_sum},{name:"Daily ",value:this.fees.day_fee_sum}];const t=Math.ceil(Math.log(this.fees.month_fee_sum+1)/Math.LN10),a=Math.pow(10,t-1);this.maxFeeValue=Math.ceil(this.fees.month_fee_sum/a)*a/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)}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},features:[e.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"],["fxFlex","20"],[1,"dashboard-info-title"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(t,a){if(1&t&&(e.YNc(0,dt,45,18,"div",0),e.YNc(1,ht,3,1,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},directives:[m.O5,_.xw,_.yH,_.Wh],pipes:[m.JJ],styles:[""]}),n})();function gt(n,i){if(1&n&&(e.TgZ(0,"div",2),e.TgZ(1,"div",3),e.TgZ(2,"div"),e.TgZ(3,"h4",4),e._uU(4,"Active"),e.qZA(),e.TgZ(5,"div",5),e._UZ(6,"span",6),e._uU(7),e.ALo(8,"number"),e.qZA(),e.qZA(),e.TgZ(9,"div"),e.TgZ(10,"h4",4),e._uU(11,"Pending"),e.qZA(),e.TgZ(12,"div",5),e._UZ(13,"span",7),e._uU(14),e.ALo(15,"number"),e.qZA(),e.qZA(),e.TgZ(16,"div"),e.TgZ(17,"h4",4),e._uU(18,"Inactive"),e.qZA(),e.TgZ(19,"div",5),e._UZ(20,"span",8),e._uU(21),e.ALo(22,"number"),e.qZA(),e.qZA(),e.TgZ(23,"div"),e.TgZ(24,"h4",4),e._uU(25,"Closing"),e.qZA(),e.TgZ(26,"div",5),e._UZ(27,"span",9),e._uU(28),e.ALo(29,"number"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(30,"div",3),e.TgZ(31,"div"),e.TgZ(32,"h4",4),e._uU(33,"Capacity"),e.qZA(),e.TgZ(34,"div",5),e._uU(35),e.ALo(36,"number"),e.qZA(),e.qZA(),e.TgZ(37,"div"),e.TgZ(38,"h4",4),e._uU(39,"Capacity"),e.qZA(),e.TgZ(40,"div",5),e._uU(41),e.ALo(42,"number"),e.qZA(),e.qZA(),e.TgZ(43,"div"),e.TgZ(44,"h4",4),e._uU(45,"Capacity"),e.qZA(),e.TgZ(46,"div",5),e._uU(47),e.ALo(48,"number"),e.qZA(),e.qZA(),e.TgZ(49,"div"),e.TgZ(50,"h4",4),e._uU(51,"Capacity"),e.qZA(),e.TgZ(52,"div",5),e._uU(53),e.ALo(54,"number"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(7),e.Oqu(e.lcZ(8,8,(null==t.channelsStatus||null==t.channelsStatus.active?null:t.channelsStatus.active.num_channels)||0)),e.xp6(7),e.Oqu(e.lcZ(15,10,(null==t.channelsStatus||null==t.channelsStatus.pending?null:t.channelsStatus.pending.num_channels)||0)),e.xp6(7),e.Oqu(e.lcZ(22,12,(null==t.channelsStatus||null==t.channelsStatus.inactive?null:t.channelsStatus.inactive.num_channels)||0)),e.xp6(7),e.Oqu(e.lcZ(29,14,(null==t.channelsStatus||null==t.channelsStatus.closing?null:t.channelsStatus.closing.num_channels)||0)),e.xp6(7),e.hij("",e.lcZ(36,16,(null==t.channelsStatus||null==t.channelsStatus.active?null:t.channelsStatus.active.capacity)||0)," Sats"),e.xp6(6),e.hij("",e.lcZ(42,18,(null==t.channelsStatus||null==t.channelsStatus.pending?null:t.channelsStatus.pending.capacity)||0)," Sats"),e.xp6(6),e.hij("",e.lcZ(48,20,(null==t.channelsStatus||null==t.channelsStatus.inactive?null:t.channelsStatus.inactive.capacity)||0)," Sats"),e.xp6(6),e.hij("",e.lcZ(54,22,(null==t.channelsStatus||null==t.channelsStatus.closing?null:t.channelsStatus.closing.capacity)||0)," Sats")}}function ft(n,i){if(1&n&&(e.TgZ(0,"div",10),e.TgZ(1,"p"),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.errorMessage)}}let Le=(()=>{class n{constructor(){this.channelsStatus={}}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-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"],[1,"dot","tiny-dot","red"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(t,a){if(1&t&&(e.YNc(0,gt,55,24,"div",0),e.YNc(1,ft,3,1,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf"," "===a.errorMessage)("ngIfElse",o)}},directives:[m.O5,_.xw,_.yH,_.Wh],pipes:[m.JJ],styles:[""]}),n})();var ke=h(8213),v=h(7861),Fe=h(9107);function Ct(n,i){if(1&n&&(e.TgZ(0,"mat-hint",19),e.TgZ(1,"strong",20),e._uU(2,"Capacity: "),e.qZA(),e._uU(3),e.ALo(4,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(3),e.hij("",e.lcZ(4,1,t.remote_balance||0)," Sats")}}function xt(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2).$implicit;return e.oxw(3).onLoopOut(o)}),e._uU(1,"Loop Out"),e.qZA()}}function Tt(n,i){if(1&n&&(e.TgZ(0,"div",21),e.TgZ(1,"mat-hint",22),e.TgZ(2,"strong",20),e._uU(3,"Capacity: "),e.qZA(),e._uU(4),e.ALo(5,"number"),e.qZA(),e.YNc(6,xt,2,0,"button",23),e.qZA()),2&n){const t=e.oxw().$implicit,a=e.oxw(3);e.xp6(4),e.hij("",e.lcZ(5,2,t.local_balance||0)," Sats"),e.xp6(2),e.Q6J("ngIf",a.showLoop)}}function yt(n,i){if(1&n&&e._UZ(0,"mat-progress-bar",25),2&n){const t=e.oxw().$implicit,a=e.oxw(3);e.s9C("value",a.totalLiquidity>0?(+t.remote_balance||0)/a.totalLiquidity*100:0)}}function Zt(n,i){if(1&n&&e._UZ(0,"mat-progress-bar",25),2&n){const t=e.oxw().$implicit,a=e.oxw(3);e.s9C("value",a.totalLiquidity>0?(+t.local_balance||0)/a.totalLiquidity*100:0)}}const bt=function(){return["../connections/channels/open"]},At=function(n){return{filter:n}};function vt(n,i){if(1&n&&(e.TgZ(0,"div",13),e.TgZ(1,"a",14),e._uU(2),e.ALo(3,"slice"),e.qZA(),e.TgZ(4,"div",15),e.YNc(5,Ct,5,3,"mat-hint",16),e.YNc(6,Tt,7,4,"div",17),e.qZA(),e.YNc(7,yt,1,1,"mat-progress-bar",18),e.YNc(8,Zt,1,1,"mat-progress-bar",18),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(3);e.xp6(1),e.s9C("matTooltip",t.remote_alias||t.remote_pubkey),e.s9C("matTooltipDisabled",(t.remote_alias||t.remote_pubkey).length<26),e.Q6J("routerLink",e.DdM(14,bt))("state",e.VKq(15,At,t.chan_id)),e.xp6(1),e.AsE(" ",e.Dn7(3,10,t.remote_alias||t.remote_pubkey,0,24),"",(t.remote_alias||t.remote_pubkey).length>25?"...":""," "),e.xp6(3),e.Q6J("ngIf","In"===a.direction),e.xp6(1),e.Q6J("ngIf","Out"===a.direction),e.xp6(1),e.Q6J("ngIf","In"===a.direction),e.xp6(1),e.Q6J("ngIf","Out"===a.direction)}}function wt(n,i){if(1&n&&(e.TgZ(0,"div",11),e.YNc(1,vt,9,17,"div",12),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.allChannels)}}const qt=function(n,i,t){return{"mb-4":n,"mb-2":i,"mb-1":t}};function St(n,i){if(1&n&&(e.TgZ(0,"div",3),e.TgZ(1,"div",4),e.TgZ(2,"span",5),e._uU(3,"Total Capacity"),e.qZA(),e.TgZ(4,"mat-hint",6),e._uU(5),e.ALo(6,"number"),e.qZA(),e._UZ(7,"mat-progress-bar",7),e.qZA(),e.TgZ(8,"div",8),e._UZ(9,"mat-divider",9),e.qZA(),e.YNc(10,wt,2,1,"div",10),e.qZA()),2&n){const t=e.oxw(),a=e.MAs(2);e.Q6J("ngClass",e.kEZ(6,qt,t.screenSize===t.screenSizeEnum.XS||t.screenSize===t.screenSizeEnum.SM,t.screenSize===t.screenSizeEnum.MD,t.screenSize===t.screenSizeEnum.LG||t.screenSize===t.screenSizeEnum.XL)),e.xp6(5),e.hij("",e.lcZ(6,4,t.totalLiquidity)," Sats"),e.xp6(5),e.Q6J("ngIf",t.allChannels&&t.allChannels.length>0)("ngIfElse",a)}}function Lt(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).goToChannels()}),e._uU(1,"Open Channel"),e.qZA()}}function kt(n,i){if(1&n&&(e.TgZ(0,"div",26),e._uU(1," No channels available. "),e.YNc(2,Lt,2,0,"button",27),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf","Out"===t.direction)}}function Ft(n,i){if(1&n&&(e.TgZ(0,"div",29),e.TgZ(1,"p"),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.errorMessage)}}let Nt=(()=>{class n{constructor(t,a,o,s){this.router=t,this.loopService=a,this.commonService=o,this.store=s,this.targetConf=6,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.showLoop=!(!t.swapServerUrl||""===t.swapServerUrl.trim())})}goToChannels(){this.router.navigateByUrl("/lnd/connections")}onLoopOut(t){this.loopService.getLoopOutTermsAndQuotes(this.targetConf).pipe((0,d.R)(this.unSubs[1])).subscribe(a=>{this.store.dispatch((0,v.qR)({payload:{minHeight:"56rem",data:{channel:t,minQuote:a[0],maxQuote:a[1],direction:l.$I.LOOP_OUT,component:ke.a}}}))})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.F0),e.Y36(Fe.W),e.Y36(P.v),e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-liquidity-info"]],inputs:{direction:"direction",totalLiquidity:"totalLiquidity",allChannels:"allChannels",errorMessage:"errorMessage"},decls:5,vars:2,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",3,"ngClass",4,"ngIf","ngIfElse"],["noChannelBlock",""],["errorBlock",""],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",3,"ngClass"],["fxLayout","column","fxFlex","9","fxLayoutAlign","end start"],[1,"dashboard-capacity-header","this-channel-capacity"],[1,"font-size-90"],["mode","determinate","color","accent","value","100",1,"dashboard-progress-bar","this-channel-bar"],["fxLayout","column","fxFlex","3","fxLayoutAlign","end stretch"],[1,"dashboard-divider"],[3,"perfectScrollbar",4,"ngIf","ngIfElse"],[3,"perfectScrollbar"],["fxLayout","column",4,"ngFor","ngForOf"],["fxLayout","column"],[1,"dashboard-capacity-header","mt-2",3,"routerLink","state","matTooltip","matTooltipDisabled"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start"],["class","font-size-90 color-primary",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",4,"ngIf"],["class","dashboard-progress-bar","mode","determinate",3,"value",4,"ngIf"],[1,"font-size-90","color-primary"],[1,"font-weight-900","mr-5px"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxFlex","85","fxLayoutAlign","start start",1,"font-size-90","color-primary"],["fxFlex","15","fxLayoutAlign","end start","class","button-link-dashboard","color","primary","mat-button","","aria-label","Loop Out",3,"click",4,"ngIf"],["fxFlex","15","fxLayoutAlign","end start","color","primary","mat-button","","aria-label","Loop Out",1,"button-link-dashboard",3,"click"],["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(t,a){if(1&t&&(e.YNc(0,St,11,10,"div",0),e.YNc(1,kt,3,1,"ng-template",null,1,e.W1O),e.YNc(3,Ft,3,1,"ng-template",null,2,e.W1O)),2&t){const o=e.MAs(4);e.Q6J("ngIf",""===(null==a.errorMessage?null:a.errorMessage.trim()))("ngIfElse",o)}},directives:[m.O5,_.xw,_.Wh,_.yH,m.mk,S.oO,f.bx,M.pW,X.d,Y.$V,m.sg,T.yS,W.gM,L.lW],pipes:[m.JJ,m.OU],styles:[""]}),n})();var D=h(3251),q=h(6087),Z=h(4847),r=h(2075),J=h(8966),b=h(6523),c=h(3075),R=h(7531),V=h(3390),$=h(6534),O=h(4107),re=h(2368),E=h(508);function Ot(n,i){if(1&n&&(e.TgZ(0,"mat-option",25),e._uU(1),e.ALo(2,"titlecase"),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(e.lcZ(2,2,t))}}function Ut(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.invoiceError)}}function Rt(n,i){if(1&n&&(e.TgZ(0,"div",26),e._UZ(1,"fa-icon",27),e.YNc(2,Ut,2,1,"span",28),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(1),e.Q6J("ngIf",""!==t.invoiceError)}}let It=(()=>{class n{constructor(t,a,o,s,u,g){this.dialogRef=t,this.data=a,this.store=o,this.decimalPipe=s,this.commonService=u,this.actions=g,this.faExclamationTriangle=y.eHv,this.selNode={},this.memo="",this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=l.IV,this.timeUnitEnum=l.Qk,this.timeUnits=l.LO,this.selTimeUnit=l.Qk.SECS,this.invoiceError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.pageSize=this.data.pageSize,this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t}),this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.information=t}),this.actions.pipe((0,d.R)(this.unSubs[2]),(0,Q.h)(t=>t.type===l.uR.UPDATE_API_CALL_STATUS_LND)).subscribe(t=>{t.type===l.uR.UPDATE_API_CALL_STATUS_LND&&"SaveNewInvoice"===t.payload.action&&(this.invoiceError=t.payload.message,t.payload.status===l.Bn.ERROR&&(this.invoiceError=t.payload.message),t.payload.status===l.Bn.COMPLETED&&this.dialogRef.close())})}onAddInvoice(t){this.invoiceError="";let a=this.expiry?this.expiry:3600;this.selTimeUnit!==l.Qk.SECS&&(a=this.commonService.convertTime(this.expiry,this.selTimeUnit,l.Qk.SECS)),this.store.dispatch((0,b.Rd)({payload:{uiMessage:l.m6.ADD_INVOICE,memo:this.memo,invoiceValue:this.invoiceValue,private:this.private,expiry:a,pageSize:this.pageSize,openModal:!0}}))}resetData(){this.memo="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=l.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[3])).subscribe({next:t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,l.Xz.OTHER)+" "+t.unit},error:t=>{this.invoiceValueHint="Conversion Error: "+t}}))}onTimeUnitChange(t){this.expiry&&this.selTimeUnit!==t.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,t.value)),this.selTimeUnit=t.value}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(w.yh),e.Y36(m.JJ),e.Y36(P.v),e.Y36(z.eX))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-create-invoices"]],decls:38,vars:16,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","end start"],["matInput","","autoFocus","","placeholder","Memo","tabindex","1","name","memo",3,"ngModel","ngModelChange"],["fxFlex","50","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","2","name","invoiceValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxFlex","24","fxLayoutAlign","start end"],["matInput","","placeholder","Expiry","type","number","tabindex","3","name","expiry",3,"ngModel","step","min","ngModelChange"],["tabindex","4","name","timeUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",1,"mt-1"],["tabindex","4","color","primary","name","private",3,"ngModel","ngModelChange"],["matTooltip","Include routing hints for private channels","matTooltipPosition","above",1,"info-icon"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-1"],["mat-button","","color","primary","tabindex","5","type","reset",1,"mr-1",3,"click"],["mat-button","","color","primary","tabindex","6",3,"click"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[4,"ngIf"]],template:function(t,a){if(1&t){const o=e.EpF();e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5,"Create Invoice"),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"form",7,8),e.TgZ(11,"mat-form-field",9),e.TgZ(12,"input",10),e.NdJ("ngModelChange",function(u){return a.memo=u}),e.qZA(),e.qZA(),e.TgZ(13,"mat-form-field",11),e.TgZ(14,"input",12),e.NdJ("ngModelChange",function(u){return a.invoiceValue=u})("keyup",function(){return a.onInvoiceValueChange()}),e.qZA(),e.TgZ(15,"span",13),e._uU(16," Sats "),e.qZA(),e.TgZ(17,"mat-hint"),e._uU(18),e.qZA(),e.qZA(),e.TgZ(19,"mat-form-field",14),e.TgZ(20,"input",15),e.NdJ("ngModelChange",function(u){return a.expiry=u}),e.qZA(),e.TgZ(21,"span",13),e._uU(22),e.ALo(23,"titlecase"),e.qZA(),e.qZA(),e.TgZ(24,"mat-form-field",14),e.TgZ(25,"mat-select",16),e.NdJ("selectionChange",function(u){return a.onTimeUnitChange(u)}),e.YNc(26,Ot,3,4,"mat-option",17),e.qZA(),e.qZA(),e.TgZ(27,"div",18),e.TgZ(28,"mat-slide-toggle",19),e.NdJ("ngModelChange",function(u){return a.private=u}),e._uU(29,"Private Routing Hints"),e.qZA(),e.TgZ(30,"mat-icon",20),e._uU(31,"info_outline"),e.qZA(),e.qZA(),e.YNc(32,Rt,3,2,"div",21),e.TgZ(33,"div",22),e.TgZ(34,"button",23),e.NdJ("click",function(){return a.resetData()}),e._uU(35,"Clear Field"),e.qZA(),e.TgZ(36,"button",24),e.NdJ("click",function(){e.CHM(o);const u=e.MAs(10);return a.onAddInvoice(u)}),e._uU(37,"Create Invoice"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()}2&t&&(e.xp6(6),e.Q6J("mat-dialog-close",!1),e.xp6(6),e.Q6J("ngModel",a.memo),e.xp6(2),e.Q6J("ngModel",a.invoiceValue)("step",100)("min",1),e.xp6(4),e.Oqu(a.invoiceValueHint),e.xp6(2),e.Q6J("ngModel",a.expiry)("step",a.selTimeUnit===a.timeUnitEnum.SECS?300:a.selTimeUnit===a.timeUnitEnum.MINS?10:a.selTimeUnit===a.timeUnitEnum.HOURS?2:1)("min",1),e.xp6(2),e.hij(" ",e.lcZ(23,14,a.selTimeUnit)," "),e.xp6(3),e.Q6J("value",a.selTimeUnit),e.xp6(1),e.Q6J("ngForOf",a.timeUnits),e.xp6(2),e.Q6J("ngModel",a.private),e.xp6(4),e.Q6J("ngIf",""!==a.invoiceError))},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,J.ZT,A.dn,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,V.h,c.JJ,c.On,c.wV,c.qQ,$.q,f.R9,f.bx,O.gD,m.sg,re.Rr,j.Hw,W.gM,m.O5,E.ey,I.BN],pipes:[m.rS],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();var Dt=h(8627);function Pt(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"form",4,5),e.TgZ(2,"mat-form-field",6),e.TgZ(3,"input",7),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().memo=o}),e.qZA(),e.qZA(),e.TgZ(4,"mat-form-field",8),e.TgZ(5,"input",9),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().invoiceValue=o})("keyup",function(){return e.CHM(t),e.oxw().onInvoiceValueChange()}),e.qZA(),e.TgZ(6,"span",10),e._uU(7," Sats "),e.qZA(),e.TgZ(8,"mat-hint"),e._uU(9),e.qZA(),e.qZA(),e.TgZ(10,"div",11),e.TgZ(11,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw().resetData()}),e._uU(12,"Clear Field"),e.qZA(),e.TgZ(13,"button",13),e.NdJ("click",function(){e.CHM(t);const o=e.MAs(1);return e.oxw().onAddInvoice(o)}),e._uU(14,"Create Invoice"),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngModel",t.memo),e.xp6(2),e.Q6J("ngModel",t.invoiceValue)("step",100)("min",1),e.xp6(4),e.Oqu(t.invoiceValueHint)}}function Mt(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",14),e.TgZ(1,"button",15),e.NdJ("click",function(){return e.CHM(t),e.oxw().openCreateInvoiceModal()}),e._uU(2,"Create Invoice"),e.qZA(),e.qZA()}}function Jt(n,i){1&n&&e._UZ(0,"mat-progress-bar",46)}function Qt(n,i){1&n&&(e.TgZ(0,"th",47),e._uU(1," Date Created "),e.qZA())}const ce=function(n){return{"mr-0":n}};function Et(n,i){if(1&n&&e._UZ(0,"span",53),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ce,t.screenSize===t.screenSizeEnum.XS))}}function Yt(n,i){if(1&n&&e._UZ(0,"span",54),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ce,t.screenSize===t.screenSizeEnum.XS))}}function Bt(n,i){if(1&n&&e._UZ(0,"span",55),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ce,t.screenSize===t.screenSizeEnum.XS))}}function Ht(n,i){if(1&n&&e._UZ(0,"span",56),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ce,t.screenSize===t.screenSizeEnum.XS))}}function Gt(n,i){if(1&n&&(e.TgZ(0,"td",48),e.YNc(1,Et,1,3,"span",49),e.YNc(2,Yt,1,3,"span",50),e.YNc(3,Bt,1,3,"span",51),e.YNc(4,Ht,1,3,"span",52),e._uU(5),e.ALo(6,"date"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Q6J("ngIf","OPEN"===(null==t?null:t.state)),e.xp6(1),e.Q6J("ngIf","SETTLED"===(null==t?null:t.state)),e.xp6(1),e.Q6J("ngIf","ACCEPTED"===(null==t?null:t.state)),e.xp6(1),e.Q6J("ngIf","CANCELED"===(null==t?null:t.state)),e.xp6(1),e.hij(" ",e.xi3(6,5,1e3*(null==t?null:t.creation_date),"dd/MMM/y HH:mm"),"")}}function zt(n,i){1&n&&(e.TgZ(0,"th",57),e._uU(1," Date Settled "),e.qZA())}function Vt(n,i){if(1&n&&(e.TgZ(0,"td",58),e._uU(1),e.ALo(2,"date"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(0!=+(null==t?null:t.settle_date)?e.xi3(2,1,1e3*+(null==t?null:t.settle_date),"dd/MMM/y HH:mm"):"-")}}function Wt(n,i){1&n&&(e.TgZ(0,"th",47),e._uU(1," Memo "),e.qZA())}const Xt=function(n){return{"max-width":n}};function $t(n,i){if(1&n&&(e.TgZ(0,"td",48),e.TgZ(1,"div",59),e.TgZ(2,"span",60),e._uU(3),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngStyle",e.VKq(2,Xt,a.screenSize===a.screenSizeEnum.XS?"10rem":"22rem")),e.xp6(2),e.Oqu(null==t?null:t.memo)}}function jt(n,i){1&n&&(e.TgZ(0,"th",61),e._uU(1," Amount (Sats) "),e.qZA())}function Kt(n,i){if(1&n&&(e.TgZ(0,"td",48),e.TgZ(1,"span",62),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.value)," ")}}function en(n,i){1&n&&(e.TgZ(0,"th",61),e._uU(1," Amount Settled (Sats) "),e.qZA())}function tn(n,i){if(1&n&&(e.TgZ(0,"td",48),e.TgZ(1,"span",62),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.amt_paid_sat)," ")}}function nn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",63),e.TgZ(1,"div",64),e.TgZ(2,"mat-select",65),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",66),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}const an=function(n){return{"pl-3":n}};function on(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",67),e.TgZ(1,"div",68),e.TgZ(2,"mat-select",69),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",66),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw(2).onInvoiceClick(s)}),e._uU(5,"View Info"),e.qZA(),e.TgZ(6,"mat-option",66),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw(2).onRefreshInvoice(s)}),e._uU(7,"Refresh"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(1,an,t.screenSize!==t.screenSizeEnum.XS))}}function sn(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No invoice available."),e.qZA())}function ln(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting invoices..."),e.qZA())}function rn(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.errorMessage)}}function cn(n,i){if(1&n&&(e.TgZ(0,"td",70),e.YNc(1,sn,2,0,"p",71),e.YNc(2,ln,2,0,"p",71),e.YNc(3,rn,2,1,"p",71),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",(!(null!=t.invoices&&t.invoices.data)||(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.invoices&&t.invoices.data)||(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.invoices&&t.invoices.data)||(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const un=function(n){return{"display-none":n}};function pn(n,i){if(1&n&&e._UZ(0,"tr",72),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(1,un,(null==t.invoices?null:t.invoices.data)&&(null==t.invoices||null==t.invoices.data?null:t.invoices.data.length)>0))}}function mn(n,i){1&n&&e._UZ(0,"tr",73)}function _n(n,i){1&n&&e._UZ(0,"tr",74)}const dn=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},hn=function(){return["no_invoice"]};function gn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",16),e.TgZ(1,"div",17),e.TgZ(2,"div",18),e._UZ(3,"fa-icon",19),e.TgZ(4,"span",20),e._uU(5,"Invoices History"),e.qZA(),e.qZA(),e.TgZ(6,"mat-form-field",21),e.TgZ(7,"input",22),e.NdJ("keyup",function(){return e.CHM(t),e.oxw().applyFilter()})("ngModelChange",function(o){return e.CHM(t),e.oxw().selFilter=o}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",23),e.YNc(9,Jt,1,0,"mat-progress-bar",24),e.TgZ(10,"table",25,26),e.ynx(12,27),e.YNc(13,Qt,2,0,"th",28),e.YNc(14,Gt,7,8,"td",29),e.BQk(),e.ynx(15,30),e.YNc(16,zt,2,0,"th",31),e.YNc(17,Vt,3,4,"td",32),e.BQk(),e.ynx(18,33),e.YNc(19,Wt,2,0,"th",28),e.YNc(20,$t,4,4,"td",29),e.BQk(),e.ynx(21,34),e.YNc(22,jt,2,0,"th",35),e.YNc(23,Kt,4,3,"td",29),e.BQk(),e.ynx(24,36),e.YNc(25,en,2,0,"th",35),e.YNc(26,tn,4,3,"td",29),e.BQk(),e.ynx(27,37),e.YNc(28,nn,6,0,"th",38),e.YNc(29,on,8,3,"td",39),e.BQk(),e.ynx(30,40),e.YNc(31,cn,4,3,"td",41),e.BQk(),e.YNc(32,pn,1,3,"tr",42),e.YNc(33,mn,1,0,"tr",43),e.YNc(34,_n,1,0,"tr",44),e.qZA(),e.TgZ(35,"mat-paginator",45),e.NdJ("page",function(o){return e.CHM(t),e.oxw().onPageChange(o)}),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("icon",t.faHistory),e.xp6(4),e.Q6J("ngModel",t.selFilter),e.xp6(2),e.Q6J("ngIf",t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",t.invoices)("ngClass",e.VKq(13,dn,""!==t.errorMessage)),e.xp6(22),e.Q6J("matFooterRowDef",e.DdM(15,hn)),e.xp6(1),e.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns),e.xp6(1),e.Q6J("length",t.totalInvoices)("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let Ne=(()=>{class n{constructor(t,a,o,s,u,g){this.logger=t,this.store=a,this.decimalPipe=o,this.commonService=s,this.datePipe=u,this.actions=g,this.calledFrom="transactions",this.faHistory=y.qO$,this.selNode={},this.newlyAddedInvoiceMemo=null,this.newlyAddedInvoiceValue=null,this.memo="",this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoicesData=[],this.information={},this.flgSticky=!1,this.selFilter="",this.private=!1,this.expiryStep=100,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.firstOffset=-1,this.lastOffset=-1,this.totalInvoices=100,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["creation_date","value","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["creation_date","settle_date","value","amt_paid_sat","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["creation_date","settle_date","memo","value","actions"]):(this.flgSticky=!0,this.displayedColumns=["creation_date","settle_date","memo","value","amt_paid_sat","actions"])}ngOnInit(){this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t}),this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.information=t}),this.store.select(C.Ef).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.totalInvoices=t.listInvoices.total_invoices,this.firstOffset=+t.listInvoices.first_index_offset,this.lastOffset=+t.listInvoices.last_index_offset,this.invoicesData=t.listInvoices.invoices||[],this.invoicesData.length>0&&this.sort&&this.paginator&&this.loadInvoicesTable(this.invoicesData),this.logger.info(t)}),this.actions.pipe((0,d.R)(this.unSubs[3]),(0,Q.h)(t=>t.type===l.uR.SET_LOOKUP_LND||t.type===l.uR.UPDATE_API_CALL_STATUS_LND)).subscribe(t=>{t.type===l.uR.SET_LOOKUP_LND&&this.invoicesData.length>0&&this.sort&&this.paginator&&t.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(t.payload))),this.loadInvoicesTable(this.invoicesData))})}ngAfterViewInit(){this.invoicesData.length>0&&this.loadInvoicesTable(this.invoicesData)}onAddInvoice(t){const a=this.expiry?this.expiry:3600;this.newlyAddedInvoiceMemo=this.memo,this.newlyAddedInvoiceValue=this.invoiceValue,this.store.dispatch((0,b.Rd)({payload:{uiMessage:l.m6.ADD_INVOICE,memo:this.memo,invoiceValue:this.invoiceValue,private:this.private,expiry:a,pageSize:this.pageSize,openModal:!0}})),this.resetData()}onInvoiceClick(t){this.store.dispatch((0,v.qR)({payload:{data:{invoice:t,newlyAdded:!1,component:Dt.v}}}))}onRefreshInvoice(t){this.store.dispatch((0,b.n7)({payload:t.r_hash}))}updateInvoicesData(t){this.invoicesData=this.invoicesData.map(a=>a.r_hash===t.r_hash?t:a)}loadInvoicesTable(t){this.invoices=new r.by(t?[...t]:[]),this.invoices.sort=this.sort,this.invoices.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.invoices.filterPredicate=(a,o)=>((a.creation_date?this.datePipe.transform(new Date(1e3*a.creation_date),"dd/MMM/YYYY HH:mm").toLowerCase():"")+(a.settle_date?this.datePipe.transform(new Date(1e3*a.settle_date),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(a).toLowerCase()).includes(o),this.applyFilter(),this.logger.info(this.invoices)}resetData(){this.memo="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint=""}applyFilter(){this.invoices.filter=this.selFilter.trim().toLowerCase()}onPageChange(t){let a=!0,o=this.lastOffset,s=t.pageSize;0===t.pageIndex?(a=!0,o=0):t.pageIndex<t.previousPageIndex?(a=!1,o=this.lastOffset):t.pageIndex>t.previousPageIndex&&t.length>(t.pageIndex+1)*t.pageSize?(a=!0,o=this.firstOffset):t.length<=(t.pageIndex+1)*t.pageSize&&(a=!1,o=0,s=t.length-t.pageIndex*t.pageSize),this.store.dispatch((0,b.WM)({payload:{num_max_invoices:t.pageSize,index_offset:o,reversed:a}}))}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[4])).subscribe({next:t=>{this.invoiceValueHint="= "+t.symbol+this.decimalPipe.transform(t.OTHER,l.Xz.OTHER)+" "+t.unit},error:t=>{this.invoiceValueHint="Conversion Error: "+t}}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}openCreateInvoiceModal(){this.store.dispatch((0,v.qR)({payload:{data:{pageSize:this.pageSize,component:It}}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(m.JJ),e.Y36(P.v),e.Y36(m.uU),e.Y36(z.eX))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-lightning-invoices"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Invoices")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayout","row wrap","fxLayoutAlign","stretch start","fxFlex","100"],["addInvoiceForm","ngForm"],["fxFlex","100","fxLayoutAlign","end start"],["matInput","","placeholder","Memo","tabindex","1","name","memo",3,"ngModel","ngModelChange"],["fxFlex","100","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","2","name","invValue",3,"ngModel","step","min","ngModelChange","keyup"],["matSuffix",""],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4",3,"click"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","5",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","30","fxLayoutAlign","start end"],["matInput","","tabindex","6","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","creation_date"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","settle_date"],["mat-header-cell","","mat-sort-header","","class","pl-4",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["matColumnDef","memo"],["matColumnDef","value"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amt_paid_sat"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass",4,"matCellDef"],["matColumnDef","no_invoice"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"length","pageSize","pageSizeOptions","showFirstLastButtons","page"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["class","dot grey","matTooltip","Open","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot green","matTooltip","Settled","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Accepted","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Cancelled","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Open","matTooltipPosition","right",1,"dot","grey",3,"ngClass"],["matTooltip","Settled","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Accepted","matTooltipPosition","right",1,"dot","yellow",3,"ngClass"],["matTooltip","Cancelled","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["mat-header-cell","","mat-sort-header","",1,"pl-4"],["mat-cell","",1,"pl-4"],[1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",3,"ngClass"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","4",1,"mr-0"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,Pt,15,5,"form",1),e.YNc(2,Mt,3,0,"div",2),e.YNc(3,gn,36,16,"div",3),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf","home"===a.calledFrom),e.xp6(1),e.Q6J("ngIf","transactions"===a.calledFrom),e.xp6(1),e.Q6J("ngIf","transactions"===a.calledFrom))},directives:[_.xw,_.yH,_.Wh,m.O5,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,c.JJ,c.On,c.wV,c.qQ,$.q,f.R9,f.bx,L.lW,I.BN,Y.$V,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,W.gM,m.PC,S.Zl,O.gD,O.$L,E.ey,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.uU,m.JJ],styles:[".mat-column-memo[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-memo[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();var G=h(5698),K=h(8104),H=h(1125),ne=h(1079);const fn=["paymentReq"];function Cn(n,i){if(1&n&&(e.TgZ(0,"mat-hint"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.paymentDecodedHint)}}function xn(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Payment request is required."),e.qZA())}function Tn(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.paymentDecodedHint)}}function yn(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Payment amount is required."),e.qZA())}function Zn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",1),e.TgZ(1,"input",29,30),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().paymentAmount=o})("change",function(o){return e.CHM(t),e.oxw().onAmountChange(o)}),e.qZA(),e.TgZ(3,"mat-hint"),e._uU(4,"It is a zero amount invoice, enter amount to be paid."),e.qZA(),e.YNc(5,yn,2,0,"mat-error",11),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.paymentAmount),e.xp6(4),e.Q6J("ngIf",!t.paymentAmount)}}function bn(n,i){if(1&n&&(e.TgZ(0,"mat-option",31),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.hij(" ",null==t?null:t.name," ")}}function An(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("",null==t.selFeeLimitType?null:t.selFeeLimitType.placeholder," is required.")}}function vn(n,i){if(1&n&&(e.TgZ(0,"mat-option",31),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu((null==t?null:t.remote_alias)||(null==t?null:t.chan_id))}}function wn(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Channel not found in the list."),e.qZA())}function qn(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.paymentError)}}function Sn(n,i){if(1&n&&(e.TgZ(0,"div",32),e._UZ(1,"fa-icon",33),e.YNc(2,qn,2,1,"span",11),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(1),e.Q6J("ngIf",""!==t.paymentError)}}let Ln=(()=>{class n{constructor(t,a,o,s,u,g,U){this.dialogRef=t,this.store=a,this.logger=o,this.commonService=s,this.decimalPipe=u,this.actions=g,this.dataService=U,this.faExclamationTriangle=y.eHv,this.selNode={},this.paymentDecoded={},this.zeroAmtInvoice=!1,this.paymentAmount=null,this.paymentRequest="",this.paymentDecodedHint="",this.showAdvanced=!1,this.activeChannels=[],this.filteredMinAmtActvChannels=[],this.selectedChannelCtrl=new c.NI,this.feeLimit=null,this.selFeeLimitType=l.Vc[0],this.feeLimitTypes=l.Vc,this.advancedTitle="Advanced Options",this.paymentError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(o=>{this.selNode=o}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[1])).subscribe(o=>{this.activeChannels=o.channels.filter(s=>s.active),this.filteredMinAmtActvChannels=this.activeChannels,this.filteredMinAmtActvChannels.length&&this.filteredMinAmtActvChannels.length>0?this.selectedChannelCtrl.enable():this.selectedChannelCtrl.disable(),this.logger.info(o)}),this.actions.pipe((0,d.R)(this.unSubs[2]),(0,Q.h)(o=>o.type===l.uR.UPDATE_API_CALL_STATUS_LND||o.type===l.uR.SEND_PAYMENT_STATUS_LND)).subscribe(o=>{o.type===l.uR.SEND_PAYMENT_STATUS_LND&&this.dialogRef.close(),o.type===l.uR.UPDATE_API_CALL_STATUS_LND&&o.payload.status===l.Bn.ERROR&&"SendPayment"===o.payload.action&&(delete this.paymentDecoded.num_satoshis,this.paymentError=o.payload.message)});let t="",a="";this.activeChannels=this.activeChannels.sort((o,s)=>(t=o.remote_alias?o.remote_alias.toLowerCase():o.chan_id?o.chan_id.toLowerCase():"",a=s.remote_alias?s.remote_alias.toLowerCase():s.chan_id?s.chan_id.toLowerCase():"",t<a?-1:t>a?1:0)),this.selectedChannelCtrl.valueChanges.pipe((0,d.R)(this.unSubs[3])).subscribe(o=>{"string"==typeof o&&(this.filteredMinAmtActvChannels=this.filterChannels())})}filterChannels(){return this.activeChannels.filter(t=>0===(t.remote_alias?t.remote_alias.toLowerCase():t.chan_id?t.chan_id.toLowerCase():"").indexOf(this.selectedChannelCtrl.value?this.selectedChannelCtrl.value.toLowerCase():"")&&t.local_balance>=+(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0))}displayFn(t){return t&&t.remote_alias?t.remote_alias:t&&t.chan_id?t.chan_id:""}onSelectedChannelChanged(){if(this.selectedChannelCtrl.value&&this.selectedChannelCtrl.value.length>0&&"string"==typeof this.selectedChannelCtrl.value){const t=this.activeChannels.filter(a=>{const o=a.remote_alias?a.remote_alias.toLowerCase():a.chan_id?a.chan_id.toLowerCase():"";return o.length===this.selectedChannelCtrl.value.length&&0===o.indexOf(this.selectedChannelCtrl.value?this.selectedChannelCtrl.value.toLowerCase():"")});t&&t.length>0?(this.selectedChannelCtrl.setValue(t[0]),this.selectedChannelCtrl.setErrors(null)):this.selectedChannelCtrl.setErrors({notfound:!0})}}onSendPayment(){if(this.selectedChannelCtrl.value&&"string"==typeof this.selectedChannelCtrl.value&&this.onSelectedChannelChanged(),!this.paymentRequest||this.zeroAmtInvoice&&(!this.paymentAmount||this.paymentAmount<=0)||"string"==typeof this.selectedChannelCtrl.value)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.onPaymentRequestEntry(this.paymentRequest)}sendPayment(){if(this.selFeeLimitType!==this.feeLimitTypes[0]&&!this.feeLimit)return!0;this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis&&""!==this.paymentDecoded.num_satoshis&&"0"!==this.paymentDecoded.num_satoshis?(this.zeroAmtInvoice=!1,this.store.dispatch((0,b.oV)({payload:{uiMessage:l.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,outgoingChannel:this.selectedChannelCtrl.value,feeLimitType:this.selFeeLimitType.id,feeLimit:this.feeLimit,fromDialog:!0}}))):(this.zeroAmtInvoice=!0,this.paymentDecoded.num_satoshis=this.paymentAmount,this.store.dispatch((0,b.oV)({payload:{uiMessage:l.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,paymentAmount:this.paymentAmount,outgoingChannel:this.selectedChannelCtrl.value,feeLimitType:this.selFeeLimitType.id,feeLimit:this.feeLimit,fromDialog:!0}})))}onAmountChange(t){delete this.paymentDecoded.num_satoshis}onPaymentRequestEntry(t){this.paymentRequest=t,this.paymentAmount=null,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,G.q)(1)).subscribe({next:a=>{this.paymentDecoded=a,this.selectedChannelCtrl.setValue(null),this.onAdvancedPanelToggle(!0,!0),this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis&&""!==this.paymentDecoded.num_satoshis&&"0"!==this.paymentDecoded.num_satoshis?(this.filteredMinAmtActvChannels=this.filterChannels(),this.filteredMinAmtActvChannels.length&&this.filteredMinAmtActvChannels.length>0?this.selectedChannelCtrl.enable():this.selectedChannelCtrl.disable(),this.zeroAmtInvoice=!1,this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.num_satoshis,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[4])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats ("+o.symbol+" "+this.decimalPipe.transform(o.OTHER?o.OTHER:0,l.Xz.OTHER)+") | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")):(this.zeroAmtInvoice=!0,this.filteredMinAmtActvChannels=this.activeChannels,this.filteredMinAmtActvChannels.length&&this.filteredMinAmtActvChannels.length>0?this.selectedChannelCtrl.enable():this.selectedChannelCtrl.disable(),this.paymentDecodedHint="Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None"))},error:a=>{this.logger.error(a),this.paymentDecodedHint="ERROR: "+a.message,this.paymentReq.control.setErrors({decodeError:!0})}}))}onAdvancedPanelToggle(t,a){if(t&&!a){const o=this.selectedChannelCtrl.value&&this.selectedChannelCtrl.value.remote_alias?this.selectedChannelCtrl.value.remote_alias:this.selectedChannelCtrl.value&&this.selectedChannelCtrl.value.chan_id?this.selectedChannelCtrl.value.chan_id:"";this.advancedTitle="Advanced Options | "+this.selFeeLimitType.name+("none"===this.selFeeLimitType.id?"":": "+this.feeLimit)+(""!==o?" | First Outgoing Channel: "+o:"")}else this.advancedTitle="Advanced Options"}resetData(){this.paymentDecoded={},this.paymentRequest="",this.selectedChannelCtrl.setValue(null),this.filteredMinAmtActvChannels=this.activeChannels,this.filteredMinAmtActvChannels.length&&this.filteredMinAmtActvChannels.length>0?this.selectedChannelCtrl.enable():this.selectedChannelCtrl.disable(),this.feeLimit=null,this.selFeeLimitType=l.Vc[0],this.advancedTitle="Advanced Options",this.zeroAmtInvoice=!1,this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint=""}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(w.yh),e.Y36(F.mQ),e.Y36(P.v),e.Y36(m.JJ),e.Y36(z.eX),e.Y36(K.D))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-lightning-send-payments"]],viewQuery:function(t,a){if(1&t&&e.Gf(fn,5),2&t){let o;e.iGM(o=e.CRH())&&(a.paymentReq=o.first)}},decls:43,vars:21,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayoutAlign","space-between stretch","fxLayout","column"],["sendPaymentForm","ngForm"],["autoFocus","","matInput","","placeholder","Payment Request","name","paymentRequest","rows","4","tabindex","1","required","",3,"ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxFlex","100",4,"ngIf"],["fxFlex","100","expanded","false",1,"flat-expansion-panel","mt-2",3,"closed","opened"],["fxFlex","100","fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxFlex","30","fxLayoutAlign","start end"],["tabindex","5","Placeholder","Fee Limits",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","26"],["matInput","","type","number","name","feeLmt","required","","tabindex","6",3,"ngModel","placeholder","step","min","disabled","ngModelChange"],["fLmt","ngModel"],["fxFlex","40","fxLayoutAlign","start end"],["type","text","placeholder","First Outgoing Channel","aria-label","First Outgoing Channel","matInput","","tabindex","7",3,"formControl","matAutocomplete"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],["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","","id","sendBtn","color","primary","tabindex","3",3,"click"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","required","",3,"ngModel","ngModelChange","change"],["paymentAmt","ngModel"],[3,"value"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(t,a){if(1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5,"Send Payment"),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"form",7,8),e.TgZ(11,"mat-form-field",1),e.TgZ(12,"textarea",9,10),e.NdJ("ngModelChange",function(s){return a.onPaymentRequestEntry(s)})("matTextareaAutosize",function(){return!0}),e.qZA(),e.YNc(14,Cn,2,1,"mat-hint",11),e.YNc(15,xn,2,0,"mat-error",11),e.YNc(16,Tn,2,1,"mat-error",11),e.qZA(),e.YNc(17,Zn,6,2,"mat-form-field",12),e.TgZ(18,"mat-expansion-panel",13),e.NdJ("closed",function(){return a.onAdvancedPanelToggle(!0,!1)})("opened",function(){return a.onAdvancedPanelToggle(!1,!1)}),e.TgZ(19,"mat-expansion-panel-header"),e.TgZ(20,"mat-panel-title"),e.TgZ(21,"span"),e._uU(22),e.qZA(),e.qZA(),e.qZA(),e.TgZ(23,"div",14),e.TgZ(24,"mat-form-field",15),e.TgZ(25,"mat-select",16),e.NdJ("valueChange",function(s){return a.selFeeLimitType=s}),e.YNc(26,bn,2,2,"mat-option",17),e.qZA(),e.qZA(),e.TgZ(27,"mat-form-field",18),e.TgZ(28,"input",19,20),e.NdJ("ngModelChange",function(s){return a.feeLimit=s}),e.qZA(),e.YNc(30,An,2,1,"mat-error",11),e.qZA(),e.TgZ(31,"mat-form-field",21),e._UZ(32,"input",22),e.TgZ(33,"mat-autocomplete",23,24),e.NdJ("optionSelected",function(){return a.onSelectedChannelChanged()}),e.YNc(35,vn,2,2,"mat-option",17),e.qZA(),e.YNc(36,wn,2,0,"mat-error",11),e.qZA(),e.qZA(),e.qZA(),e.YNc(37,Sn,3,2,"div",25),e.TgZ(38,"div",26),e.TgZ(39,"button",27),e.NdJ("click",function(){return a.resetData()}),e._uU(40,"Clear Fields"),e.qZA(),e.TgZ(41,"button",28),e.NdJ("click",function(){return a.onSendPayment()}),e._uU(42,"Send Payment"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t){const o=e.MAs(13),s=e.MAs(34);e.xp6(6),e.Q6J("mat-dialog-close",!1),e.xp6(6),e.Q6J("ngModel",a.paymentRequest),e.xp6(2),e.Q6J("ngIf",a.paymentRequest&&""!==a.paymentDecodedHint),e.xp6(1),e.Q6J("ngIf",!a.paymentRequest),e.xp6(1),e.Q6J("ngIf",null==o.errors?null:o.errors.decodeError),e.xp6(1),e.Q6J("ngIf",a.zeroAmtInvoice),e.xp6(5),e.Oqu(a.advancedTitle),e.xp6(3),e.Q6J("value",a.selFeeLimitType),e.xp6(1),e.Q6J("ngForOf",a.feeLimitTypes),e.xp6(2),e.Q6J("ngModel",a.feeLimit)("placeholder",null==a.selFeeLimitType?null:a.selFeeLimitType.placeholder)("step",1)("min",0)("disabled",a.selFeeLimitType===a.feeLimitTypes[0]),e.xp6(2),e.Q6J("ngIf",a.selFeeLimitType!==a.feeLimitTypes[0]&&!a.feeLimit),e.xp6(2),e.Q6J("formControl",a.selectedChannelCtrl)("matAutocomplete",s),e.xp6(1),e.Q6J("displayWith",a.displayFn),e.xp6(2),e.Q6J("ngForOf",a.filteredMinAmtActvChannels),e.xp6(1),e.Q6J("ngIf",null==a.selectedChannelCtrl.errors?null:a.selectedChannelCtrl.errors.notfound),e.xp6(1),e.Q6J("ngIf",""!==a.paymentError)}},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,J.ZT,A.dn,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,V.h,c.Q7,c.JJ,c.On,m.O5,H.ib,H.yz,H.yK,O.gD,m.sg,c.wV,c.qQ,$.q,ne.ZL,c.oH,ne.XC,f.bx,f.TO,E.ey,I.BN],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-payment_hash[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();var ie=h(3093),ee=h(711);const kn=["sendPaymentForm"];function Fn(n,i){if(1&n&&(e.TgZ(0,"mat-hint"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.paymentDecodedHint)}}function Nn(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Payment request is required."),e.qZA())}function On(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"form",4,5),e.TgZ(2,"mat-form-field",6),e.TgZ(3,"textarea",7,8),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().onPaymentRequestEntry(o)})("matTextareaAutosize",function(){return!0}),e.qZA(),e.YNc(5,Fn,2,1,"mat-hint",9),e.YNc(6,Nn,2,0,"mat-error",9),e.qZA(),e.TgZ(7,"div",10),e.TgZ(8,"button",11),e.NdJ("click",function(){return e.CHM(t),e.oxw().resetData()}),e._uU(9,"Clear Field"),e.qZA(),e.TgZ(10,"button",12),e.NdJ("click",function(){return e.CHM(t),e.oxw().onSendPayment()}),e._uU(11,"Send Payment"),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngModel",t.paymentRequest),e.xp6(2),e.Q6J("ngIf",t.paymentRequest&&""!==t.paymentDecodedHint),e.xp6(1),e.Q6J("ngIf",!t.paymentRequest)}}function Un(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",13),e.TgZ(1,"button",14),e.NdJ("click",function(){return e.CHM(t),e.oxw().openSendPaymentModal()}),e._uU(2,"Send Payment"),e.qZA(),e.qZA()}}function Rn(n,i){1&n&&e._UZ(0,"mat-progress-bar",52)}function In(n,i){1&n&&(e.TgZ(0,"th",53),e._uU(1,"Creation Date"),e.qZA())}const ae=function(n){return{"mr-0":n}};function Dn(n,i){if(1&n&&e._UZ(0,"span",57),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ae,t.screenSize===t.screenSizeEnum.XS))}}function Pn(n,i){if(1&n&&e._UZ(0,"span",58),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ae,t.screenSize===t.screenSizeEnum.XS))}}function Mn(n,i){if(1&n&&(e.TgZ(0,"td",54),e.YNc(1,Dn,1,3,"span",55),e.YNc(2,Pn,1,3,"span",56),e._uU(3),e.ALo(4,"date"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Q6J("ngIf","SUCCEEDED"===(null==t?null:t.status)),e.xp6(1),e.Q6J("ngIf","SUCCEEDED"!==(null==t?null:t.status)),e.xp6(1),e.hij(" ",e.xi3(4,3,1e3*(null==t?null:t.creation_date),"dd/MMM/y HH:mm")," ")}}function Jn(n,i){1&n&&(e.TgZ(0,"th",53),e._uU(1,"Payment Hash"),e.qZA())}const Oe=function(n){return{"max-width":n}};function Qn(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",59),e.TgZ(2,"span",60),e._uU(3),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngStyle",e.VKq(2,Oe,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),e.xp6(2),e.Oqu(null==t?null:t.payment_hash)}}function En(n,i){1&n&&(e.TgZ(0,"th",61),e._uU(1,"Fee (Sats)"),e.qZA())}function Yn(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",62),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,null==t?null:t.fee))}}function Bn(n,i){1&n&&(e.TgZ(0,"th",61),e._uU(1,"Value (Sats)"),e.qZA())}function Hn(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",62),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,null==t?null:t.value))}}function Gn(n,i){1&n&&(e.TgZ(0,"th",61),e._uU(1,"#Hops"),e.qZA())}function zn(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",62),e._uU(2),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu((null==t||null==t.htlcs[0]||null==t.htlcs[0].route||null==t.htlcs[0].route.hops?null:t.htlcs[0].route.hops.length)||0)}}function Vn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",63),e.TgZ(1,"div",64),e.TgZ(2,"mat-select",65),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",66),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function Wn(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",67),e.TgZ(1,"button",68),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw(2).onPaymentClick(s)}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function Xn(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No payment available."),e.qZA())}function $n(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting payments..."),e.qZA())}function jn(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.errorMessage)}}function Kn(n,i){if(1&n&&(e.TgZ(0,"td",69),e.YNc(1,Xn,2,0,"p",9),e.YNc(2,$n,2,0,"p",9),e.YNc(3,jn,2,1,"p",9),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",(!(null!=t.payments&&t.payments.data)||(null==t.payments||null==t.payments.data?null:t.payments.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.payments&&t.payments.data)||(null==t.payments||null==t.payments.data?null:t.payments.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.payments&&t.payments.data)||(null==t.payments||null==t.payments.data?null:t.payments.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}function ea(n,i){if(1&n&&e._UZ(0,"span",57),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ae,t.screenSize===t.screenSizeEnum.XS))}}function ta(n,i){if(1&n&&e._UZ(0,"span",58),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,ae,t.screenSize===t.screenSizeEnum.XS))}}function na(n,i){if(1&n&&e._UZ(0,"span",57),2&n){const t=e.oxw(5);e.Q6J("ngClass",e.VKq(1,ae,t.screenSize===t.screenSizeEnum.XS))}}function aa(n,i){if(1&n&&e._UZ(0,"span",58),2&n){const t=e.oxw(5);e.Q6J("ngClass",e.VKq(1,ae,t.screenSize===t.screenSizeEnum.XS))}}function ia(n,i){if(1&n&&(e.TgZ(0,"span",72),e.YNc(1,na,1,3,"span",55),e.YNc(2,aa,1,3,"span",56),e._uU(3),e.ALo(4,"date"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Q6J("ngIf","SUCCEEDED"===t.status),e.xp6(1),e.Q6J("ngIf","SUCCEEDED"!==t.status),e.xp6(1),e.hij(" ",e.xi3(4,3,1e3*t.attempt_time,"dd/MMM/y HH:mm")," ")}}function oa(n,i){if(1&n&&(e.ynx(0),e.YNc(1,ia,5,6,"span",71),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.htlcs)}}function sa(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",70),e.YNc(2,ea,1,3,"span",55),e.YNc(3,ta,1,3,"span",56),e._uU(4),e.qZA(),e.YNc(5,oa,2,1,"ng-container",9),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Q6J("ngIf","SUCCEEDED"===(null==t?null:t.status)),e.xp6(1),e.Q6J("ngIf","SUCCEEDED"!==(null==t?null:t.status)),e.xp6(1),e.hij(" Total Attempts: ",null==t||null==t.htlcs?null:t.htlcs.length," "),e.xp6(1),e.Q6J("ngIf",null==t?null:t.is_expanded)}}function la(n,i){if(1&n&&(e.TgZ(0,"span",70),e._uU(1),e.qZA()),2&n){const t=i.index;e.xp6(1),e.hij(" HTLC ",t+1," ")}}function ra(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,la,2,1,"span",73),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.htlcs)}}function ca(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",59),e.TgZ(2,"span",60),e._uU(3),e.qZA(),e.qZA(),e.YNc(4,ra,2,1,"span",9),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.xp6(1),e.Q6J("ngStyle",e.VKq(3,Oe,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),e.xp6(2),e.Oqu(null==t?null:t.payment_hash),e.xp6(1),e.Q6J("ngIf",null==t?null:t.is_expanded)}}function ua(n,i){if(1&n&&(e.TgZ(0,"span",74),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,null==t.route?null:t.route.total_fees,"1.0-0")," ")}}function pa(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,ua,3,4,"span",75),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.htlcs)}}function ma(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",74),e._uU(2),e.ALo(3,"number"),e.qZA(),e.YNc(4,pa,2,1,"span",9),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.xi3(3,2,null==t?null:t.fee,"1.0-0")),e.xp6(2),e.Q6J("ngIf",null==t?null:t.is_expanded)}}function _a(n,i){if(1&n&&(e.TgZ(0,"span",74),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,null==t.route?null:t.route.total_amt,"1.0-0")," ")}}function da(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,_a,3,4,"span",75),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.htlcs)}}function ha(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",74),e._uU(2),e.ALo(3,"number"),e.qZA(),e.YNc(4,da,2,1,"span",9),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.xi3(3,2,null==t?null:t.value,"1.0-0")),e.xp6(2),e.Q6J("ngIf",null==t?null:t.is_expanded)}}function ga(n,i){if(1&n&&(e.TgZ(0,"span",74),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,(null==t.route||null==t.route.hops?null:t.route.hops.length)||0,"1.0-0")," ")}}function fa(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,ga,3,4,"span",75),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.htlcs)}}function Ca(n,i){if(1&n&&(e.TgZ(0,"td",54),e.TgZ(1,"span",74),e._uU(2,"-"),e.qZA(),e.YNc(3,fa,2,1,"span",9),e.qZA()),2&n){const t=i.$implicit;e.xp6(3),e.Q6J("ngIf",null==t?null:t.is_expanded)}}function xa(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",62),e.TgZ(1,"button",79),e.NdJ("click",function(){const s=e.CHM(t).$implicit,u=e.oxw(2).$implicit;return e.oxw(2).onHTLCClick(s,u)}),e._uU(2),e.qZA(),e.qZA()}if(2&n){const t=i.index;e.xp6(2),e.hij("View ",t+1,"")}}function Ta(n,i){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,xa,3,1,"div",78),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.htlcs)}}function ya(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",76),e.TgZ(1,"span",62),e.TgZ(2,"button",77),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return s.is_expanded=!(null!=s&&s.is_expanded)}),e._uU(3),e.qZA(),e.qZA(),e.YNc(4,Ta,2,1,"div",9),e.qZA()}if(2&n){const t=i.$implicit;e.xp6(3),e.Oqu(null!=t&&t.is_expanded?"Hide":"Show"),e.xp6(1),e.Q6J("ngIf",null==t?null:t.is_expanded)}}function Za(n,i){1&n&&e._UZ(0,"tr",80)}const ba=function(n){return{"display-none":n}};function Aa(n,i){if(1&n&&e._UZ(0,"tr",81),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(1,ba,(null==t.payments?null:t.payments.data)&&(null==t.payments||null==t.payments.data?null:t.payments.data.length)>0))}}function va(n,i){1&n&&e._UZ(0,"tr",82)}function wa(n,i){1&n&&e._UZ(0,"tr",80)}const qa=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Sa=function(){return["no_payment"]};function La(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",15),e.TgZ(1,"div",16),e.TgZ(2,"div",17),e._UZ(3,"fa-icon",18),e.TgZ(4,"span",19),e._uU(5,"Payments History"),e.qZA(),e.qZA(),e.TgZ(6,"mat-form-field",20),e.TgZ(7,"input",21),e.NdJ("keyup",function(){return e.CHM(t),e.oxw().applyFilter()})("ngModelChange",function(o){return e.CHM(t),e.oxw().selFilter=o}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",22),e.TgZ(9,"div",23),e.YNc(10,Rn,1,0,"mat-progress-bar",24),e.TgZ(11,"table",25,26),e.ynx(13,27),e.YNc(14,In,2,0,"th",28),e.YNc(15,Mn,5,6,"td",29),e.BQk(),e.ynx(16,30),e.YNc(17,Jn,2,0,"th",28),e.YNc(18,Qn,4,4,"td",29),e.BQk(),e.ynx(19,31),e.YNc(20,En,2,0,"th",32),e.YNc(21,Yn,4,3,"td",29),e.BQk(),e.ynx(22,33),e.YNc(23,Bn,2,0,"th",32),e.YNc(24,Hn,4,3,"td",29),e.BQk(),e.ynx(25,34),e.YNc(26,Gn,2,0,"th",32),e.YNc(27,zn,3,1,"td",29),e.BQk(),e.ynx(28,35),e.YNc(29,Vn,6,0,"th",36),e.YNc(30,Wn,3,0,"td",37),e.BQk(),e.ynx(31,38),e.YNc(32,Kn,4,3,"td",39),e.BQk(),e.ynx(33,40),e.YNc(34,sa,6,4,"td",29),e.BQk(),e.ynx(35,41),e.YNc(36,ca,5,5,"td",29),e.BQk(),e.ynx(37,42),e.YNc(38,ma,5,5,"td",29),e.BQk(),e.ynx(39,43),e.YNc(40,ha,5,5,"td",29),e.BQk(),e.ynx(41,44),e.YNc(42,Ca,4,1,"td",29),e.BQk(),e.ynx(43,45),e.YNc(44,ya,5,2,"td",46),e.BQk(),e.YNc(45,Za,1,0,"tr",47),e.YNc(46,Aa,1,3,"tr",48),e.YNc(47,va,1,0,"tr",49),e.YNc(48,wa,1,0,"tr",50),e.qZA(),e.TgZ(49,"mat-paginator",51),e.NdJ("page",function(o){return e.CHM(t),e.oxw().onPageChange(o)}),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("icon",t.faHistory),e.xp6(4),e.Q6J("ngModel",t.selFilter),e.xp6(3),e.Q6J("ngIf",t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",t.payments)("ngClass",e.VKq(15,qa,""!==t.errorMessage)),e.xp6(34),e.Q6J("matRowDefColumns",t.htlcColumns)("matRowDefWhen",t.is_group),e.xp6(1),e.Q6J("matFooterRowDef",e.DdM(17,Sa)),e.xp6(1),e.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns),e.xp6(1),e.Q6J("length",t.totalPayments)("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let Ue=(()=>{class n{constructor(t,a,o,s,u,g,U,x){this.logger=t,this.commonService=a,this.dataService=o,this.store=s,this.rtlEffects=u,this.lndEffects=g,this.decimalPipe=U,this.datePipe=x,this.calledFrom="transactions",this.faHistory=y.qO$,this.newlyAddedPayment="",this.selNode={},this.information={},this.peers=[],this.totalPayments=100,this.paymentJSONArr=[],this.displayedColumns=[],this.htlcColumns=[],this.paymentDecoded={},this.paymentRequest="",this.paymentDecodedHint="",this.flgSticky=!1,this.firstOffset=-1,this.lastOffset=-1,this.selFilter="",this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["creation_date","fee","actions"],this.htlcColumns=["groupTotal","groupFee","groupAction"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["creation_date","fee","value","hops","actions"],this.htlcColumns=["groupTotal","groupFee","groupValue","groupHops","groupAction"]):(this.flgSticky=!0,this.displayedColumns=["creation_date","payment_hash","fee","value","hops","actions"],this.htlcColumns=["groupTotal","groupHash","groupFee","groupValue","groupHops","groupAction"])}ngOnInit(){this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t}),this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.information=t}),this.store.select(C.Wi).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.peers=t.peers}),this.store.select(C.l5).pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{this.totalPayments=t.allLightningTransactions.listPaymentsAll&&t.allLightningTransactions.listPaymentsAll.payments&&t.allLightningTransactions.listPaymentsAll.payments.length?t.allLightningTransactions.listPaymentsAll.payments.length:0}),this.store.select(C.PP).pipe((0,d.R)(this.unSubs[4])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.paymentJSONArr=t.listPayments.payments||[],this.firstOffset=+t.listPayments.first_index_offset,this.lastOffset=+t.listPayments.last_index_offset,this.paymentJSONArr&&this.paymentJSONArr.length>0&&this.sort&&this.paginator&&this.loadPaymentsTable(this.paymentJSONArr),this.logger.info(t)})}ngAfterViewInit(){this.paymentJSONArr&&this.paymentJSONArr.length>0&&this.loadPaymentsTable(this.paymentJSONArr)}onSendPayment(){if(!this.paymentRequest)return!0;this.paymentDecoded.timestamp?this.sendPayment():this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,G.q)(1)).subscribe(t=>{this.paymentDecoded=t,this.paymentDecoded.timestamp?(this.paymentDecoded.num_satoshis=this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis?(+this.paymentDecoded.num_msat/1e3).toString():"0",this.sendPayment()):this.resetData()})}sendPayment(){this.newlyAddedPayment=this.paymentDecoded.payment_hash,this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis&&""!==this.paymentDecoded.num_satoshis&&"0"!==this.paymentDecoded.num_satoshis?(this.store.dispatch((0,v.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Confirm Send Payment",noBtnText:"Cancel",yesBtnText:"Send Payment",message:[[{key:"payment_hash",value:this.paymentDecoded.payment_hash,title:"Payment Hash",width:100}],[{key:"destination",value:this.paymentDecoded.destination,title:"Destination",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:50,type:l.Gi.DATE_TIME},{key:"num_satoshis",value:this.paymentDecoded.num_satoshis,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:l.Gi.NUMBER},{key:"cltv_expiry",value:this.paymentDecoded.cltv_expiry,title:"CLTV Expiry",width:50}]]}}})),this.rtlEffects.closeConfirm.pipe((0,G.q)(1)).subscribe(a=>{a&&(this.store.dispatch((0,b.oV)({payload:{uiMessage:l.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,fromDialog:!1}})),this.resetData())})):(this.store.dispatch((0,v.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Enter Amount and Confirm Send Payment",titleMessage:"It is a zero amount invoice. Enter the amount (Sats) to pay.",message:[[{key:"payment_hash",value:this.paymentDecoded.payment_hash,title:"Payment Hash",width:100}],[{key:"destination",value:this.paymentDecoded.destination,title:"Destination",width:100}],[{key:"description",value:this.paymentDecoded.description,title:"Description",width:100}],[{key:"timestamp",value:this.paymentDecoded.timestamp,title:"Creation Date",width:40,type:l.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:l.Gi.NUMBER},{key:"cltv_expiry",value:this.paymentDecoded.cltv_expiry,title:"CLTV Expiry",width:30}]],noBtnText:"Cancel",yesBtnText:"Send Payment",flgShowInput:!0,getInputs:[{placeholder:"Amount (Sats)",inputType:l.Gi.NUMBER.toLowerCase(),inputValue:"",width:30}]}}})),this.rtlEffects.closeConfirm.pipe((0,G.q)(1)).subscribe(o=>{o&&(this.paymentDecoded.num_satoshis=o[0].inputValue,this.store.dispatch((0,b.oV)({payload:{uiMessage:l.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,paymentAmount:o[0].inputValue,fromDialog:!1}})),this.resetData())}))}openSendPaymentModal(){this.store.dispatch((0,v.qR)({payload:{data:{component:Ln}}}))}onPaymentRequestEntry(t){this.paymentRequest=t,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,G.q)(1)).subscribe(a=>{this.paymentDecoded=a,this.paymentDecoded.num_msat&&!this.paymentDecoded.num_satoshis&&(this.paymentDecoded.num_satoshis=(+this.paymentDecoded.num_msat/1e3).toString()),this.paymentDecoded.num_satoshis?this.selNode.fiatConversion?this.commonService.convertCurrency(+this.paymentDecoded.num_satoshis,l.NT.SATS,l.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[5])).subscribe({next:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0)+" Sats ("+o.symbol+this.decimalPipe.transform(o.OTHER?o.OTHER:0,l.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:o=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0)+" Sats | Memo: "+this.paymentDecoded.description+". Unable to convert currency."}}):this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0)+" Sats | Memo: "+this.paymentDecoded.description:this.paymentDecodedHint="Zero Amount Invoice | Memo: "+this.paymentDecoded.description})}onPageChange(t){let a=!0,o=this.lastOffset,s=t.pageSize;0===t.pageIndex?(a=!0,o=0):t.pageIndex<t.previousPageIndex?(a=!1,o=this.lastOffset):t.pageIndex>t.previousPageIndex&&t.length>(t.pageIndex+1)*t.pageSize?(a=!0,o=this.firstOffset):t.length<=(t.pageIndex+1)*t.pageSize&&(a=!1,o=0,s=t.length-t.pageIndex*t.pageSize),this.store.dispatch((0,b.cQ)({payload:{max_payments:s,index_offset:o,reversed:a}}))}is_group(t,a){return a.htlcs&&a.htlcs.length>1}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}getHopDetails(t){const a=this;return t.reduce((o,s)=>{const u=a.peers.find(g=>g.pub_key===s.pub_key);return u&&u.alias?o.push("<pre>Channel: "+u.alias.padEnd(20)+"&Tab;&Tab;&Tab;Amount (Sats): "+a.decimalPipe.transform(s.amt_to_forward)+"</pre>"):a.dataService.getAliasesFromPubkeys(s.pub_key,!1).pipe((0,d.R)(a.unSubs[6])).subscribe(g=>{o.push("<pre>Channel: "+(g.node&&g.node.alias?g.node.alias.padEnd(20):s.pub_key.substring(0,17)+"...")+"&Tab;&Tab;&Tab;Amount (Sats): "+a.decimalPipe.transform(s.amt_to_forward)+"</pre>")}),o},[])}onHTLCClick(t,a){a.payment_request&&""!==a.payment_request.trim()?this.dataService.decodePayment(a.payment_request,!1).pipe((0,G.q)(1)).subscribe({next:o=>{setTimeout(()=>{this.showHTLCView(t,a,o)},0)},error:o=>{this.showHTLCView(t,a,null)}}):this.showHTLCView(t,a,null)}showHTLCView(t,a,o){const s=[[{key:"payment_hash",value:a.payment_hash,title:"Payment Hash",width:100,type:l.Gi.STRING}],[{key:"preimage",value:t.preimage,title:"Preimage",width:100,type:l.Gi.STRING}],[{key:"payment_request",value:a.payment_request,title:"Payment Request",width:100,type:l.Gi.STRING}],[{key:"status",value:t.status,title:"Status",width:33,type:l.Gi.STRING},{key:"attempt_time_ns",value:+t.attempt_time_ns/1e9,title:"Attempt Time",width:33,type:l.Gi.DATE_TIME},{key:"resolve_time_ns",value:+t.resolve_time_ns/1e9,title:"Resolve Time",width:34,type:l.Gi.DATE_TIME}],[{key:"total_amt",value:t.route.total_amt,title:"Amount (Sats)",width:33,type:l.Gi.NUMBER},{key:"total_fees",value:t.route.total_fees,title:"Fee (Sats)",width:33,type:l.Gi.NUMBER},{key:"total_time_lock",value:t.route.total_time_lock,title:"Total Time Lock",width:34,type:l.Gi.NUMBER}],[{key:"hops",value:this.getHopDetails(t.route.hops),title:"Hops",width:100,type:l.Gi.ARRAY}]];o&&o.description&&""!==o.description&&s.splice(3,0,[{key:"description",value:o.description,title:"Description",width:100,type:l.Gi.STRING}]),this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"HTLC Information",message:s,scrollable:t.route&&t.route.hops&&t.route.hops.length>1}}}))}onPaymentClick(t){if(t.htlcs&&t.htlcs[0]&&t.htlcs[0].route&&t.htlcs[0].route.hops&&t.htlcs[0].route.hops.length>0){const a=t.htlcs[0].route.hops.reduce((o,s)=>""===o?s.pub_key:o+","+s.pub_key,"");this.dataService.getAliasesFromPubkeys(a,!0).pipe((0,d.R)(this.unSubs[7])).subscribe(o=>{this.showPaymentView(t,o.reduce((s,u)=>""===s?u:s+"\n"+u,""))})}else this.showPaymentView(t,"")}showPaymentView(t,a){const o=[[{key:"payment_hash",value:t.payment_hash,title:"Payment Hash",width:100,type:l.Gi.STRING}],[{key:"payment_preimage",value:t.payment_preimage,title:"Payment Preimage",width:100,type:l.Gi.STRING}],[{key:"payment_request",value:t.payment_request,title:"Payment Request",width:100,type:l.Gi.STRING}],[{key:"status",value:t.status,title:"Status",width:50,type:l.Gi.STRING},{key:"creation_date",value:t.creation_date,title:"Creation Date",width:50,type:l.Gi.DATE_TIME}],[{key:"value_msat",value:t.value_msat,title:"Value (mSats)",width:50,type:l.Gi.NUMBER},{key:"fee_msat",value:t.fee_msat,title:"Fee (mSats)",width:50,type:l.Gi.NUMBER}],[{key:"path",value:a,title:"Path",width:100,type:l.Gi.STRING}]];t.payment_request&&""!==t.payment_request.trim()?this.dataService.decodePayment(t.payment_request,!1).pipe((0,G.q)(1)).subscribe(s=>{s&&s.description&&""!==s.description&&o.splice(3,0,[{key:"description",value:s.description,title:"Description",width:100,type:l.Gi.STRING}]),setTimeout(()=>{this.openPaymentAlert(o,t.htlcs&&t.htlcs[0]&&t.htlcs[0].route&&t.htlcs[0].route.hops&&t.htlcs[0].route.hops.length>1)},0)}):this.openPaymentAlert(o,!1)}openPaymentAlert(t,a){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Payment Information",message:t,scrollable:a}}}))}applyFilter(){this.payments.filter=this.selFilter.trim().toLowerCase()}loadPaymentsTable(t){this.payments=new r.by(t?[...t]:[]),this.payments.sortingDataAccessor=(a,o)=>"hops"===o?a.htlcs.length&&a.htlcs[0]&&a.htlcs[0].route&&a.htlcs[0].route.hops&&a.htlcs[0].route.hops.length?a.htlcs[0].route.hops.length:0:a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.payments.sort=this.sort,this.payments.filterPredicate=(a,o)=>((a.creation_date?this.datePipe.transform(new Date(1e3*a.creation_date),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(a).toLowerCase()).includes(o),this.applyFilter()}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const t=JSON.parse(JSON.stringify(this.payments.data)),a=t.reduce((o,s)=>(s.payment_request&&""!==s.payment_request.trim()&&(o=""===o?s.payment_request:o+","+s.payment_request),o),"");this.dataService.decodePayments(a).pipe((0,d.R)(this.unSubs[8])).subscribe(o=>{let s=0;o.forEach((g,U)=>{if(g){for(;t[U+s].payment_hash!==g.payment_hash;)s+=1;t[U+s].description=g.description}});const u=t.reduce((g,U)=>g.concat(U),[]);this.commonService.downloadFile(u,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(K.D),e.Y36(w.yh),e.Y36(ie.V),e.Y36(ee.l),e.Y36(m.JJ),e.Y36(m.uU))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-lightning-payments"]],viewQuery:function(t,a){if(1&t&&(e.Gf(kn,5),e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.form=o.first),e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},inputs:{calledFrom:"calledFrom"},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Payments")}])],decls:4,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["fxLayoutAlign","space-between stretch","fxLayout","row wrap",4,"ngIf"],["fxLayout","row",4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",4,"ngIf"],["fxLayoutAlign","space-between stretch","fxLayout","row wrap"],["sendPaymentForm","ngForm"],["fxFlex","100"],["matInput","","placeholder","Payment Request","name","paymentRequest","tabindex","1","required","",3,"perfectScrollbar","ngModel","ngModelChange","matTextareaAutosize"],["paymentReq","ngModel"],[4,"ngIf"],["fxLayout","row",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["fxLayout","row"],["mat-flat-button","","color","primary","tabindex","4",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","30","fxLayoutAlign","start end"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","creation_date"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","payment_hash"],["matColumnDef","fee"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","value"],["matColumnDef","hops"],["matColumnDef","actions"],["mat-header-cell","","class","px-2",4,"matHeaderCellDef"],["mat-cell","","class","px-2","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_payment"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["matColumnDef","groupTotal"],["matColumnDef","groupHash"],["matColumnDef","groupFee"],["matColumnDef","groupValue"],["matColumnDef","groupHops"],["matColumnDef","groupAction"],["mat-cell","","class","px-2",4,"matCellDef"],["mat-row","",4,"matRowDef","matRowDefColumns","matRowDefWhen"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"length","pageSize","pageSizeOptions","showFirstLastButtons","page"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["class","dot green","matTooltip","Succeeded","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot red","matTooltip","Failed","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Succeeded","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Failed","matTooltipPosition","right",1,"dot","red",3,"ngClass"],["fxLayout","row",1,"ellipsis-parent",3,"ngStyle"],[1,"ellipsis-child"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-2"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-2"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],["fxLayoutAlign","start center",1,"htlc-row-span"],["fxLayoutAlign","start center","class","htlc-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"htlc-row-span","pl-3"],["fxLayoutAlign","start center","class","htlc-row-span",4,"ngFor","ngForOf"],["fxLayoutAlign","end center",1,"htlc-row-span"],["fxLayoutAlign","end center","class","htlc-row-span",4,"ngFor","ngForOf"],["mat-cell","",1,"px-2"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-htlc-expand",3,"click"],["fxLayoutAlign","end center",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-htlc-info",3,"click"],["mat-row",""],["mat-footer-row","",3,"ngClass"],["mat-header-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,On,12,3,"form",1),e.YNc(2,Un,3,0,"div",2),e.YNc(3,La,50,18,"div",3),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf","home"===a.calledFrom),e.xp6(1),e.Q6J("ngIf","transactions"===a.calledFrom),e.xp6(1),e.Q6J("ngIf","transactions"===a.calledFrom))},directives:[_.xw,_.yH,_.Wh,m.O5,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,c.Q7,Y.$V,c.JJ,c.On,L.lW,f.bx,f.TO,I.BN,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.nj,r.Ke,r.as,q.NW,M.pW,r.ge,Z.nU,r.ev,W.gM,m.PC,S.Zl,O.gD,O.$L,E.ey,r.yh,m.sg,r.Gk,r.Q2,r.XQ],pipes:[m.uU,m.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-payment_hash[_ngcontent-%COMP%]{flex:0 0 20%;width:20%}.mat-column-payment_hash[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-groupAction[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-htlc-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-groupAction[_ngcontent-%COMP%] .btn-htlc-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}.htlc-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-groupTotal[_ngcontent-%COMP%]{min-width:17rem}"]}),n})();function ka(n,i){if(1&n&&(e.TgZ(0,"button",26),e.TgZ(1,"mat-icon"),e._uU(2,"more_vert"),e.qZA(),e.qZA()),2&n){e.oxw();const t=e.MAs(11);e.Q6J("matMenuTriggerFor",t)}}function Fa(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){const s=e.CHM(t).index,u=e.oxw().$implicit;return e.oxw(2).onNavigateTo(u.links[s])}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t)}}function Na(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){return e.CHM(t),e.oxw(3).onsortChannelsBy()}),e._uU(1),e.qZA()}if(2&n){const t=e.oxw(3);e.xp6(1),e.hij("Sort By ","Balance Score"===t.sortField?"Capacity":"Balance Score","")}}function Oa(n,i){1&n&&e._UZ(0,"mat-progress-bar",28)}function Ua(n,i){if(1&n&&e._UZ(0,"rtl-node-info",29),2&n){const t=e.oxw(3);e.Q6J("information",t.information)("showColorFieldSeparately",!1)}}function Ra(n,i){if(1&n&&e._UZ(0,"rtl-balances-info",30),2&n){const t=e.oxw(3);e.Q6J("balances",t.balances)("errorMessage",t.errorMessages[3]+" "+t.errorMessages[2])}}function Ia(n,i){if(1&n&&e._UZ(0,"rtl-channel-capacity-info",31),2&n){const t=e.oxw(3);e.Q6J("sortBy",t.sortField)("channelBalances",t.channelBalances)("allChannels",t.allChannelsCapacity)("errorMessage",t.errorMessages[3])}}function Da(n,i){if(1&n&&e._UZ(0,"rtl-fee-info",32),2&n){const t=e.oxw(3);e.Q6J("fees",t.fees)("errorMessage",t.errorMessages[1])}}function Pa(n,i){if(1&n&&e._UZ(0,"rtl-channel-status-info",33),2&n){const t=e.oxw(3);e.Q6J("channelsStatus",t.channelsStatus)("errorMessage",t.errorMessages[3]+" "+t.errorMessages[4])}}function Ma(n,i){1&n&&(e.TgZ(0,"h3"),e._uU(1,"Error! Unable to find information!"),e.qZA())}const Re=function(n){return{"dashboard-card-content":!0,"error-border":n}};function Ja(n,i){if(1&n&&(e.TgZ(0,"mat-grid-tile",8),e.TgZ(1,"mat-card",9),e.TgZ(2,"mat-card-header"),e.TgZ(3,"mat-card-title",10),e.TgZ(4,"div"),e._UZ(5,"fa-icon",11),e.TgZ(6,"span"),e._uU(7),e.qZA(),e.qZA(),e.TgZ(8,"div"),e.YNc(9,ka,3,1,"button",12),e.TgZ(10,"mat-menu",13,14),e.YNc(12,Fa,2,1,"button",15),e.YNc(13,Na,2,1,"button",16),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(14,"mat-card-content",17),e.YNc(15,Oa,1,0,"mat-progress-bar",18),e.TgZ(16,"div",19),e.YNc(17,Ua,1,2,"rtl-node-info",20),e.YNc(18,Ra,1,2,"rtl-balances-info",21),e.YNc(19,Ia,1,4,"rtl-channel-capacity-info",22),e.YNc(20,Da,1,2,"rtl-fee-info",23),e.YNc(21,Pa,1,2,"rtl-channel-status-info",24),e.YNc(22,Ma,2,0,"h3",25),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.Q6J("colspan",t.cols)("rowspan",t.rows),e.xp6(5),e.Q6J("icon",t.icon),e.xp6(2),e.Oqu(t.title),e.xp6(2),e.Q6J("ngIf",t.links[0]),e.xp6(3),e.Q6J("ngForOf",t.goToOptions),e.xp6(1),e.Q6J("ngIf","capacity"===t.id),e.xp6(1),e.s9C("fxFlex","node"===t.id||"balance"===t.id?70:"fee"===t.id||"status"===t.id?78:90),e.Q6J("ngClass",e.VKq(16,Re,"node"===t.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.ERROR||"balance"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.ERROR||a.apiCallStatusBlockchainBalance.status===a.apiCallStatusEnum.ERROR)||"capacity"===t.id&&a.apiCallStatusChannels.status===a.apiCallStatusEnum.ERROR||"fee"===t.id&&a.apiCallStatusFees.status===a.apiCallStatusEnum.ERROR||"status"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.ERROR||a.apiCallStatusPendingChannels.status===a.apiCallStatusEnum.ERROR))),e.xp6(1),e.Q6J("ngIf","node"===t.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.INITIATED||"balance"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.INITIATED||a.apiCallStatusBlockchainBalance.status===a.apiCallStatusEnum.INITIATED)||"capacity"===t.id&&a.apiCallStatusChannels.status===a.apiCallStatusEnum.INITIATED||"fee"===t.id&&a.apiCallStatusFees.status===a.apiCallStatusEnum.INITIATED||"status"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.INITIATED||a.apiCallStatusPendingChannels.status===a.apiCallStatusEnum.INITIATED)),e.xp6(1),e.Q6J("ngSwitch",t.id),e.xp6(1),e.Q6J("ngSwitchCase","node"),e.xp6(1),e.Q6J("ngSwitchCase","balance"),e.xp6(1),e.Q6J("ngSwitchCase","capacity"),e.xp6(1),e.Q6J("ngSwitchCase","fee"),e.xp6(1),e.Q6J("ngSwitchCase","status")}}function Qa(n,i){if(1&n&&(e.TgZ(0,"div",2),e.TgZ(1,"div",3),e._UZ(2,"fa-icon",4),e.TgZ(3,"span",5),e._uU(4),e.qZA(),e.qZA(),e.TgZ(5,"mat-grid-list",6),e.YNc(6,Ja,23,18,"mat-grid-tile",7),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("icon",t.apiCallStatusNodeInfo.status===t.apiCallStatusEnum.ERROR?t.faFrown:t.faSmile),e.xp6(2),e.Oqu(t.apiCallStatusNodeInfo.status===t.apiCallStatusEnum.COMPLETED?"Welcome "+t.information.alias+"! Your node is up and running.":t.apiCallStatusNodeInfo.status===t.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),e.xp6(1),e.Q6J("rowHeight",t.operatorCardHeight),e.xp6(1),e.Q6J("ngForOf",t.operatorCards)}}function Ea(n,i){if(1&n&&(e.TgZ(0,"button",26),e.TgZ(1,"mat-icon"),e._uU(2,"more_vert"),e.qZA(),e.qZA()),2&n){e.oxw();const t=e.MAs(9);e.Q6J("matMenuTriggerFor",t)}}function Ya(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){const s=e.CHM(t).index,u=e.oxw(2).$implicit;return e.oxw(2).onNavigateTo(u.links[s])}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t)}}function Ba(n,i){if(1&n&&(e.TgZ(0,"mat-card-header"),e.TgZ(1,"mat-card-title",10),e.TgZ(2,"div"),e._UZ(3,"fa-icon",11),e.TgZ(4,"span"),e._uU(5),e.qZA(),e.qZA(),e.TgZ(6,"div"),e.YNc(7,Ea,3,1,"button",12),e.TgZ(8,"mat-menu",13,43),e.YNc(10,Ya,2,1,"button",15),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(3),e.Q6J("icon",t.icon),e.xp6(2),e.Oqu(t.title),e.xp6(2),e.Q6J("ngIf",t.links[0]),e.xp6(3),e.Q6J("ngForOf",t.goToOptions)}}function Ha(n,i){1&n&&e._UZ(0,"mat-progress-bar",28)}function Ga(n,i){if(1&n&&e._UZ(0,"rtl-node-info",44),2&n){const t=e.oxw(3);e.Q6J("information",t.information)}}function za(n,i){if(1&n&&e._UZ(0,"rtl-balances-info",30),2&n){const t=e.oxw(3);e.Q6J("balances",t.balances)("errorMessage",t.errorMessages[3]+" "+t.errorMessages[2])}}function Va(n,i){if(1&n&&e._UZ(0,"rtl-channel-liquidity-info",45),2&n){const t=e.oxw(3);e.Q6J("direction","In")("totalLiquidity",t.totalInboundLiquidity)("allChannels",t.allInboundChannels)("errorMessage",t.errorMessages[3])}}function Wa(n,i){if(1&n&&e._UZ(0,"rtl-channel-liquidity-info",45),2&n){const t=e.oxw(3);e.Q6J("direction","Out")("totalLiquidity",t.totalOutboundLiquidity)("allChannels",t.allOutboundChannels)("errorMessage",t.errorMessages[3])}}function Xa(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",27),e.NdJ("click",function(){const s=e.CHM(t).index,u=e.oxw(3).$implicit;return e.oxw(2).onNavigateTo(u.links[s])}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t)}}function $a(n,i){if(1&n&&(e.TgZ(0,"button",26),e.TgZ(1,"mat-icon"),e._uU(2,"more_vert"),e.qZA(),e.qZA(),e.TgZ(3,"mat-menu",13,53),e.YNc(5,Xa,2,1,"button",15),e.qZA()),2&n){const t=e.MAs(4),a=e.oxw(2).$implicit;e.Q6J("matMenuTriggerFor",t),e.xp6(5),e.Q6J("ngForOf",a.goToOptions)}}function ja(n,i){1&n&&(e.TgZ(0,"span",46),e.TgZ(1,"mat-tab-group",47),e.TgZ(2,"mat-tab",48),e._UZ(3,"rtl-lightning-invoices",49),e.qZA(),e.TgZ(4,"mat-tab",50),e._UZ(5,"rtl-lightning-payments",49),e.qZA(),e.TgZ(6,"mat-tab",51),e.YNc(7,$a,6,2,"ng-template",52),e.qZA(),e.qZA(),e.qZA()),2&n&&(e.xp6(3),e.Q6J("calledFrom","home"),e.xp6(2),e.Q6J("calledFrom","home"),e.xp6(1),e.Q6J("disabled",!0))}function Ka(n,i){1&n&&(e.TgZ(0,"h3"),e._uU(1,"Error! Unable to find information!"),e.qZA())}const ei=function(n){return{"p-0":n}};function ti(n,i){if(1&n&&(e.TgZ(0,"mat-grid-tile",8),e.TgZ(1,"mat-card",36),e.YNc(2,Ba,11,4,"mat-card-header",37),e.TgZ(3,"mat-card-content",38),e.YNc(4,Ha,1,0,"mat-progress-bar",18),e.TgZ(5,"div",39),e.YNc(6,Ga,1,1,"rtl-node-info",40),e.YNc(7,za,1,2,"rtl-balances-info",21),e.YNc(8,Va,1,4,"rtl-channel-liquidity-info",41),e.YNc(9,Wa,1,4,"rtl-channel-liquidity-info",41),e.YNc(10,ja,8,3,"span",42),e.YNc(11,Ka,2,0,"h3",25),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.Q6J("colspan",t.cols)("rowspan",t.rows),e.xp6(1),e.Q6J("ngClass",e.VKq(13,ei,"transactions"===t.id)),e.xp6(1),e.Q6J("ngIf","transactions"!==t.id),e.xp6(1),e.s9C("fxFlex","transactions"===t.id?100:"balance"===t.id?70:90),e.Q6J("ngClass",e.VKq(15,Re,"node"===t.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.ERROR||"balance"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.ERROR||a.apiCallStatusBlockchainBalance.status===a.apiCallStatusEnum.ERROR)||("inboundLiq"===t.id||"outboundLiq"===t.id)&&a.apiCallStatusChannels.status===a.apiCallStatusEnum.ERROR)),e.xp6(1),e.Q6J("ngIf","node"===t.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.INITIATED||"balance"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.INITIATED||a.apiCallStatusBlockchainBalance.status===a.apiCallStatusEnum.INITIATED)||("inboundLiq"===t.id||"outboundLiq"===t.id)&&a.apiCallStatusChannels.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngSwitch",t.id),e.xp6(1),e.Q6J("ngSwitchCase","node"),e.xp6(1),e.Q6J("ngSwitchCase","balance"),e.xp6(1),e.Q6J("ngSwitchCase","inboundLiq"),e.xp6(1),e.Q6J("ngSwitchCase","outboundLiq"),e.xp6(1),e.Q6J("ngSwitchCase","transactions")}}function ni(n,i){if(1&n&&(e.TgZ(0,"div",34),e._UZ(1,"fa-icon",4),e.TgZ(2,"span",5),e._uU(3),e.qZA(),e.qZA(),e.TgZ(4,"mat-grid-list",35),e.YNc(5,ti,12,17,"mat-grid-tile",7),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faSmile),e.xp6(2),e.hij("Welcome ",t.information.alias,"! Your node is up and running."),e.xp6(1),e.Q6J("rowHeight",t.merchantCardHeight),e.xp6(1),e.Q6J("ngForOf",t.merchantCards)}}let ai=(()=>{class n{constructor(t,a,o,s,u){switch(this.logger=t,this.store=a,this.actions=o,this.commonService=s,this.router=u,this.faSmile=ve.I3,this.faFrown=ve.Kf,this.faAngleDoubleDown=y.Sbq,this.faAngleDoubleUp=y.Vfw,this.faChartPie=y.OS1,this.faBolt=y.BDt,this.faServer=y.xf3,this.faNetworkWired=y.kXW,this.flgChildInfoUpdated=!1,this.userPersonaEnum=l.ol,this.activeChannels=0,this.inactiveChannels=0,this.channelBalances={localBalance:0,remoteBalance:0,balancedness:0},this.selNode={},this.information={},this.balances={onchain:-1,lightning:-1,total:0},this.allChannels=[],this.channelsStatus={},this.allChannelsCapacity=[],this.allInboundChannels=[],this.allOutboundChannels=[],this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.operatorCards=[],this.merchantCards=[],this.screenSize="",this.operatorCardHeight="330px",this.merchantCardHeight="65px",this.sortField="Balance Score",this.screenSizeEnum=l.cu,this.errorMessages=["","","","",""],this.apiCallStatusNodeInfo=null,this.apiCallStatusFees=null,this.apiCallStatusBlockchainBalance=null,this.apiCallStatusChannels=null,this.apiCallStatusPendingChannels=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize){case l.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","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:6},{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}];break;case l.cu.SM:case l.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","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}];break;default: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","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(C.bx).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessages[0]="",this.apiCallStatusNodeInfo=t.apiCallStatus,this.apiCallStatusNodeInfo.status===l.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message),this.selNode=t.nodeSettings,this.information=t.information}),this.store.select(C.JG).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.errorMessages[1]="",this.apiCallStatusFees=t.apiCallStatus,this.apiCallStatusFees.status===l.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apiCallStatusFees.message?JSON.stringify(this.apiCallStatusFees.message):this.apiCallStatusFees.message),this.fees=t.fees}),this.store.select(C.qU).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.errorMessages[2]="",this.apiCallStatusBlockchainBalance=t.apiCallStatus,this.apiCallStatusBlockchainBalance.status===l.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apiCallStatusBlockchainBalance.message?JSON.stringify(this.apiCallStatusBlockchainBalance.message):this.apiCallStatusBlockchainBalance.message),this.balances.onchain=+t.blockchainBalance.total_balance>=0?+t.blockchainBalance.total_balance:0,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances)}),this.store.select(C.ni).pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{this.errorMessages[4]="",this.apiCallStatusPendingChannels=t.apiCallStatus,this.apiCallStatusPendingChannels.status===l.Bn.ERROR&&(this.errorMessages[4]="object"==typeof this.apiCallStatusPendingChannels.message?JSON.stringify(this.apiCallStatusPendingChannels.message):this.apiCallStatusPendingChannels.message),this.channelsStatus.pending={num_channels:t.pendingChannelsSummary.open.num_channels,capacity:t.pendingChannelsSummary.open.limbo_balance},this.channelsStatus.closing={num_channels:t.pendingChannelsSummary.closing.num_channels+t.pendingChannelsSummary.force_closing.num_channels+t.pendingChannelsSummary.waiting_close.num_channels,capacity:t.pendingChannelsSummary.total_limbo_balance}}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[4])).subscribe(t=>{this.errorMessages[3]="",this.apiCallStatusChannels=t.apiCallStatus,this.apiCallStatusChannels.status===l.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusChannels.message?JSON.stringify(this.apiCallStatusChannels.message):this.apiCallStatusChannels.message);const a=t.lightningBalance&&t.lightningBalance.local?+t.lightningBalance.local:0,o=t.lightningBalance&&t.lightningBalance.remote?+t.lightningBalance.remote:0;this.channelBalances={localBalance:a,remoteBalance:o,balancedness:+(1-Math.abs((a-o)/(a+o))).toFixed(3)},this.balances.lightning=t.lightningBalance.local,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances),this.activeChannels=t.channelsSummary.active.num_channels,this.inactiveChannels=t.channelsSummary.inactive.num_channels,this.channelsStatus.active=t.channelsSummary.active,this.channelsStatus.inactive=t.channelsSummary.inactive,this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannels=t.channels.filter(u=>!0===u.active),this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels,"balancedness"))),this.allInboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(u=>u.remote_balance>0),"remote_balance"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(u=>u.local_balance>0),"local_balance"))),this.allChannels.forEach(u=>{this.totalInboundLiquidity=this.totalInboundLiquidity+ +u.remote_balance,this.totalOutboundLiquidity=this.totalOutboundLiquidity+ +u.local_balance}),this.flgChildInfoUpdated=this.balances.lightning>=0&&this.balances.onchain>=0&&this.fees.month_fee_sum>=0,this.logger.info(t)}),this.actions.pipe((0,d.R)(this.unSubs[5]),(0,Q.h)(t=>t.type===l.uR.FETCH_FEES_LND||t.type===l.uR.SET_FEES_LND)).subscribe(t=>{t.type===l.uR.FETCH_FEES_LND&&(this.flgChildInfoUpdated=!1),t.type===l.uR.SET_FEES_LND&&(this.flgChildInfoUpdated=!0)})}onNavigateTo(t){"inactive"===t?this.router.navigateByUrl("/lnd/connections",{state:{filter:t}}):this.router.navigateByUrl("/lnd/"+t)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.allChannels.sort((t,a)=>{const o=+t.local_balance+ +t.remote_balance,s=+a.local_balance+ +a.remote_balance;return o>s?-1:o<s?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(z.eX),e.Y36(P.v),e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-home"]],decls:3,vars:2,consts:[["fxLayout","column",4,"ngIf","ngIfElse"],["merchantDashboard",""],["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container","mb-0"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","10",3,"rowHeight"],[3,"colspan","rowspan",4,"ngFor","ngForOf"],[3,"colspan","rowspan"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4"],["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-0"],["cols","6",3,"rowHeight"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch",1,"h-100","dashboard-card","mt-4",3,"ngClass"],[4,"ngIf"],["fxLayout","column","fxLayoutAlign","start stretch",3,"fxFlex","ngClass"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",3,"ngSwitch"],["fxFlex","100",3,"information",4,"ngSwitchCase"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage",4,"ngSwitchCase"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start",3,"perfectScrollbar",4,"ngSwitchCase"],["menuMerchant","matMenu"],["fxFlex","100",3,"information"],["fxFlex","100",3,"direction","totalLiquidity","allChannels","errorMessage"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start",3,"perfectScrollbar"],["fxLayout","column","fxFlex","100",1,"w-100","dashboard-tabs-group"],["label","Receive"],[3,"calledFrom"],["label","Pay"],[3,"disabled"],["mat-tab-label",""],["menuTransactions","matMenu"]],template:function(t,a){if(1&t&&(e.YNc(0,Qa,7,4,"div",0),e.YNc(1,ni,6,4,"ng-template",null,1,e.W1O)),2&t){const o=e.MAs(2);e.Q6J("ngIf",(null==a.selNode?null:a.selNode.userPersona)===a.userPersonaEnum.OPERATOR)("ngIfElse",o)}},directives:[m.O5,_.xw,_.Wh,I.BN,le.Il,m.sg,le.DX,A.a8,_.yH,A.dk,A.n5,_e.VK,A.dn,m.mk,S.oO,m.RF,m.n9,m.ED,L.lW,_e.p6,j.Hw,_e.OP,M.pW,qe,ot,_t,Se,Le,Nt,Y.$V,D.SP,D.uX,Ne,Ue,D.uD],styles:[""]}),n})();var de=h(1203),he=h(7544);function ii(n,i){if(1&n&&(e.TgZ(0,"span",10),e._uU(1,"Channels"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.activeChannels)}}function oi(n,i){if(1&n&&(e.TgZ(0,"span",10),e._uU(1,"Peers"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.activePeers)}}let si=(()=>{class n{constructor(t,a,o){this.store=t,this.logger=a,this.router=o,this.selNode={},this.activePeers=0,this.activeChannels=0,this.faUsers=y.FVb,this.faChartPie=y.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 p.x,new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(t=>t.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(t=>t instanceof T.Av)).subscribe(t=>{this.activeLink=this.links.findIndex(a=>a.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select(C.$k).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.selNode=t}),this.store.select(C.Wi).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.activePeers=t.peers&&t.peers.length?t.peers.length:0,this.logger.info(t)}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{this.activeChannels=t.channelsSummary.active.num_channels,this.logger.info(t)}),this.store.select(C.qU).pipe((0,d.R)(this.unSubs[4])).subscribe(t=>{this.balances=[{title:"Total Balance",dataValue:t.blockchainBalance.total_balance||0},{title:"Confirmed",dataValue:t.blockchainBalance.confirmed_balance},{title:"Unconfirmed",dataValue:t.blockchainBalance.unconfirmed_balance}],this.logger.info(t)})}onSelectedTabChange(t){this.router.navigateByUrl("/lnd/connections/"+this.links[t.index].link)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh),e.Y36(F.mQ),e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-connections"]],decls:22,vars:4,consts:[["fxLayout","row","fxLayoutAlign","start center",1,"page-title-container"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxLayout","column",1,"padding-gap-x","mb-4"],["fxLayout","column"],[3,"values"],["fxLayout","column",1,"padding-gap-x"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"On-chain Balance"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e._UZ(7,"rtl-currency-unit-converter",5),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",0),e._UZ(9,"fa-icon",1),e.TgZ(10,"span",2),e._uU(11,"Connections"),e.qZA(),e.qZA(),e.TgZ(12,"div",6),e.TgZ(13,"mat-card"),e.TgZ(14,"mat-card-content",4),e.TgZ(15,"mat-tab-group",7),e.NdJ("selectedIndexChange",function(s){return a.activeLink=s})("selectedTabChange",function(s){return a.onSelectedTabChange(s)}),e.TgZ(16,"mat-tab"),e.YNc(17,ii,2,1,"ng-template",8),e.qZA(),e.TgZ(18,"mat-tab"),e.YNc(19,oi,2,1,"ng-template",8),e.qZA(),e.qZA(),e.TgZ(20,"div",9),e._UZ(21,"router-outlet"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faChartPie),e.xp6(6),e.Q6J("values",a.balances),e.xp6(2),e.Q6J("icon",a.faUsers),e.xp6(6),e.Q6J("selectedIndex",a.activeLink))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,de.D,D.SP,D.uX,D.uD,_.yH,T.lC,he.k],styles:[""]}),n})();var ge=h(8675),Ie=h(4004),De=h(9843);const li=["form"];function ri(n,i){if(1&n&&(e.TgZ(0,"mat-option",37),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t.alias?t.alias:t.pub_key?t.pub_key:"")}}function ci(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Peer alias is required."),e.qZA())}function ui(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Peer not found in the list."),e.qZA())}function pi(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",1),e._UZ(1,"input",34),e.TgZ(2,"mat-autocomplete",35,36),e.NdJ("optionSelected",function(){return e.CHM(t),e.oxw().onSelectedPeerChanged()}),e.YNc(4,ri,2,2,"mat-option",24),e.ALo(5,"async"),e.qZA(),e.YNc(6,ci,2,0,"mat-error",17),e.YNc(7,ui,2,0,"mat-error",17),e.qZA()}if(2&n){const t=e.MAs(3),a=e.oxw();e.xp6(1),e.Q6J("formControl",a.selectedPeer)("matAutocomplete",t),e.xp6(1),e.Q6J("displayWith",a.displayFn),e.xp6(2),e.Q6J("ngForOf",e.lcZ(5,6,a.filteredPeers)),e.xp6(2),e.Q6J("ngIf",null==a.selectedPeer.errors?null:a.selectedPeer.errors.required),e.xp6(1),e.Q6J("ngIf",null==a.selectedPeer.errors?null:a.selectedPeer.errors.notfound)}}function mi(n,i){1&n&&e.GkF(0)}function _i(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Amount is required."),e.qZA())}function di(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("Amount must be less than or equal to ",t.totalBalance,".")}}function hi(n,i){if(1&n&&(e.TgZ(0,"mat-option",37),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.name," ")}}function gi(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("","1"===t.selTransType?"Target Confirmation Blocks":"Fee"," is required.")}}function fi(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.channelConnectionError)}}function Ci(n,i){if(1&n&&(e.TgZ(0,"div",38),e._UZ(1,"fa-icon",39),e.YNc(2,fi,2,1,"span",17),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(1),e.Q6J("ngIf",""!==t.channelConnectionError)}}function xi(n,i){if(1&n&&(e.TgZ(0,"mat-expansion-panel",41),e.TgZ(1,"mat-expansion-panel-header"),e.TgZ(2,"mat-panel-title"),e.TgZ(3,"span"),e._uU(4,"Peer: \xa0"),e.qZA(),e.TgZ(5,"strong",42),e._uU(6),e.qZA(),e.qZA(),e.qZA(),e.TgZ(7,"div",9),e.TgZ(8,"div",0),e.TgZ(9,"div",1),e.TgZ(10,"h4",43),e._uU(11,"Pubkey"),e.qZA(),e.TgZ(12,"span",44),e._uU(13),e.qZA(),e.qZA(),e.qZA(),e._UZ(14,"mat-divider",45),e.TgZ(15,"div",0),e.TgZ(16,"div",46),e.TgZ(17,"h4",43),e._uU(18,"Address"),e.qZA(),e.TgZ(19,"span",47),e._uU(20),e.qZA(),e.qZA(),e.TgZ(21,"div",46),e.TgZ(22,"h4",43),e._uU(23,"Inbound"),e.qZA(),e.TgZ(24,"span",47),e._uU(25),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(6),e.Oqu((null==t.peer?null:t.peer.alias)||(null==t.peer?null:t.peer.address)),e.xp6(7),e.Oqu(t.peer.pub_key),e.xp6(7),e.Oqu(null==t.peer?null:t.peer.address),e.xp6(5),e.Oqu(null!=t.peer&&t.peer.inbound?"True":"False")}}function Ti(n,i){if(1&n&&e.YNc(0,xi,26,4,"mat-expansion-panel",40),2&n){const t=e.oxw();e.Q6J("ngIf",t.peer)}}let Pe=(()=>{class n{constructor(t,a,o,s){this.dialogRef=t,this.data=a,this.store=o,this.actions=s,this.selectedPeer=new c.NI,this.amount=new c.NI,this.faExclamationTriangle=y.eHv,this.channelConnectionError="",this.advancedTitle="Advanced Options",this.totalBalance=0,this.selectedPubkey="",this.isPrivate=!1,this.selTransType="0",this.spendUnconfirmed=!1,this.transTypeValue="",this.transTypes=l.Dr,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.information=this.data.message.information,this.totalBalance=this.data.message.balance,this.alertTitle=this.data.alertTitle,this.peer=this.data.message.peer||null,this.peers=this.data.message.peers||[],this.actions.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(o=>o.type===l.uR.UPDATE_API_CALL_STATUS_LND||o.type===l.uR.FETCH_CHANNELS_LND)).subscribe(o=>{o.type===l.uR.UPDATE_API_CALL_STATUS_LND&&o.payload.status===l.Bn.ERROR&&"SaveNewChannel"===o.payload.action&&(this.channelConnectionError=o.payload.message),o.type===l.uR.FETCH_CHANNELS_LND&&this.dialogRef.close()});let t="",a="";this.sortedPeers=this.peers.sort((o,s)=>(t=o.alias?o.alias.toLowerCase():o.pub_key?o.pub_key.toLowerCase():"",a=s.alias?s.alias.toLowerCase():o.pub_key.toLowerCase(),t<a?-1:t>a?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,d.R)(this.unSubs[1]),(0,ge.O)(""),(0,Ie.U)(o=>"string"==typeof o?o:o.alias?o.alias:o.pub_key),(0,Ie.U)(o=>o?this.filterPeers(o):this.sortedPeers.slice()))}filterPeers(t){return this.sortedPeers.filter(a=>0===a.alias.toLowerCase().indexOf(t?t.toLowerCase():""))}displayFn(t){return t&&t.alias?t.alias:t&&t.pub_key?t.pub_key:""}onSelectedPeerChanged(){if(this.channelConnectionError="",this.selectedPubkey=this.selectedPeer.value&&this.selectedPeer.value.pub_key?this.selectedPeer.value.pub_key:null,"string"==typeof this.selectedPeer.value){const t=this.peers.filter(a=>a.alias.length===this.selectedPeer.value.length&&0===a.alias.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===t.length&&t[0].pub_key&&(this.selectedPubkey=t[0].pub_key)}this.selectedPeer.setErrors(this.selectedPeer.value&&!this.selectedPubkey?{notfound:!0}:null)}onClose(){this.dialogRef.close(!1)}resetData(){this.selectedPeer.setValue(""),this.fundingAmount=null,this.isPrivate=!1,this.spendUnconfirmed=!1,this.selTransType="0",this.transTypeValue="",this.channelConnectionError="",this.advancedTitle="Advanced Options",this.form.resetForm()}onOpenChannel(){if(!this.peer&&!this.selectedPubkey||!this.fundingAmount||this.totalBalance-this.fundingAmount<0||("1"===this.selTransType||"2"===this.selTransType)&&!this.transTypeValue)return!0;this.store.dispatch((0,b.YX)({payload:{selectedPeerPubkey:this.peer&&this.peer.pub_key?this.peer.pub_key:this.selectedPubkey,fundingAmount:this.fundingAmount,private:this.isPrivate,transType:this.selTransType,transTypeValue:this.transTypeValue,spendUnconfirmed:this.spendUnconfirmed}}))}onAdvancedPanelToggle(t){this.advancedTitle=t?"Advanced Options | "+("1"===this.selTransType?"Target Confirmation Blocks: ":"2"===this.selTransType?"Fee (Sats/vByte): ":"Default")+("1"===this.selTransType||"2"===this.selTransType?this.transTypeValue:"")+" | Spend Unconfirmed Output: "+(this.spendUnconfirmed?"Yes":"No"):"Advanced Options"}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(w.yh),e.Y36(z.eX))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-open-channel"]],viewQuery:function(t,a){if(1&t&&e.Gf(li,7),2&t){let o;e.iGM(o=e.CRH())&&(a.form=o.first)}},decls:55,vars:25,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column",3,"submit","reset"],["form","ngForm"],["fxLayout","column"],["fxFlex","100",4,"ngIf"],[4,"ngTemplateOutlet"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","60","fxLayoutAlign","start end"],["matInput","","placeholder","Amount","type","number","tabindex","1","required","","name","amnt",3,"ngModel","step","min","max","ngModelChange"],["amt","ngModel"],["matSuffix",""],[4,"ngIf"],["fxFlex","35","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","49"],["tabindex","3",3,"value","valueChange"],[3,"value",4,"ngFor","ngForOf"],["matInput","","type","number","tabindex","4","name","transTpValue",3,"ngModel","required","disabled","placeholder","step","min","ngModelChange"],["transTypeVal","ngModel"],["fxFlex","50","fxLayoutAlign","start center"],["tabindex","6","color","primary","name","spendUnconfirmed",3,"ngModel","ngModelChange"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center",1,"mt-2"],["mat-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["autoFocus","","mat-button","","color","primary","type","submit","tabindex","9"],["peerDetailsExpansionBlock",""],["type","text","placeholder","Peer Alias","aria-label","Peers","matInput","","tabindex","1","required","",3,"formControl","matAutocomplete"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[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(t,a){if(1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e.NdJ("click",function(){return a.onClose()}),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"form",7,8),e.NdJ("submit",function(){return a.onOpenChannel()})("reset",function(){return a.resetData()}),e.TgZ(11,"div",9),e.YNc(12,pi,8,8,"mat-form-field",10),e.qZA(),e.YNc(13,mi,1,0,"ng-container",11),e.TgZ(14,"div",9),e.TgZ(15,"div",12),e.TgZ(16,"mat-form-field",13),e.TgZ(17,"input",14,15),e.NdJ("ngModelChange",function(s){return a.fundingAmount=s}),e.qZA(),e.TgZ(19,"mat-hint"),e._uU(20),e.ALo(21,"number"),e.qZA(),e.TgZ(22,"span",16),e._uU(23," Sats "),e.qZA(),e.YNc(24,_i,2,0,"mat-error",17),e.YNc(25,di,2,1,"mat-error",17),e.qZA(),e.TgZ(26,"div",18),e.TgZ(27,"mat-slide-toggle",19),e.NdJ("ngModelChange",function(s){return a.isPrivate=s}),e._uU(28,"Private Channel"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(29,"mat-expansion-panel",20),e.NdJ("closed",function(){return a.onAdvancedPanelToggle(!0)})("opened",function(){return a.onAdvancedPanelToggle(!1)}),e.TgZ(30,"mat-expansion-panel-header"),e.TgZ(31,"mat-panel-title"),e.TgZ(32,"span"),e._uU(33),e.qZA(),e.qZA(),e.qZA(),e.TgZ(34,"div",21),e.TgZ(35,"div",12),e.TgZ(36,"mat-form-field",22),e.TgZ(37,"mat-select",23),e.NdJ("valueChange",function(s){return a.selTransType=s}),e.YNc(38,hi,2,2,"mat-option",24),e.qZA(),e.qZA(),e.TgZ(39,"mat-form-field",22),e.TgZ(40,"input",25,26),e.NdJ("ngModelChange",function(s){return a.transTypeValue=s}),e.qZA(),e.YNc(42,gi,2,1,"mat-error",17),e.qZA(),e.qZA(),e.TgZ(43,"div",12),e.TgZ(44,"div",27),e.TgZ(45,"mat-slide-toggle",28),e.NdJ("ngModelChange",function(s){return a.spendUnconfirmed=s}),e._uU(46,"Spend Unconfirmed Output"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(47,Ci,3,2,"div",29),e.TgZ(48,"div",30),e.TgZ(49,"button",31),e._uU(50,"Clear Fields"),e.qZA(),e.TgZ(51,"button",32),e._uU(52,"Open Channel"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(53,Ti,1,1,"ng-template",null,33,e.W1O)),2&t){const o=e.MAs(54);e.xp6(5),e.Oqu(a.alertTitle),e.xp6(7),e.Q6J("ngIf",!a.peer&&a.peers&&a.peers.length>0),e.xp6(1),e.Q6J("ngTemplateOutlet",o),e.xp6(4),e.Q6J("ngModel",a.fundingAmount)("step",1e3)("min",1)("max",a.totalBalance),e.xp6(3),e.hij("(Remaining Bal: ",e.lcZ(21,23,a.totalBalance-(a.fundingAmount?a.fundingAmount:0)),")"),e.xp6(4),e.Q6J("ngIf",null==a.amount.errors?null:a.amount.errors.required),e.xp6(1),e.Q6J("ngIf",null==a.amount.errors?null:a.amount.errors.max),e.xp6(2),e.Q6J("ngModel",a.isPrivate),e.xp6(6),e.Oqu(a.advancedTitle),e.xp6(4),e.Q6J("value",a.selTransType),e.xp6(1),e.Q6J("ngForOf",a.transTypes),e.xp6(2),e.Q6J("ngModel",a.transTypeValue)("required","0"!==a.selTransType)("disabled","0"===a.selTransType)("placeholder","0"===a.selTransType?"Default":"1"===a.selTransType?"Target Confirmation Blocks":"Fee (Sats/vByte)")("step",1)("min",0),e.xp6(2),e.Q6J("ngIf","0"!==a.selTransType&&!a.transTypeValue),e.xp6(3),e.Q6J("ngModel",a.spendUnconfirmed),e.xp6(2),e.Q6J("ngIf",""!==a.channelConnectionError)}},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,A.dn,c._Y,c.JL,c.F,m.O5,m.tP,f.KE,R.Nt,c.wV,c.qQ,c.Fd,c.Fj,$.q,De.F,c.Q7,c.JJ,c.On,f.bx,f.R9,re.Rr,H.ib,H.yz,H.yK,O.gD,m.sg,V.h,ne.ZL,c.oH,ne.XC,E.ey,f.TO,I.BN,X.d],pipes:[m.JJ,m.Ov],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),n})();var B=h(5615);const yi=["peersForm"],Zi=["stepper"];function bi(n,i){if(1&n&&e._uU(0),2&n){const t=e.oxw();e.Oqu(t.peerFormLabel)}}function Ai(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Address is required."),e.qZA())}function vi(n,i){if(1&n&&(e.TgZ(0,"div",37),e._UZ(1,"fa-icon",38),e.TgZ(2,"span"),e._uU(3),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(2),e.Oqu(t.peerConnectionError)}}function wi(n,i){if(1&n&&e._uU(0),2&n){const t=e.oxw();e.Oqu(t.channelFormLabel)}}function qi(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Amount is required."),e.qZA())}function Si(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Amount must be a positive number."),e.qZA())}function Li(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("Amount must be less than or equal to ",t.totalBalance,".")}}function ki(n,i){if(1&n&&(e.TgZ(0,"mat-option",39),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.name," ")}}function Fi(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("","0"===t.channelFormGroup.controls.selTransType.value?"Default":"1"===t.channelFormGroup.controls.selTransType.value?"Target Confirmation Blocks":"Fee (Sats/vByte)"," is required.")}}function Ni(n,i){if(1&n&&(e.TgZ(0,"div",37),e._UZ(1,"fa-icon",38),e.TgZ(2,"span"),e._uU(3),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(2),e.Oqu(t.channelConnectionError)}}let Oi=(()=>{class n{constructor(t,a,o,s,u,g,U){this.dialogRef=t,this.data=a,this.store=o,this.lndEffects=s,this.formBuilder=u,this.actions=g,this.logger=U,this.faExclamationTriangle=y.eHv,this.peerAddress="",this.totalBalance=0,this.transTypes=l.Dr,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 p.x,new p.x]}ngOnInit(){this.totalBalance=this.data.message.balance,this.peerFormGroup=this.formBuilder.group({hiddenAddress:["",[c.kI.required]],peerAddress:["",[c.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[c.kI.required,c.kI.min(1),c.kI.max(this.totalBalance)]],isPrivate:[!1],selTransType:[l.Dr[0].id],transTypeValue:[{value:"",disabled:!0}],spendUnconfirmed:[!1],hiddenAmount:["",[c.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.channelFormGroup.controls.selTransType.valueChanges.pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{t===l.Dr[0].id?(this.channelFormGroup.controls.transTypeValue.setValue(""),this.channelFormGroup.controls.transTypeValue.disable(),this.channelFormGroup.controls.transTypeValue.setValidators(null),this.channelFormGroup.controls.transTypeValue.setErrors(null)):(this.channelFormGroup.controls.transTypeValue.setValue(""),this.channelFormGroup.controls.transTypeValue.enable(),this.channelFormGroup.controls.transTypeValue.setValidators([c.kI.required]))}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,Q.h)(t=>t.type===l.uR.NEWLY_ADDED_PEER_LND||t.type===l.uR.FETCH_PENDING_CHANNELS_LND||t.type===l.uR.UPDATE_API_CALL_STATUS_LND)).subscribe(t=>{t.type===l.uR.NEWLY_ADDED_PEER_LND&&(this.logger.info(t.payload),this.flgEditable=!1,this.newlyAddedPeer=t.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),t.type===l.uR.FETCH_PENDING_CHANNELS_LND&&this.dialogRef.close(),t.type===l.uR.UPDATE_API_CALL_STATUS_LND&&t.payload.status===l.Bn.ERROR&&("SaveNewPeer"===t.payload.action||"FetchGraphNode"===t.payload.action?this.peerConnectionError=t.payload.message:"SaveNewChannel"===t.payload.action&&(this.channelConnectionError=t.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="";const t=this.peerFormGroup.controls.peerAddress.value.search("@");let a="",o="";t>-1?(a=this.peerFormGroup.controls.peerAddress.value.substring(0,t),o=this.peerFormGroup.controls.peerAddress.value.substring(t+1),this.connectPeerWithParams(a,o)):(this.store.dispatch((0,b.dV)({payload:{pubkey:this.peerFormGroup.controls.peerAddress.value}})),this.lndEffects.setGraphNode.pipe((0,G.q)(1)).subscribe(s=>{setTimeout(()=>{o=s.node.addresses&&s.node.addresses.length&&s.node.addresses.length>0&&s.node.addresses[0].addr?s.node.addresses[0].addr:"",this.connectPeerWithParams(this.peerFormGroup.controls.peerAddress.value,o)},0)}))}connectPeerWithParams(t,a){this.store.dispatch((0,b.El)({payload:{pubkey:t,host:a,perm:!1}}))}onOpenChannel(){if(!this.channelFormGroup.controls.fundingAmount.value||this.totalBalance-this.channelFormGroup.controls.fundingAmount.value<0||"1"===this.channelFormGroup.controls.selTransType.value&&!this.channelFormGroup.controls.transTypeValue.value||"2"===this.channelFormGroup.controls.selTransType.value&&!this.channelFormGroup.controls.transTypeValue.value)return!0;this.channelConnectionError="",this.store.dispatch((0,b.YX)({payload:{selectedPeerPubkey:this.newlyAddedPeer.pub_key,fundingAmount:this.channelFormGroup.controls.fundingAmount.value,private:this.channelFormGroup.controls.isPrivate.value,transType:this.channelFormGroup.controls.selTransType.value,transTypeValue:this.channelFormGroup.controls.transTypeValue.value,spendUnconfirmed:this.channelFormGroup.controls.spendUnconfirmed.value}}))}onClose(){this.dialogRef.close(!1)}stepSelectionChanged(t){switch(t.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:"Peer Details",this.channelFormLabel="Open Channel (Optional)";break;case 2:this.peerFormLabel=this.peerFormGroup.controls.peerAddress.value?"Peer Added: "+this.newlyAddedPeer.alias:"Peer Details",this.channelFormLabel=this.channelFormGroup.controls.fundingAmount.value?"Opening Channel for "+this.channelFormGroup.controls.fundingAmount.value+" Sats":"Open Channel (Optional)"}t.selectedIndex<t.previouslySelectedIndex&&(0===t.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===t.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(w.yh),e.Y36(ee.l),e.Y36(c.qu),e.Y36(z.eX),e.Y36(F.mQ))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-connect-peer"]],viewQuery:function(t,a){if(1&t&&(e.Gf(yi,5),e.Gf(Zi,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.form=o.first),e.iGM(o=e.CRH())&&(a.stepper=o.first)}},decls:56,vars:24,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],[3,"linear","selectionChange"],["stepper",""],[3,"stepControl","editable"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"my-1",3,"formGroup"],["matStepLabel",""],["autoFocus","","matInput","","placeholder","Lightning Address (pubkey OR pubkey@ip:port)","formControlName","peerAddress","tabindex","1","required",""],[4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mb-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex","60","fxLayoutAlign","start end"],["matInput","","formControlName","fundingAmount","placeholder","Amount","type","number","tabindex","1","required","",3,"step"],["matSuffix",""],["fxFlex","35","fxLayoutAlign","start center"],["tabindex","2","color","primary","formControlName","isPrivate","name","isPrivate"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center",1,"mt-1"],["fxFlex","30","fxLayoutAlign","start end"],["tabindex","3","formControlName","selTransType","placeholder","Transaction Type"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","30"],["matInput","","formControlName","transTypeValue","type","number","name","transTypeValue","tabindex","4",3,"placeholder","step","required"],["tabindex","6","color","primary","formControlName","spendUnconfirmed","name","spendUnconfirmed"],["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,"mat-dialog-close"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],[3,"value"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5,"Connect to a new peer"),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e.NdJ("click",function(){return a.onClose()}),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"div",7),e.TgZ(10,"mat-vertical-stepper",8,9),e.NdJ("selectionChange",function(s){return a.stepSelectionChanged(s)}),e.TgZ(12,"mat-step",10),e.TgZ(13,"form",11),e.YNc(14,bi,1,1,"ng-template",12),e.TgZ(15,"mat-form-field",1),e._UZ(16,"input",13),e.YNc(17,Ai,2,0,"mat-error",14),e.qZA(),e.YNc(18,vi,4,2,"div",15),e.TgZ(19,"div",16),e.TgZ(20,"button",17),e.NdJ("click",function(){return a.onConnectPeer()}),e._uU(21),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(22,"mat-step",10),e.TgZ(23,"form",18),e.YNc(24,wi,1,1,"ng-template",19),e.TgZ(25,"div",20),e.TgZ(26,"div",21),e.TgZ(27,"mat-form-field",22),e._UZ(28,"input",23),e.TgZ(29,"mat-hint"),e._uU(30),e.qZA(),e.TgZ(31,"span",24),e._uU(32," Sats "),e.qZA(),e.YNc(33,qi,2,0,"mat-error",14),e.YNc(34,Si,2,0,"mat-error",14),e.YNc(35,Li,2,1,"mat-error",14),e.qZA(),e.TgZ(36,"div",25),e.TgZ(37,"mat-slide-toggle",26),e._uU(38,"Private Channel"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(39,"div",27),e.TgZ(40,"mat-form-field",28),e.TgZ(41,"mat-select",29),e.YNc(42,ki,2,2,"mat-option",30),e.qZA(),e.qZA(),e.TgZ(43,"mat-form-field",31),e._UZ(44,"input",32),e.YNc(45,Fi,2,1,"mat-error",14),e.qZA(),e.TgZ(46,"div",25),e.TgZ(47,"mat-slide-toggle",33),e._uU(48,"Spend Unconfirmed Output"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(49,Ni,4,2,"div",15),e.TgZ(50,"div",16),e.TgZ(51,"button",34),e.NdJ("click",function(){return a.onOpenChannel()}),e._uU(52),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(53,"div",35),e.TgZ(54,"button",36),e._uU(55),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(10),e.Q6J("linear",!0),e.xp6(2),e.Q6J("stepControl",a.peerFormGroup)("editable",a.flgEditable),e.xp6(1),e.Q6J("formGroup",a.peerFormGroup),e.xp6(4),e.Q6J("ngIf",null==a.peerFormGroup.controls.peerAddress.errors?null:a.peerFormGroup.controls.peerAddress.errors.required),e.xp6(1),e.Q6J("ngIf",""!==a.peerConnectionError),e.xp6(3),e.Oqu(""!==a.peerConnectionError?"Retry":"Add Peer"),e.xp6(1),e.Q6J("stepControl",a.channelFormGroup)("editable",a.flgEditable),e.xp6(1),e.Q6J("formGroup",a.channelFormGroup),e.xp6(5),e.Q6J("step",1e3),e.xp6(2),e.hij("Remaining Bal: ",a.totalBalance-(a.channelFormGroup.controls.fundingAmount.value?a.channelFormGroup.controls.fundingAmount.value:0),""),e.xp6(3),e.Q6J("ngIf",null==a.channelFormGroup.controls.fundingAmount.errors?null:a.channelFormGroup.controls.fundingAmount.errors.required),e.xp6(1),e.Q6J("ngIf",null==a.channelFormGroup.controls.fundingAmount.errors?null:a.channelFormGroup.controls.fundingAmount.errors.min),e.xp6(1),e.Q6J("ngIf",null==a.channelFormGroup.controls.fundingAmount.errors?null:a.channelFormGroup.controls.fundingAmount.errors.max),e.xp6(7),e.Q6J("ngForOf",a.transTypes),e.xp6(2),e.Q6J("placeholder","0"===a.channelFormGroup.controls.selTransType.value?"Default":"1"===a.channelFormGroup.controls.selTransType.value?"Target Confirmation Blocks":"Fee (Sats/vByte)")("step",1)("required","0"!==a.channelFormGroup.controls.selTransType.value),e.xp6(1),e.Q6J("ngIf",null==a.channelFormGroup.controls.transTypeValue.errors?null:a.channelFormGroup.controls.transTypeValue.errors.required),e.xp6(4),e.Q6J("ngIf",""!==a.channelConnectionError),e.xp6(3),e.Oqu(""!==a.channelConnectionError?"Retry":"Open Channel"),e.xp6(2),e.Q6J("mat-dialog-close",!1),e.xp6(1),e.Oqu(null!=a.newlyAddedPeer&&a.newlyAddedPeer.pub_key?"Do It Later":"Close"))},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,A.dn,B.Vq,B.C0,c._Y,c.JL,c.sg,B.VY,f.KE,R.Nt,c.Fj,V.h,c.JJ,c.u,c.Q7,m.O5,c.wV,f.bx,f.R9,re.Rr,O.gD,m.sg,J.ZT,f.TO,I.BN,E.ey],styles:[""]}),n})();function Ui(n,i){1&n&&e._UZ(0,"mat-progress-bar",32)}function Ri(n,i){1&n&&(e.TgZ(0,"th",33),e._uU(1," Alias "),e.qZA())}const Me=function(n){return{"max-width":n}};function Ii(n,i){if(1&n&&(e.TgZ(0,"td",34),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,Me,a.screenSize===a.screenSizeEnum.XS?"12rem":"25rem")),e.xp6(1),e.hij(" ",null==t?null:t.alias," ")}}function Di(n,i){1&n&&(e.TgZ(0,"th",33),e._uU(1," Public Key "),e.qZA())}function Pi(n,i){if(1&n&&(e.TgZ(0,"td",34),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,Me,a.screenSize===a.screenSizeEnum.XS?"5rem":"35rem")),e.xp6(1),e.hij(" ",null==t?null:t.pub_key," ")}}function Mi(n,i){1&n&&(e.TgZ(0,"th",35),e._uU(1," Sats Sent "),e.qZA())}function Ji(n,i){if(1&n&&(e.TgZ(0,"td",36),e.TgZ(1,"span",37),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.sat_sent)," ")}}function Qi(n,i){1&n&&(e.TgZ(0,"th",35),e._uU(1," Sats Received "),e.qZA())}function Ei(n,i){if(1&n&&(e.TgZ(0,"td",36),e.TgZ(1,"span",37),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.sat_recv)," ")}}function Yi(n,i){1&n&&(e.TgZ(0,"th",35),e._uU(1," Ping "),e.qZA())}function Bi(n,i){if(1&n&&(e.TgZ(0,"td",36),e.TgZ(1,"span",37),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.ping_time)," ")}}function Hi(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",38),e.TgZ(1,"div",39),e.TgZ(2,"mat-select",40),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",41),e.NdJ("click",function(){return e.CHM(t),e.oxw().onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function Gi(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",42),e.TgZ(1,"div",39),e.TgZ(2,"mat-select",40),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",41),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw().onPeerClick(u,o)}),e._uU(5,"View Info"),e.qZA(),e.TgZ(6,"mat-option",41),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onOpenChannel(s)}),e._uU(7,"Open Channel"),e.qZA(),e.TgZ(8,"mat-option",41),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onPeerDetach(s)}),e._uU(9,"Disconnect"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function zi(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No connected peer."),e.qZA())}function Vi(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting peers..."),e.qZA())}function Wi(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function Xi(n,i){if(1&n&&(e.TgZ(0,"td",43),e.YNc(1,zi,2,0,"p",44),e.YNc(2,Vi,2,0,"p",44),e.YNc(3,Wi,2,1,"p",44),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!(null!=t.peers&&t.peers.data)||(null==t.peers.data?null:t.peers.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.peers&&t.peers.data)||(null==t.peers.data?null:t.peers.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.peers&&t.peers.data)||(null==t.peers.data?null:t.peers.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const $i=function(n){return{"display-none":n}};function ji(n,i){if(1&n&&e._UZ(0,"tr",45),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,$i,(null==t.peers?null:t.peers.data)&&(null==t.peers||null==t.peers.data?null:t.peers.data.length)>0))}}function Ki(n,i){1&n&&e._UZ(0,"tr",46)}function eo(n,i){1&n&&e._UZ(0,"tr",47)}const to=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},no=function(){return["no_peer"]};let ao=(()=>{class n{constructor(t,a,o,s){this.logger=t,this.store=a,this.rtlEffects=o,this.commonService=s,this.availableBalance=0,this.faUsers=y.FVb,this.displayedColumns=[],this.peersData=[],this.information={},this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","sat_sent","sat_recv","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["alias","sat_sent","sat_recv","ping_time","actions"]):(this.flgSticky=!0,this.displayedColumns=["alias","pub_key","sat_sent","sat_recv","ping_time","actions"])}ngOnInit(){this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.information=t}),this.store.select(C.qU).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.availableBalance=t.blockchainBalance.total_balance||0}),this.store.select(C.Wi).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.peersData=t.peers,this.peersData.length>0&&this.loadPeersTable(this.peersData),this.logger.info(t)})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:t.pub_key,message:[[{key:"pub_key",value:t.pub_key,title:"Public Key",width:100}],[{key:"address",value:t.address,title:"Address",width:100}],[{key:"alias",value:t.alias,title:"Alias",width:40},{key:"inbound",value:t.inbound?"True":"False",title:"Inbound",width:30},{key:"ping_time",value:t.ping_time,title:"Ping Time",width:30,type:l.Gi.NUMBER}],[{key:"sat_sent",value:t.sat_sent,title:"Satoshis Sent",width:50,type:l.Gi.NUMBER},{key:"sat_recv",value:t.sat_recv,title:"Satoshis Received",width:50,type:l.Gi.NUMBER}],[{key:"bytes_sent",value:t.bytes_sent,title:"Bytes Sent",width:50,type:l.Gi.NUMBER},{key:"bytes_recv",value:t.bytes_recv,title:"Bytes Received",width:50,type:l.Gi.NUMBER}]]}}}))}onConnectPeer(){this.store.dispatch((0,v.qR)({payload:{data:{message:{peer:null,information:this.information,balance:this.availableBalance},component:Oi}}}))}onOpenChannel(t){this.store.dispatch((0,v.qR)({payload:{data:{alertTitle:"Open Channel",message:{peer:t,information:this.information,balance:this.availableBalance},component:Pe}}}))}onPeerDetach(t){this.store.dispatch((0,v.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(t.alias?t.alias:t.pub_key),noBtnText:"Cancel",yesBtnText:"Disconnect"}}})),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[3])).subscribe(o=>{o&&this.store.dispatch((0,b.z)({payload:{pubkey:t.pub_key}}))})}applyFilter(){this.peers.filter=this.selFilter.trim().toLowerCase()}loadPeersTable(t){this.peers=new r.by(t?[...t]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.peers.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.peers.paginator=this.paginator,this.applyFilter()}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(ie.V),e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-peers"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Peers")}])],decls:40,vars:15,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column"],["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","30","fxLayoutAlign","start end"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","pub_key"],["matColumnDef","sat_sent"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","sat_recv"],["matColumnDef","ping_time"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","px-3",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"px-3"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"button",2),e.NdJ("click",function(){return a.onConnectPeer()}),e._uU(3,"Add Peer"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"div",4),e.TgZ(6,"div",5),e._UZ(7,"fa-icon",6),e.TgZ(8,"span",7),e._uU(9,"Connected Peers"),e.qZA(),e.qZA(),e.TgZ(10,"mat-form-field",8),e.TgZ(11,"input",9),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(12,"div",10),e.YNc(13,Ui,1,0,"mat-progress-bar",11),e.TgZ(14,"table",12,13),e.ynx(16,14),e.YNc(17,Ri,2,0,"th",15),e.YNc(18,Ii,2,4,"td",16),e.BQk(),e.ynx(19,17),e.YNc(20,Di,2,0,"th",15),e.YNc(21,Pi,2,4,"td",16),e.BQk(),e.ynx(22,18),e.YNc(23,Mi,2,0,"th",19),e.YNc(24,Ji,4,3,"td",20),e.BQk(),e.ynx(25,21),e.YNc(26,Qi,2,0,"th",19),e.YNc(27,Ei,4,3,"td",20),e.BQk(),e.ynx(28,22),e.YNc(29,Yi,2,0,"th",19),e.YNc(30,Bi,4,3,"td",20),e.BQk(),e.ynx(31,23),e.YNc(32,Hi,6,0,"th",24),e.YNc(33,Gi,10,0,"td",25),e.BQk(),e.ynx(34,26),e.YNc(35,Xi,4,3,"td",27),e.BQk(),e.YNc(36,ji,1,3,"tr",28),e.YNc(37,Ki,1,0,"tr",29),e.YNc(38,eo,1,0,"tr",30),e.qZA(),e.qZA(),e._UZ(39,"mat-paginator",31),e.qZA(),e.qZA()),2&t&&(e.xp6(7),e.Q6J("icon",a.faUsers),e.xp6(4),e.Q6J("ngModel",a.selFilter),e.xp6(2),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.peers)("ngClass",e.VKq(12,to,""!==a.errorMessage)),e.xp6(22),e.Q6J("matFooterRowDef",e.DdM(14,no)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,_.yH,_.Wh,L.lW,I.BN,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,m.O5,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,O.gD,O.$L,E.ey,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-alias[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-pub_key[_ngcontent-%COMP%]{flex:1 1 35%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:2rem}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem;flex:1 1 10%}.mat-column-sat_sent[_ngcontent-%COMP%], .mat-column-sat_recv[_ngcontent-%COMP%], .mat-column-ping_time[_ngcontent-%COMP%]{flex:1 1 13%;width:13%}"]}),n})();function io(n,i){if(1&n&&(e.TgZ(0,"span",7),e._uU(1,"Open"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.numOpenChannels)}}function oo(n,i){if(1&n&&(e.TgZ(0,"span",7),e._uU(1,"Pending"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.numPendingChannels)}}function so(n,i){if(1&n&&(e.TgZ(0,"span",7),e._uU(1,"Closed"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.numClosedChannels)}}function lo(n,i){if(1&n&&(e.TgZ(0,"span",7),e._uU(1,"Active HTLCs"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.numActiveHTLCs)}}let ro=(()=>{class n{constructor(t,a,o){this.logger=t,this.store=a,this.router=o,this.numOpenChannels=0,this.numPendingChannels=0,this.numClosedChannels=0,this.numActiveHTLCs=0,this.peers=[],this.information={},this.totalBalance=0,this.links=[{link:"open",name:"Open"},{link:"pending",name:"Pending"},{link:"closed",name:"Closed"},{link:"activehtlcs",name:"Active HTLCs"}],this.activeLink=0,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.activeLink=this.links.findIndex(t=>t.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(t=>t instanceof T.Av)).subscribe(t=>{this.activeLink=this.links.findIndex(a=>a.link===t.urlAfterRedirects.substring(t.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.information=t}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.numOpenChannels=t.channels&&t.channels.length?t.channels.length:0,this.numActiveHTLCs=t.channels.reduce((a,o)=>a+(o.pending_htlcs&&o.pending_htlcs.length>0?o.pending_htlcs.length:0),0),this.logger.info(t)}),this.store.select(C.ni).pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{this.numPendingChannels=t.pendingChannelsSummary.total_channels?t.pendingChannelsSummary.total_channels:0}),this.store.select(C.P2).pipe((0,d.R)(this.unSubs[4])).subscribe(t=>{this.numClosedChannels=t.closedChannels&&t.closedChannels.length?t.closedChannels.length:0}),this.store.select(C.qU).pipe((0,d.R)(this.unSubs[5])).subscribe(t=>{this.totalBalance=+t.blockchainBalance.total_balance}),this.store.select(C.Wi).pipe((0,d.R)(this.unSubs[6])).subscribe(t=>{this.peers=t.peers,this.peers.forEach(a=>{(!a.alias||""===a.alias)&&(a.alias=a.pub_key.substring(0,15)+"...")}),this.logger.info(t)})}onOpenChannel(){this.store.dispatch((0,v.qR)({payload:{data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:Pe}}}))}onSelectedTabChange(t){this.router.navigateByUrl("/lnd/connections/channels/"+this.links[t.index].link)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channels-tables"]],decls:16,vars:1,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x"],["fxLayout","row"],["mat-flat-button","","color","primary","type","submit","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100",1,"my-2","bordered-box"],[3,"selectedIndex","selectedIndexChange","selectedTabChange"],["mat-tab-label",""],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"button",2),e.NdJ("click",function(){return a.onOpenChannel()}),e._uU(3,"Open Channel"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-tab-group",4),e.NdJ("selectedIndexChange",function(s){return a.activeLink=s})("selectedTabChange",function(s){return a.onSelectedTabChange(s)}),e.TgZ(6,"mat-tab"),e.YNc(7,io,2,1,"ng-template",5),e.qZA(),e.TgZ(8,"mat-tab"),e.YNc(9,oo,2,1,"ng-template",5),e.qZA(),e.TgZ(10,"mat-tab"),e.YNc(11,so,2,1,"ng-template",5),e.qZA(),e.TgZ(12,"mat-tab"),e.YNc(13,lo,2,1,"ng-template",5),e.qZA(),e.qZA(),e.TgZ(14,"div",6),e._UZ(15,"router-outlet"),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(5),e.Q6J("selectedIndex",a.activeLink))},directives:[_.xw,_.yH,_.Wh,L.lW,D.SP,D.uX,D.uD,T.lC,he.k],styles:[""]}),n})();var te=h(7261),oe=h(6895);function co(n,i){if(1&n&&(e.TgZ(0,"div"),e.TgZ(1,"div",9),e.TgZ(2,"div",14),e.TgZ(3,"h4",11),e._uU(4,"Commit Fee"),e.qZA(),e.TgZ(5,"span",15),e._uU(6),e.ALo(7,"number"),e.qZA(),e.qZA(),e.TgZ(8,"div",14),e.TgZ(9,"h4",11),e._uU(10,"Commit Weight"),e.qZA(),e.TgZ(11,"span",15),e._uU(12),e.ALo(13,"number"),e.qZA(),e.qZA(),e.TgZ(14,"div",14),e.TgZ(15,"h4",11),e._uU(16,"Fee/KW"),e.qZA(),e.TgZ(17,"span",15),e._uU(18),e.ALo(19,"number"),e.qZA(),e.qZA(),e.TgZ(20,"div",14),e.TgZ(21,"h4",11),e._uU(22,"Static Remote Key"),e.qZA(),e.TgZ(23,"span",15),e._uU(24),e.qZA(),e.qZA(),e.qZA(),e._UZ(25,"mat-divider",13),e.TgZ(26,"div",9),e.TgZ(27,"div",14),e.TgZ(28,"h4",11),e._uU(29),e.qZA(),e.TgZ(30,"span",15),e._uU(31),e.ALo(32,"number"),e.qZA(),e.qZA(),e.TgZ(33,"div",14),e.TgZ(34,"h4",11),e._uU(35),e.qZA(),e.TgZ(36,"span",15),e._uU(37),e.ALo(38,"number"),e.qZA(),e.qZA(),e.TgZ(39,"div",14),e.TgZ(40,"h4",11),e._uU(41,"Unsettled Balance"),e.qZA(),e.TgZ(42,"span",15),e._uU(43),e.ALo(44,"number"),e.qZA(),e.qZA(),e.TgZ(45,"div",14),e.TgZ(46,"h4",11),e._uU(47,"CSV Delay"),e.qZA(),e.TgZ(48,"span",15),e._uU(49),e.ALo(50,"number"),e.qZA(),e.qZA(),e.qZA(),e._UZ(51,"mat-divider",13),e.TgZ(52,"div",9),e.TgZ(53,"div",14),e.TgZ(54,"h4",11),e._uU(55,"Local Reserve (Sats)"),e.qZA(),e.TgZ(56,"span",15),e._uU(57),e.ALo(58,"number"),e.qZA(),e.qZA(),e.TgZ(59,"div",14),e.TgZ(60,"h4",11),e._uU(61,"Remote Reserve (Sats)"),e.qZA(),e.TgZ(62,"span",15),e._uU(63),e.ALo(64,"number"),e.qZA(),e.qZA(),e.TgZ(65,"div",14),e.TgZ(66,"h4",11),e._uU(67,"Lifetime (Seconds)"),e.qZA(),e.TgZ(68,"span",15),e._uU(69),e.ALo(70,"number"),e.qZA(),e.qZA(),e.TgZ(71,"div",14),e.TgZ(72,"h4",11),e._uU(73,"Pending HTLCs"),e.qZA(),e.TgZ(74,"span",15),e._uU(75),e.ALo(76,"number"),e.qZA(),e.qZA(),e.qZA(),e._UZ(77,"mat-divider",13),e.qZA()),2&n){const t=e.oxw();e.xp6(6),e.Oqu(e.lcZ(7,17,t.channel.commit_fee)),e.xp6(6),e.Oqu(e.lcZ(13,19,t.channel.commit_weight)),e.xp6(6),e.Oqu(e.lcZ(19,21,t.channel.fee_per_kw)),e.xp6(6),e.Oqu(t.channel.static_remote_key?"Yes":"No"),e.xp6(1),e.Q6J("inset",!0),e.xp6(4),e.Oqu(t.screenSize===t.screenSizeEnum.XS?"Total Sats Sent":"Total Satoshis Sent"),e.xp6(2),e.Oqu(e.lcZ(32,23,t.channel.total_satoshis_sent)),e.xp6(4),e.Oqu(t.screenSize===t.screenSizeEnum.XS?"Total Sats Recv":"Total Satoshis Received"),e.xp6(2),e.Oqu(e.lcZ(38,25,t.channel.total_satoshis_received)),e.xp6(6),e.Oqu(e.lcZ(44,27,t.channel.unsettled_balance)),e.xp6(6),e.Oqu(e.lcZ(50,29,t.channel.csv_delay)),e.xp6(2),e.Q6J("inset",!0),e.xp6(6),e.Oqu(e.lcZ(58,31,t.channel.local_chan_reserve_sat)),e.xp6(6),e.Oqu(e.lcZ(64,33,t.channel.remote_chan_reserve_sat)),e.xp6(6),e.Oqu(e.lcZ(70,35,t.channel.lifetime)),e.xp6(6),e.Oqu(e.lcZ(76,37,null==t.channel||null==t.channel.pending_htlcs?null:t.channel.pending_htlcs.length)),e.xp6(2),e.Q6J("inset",!0)}}function uo(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Show Advanced"),e.qZA())}function po(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Hide Advanced"),e.qZA())}function mo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",23),e.NdJ("copied",function(o){return e.CHM(t),e.oxw().onCopyChanID(o)}),e._uU(1,"Copy Channel ID"),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("payload",t.channel.chan_id)}}function _o(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",24),e.NdJ("click",function(){return e.CHM(t),e.oxw().onClose()}),e._uU(1,"OK"),e.qZA()}}const ho=function(n){return{"xs-scroll-y":n}};let fe=(()=>{class n{constructor(t,a,o,s,u){this.dialogRef=t,this.data=a,this.logger=o,this.commonService=s,this.snackBar=u,this.faReceipt=y.dLy,this.showAdvanced=!1,this.showCopy=!0,this.showCopyField=null,this.screenSize="",this.screenSizeEnum=l.cu}ngOnInit(){this.channel=this.data.channel,this.showCopy=this.data.showCopy,this.screenSize=this.commonService.getScreenSize()}onClose(){this.dialogRef.close(!1)}onShowAdvanced(){this.showAdvanced=!this.showAdvanced}onCopyChanID(t){this.snackBar.open("Channel ID "+t+" copied."),this.logger.info("Copied Text: "+t)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(F.mQ),e.Y36(P.v),e.Y36(te.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-information"]],decls:94,vars:36,consts:[["fxLayout","column","fxLayout.gt-sm","row","fxLayoutAlign","space-between stretch"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["tabindex","3","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large",3,"ngClass"],["fxLayout","column"],["fxLayout","row"],["fxFlex","50"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],["fxFlex","25"],[1,"overflow-wrap","foreground-secondary-text"],[4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center","fxFlex","100",1,"mt-1"],["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",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","button",3,"click",4,"ngIf"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-button","","color","primary","tabindex","2","type","button",3,"click"]],template:function(t,a){if(1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e._UZ(4,"fa-icon",4),e.TgZ(5,"span",5),e._uU(6,"Channel Information"),e.qZA(),e.qZA(),e.TgZ(7,"button",6),e.NdJ("click",function(){return a.onClose()}),e._uU(8,"X"),e.qZA(),e.qZA(),e.TgZ(9,"mat-card-content",7),e.TgZ(10,"div",8),e.TgZ(11,"div",9),e.TgZ(12,"div",10),e.TgZ(13,"h4",11),e._uU(14,"Channel ID"),e.qZA(),e.TgZ(15,"span",12),e._uU(16),e.qZA(),e.qZA(),e.TgZ(17,"div",10),e.TgZ(18,"h4",11),e._uU(19,"Peer Alias"),e.qZA(),e.TgZ(20,"span",12),e._uU(21),e.qZA(),e.qZA(),e.qZA(),e._UZ(22,"mat-divider",13),e.TgZ(23,"div",9),e.TgZ(24,"div",1),e.TgZ(25,"h4",11),e._uU(26,"Channel Point"),e.qZA(),e.TgZ(27,"span",12),e._uU(28),e.qZA(),e.qZA(),e.qZA(),e._UZ(29,"mat-divider",13),e.TgZ(30,"div",9),e.TgZ(31,"div",1),e.TgZ(32,"h4",11),e._uU(33,"Peer Public Key"),e.qZA(),e.TgZ(34,"span",12),e._uU(35),e.qZA(),e.qZA(),e.qZA(),e._UZ(36,"mat-divider",13),e.TgZ(37,"div",9),e.TgZ(38,"div",14),e.TgZ(39,"h4",11),e._uU(40,"Local Balance"),e.qZA(),e.TgZ(41,"span",15),e._uU(42),e.ALo(43,"number"),e.qZA(),e.qZA(),e.TgZ(44,"div",14),e.TgZ(45,"h4",11),e._uU(46,"Remote Balance"),e.qZA(),e.TgZ(47,"span",15),e._uU(48),e.ALo(49,"number"),e.qZA(),e.qZA(),e.TgZ(50,"div",14),e.TgZ(51,"h4",11),e._uU(52,"Capacity"),e.qZA(),e.TgZ(53,"span",15),e._uU(54),e.ALo(55,"number"),e.qZA(),e.qZA(),e.TgZ(56,"div",14),e.TgZ(57,"h4",11),e._uU(58,"Uptime (Seconds)"),e.qZA(),e.TgZ(59,"span",15),e._uU(60),e.ALo(61,"number"),e.qZA(),e.qZA(),e.qZA(),e._UZ(62,"mat-divider",13),e.TgZ(63,"div",9),e.TgZ(64,"div",14),e.TgZ(65,"h4",11),e._uU(66,"Active"),e.qZA(),e.TgZ(67,"span",15),e._uU(68),e.qZA(),e.qZA(),e.TgZ(69,"div",14),e.TgZ(70,"h4",11),e._uU(71,"Private"),e.qZA(),e.TgZ(72,"span",15),e._uU(73),e.qZA(),e.qZA(),e.TgZ(74,"div",14),e.TgZ(75,"h4",11),e._uU(76,"Initiator"),e.qZA(),e.TgZ(77,"span",15),e._uU(78),e.qZA(),e.qZA(),e.TgZ(79,"div",14),e.TgZ(80,"h4",11),e._uU(81,"Number of Updates"),e.qZA(),e.TgZ(82,"span",15),e._uU(83),e.ALo(84,"number"),e.qZA(),e.qZA(),e.qZA(),e._UZ(85,"mat-divider",13),e.YNc(86,co,78,39,"div",16),e.TgZ(87,"div",17),e.TgZ(88,"button",18),e.NdJ("click",function(){return a.onShowAdvanced()}),e.YNc(89,uo,2,0,"p",19),e.YNc(90,po,2,0,"ng-template",null,20,e.W1O),e.qZA(),e.YNc(92,mo,2,1,"button",21),e.YNc(93,_o,2,0,"button",22),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t){const o=e.MAs(91);e.xp6(4),e.Q6J("icon",a.faReceipt),e.xp6(5),e.Q6J("ngClass",e.VKq(34,ho,a.screenSize===a.screenSizeEnum.XS)),e.xp6(7),e.Oqu(a.channel.chan_id),e.xp6(5),e.Oqu(a.channel.remote_alias),e.xp6(1),e.Q6J("inset",!0),e.xp6(6),e.Oqu(a.channel.channel_point),e.xp6(1),e.Q6J("inset",!0),e.xp6(6),e.Oqu(a.channel.remote_pubkey),e.xp6(1),e.Q6J("inset",!0),e.xp6(6),e.Oqu(e.lcZ(43,24,a.channel.local_balance)),e.xp6(6),e.Oqu(e.lcZ(49,26,a.channel.remote_balance)),e.xp6(6),e.Oqu(e.lcZ(55,28,a.channel.capacity)),e.xp6(6),e.Oqu(e.lcZ(61,30,a.channel.uptime)),e.xp6(2),e.Q6J("inset",!0),e.xp6(6),e.Oqu(a.channel.active?"Yes":"No"),e.xp6(5),e.Oqu(a.channel.private?"Yes":"No"),e.xp6(5),e.Oqu(a.channel.initiator?"Yes":"No"),e.xp6(5),e.Oqu(e.lcZ(84,32,a.channel.num_updates)),e.xp6(2),e.Q6J("inset",!0),e.xp6(1),e.Q6J("ngIf",a.showAdvanced),e.xp6(3),e.Q6J("ngIf",!a.showAdvanced)("ngIfElse",o),e.xp6(3),e.Q6J("ngIf",a.showCopy),e.xp6(1),e.Q6J("ngIf",!a.showCopy)}},directives:[_.xw,_.Wh,_.yH,A.dk,I.BN,L.lW,A.dn,m.mk,S.oO,X.d,m.O5,V.h,oe.y],pipes:[m.JJ],styles:[""]}),n})();var Ce=h(9646);const go=["stepper"];function fo(n,i){if(1&n&&e._uU(0),2&n){const t=e.oxw();e.Oqu(t.inputFormLabel)}}function Co(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Amount is required."),e.qZA())}function xo(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Amount must be a positive number."),e.qZA())}function To(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("Amount must be less than or equal to ",null==t.selChannel?null:t.selChannel.local_balance,".")}}function yo(n,i){if(1&n&&(e.TgZ(0,"mat-option",52),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t.remote_alias||t.chan_id)}}function Zo(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Receive from Peer is required."),e.qZA())}function bo(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Receive from Peer not found in the list."),e.qZA())}function Ao(n,i){if(1&n&&e._uU(0),2&n){const t=e.oxw();e.Oqu(t.feeFormLabel)}}function vo(n,i){if(1&n&&(e.TgZ(0,"mat-option",52),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.hij(" ",t.name," ")}}function wo(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("",t.feeFormGroup.controls.selFeeLimitType.value?t.feeFormGroup.controls.selFeeLimitType.value.placeholder:t.feeLimitTypes[0].placeholder," is required.")}}function qo(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("",t.feeFormGroup.controls.selFeeLimitType.value?t.feeFormGroup.controls.selFeeLimitType.value.placeholder:t.feeLimitTypes[0].placeholder," must be a positive number.")}}function So(n,i){1&n&&e._uU(0,"Invoice/Payment")}function Lo(n,i){1&n&&(e.TgZ(0,"mat-icon",53),e._uU(1,"check"),e.qZA())}function ko(n,i){1&n&&e._UZ(0,"mat-progress-bar",54)}function Fo(n,i){if(1&n&&(e.TgZ(0,"mat-icon",53),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(null!=t.paymentStatus&&t.paymentStatus.error?"close":"check")}}function No(n,i){1&n&&e._UZ(0,"div",7)}function Oo(n,i){1&n&&e._UZ(0,"mat-progress-bar",54)}function Uo(n,i){if(1&n&&(e.TgZ(0,"h4",55),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.paymentStatus&&t.paymentStatus.payment_hash?"Rebalance Successful.":"Rebalance Failed.")}}function Ro(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",56),e.NdJ("click",function(){return e.CHM(t),e.oxw().onRestart()}),e._uU(1,"Start Again"),e.qZA()}}function Io(n,i){1&n&&e.GkF(0)}function Do(n,i){if(1&n&&e.YNc(0,Io,1,0,"ng-container",57),2&n){const t=e.oxw(),a=e.MAs(98),o=e.MAs(100);e.Q6J("ngTemplateOutlet",t.paymentStatus.error?a:o)}}function Po(n,i){if(1&n&&(e.TgZ(0,"div",7),e.TgZ(1,"span",40),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.hij("Error: ",t.paymentStatus.error,"")}}function Mo(n,i){if(1&n&&(e.TgZ(0,"div",7),e.TgZ(1,"div",0),e.TgZ(2,"div",1),e.TgZ(3,"h4",58),e._uU(4,"Payment Hash"),e.qZA(),e.TgZ(5,"span",40),e._uU(6),e.qZA(),e.qZA(),e.qZA(),e._UZ(7,"mat-divider",59),e.TgZ(8,"div",0),e.TgZ(9,"div",60),e.TgZ(10,"h4",58),e._uU(11),e.qZA(),e.TgZ(12,"span",40),e._uU(13),e.qZA(),e.qZA(),e.TgZ(14,"div",60),e.TgZ(15,"h4",58),e._uU(16,"Number of Hops"),e.qZA(),e.TgZ(17,"span",40),e._uU(18),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(6),e.Oqu(t.paymentStatus.payment_hash),e.xp6(5),e.hij("Total Fees (",t.paymentStatus.payment_route.total_fees_msat?"mSats":"Sats",")"),e.xp6(2),e.Oqu(t.paymentStatus.payment_route.total_fees_msat?t.paymentStatus.payment_route.total_fees_msat:t.paymentStatus.payment_route.total_fees?t.paymentStatus.payment_route.total_fees:0),e.xp6(5),e.Oqu(t.paymentStatus&&t.paymentStatus.payment_route&&t.paymentStatus.payment_route.hops&&t.paymentStatus.payment_route.hops.length?t.paymentStatus.payment_route.hops.length:0)}}let Jo=(()=>{class n{constructor(t,a,o,s,u,g,U){this.dialogRef=t,this.data=a,this.logger=o,this.store=s,this.actions=u,this.formBuilder=g,this.decimalPipe=U,this.faInfoCircle=y.sqG,this.invoices={},this.selChannel={},this.activeChannels=[],this.feeLimitTypes=[],this.queryRoute={},this.paymentRequest="",this.paymentStatus=null,this.flgReusingInvoice=!1,this.flgInvoiceGenerated=!1,this.flgPaymentSent=!1,this.inputFormLabel="Amount to rebalance",this.feeFormLabel="Select rebalance fee",this.flgEditable=!0,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){let t="",a="";this.selChannel=this.data.message.selChannel,this.activeChannels=this.data.message.channels.filter(o=>o.active&&o.chan_id!==this.selChannel.chan_id&&o.remote_balance>0),this.activeChannels=this.activeChannels.sort((o,s)=>(t=o.remote_alias?o.remote_alias.toLowerCase():o.chan_id?o.chan_id.toLowerCase():"",a=s.remote_alias?s.remote_alias.toLowerCase():o.chan_id.toLowerCase(),t<a?-1:t>a?1:0)),l.Vc.forEach((o,s)=>{s>0&&this.feeLimitTypes.push(o)}),this.inputFormGroup=this.formBuilder.group({hiddenAmount:["",[c.kI.required]],rebalanceAmount:["",[c.kI.required,c.kI.min(1),c.kI.max(this.selChannel.local_balance)]],selRebalancePeer:[null,c.kI.required]}),this.feeFormGroup=this.formBuilder.group({selFeeLimitType:[this.feeLimitTypes[0],c.kI.required],feeLimit:["",[c.kI.required,c.kI.min(0)]],hiddenFeeLimit:["",[c.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select(C.Ef).pipe((0,d.R)(this.unSubs[0])).subscribe(o=>{this.invoices=o.listInvoices,this.logger.info(o)}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,Q.h)(o=>o.type===l.uR.SET_QUERY_ROUTES_LND||o.type===l.uR.SEND_PAYMENT_STATUS_LND||o.type===l.uR.NEWLY_SAVED_INVOICE_LND)).subscribe(o=>{o.type===l.uR.SET_QUERY_ROUTES_LND&&(this.queryRoute=o.payload),o.type===l.uR.SEND_PAYMENT_STATUS_LND&&(this.logger.info(o.payload),this.flgPaymentSent=!0,this.paymentStatus=o.payload,this.flgEditable=!0),o.type===l.uR.NEWLY_SAVED_INVOICE_LND&&(this.logger.info(o.payload),this.flgInvoiceGenerated=!0,this.sendPayment(o.payload.paymentRequest))}),this.inputFormGroup.get("rebalanceAmount").valueChanges.pipe((0,d.R)(this.unSubs[2]),(0,ge.O)(0)).subscribe(o=>{this.inputFormGroup.controls.selRebalancePeer.setValue(""),this.inputFormGroup.controls.selRebalancePeer.setErrors(null),this.filteredActiveChannels=(0,Ce.of)(o?this.filterActiveChannels():this.activeChannels.slice())}),this.inputFormGroup.get("selRebalancePeer").valueChanges.pipe((0,d.R)(this.unSubs[3]),(0,ge.O)("")).subscribe(o=>{"string"==typeof o&&(this.filteredActiveChannels=(0,Ce.of)(this.filterActiveChannels()))})}onSelectFee(){return this.inputFormGroup.controls.selRebalancePeer.value&&"string"==typeof this.inputFormGroup.controls.selRebalancePeer.value&&this.onSelectedPeerChanged(),this.inputFormGroup.controls.selRebalancePeer.value&&"string"!=typeof this.inputFormGroup.controls.selRebalancePeer.value?!this.inputFormGroup.controls.rebalanceAmount.value||(0===this.stepper.selectedIndex&&(this.inputFormGroup.controls.hiddenAmount.setValue(this.inputFormGroup.controls.rebalanceAmount.value),this.stepper.next()),this.queryRoute=null,this.feeFormGroup.reset(),void this.feeFormGroup.controls.selFeeLimitType.setValue(this.feeLimitTypes[0])):(this.inputFormGroup.controls.selRebalancePeer.setErrors({required:!0}),!0)}stepSelectionChanged(t){switch(t.selectedIndex){case 0:default:this.inputFormLabel="Amount to rebalance",this.feeFormLabel="Select rebalance fee";break;case 1:this.inputFormLabel=this.inputFormGroup.controls.rebalanceAmount.value||this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?"Rebalancing Amount: "+this.decimalPipe.transform(this.inputFormGroup.controls.rebalanceAmount.value?this.inputFormGroup.controls.rebalanceAmount.value:0)+" Sats | Peer: "+(this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?this.inputFormGroup.controls.selRebalancePeer.value.remote_alias:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey.substring(0,15)+"..."):"Amount to rebalance",this.feeFormLabel="Select rebalance fee";break;case 2:this.inputFormLabel=this.inputFormGroup.controls.rebalanceAmount.value||this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?"Rebalancing Amount: "+this.decimalPipe.transform(this.inputFormGroup.controls.rebalanceAmount.value?this.inputFormGroup.controls.rebalanceAmount.value:0)+" Sats | Peer: "+(this.inputFormGroup.controls.selRebalancePeer.value.remote_alias?this.inputFormGroup.controls.selRebalancePeer.value.remote_alias:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey.substring(0,15)+"..."):"Amount to rebalance",this.feeFormLabel=this.queryRoute&&this.queryRoute.routes&&this.queryRoute.routes.length>0&&(this.queryRoute.routes[0].total_fees_msat||this.queryRoute.routes[0].hops&&this.queryRoute.routes[0].hops.length)?this.feeFormGroup.controls.selFeeLimitType.value.placeholder+": "+this.decimalPipe.transform(this.feeFormGroup.controls.feeLimit.value?this.feeFormGroup.controls.feeLimit.value:0)+" | Hops: "+this.queryRoute.routes[0].hops.length:"Select rebalance fee"}t.selectedIndex<t.previouslySelectedIndex&&(0===t.selectedIndex?this.inputFormGroup.controls.hiddenAmount.setValue(""):1===t.selectedIndex&&this.feeFormGroup.controls.hiddenFeeLimit.setValue(""))}onRebalance(){if(!this.inputFormGroup.controls.rebalanceAmount.value||this.inputFormGroup.controls.rebalanceAmount.value<=0||this.inputFormGroup.controls.rebalanceAmount.value>+this.selChannel.local_balance||!this.feeFormGroup.controls.feeLimit.value||this.feeFormGroup.controls.feeLimit.value<0||!this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey)return!0;this.feeFormGroup.controls.hiddenFeeLimit.setValue(this.feeFormGroup.controls.feeLimit.value),this.stepper.next(),this.flgEditable=!1,this.paymentRequest="",this.paymentStatus=null,this.flgReusingInvoice=!1,this.flgInvoiceGenerated=!1,this.flgPaymentSent=!1;const t=this.findUnsettledInvoice();t?(this.flgReusingInvoice=!0,this.sendPayment(t.payment_request)):this.store.dispatch((0,b.Rd)({payload:{uiMessage:l.m6.NO_SPINNER,memo:"Local-Rebalance-"+this.inputFormGroup.controls.rebalanceAmount.value+"-Sats",invoiceValue:this.inputFormGroup.controls.rebalanceAmount.value,private:!1,expiry:3600,pageSize:l.IV,openModal:!1}}))}findUnsettledInvoice(){return this.invoices.invoices.find(t=>(0==+t.settle_date||!t.settle_date)&&t.memo==="Local-Rebalance-"+this.inputFormGroup.controls.rebalanceAmount.value+"-Sats"&&"CANCELED"!==t.state)}sendPayment(t){this.flgInvoiceGenerated=!0,this.paymentRequest=t,this.store.dispatch((0,b.oV)("percent"===this.feeFormGroup.controls.selFeeLimitType.value.id&&+this.feeFormGroup.controls.feeLimit.value%1!=0?{payload:{uiMessage:l.m6.NO_SPINNER,paymentReq:t,outgoingChannel:this.selChannel,feeLimitType:"fixed",feeLimit:Math.ceil(+this.feeFormGroup.controls.feeLimit.value*+this.inputFormGroup.controls.rebalanceAmount.value/100),allowSelfPayment:!0,lastHopPubkey:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey,fromDialog:!0}}:{payload:{uiMessage:l.m6.NO_SPINNER,paymentReq:t,outgoingChannel:this.selChannel,feeLimitType:this.feeFormGroup.controls.selFeeLimitType.value.id,feeLimit:this.feeFormGroup.controls.feeLimit.value,allowSelfPayment:!0,lastHopPubkey:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey,fromDialog:!0}}))}filterActiveChannels(){return this.activeChannels.filter(t=>t.remote_balance>=this.inputFormGroup.controls.rebalanceAmount.value&&t.chan_id!==this.selChannel.chan_id&&(0===t.remote_alias.toLowerCase().indexOf(this.inputFormGroup.controls.selRebalancePeer.value?this.inputFormGroup.controls.selRebalancePeer.value.toLowerCase():"")||0===t.chan_id.toLowerCase().indexOf(this.inputFormGroup.controls.selRebalancePeer.value?this.inputFormGroup.controls.selRebalancePeer.value.toLowerCase():"")))}onSelectedPeerChanged(){if(this.inputFormGroup.controls.selRebalancePeer.value&&this.inputFormGroup.controls.selRebalancePeer.value.length>0&&"string"==typeof this.inputFormGroup.controls.selRebalancePeer.value){const t=this.activeChannels.filter(a=>a.remote_alias.length===this.inputFormGroup.controls.selRebalancePeer.value.length&&0===a.remote_alias.toLowerCase().indexOf(this.inputFormGroup.controls.selRebalancePeer.value?this.inputFormGroup.controls.selRebalancePeer.value.toLowerCase():""));t&&t.length>0?(this.inputFormGroup.controls.selRebalancePeer.setValue(t[0]),this.inputFormGroup.controls.selRebalancePeer.setErrors(null)):this.inputFormGroup.controls.selRebalancePeer.setErrors({notfound:!0})}}displayFn(t){return t&&t.remote_alias?t.remote_alias:t&&t.chan_id?t.chan_id:""}onClose(){this.dialogRef.close(!1)}onRestart(){this.flgInvoiceGenerated=!1,this.flgPaymentSent=!1,this.flgEditable=!0,this.stepper.reset(),this.inputFormGroup.reset(),this.feeFormGroup.reset(),this.statusFormGroup.reset(),this.inputFormGroup.controls.hiddenAmount.setValue(""),this.inputFormGroup.controls.hiddenAmount.setErrors(null),this.inputFormGroup.controls.rebalanceAmount.setValue(""),this.inputFormGroup.controls.rebalanceAmount.setErrors(null),this.inputFormGroup.controls.selRebalancePeer.setValue(""),this.inputFormGroup.controls.selRebalancePeer.setErrors(null),this.filteredActiveChannels=(0,Ce.of)(this.activeChannels)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(F.mQ),e.Y36(w.yh),e.Y36(z.eX),e.Y36(c.qu),e.Y36(m.JJ))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-rebalance"]],viewQuery:function(t,a){if(1&t&&e.Gf(go,5),2&t){let o;e.iGM(o=e.CRH())&&(a.stepper=o.first)}},decls:101,vars:45,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","15","fxFlex","5","fxLayoutAlign","center","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","space-between stretch"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","space-between stretch",1,"padding-gap-large"],["fxFlex","40"],["fxFlex","30"],[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","fxLayout.gt-sm","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","48"],["autoFocus","","matInput","","placeholder","Amount","type","number","tabindex","1","formControlName","rebalanceAmount","required","",3,"step"],["matSuffix",""],[4,"ngIf"],["fxFlex","48","fxLayoutAlign","start end"],["type","text","placeholder","Receive from Peer","aria-label","Receive from Peer","matInput","","formControlName","selRebalancePeer","tabindex","2","required","",3,"matAutocomplete","change"],[3,"displayWith","optionSelected"],["auto","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","submit",3,"click"],["matStepLabel","","disabled","true"],["tabindex","6","formControlName","selFeeLimitType","Placeholder","Fee Limits","required",""],["matInput","","formControlName","feeLimit","type","number","tabindex","7","required","",3,"placeholder","step"],["mat-button","","color","primary","tabindex","8","type","submit",3,"click"],[3,"stepControl"],["fxLayout","row wrap","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100",1,"flat-expansion-panel","mb-2"],["fxLayoutAlign","start center","fxFlex","100"],["class","ml-1 icon-small",4,"ngIf"],[1,"foreground-secondary-text"],["fxFlex","100","color","primary","mode","indeterminate",4,"ngIf"],["fxFlex","100",1,"flat-expansion-panel",3,"expanded"],["fxLayout","column",4,"ngIf","ngIfElse"],["fxLayoutAlign","start","class","font-bold-500 mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-1"],["mat-button","","color","primary","tabindex","11","type","button",3,"click",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","12","type","button","default","",3,"mat-dialog-close"],["paymentStatusBlock",""],["paymentFailedBlock",""],["paymentSuccessfulBlock",""],[3,"value"],[1,"ml-1","icon-small"],["fxFlex","100","color","primary","mode","indeterminate"],["fxLayoutAlign","start",1,"font-bold-500","mt-1"],["mat-button","","color","primary","tabindex","11","type","button",3,"click"],[4,"ngTemplateOutlet"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"w-100","my-1"],["fxFlex","50"]],template:function(t,a){if(1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5,"Channel Rebalance"),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e.NdJ("click",function(){return a.onClose()}),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"div",7),e.TgZ(10,"div",8),e.TgZ(11,"div",9),e._UZ(12,"fa-icon",10),e.TgZ(13,"span"),e._uU(14,"Circular Rebalance is a payment you make to *yourselves* to affect a relative change in the balances of two channels. This is accomplished by sending payment out from the selected channel and receiving it back on the channel with the selected peer. Please note, you will be paying routing fee to balance the channels in this manner."),e.qZA(),e.qZA(),e.qZA(),e.TgZ(15,"div",11),e.TgZ(16,"p",12),e.TgZ(17,"strong"),e._uU(18,"Channel Peer:\xa0"),e.qZA(),e._uU(19),e.ALo(20,"titlecase"),e.qZA(),e.TgZ(21,"p",13),e.TgZ(22,"strong"),e._uU(23,"Channel ID:\xa0"),e.qZA(),e._uU(24),e.qZA(),e._UZ(25,"p",13),e.qZA(),e.TgZ(26,"mat-vertical-stepper",14,15),e.NdJ("selectionChange",function(s){return a.stepSelectionChanged(s)}),e.TgZ(28,"mat-step",16),e.TgZ(29,"form",17),e.YNc(30,fo,1,1,"ng-template",18),e.TgZ(31,"div",19),e.TgZ(32,"mat-form-field",20),e._UZ(33,"input",21),e.TgZ(34,"mat-hint"),e._uU(35),e.qZA(),e.TgZ(36,"span",22),e._uU(37,"Sats"),e.qZA(),e.YNc(38,Co,2,0,"mat-error",23),e.YNc(39,xo,2,0,"mat-error",23),e.YNc(40,To,2,1,"mat-error",23),e.qZA(),e.TgZ(41,"mat-form-field",24),e.TgZ(42,"input",25),e.NdJ("change",function(){return a.onSelectedPeerChanged()}),e.qZA(),e.TgZ(43,"mat-autocomplete",26,27),e.NdJ("optionSelected",function(){return a.onSelectedPeerChanged()}),e.YNc(45,yo,2,2,"mat-option",28),e.ALo(46,"async"),e.qZA(),e.YNc(47,Zo,2,0,"mat-error",23),e.YNc(48,bo,2,0,"mat-error",23),e.qZA(),e.qZA(),e.TgZ(49,"div",29),e.TgZ(50,"button",30),e.NdJ("click",function(){return a.onSelectFee()}),e._uU(51,"Select Fee"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(52,"mat-step",16),e.TgZ(53,"form",17),e.YNc(54,Ao,1,1,"ng-template",31),e.TgZ(55,"div",19),e.TgZ(56,"div",19),e.TgZ(57,"mat-form-field",24),e.TgZ(58,"mat-select",32),e.YNc(59,vo,2,2,"mat-option",28),e.qZA(),e.qZA(),e.TgZ(60,"mat-form-field",20),e._UZ(61,"input",33),e.YNc(62,wo,2,1,"mat-error",23),e.YNc(63,qo,2,1,"mat-error",23),e.qZA(),e.qZA(),e.qZA(),e.TgZ(64,"div",29),e.TgZ(65,"button",34),e.NdJ("click",function(){return a.onRebalance()}),e._uU(66,"Rebalance"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(67,"mat-step",35),e.TgZ(68,"form",17),e.YNc(69,So,1,0,"ng-template",18),e.TgZ(70,"div",36),e.TgZ(71,"mat-expansion-panel",37),e.TgZ(72,"mat-expansion-panel-header"),e.TgZ(73,"mat-panel-title"),e.TgZ(74,"span",38),e._uU(75),e.YNc(76,Lo,2,0,"mat-icon",39),e.qZA(),e.qZA(),e.qZA(),e.TgZ(77,"div",7),e.TgZ(78,"span",40),e._uU(79),e.qZA(),e.qZA(),e.qZA(),e.YNc(80,ko,1,0,"mat-progress-bar",41),e.TgZ(81,"mat-expansion-panel",42),e.TgZ(82,"mat-expansion-panel-header"),e.TgZ(83,"mat-panel-title"),e.TgZ(84,"span",38),e._uU(85),e.YNc(86,Fo,2,1,"mat-icon",39),e.qZA(),e.qZA(),e.qZA(),e.YNc(87,No,1,0,"div",43),e.qZA(),e.YNc(88,Oo,1,0,"mat-progress-bar",41),e.qZA(),e.YNc(89,Uo,2,1,"h4",44),e.TgZ(90,"div",45),e.YNc(91,Ro,2,0,"button",46),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(92,"div",47),e.TgZ(93,"button",48),e._uU(94,"Close"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(95,Do,1,1,"ng-template",null,49,e.W1O),e.YNc(97,Po,3,1,"ng-template",null,50,e.W1O),e.YNc(99,Mo,19,4,"ng-template",null,51,e.W1O)),2&t){const o=e.MAs(44),s=e.MAs(96);e.xp6(12),e.Q6J("icon",a.faInfoCircle),e.xp6(7),e.Oqu(e.lcZ(20,41,a.selChannel.remote_alias)),e.xp6(5),e.Oqu(a.selChannel.chan_id),e.xp6(2),e.Q6J("linear",!0),e.xp6(2),e.Q6J("stepControl",a.inputFormGroup)("editable",a.flgEditable),e.xp6(1),e.Q6J("formGroup",a.inputFormGroup),e.xp6(4),e.Q6J("step",100),e.xp6(2),e.AsE("(Local Bal: ",null==a.selChannel?null:a.selChannel.local_balance,", Remaining: ",(null==a.selChannel?null:a.selChannel.local_balance)-(a.inputFormGroup.controls.rebalanceAmount.value?a.inputFormGroup.controls.rebalanceAmount.value:0),")"),e.xp6(3),e.Q6J("ngIf",null==a.inputFormGroup.controls.rebalanceAmount.errors?null:a.inputFormGroup.controls.rebalanceAmount.errors.required),e.xp6(1),e.Q6J("ngIf",null==a.inputFormGroup.controls.rebalanceAmount.errors?null:a.inputFormGroup.controls.rebalanceAmount.errors.min),e.xp6(1),e.Q6J("ngIf",null==a.inputFormGroup.controls.rebalanceAmount.errors?null:a.inputFormGroup.controls.rebalanceAmount.errors.max),e.xp6(2),e.Q6J("matAutocomplete",o),e.xp6(1),e.Q6J("displayWith",a.displayFn),e.xp6(2),e.Q6J("ngForOf",e.lcZ(46,43,a.filteredActiveChannels)),e.xp6(2),e.Q6J("ngIf",null==a.inputFormGroup.controls.selRebalancePeer.errors?null:a.inputFormGroup.controls.selRebalancePeer.errors.required),e.xp6(1),e.Q6J("ngIf",null==a.inputFormGroup.controls.selRebalancePeer.errors?null:a.inputFormGroup.controls.selRebalancePeer.errors.notfound),e.xp6(4),e.Q6J("stepControl",a.feeFormGroup)("editable",a.flgEditable),e.xp6(1),e.Q6J("formGroup",a.feeFormGroup),e.xp6(6),e.Q6J("ngForOf",a.feeLimitTypes),e.xp6(2),e.s9C("placeholder",a.feeFormGroup.controls.selFeeLimitType.value?a.feeFormGroup.controls.selFeeLimitType.value.placeholder:a.feeLimitTypes[0].placeholder),e.Q6J("step",1),e.xp6(1),e.Q6J("ngIf",null==a.feeFormGroup.controls.feeLimit.errors?null:a.feeFormGroup.controls.feeLimit.errors.required),e.xp6(1),e.Q6J("ngIf",null==a.feeFormGroup.controls.feeLimit.errors?null:a.feeFormGroup.controls.feeLimit.errors.min),e.xp6(4),e.Q6J("stepControl",a.statusFormGroup),e.xp6(1),e.Q6J("formGroup",a.statusFormGroup),e.xp6(7),e.Oqu(a.flgInvoiceGenerated?a.flgReusingInvoice?"Invoice re-used":"Invoice generated":"Generating invoice..."),e.xp6(1),e.Q6J("ngIf",a.flgInvoiceGenerated),e.xp6(3),e.Oqu(a.paymentRequest),e.xp6(1),e.Q6J("ngIf",!a.flgInvoiceGenerated),e.xp6(1),e.Q6J("expanded",(a.flgInvoiceGenerated||a.flgReusingInvoice)&&a.flgPaymentSent),e.xp6(4),e.Oqu(a.flgInvoiceGenerated||a.flgPaymentSent?a.flgPaymentSent?null!=a.paymentStatus&&a.paymentStatus.error?"Payment failed":"Payment successful":"Processing payment...":"Payment waiting for Invoice"),e.xp6(1),e.Q6J("ngIf",a.flgPaymentSent),e.xp6(1),e.Q6J("ngIf",!a.paymentStatus)("ngIfElse",s),e.xp6(1),e.Q6J("ngIf",a.flgInvoiceGenerated&&!a.flgPaymentSent),e.xp6(1),e.Q6J("ngIf",a.flgInvoiceGenerated&&a.flgPaymentSent),e.xp6(2),e.Q6J("ngIf",a.paymentStatus&&a.paymentStatus.error),e.xp6(2),e.Q6J("mat-dialog-close",!1)}},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,A.dn,I.BN,B.Vq,B.C0,c._Y,c.JL,c.sg,B.VY,f.KE,R.Nt,c.wV,c.Fj,V.h,c.JJ,c.u,c.Q7,f.bx,f.R9,m.O5,ne.ZL,ne.XC,m.sg,O.gD,H.ib,H.yz,H.yK,J.ZT,f.TO,E.ey,j.Hw,M.pW,m.tP,X.d],pipes:[m.rS,m.Ov],styles:[""]}),n})();function Qo(n,i){if(1&n&&(e.TgZ(0,"div",16),e.TgZ(1,"p",17),e.TgZ(2,"mat-icon",18),e._uU(3,"close"),e.qZA(),e._uU(4),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(4),e.Oqu(t.errorMsg)}}function Eo(n,i){if(1&n&&(e.TgZ(0,"div",27),e._UZ(1,"fa-icon",28),e.TgZ(2,"span"),e._uU(3,"Priority/Fee for force closing inactive channels cannot be modified."),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("icon",t.faInfoCircle)}}function Yo(n,i){if(1&n&&(e.TgZ(0,"mat-option",29),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.name," ")}}function Bo(n,i){1&n&&(e.TgZ(0,"mat-form-field",30),e._UZ(1,"input",31),e.qZA())}function Ho(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Number of blocks is required."),e.qZA())}function Go(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",32),e.TgZ(1,"input",33,34),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw(2).blocks=o}),e.qZA(),e.YNc(3,Ho,2,0,"mat-error",35),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngModel",t.blocks)("step",1)("min",0),e.xp6(2),e.Q6J("ngIf",!t.blocks)}}function zo(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Fees is required."),e.qZA())}function Vo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",32),e.TgZ(1,"input",36,37),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw(2).fees=o}),e.qZA(),e.YNc(3,zo,2,0,"mat-error",35),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngModel",t.fees)("step",1)("min",0),e.xp6(2),e.Q6J("ngIf",!t.fees)}}function Wo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",19),e.YNc(1,Eo,4,1,"div",20),e.TgZ(2,"div",21),e.TgZ(3,"mat-form-field",22),e.TgZ(4,"mat-select",23),e.NdJ("valueChange",function(o){return e.CHM(t),e.oxw().selTransType=o}),e.YNc(5,Yo,2,2,"mat-option",24),e.qZA(),e.qZA(),e.YNc(6,Bo,2,0,"mat-form-field",25),e.YNc(7,Go,4,4,"mat-form-field",26),e.YNc(8,Vo,4,4,"mat-form-field",26),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.channelToClose.active),e.xp6(3),e.Q6J("value",t.selTransType)("disabled",!t.channelToClose.active),e.xp6(1),e.Q6J("ngForOf",t.transTypes),e.xp6(1),e.Q6J("ngIf","0"===t.selTransType),e.xp6(1),e.Q6J("ngIf","1"===t.selTransType),e.xp6(1),e.Q6J("ngIf","2"===t.selTransType)}}function Xo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",38),e.NdJ("click",function(){return e.CHM(t),e.oxw().resetData()}),e._uU(1,"Clear"),e.qZA()}}function $o(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",39),e.NdJ("click",function(){return e.CHM(t),e.oxw().onCloseChannel()}),e._uU(1),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.channelToClose.active?"Close Channel":"Force Close")}}function jo(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",40),e.NdJ("click",function(){return e.CHM(t),e.oxw().onClose()}),e._uU(1,"Ok"),e.qZA()}}let Ko=(()=>{class n{constructor(t,a,o,s,u){this.dialogRef=t,this.data=a,this.store=o,this.actions=s,this.logger=u,this.transTypes=l.Dr,this.selTransType="0",this.blocks=null,this.fees=null,this.faExclamationTriangle=y.eHv,this.faInfoCircle=y.sqG,this.flgPendingHtlcs=!1,this.errorMsg="Please wait for pending HTLCs to settle before attempting channel closure.",this.unSubs=[new p.x,new p.x]}ngOnInit(){this.channelToClose=this.data.channel,this.actions.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(t=>t.type===l.uR.UPDATE_API_CALL_STATUS_LND||t.type===l.uR.SET_CHANNELS_LND)).subscribe(t=>{if(t.type===l.uR.SET_CHANNELS_LND){const a=t.payload.find(o=>o.chan_id===this.data.channel.chan_id);a&&a.pending_htlcs&&a.pending_htlcs.length&&a.pending_htlcs.length>0&&(this.flgPendingHtlcs=!0)}t.type===l.uR.UPDATE_API_CALL_STATUS_LND&&t.payload.status===l.Bn.ERROR&&"FetchAllChannels"===t.payload.action&&this.logger.error("Fetching latest channel information failed!\n"+t.payload.message)})}onCloseChannel(){if("1"===this.selTransType&&(!this.blocks||0===this.blocks)||"2"===this.selTransType&&(!this.fees||0===this.fees))return!0;const t={channelPoint:this.channelToClose.channel_point,forcibly:!this.channelToClose.active};this.blocks&&(t.targetConf=this.blocks),this.fees&&(t.satPerByte=this.fees),this.store.dispatch((0,b.BL)({payload:t})),this.dialogRef.close(!1)}resetData(){this.selTransType="0",this.blocks=null,this.fees=null}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(w.yh),e.Y36(z.eX),e.Y36(F.mQ))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-close-channel"]],decls:19,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","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],["fxLayout","column",1,"bordered-box","mb-1","p-2"],["fxLayoutAlign","start center",1,"pb-1","word-break"],["fxLayoutAlign","start center",4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center"],["mat-button","","color","primary","type","reset","class","mr-1","tabindex","3","default","",3,"click",4,"ngIf"],["mat-button","","color","primary","type","submit","tabindex","4",3,"click",4,"ngIf"],["mat-button","","color","primary","type","submit","tabindex","5",3,"click",4,"ngIf"],["fxLayoutAlign","start center"],["fxFlex","100","fxLayoutAlign","start center",1,"color-warn"],[1,"mr-1","icon-small"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100","class","alert alert-info",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex.gt-sm","48"],["tabindex","1",3,"value","disabled","valueChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex","48",4,"ngIf"],["fxFlex.gt-sm","48","fxLayoutAlign","start end",4,"ngIf"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],[3,"value"],["fxFlex","48"],["matInput","","placeholder","Default","disabled",""],["fxFlex.gt-sm","48","fxLayoutAlign","start end"],["matInput","","placeholder","Number of Blocks","type","number","name","blocks","required","","tabindex","2",3,"ngModel","step","min","ngModelChange"],["blcks","ngModel"],[4,"ngIf"],["matInput","","placeholder","Fees (Sats/vByte)","type","number","name","ccfees","required","","tabindex","3",3,"ngModel","step","min","ngModelChange"],["clchfee","ngModel"],["mat-button","","color","primary","type","reset","tabindex","3","default","",1,"mr-1",3,"click"],["mat-button","","color","primary","type","submit","tabindex","4",3,"click"],["mat-button","","color","primary","type","submit","tabindex","5",3,"click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e.NdJ("click",function(){return a.onClose()}),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"form",7),e.TgZ(10,"div",8),e.TgZ(11,"p",9),e._uU(12),e.qZA(),e.YNc(13,Qo,5,1,"div",10),e.YNc(14,Wo,9,7,"div",11),e.qZA(),e.TgZ(15,"div",12),e.YNc(16,Xo,2,0,"button",13),e.YNc(17,$o,2,1,"button",14),e.YNc(18,jo,2,0,"button",15),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(5),e.Oqu(a.channelToClose.active?"Close Channel":"Force Close Channel"),e.xp6(7),e.hij("",a.channelToClose.active?"Closing channel: "+(a.channelToClose.remote_alias||a.channelToClose.chan_id?a.channelToClose.remote_alias&&a.channelToClose.chan_id?a.channelToClose.remote_alias+" ("+a.channelToClose.chan_id+")":a.channelToClose.remote_alias?a.channelToClose.remote_alias:a.channelToClose.chan_id:a.channelToClose.channel_point):"Force closing channel: "+(a.channelToClose.remote_alias||a.channelToClose.chan_id?a.channelToClose.remote_alias&&a.channelToClose.chan_id?a.channelToClose.remote_alias+" ("+a.channelToClose.chan_id+")":a.channelToClose.remote_alias?a.channelToClose.remote_alias:a.channelToClose.chan_id:a.channelToClose.channel_point)," "),e.xp6(1),e.Q6J("ngIf",a.flgPendingHtlcs),e.xp6(1),e.Q6J("ngIf",!a.flgPendingHtlcs),e.xp6(2),e.Q6J("ngIf",a.channelToClose.active&&!a.flgPendingHtlcs),e.xp6(1),e.Q6J("ngIf",!a.flgPendingHtlcs),e.xp6(1),e.Q6J("ngIf",a.flgPendingHtlcs))},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,A.dn,c._Y,c.JL,c.F,m.O5,j.Hw,f.KE,O.gD,m.sg,I.BN,E.ey,R.Nt,c.wV,c.qQ,c.Fj,$.q,c.Q7,c.JJ,c.On,f.TO],styles:[""]}),n})();function es(n,i){1&n&&e._UZ(0,"mat-progress-bar",30)}function ts(n,i){1&n&&(e.TgZ(0,"th",31),e._uU(1," Peer "),e.qZA())}function ns(n,i){1&n&&e._UZ(0,"span",39)}function as(n,i){1&n&&e._UZ(0,"span",40)}function is(n,i){if(1&n&&(e.TgZ(0,"span",41),e._UZ(1,"fa-icon",42),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("icon",t.faEyeSlash)}}function os(n,i){if(1&n&&(e.TgZ(0,"span",43),e._UZ(1,"fa-icon",42),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("icon",t.faEye)}}const ss=function(n){return{"max-width":n}};function ls(n,i){if(1&n&&(e.TgZ(0,"td",32),e.TgZ(1,"div",33),e.YNc(2,ns,1,0,"span",34),e.YNc(3,as,1,0,"span",35),e.YNc(4,is,2,1,"span",36),e.YNc(5,os,2,1,"span",37),e.TgZ(6,"span",38),e._uU(7),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.xp6(1),e.Q6J("ngStyle",e.VKq(6,ss,a.screenSize===a.screenSizeEnum.XS?"10rem":a.screenSize===a.screenSizeEnum.MD?"15rem":"22rem")),e.xp6(1),e.Q6J("ngIf",t.active),e.xp6(1),e.Q6J("ngIf",!t.active),e.xp6(1),e.Q6J("ngIf",t.private),e.xp6(1),e.Q6J("ngIf",!t.private),e.xp6(2),e.Oqu(t.remote_alias||t.remote_pubkey)}}function rs(n,i){if(1&n&&(e.TgZ(0,"th",44),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("Uptime (",t.timeUnit,")")}}function cs(n,i){if(1&n&&(e.TgZ(0,"td",32),e.TgZ(1,"span",45),e._uU(2),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij("",t.uptime_str," ")}}function us(n,i){1&n&&(e.TgZ(0,"th",44),e._uU(1,"Sats Sent "),e.qZA())}function ps(n,i){if(1&n&&(e.TgZ(0,"td",32),e.TgZ(1,"span",45),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij("",e.lcZ(3,1,t.total_satoshis_sent)," ")}}function ms(n,i){1&n&&(e.TgZ(0,"th",44),e._uU(1,"Sats Received "),e.qZA())}function _s(n,i){if(1&n&&(e.TgZ(0,"td",32),e.TgZ(1,"span",45),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij("",e.lcZ(3,1,t.total_satoshis_received)," ")}}function ds(n,i){1&n&&(e.TgZ(0,"th",44),e._uU(1,"Local Balance (Sats) "),e.qZA())}function hs(n,i){if(1&n&&(e.TgZ(0,"td",32),e.TgZ(1,"span",45),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij("",e.lcZ(3,1,t.local_balance)," ")}}function gs(n,i){1&n&&(e.TgZ(0,"th",44),e._uU(1,"Remote Balance (Sats) "),e.qZA())}function fs(n,i){if(1&n&&(e.TgZ(0,"td",32),e.TgZ(1,"span",45),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij("",e.lcZ(3,1,t.remote_balance)," ")}}function Cs(n,i){1&n&&(e.TgZ(0,"th",46),e._uU(1,"Balance Score "),e.qZA())}function xs(n,i){if(1&n&&(e.TgZ(0,"td",47),e.TgZ(1,"div",48),e.TgZ(2,"mat-hint",49),e._uU(3),e.ALo(4,"number"),e.qZA(),e.qZA(),e._UZ(5,"mat-progress-bar",50),e.qZA()),2&n){const t=i.$implicit;e.xp6(3),e.Oqu(e.lcZ(4,2,t.balancedness||0)),e.xp6(2),e.s9C("value",t.local_balance&&t.local_balance>0?+t.local_balance/(+t.local_balance+ +t.remote_balance)*100:0)}}function Ts(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",51),e.TgZ(1,"div",52),e.TgZ(2,"mat-select",53),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",54),e.NdJ("click",function(){return e.CHM(t),e.oxw().onChannelUpdate("all")}),e._uU(5,"Update Fee Policy"),e.qZA(),e.TgZ(6,"mat-option",54),e.NdJ("click",function(){return e.CHM(t),e.oxw().onDownloadCSV()}),e._uU(7,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function ys(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-option",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit;return e.oxw().onCircularRebalance(o)}),e._uU(1,"Circular Rebalance"),e.qZA()}}function Zs(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-option",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit;return e.oxw().onLoopOut(o)}),e._uU(1,"Loop Out"),e.qZA()}}function bs(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",55),e.TgZ(1,"div",52),e.TgZ(2,"mat-select",56),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",54),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw().onChannelClick(u,o)}),e._uU(5,"View Info"),e.qZA(),e.TgZ(6,"mat-option",54),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onViewRemotePolicy(s)}),e._uU(7,"View Remote Fee "),e.qZA(),e.TgZ(8,"mat-option",54),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onChannelUpdate(s)}),e._uU(9,"Update Fee Policy"),e.qZA(),e.YNc(10,ys,2,0,"mat-option",57),e.YNc(11,Zs,2,0,"mat-option",57),e.TgZ(12,"mat-option",54),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onChannelClose(s)}),e._uU(13,"Close Channel"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(10),e.Q6J("ngIf",+t.versionsArr[0]>0||+t.versionsArr[1]>=9),e.xp6(1),e.Q6J("ngIf",t.selNode.swapServerUrl)}}function As(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No peers connected. Add a peer in order to open a channel."),e.qZA())}function vs(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No channel available."),e.qZA())}function ws(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting channels..."),e.qZA())}function qs(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function Ss(n,i){if(1&n&&(e.TgZ(0,"td",58),e.YNc(1,As,2,0,"p",59),e.YNc(2,vs,2,0,"p",59),e.YNc(3,ws,2,0,"p",59),e.YNc(4,qs,2,1,"p",59),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.numPeers<1&&(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apiCallStatus?null:t.apiCallStatus.status)===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",t.numPeers>0&&(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apiCallStatus?null:t.apiCallStatus.status)===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apiCallStatus?null:t.apiCallStatus.status)===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&(null==t.apiCallStatus?null:t.apiCallStatus.status)===t.apiCallStatusEnum.ERROR)}}const Ls=function(n){return{"display-none":n}};function ks(n,i){if(1&n&&e._UZ(0,"tr",60),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,Ls,t.numPeers>0&&(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function Fs(n,i){1&n&&e._UZ(0,"tr",61)}function Ns(n,i){1&n&&e._UZ(0,"tr",62)}const Os=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Us=function(){return["no_peer"]};let Rs=(()=>{class n{constructor(t,a,o,s,u,g,U,x){var N,se,ye,Ze;this.logger=t,this.store=a,this.lndEffects=o,this.commonService=s,this.rtlEffects=u,this.decimalPipe=g,this.loopService=U,this.router=x,this.timeUnit="mins:secs",this.userPersonaEnum=l.ol,this.selNode={},this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.selFilter="",this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.versionsArr=[],this.faEye=y.Mdf,this.faEyeSlash=y.Aq,this.targetConf=6,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["remote_alias","local_balance","remote_balance","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["remote_alias","local_balance","remote_balance","balancedness","actions"]):(this.flgSticky=!0,this.displayedColumns=["remote_alias","uptime","total_satoshis_sent","total_satoshis_received","local_balance","remote_balance","balancedness","actions"]),this.selFilter=(null===(se=null===(N=this.router.getCurrentNavigation().extras)||void 0===N?void 0:N.state)||void 0===se?void 0:se.filter)?null===(Ze=null===(ye=this.router.getCurrentNavigation().extras)||void 0===ye?void 0:ye.state)||void 0===Ze?void 0:Ze.filter:""}ngOnInit(){this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t}),this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.information=t,this.information&&this.information.version&&(this.versionsArr=this.information.version.split("."))}),this.store.select(C.Wi).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.numPeers=t.peers&&t.peers.length?t.peers.length:0}),this.store.select(C.qU).pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{this.totalBalance=+t.blockchainBalance.total_balance}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[4])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.channelsData=this.calculateUptime(t.channels),this.channelsData.length>0&&this.loadChannelsTable(this.channelsData),this.logger.info(t)})}ngAfterViewInit(){this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}onViewRemotePolicy(t){this.store.dispatch((0,b.$A)({payload:{uiMessage:l.m6.GET_REMOTE_POLICY,channelID:t.chan_id.toString()+"/"+this.information.identity_pubkey}})),this.lndEffects.setLookup.pipe((0,G.q)(1)).subscribe(a=>{if(!a.fee_base_msat&&!a.fee_rate_milli_msat&&!a.time_lock_delta)return!1;const o=[[{key:"fee_base_msat",value:a.fee_base_msat,title:"Base Fees (mSats)",width:25,type:l.Gi.NUMBER},{key:"fee_rate_milli_msat",value:a.fee_rate_milli_msat,title:"Fee Rate (milli mSats)",width:25,type:l.Gi.NUMBER},{key:"fee_rate_milli_msat",value:a.fee_rate_milli_msat/1e4,title:"Fee Rate (%)",width:25,type:l.Gi.NUMBER,digitsInfo:"1.0-8"},{key:"time_lock_delta",value:a.time_lock_delta,title:"Time Lock Delta",width:25,type:l.Gi.NUMBER}]],s="Remote policy for Channel: "+(t.remote_alias||t.chan_id?t.remote_alias&&t.chan_id?t.remote_alias+" ("+t.chan_id+")":t.remote_alias?t.remote_alias:t.chan_id:t.channel_point);setTimeout(()=>{this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Remote Channel Policy",titleMessage:s,message:o}}}))},0)})}onCircularRebalance(t){this.store.dispatch((0,v.qR)({payload:{data:{message:{channels:this.channelsData,selChannel:t},component:Jo}}}))}onChannelUpdate(t){"all"===t?(this.store.dispatch((0,v.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Update Fee Policy",noBtnText:"Cancel",yesBtnText:"Update All Channels",message:[],titleMessage:"Update fee policy for all channels",flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSat)",inputType:l.Gi.NUMBER.toLowerCase(),inputValue:1e3,width:32},{placeholder:"Fee Rate (mili mSat)",inputType:l.Gi.NUMBER.toLowerCase(),inputValue:1,min:1,width:32,hintFunction:this.percentHintFunction},{placeholder:"Time Lock Delta",inputType:l.Gi.NUMBER.toLowerCase(),inputValue:40,width:32}]}}})),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[5])).subscribe(o=>{o&&this.store.dispatch((0,b.pW)({payload:{baseFeeMsat:o[0].inputValue,feeRate:o[1].inputValue,timeLockDelta:o[2].inputValue,chanPoint:"all"}}))})):(this.myChanPolicy={fee_base_msat:0,fee_rate_milli_msat:0,time_lock_delta:0},this.store.dispatch((0,b.$A)({payload:{uiMessage:l.m6.GET_CHAN_POLICY,channelID:t.chan_id.toString()}})),this.lndEffects.setLookup.pipe((0,G.q)(1)).subscribe(a=>{this.myChanPolicy=a.node1_pub===this.information.identity_pubkey?a.node1_policy:a.node2_pub===this.information.identity_pubkey?a.node2_policy:{fee_base_msat:0,fee_rate_milli_msat:0,time_lock_delta:0},this.logger.info(this.myChanPolicy);const o="Update fee policy for Channel: "+(t.remote_alias||t.chan_id?t.remote_alias&&t.chan_id?t.remote_alias+" ("+t.chan_id+")":t.remote_alias?t.remote_alias:t.chan_id:t.channel_point),s=[];setTimeout(()=>{this.store.dispatch((0,v.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Update Fee Policy",titleMessage:o,noBtnText:"Cancel",yesBtnText:"Update Channel",message:s,flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSat)",inputType:l.Gi.NUMBER.toLowerCase(),inputValue:""===this.myChanPolicy.fee_base_msat?0:this.myChanPolicy.fee_base_msat,width:32},{placeholder:"Fee Rate (mili mSat)",inputType:l.Gi.NUMBER.toLowerCase(),inputValue:this.myChanPolicy.fee_rate_milli_msat,min:1,width:32,hintFunction:this.percentHintFunction},{placeholder:"Time Lock Delta",inputType:l.Gi.NUMBER.toLowerCase(),inputValue:this.myChanPolicy.time_lock_delta,width:32}]}}}))},0)}),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[6])).subscribe(a=>{a&&this.store.dispatch((0,b.pW)({payload:{baseFeeMsat:a[0].inputValue,feeRate:a[1].inputValue,timeLockDelta:a[2].inputValue,chanPoint:t.channel_point}}))})),this.applyFilter()}onChannelClose(t){t.active&&this.store.dispatch((0,b.UR)()),this.store.dispatch((0,v.qR)({payload:{data:{channel:t,component:Ko}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{channel:t,showCopy:!0,component:fe}}}))}loadChannelsTable(t){t.sort((a,o)=>a.active===o.active?0:o.active?1:-1),this.channels=new r.by([...t]),this.channels.filterPredicate=(a,o)=>((a.active?"active":"inactive")+(a.chan_id?a.chan_id.toLowerCase():"")+(a.remote_pubkey?a.remote_pubkey.toLowerCase():"")+(a.remote_alias?a.remote_alias.toLowerCase():"")+(a.capacity?a.capacity:"")+(a.local_balance?a.local_balance:"")+(a.remote_balance?a.remote_balance:"")+(a.total_satoshis_sent?a.total_satoshis_sent:"")+(a.total_satoshis_received?a.total_satoshis_received:"")+(a.commit_fee?a.commit_fee:"")+(a.private?"private":"public")).includes(o),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.channels.paginator=this.paginator,this.applyFilter(),this.logger.info(this.channels)}calculateUptime(t){const o=3600,s=24*o,u=365*s;let g=60,U=1,x=0;switch(t.forEach(N=>{N.uptime&&+N.uptime>x&&(x=+N.uptime)}),!0){case x<o:this.timeUnit="Mins:Secs",g=60,U=1;break;case x>=o&&x<s:this.timeUnit="Hrs:Mins",g=o,U=60;break;case x>=s&&x<u:this.timeUnit="Days:Hrs",g=s,U=o;break;case x>u:this.timeUnit="Yrs:Days",g=u,U=s;break;default:this.timeUnit="Mins:Secs",g=60,U=1}return t.forEach(N=>{N.uptime_str=N.uptime?this.decimalPipe.transform(Math.floor(+N.uptime/g),"2.0-0")+":"+this.decimalPipe.transform(Math.round(+N.uptime%g/U),"2.0-0"):"---"}),t}onLoopOut(t){this.loopService.getLoopOutTermsAndQuotes(this.targetConf).pipe((0,d.R)(this.unSubs[7])).subscribe(a=>{this.store.dispatch((0,v.qR)({payload:{minHeight:"56rem",data:{channel:t,minQuote:a[0],maxQuote:a[1],direction:l.$I.LOOP_OUT,component:ke.a}}}))})}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"Open-channels")}percentHintFunction(t){return(t/1e4).toString()+"%"}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(ee.l),e.Y36(P.v),e.Y36(ie.V),e.Y36(m.JJ),e.Y36(Fe.W),e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-open-table"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Channels")}])],decls:39,vars:14,consts:[["fxLayout","column",1,"padding-gap-x"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","remote_alias"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","uptime"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","total_satoshis_sent"],["matColumnDef","total_satoshis_received"],["matColumnDef","local_balance"],["matColumnDef","remote_balance"],["matColumnDef","balancedness"],["mat-header-cell","","mat-sort-header","","class","pl-2",4,"matHeaderCellDef"],["mat-cell","","class","pl-2",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","pl-1",4,"matCellDef"],["matColumnDef","no_peer"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],[1,"ellipsis-parent",3,"ngStyle"],["class","dot green","matTooltip","Active","matTooltipPosition","right",4,"ngIf"],["class","dot yellow","matTooltip","Inactive","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Private","matTooltipPosition","right",4,"ngIf"],["class","mr-1","matTooltip","Public","matTooltipPosition","right",4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Active","matTooltipPosition","right",1,"dot","green"],["matTooltip","Inactive","matTooltipPosition","right",1,"dot","yellow"],["matTooltip","Private","matTooltipPosition","right",1,"mr-1"],[3,"icon"],["matTooltip","Public","matTooltipPosition","right",1,"mr-1"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","","mat-sort-header","",1,"pl-2"],["mat-cell","",1,"pl-2"],["fxLayout","row"],["fxFlex","100","fxLayoutAlign","center center",1,"font-size-80"],["mode","determinate",3,"value"],["mat-header-cell","",1,"pl-1"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-1"],["placeholder","Actions","tabindex","2",1,"mr-0"],[3,"click",4,"ngIf"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e._UZ(2,"div",2),e.TgZ(3,"mat-form-field",3),e.TgZ(4,"input",4),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(5,"div",5),e.YNc(6,es,1,0,"mat-progress-bar",6),e.TgZ(7,"table",7,8),e.ynx(9,9),e.YNc(10,ts,2,0,"th",10),e.YNc(11,ls,8,8,"td",11),e.BQk(),e.ynx(12,12),e.YNc(13,rs,2,1,"th",13),e.YNc(14,cs,3,1,"td",11),e.BQk(),e.ynx(15,14),e.YNc(16,us,2,0,"th",13),e.YNc(17,ps,4,3,"td",11),e.BQk(),e.ynx(18,15),e.YNc(19,ms,2,0,"th",13),e.YNc(20,_s,4,3,"td",11),e.BQk(),e.ynx(21,16),e.YNc(22,ds,2,0,"th",13),e.YNc(23,hs,4,3,"td",11),e.BQk(),e.ynx(24,17),e.YNc(25,gs,2,0,"th",13),e.YNc(26,fs,4,3,"td",11),e.BQk(),e.ynx(27,18),e.YNc(28,Cs,2,0,"th",19),e.YNc(29,xs,6,4,"td",20),e.BQk(),e.ynx(30,21),e.YNc(31,Ts,8,0,"th",22),e.YNc(32,bs,14,2,"td",23),e.BQk(),e.ynx(33,24),e.YNc(34,Ss,5,4,"td",25),e.BQk(),e.YNc(35,ks,1,3,"tr",26),e.YNc(36,Fs,1,0,"tr",27),e.YNc(37,Ns,1,0,"tr",28),e.qZA(),e.qZA(),e._UZ(38,"mat-paginator",29),e.qZA()),2&t&&(e.xp6(4),e.Q6J("ngModel",a.selFilter),e.xp6(2),e.Q6J("ngIf",(null==a.apiCallStatus?null:a.apiCallStatus.status)===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.channels)("ngClass",e.VKq(11,Os,""!==a.errorMessage)),e.xp6(28),e.Q6J("matFooterRowDef",e.DdM(13,Us)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,_.Wh,_.yH,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,m.O5,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,W.gM,I.BN,f.bx,O.gD,O.$L,E.ey,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-remote_alias[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}.mat-column-remote_alias[_ngcontent-%COMP%] .ellipsis-parent[_ngcontent-%COMP%]{display:flex}.mat-column-balancedness[_ngcontent-%COMP%]{flex:0 0 20%;width:20%}@media only screen and (max-width: 75em){.mat-column-balancedness[_ngcontent-%COMP%]{flex:0 0 35%;width:35%}}@media only screen and (max-width: 56.25em){.mat-column-balancedness[_ngcontent-%COMP%]{flex:0 0 25%;width:25%}}.mat-column-uptime[_ngcontent-%COMP%], .mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%]{flex:1 1 10%;width:10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@media only screen and (max-width: 75em){.mat-column-uptime[_ngcontent-%COMP%], .mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%]{white-space:unset;flex:1 1 25%;width:25%}}@media only screen and (max-width: 56.25em){.mat-column-uptime[_ngcontent-%COMP%], .mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}}@media only screen and (max-width: 37.5em){.mat-column-uptime[_ngcontent-%COMP%], .mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%]{white-space:unset}}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 100%}@media only screen and (max-width: 56.25em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 90%}}@media only screen and (max-width: 37.5em){.mat-column-actions[_ngcontent-%COMP%] .bordered-box.table-actions-select[_ngcontent-%COMP%]{flex:0 0 80%}}"]}),n})();const Is=["outputIdx"];function Ds(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Index for change output is required."),e.qZA())}function Ps(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Invalid index value."),e.qZA())}function Ms(n,i){if(1&n&&(e.TgZ(0,"mat-option",29),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.name," ")}}function Js(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Number of blocks is required."),e.qZA())}function Qs(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",17),e.TgZ(1,"input",30,31),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().blocks=o}),e.qZA(),e.YNc(3,Js,2,0,"mat-error",20),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.blocks)("step",1)("min",0),e.xp6(2),e.Q6J("ngIf",!t.blocks)}}function Es(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Fees is required."),e.qZA())}function Ys(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",17),e.TgZ(1,"input",32,33),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().fees=o}),e.qZA(),e.YNc(3,Es,2,0,"mat-error",20),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngModel",t.fees)("step",1)("min",0),e.xp6(2),e.Q6J("ngIf",!t.fees)}}function Bs(n,i){if(1&n&&(e.TgZ(0,"div",34),e._UZ(1,"fa-icon",13),e.TgZ(2,"span"),e._uU(3),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(2),e.Oqu(t.bumpFeeError)}}let Hs=(()=>{class n{constructor(t,a,o,s,u){this.dialogRef=t,this.data=a,this.logger=o,this.dataService=s,this.snackBar=u,this.transTypes=[...l.Dr],this.selTransType="2",this.blocks=null,this.fees=null,this.outputIndex=null,this.faCopy=y.kZ_,this.faInfoCircle=y.sqG,this.faExclamationTriangle=y.eHv,this.bumpFeeError="",this.unSubs=[new p.x,new p.x]}set payReq(t){t&&(this.outputIdx=t)}ngOnInit(){this.transTypes=this.transTypes.splice(1),this.bumpFeeChannel=this.data.pendingChannel;const t=this.bumpFeeChannel.channel.channel_point.split(":")||[];this.bumpFeeChannel.channel.txid_str=t[0]||(this.bumpFeeChannel.channel&&this.bumpFeeChannel.channel.channel_point?this.bumpFeeChannel.channel.channel_point:""),this.bumpFeeChannel.channel.output_index=+t[1]||null}onBumpFee(){return this.outputIndex===this.bumpFeeChannel.channel.output_index?(this.outputIdx.control.setErrors({pendingChannelOutputIndex:!0}),!0):!this.outputIndex&&0!==this.outputIndex||!("1"!==this.selTransType||this.blocks&&0!==this.blocks)||!("2"!==this.selTransType||this.fees&&0!==this.fees)||void this.dataService.bumpFee(this.bumpFeeChannel.channel.txid_str,this.outputIndex,this.blocks,this.fees).pipe((0,d.R)(this.unSubs[0])).subscribe({next:t=>{this.dialogRef.close(!1)},error:t=>{this.logger.error(t),this.bumpFeeError=t.message?t.message:t}})}onCopyID(t){this.snackBar.open("Transaction ID copied.")}resetData(){this.bumpFeeError="",this.selTransType="2",this.blocks=null,this.fees=null,this.outputIdx.control.setErrors(null)}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(F.mQ),e.Y36(K.D),e.Y36(te.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-bump-fee"]],viewQuery:function(t,a){if(1&t&&e.Gf(Is,5),2&t){let o;e.iGM(o=e.CRH())&&(a.payReq=o.first)}},decls:48,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","mat-button","",1,"btn-close-x","p-0",3,"click"],[1,"padding-gap-x-large"],["fxLayout","column"],["fxLayout","column",1,"bordered-box","mb-1","p-2"],["fxLayoutAlign","start center",1,"pb-1","word-break"],["matSuffix","","rtlClipboard","","matTooltip","Copy transaction ID",1,"ml-1",3,"icon","payload","copied"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","100",1,"alert","alert-info"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column","fxFlex","100"],[1,"pl-1"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between center"],["fxFlex.gt-sm","32","fxLayoutAlign","start end"],["matInput","","placeholder","Index for Change Output","type","number","tabindex","1","required","","name","outputIdx",3,"ngModel","step","min","ngModelChange"],["outputIdx","ngModel"],[4,"ngIf"],["fxFlex.gt-sm","32"],["tabindex","2",3,"value","valueChange","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxFlex.gt-sm","32","fxLayoutAlign","start end",4,"ngIf"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxLayoutAlign","end center"],["mat-button","","color","primary","type","reset","tabindex","5","default","",1,"mr-1",3,"click"],["mat-button","","color","primary","type","submit","tabindex","6",3,"click"],[3,"value"],["matInput","","placeholder","Number of Blocks","type","number","name","blocks","required","","tabindex","3",3,"ngModel","step","min","ngModelChange"],["blcks","ngModel"],["matInput","","placeholder","Fees (Sats/vByte)","type","number","name","fees","required","","tabindex","4",3,"ngModel","step","min","ngModelChange"],["fee","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"]],template:function(t,a){if(1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5,"Bump Fee"),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e.NdJ("click",function(){return a.onClose()}),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"form",7),e.TgZ(10,"div",8),e.TgZ(11,"p",9),e._uU(12),e.TgZ(13,"fa-icon",10),e.NdJ("copied",function(s){return a.onCopyID(s)}),e.qZA(),e.qZA(),e.TgZ(14,"div",11),e.TgZ(15,"div",12),e._UZ(16,"fa-icon",13),e.TgZ(17,"span",14),e._uU(18,"Bumping fee on pending open channels is an advanced feature, attempt it only if you are familiar with the functionality of Bitcoin transactions. "),e.TgZ(19,"div"),e._uU(20,"Before attempting fee bump ensure the following:"),e.qZA(),e.TgZ(21,"div",15),e._uU(22,"1: Use a Bitcoin block explorer to ensure that channel opening transaction is not confirmed."),e.qZA(),e.TgZ(23,"div",15),e._uU(24,"2: The channel opening transaction must have a sizable change output, which can be spent further. The fee cannot be bumped without the change output."),e.qZA(),e.TgZ(25,"div",15),e._uU(26,"3: Find the index value of the change output via a block explorer."),e.qZA(),e.TgZ(27,"div",15),e._uU(28,"4: Enter the index value of the change output in the form below and the desired fee rate."),e.qZA(),e.TgZ(29,"div",15),e._uU(30,"5: Upon successful fee bump, use your block explorer to track the child transaction in the mempool, which should be linked with the change output transaction."),e.qZA(),e.qZA(),e.qZA(),e.TgZ(31,"div",16),e.TgZ(32,"mat-form-field",17),e.TgZ(33,"input",18,19),e.NdJ("ngModelChange",function(s){return a.outputIndex=s}),e.qZA(),e.YNc(35,Ds,2,0,"mat-error",20),e.YNc(36,Ps,2,0,"mat-error",20),e.qZA(),e.TgZ(37,"mat-form-field",21),e.TgZ(38,"mat-select",22),e.NdJ("valueChange",function(s){return a.selTransType=s})("selectionChange",function(){return a.blocks=null,a.fees=null}),e.YNc(39,Ms,2,2,"mat-option",23),e.qZA(),e.qZA(),e.YNc(40,Qs,4,4,"mat-form-field",24),e.YNc(41,Ys,4,4,"mat-form-field",24),e.qZA(),e.YNc(42,Bs,4,2,"div",25),e.qZA(),e.qZA(),e.TgZ(43,"div",26),e.TgZ(44,"button",27),e.NdJ("click",function(){return a.resetData()}),e._uU(45,"Clear"),e.qZA(),e.TgZ(46,"button",28),e.NdJ("click",function(){return a.onBumpFee()}),e._uU(47),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t){const o=e.MAs(34);e.xp6(12),e.hij("Bump fee for channel point: ",null==a.bumpFeeChannel||null==a.bumpFeeChannel.channel?null:a.bumpFeeChannel.channel.channel_point," "),e.xp6(1),e.Q6J("icon",a.faCopy)("payload",null==a.bumpFeeChannel||null==a.bumpFeeChannel.channel?null:a.bumpFeeChannel.channel.txid_str),e.xp6(3),e.Q6J("icon",a.faInfoCircle),e.xp6(17),e.Q6J("ngModel",a.outputIndex)("step",1)("min",0),e.xp6(2),e.Q6J("ngIf",null==o.errors?null:o.errors.required),e.xp6(1),e.Q6J("ngIf",null==o.errors?null:o.errors.pendingChannelOutputIndex),e.xp6(2),e.Q6J("value",a.selTransType),e.xp6(1),e.Q6J("ngForOf",a.transTypes),e.xp6(1),e.Q6J("ngIf","1"===a.selTransType),e.xp6(1),e.Q6J("ngIf","2"===a.selTransType),e.xp6(1),e.Q6J("ngIf",""!==a.bumpFeeError),e.xp6(5),e.Oqu(""!==a.bumpFeeError?"Retry Bump Fee":"Bump Fee")}},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,A.dn,c._Y,c.JL,c.F,I.BN,f.R9,oe.y,W.gM,f.KE,R.Nt,c.wV,c.qQ,c.Fj,$.q,c.Q7,c.JJ,c.On,m.O5,O.gD,m.sg,f.TO,E.ey],styles:[""]}),n})();function Gs(n,i){1&n&&e._UZ(0,"mat-progress-bar",36)}function zs(n,i){1&n&&e._UZ(0,"mat-progress-bar",36)}function Vs(n,i){1&n&&(e.TgZ(0,"mat-header-cell",37),e._uU(1," Peer "),e.qZA())}const ue=function(n){return{"max-width":n}};function Ws(n,i){if(1&n&&(e.TgZ(0,"mat-cell",38),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,ue,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),e.xp6(1),e.Oqu(t.channel.remote_alias)}}function Xs(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1,"Commit Fee (Sats) "),e.qZA())}function $s(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.commit_fee))}}function js(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1,"Commit Weight "),e.qZA())}function Ks(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.commit_weight))}}function el(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1,"Capacity (Sats)"),e.qZA())}function tl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.capacity))}}function nl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",41),e._uU(1,"Actions"),e.qZA())}function al(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-cell",42),e.TgZ(1,"div",43),e.TgZ(2,"mat-select",44),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",45),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onOpenClick(s)}),e._uU(5,"View Info"),e.qZA(),e.TgZ(6,"mat-option",45),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onBumpFee(s)}),e._uU(7,"Bump Fee"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function il(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No pending channel."),e.qZA())}function ol(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting pending channels..."),e.qZA())}function sl(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function ll(n,i){if(1&n&&(e.TgZ(0,"td",46),e.YNc(1,il,2,0,"p",47),e.YNc(2,ol,2,0,"p",47),e.YNc(3,sl,2,1,"p",47),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!t.pendingOpenChannels||!(null!=t.pendingOpenChannels&&t.pendingOpenChannels.data)||(null==t.pendingOpenChannels||null==t.pendingOpenChannels.data?null:t.pendingOpenChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!t.pendingOpenChannels||!(null!=t.pendingOpenChannels&&t.pendingOpenChannels.data)||(null==t.pendingOpenChannels||null==t.pendingOpenChannels.data?null:t.pendingOpenChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!t.pendingOpenChannels||!(null!=t.pendingOpenChannels&&t.pendingOpenChannels.data)||(null==t.pendingOpenChannels||null==t.pendingOpenChannels.data?null:t.pendingOpenChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const xe=function(n){return{"display-none":n}};function rl(n,i){if(1&n&&e._UZ(0,"tr",48),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,xe,t.pendingOpenChannels&&(null==t.pendingOpenChannels?null:t.pendingOpenChannels.data)&&(null==t.pendingOpenChannels||null==t.pendingOpenChannels.data?null:t.pendingOpenChannels.data.length)>0))}}function cl(n,i){1&n&&e._UZ(0,"mat-header-row")}function ul(n,i){1&n&&e._UZ(0,"mat-row",49)}function pl(n,i){1&n&&e._UZ(0,"mat-progress-bar",36)}function ml(n,i){1&n&&(e.TgZ(0,"mat-header-cell",37),e._uU(1," Peer "),e.qZA())}function _l(n,i){if(1&n&&(e.TgZ(0,"mat-cell",38),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,ue,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),e.xp6(1),e.Oqu(t.channel.remote_alias)}}function dl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1,"Recovered Balance (Sats) "),e.qZA())}function hl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.recovered_balance))}}function gl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1,"Limbo Balance (Sats) "),e.qZA())}function fl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.limbo_balance))}}function Cl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1,"Capacity (Sats) "),e.qZA())}function xl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.capacity))}}function Tl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",50),e._uU(1,"Actions"),e.qZA())}function yl(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-cell",51),e.TgZ(1,"button",52),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onForceClosingClick(s)}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function Zl(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No pending channel."),e.qZA())}function bl(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting pending channels..."),e.qZA())}function Al(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function vl(n,i){if(1&n&&(e.TgZ(0,"td",46),e.YNc(1,Zl,2,0,"p",47),e.YNc(2,bl,2,0,"p",47),e.YNc(3,Al,2,1,"p",47),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!t.pendingForceClosingChannels||!(null!=t.pendingForceClosingChannels&&t.pendingForceClosingChannels.data)||(null==t.pendingForceClosingChannels||null==t.pendingForceClosingChannels.data?null:t.pendingForceClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!t.pendingForceClosingChannels||!(null!=t.pendingForceClosingChannels&&t.pendingForceClosingChannels.data)||(null==t.pendingForceClosingChannels||null==t.pendingForceClosingChannels.data?null:t.pendingForceClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!t.pendingForceClosingChannels||!(null!=t.pendingForceClosingChannels&&t.pendingForceClosingChannels.data)||(null==t.pendingForceClosingChannels||null==t.pendingForceClosingChannels.data?null:t.pendingForceClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}function wl(n,i){if(1&n&&e._UZ(0,"tr",48),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,xe,t.pendingForceClosingChannels&&(null==t.pendingForceClosingChannels?null:t.pendingForceClosingChannels.data)&&(null==t.pendingForceClosingChannels||null==t.pendingForceClosingChannels.data?null:t.pendingForceClosingChannels.data.length)>0))}}function ql(n,i){1&n&&e._UZ(0,"mat-header-row")}function Sl(n,i){1&n&&e._UZ(0,"mat-row",49)}function Ll(n,i){1&n&&e._UZ(0,"mat-progress-bar",36)}function kl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",53),e._uU(1," Peer "),e.qZA())}function Fl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",54),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,ue,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),e.xp6(1),e.Oqu(t.channel.remote_alias)}}function Nl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1," Local Balance (Sats) "),e.qZA())}function Ol(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.local_balance))}}function Ul(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1," Remote Balance (Sats) "),e.qZA())}function Rl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.remote_balance))}}function Il(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1," Capacity (Sats) "),e.qZA())}function Dl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.capacity))}}function Pl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",50),e._uU(1,"Actions"),e.qZA())}function Ml(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-cell",51),e.TgZ(1,"button",55),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onClosingClick(s)}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function Jl(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No pending channel."),e.qZA())}function Ql(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting pending channels..."),e.qZA())}function El(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function Yl(n,i){if(1&n&&(e.TgZ(0,"td",46),e.YNc(1,Jl,2,0,"p",47),e.YNc(2,Ql,2,0,"p",47),e.YNc(3,El,2,1,"p",47),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!t.pendingClosingChannels||!(null!=t.pendingClosingChannels&&t.pendingClosingChannels.data)||(null==t.pendingClosingChannels||null==t.pendingClosingChannels.data?null:t.pendingClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!t.pendingClosingChannels||!(null!=t.pendingClosingChannels&&t.pendingClosingChannels.data)||(null==t.pendingClosingChannels||null==t.pendingClosingChannels.data?null:t.pendingClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!t.pendingClosingChannels||!(null!=t.pendingClosingChannels&&t.pendingClosingChannels.data)||(null==t.pendingClosingChannels||null==t.pendingClosingChannels.data?null:t.pendingClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}function Bl(n,i){if(1&n&&e._UZ(0,"tr",48),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,xe,t.pendingClosingChannels&&(null==t.pendingClosingChannels?null:t.pendingClosingChannels.data)&&(null==t.pendingClosingChannels||null==t.pendingClosingChannels.data?null:t.pendingClosingChannels.data.length)>0))}}function Hl(n,i){1&n&&e._UZ(0,"mat-header-row")}function Gl(n,i){1&n&&e._UZ(0,"mat-row",49)}function zl(n,i){1&n&&e._UZ(0,"mat-progress-bar",36)}function Vl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",53),e._uU(1," Peer "),e.qZA())}function Wl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",54),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,ue,a.screenSize===a.screenSizeEnum.XS?"10rem":"30rem")),e.xp6(1),e.Oqu(t.channel.remote_alias)}}function Xl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1," Limbo Balance (Sats) "),e.qZA())}function $l(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij("",e.lcZ(2,1,t.limbo_balance)," ")}}function jl(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1," Local Balance (Sats) "),e.qZA())}function Kl(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.local_balance))}}function er(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1," Remote Balance (Sats) "),e.qZA())}function tr(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.remote_balance))}}function nr(n,i){1&n&&(e.TgZ(0,"mat-header-cell",39),e._uU(1," Capacity (Sats) "),e.qZA())}function ar(n,i){if(1&n&&(e.TgZ(0,"mat-cell",40),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.channel.capacity))}}function ir(n,i){1&n&&(e.TgZ(0,"mat-header-cell",50),e._uU(1,"Actions"),e.qZA())}function or(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-cell",51),e.TgZ(1,"button",56),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onWaitClosingClick(s)}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function sr(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No pending channel."),e.qZA())}function lr(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting pending channels..."),e.qZA())}function rr(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function cr(n,i){if(1&n&&(e.TgZ(0,"td",46),e.YNc(1,sr,2,0,"p",47),e.YNc(2,lr,2,0,"p",47),e.YNc(3,rr,2,1,"p",47),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!t.pendingWaitClosingChannels||!(null!=t.pendingWaitClosingChannels&&t.pendingWaitClosingChannels.data)||(null==t.pendingWaitClosingChannels||null==t.pendingWaitClosingChannels.data?null:t.pendingWaitClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!t.pendingWaitClosingChannels||!(null!=t.pendingWaitClosingChannels&&t.pendingWaitClosingChannels.data)||(null==t.pendingWaitClosingChannels||null==t.pendingWaitClosingChannels.data?null:t.pendingWaitClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!t.pendingWaitClosingChannels||!(null!=t.pendingWaitClosingChannels&&t.pendingWaitClosingChannels.data)||(null==t.pendingWaitClosingChannels||null==t.pendingWaitClosingChannels.data?null:t.pendingWaitClosingChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const ur=function(n){return{"py-0":!0,"display-none":n}};function pr(n,i){if(1&n&&e._UZ(0,"tr",48),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,ur,t.pendingWaitClosingChannels&&(null==t.pendingWaitClosingChannels?null:t.pendingWaitClosingChannels.data)&&(null==t.pendingWaitClosingChannels||null==t.pendingWaitClosingChannels.data?null:t.pendingWaitClosingChannels.data.length)>0))}}function mr(n,i){1&n&&e._UZ(0,"mat-header-row")}function _r(n,i){1&n&&e._UZ(0,"mat-row",49)}const pe=function(n){return{"error-border bordered-box":n,"bordered-box":!0}},dr=function(){return["no_pending_open"]},hr=function(){return["no_pending_force_closing"]},gr=function(){return["no_pending_closing"]},fr=function(){return["no_pending_wait_closing"]};let Cr=(()=>{class n{constructor(t,a,o){this.logger=t,this.store=a,this.commonService=o,this.selNode={},this.selectedFilter="",this.information={},this.pendingChannels={},this.displayedOpenColumns=["remote_alias","commit_fee","commit_weight","capacity","actions"],this.pendingOpenChannelsLength=0,this.displayedForceClosingColumns=["remote_alias","recovered_balance","limbo_balance","capacity","actions"],this.pendingForceClosingChannelsLength=0,this.displayedClosingColumns=["remote_alias","local_balance","remote_balance","capacity","actions"],this.pendingClosingChannelsLength=0,this.displayedWaitClosingColumns=["remote_alias","limbo_balance","local_balance","remote_balance","actions"],this.pendingWaitClosingChannelsLength=0,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.displayedOpenColumns=["remote_alias","actions"],this.displayedForceClosingColumns=["remote_alias","actions"],this.displayedClosingColumns=["remote_alias","actions"],this.displayedWaitClosingColumns=["remote_alias","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.displayedOpenColumns=["remote_alias","commit_fee","actions"],this.displayedForceClosingColumns=["remote_alias","limbo_balance","actions"],this.displayedClosingColumns=["remote_alias","remote_balance","actions"],this.displayedWaitClosingColumns=["remote_alias","limbo_balance","actions"]):(this.displayedOpenColumns=["remote_alias","commit_fee","commit_weight","capacity","actions"],this.displayedForceClosingColumns=["remote_alias","recovered_balance","limbo_balance","capacity","actions"],this.displayedClosingColumns=["remote_alias","local_balance","remote_balance","capacity","actions"],this.displayedWaitClosingColumns=["remote_alias","limbo_balance","local_balance","remote_balance","actions"])}ngOnInit(){this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t}),this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.information=t}),this.store.select(C.ni).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.pendingChannels=t.pendingChannels,this.pendingChannels.pending_open_channels&&this.pendingChannels.pending_open_channels.length&&this.pendingChannels.pending_open_channels.length>0&&this.loadOpenChannelsTable(this.pendingChannels.pending_open_channels),this.pendingChannels.pending_force_closing_channels&&this.pendingChannels.pending_force_closing_channels.length&&this.pendingChannels.pending_force_closing_channels.length>0&&this.loadForceClosingChannelsTable(this.pendingChannels.pending_force_closing_channels),this.pendingChannels.pending_closing_channels&&this.pendingChannels.pending_closing_channels.length&&this.pendingChannels.pending_closing_channels.length>0&&this.loadClosingChannelsTable(this.pendingChannels.pending_closing_channels),this.pendingChannels.waiting_close_channels&&this.pendingChannels.waiting_close_channels.length&&this.pendingChannels.waiting_close_channels.length>0&&this.loadWaitClosingChannelsTable(this.pendingChannels.waiting_close_channels),this.logger.info(t)})}ngAfterViewInit(){this.pendingChannels.pending_open_channels&&this.pendingChannels.pending_open_channels.length&&this.pendingChannels.pending_open_channels.length>0&&this.loadOpenChannelsTable(this.pendingChannels.pending_open_channels),this.pendingChannels.pending_force_closing_channels&&this.pendingChannels.pending_force_closing_channels.length&&this.pendingChannels.pending_force_closing_channels.length>0&&this.loadForceClosingChannelsTable(this.pendingChannels.pending_force_closing_channels),this.pendingChannels.pending_closing_channels&&this.pendingChannels.pending_closing_channels.length&&this.pendingChannels.pending_closing_channels.length>0&&this.loadClosingChannelsTable(this.pendingChannels.pending_closing_channels),this.pendingChannels.waiting_close_channels&&this.pendingChannels.waiting_close_channels.length&&this.pendingChannels.waiting_close_channels.length>0&&this.loadWaitClosingChannelsTable(this.pendingChannels.waiting_close_channels)}onOpenClick(t){const a=JSON.parse(JSON.stringify(t,["commit_weight","confirmation_height","fee_per_kw","commit_fee"],2)),o=JSON.parse(JSON.stringify(t.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),s={};Object.assign(s,a,o),this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Opening Channel Information",message:[[{key:"channel_point",value:s.channel_point,title:"Channel Point",width:100,type:l.Gi.STRING}],[{key:"remote_alias",value:s.remote_alias,title:"Peer Alias",width:25,type:l.Gi.STRING},{key:"remote_node_pub",value:s.remote_node_pub,title:"Peer Node Pubkey",width:75,type:l.Gi.STRING}],[{key:"capacity",value:s.capacity,title:"Capacity",width:25,type:l.Gi.NUMBER},{key:"confirmation_height",value:s.confirmation_height,title:"Confirmation Height",width:25,type:l.Gi.NUMBER},{key:"local_balance",value:s.local_balance,title:"Local Balance",width:25,type:l.Gi.NUMBER},{key:"remote_balance",value:s.remote_balance,title:"Remote Balance",width:25,type:l.Gi.NUMBER}],[{key:"fee_per_kw",value:s.fee_per_kw,title:"Fee/KW",width:25,type:l.Gi.NUMBER},{key:"commit_weight",value:s.commit_weight,title:"Commit Weight",width:25,type:l.Gi.NUMBER},{key:"commit_fee",value:s.commit_fee,title:"Commit Fee",width:50,type:l.Gi.NUMBER}]]}}}))}onBumpFee(t){this.store.dispatch((0,v.qR)({payload:{data:{pendingChannel:t,component:Hs}}}))}onForceClosingClick(t){const a=JSON.parse(JSON.stringify(t,["closing_txid","limbo_balance","maturity_height","blocks_til_maturity","recovered_balance"],2)),o=JSON.parse(JSON.stringify(t.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),s={};Object.assign(s,a,o),this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Force Closing Channel Information",message:[[{key:"closing_txid",value:s.closing_txid,title:"Closing Transaction ID",width:100,type:l.Gi.STRING}],[{key:"channel_point",value:s.channel_point,title:"Channel Point",width:100,type:l.Gi.STRING}],[{key:"remote_alias",value:s.remote_alias,title:"Peer Alias",width:25,type:l.Gi.STRING},{key:"remote_node_pub",value:s.remote_node_pub,title:"Peer Node Pubkey",width:75,type:l.Gi.STRING}],[{key:"capacity",value:s.capacity,title:"Capacity",width:25,type:l.Gi.NUMBER},{key:"limbo_balance",value:s.limbo_balance,title:"Limbo Balance",width:25,type:l.Gi.NUMBER},{key:"local_balance",value:s.local_balance,title:"Local Balance",width:25,type:l.Gi.NUMBER},{key:"remote_balance",value:s.remote_balance,title:"Remote Balance",width:25,type:l.Gi.NUMBER}],[{key:"maturity_height",value:s.maturity_height,title:"Maturity Height",width:25,type:l.Gi.NUMBER},{key:"blocks_til_maturity",value:s.blocks_til_maturity,title:"Blocks Till Maturity",width:25,type:l.Gi.NUMBER},{key:"recovered_balance",value:s.recovered_balance,title:"Recovered Balance",width:50,type:l.Gi.NUMBER}]]}}}))}onClosingClick(t){const a=JSON.parse(JSON.stringify(t,["closing_txid"],2)),o=JSON.parse(JSON.stringify(t.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),s={};Object.assign(s,a,o),this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Closing Channel Information",message:[[{key:"closing_txid",value:s.closing_txid,title:"Closing Transaction ID",width:50,type:l.Gi.STRING}],[{key:"channel_point",value:s.channel_point,title:"Channel Point",width:100,type:l.Gi.STRING}],[{key:"remote_alias",value:s.remote_alias,title:"Peer Alias",width:25,type:l.Gi.STRING},{key:"remote_node_pub",value:s.remote_node_pub,title:"Peer Node Pubkey",width:75,type:l.Gi.STRING}],[{key:"capacity",value:s.capacity,title:"Capacity",width:25,type:l.Gi.NUMBER},{key:"local_balance",value:s.local_balance,title:"Local Balance",width:25,type:l.Gi.NUMBER},{key:"remote_balance",value:s.remote_balance,title:"Remote Balance",width:50,type:l.Gi.NUMBER}]]}}}))}onWaitClosingClick(t){const a=JSON.parse(JSON.stringify(t,["limbo_balance"],2)),o=JSON.parse(JSON.stringify(t.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),s=JSON.parse(JSON.stringify(t.commitments,["local_txid"],2)),u={};Object.assign(u,a,o,s),this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Wait Closing Channel Information",message:[[{key:"local_txid",value:u.local_txid,title:"Transaction ID",width:100,type:l.Gi.STRING}],[{key:"channel_point",value:u.channel_point,title:"Channel Point",width:100,type:l.Gi.STRING}],[{key:"remote_alias",value:u.remote_alias,title:"Peer Alias",width:25,type:l.Gi.STRING},{key:"remote_node_pub",value:u.remote_node_pub,title:"Peer Node Pubkey",width:75,type:l.Gi.STRING}],[{key:"capacity",value:u.capacity,title:"Capacity",width:25,type:l.Gi.NUMBER},{key:"limbo_balance",value:u.limbo_balance,title:"Limbo Balance",width:25,type:l.Gi.NUMBER},{key:"local_balance",value:u.local_balance,title:"Local Balance",width:25,type:l.Gi.NUMBER},{key:"remote_balance",value:u.remote_balance,title:"Remote Balance",width:25,type:l.Gi.NUMBER}]]}}}))}loadOpenChannelsTable(t){t.sort((a,o)=>a.active===o.active?0:o.active?-1:1),this.pendingOpenChannelsLength=t.length?t.length:0,this.pendingOpenChannels=new r.by([...t]),this.pendingOpenChannels.sort=this.sort,this.pendingOpenChannels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.pendingOpenChannels.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.logger.info(this.pendingOpenChannels)}loadForceClosingChannelsTable(t){t.sort((a,o)=>a.active===o.active?0:o.active?-1:1),this.pendingForceClosingChannelsLength=t.length?t.length:0,this.pendingForceClosingChannels=new r.by([...t]),this.pendingForceClosingChannels.sort=this.sort,this.pendingForceClosingChannels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.pendingForceClosingChannels.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.logger.info(this.pendingForceClosingChannels)}loadClosingChannelsTable(t){t.sort((a,o)=>a.active===o.active?0:o.active?-1:1),this.pendingClosingChannelsLength=t.length?t.length:0,this.pendingClosingChannels=new r.by([...t]),this.pendingClosingChannels.sort=this.sort,this.pendingClosingChannels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.pendingClosingChannels.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.logger.info(this.pendingClosingChannels)}loadWaitClosingChannelsTable(t){t.sort((a,o)=>a.active===o.active?0:o.active?-1:1),this.pendingWaitClosingChannelsLength=t.length?t.length:0,this.pendingWaitClosingChannels=new r.by([...t]),this.pendingWaitClosingChannels.sort=this.sort,this.pendingWaitClosingChannels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.pendingWaitClosingChannels.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.logger.info(this.pendingWaitClosingChannels)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-pending-table"]],viewQuery:function(t,a){if(1&t&&e.Gf(Z.YE,5),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first)}},decls:121,vars:44,consts:[["fxLayout","column",1,"mb-2"],[1,"page-title"],["displayMode","flat",1,"mt-1"],["mode","indeterminate",4,"ngIf"],["fxLayout","column",1,"flat-expansion-panel"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","remote_alias"],["mat-sort-header","",4,"matHeaderCellDef"],[3,"ngStyle",4,"matCellDef"],["matColumnDef","commit_fee"],["fxLayoutAlign","end center","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","commit_weight"],["matColumnDef","capacity"],["matColumnDef","actions"],["fxLayoutAlign","end center","class","pl-3 pr-4",4,"matHeaderCellDef"],["fxLayoutAlign","end center","class","px-3",4,"matCellDef"],["matColumnDef","no_pending_open"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","","fxLayoutAlign","start center",3,"ngClass",4,"matFooterRowDef"],[4,"matHeaderRowDef"],["fxLayoutAlign","stretch stretch",4,"matRowDef","matRowDefColumns"],["mat-table","","matSort","",3,"dataSource","ngClass"],["matColumnDef","recovered_balance"],["matColumnDef","limbo_balance"],["fxLayoutAlign","end center","class","pl-4 pr-3",4,"matHeaderCellDef"],["fxLayoutAlign","end center","class","pl-4",4,"matCellDef"],["matColumnDef","no_pending_force_closing"],["class","pl-2","mat-sort-header","",4,"matHeaderCellDef"],["class","pl-2",3,"ngStyle",4,"matCellDef"],["matColumnDef","local_balance"],["matColumnDef","remote_balance"],["matColumnDef","no_pending_closing"],["matColumnDef","no_pending_wait_closing"],["mode","indeterminate"],["mat-sort-header",""],[3,"ngStyle"],["fxLayoutAlign","end center","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["fxLayoutAlign","end center",1,"pl-3","pr-4"],["fxLayoutAlign","end center",1,"px-3"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","","fxLayoutAlign","start center",3,"ngClass"],["fxLayoutAlign","stretch stretch"],["fxLayoutAlign","end center",1,"pl-4","pr-3"],["fxLayoutAlign","end center",1,"pl-4"],["mat-stroked-button","","color","primary","type","button","tabindex","2",3,"click"],["mat-sort-header","",1,"pl-2"],[1,"pl-2",3,"ngStyle"],["mat-stroked-button","","color","primary","type","button","tabindex","3",3,"click"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"span",1),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"mat-accordion",2),e.YNc(5,Gs,1,0,"mat-progress-bar",3),e.TgZ(6,"mat-expansion-panel",4),e.TgZ(7,"mat-expansion-panel-header"),e.TgZ(8,"mat-panel-title"),e._uU(9),e.qZA(),e.qZA(),e.TgZ(10,"div",5),e.YNc(11,zs,1,0,"mat-progress-bar",3),e.TgZ(12,"table",6,7),e.ynx(14,8),e.YNc(15,Vs,2,0,"mat-header-cell",9),e.YNc(16,Ws,2,4,"mat-cell",10),e.BQk(),e.ynx(17,11),e.YNc(18,Xs,2,0,"mat-header-cell",12),e.YNc(19,$s,3,3,"mat-cell",13),e.BQk(),e.ynx(20,14),e.YNc(21,js,2,0,"mat-header-cell",12),e.YNc(22,Ks,3,3,"mat-cell",13),e.BQk(),e.ynx(23,15),e.YNc(24,el,2,0,"mat-header-cell",12),e.YNc(25,tl,3,3,"mat-cell",13),e.BQk(),e.ynx(26,16),e.YNc(27,nl,2,0,"mat-header-cell",17),e.YNc(28,al,8,0,"mat-cell",18),e.BQk(),e.ynx(29,19),e.YNc(30,ll,4,3,"td",20),e.BQk(),e.YNc(31,rl,1,3,"tr",21),e.YNc(32,cl,1,0,"mat-header-row",22),e.YNc(33,ul,1,0,"mat-row",23),e.qZA(),e.qZA(),e.qZA(),e.YNc(34,pl,1,0,"mat-progress-bar",3),e.TgZ(35,"mat-expansion-panel",4),e.TgZ(36,"mat-expansion-panel-header"),e.TgZ(37,"mat-panel-title"),e._uU(38),e.qZA(),e.qZA(),e.TgZ(39,"div",5),e.TgZ(40,"table",24,7),e.ynx(42,8),e.YNc(43,ml,2,0,"mat-header-cell",9),e.YNc(44,_l,2,4,"mat-cell",10),e.BQk(),e.ynx(45,25),e.YNc(46,dl,2,0,"mat-header-cell",12),e.YNc(47,hl,3,3,"mat-cell",13),e.BQk(),e.ynx(48,26),e.YNc(49,gl,2,0,"mat-header-cell",12),e.YNc(50,fl,3,3,"mat-cell",13),e.BQk(),e.ynx(51,15),e.YNc(52,Cl,2,0,"mat-header-cell",12),e.YNc(53,xl,3,3,"mat-cell",13),e.BQk(),e.ynx(54,16),e.YNc(55,Tl,2,0,"mat-header-cell",27),e.YNc(56,yl,3,0,"mat-cell",28),e.BQk(),e.ynx(57,29),e.YNc(58,vl,4,3,"td",20),e.BQk(),e.YNc(59,wl,1,3,"tr",21),e.YNc(60,ql,1,0,"mat-header-row",22),e.YNc(61,Sl,1,0,"mat-row",23),e.qZA(),e.qZA(),e.qZA(),e.YNc(62,Ll,1,0,"mat-progress-bar",3),e.TgZ(63,"mat-expansion-panel",4),e.TgZ(64,"mat-expansion-panel-header"),e.TgZ(65,"mat-panel-title"),e._uU(66),e.qZA(),e.qZA(),e.TgZ(67,"div",5),e.TgZ(68,"table",24,7),e.ynx(70,8),e.YNc(71,kl,2,0,"mat-header-cell",30),e.YNc(72,Fl,2,4,"mat-cell",31),e.BQk(),e.ynx(73,32),e.YNc(74,Nl,2,0,"mat-header-cell",12),e.YNc(75,Ol,3,3,"mat-cell",13),e.BQk(),e.ynx(76,33),e.YNc(77,Ul,2,0,"mat-header-cell",12),e.YNc(78,Rl,3,3,"mat-cell",13),e.BQk(),e.ynx(79,15),e.YNc(80,Il,2,0,"mat-header-cell",12),e.YNc(81,Dl,3,3,"mat-cell",13),e.BQk(),e.ynx(82,16),e.YNc(83,Pl,2,0,"mat-header-cell",27),e.YNc(84,Ml,3,0,"mat-cell",28),e.BQk(),e.ynx(85,34),e.YNc(86,Yl,4,3,"td",20),e.BQk(),e.YNc(87,Bl,1,3,"tr",21),e.YNc(88,Hl,1,0,"mat-header-row",22),e.YNc(89,Gl,1,0,"mat-row",23),e.qZA(),e.qZA(),e.qZA(),e.YNc(90,zl,1,0,"mat-progress-bar",3),e.TgZ(91,"mat-expansion-panel",4),e.TgZ(92,"mat-expansion-panel-header"),e.TgZ(93,"mat-panel-title"),e._uU(94),e.qZA(),e.qZA(),e.TgZ(95,"div",5),e.TgZ(96,"table",24,7),e.ynx(98,8),e.YNc(99,Vl,2,0,"mat-header-cell",30),e.YNc(100,Wl,2,4,"mat-cell",31),e.BQk(),e.ynx(101,26),e.YNc(102,Xl,2,0,"mat-header-cell",12),e.YNc(103,$l,3,3,"mat-cell",13),e.BQk(),e.ynx(104,32),e.YNc(105,jl,2,0,"mat-header-cell",12),e.YNc(106,Kl,3,3,"mat-cell",13),e.BQk(),e.ynx(107,33),e.YNc(108,er,2,0,"mat-header-cell",12),e.YNc(109,tr,3,3,"mat-cell",13),e.BQk(),e.ynx(110,15),e.YNc(111,nr,2,0,"mat-header-cell",12),e.YNc(112,ar,3,3,"mat-cell",13),e.BQk(),e.ynx(113,16),e.YNc(114,ir,2,0,"mat-header-cell",27),e.YNc(115,or,3,0,"mat-cell",28),e.BQk(),e.ynx(116,35),e.YNc(117,cr,4,3,"td",20),e.BQk(),e.YNc(118,pr,1,3,"tr",21),e.YNc(119,mr,1,0,"mat-header-row",22),e.YNc(120,_r,1,0,"mat-row",23),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(2),e.hij("Total Limbo Balance: ",e.lcZ(3,30,a.pendingChannels.total_limbo_balance)," Sats"),e.xp6(3),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(4),e.hij("Pending Open (",a.pendingOpenChannelsLength,")"),e.xp6(2),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.pendingOpenChannels)("ngClass",e.VKq(32,pe,""!==a.errorMessage)),e.xp6(19),e.Q6J("matFooterRowDef",e.DdM(34,dr)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedOpenColumns),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedOpenColumns),e.xp6(1),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(4),e.hij("Pending Force Closing (",a.pendingForceClosingChannelsLength,")"),e.xp6(2),e.Q6J("dataSource",a.pendingForceClosingChannels)("ngClass",e.VKq(35,pe,""!==a.errorMessage)),e.xp6(19),e.Q6J("matFooterRowDef",e.DdM(37,hr)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedForceClosingColumns),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedForceClosingColumns),e.xp6(1),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(4),e.hij("Pending Closing (",a.pendingClosingChannelsLength,")"),e.xp6(2),e.Q6J("dataSource",a.pendingClosingChannels)("ngClass",e.VKq(38,pe,""!==a.errorMessage)),e.xp6(19),e.Q6J("matFooterRowDef",e.DdM(40,gr)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedClosingColumns),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedClosingColumns),e.xp6(1),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(4),e.hij("Waiting Close (",a.pendingWaitClosingChannelsLength,")"),e.xp6(2),e.Q6J("dataSource",a.pendingWaitClosingChannels)("ngClass",e.VKq(41,pe,""!==a.errorMessage)),e.xp6(22),e.Q6J("matFooterRowDef",e.DdM(43,fr)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedWaitClosingColumns),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedWaitClosingColumns))},directives:[_.xw,H.pp,m.O5,H.ib,H.yz,H.yK,_.Wh,_.yH,Y.$V,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,O.gD,O.$L,E.ey,r.yh,r.Q2,r.XQ,r.Gk,L.lW],pipes:[m.JJ],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tr.mat-footer-row[_ngcontent-%COMP%] td.mat-footer-cell[_ngcontent-%COMP%]{border-bottom:none}"]}),n})();function xr(n,i){1&n&&e._UZ(0,"mat-progress-bar",27)}function Tr(n,i){1&n&&(e.TgZ(0,"th",28),e._uU(1," Close Type "),e.qZA())}function yr(n,i){if(1&n&&(e.TgZ(0,"td",29),e.TgZ(1,"div",30),e.TgZ(2,"mat-icon",31),e._uU(3,"info_outline"),e.qZA(),e._uU(4),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.xp6(2),e.Q6J("matTooltip",a.channelClosureType[t.close_type].tooltip),e.xp6(2),e.hij(" ",a.channelClosureType[t.close_type].name," ")}}function Zr(n,i){1&n&&(e.TgZ(0,"th",28),e._uU(1," Peer "),e.qZA())}const br=function(n){return{"max-width":n}};function Ar(n,i){if(1&n&&(e.TgZ(0,"td",32),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,br,a.screenSize===a.screenSizeEnum.XS?"10rem":"20rem")),e.xp6(1),e.hij(" ",t.remote_alias," ")}}function vr(n,i){1&n&&(e.TgZ(0,"th",33),e._uU(1," Capacity "),e.qZA())}function wr(n,i){if(1&n&&(e.TgZ(0,"td",29),e.TgZ(1,"span",34),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,t.capacity)," ")}}function qr(n,i){1&n&&(e.TgZ(0,"th",33),e._uU(1," Close Height "),e.qZA())}function Sr(n,i){if(1&n&&(e.TgZ(0,"td",29),e.TgZ(1,"span",34),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,t.close_height)," ")}}function Lr(n,i){1&n&&(e.TgZ(0,"th",33),e._uU(1," Settled Balance "),e.qZA())}function kr(n,i){if(1&n&&(e.TgZ(0,"td",29),e.TgZ(1,"span",34),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,t.settled_balance)," ")}}function Fr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",35),e.TgZ(1,"div",36),e.TgZ(2,"mat-select",37),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",38),e.NdJ("click",function(){return e.CHM(t),e.oxw().onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function Nr(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",39),e.TgZ(1,"span",34),e.TgZ(2,"button",40),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw().onClosedChannelClick(u,o)}),e._uU(3,"View Info"),e.qZA(),e.qZA(),e.qZA()}}function Or(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No closed channel available."),e.qZA())}function Ur(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting closed channels..."),e.qZA())}function Rr(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function Ir(n,i){if(1&n&&(e.TgZ(0,"td",41),e.YNc(1,Or,2,0,"p",42),e.YNc(2,Ur,2,0,"p",42),e.YNc(3,Rr,2,1,"p",42),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!(null!=t.closedChannels&&t.closedChannels.data)||(null==t.closedChannels||null==t.closedChannels.data?null:t.closedChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.closedChannels&&t.closedChannels.data)||(null==t.closedChannels||null==t.closedChannels.data?null:t.closedChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.closedChannels&&t.closedChannels.data)||(null==t.closedChannels||null==t.closedChannels.data?null:t.closedChannels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const Dr=function(n){return{"display-none":n}};function Pr(n,i){if(1&n&&e._UZ(0,"tr",43),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,Dr,(null==t.closedChannels?null:t.closedChannels.data)&&(null==t.closedChannels||null==t.closedChannels.data?null:t.closedChannels.data.length)>0))}}function Mr(n,i){1&n&&e._UZ(0,"tr",44)}function Jr(n,i){1&n&&e._UZ(0,"tr",45)}const Qr=function(n){return{"error-border":n,"overflow-auto":!0}},Er=function(){return["no_closed_channel"]};let Yr=(()=>{class n{constructor(t,a,o){this.logger=t,this.store=a,this.commonService=o,this.channelClosureType=l.HW,this.faHistory=y.qO$,this.displayedColumns=[],this.closedChannelsData=[],this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unsub=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["remote_alias","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["close_type","remote_alias","settled_balance","actions"]):(this.flgSticky=!0,this.displayedColumns=["close_type","remote_alias","capacity","close_height","settled_balance","actions"])}ngOnInit(){this.store.select(C.P2).pipe((0,d.R)(this.unsub[0])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.closedChannelsData=t.closedChannels,this.closedChannelsData.length>0&&this.loadClosedChannelsTable(this.closedChannelsData),this.logger.info(t)})}ngAfterViewInit(){this.closedChannelsData.length>0&&this.loadClosedChannelsTable(this.closedChannelsData)}applyFilter(){this.closedChannels.filter=this.selFilter.trim().toLowerCase()}onClosedChannelClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Closed Channel Information",message:[[{key:"close_type",value:this.channelClosureType[t.close_type].name,title:"Close Type",width:30,type:l.Gi.STRING},{key:"settled_balance",value:t.settled_balance,title:"Settled Balance",width:30,type:l.Gi.NUMBER},{key:"time_locked_balance",value:t.time_locked_balance,title:"Time Locked Balance",width:40,type:l.Gi.NUMBER}],[{key:"chan_id",value:t.chan_id,title:"Channel ID",width:30},{key:"capacity",value:t.capacity,title:"Capacity",width:30,type:l.Gi.NUMBER},{key:"close_height",value:t.close_height,title:"Close Height",width:40,type:l.Gi.NUMBER}],[{key:"remote_alias",value:t.remote_alias,title:"Peer Alias",width:30},{key:"remote_pubkey",value:t.remote_pubkey,title:"Peer Public Key",width:70}],[{key:"channel_point",value:t.channel_point,title:"Channel Point",width:100}],[{key:"closing_tx_hash",value:t.closing_tx_hash,title:"Closing Transaction Hash",width:100,type:l.Gi.STRING}]]}}}))}loadClosedChannelsTable(t){this.closedChannels=new r.by([...t]),this.closedChannels.sort=this.sort,this.closedChannels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.closedChannels.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.closedChannels.paginator=this.paginator,this.applyFilter(),this.logger.info(this.closedChannels)}onDownloadCSV(){this.closedChannels.data&&this.closedChannels.data.length>0&&this.commonService.downloadFile(this.closedChannels.data,"Closed-channels")}ngOnDestroy(){this.unsub.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-closed-table"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Channels")}])],decls:33,vars:14,consts:[["fxLayout","column"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","close_type"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","remote_alias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","capacity"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","close_height"],["matColumnDef","settled_balance"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1",4,"matCellDef"],["matColumnDef","no_closed_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["fxLayout","row","fxLayoutAlign","start center"],[1,"info-icon","info-icon-text",3,"matTooltip"],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pl-1"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e._UZ(2,"div",2),e.TgZ(3,"mat-form-field",3),e.TgZ(4,"input",4),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(5,"div",5),e.YNc(6,xr,1,0,"mat-progress-bar",6),e.TgZ(7,"table",7,8),e.ynx(9,9),e.YNc(10,Tr,2,0,"th",10),e.YNc(11,yr,5,2,"td",11),e.BQk(),e.ynx(12,12),e.YNc(13,Zr,2,0,"th",10),e.YNc(14,Ar,2,4,"td",13),e.BQk(),e.ynx(15,14),e.YNc(16,vr,2,0,"th",15),e.YNc(17,wr,4,3,"td",11),e.BQk(),e.ynx(18,16),e.YNc(19,qr,2,0,"th",15),e.YNc(20,Sr,4,3,"td",11),e.BQk(),e.ynx(21,17),e.YNc(22,Lr,2,0,"th",15),e.YNc(23,kr,4,3,"td",11),e.BQk(),e.ynx(24,18),e.YNc(25,Fr,6,0,"th",19),e.YNc(26,Nr,4,0,"td",20),e.BQk(),e.ynx(27,21),e.YNc(28,Ir,4,3,"td",22),e.BQk(),e.YNc(29,Pr,1,3,"tr",23),e.YNc(30,Mr,1,0,"tr",24),e.YNc(31,Jr,1,0,"tr",25),e.qZA(),e.qZA(),e._UZ(32,"mat-paginator",26),e.qZA()),2&t&&(e.xp6(4),e.Q6J("ngModel",a.selFilter),e.xp6(2),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.closedChannels)("ngClass",e.VKq(11,Qr,""!==a.errorMessage)),e.xp6(22),e.Q6J("matFooterRowDef",e.DdM(13,Er)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,_.Wh,_.yH,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,m.O5,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,j.Hw,W.gM,m.PC,S.Zl,O.gD,O.$L,E.ey,L.lW,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-close_type[_ngcontent-%COMP%]{flex:0 0 16%;min-width:5rem}.mat-column-remote_alias[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();function Br(n,i){1&n&&e._UZ(0,"mat-progress-bar",27)}function Hr(n,i){1&n&&(e.TgZ(0,"th",28),e._uU(1,"Amount (Sats)"),e.qZA())}function Gr(n,i){if(1&n&&(e.TgZ(0,"span",33),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",e.lcZ(2,1,null==t?null:t.amount)," ")}}function zr(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,Gr,3,3,"span",32),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.pending_htlcs)}}function Vr(n,i){if(1&n&&(e.TgZ(0,"td",29),e.TgZ(1,"span",30),e._uU(2),e.qZA(),e.YNc(3,zr,2,1,"span",31),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" Active HTLCs: ",null==t||null==t.pending_htlcs?null:t.pending_htlcs.length," "),e.xp6(1),e.Q6J("ngIf",t.is_expanded)}}function Wr(n,i){1&n&&(e.TgZ(0,"th",28),e._uU(1,"Alias/Incoming"),e.qZA())}function Xr(n,i){if(1&n&&(e.TgZ(0,"span",30),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",null!=t&&t.incoming?"Yes":"No"," ")}}function $r(n,i){if(1&n&&(e.ynx(0),e.YNc(1,Xr,2,1,"span",34),e.BQk()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.pending_htlcs)}}function jr(n,i){if(1&n&&(e.TgZ(0,"td",29),e.TgZ(1,"span",30),e._uU(2),e.qZA(),e.YNc(3,$r,2,1,"ng-container",31),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(null==t?null:t.remote_alias),e.xp6(1),e.Q6J("ngIf",t.is_expanded)}}function Kr(n,i){1&n&&(e.TgZ(0,"th",35),e.TgZ(1,"span",36),e._uU(2,"Expiration Height"),e.qZA(),e.qZA())}function ec(n,i){if(1&n&&(e.TgZ(0,"span",36),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,null==t?null:t.expiration_height,"1.0-0")," ")}}function tc(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,ec,3,4,"span",37),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.pending_htlcs)}}function nc(n,i){if(1&n&&(e.TgZ(0,"td",29),e.TgZ(1,"span",36),e._uU(2),e.qZA(),e.YNc(3,tc,2,1,"span",31),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(" "),e.xp6(1),e.Q6J("ngIf",t.is_expanded)}}function ac(n,i){1&n&&(e.TgZ(0,"th",38),e.TgZ(1,"span",36),e._uU(2,"Hash Lock"),e.qZA(),e.qZA())}function ic(n,i){if(1&n&&(e.TgZ(0,"span",36),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",null==t?null:t.hash_lock," ")}}function oc(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,ic,2,1,"span",37),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.pending_htlcs)}}function sc(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",36),e._uU(2),e.qZA(),e.YNc(3,oc,2,1,"span",31),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(" "),e.xp6(1),e.Q6J("ngIf",t.is_expanded)}}function lc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",40),e.TgZ(1,"div",41),e.TgZ(2,"mat-select",42),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",43),e.NdJ("click",function(){return e.CHM(t),e.oxw().onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function rc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",45),e.TgZ(1,"button",48),e.NdJ("click",function(){const s=e.CHM(t).$implicit,u=e.oxw(2).$implicit;return e.oxw().onHTLCClick(s,u)}),e._uU(2),e.qZA(),e.qZA()}if(2&n){const t=i.index;e.xp6(2),e.hij("View ",t+1,"")}}function cc(n,i){if(1&n&&(e.TgZ(0,"div"),e.YNc(1,rc,3,1,"div",47),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",null==t?null:t.pending_htlcs)}}function uc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",44),e.TgZ(1,"span",45),e.TgZ(2,"button",46),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return s.is_expanded=!s.is_expanded}),e._uU(3),e.qZA(),e.qZA(),e.YNc(4,cc,2,1,"div",31),e.qZA()}if(2&n){const t=i.$implicit;e.xp6(3),e.Oqu(t.is_expanded?"Hide":"Show"),e.xp6(1),e.Q6J("ngIf",t.is_expanded)}}function pc(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No active htlc available."),e.qZA())}function mc(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting active htlcs..."),e.qZA())}function _c(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function dc(n,i){if(1&n&&(e.TgZ(0,"td",49),e.YNc(1,pc,2,0,"p",31),e.YNc(2,mc,2,0,"p",31),e.YNc(3,_c,2,1,"p",31),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const hc=function(n){return{"display-none":n}};function gc(n,i){if(1&n&&e._UZ(0,"tr",50),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,hc,(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function fc(n,i){1&n&&e._UZ(0,"tr",51)}function Cc(n,i){1&n&&e._UZ(0,"tr",52)}const xc=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Tc=function(){return["no_channel"]};let yc=(()=>{class n{constructor(t,a,o){this.logger=t,this.commonService=a,this.store=o,this.channelsJSONArr=[],this.displayedColumns=[],this.htlcColumns=[],this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["amount","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["amount","incoming","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["amount","incoming","expiration_height","actions"]):(this.flgSticky=!0,this.displayedColumns=["amount","incoming","expiration_height","hash_lock","actions"])}ngOnInit(){this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.channelsJSONArr=t.channels.filter(a=>a.pending_htlcs&&a.pending_htlcs.length>0)||[],this.loadHTLCsTable(this.channelsJSONArr),this.logger.info(t)})}ngAfterViewInit(){this.loadHTLCsTable(this.channelsJSONArr)}onHTLCClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"HTLC Information",message:[[{key:"remote_alias",value:a.remote_alias,title:"Alias",width:100,type:l.Gi.STRING}],[{key:"amount",value:t.amount,title:"Amount (Sats)",width:50,type:l.Gi.NUMBER},{key:"incoming",value:t.incoming?"Yes":"No",title:"Incoming",width:50,type:l.Gi.STRING}],[{key:"expiration_height",value:t.expiration_height,title:"Expiration Height",width:50,type:l.Gi.NUMBER},{key:"hash_lock",value:t.hash_lock,title:"Hash Lock",width:50,type:l.Gi.STRING}]]}}}))}onChannelClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{channel:t,showCopy:!0,component:fe}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}loadHTLCsTable(t){this.channels=new r.by(t?[...t]:[]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(a,o)=>{switch(o){case"amount":return this.commonService.sortByKey(a.pending_htlcs,o,"number",this.sort.direction),a.pending_htlcs&&a.pending_htlcs.length?a.pending_htlcs.length:null;case"incoming":return this.commonService.sortByKey(a.pending_htlcs,o,"boolean",this.sort.direction),a.remote_alias?a.remote_alias:a.remote_pubkey?a.remote_pubkey:null;case"expiration_height":case"hash_lock":return this.commonService.sortByKey(a.pending_htlcs,o,"number",this.sort.direction),a;default:return a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null}},this.channels.paginator=this.paginator,this.channels.filterPredicate=(a,o)=>((a.remote_alias?a.remote_alias.toLowerCase():"")+a.pending_htlcs.map(u=>JSON.stringify(u)+(u.incoming?"yes":"no"))).includes(o),this.applyFilter()}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.flattenHTLCs(),"ActiveHTLCs")}flattenHTLCs(){return JSON.parse(JSON.stringify(this.channels.data)).reduce((o,s)=>o.concat(s.pending_htlcs?s.pending_htlcs:s),[])}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-active-htlcs-table"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("HTLCs")}])],decls:30,vars:14,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","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","incoming"],["matColumnDef","expiration_height"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","hash_lock"],["mat-header-cell","","mat-sort-header","","arrowPosition","before","class","pl-3 htlc-row-span",4,"matHeaderCellDef"],["mat-cell","","class","pl-3",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","px-2",4,"matHeaderCellDef"],["mat-cell","","class","px-2",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["fxLayoutAlign","start center",1,"htlc-row-span"],[4,"ngIf"],["fxLayoutAlign","start center","class","htlc-row-span pl-3",4,"ngFor","ngForOf"],["fxLayoutAlign","start center",1,"htlc-row-span","pl-3"],["fxLayoutAlign","start center","class","htlc-row-span",4,"ngFor","ngForOf"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center",1,"htlc-row-span"],["fxLayoutAlign","end center","class","htlc-row-span",4,"ngFor","ngForOf"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",1,"pl-3","htlc-row-span"],["mat-cell","",1,"pl-3"],["mat-header-cell","",1,"px-2"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","",1,"px-2"],["fxLayoutAlign","end center"],["mat-flat-button","","color","primary","type","button","tabindex","5",1,"btn-htlc-expand",3,"click"],["fxLayoutAlign","end center",4,"ngFor","ngForOf"],["mat-stroked-button","","color","primary","type","button","tabindex","6",1,"btn-htlc-info",3,"click"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e._UZ(2,"div",2),e.TgZ(3,"mat-form-field",3),e.TgZ(4,"input",4),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(5,"div",5),e.YNc(6,Br,1,0,"mat-progress-bar",6),e.TgZ(7,"table",7,8),e.ynx(9,9),e.YNc(10,Hr,2,0,"th",10),e.YNc(11,Vr,4,2,"td",11),e.BQk(),e.ynx(12,12),e.YNc(13,Wr,2,0,"th",10),e.YNc(14,jr,4,2,"td",11),e.BQk(),e.ynx(15,13),e.YNc(16,Kr,3,0,"th",14),e.YNc(17,nc,4,2,"td",11),e.BQk(),e.ynx(18,15),e.YNc(19,ac,3,0,"th",16),e.YNc(20,sc,4,2,"td",17),e.BQk(),e.ynx(21,18),e.YNc(22,lc,6,0,"th",19),e.YNc(23,uc,5,2,"td",20),e.BQk(),e.ynx(24,21),e.YNc(25,dc,4,3,"td",22),e.BQk(),e.YNc(26,gc,1,3,"tr",23),e.YNc(27,fc,1,0,"tr",24),e.YNc(28,Cc,1,0,"tr",25),e.qZA(),e.qZA(),e._UZ(29,"mat-paginator",26),e.qZA()),2&t&&(e.xp6(4),e.Q6J("ngModel",a.selFilter),e.xp6(2),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.channels)("ngClass",e.VKq(11,xc,""!==a.errorMessage)),e.xp6(19),e.Q6J("matFooterRowDef",e.DdM(13,Tc)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,_.Wh,_.yH,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,m.O5,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,m.sg,O.gD,O.$L,E.ey,L.lW,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-amount[_ngcontent-%COMP%], .mat-column-expiration_height[_ngcontent-%COMP%]{flex:0 0 30%;width:30%}.mat-column-incoming[_ngcontent-%COMP%], .mat-column-hash_lock[_ngcontent-%COMP%]{flex:0 0 25%;width:25%;text-overflow:ellipsis}.htlc-row-span[_ngcontent-%COMP%]{min-height:4.2rem;place-content:center flex-start;align-items:center}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}.mat-column-actions[_ngcontent-%COMP%] .btn-htlc-expand[_ngcontent-%COMP%]{width:9rem}.mat-column-actions[_ngcontent-%COMP%] .btn-htlc-info[_ngcontent-%COMP%]{margin-top:.5rem;width:9rem}"]}),n})();function Zc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Wallet password is required."),e.qZA())}let bc=(()=>{class n{constructor(t){this.store=t,this.walletPassword=""}ngOnInit(){this.walletPassword=""}onUnlockWallet(){if(!this.walletPassword)return!0;this.store.dispatch((0,b.xG)({payload:{pwd:window.btoa(this.walletPassword)}}))}resetData(){this.walletPassword=""}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-unlock-wallet"]],decls:12,vars:2,consts:[["fxLayout","column",1,"padding-gap","mb-2"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between"],["fxFlex","100","fxLayoutAlign","start"],["autoFocus","","matInput","","type","password","placeholder","Password","name","walletPassword","tabindex","1","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","3",3,"click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"form",1),e.TgZ(2,"mat-form-field",2),e.TgZ(3,"input",3),e.NdJ("ngModelChange",function(s){return a.walletPassword=s}),e.qZA(),e.TgZ(4,"mat-hint"),e._uU(5,"Enter Wallet Password"),e.qZA(),e.YNc(6,Zc,2,0,"mat-error",4),e.qZA(),e.TgZ(7,"div",5),e.TgZ(8,"button",6),e.NdJ("click",function(){return a.resetData()}),e._uU(9,"Clear Field"),e.qZA(),e.TgZ(10,"button",7),e.NdJ("click",function(){return a.onUnlockWallet()}),e._uU(11,"Unlock Wallet"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(3),e.Q6J("ngModel",a.walletPassword),e.xp6(3),e.Q6J("ngIf",!a.walletPassword))},directives:[_.xw,c._Y,c.JL,c.F,_.Wh,f.KE,_.yH,R.Nt,c.Fj,V.h,c.Q7,c.JJ,c.On,f.bx,m.O5,L.lW,f.TO],styles:[""]}),n})();var Ac=h(1555);function vc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"form",4),e.TgZ(2,"div",5),e._uU(3,"Warning: Your connection is unsecure, it's not safe to generate private keys over this connection.Are you sure you want to proceed?"),e.qZA(),e.TgZ(4,"div",6),e.TgZ(5,"button",7),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return o.proceed=!1,o.warnRes=!0}),e._uU(6,"Do Not Proceed"),e.qZA(),e.TgZ(7,"button",8),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return o.proceed=!0,o.warnRes=!0}),e._uU(8,"Proceed"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function wc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"div",10),e._uU(2,"Please re-configure & re-start RTL after securing your LND connction. You can close this window now."),e.qZA(),e.TgZ(3,"div",6),e.TgZ(4,"button",11),e.NdJ("click",function(){return e.CHM(t),e.oxw().warnRes=!1}),e._uU(5,"Go Back"),e.qZA(),e.qZA(),e.qZA()}}function qc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Password is required."),e.qZA())}function Sc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Password must be at least 8 characters in length."),e.qZA())}function Lc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Confirm password is required."),e.qZA())}function kc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Confirm password must be at least 8 characters in length."),e.qZA())}function Fc(n,i){1&n&&(e.TgZ(0,"div",41),e.TgZ(1,"mat-icon",42),e._uU(2,"cancel"),e.qZA(),e._uU(3,"Passwords do not match. "),e.qZA())}function Nc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Cipher seed is required."),e.qZA())}function Oc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Invalid Cipher. Enter comma separated 24 words cipher seed."),e.qZA())}function Uc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Passphrase is required."),e.qZA())}function Rc(n,i){1&n&&(e.TgZ(0,"mat-icon"),e._uU(1,"vpn_key"),e.qZA())}function Ic(n,i){1&n&&(e.TgZ(0,"mat-icon"),e._uU(1,"swap_calls"),e.qZA())}function Dc(n,i){1&n&&(e.TgZ(0,"mat-icon"),e._uU(1,"fingerprint"),e.qZA())}function Pc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-vertical-stepper",12,13),e.TgZ(2,"mat-step",14),e.TgZ(3,"form",15),e.TgZ(4,"mat-form-field",16),e._UZ(5,"input",17),e.TgZ(6,"mat-hint"),e._uU(7,"Enter Wallet Password"),e.qZA(),e.YNc(8,qc,2,0,"mat-error",1),e.YNc(9,Sc,2,0,"mat-error",1),e.qZA(),e.TgZ(10,"mat-form-field",16),e._UZ(11,"input",18),e.TgZ(12,"mat-hint"),e._uU(13,"Confirm Wallet Password"),e.qZA(),e.YNc(14,Lc,2,0,"mat-error",1),e.YNc(15,kc,2,0,"mat-error",1),e.qZA(),e.YNc(16,Fc,4,0,"div",19),e.TgZ(17,"div",20),e.TgZ(18,"button",21),e._uU(19,"Next"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(20,"mat-step",22),e.TgZ(21,"form",23),e.TgZ(22,"div",24),e.TgZ(23,"mat-slide-toggle",25),e._uU(24,"Existing Cipher"),e.qZA(),e.TgZ(25,"mat-form-field",26),e._UZ(26,"input",27),e.TgZ(27,"mat-hint"),e._uU(28,"Cipher Seed"),e.qZA(),e.YNc(29,Nc,2,0,"mat-error",1),e.YNc(30,Oc,2,0,"mat-error",1),e.qZA(),e.qZA(),e.TgZ(31,"div",28),e.TgZ(32,"button",29),e._uU(33,"Back"),e.qZA(),e.TgZ(34,"button",30),e._uU(35,"Next"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(36,"mat-step",31),e.TgZ(37,"form",23),e.TgZ(38,"div",24),e.TgZ(39,"mat-slide-toggle",32),e._uU(40,"Existing Passphrase"),e.qZA(),e.TgZ(41,"mat-form-field",33),e._UZ(42,"input",34),e.TgZ(43,"mat-hint"),e._uU(44,"Enter Passphrase"),e.qZA(),e.YNc(45,Uc,2,0,"mat-error",1),e.qZA(),e.qZA(),e.TgZ(46,"div",28),e.TgZ(47,"button",35),e.NdJ("click",function(){return e.CHM(t),e.oxw().resetData()}),e._uU(48,"Clear"),e.qZA(),e.TgZ(49,"button",36),e._uU(50,"Back"),e.qZA(),e.TgZ(51,"button",37),e.NdJ("click",function(){return e.CHM(t),e.oxw().onInitWallet()}),e._uU(52,"Initialize Wallet"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.YNc(53,Rc,2,0,"ng-template",38),e.YNc(54,Ic,2,0,"ng-template",39),e.YNc(55,Dc,2,0,"ng-template",40),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("linear",!0),e.xp6(2),e.Q6J("stepControl",t.passwordFormGroup),e.xp6(1),e.Q6J("formGroup",t.passwordFormGroup),e.xp6(5),e.Q6J("ngIf",null==t.passwordFormGroup.controls.initWalletPassword.errors?null:t.passwordFormGroup.controls.initWalletPassword.errors.required),e.xp6(1),e.Q6J("ngIf",null==t.passwordFormGroup.controls.initWalletPassword.errors?null:t.passwordFormGroup.controls.initWalletPassword.errors.minlength),e.xp6(5),e.Q6J("ngIf",null==t.passwordFormGroup.controls.initWalletConfirmPassword.errors?null:t.passwordFormGroup.controls.initWalletConfirmPassword.errors.required),e.xp6(1),e.Q6J("ngIf",null==t.passwordFormGroup.controls.initWalletConfirmPassword.errors?null:t.passwordFormGroup.controls.initWalletConfirmPassword.errors.minlength),e.xp6(1),e.Q6J("ngIf",(null==t.passwordFormGroup.errors?null:t.passwordFormGroup.errors.unmatchedPasswords)&&(t.passwordFormGroup.controls.initWalletPassword.touched||t.passwordFormGroup.controls.initWalletPassword.dirty)&&(t.passwordFormGroup.controls.initWalletConfirmPassword.touched||t.passwordFormGroup.controls.initWalletConfirmPassword.dirty)),e.xp6(4),e.Q6J("stepControl",t.cipherFormGroup),e.xp6(1),e.Q6J("formGroup",t.cipherFormGroup),e.xp6(2),e.Q6J("labelPosition","before"),e.xp6(6),e.Q6J("ngIf",null==t.cipherFormGroup.controls.cipherSeed.errors?null:t.cipherFormGroup.controls.cipherSeed.errors.required),e.xp6(1),e.Q6J("ngIf",!(null!=t.cipherFormGroup.controls.cipherSeed.errors&&t.cipherFormGroup.controls.cipherSeed.errors.required)&&(null==t.cipherFormGroup.controls.cipherSeed.errors?null:t.cipherFormGroup.controls.cipherSeed.errors.invalidCipher)),e.xp6(6),e.Q6J("stepControl",t.passphraseFormGroup),e.xp6(1),e.Q6J("formGroup",t.passphraseFormGroup),e.xp6(2),e.Q6J("labelPosition","before"),e.xp6(6),e.Q6J("ngIf",null==t.passphraseFormGroup.controls.passphrase.errors?null:t.passphraseFormGroup.controls.passphrase.errors.required)}}function Mc(n,i){if(1&n&&(e.TgZ(0,"span",48),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t)}}function Jc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"form",4),e.TgZ(2,"div",43),e._uU(3,"YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!"),e.qZA(),e.TgZ(4,"div",44),e.YNc(5,Mc,2,1,"span",45),e.qZA(),e.TgZ(6,"div",46),e._uU(7,"Wallet initialization is done."),e.qZA(),e.TgZ(8,"div",46),e._uU(9,"The node will be usable only after LND has synced completely with the network."),e.qZA(),e.TgZ(10,"div",46),e._uU(11,"Click continue only after writing down the seed."),e.qZA(),e.TgZ(12,"div",6),e.TgZ(13,"button",47),e.NdJ("click",function(){return e.CHM(t),e.oxw().onGoToHome()}),e._uU(14,"Go To Home"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(5),e.Q6J("ngForOf",t.genSeedResponse)}}function Qc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"form",4),e.TgZ(2,"div",46),e._uU(3,"Something went wrong! Unable to initialize wallet!"),e.qZA(),e.TgZ(4,"div",6),e.TgZ(5,"button",49),e.NdJ("click",function(){return e.CHM(t),e.oxw().resetData()}),e._uU(6,"Restart"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function Ec(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div"),e.TgZ(1,"form",4),e.TgZ(2,"div",46),e._uU(3,"Wallet recovery is done."),e.qZA(),e.TgZ(4,"div",46),e._uU(5,"The node will be usable only after LND has synced completely with the network."),e.qZA(),e.TgZ(6,"div",6),e.TgZ(7,"button",50),e.NdJ("click",function(){return e.CHM(t),e.oxw().onGoToHome()}),e._uU(8,"Go To Home"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function Yc(n){const i=n.get("initWalletPassword"),t=n.get("initWalletConfirmPassword");return i&&t&&i.value!==t.value?{unmatchedPasswords:!0}:null}function Bc(n){const i=n.value.toString().trim().split(",")||[];return i&&24!==i.length?{invalidCipher:!0}:null}let Hc=(()=>{class n{constructor(t,a,o){this.store=t,this.formBuilder=a,this.lndEffects=o,this.insecureLND=!1,this.genSeedResponse=[],this.initWalletResponse="",this.proceed=!0,this.warnRes=!1,this.unsubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.passwordFormGroup=this.formBuilder.group({initWalletPassword:["",[c.kI.required,c.kI.minLength(8)]],initWalletConfirmPassword:["",[c.kI.required,c.kI.minLength(8)]]},{validators:Yc}),this.cipherFormGroup=this.formBuilder.group({existingCipher:[!1],cipherSeed:[{value:"",disabled:!0},[Bc]]}),this.passphraseFormGroup=this.formBuilder.group({enterPassphrase:[!1],passphrase:[{value:"",disabled:!0}]}),this.cipherFormGroup.controls.existingCipher.valueChanges.pipe((0,d.R)(this.unsubs[0])).subscribe(t=>{t?(this.cipherFormGroup.controls.cipherSeed.setValue(""),this.cipherFormGroup.controls.cipherSeed.enable()):(this.cipherFormGroup.controls.cipherSeed.setValue(""),this.cipherFormGroup.controls.cipherSeed.disable())}),this.passphraseFormGroup.controls.enterPassphrase.valueChanges.pipe((0,d.R)(this.unsubs[1])).subscribe(t=>{t?(this.passphraseFormGroup.controls.passphrase.setValue(""),this.passphraseFormGroup.controls.passphrase.enable()):(this.passphraseFormGroup.controls.passphrase.setValue(""),this.passphraseFormGroup.controls.passphrase.disable())}),this.insecureLND=!window.location.protocol.includes("https:"),this.lndEffects.initWalletRes.pipe((0,d.R)(this.unsubs[2])).subscribe(t=>{this.initWalletResponse=t}),this.lndEffects.genSeedResponse.pipe((0,d.R)(this.unsubs[3])).subscribe(t=>{this.genSeedResponse=t,this.store.dispatch((0,b.y2)(this.passphraseFormGroup.controls.enterPassphrase.value?{payload:{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:this.genSeedResponse,passphrase:window.btoa(this.passphraseFormGroup.controls.passphrase.value)}}:{payload:{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:this.genSeedResponse}}))})}onInitWallet(){if(this.passwordFormGroup.invalid||this.cipherFormGroup.invalid||this.passphraseFormGroup.invalid)return!0;if(this.cipherFormGroup.controls.existingCipher.value){const t=this.cipherFormGroup.controls.cipherSeed.value.toString().trim().split(",");this.store.dispatch((0,b.y2)(this.passphraseFormGroup.controls.enterPassphrase.value?{payload:{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:t,passphrase:window.btoa(this.passphraseFormGroup.controls.passphrase.value)}}:{payload:{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:t}}))}else this.store.dispatch((0,b.fu)(this.passphraseFormGroup.controls.enterPassphrase.value?{payload:window.btoa(this.passphraseFormGroup.controls.passphrase.value)}:{payload:""}))}onGoToHome(){setTimeout(()=>{this.store.dispatch((0,v.tw)()),this.store.dispatch((0,b.sQ)({payload:{loadPage:"HOME"}}))},1e3)}resetData(){this.genSeedResponse=[],this.initWalletResponse=""}ngOnDestroy(){this.unsubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh),e.Y36(c.qu),e.Y36(ee.l))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-initialize-wallet"]],viewQuery:function(t,a){if(1&t&&e.Gf(B.Vq,5),2&t){let o;e.iGM(o=e.CRH())&&(a.stepper=o.first)}},features:[e._Bn([{provide:Ac.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:7,vars:6,consts:[["fxLayout","column",1,"padding-gap","mb-4"],[4,"ngIf"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","stretch stretch",4,"ngIf"],[3,"linear",4,"ngIf"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mt-2"],["fxFlex","100","fxLayoutAlign","start"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","1","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","2",3,"click"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","stretch stretch"],["fxFlex","100",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",3,"click"],[3,"linear"],["stepper",""],["label","Wallet Password","state","password",3,"stepControl"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start","fxLayoutAlign.gt-sm","space-between",1,"mt-1",3,"formGroup"],["fxFlex","49","fxLayoutAlign","start"],["matInput","","type","password","placeholder","Password","name","initWalletPassword","formControlName","initWalletPassword","tabindex","5","required",""],["matInput","","type","password","placeholder","Confirm Password","name","initWalletConfirmPassword","formControlName","initWalletConfirmPassword","tabindex","6","required",""],["class","validation-error-message",4,"ngIf"],["fxLayout","row",1,"my-2"],["mat-flat-button","","color","primary","tabindex","7","type","submit","matStepperNext",""],["label","Cipher","state","cipher",3,"stepControl"],["fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start",1,"mt-1",3,"formGroup"],["fxFlex","100","fxLayout","column","fxLayoutAlign","start stretch"],["fxFlex","20","tabindex","8","color","primary","formControlName","existingCipher","name","existingCipher",1,"chkbox-wallet",3,"labelPosition"],["fxFlex","75","fxLayoutAlign","start",1,"my-1"],["autofocus","","matInput","","type","input","placeholder","Comma separated array of 24 words cipher seed","name","cipherSeed","formControlName","cipherSeed","tabindex","9","required",""],["fxLayout","row",1,"mb-2"],["mat-stroked-button","","color","primary","type","reset","tabindex","10","matStepperPrevious","",1,"mr-1","mt-1"],["mat-flat-button","","color","primary","tabindex","11","type","submit","matStepperNext","",1,"mt-1"],["label","Passphrase","state","passphrase",3,"stepControl"],["fxFlex","20","tabindex","10","color","primary","formControlName","enterPassphrase","name","enterPassphrase",1,"chkbox-wallet",3,"labelPosition"],["fxFlex","75","fxLayoutAlign","start"],["matInput","","type","password","placeholder","Passphrase","name","passphrase","formControlName","passphrase","tabindex","12","required",""],["mat-stroked-button","","color","warn","tabindex","13","type","reset",1,"mr-1","mt-1",3,"click"],["mat-stroked-button","","tabindex","14","color","primary","type","button","matStepperPrevious","",1,"mr-1","mt-1"],["mat-flat-button","","color","primary","tabindex","15","type","submit",1,"mt-1",3,"click"],["matStepperIcon","password"],["matStepperIcon","cipher"],["matStepperIcon","passphrase"],[1,"validation-error-message"],[1,"validation-error-icon","red"],["fxFlex","100","fxLayoutAlign","start",1,"blinker"],["fxFlex","40","fxLayout","row wrap",1,"mt-2"],["fxFlex","25","fxLayoutAlign","start","class","genseed-message",4,"ngFor","ngForOf"],["fxFlex","100","fxLayoutAlign","start",1,"mt-2"],["mat-flat-button","","color","primary","type","submit","tabindex","16",3,"click"],["fxFlex","25","fxLayoutAlign","start",1,"genseed-message"],["mat-stroked-button","","color","primary","tabindex","17","type","reset",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","18",3,"click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,vc,9,0,"div",1),e.YNc(2,wc,6,0,"div",2),e.YNc(3,Pc,56,17,"mat-vertical-stepper",3),e.YNc(4,Jc,15,1,"div",1),e.YNc(5,Qc,7,0,"div",1),e.YNc(6,Ec,9,0,"div",1),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf",a.insecureLND&&!a.warnRes),e.xp6(1),e.Q6J("ngIf",a.warnRes&&!a.proceed),e.xp6(1),e.Q6J("ngIf",(!a.insecureLND||a.warnRes&&a.proceed)&&a.genSeedResponse.length<=0&&""===a.initWalletResponse),e.xp6(1),e.Q6J("ngIf",a.genSeedResponse.length>0&&""!==a.initWalletResponse),e.xp6(1),e.Q6J("ngIf",a.genSeedResponse.length>0&&""===a.initWalletResponse),e.xp6(1),e.Q6J("ngIf",a.genSeedResponse.length<=0&&""!==a.initWalletResponse))},directives:[_.xw,m.O5,c._Y,c.JL,c.F,_.Wh,_.yH,L.lW,B.Vq,B.C0,c.sg,f.KE,R.Nt,c.Fj,c.JJ,c.u,c.Q7,f.bx,B.Ic,re.Rr,B.fd,B.z9,f.TO,j.Hw,m.sg],styles:[""]}),n})(),Gc=(()=>{class n{constructor(){this.faWallet=y.X5K}}return n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-wallet"]],decls:12,vars:1,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"],["label","Unlock"],["label","Initialize"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"Wallet"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e.TgZ(7,"mat-tab-group"),e.TgZ(8,"mat-tab",5),e._UZ(9,"rtl-unlock-wallet"),e.qZA(),e.TgZ(10,"mat-tab",6),e._UZ(11,"rtl-initialize-wallet"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faWallet))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,D.SP,D.uX,bc,Hc],styles:[""]}),n})();var zc=h(1365);function Vc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().activeLink=s.link}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw();e.s9C("routerLink",t.link),e.Q6J("active",a.activeLink===t.link),e.xp6(1),e.Oqu(t.name)}}let Wc=(()=>{class n{constructor(t,a,o){this.logger=t,this.store=a,this.router=o,this.faExchangeAlt=y.Ssp,this.faChartPie=y.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 p.x,new p.x,new p.x,new p.x]}ngOnInit(){const t=this.links.find(a=>this.router.url.includes(a.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(a=>a instanceof T.Av)).subscribe(a=>{const o=this.links.find(s=>a.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[1]),(0,zc.M)(this.store.select(C.$k))).subscribe(([a,o])=>{this.currencyUnits=o.currencyUnits,this.balances=o.userPersona===l.ol.OPERATOR?[{title:"Local Capacity",dataValue:a.lightningBalance.local,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:a.lightningBalance.remote,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:a.lightningBalance.local,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:a.lightningBalance.remote,tooltip:"Amount you can receive"}],this.logger.info(a)})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-transactions"]],decls:19,vars:4,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",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"Lightning Balance"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e._UZ(7,"rtl-currency-unit-converter",5),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",6),e._UZ(9,"fa-icon",1),e.TgZ(10,"span",2),e._uU(11,"Lightning Transactions"),e.qZA(),e.qZA(),e.TgZ(12,"div",7),e.TgZ(13,"mat-card"),e.TgZ(14,"mat-card-content",4),e.TgZ(15,"nav",8),e.YNc(16,Vc,2,3,"div",9),e.qZA(),e.TgZ(17,"div",10),e._UZ(18,"router-outlet"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faChartPie),e.xp6(6),e.Q6J("values",a.balances),e.xp6(2),e.Q6J("icon",a.faExchangeAlt),e.xp6(7),e.Q6J("ngForOf",a.links))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,de.D,D.BU,m.sg,_.yH,T.lC,D.Nj,T.rH],styles:[""]}),n})();function Xc(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",8),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().activeLink=s.link}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw();e.s9C("routerLink",t.link),e.Q6J("active",a.activeLink===t.link),e.xp6(1),e.Oqu(t.name)}}let $c=(()=>{class n{constructor(t){this.router=t,this.faSearch=y.wn1,this.links=[{link:"lookups",name:"Lookup"},{link:"queryroutes",name:"Query Routes"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const t=this.links.find(a=>this.router.url.includes(a.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(a=>a instanceof T.Av)).subscribe(a=>{const o=this.links.find(s=>a.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-graph"]],decls:11,vars:2,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",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"Graph Lookups"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e.TgZ(7,"nav",5),e.YNc(8,Xc,2,3,"div",6),e.qZA(),e.TgZ(9,"div",7),e._UZ(10,"router-outlet"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faSearch),e.xp6(7),e.Q6J("ngForOf",a.links))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,D.BU,m.sg,_.yH,T.lC,D.Nj,T.rH],styles:[""]}),n})();function jc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Destination pubkey is required."),e.qZA())}function Kc(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Amount is required."),e.qZA())}function eu(n,i){1&n&&e._UZ(0,"mat-progress-bar",37)}function tu(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1," Hop "),e.qZA())}function nu(n,i){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",null==t?null:t.hop_sequence," ")}}function au(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1," Peer "),e.qZA())}const iu=function(n){return{"max-width":n}};function ou(n,i){if(1&n&&(e.TgZ(0,"td",40),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,iu,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.hij(" ",null==t?null:t.pubkey_alias," ")}}function su(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1," Channel "),e.qZA())}function lu(n,i){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",null==t?null:t.chan_id," ")}}function ru(n,i){1&n&&(e.TgZ(0,"th",41),e._uU(1," Capacity (Sats) "),e.qZA())}function cu(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",42),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.chan_capacity),"")}}function uu(n,i){1&n&&(e.TgZ(0,"th",41),e._uU(1," Amount To Fwd (Sats) "),e.qZA())}function pu(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",42),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.amt_to_forward)," ")}}function mu(n,i){1&n&&(e.TgZ(0,"th",41),e._uU(1," Fee (mSats) "),e.qZA())}function _u(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",42),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.fee_msat)," ")}}function du(n,i){1&n&&(e.TgZ(0,"th",43),e.TgZ(1,"span",42),e._uU(2,"Actions"),e.qZA(),e.qZA())}function hu(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",44),e.TgZ(1,"button",45),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw().onHopClick(u,o)}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function gu(n,i){1&n&&e._UZ(0,"tr",46)}function fu(n,i){1&n&&e._UZ(0,"tr",47)}const Cu=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}};let xu=(()=>{class n{constructor(t,a,o){this.store=t,this.lndEffects=a,this.commonService=o,this.destinationPubkey="",this.amount=null,this.flgSticky=!1,this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=y.FpQ,this.faExclamationTriangle=y.eHv,this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["pubkey_alias","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["hop_sequence","pubkey_alias","fee_msat","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["hop_sequence","pubkey_alias","chan_capacity","amt_to_forward_msat","fee_msat","actions"]):(this.flgSticky=!0,this.displayedColumns=["hop_sequence","pubkey_alias","chan_capacity","amt_to_forward_msat","fee_msat","actions"])}ngOnInit(){this.lndEffects.setQueryRoutes.pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.qrHops=new r.by([]),t.routes&&t.routes.length&&t.routes.length>0&&t.routes[0].hops?(this.flgLoading[0]=!1,this.qrHops=new r.by([...t.routes[0].hops]),this.qrHops.data=t.routes[0].hops):this.flgLoading[0]="error",this.qrHops.sort=this.sort,this.qrHops.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null})}onQueryRoutes(){if(!this.destinationPubkey||!this.amount)return!0;this.qrHops=new r.by([]),this.flgLoading[0]=!0,this.store.dispatch((0,b.WO)({payload:{destPubkey:this.destinationPubkey,amount:this.amount}}))}resetData(){this.destinationPubkey="",this.amount=null,this.flgLoading[0]=!1}onHopClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Route Information",message:[[{key:"hop_sequence",value:t.hop_sequence,title:"Sequence",width:33,type:l.Gi.NUMBER},{key:"amt_to_forward",value:t.amt_to_forward,title:"Amount To Forward (Sats)",width:33,type:l.Gi.NUMBER},{key:"fee_msat",value:t.fee_msat,title:"Fee (mSats)",width:34,type:l.Gi.NUMBER}],[{key:"chan_capacity",value:t.chan_capacity,title:"Channel Capacity (Sats)",width:50,type:l.Gi.NUMBER},{key:"expiry",value:t.expiry,title:"Expiry",width:50,type:l.Gi.NUMBER}],[{key:"pubkey_alias",value:t.pubkey_alias,title:"Peer Alias",width:50,type:l.Gi.STRING},{key:"chan_id",value:t.chan_id,title:"Channel ID",width:50,type:l.Gi.STRING}],[{key:"pub_key",value:t.pub_key,title:"Peer Pubkey",width:100,type:l.Gi.STRING}]]}}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh),e.Y36(ee.l),e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-query-routes"]],viewQuery:function(t,a){if(1&t&&e.Gf(Z.YE,5),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first)}},decls:51,vars:16,consts:[["fxLayout","column","fxFlex","100",1,"padding-gap"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",3,"ngSubmit"],["queryRoutesForm","ngForm"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","69","fxLayoutAlign","start end"],["matInput","","placeholder","Destination Pubkey","name","destinationPubkey","tabindex","1","required","",3,"ngModel","ngModelChange"],["destPubkey","ngModel"],[4,"ngIf"],["fxFlex","29","fxLayoutAlign","start end"],["matInput","","placeholder","Amount (Sats)","name","amount","tabindex","2","type","number","required","",3,"ngModel","step","min","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"],[1,"table-container","mb-6",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","hop_sequence"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","pubkey_alias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","chan_id"],["matColumnDef","chan_capacity"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amt_to_forward_msat"],["matColumnDef","fee_msat"],["matColumnDef","actions"],["mat-header-cell","","class","pl-4 pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-4",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pl-4","pr-3"],["mat-cell","",1,"pl-4"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(t,a){if(1&t){const o=e.EpF();e.TgZ(0,"div",0),e.TgZ(1,"form",1,2),e.NdJ("ngSubmit",function(){return e.CHM(o),e.MAs(2).form.valid&&a.onQueryRoutes()}),e.TgZ(3,"div",3),e._UZ(4,"fa-icon",4),e.TgZ(5,"span"),e._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),e.qZA(),e.qZA(),e.TgZ(7,"mat-form-field",5),e.TgZ(8,"input",6,7),e.NdJ("ngModelChange",function(u){return a.destinationPubkey=u}),e.qZA(),e.YNc(10,jc,2,0,"mat-error",8),e.qZA(),e.TgZ(11,"mat-form-field",9),e.TgZ(12,"input",10),e.NdJ("ngModelChange",function(u){return a.amount=u}),e.qZA(),e.YNc(13,Kc,2,0,"mat-error",8),e.qZA(),e.TgZ(14,"div",11),e.TgZ(15,"button",12),e.NdJ("click",function(){return a.resetData()}),e._uU(16,"Clear"),e.qZA(),e.TgZ(17,"button",13),e._uU(18,"Query Route"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(19,"div",14),e.TgZ(20,"div",15),e._UZ(21,"fa-icon",16),e.TgZ(22,"span",17),e._uU(23,"Transaction Route"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(24,"div",18),e.YNc(25,eu,1,0,"mat-progress-bar",19),e.TgZ(26,"table",20,21),e.ynx(28,22),e.YNc(29,tu,2,0,"th",23),e.YNc(30,nu,2,1,"td",24),e.BQk(),e.ynx(31,25),e.YNc(32,au,2,0,"th",23),e.YNc(33,ou,2,4,"td",26),e.BQk(),e.ynx(34,27),e.YNc(35,su,2,0,"th",23),e.YNc(36,lu,2,1,"td",24),e.BQk(),e.ynx(37,28),e.YNc(38,ru,2,0,"th",29),e.YNc(39,cu,4,3,"td",24),e.BQk(),e.ynx(40,30),e.YNc(41,uu,2,0,"th",29),e.YNc(42,pu,4,3,"td",24),e.BQk(),e.ynx(43,31),e.YNc(44,mu,2,0,"th",29),e.YNc(45,_u,4,3,"td",24),e.BQk(),e.ynx(46,32),e.YNc(47,du,3,0,"th",33),e.YNc(48,hu,3,0,"td",34),e.BQk(),e.YNc(49,gu,1,0,"tr",35),e.YNc(50,fu,1,0,"tr",36),e.qZA(),e.qZA(),e.qZA()}2&t&&(e.xp6(4),e.Q6J("icon",a.faExclamationTriangle),e.xp6(4),e.Q6J("ngModel",a.destinationPubkey),e.xp6(2),e.Q6J("ngIf",!a.destinationPubkey),e.xp6(2),e.Q6J("ngModel",a.amount)("step",1e3)("min",0),e.xp6(1),e.Q6J("ngIf",!a.amount),e.xp6(8),e.Q6J("icon",a.faRoute),e.xp6(4),e.Q6J("ngIf",!0===a.flgLoading[0]),e.xp6(1),e.Q6J("dataSource",a.qrHops)("ngClass",e.VKq(14,Cu,"error"===a.flgLoading[0])),e.xp6(23),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns))},directives:[_.xw,_.yH,c._Y,c.JL,c.F,_.Wh,I.BN,f.KE,R.Nt,c.Fj,c.Q7,c.JJ,c.On,m.O5,c.wV,c.qQ,$.q,L.lW,Y.$V,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.as,r.nj,f.TO,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{flex:0 0 5%;width:5%}.mat-column-pubkey_alias[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();var Je=h(9814);function Tu(n,i){if(1&n&&(e.TgZ(0,"span",9),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.xp6(1),e.AsE("",a.nodeFeaturesEnum[t.value.name]||t.value.name,": ",t.value.is_required?"Mandatory":"Optional","")}}function yu(n,i){1&n&&(e.TgZ(0,"th",27),e._uU(1,"Network"),e.qZA())}function Zu(n,i){if(1&n&&(e.TgZ(0,"td",28),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",null==t?null:t.network," ")}}function bu(n,i){1&n&&(e.TgZ(0,"th",27),e._uU(1,"Address"),e.qZA())}function Au(n,i){if(1&n&&(e.TgZ(0,"td",28),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.hij(" ",null==t?null:t.addr," ")}}function vu(n,i){1&n&&(e.TgZ(0,"th",29),e.TgZ(1,"span",30),e._uU(2,"Actions"),e.qZA(),e.qZA())}function wu(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",31),e.TgZ(1,"span",30),e.TgZ(2,"button",32),e.NdJ("copied",function(o){return e.CHM(t),e.oxw(2).onCopyNodeURI(o)}),e._uU(3,"Copy Node URI"),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw(2);e.xp6(2),e.Q6J("payload",a.lookupResult.node.pub_key+"@"+t.addr)}}function qu(n,i){1&n&&e._UZ(0,"tr",33)}function Su(n,i){1&n&&e._UZ(0,"tr",34)}const Lu=function(n){return{"background-color":n}};function ku(n,i){if(1&n&&(e.TgZ(0,"div",1),e._UZ(1,"mat-divider",2),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.TgZ(4,"h4",5),e._uU(5,"Alias"),e.qZA(),e.TgZ(6,"span",6),e._uU(7),e.TgZ(8,"span",7),e._uU(9),e.qZA(),e.qZA(),e.qZA(),e.TgZ(10,"div",8),e.TgZ(11,"h4",5),e._uU(12,"Pub Key"),e.qZA(),e.TgZ(13,"span",9),e._uU(14),e.qZA(),e.qZA(),e.qZA(),e._UZ(15,"mat-divider",10),e.TgZ(16,"div",3),e.TgZ(17,"div",4),e.TgZ(18,"h4",5),e._uU(19,"Last Update"),e.qZA(),e.TgZ(20,"span",6),e._uU(21),e.ALo(22,"date"),e.qZA(),e.qZA(),e.TgZ(23,"div",8),e.TgZ(24,"h4",5),e._uU(25,"Total Capacity (Sats)"),e.qZA(),e.TgZ(26,"span",6),e._uU(27),e.ALo(28,"number"),e.qZA(),e.qZA(),e.qZA(),e._UZ(29,"mat-divider",10),e.TgZ(30,"div",3),e.TgZ(31,"div",4),e.TgZ(32,"h4",5),e._uU(33,"Number of Channels"),e.qZA(),e.TgZ(34,"span",6),e._uU(35),e.ALo(36,"number"),e.qZA(),e.qZA(),e.TgZ(37,"div",11),e.TgZ(38,"h4",5),e._uU(39,"Features"),e.qZA(),e.YNc(40,Tu,2,2,"span",12),e.ALo(41,"keyvalue"),e.qZA(),e.qZA(),e._UZ(42,"mat-divider",10),e.TgZ(43,"div",13),e.TgZ(44,"h4",14),e._uU(45,"Addresses"),e.qZA(),e.TgZ(46,"div",15),e.TgZ(47,"table",16,17),e.ynx(49,18),e.YNc(50,yu,2,0,"th",19),e.YNc(51,Zu,2,1,"td",20),e.BQk(),e.ynx(52,21),e.YNc(53,bu,2,0,"th",19),e.YNc(54,Au,2,1,"td",20),e.BQk(),e.ynx(55,22),e.YNc(56,vu,3,0,"th",23),e.YNc(57,wu,4,1,"td",24),e.BQk(),e.YNc(58,qu,1,0,"tr",25),e.YNc(59,Su,1,0,"tr",26),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("inset",!0),e.xp6(6),e.Oqu(t.lookupResult.node.alias),e.xp6(1),e.Q6J("ngStyle",e.VKq(24,Lu,null==t.lookupResult.node?null:t.lookupResult.node.color)),e.xp6(1),e.Oqu(null==t.lookupResult.node?null:t.lookupResult.node.color),e.xp6(5),e.Oqu(t.lookupResult.node.pub_key),e.xp6(1),e.Q6J("inset",!0),e.xp6(6),e.Oqu(e.xi3(22,15,1e3*t.lookupResult.node.last_update,"dd/MMM/y HH:mm")),e.xp6(6),e.Oqu(e.lcZ(28,18,t.lookupResult.total_capacity)),e.xp6(2),e.Q6J("inset",!0),e.xp6(6),e.Oqu(e.lcZ(36,20,t.lookupResult.num_channels)),e.xp6(5),e.Q6J("ngForOf",e.lcZ(41,22,t.lookupResult.node.features)),e.xp6(2),e.Q6J("inset",!0),e.xp6(5),e.Q6J("dataSource",t.lookupResult.node.addresses),e.xp6(11),e.Q6J("matHeaderRowDef",t.displayedColumns),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns)}}let Fu=(()=>{class n{constructor(t,a){this.logger=t,this.snackBar=a,this.nodeFeaturesEnum=l.hZ,this.displayedColumns=["network","addr","actions"]}onCopyNodeURI(t){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+t)}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(te.ux))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-node-lookup"]],inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column","class","mt-1",4,"ngIf"],["fxLayout","column",1,"mt-1"],[1,"mb-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"],[1,"my-1",3,"inset"],["fxLayout","column","fxFlex","70","fxLayoutAlign","end start",1,"my-1"],["class","foreground-secondary-text w-100",4,"ngFor","ngForOf"],["fxLayout","column"],["fxFlex","100","fxLayoutAlign","start",1,"font-bold-500","mb-1"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mat-table","","matSort","",3,"dataSource"],["table",""],["matColumnDef","network"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","addr"],["matColumnDef","actions"],["mat-header-cell","","class","pl-1",4,"matHeaderCellDef"],["mat-cell","","class","pl-1",4,"matCellDef"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","",1,"pl-1"],["fxLayoutAlign","end center"],["mat-cell","",1,"pl-1"],["mat-stroked-button","","color","primary","type","button","tabindex","1","rtlClipboard","",3,"payload","copied"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&e.YNc(0,ku,60,26,"div",0),2&t&&e.Q6J("ngIf",a.lookupResult)},directives:[m.O5,_.xw,X.d,_.yH,_.Wh,m.PC,S.Zl,m.sg,Y.$V,r.BZ,Z.YE,r.w1,r.fO,r.Dz,r.as,r.nj,r.ge,Z.nU,r.ev,L.lW,oe.y,r.XQ,r.Gk],pipes:[m.uU,m.JJ,m.Nd],styles:[""]}),n})();function Nu(n,i){1&n&&(e.TgZ(0,"h3",15),e._uU(1,"Node 1"),e.qZA())}function Ou(n,i){1&n&&(e.TgZ(0,"h3",15),e._uU(1,"Node 1 (Your Node)"),e.qZA())}function Uu(n,i){1&n&&(e.TgZ(0,"h3",15),e._uU(1,"Node 2"),e.qZA())}function Ru(n,i){1&n&&(e.TgZ(0,"h3",15),e._uU(1,"Node 2 (Your Node)"),e.qZA())}function Iu(n,i){if(1&n&&(e.TgZ(0,"div",1),e._UZ(1,"mat-divider",2),e.TgZ(2,"div",3),e.TgZ(3,"div",4),e.TgZ(4,"h4",5),e._uU(5,"Channel Id"),e.qZA(),e.TgZ(6,"span",6),e._uU(7),e.qZA(),e.qZA(),e.TgZ(8,"div",7),e.TgZ(9,"h4",5),e._uU(10,"Channel Point"),e.qZA(),e.TgZ(11,"span",6),e._uU(12),e.qZA(),e.qZA(),e.qZA(),e._UZ(13,"mat-divider",8),e.TgZ(14,"div",3),e.TgZ(15,"div",4),e.TgZ(16,"h4",5),e._uU(17,"Last Update"),e.qZA(),e.TgZ(18,"span",6),e._uU(19),e.ALo(20,"date"),e.qZA(),e.qZA(),e.TgZ(21,"div",7),e.TgZ(22,"h4",5),e._uU(23,"Capacity (Sats)"),e.qZA(),e.TgZ(24,"span",6),e._uU(25),e.ALo(26,"number"),e.qZA(),e.qZA(),e.qZA(),e._UZ(27,"mat-divider",8),e.TgZ(28,"div",9),e.TgZ(29,"div",10),e.TgZ(30,"div",11),e.YNc(31,Nu,2,0,"h3",12),e.YNc(32,Ou,2,0,"h3",12),e.qZA(),e._UZ(33,"mat-divider",8),e.TgZ(34,"div",13),e.TgZ(35,"h4",5),e._uU(36,"Pubkey"),e.qZA(),e.TgZ(37,"span",6),e._uU(38),e.qZA(),e.qZA(),e._UZ(39,"mat-divider",8),e.TgZ(40,"div",14),e.TgZ(41,"h4",5),e._uU(42,"Time Lock Delta"),e.qZA(),e.TgZ(43,"span",6),e._uU(44),e.qZA(),e.qZA(),e._UZ(45,"mat-divider",8),e.TgZ(46,"div",14),e.TgZ(47,"h4",5),e._uU(48,"Min HTLC"),e.qZA(),e.TgZ(49,"span",6),e._uU(50),e.qZA(),e.qZA(),e._UZ(51,"mat-divider",8),e.TgZ(52,"div",14),e.TgZ(53,"h4",5),e._uU(54,"Fee Base Msat"),e.qZA(),e.TgZ(55,"span",6),e._uU(56),e.qZA(),e.qZA(),e._UZ(57,"mat-divider",8),e.TgZ(58,"div",14),e.TgZ(59,"h4",5),e._uU(60,"Fee Rate Milli Msat"),e.qZA(),e.TgZ(61,"span",6),e._uU(62),e.qZA(),e.qZA(),e._UZ(63,"mat-divider",8),e.TgZ(64,"div",14),e.TgZ(65,"h4",5),e._uU(66,"Disabled"),e.qZA(),e.TgZ(67,"span",6),e._uU(68),e.qZA(),e.qZA(),e.qZA(),e.TgZ(69,"div",10),e.TgZ(70,"div"),e.YNc(71,Uu,2,0,"h3",12),e.YNc(72,Ru,2,0,"h3",12),e.qZA(),e._UZ(73,"mat-divider",8),e.TgZ(74,"div",13),e.TgZ(75,"h4",5),e._uU(76,"Pubkey"),e.qZA(),e.TgZ(77,"span",6),e._uU(78),e.qZA(),e.qZA(),e._UZ(79,"mat-divider",8),e.TgZ(80,"div",14),e.TgZ(81,"h4",5),e._uU(82,"Time Lock Delta"),e.qZA(),e.TgZ(83,"span",6),e._uU(84),e.qZA(),e.qZA(),e._UZ(85,"mat-divider",8),e.TgZ(86,"div",14),e.TgZ(87,"h4",5),e._uU(88,"Min HTLC"),e.qZA(),e.TgZ(89,"span",6),e._uU(90),e.qZA(),e.qZA(),e._UZ(91,"mat-divider",8),e.TgZ(92,"div",14),e.TgZ(93,"h4",5),e._uU(94,"Fee Base Msat"),e.qZA(),e.TgZ(95,"span",6),e._uU(96),e.qZA(),e.qZA(),e._UZ(97,"mat-divider",8),e.TgZ(98,"div",14),e.TgZ(99,"h4",5),e._uU(100,"Fee Rate Milli Msat"),e.qZA(),e.TgZ(101,"span",6),e._uU(102),e.qZA(),e.qZA(),e._UZ(103,"mat-divider",8),e.TgZ(104,"div",14),e.TgZ(105,"h4",5),e._uU(106,"Disabled"),e.qZA(),e.TgZ(107,"span",6),e._uU(108),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("inset",!0),e.xp6(6),e.Oqu(t.lookupResult.channel_id),e.xp6(5),e.Oqu(t.lookupResult.chan_point),e.xp6(1),e.Q6J("inset",!0),e.xp6(6),e.Oqu(e.xi3(20,35,1e3*t.lookupResult.last_update,"dd/MMM/y HH:mm")),e.xp6(6),e.Oqu(e.lcZ(26,38,t.lookupResult.capacity)),e.xp6(2),e.Q6J("inset",!0),e.xp6(4),e.Q6J("ngIf",!t.node1_match),e.xp6(1),e.Q6J("ngIf",t.node1_match),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(t.lookupResult.node1_pub),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node1_policy?null:t.lookupResult.node1_policy.time_lock_delta),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node1_policy?null:t.lookupResult.node1_policy.min_htlc),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node1_policy?null:t.lookupResult.node1_policy.fee_base_msat),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node1_policy?null:t.lookupResult.node1_policy.fee_rate_milli_msat),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null!=t.lookupResult.node1_policy&&t.lookupResult.node1_policy.disabled?"Yes":"No"),e.xp6(3),e.Q6J("ngIf",!t.node2_match),e.xp6(1),e.Q6J("ngIf",t.node2_match),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(t.lookupResult.node2_pub),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node2_policy?null:t.lookupResult.node2_policy.time_lock_delta),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node2_policy?null:t.lookupResult.node2_policy.min_htlc),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node2_policy?null:t.lookupResult.node2_policy.fee_base_msat),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null==t.lookupResult.node2_policy?null:t.lookupResult.node2_policy.fee_rate_milli_msat),e.xp6(1),e.Q6J("inset",!0),e.xp6(5),e.Oqu(null!=t.lookupResult.node2_policy&&t.lookupResult.node2_policy.disabled?"Yes":"No")}}let Du=(()=>{class n{constructor(t){this.store=t,this.node1_match=!1,this.node2_match=!1,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.lookupResult.node1_pub===t.identity_pubkey&&(this.node1_match=!0),this.lookupResult.node2_pub===t.identity_pubkey&&(this.node2_match=!0)})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-lookup"]],inputs:{lookupResult:"lookupResult"},decls:1,vars:1,consts:[["fxLayout","column","class","mt-1",4,"ngIf"],["fxLayout","column",1,"mt-1"],[1,"mb-1",3,"inset"],["fxLayout","row"],["fxLayout","column","fxFlex","30","fxLayoutAlign","end start"],[1,"font-bold-500"],[1,"foreground-secondary-text"],["fxLayout","column","fxFlex","70","fxLayoutAlign","end start"],[1,"my-1",3,"inset"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row"],["fxLayout","column","fxFlex","49","fxLayoutAlign","start start",1,"mt-1","bordered-box","padding-gap-large"],["fxLayout","column"],["class","page-title font-bold-500",4,"ngIf"],["fxLayout","column","fxFlex","20"],["fxLayout","column","fxFlex","10"],[1,"page-title","font-bold-500"]],template:function(t,a){1&t&&e.YNc(0,Iu,109,40,"div",0),2&t&&e.Q6J("ngIf",a.lookupResult)},directives:[m.O5,_.xw,X.d,_.yH,_.Wh],pipes:[m.uU,m.JJ],styles:[".mat-list-base[_ngcontent-%COMP%] .mat-list-item[_ngcontent-%COMP%], .mat-list-base[_ngcontent-%COMP%] .mat-list-option[_ngcontent-%COMP%]{height:38px!important}"]}),n})();function Pu(n,i){if(1&n&&(e.TgZ(0,"mat-radio-button",17),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("value",t.id)("checked",a.selectedFieldId===t.id),e.xp6(1),e.hij(" ",t.name," ")}}function Mu(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.hij("",null==t.lookupFields[t.selectedFieldId]?null:t.lookupFields[t.selectedFieldId].placeholder," is required.")}}function Ju(n,i){1&n&&e._UZ(0,"mat-progress-bar",20)}const Qu=function(n){return{"w-100 mt-2 p-2 error-border":n,"w-100 my-2 p-2":!0}};function Eu(n,i){if(1&n&&(e.TgZ(0,"div",18),e.YNc(1,Ju,1,0,"mat-progress-bar",19),e._uU(2),e.qZA()),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(3,Qu,""!==t.errorMessage&&"Getting lookup details..."!==t.errorMessage)),e.xp6(1),e.Q6J("ngIf","Getting lookup details..."===t.errorMessage),e.xp6(1),e.hij(" ",t.errorMessage," ")}}function Yu(n,i){if(1&n&&(e.TgZ(0,"span",27),e._UZ(1,"rtl-node-lookup",28),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("lookupResult",t.lookupValue)}}function Bu(n,i){if(1&n&&(e.TgZ(0,"span",27),e._UZ(1,"rtl-channel-lookup",28),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("lookupResult",t.lookupValue)}}function Hu(n,i){1&n&&(e.TgZ(0,"span",27),e.TgZ(1,"h3"),e._uU(2,"Error! Unable to find details!"),e.qZA(),e.qZA())}function Gu(n,i){if(1&n&&(e.TgZ(0,"div",21),e.TgZ(1,"div",22),e.TgZ(2,"span",23),e._uU(3),e.qZA(),e.qZA(),e.TgZ(4,"div",24),e.YNc(5,Yu,2,1,"span",25),e.YNc(6,Bu,2,1,"span",25),e.YNc(7,Hu,3,0,"span",26),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(3),e.hij("",t.lookupFields[t.selectedFieldId].name," Details"),e.xp6(1),e.Q6J("ngSwitch",t.selectedFieldId),e.xp6(1),e.Q6J("ngSwitchCase",0),e.xp6(1),e.Q6J("ngSwitchCase",1)}}const zu=function(n){return{"mt-1":!0,"mt-2":n}};let Qe=(()=>{class n{constructor(t,a,o,s){this.logger=t,this.commonService=a,this.store=o,this.actions=s,this.lookupKey="",this.lookupValue={},this.flgSetLookupValue=!1,this.messageObj=[],this.selectedFieldId=0,this.lookupFields=[{id:0,name:"Node",placeholder:"Pubkey"},{id:1,name:"Channel",placeholder:"Channel ID"}],this.faSearch=y.wn1,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(t=>t.type===l.uR.SET_LOOKUP_LND||t.type===l.uR.UPDATE_API_CALL_STATUS_LND)).subscribe(t=>{t.type===l.uR.SET_LOOKUP_LND&&(this.errorMessage=0===this.selectedFieldId&&t.payload.hasOwnProperty("node")||1===this.selectedFieldId&&t.payload.hasOwnProperty("channel_id")?"":this.errorMessage,this.lookupValue=JSON.parse(JSON.stringify(t.payload)),this.flgSetLookupValue=!(0!==this.selectedFieldId||!t.payload.hasOwnProperty("node"))||!(1!==this.selectedFieldId||!t.payload.hasOwnProperty("channel_id")),this.logger.info(this.lookupValue)),t.type===l.uR.UPDATE_API_CALL_STATUS_LND&&"Lookup"===t.payload.action&&(this.errorMessage="",t.payload.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof t.payload.message?JSON.stringify(t.payload.message):t.payload.message),t.payload.status===l.Bn.INITIATED&&(this.errorMessage=l.m6.GET_LOOKUP_DETAILS))})}onLookup(){if(!this.lookupKey)return!0;switch(this.flgSetLookupValue=!1,this.lookupValue={},this.selectedFieldId){case 0:this.store.dispatch((0,b.Sf)({payload:this.lookupKey.trim()}));break;case 1:this.store.dispatch((0,b.$A)({payload:{uiMessage:l.m6.SEARCHING_CHANNEL,channelID:this.lookupKey.trim()}}))}}onSelectChange(t){this.resetData(),this.selectedFieldId=t.value}resetData(){this.flgSetLookupValue=!1,this.selectedFieldId=0,this.lookupKey="",this.lookupValue={},this.errorMessage=""}clearLookupValue(){this.lookupValue={},this.flgSetLookupValue=!1}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh),e.Y36(z.eX))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-lookups"]],decls:19,vars:10,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",3,"ngModel","ngModelChange","change"],["class","mr-4",3,"value","checked",4,"ngFor","ngForOf"],["fxFlex","100","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"placeholder","ngModel","change","ngModelChange"],["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","row wrap","fxLayoutAlign","space-between center",3,"ngClass",4,"ngIf"],["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"],[1,"mr-4",3,"value","checked"],["fxFlex","100","fxLayout","row wrap","fxLayoutAlign","space-between center",3,"ngClass"],["mode","indeterminate",4,"ngIf"],["mode","indeterminate"],["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"],["fxFlex","100",4,"ngSwitchDefault"],["fxFlex","100"],[3,"lookupResult"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-content",2),e.TgZ(3,"form",3,4),e.TgZ(5,"div",5),e.TgZ(6,"mat-radio-group",6),e.NdJ("ngModelChange",function(s){return a.selectedFieldId=s})("change",function(s){return a.onSelectChange(s)}),e.YNc(7,Pu,2,3,"mat-radio-button",7),e.qZA(),e.qZA(),e.TgZ(8,"mat-form-field",8),e.TgZ(9,"input",9,10),e.NdJ("change",function(){return a.clearLookupValue()})("ngModelChange",function(s){return a.lookupKey=s}),e.qZA(),e.YNc(11,Mu,2,1,"mat-error",11),e.qZA(),e.TgZ(12,"div",12),e.TgZ(13,"button",13),e.NdJ("click",function(){return a.resetData()}),e._uU(14,"Clear"),e.qZA(),e.TgZ(15,"button",14),e.NdJ("click",function(){return a.onLookup()}),e._uU(16,"Lookup"),e.qZA(),e.qZA(),e.qZA(),e.YNc(17,Eu,3,5,"div",15),e.YNc(18,Gu,8,4,"div",16),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(6),e.Q6J("ngModel",a.selectedFieldId),e.xp6(1),e.Q6J("ngForOf",a.lookupFields),e.xp6(1),e.Q6J("ngClass",e.VKq(8,zu,a.screenSize===a.screenSizeEnum.XS||a.screenSize===a.screenSizeEnum.SM)),e.xp6(1),e.Q6J("placeholder",(null==a.lookupFields[a.selectedFieldId]?null:a.lookupFields[a.selectedFieldId].placeholder)||"Lookup Key")("ngModel",a.lookupKey),e.xp6(2),e.Q6J("ngIf",!a.lookupKey),e.xp6(6),e.Q6J("ngIf",""!==a.errorMessage),e.xp6(1),e.Q6J("ngIf",""===a.errorMessage&&a.lookupValue&&a.flgSetLookupValue))},directives:[_.xw,_.yH,_.Wh,A.dn,c._Y,c.JL,c.F,Je.VQ,c.JJ,c.On,m.sg,f.KE,m.mk,S.oO,R.Nt,c.Fj,c.Q7,m.O5,L.lW,Je.U0,f.TO,M.pW,m.RF,m.n9,m.ED,Fu,Du],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}.pl-3[_ngcontent-%COMP%]{padding-left:3rem}"]}),n})();var Te=h(6856);function Vu(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Invalid date format."),e.qZA())}function Wu(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Invalid date format."),e.qZA())}function Xu(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",27),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().activeLink=s.link}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw();e.s9C("routerLink",t.link),e.Q6J("active",a.activeLink===t.link),e.xp6(1),e.Oqu(t.name)}}let $u=(()=>{class n{constructor(t,a,o){this.logger=t,this.store=a,this.router=o,this.faMapSigns=y.SuH,this.today=new Date(Date.now()),this.lastMonthDay=new Date(this.today.getFullYear(),this.today.getMonth()-1,this.today.getDate()+1,0,0,0),this.yesterday=new Date(this.today.getFullYear(),this.today.getMonth(),this.today.getDate()-1,0,0,0),this.endDate=this.today,this.startDate=this.lastMonthDay,this.links=[{link:"forwardinghistory",name:"Forwarding History"},{link:"peers",name:"Routing Peers"},{link:"nonroutingprs",name:"Non Routing Peers"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x]}ngOnInit(){this.onEventsFetch();const t=this.links.find(a=>this.router.url.includes(a.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(a=>a instanceof T.Av)).subscribe(a=>{const o=this.links.find(s=>a.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}onEventsFetch(){this.store.dispatch((0,b.QJ)({payload:{forwarding_events:[]}})),this.endDate||(this.endDate=this.today),this.startDate||(this.startDate=new Date(this.endDate.getFullYear(),this.endDate.getMonth()-1,this.endDate.getDate()+1,0,0,0)),this.store.dispatch((0,b.u0)({payload:{end_time:Math.round(this.endDate.getTime()/1e3).toString(),start_time:Math.round(this.startDate.getTime()/1e3).toString()}}))}resetData(){this.endDate=this.today,this.startDate=this.lastMonthDay}ngOnDestroy(){this.resetData(),this.store.dispatch((0,b.QJ)({payload:{forwarding_events:[]}})),this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-routing"]],decls:35,vars:15,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",1,"card-content-gap","mt-1"],["fxFlex","100","fxLayout","column","fxLayout.gt-sm","row wrap","fxLayoutAlign.gt-sm","space-between center","fxLayoutAlign","start stretch",1,"w-100","mb-1",3,"ngSubmit"],["routingForm","ngForm"],["fxFlex","100","fxLayoutAlign","space-between stretch"],["fxFlex","49","fxLayoutAlign","start"],["matInput","","placeholder","Start Date","name","startDate","tabindex","1",3,"matDatepicker","max","ngModel","ngModelChange"],["strtDate","ngModel"],["matSuffix","",3,"for"],[3,"startAt"],["startDatepicker",""],[4,"ngIf"],["matInput","","placeholder","End Date","name","endDate","tabindex","2",3,"matDatepicker","min","max","ngModel","ngModelChange"],["enDate","ngModel"],["endDatepicker",""],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4"],["fxLayout","row","fxFlex","100"],["mat-tab-nav-bar","","fxFlex","100"],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(t,a){if(1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e._UZ(2,"fa-icon",2),e.TgZ(3,"span",3),e._uU(4,"Routing"),e.qZA(),e.qZA(),e.TgZ(5,"div",4),e.TgZ(6,"mat-card",5),e.TgZ(7,"mat-card-content",6),e.TgZ(8,"form",7,8),e.NdJ("ngSubmit",function(){return a.onEventsFetch()}),e.TgZ(10,"div",9),e.TgZ(11,"mat-form-field",10),e.TgZ(12,"input",11,12),e.NdJ("ngModelChange",function(s){return a.startDate=s}),e.qZA(),e._UZ(14,"mat-datepicker-toggle",13),e._UZ(15,"mat-datepicker",14,15),e.YNc(17,Vu,2,0,"mat-error",16),e.qZA(),e.TgZ(18,"mat-form-field",10),e.TgZ(19,"input",17,18),e.NdJ("ngModelChange",function(s){return a.endDate=s}),e.qZA(),e._UZ(21,"mat-datepicker-toggle",13),e._UZ(22,"mat-datepicker",14,19),e.YNc(24,Wu,2,0,"mat-error",16),e.qZA(),e.qZA(),e.TgZ(25,"div",20),e.TgZ(26,"button",21),e.NdJ("click",function(){return a.resetData()}),e._uU(27,"Clear"),e.qZA(),e.TgZ(28,"button",22),e._uU(29,"Fetch Events"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(30,"div",23),e.TgZ(31,"nav",24),e.YNc(32,Xu,2,3,"div",25),e.qZA(),e.qZA(),e.TgZ(33,"div",26),e._UZ(34,"router-outlet"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t){const o=e.MAs(13),s=e.MAs(16),u=e.MAs(20),g=e.MAs(23);e.xp6(2),e.Q6J("icon",a.faMapSigns),e.xp6(10),e.Q6J("matDatepicker",s)("max",a.today)("ngModel",a.startDate),e.xp6(2),e.Q6J("for",s),e.xp6(1),e.Q6J("startAt",a.startDate),e.xp6(2),e.Q6J("ngIf",o.errors),e.xp6(2),e.Q6J("matDatepicker",g)("min",a.startDate)("max",a.today)("ngModel",a.endDate),e.xp6(2),e.Q6J("for",g),e.xp6(1),e.Q6J("startAt",a.endDate),e.xp6(2),e.Q6J("ngIf",u.errors),e.xp6(8),e.Q6J("ngForOf",a.links)}},directives:[_.xw,_.Wh,I.BN,_.yH,A.a8,A.dn,c._Y,c.JL,c.F,f.KE,R.Nt,Te.hl,De.F,c.Fj,c.JJ,c.On,Te.nW,f.R9,Te.Mq,m.O5,$.q,L.lW,D.BU,m.sg,T.lC,f.TO,D.Nj,T.rH],styles:[""]}),n})();function ju(n,i){if(1&n&&(e.TgZ(0,"div",5),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorMessage)}}function Ku(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",6),e._UZ(1,"div",7),e.TgZ(2,"mat-form-field",8),e.TgZ(3,"input",9),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().filterValue=o})("input",function(){return e.CHM(t),e.oxw().applyFilter()})("keyup",function(){return e.CHM(t),e.oxw().applyFilter()}),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngModel",t.filterValue)}}function ep(n,i){1&n&&e._UZ(0,"mat-progress-bar",31)}function tp(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1,"Timestamp"),e.qZA())}function np(n,i){if(1&n&&(e.TgZ(0,"td",33),e._uU(1),e.ALo(2,"date"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,1e3*t.timestamp,"dd/MMM/y HH:mm"))}}function ap(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1,"Inbound Channel"),e.qZA())}function ip(n,i){if(1&n&&(e.TgZ(0,"td",33),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t.alias_in)}}function op(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1,"Outbound Channel"),e.qZA())}function sp(n,i){if(1&n&&(e.TgZ(0,"td",33),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t.alias_out)}}function lp(n,i){1&n&&(e.TgZ(0,"th",34),e._uU(1,"Inbound Amount (Sats)"),e.qZA())}function rp(n,i){if(1&n&&(e.TgZ(0,"td",33),e.TgZ(1,"span",35),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.amt_in))}}function cp(n,i){1&n&&(e.TgZ(0,"th",34),e._uU(1,"Outbound Amount (Sats)"),e.qZA())}function up(n,i){if(1&n&&(e.TgZ(0,"td",33),e.TgZ(1,"span",35),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.amt_out))}}function pp(n,i){1&n&&(e.TgZ(0,"th",34),e._uU(1,"Fee (mSats)"),e.qZA())}function mp(n,i){if(1&n&&(e.TgZ(0,"td",33),e.TgZ(1,"span",35),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.fee_msat))}}function _p(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",36),e.TgZ(1,"div",37),e.TgZ(2,"mat-select",38),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",39),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function dp(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",40),e.TgZ(1,"button",41),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw(2).onForwardingEventClick(u,o)}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function hp(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No forwarding history available."),e.qZA())}function gp(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting forwarding history..."),e.qZA())}function fp(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.errorMessage)}}function Cp(n,i){if(1&n&&(e.TgZ(0,"td",42),e.YNc(1,hp,2,0,"p",43),e.YNc(2,gp,2,0,"p",43),e.YNc(3,fp,2,1,"p",43),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",(!(null!=t.forwardingHistoryEvents&&t.forwardingHistoryEvents.data)||(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.forwardingHistoryEvents&&t.forwardingHistoryEvents.data)||(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.forwardingHistoryEvents&&t.forwardingHistoryEvents.data)||(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const xp=function(n){return{"display-none":n}};function Tp(n,i){if(1&n&&e._UZ(0,"tr",44),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(1,xp,(null==t.forwardingHistoryEvents?null:t.forwardingHistoryEvents.data)&&(null==t.forwardingHistoryEvents||null==t.forwardingHistoryEvents.data?null:t.forwardingHistoryEvents.data.length)>0))}}function yp(n,i){1&n&&e._UZ(0,"tr",45)}function Zp(n,i){1&n&&e._UZ(0,"tr",46)}const bp=function(){return["no_event"]};function Ap(n,i){if(1&n&&(e.TgZ(0,"div",10),e.YNc(1,ep,1,0,"mat-progress-bar",11),e.TgZ(2,"table",12,13),e.ynx(4,14),e.YNc(5,tp,2,0,"th",15),e.YNc(6,np,3,4,"td",16),e.BQk(),e.ynx(7,17),e.YNc(8,ap,2,0,"th",15),e.YNc(9,ip,2,1,"td",16),e.BQk(),e.ynx(10,18),e.YNc(11,op,2,0,"th",15),e.YNc(12,sp,2,1,"td",16),e.BQk(),e.ynx(13,19),e.YNc(14,lp,2,0,"th",20),e.YNc(15,rp,4,3,"td",16),e.BQk(),e.ynx(16,21),e.YNc(17,cp,2,0,"th",20),e.YNc(18,up,4,3,"td",16),e.BQk(),e.ynx(19,22),e.YNc(20,pp,2,0,"th",20),e.YNc(21,mp,4,3,"td",16),e.BQk(),e.ynx(22,23),e.YNc(23,_p,6,0,"th",24),e.YNc(24,dp,3,0,"td",25),e.BQk(),e.ynx(25,26),e.YNc(26,Cp,4,3,"td",27),e.BQk(),e.YNc(27,Tp,1,3,"tr",28),e.YNc(28,yp,1,0,"tr",29),e.YNc(29,Zp,1,0,"tr",30),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",t.forwardingHistoryEvents),e.xp6(25),e.Q6J("matFooterRowDef",e.DdM(6,bp)),e.xp6(1),e.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns)}}function vp(n,i){if(1&n&&e._UZ(0,"mat-paginator",47),2&n){const t=e.oxw();e.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let Ee=(()=>{class n{constructor(t,a,o,s){this.logger=t,this.commonService=a,this.store=o,this.datePipe=s,this.eventsData=[],this.filterValue="",this.forwardingHistoryData=[],this.displayedColumns=[],this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","fee_msat","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["timestamp","amt_in","amt_out","fee_msat","actions"]):(this.flgSticky=!0,this.displayedColumns=["timestamp","alias_in","alias_out","amt_in","amt_out","fee_msat","actions"])}ngOnInit(){this.store.select(C.Bo).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{var a;this.eventsData.length<=0&&(this.errorMessage="",this.apiCallStatus=t.apiCallStatus,(null===(a=t.apiCallStatus)||void 0===a?void 0:a.status)===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.forwardingHistoryData=t.forwardingHistory.forwarding_events||[],this.loadForwardingEventsTable(this.forwardingHistoryData),this.logger.info(t.apiCallStatus),this.logger.info(t.forwardingHistory))})}ngAfterViewInit(){this.forwardingHistoryData.length>0&&this.loadForwardingEventsTable(this.forwardingHistoryData)}ngOnChanges(t){t.eventsData&&(this.apiCallStatus={status:l.Bn.COMPLETED,action:"FetchForwardingHistory"},this.eventsData=t.eventsData.currentValue,this.forwardingHistoryData=this.eventsData,t.eventsData.firstChange||this.loadForwardingEventsTable(this.forwardingHistoryData)),t.filterValue&&!t.filterValue.firstChange&&this.applyFilter()}onForwardingEventClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Event Information",message:[[{key:"timestamp",value:t.timestamp,title:"Timestamp",width:25,type:l.Gi.DATE_TIME},{key:"amt_in",value:t.amt_in,title:"Inbound Amount (Sats)",width:25,type:l.Gi.NUMBER},{key:"amt_out",value:t.amt_out,title:"Outbound Amount (Sats)",width:25,type:l.Gi.NUMBER},{key:"fee_msat",value:t.fee_msat,title:"Fee (mSats)",width:25,type:l.Gi.NUMBER}],[{key:"alias_in",value:t.alias_in,title:"Inbound Peer Alias",width:25,type:l.Gi.STRING},{key:"chan_id_in",value:t.chan_id_in,title:"Inbound Channel ID",width:25,type:l.Gi.STRING},{key:"alias_out",value:t.alias_out,title:"Outbound Peer Alias",width:25,type:l.Gi.STRING},{key:"chan_id_out",value:t.chan_id_out,title:"Outbound Channel ID",width:25,type:l.Gi.STRING}]]}}}))}loadForwardingEventsTable(t){this.forwardingHistoryEvents=new r.by(t?[...t]:[]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.forwardingHistoryEvents.filterPredicate=(a,o)=>((a.timestamp?this.datePipe.transform(new Date(1e3*a.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(a).toLowerCase()).includes(o),this.forwardingHistoryEvents.paginator=this.paginator,this.logger.info(this.forwardingHistoryEvents)}onDownloadCSV(){this.forwardingHistoryEvents&&this.forwardingHistoryEvents.data&&this.forwardingHistoryEvents.data.length>0&&this.commonService.downloadFile(this.forwardingHistoryEvents.data,"Forwarding-history")}applyFilter(){this.forwardingHistoryEvents&&(this.forwardingHistoryEvents.filter=this.filterValue.trim().toLowerCase())}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh),e.Y36(m.uU))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-forwarding-history"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},inputs:{eventsData:"eventsData",filterValue:"filterValue"},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Events")}]),e.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","30"],["matInput","","name","filter","placeholder","Filter",3,"ngModel","ngModelChange","input","keyup"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","timestamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","alias_in"],["matColumnDef","alias_out"],["matColumnDef","amt_in"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","amt_out"],["matColumnDef","fee_msat"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",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(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,ju,2,1,"div",1),e.YNc(2,Ku,4,1,"div",2),e.YNc(3,Ap,30,7,"div",3),e.YNc(4,vp,1,3,"mat-paginator",4),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf",""!==a.errorMessage),e.xp6(1),e.Q6J("ngIf",""===a.errorMessage),e.xp6(1),e.Q6J("ngIf",""===a.errorMessage),e.xp6(1),e.Q6J("ngIf",""===a.errorMessage))},directives:[_.xw,_.Wh,m.O5,_.yH,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,r.BZ,Z.YE,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,M.pW,r.ge,Z.nU,r.ev,O.gD,O.$L,E.ey,L.lW,r.yh,r.Q2,m.mk,S.oO,r.XQ,r.Gk,q.NW],pipes:[m.uU,m.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();const wp=["tableIn"],qp=["tableOut"],Sp=["paginatorIn"],Lp=["paginatorOut"];function kp(n,i){if(1&n&&(e.TgZ(0,"div",3),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorMessage)}}function Fp(n,i){1&n&&e._UZ(0,"mat-progress-bar",37)}function Np(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Channel ID"),e.qZA())}const me=function(n){return{"max-width":n}};function Op(n,i){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.Q6J("ngStyle",e.VKq(2,me,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.Oqu(t.chan_id)}}function Up(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Peer Alias"),e.qZA())}function Rp(n,i){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.Q6J("ngStyle",e.VKq(2,me,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.Oqu(t.alias)}}function Ip(n,i){1&n&&(e.TgZ(0,"th",40),e._uU(1,"Events"),e.qZA())}function Dp(n,i){if(1&n&&(e.TgZ(0,"td",41),e.TgZ(1,"span",42),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.events))}}function Pp(n,i){1&n&&(e.TgZ(0,"th",40),e._uU(1,"Total Amount (Sats)"),e.qZA())}function Mp(n,i){if(1&n&&(e.TgZ(0,"td",41),e.TgZ(1,"span",42),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.total_amount))}}function Jp(n,i){1&n&&(e.TgZ(0,"th",43),e.TgZ(1,"span",42),e._uU(2,"Actions"),e.qZA(),e.qZA())}function Qp(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",44),e.TgZ(1,"button",45),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw(2).onRoutingPeerClick(u,o,"in")}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function Ep(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No incoming routing peer available."),e.qZA())}function Yp(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting incoming routing peers..."),e.qZA())}function Bp(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.errorMessage)}}function Hp(n,i){if(1&n&&(e.TgZ(0,"td",46),e.YNc(1,Ep,2,0,"p",47),e.YNc(2,Yp,2,0,"p",47),e.YNc(3,Bp,2,1,"p",47),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",(!(null!=t.RoutingPeersIncoming&&t.RoutingPeersIncoming.data)||(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.RoutingPeersIncoming&&t.RoutingPeersIncoming.data)||(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.RoutingPeersIncoming&&t.RoutingPeersIncoming.data)||(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const Ye=function(n){return{"display-none":n}};function Gp(n,i){if(1&n&&e._UZ(0,"tr",48),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(1,Ye,(null==t.RoutingPeersIncoming||null==t.RoutingPeersIncoming.data?null:t.RoutingPeersIncoming.data.length)>0))}}function zp(n,i){1&n&&e._UZ(0,"tr",49)}function Vp(n,i){1&n&&e._UZ(0,"tr",50)}function Wp(n,i){1&n&&e._UZ(0,"mat-progress-bar",37)}function Xp(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Channel ID"),e.qZA())}function $p(n,i){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.Q6J("ngStyle",e.VKq(2,me,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.Oqu(t.chan_id)}}function jp(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Peer Alias"),e.qZA())}function Kp(n,i){if(1&n&&(e.TgZ(0,"td",39),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.Q6J("ngStyle",e.VKq(2,me,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.Oqu(t.alias)}}function em(n,i){1&n&&(e.TgZ(0,"th",40),e._uU(1,"Events"),e.qZA())}function tm(n,i){if(1&n&&(e.TgZ(0,"td",41),e.TgZ(1,"span",42),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.events))}}function nm(n,i){1&n&&(e.TgZ(0,"th",40),e._uU(1,"Total Amount (Sats)"),e.qZA())}function am(n,i){if(1&n&&(e.TgZ(0,"td",41),e.TgZ(1,"span",42),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.total_amount))}}function im(n,i){1&n&&(e.TgZ(0,"th",43),e.TgZ(1,"span",42),e._uU(2,"Actions"),e.qZA(),e.qZA())}function om(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",51),e.TgZ(1,"button",52),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw(2).onRoutingPeerClick(u,o,"out")}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function sm(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No outgoing routing peer available."),e.qZA())}function lm(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting outgoing routing peers..."),e.qZA())}function rm(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.errorMessage)}}function cm(n,i){if(1&n&&(e.TgZ(0,"td",46),e.YNc(1,sm,2,0,"p",47),e.YNc(2,lm,2,0,"p",47),e.YNc(3,rm,2,1,"p",47),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",(!(null!=t.RoutingPeersOutgoing&&t.RoutingPeersOutgoing.data)||(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.RoutingPeersOutgoing&&t.RoutingPeersOutgoing.data)||(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.RoutingPeersOutgoing&&t.RoutingPeersOutgoing.data)||(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}function um(n,i){if(1&n&&e._UZ(0,"tr",48),2&n){const t=e.oxw(2);e.Q6J("ngClass",e.VKq(1,Ye,(null==t.RoutingPeersOutgoing||null==t.RoutingPeersOutgoing.data?null:t.RoutingPeersOutgoing.data.length)>0))}}function pm(n,i){1&n&&e._UZ(0,"tr",49)}function mm(n,i){1&n&&e._UZ(0,"tr",50)}const _m=function(n,i){return{"mt-2":n,"mt-1":i}},dm=function(){return["no_incoming_event"]},hm=function(n){return{"mt-2":n}},gm=function(){return["no_outgoing_event"]};function fm(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",4),e.TgZ(1,"div",5),e.TgZ(2,"div",6),e.TgZ(3,"div",7),e._uU(4,"Incoming"),e.qZA(),e.TgZ(5,"mat-form-field",8),e.TgZ(6,"input",9),e.NdJ("keyup",function(){return e.CHM(t),e.oxw().applyIncomingFilter()})("ngModelChange",function(o){return e.CHM(t),e.oxw().filterIn=o}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(7,"div",10),e.YNc(8,Fp,1,0,"mat-progress-bar",11),e.TgZ(9,"table",12,13),e.ynx(11,14),e.YNc(12,Np,2,0,"th",15),e.YNc(13,Op,2,4,"td",16),e.BQk(),e.ynx(14,17),e.YNc(15,Up,2,0,"th",15),e.YNc(16,Rp,2,4,"td",16),e.BQk(),e.ynx(17,18),e.YNc(18,Ip,2,0,"th",19),e.YNc(19,Dp,4,3,"td",20),e.BQk(),e.ynx(20,21),e.YNc(21,Pp,2,0,"th",19),e.YNc(22,Mp,4,3,"td",20),e.BQk(),e.ynx(23,22),e.YNc(24,Jp,3,0,"th",23),e.YNc(25,Qp,3,0,"td",24),e.BQk(),e.ynx(26,25),e.YNc(27,Hp,4,3,"td",26),e.BQk(),e.YNc(28,Gp,1,3,"tr",27),e.YNc(29,zp,1,0,"tr",28),e.YNc(30,Vp,1,0,"tr",29),e.qZA(),e.qZA(),e._UZ(31,"mat-paginator",30,31),e.qZA(),e.TgZ(33,"div",5),e.TgZ(34,"div",6),e.TgZ(35,"div",7),e._uU(36,"Outgoing"),e.qZA(),e.TgZ(37,"mat-form-field",8),e.TgZ(38,"input",9),e.NdJ("keyup",function(){return e.CHM(t),e.oxw().applyOutgoingFilter()})("ngModelChange",function(o){return e.CHM(t),e.oxw().filterOut=o}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(39,"div",10),e.YNc(40,Wp,1,0,"mat-progress-bar",11),e.TgZ(41,"table",32,33),e.ynx(43,14),e.YNc(44,Xp,2,0,"th",15),e.YNc(45,$p,2,4,"td",16),e.BQk(),e.ynx(46,17),e.YNc(47,jp,2,0,"th",15),e.YNc(48,Kp,2,4,"td",16),e.BQk(),e.ynx(49,18),e.YNc(50,em,2,0,"th",19),e.YNc(51,tm,4,3,"td",20),e.BQk(),e.ynx(52,21),e.YNc(53,nm,2,0,"th",19),e.YNc(54,am,4,3,"td",20),e.BQk(),e.ynx(55,22),e.YNc(56,im,3,0,"th",23),e.YNc(57,om,3,0,"td",34),e.BQk(),e.ynx(58,35),e.YNc(59,cm,4,3,"td",26),e.BQk(),e.YNc(60,um,1,3,"tr",27),e.YNc(61,pm,1,0,"tr",28),e.YNc(62,mm,1,0,"tr",29),e.qZA(),e.qZA(),e._UZ(63,"mat-paginator",30,36),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngClass",e.WLB(22,_m,t.screenSize===t.screenSizeEnum.XS,t.screenSize===t.screenSizeEnum.SM)),e.xp6(4),e.Q6J("ngModel",t.filterIn),e.xp6(2),e.Q6J("ngIf",t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",t.RoutingPeersIncoming),e.xp6(19),e.Q6J("matFooterRowDef",e.DdM(25,dm)),e.xp6(1),e.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns),e.xp6(1),e.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS),e.xp6(3),e.Q6J("ngClass",e.VKq(26,hm,t.screenSize!==t.screenSizeEnum.LG)),e.xp6(4),e.Q6J("ngModel",t.filterOut),e.xp6(2),e.Q6J("ngIf",t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",t.RoutingPeersOutgoing),e.xp6(19),e.Q6J("matFooterRowDef",e.DdM(28,gm)),e.xp6(1),e.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns),e.xp6(1),e.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}let Cm=(()=>{class n{constructor(t,a,o){this.logger=t,this.commonService=a,this.store=o,this.routingPeersData=[],this.displayedColumns=[],this.RoutingPeersIncoming=new r.by([]),this.RoutingPeersOutgoing=new r.by([]),this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.filterIn="",this.filterOut="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["chan_id","events","actions"]):this.screenSize===l.cu.SM||this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["chan_id","alias","events","total_amount"]):(this.flgSticky=!0,this.displayedColumns=["chan_id","alias","events","total_amount"])}ngOnInit(){this.store.select(C.Bo).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{var a;this.errorMessage="",this.apiCallStatus=t.apiCallStatus,(null===(a=t.apiCallStatus)||void 0===a?void 0:a.status)===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.routingPeersData=t.forwardingHistory.forwarding_events?t.forwardingHistory.forwarding_events:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(t.apiCallStatus),this.logger.info(t.forwardingHistory)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.loadRoutingPeersTable(this.routingPeersData)}onRoutingPeerClick(t,a,o){let s=" Routing Information";s="in"===o?"Incoming"+s:"Outgoing"+s,this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:s,message:[[{key:"chan_id",value:t.chan_id,title:"Channel ID",width:50,type:l.Gi.STRING},{key:"alias",value:t.alias,title:"Peer Alias",width:50,type:l.Gi.STRING}],[{key:"events",value:t.events,title:"Events",width:50,type:l.Gi.NUMBER},{key:"total_amount",value:t.total_amount,title:"Total Amount (Sats)",width:50,type:l.Gi.NUMBER}]]}}}))}loadRoutingPeersTable(t){if(t.length>0){const a=this.groupRoutingPeers(t);this.RoutingPeersIncoming=new r.by(a[0]),this.RoutingPeersIncoming.sort=this.sortIn,this.RoutingPeersIncoming.filterPredicate=(o,s)=>JSON.stringify(o).toLowerCase().includes(s),this.RoutingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.RoutingPeersIncoming),this.RoutingPeersOutgoing=new r.by(a[1]),this.RoutingPeersOutgoing.sort=this.sortOut,this.RoutingPeersOutgoing.filterPredicate=(o,s)=>JSON.stringify(o).toLowerCase().includes(s),this.RoutingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.RoutingPeersOutgoing)}else this.RoutingPeersIncoming=new r.by([]),this.RoutingPeersOutgoing=new r.by([]);this.applyIncomingFilter(),this.applyOutgoingFilter()}groupRoutingPeers(t){const a=[],o=[];return t.forEach(s=>{const u=a.find(U=>U.chan_id===s.chan_id_in),g=o.find(U=>U.chan_id===s.chan_id_out);u?(u.events++,u.total_amount=+u.total_amount+ +s.amt_in):a.push({chan_id:s.chan_id_in,alias:s.alias_in,events:1,total_amount:+s.amt_in}),g?(g.events++,g.total_amount=+g.total_amount+ +s.amt_out):o.push({chan_id:s.chan_id_out,alias:s.alias_out,events:1,total_amount:+s.amt_out})}),[this.commonService.sortDescByKey(a,"total_amount"),this.commonService.sortDescByKey(o,"total_amount")]}applyIncomingFilter(){this.RoutingPeersIncoming.filter=this.filterIn.toLowerCase()}applyOutgoingFilter(){this.RoutingPeersOutgoing.filter=this.filterOut.toLowerCase()}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-routing-peers"]],viewQuery:function(t,a){if(1&t&&(e.Gf(wp,5,Z.YE),e.Gf(qp,5,Z.YE),e.Gf(Sp,5),e.Gf(Lp,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sortIn=o.first),e.iGM(o=e.CRH())&&(a.sortOut=o.first),e.iGM(o=e.CRH())&&(a.paginatorIn=o.first),e.iGM(o=e.CRH())&&(a.paginatorOut=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Routing peers")}])],decls:3,vars:2,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between start","class","page-sub-title-container",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxLayout.gt-md","row","fxFlex","100","fxLayoutAlign","space-between start",1,"page-sub-title-container"],["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","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start start","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto","incoming-table",3,"dataSource"],["tableIn",""],["matColumnDef","chan_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","alias"],["matColumnDef","events"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","total_amount"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-2","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_incoming_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginatorIn",""],["mat-table","","matSort","",1,"overflow-auto","outgoing-table",3,"dataSource"],["tableOut",""],["mat-cell","","class","pl-2",4,"matCellDef"],["matColumnDef","no_outgoing_event"],["paginatorOut",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pr-3"],["mat-cell","","fxLayoutAlign","end center",1,"pl-2"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""],["mat-cell","",1,"pl-2"],["mat-stroked-button","","color","primary","type","button","tabindex","5",3,"click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,kp,2,1,"div",1),e.YNc(2,fm,65,29,"div",2),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf",""!==a.errorMessage),e.xp6(1),e.Q6J("ngIf",""===a.errorMessage))},directives:[_.xw,_.Wh,m.O5,_.yH,m.mk,S.oO,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,r.BZ,Z.YE,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,L.lW,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-chan_id[_ngcontent-%COMP%], .mat-column-alias[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();function xm(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",7),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().activeLink=s.link}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw();e.s9C("routerLink",t.link),e.Q6J("active",a.activeLink===t.link),e.xp6(1),e.Oqu(t.name)}}let Tm=(()=>{class n{constructor(t){this.router=t,this.faChartBar=y.koM,this.links=[{link:"routingfees",name:"Routing Fees"},{link:"transactions",name:"Transactions"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const t=this.links.find(a=>this.router.url.includes(a.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(a=>a instanceof T.Av)).subscribe(a=>{const o=this.links.find(s=>a.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-reports"]],decls:10,vars:2,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",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"Reports"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e.TgZ(7,"nav",5),e.YNc(8,xm,2,3,"div",6),e.qZA(),e._UZ(9,"router-outlet"),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faChartBar),e.xp6(7),e.Q6J("ngForOf",a.links))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,D.BU,m.sg,T.lC,D.Nj,T.rH],styles:[""]}),n})();var Be=h(7772),He=h(7671),Ge=h(6046);function ym(n,i){1&n&&e._UZ(0,"mat-progress-bar",10)}function Zm(n,i){if(1&n&&(e.TgZ(0,"div",11),e._uU(1),e.ALo(2,"number"),e.ALo(3,"number"),e.qZA()),2&n){const t=e.oxw();e.Q6J("@fadeIn",t.events.total_fee_msat),e.xp6(1),e.AsE("",e.xi3(2,3,t.events.total_fee_msat/1e3||0,"1.0-2")," Sats/",e.lcZ(3,6,(null==t.events||null==t.events.forwarding_events?null:t.events.forwarding_events.length)||0)," Events")}}function bm(n,i){1&n&&(e.TgZ(0,"div",12),e._uU(1,"No fee report for the selected period"),e.qZA())}const Am=function(n){return{"error-border":n}};function vm(n,i){if(1&n&&(e.TgZ(0,"div",13),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(2,Am,"Getting fee report..."!==t.errorMessage&&""!==t.errorMessage)),e.xp6(1),e.Oqu(t.errorMessage)}}function wm(n,i){if(1&n&&(e.TgZ(0,"span"),e.TgZ(1,"span",16),e._uU(2),e.ALo(3,"number"),e.qZA(),e.TgZ(4,"span",16),e._uU(5),e.ALo(6,"number"),e.qZA(),e.qZA()),2&n){const t=i.model;e.xp6(2),e.hij("Events: ",e.lcZ(3,2,t.extra.totalEvents||0),""),e.xp6(3),e.hij("Fee: ",e.xi3(6,4,t.value||0,"1.0-2"),"")}}function qm(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"ngx-charts-bar-vertical",14),e.NdJ("select",function(o){return e.CHM(t),e.oxw().onChartBarSelected(o)})("mouseup",function(o){return e.CHM(t),e.oxw().onChartMouseUp(o)}),e.YNc(1,wm,7,7,"ng-template",null,15,e.W1O),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("view",t.view)("results",t.feeReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",t.showYAxisLabel)("xAxisLabel",t.xAxisLabel)("yAxisLabel",t.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function Sm(n,i){if(1&n&&e._UZ(0,"rtl-forwarding-history",17),2&n){const t=e.oxw();e.Q6J("eventsData",null==t.events?null:t.events.forwarding_events)("filterValue",t.eventFilterValue)}}let Lm=(()=>{class n{constructor(t,a,o,s){this.logger=t,this.dataService=a,this.commonService=o,this.store=s,this.reportPeriod=l.op[0],this.secondsInADay=86400,this.events={},this.eventFilterValue="",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.feeReportData=[],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Fee (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.unSubs=[new p.x,new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===l.cu.XS||this.screenSize===l.cu.SM),this.store.select(C.Q5).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{t.identity_pubkey&&this.fetchEvents(this.startDate,this.endDate)}),this.commonService.containerSizeUpdated.pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{switch(this.screenSize){case l.cu.MD:this.screenPaddingX=t.width/10;break;case l.cu.LG:this.screenPaddingX=t.width/16;break;default:this.screenPaddingX=t.width/20}this.view=[t.width-this.screenPaddingX,t.height/2.2],this.logger.info("Container Size: "+JSON.stringify(t)),this.logger.info("View: "+JSON.stringify(this.view))})}fetchEvents(t,a){this.errorMessage=l.m6.GET_FEE_REPORT;const o=Math.round(t.getTime()/1e3).toString(),s=Math.round(a.getTime()/1e3).toString();this.dataService.getForwardingHistory(o,s).pipe((0,d.R)(this.unSubs[2])).subscribe({next:u=>{this.errorMessage="",u.forwarding_events&&u.forwarding_events.length?(u.forwarding_events=u.forwarding_events.reverse(),this.events=u,this.feeReportData=this.prepareFeeReport(t)):(this.events={},this.feeReportData=[])},error:u=>{this.errorMessage=u}})}onChartMouseUp(t){"svg"===t.srcElement.tagName&&t.srcElement.classList.length>0&&"ngx-charts"===t.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(t){this.eventFilterValue=this.reportPeriod===l.op[1]?t.name+"/"+this.startDate.getFullYear():t.name.toString().padStart(2,"0")+"/"+l.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(t){const a=Math.round(t.getTime()/1e3),o=[];if(this.reportPeriod===l.op[1]){for(let s=0;s<12;s++)o.push({name:l.gg[s].name,value:0,extra:{totalEvents:0}});this.events.forwarding_events.map(s=>{const u=new Date(1e3*+s.timestamp).getMonth();return o[u].value=o[u].value+ +s.fee_msat/1e3,o[u].extra.totalEvents=o[u].extra.totalEvents+1,this.events.total_fee_msat=(this.events.total_fee_msat?this.events.total_fee_msat:0)+ +s.fee_msat,this.events})}else{for(let s=0;s<this.getMonthDays(t.getMonth(),t.getFullYear());s++)o.push({name:s+1,value:0,extra:{totalEvents:0}});this.events.forwarding_events.map(s=>{const u=Math.floor((+s.timestamp-a)/this.secondsInADay);return o[u].value=o[u].value+ +s.fee_msat/1e3,o[u].extra.totalEvents=o[u].extra.totalEvents+1,this.events.total_fee_msat=(this.events.total_fee_msat?this.events.total_fee_msat:0)+ +s.fee_msat,this.events})}return o}onSelectionChange(t){const a=t.selDate.getMonth(),o=t.selDate.getFullYear();this.reportPeriod=t.selScrollRange,this.reportPeriod===l.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,a,1,0,0,0),this.endDate=new Date(o,a,this.getMonthDays(a,o),23,59,59)),this.fetchEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(t,a){return 1===t&&a%4==0?l.gg[t].days+1:l.gg[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(K.D),e.Y36(P.v),e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-fee-report"]],hostBindings:function(t,a){1&t&&e.NdJ("mouseup",function(s){return a.onChartMouseUp(s)})},decls:11,vars:6,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],[3,"stepChanged"],["mode","indeterminate","class","mt-2",4,"ngIf"],["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"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100","class","font-size-120 mt-1",3,"ngClass",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,"eventsData","filterValue",4,"ngIf"],["mode","indeterminate",1,"mt-2"],["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"],["fxLayout","column","fxLayoutAlign","center center","fxFlex","100",1,"font-size-120","mt-1",3,"ngClass"],[1,"one-color",3,"view","results","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"eventsData","filterValue"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"rtl-horizontal-scroller",1),e.NdJ("stepChanged",function(s){return a.onSelectionChange(s)}),e.qZA(),e.YNc(2,ym,1,0,"mat-progress-bar",2),e.TgZ(3,"div",3),e.YNc(4,Zm,4,8,"div",4),e.YNc(5,bm,2,0,"div",5),e.YNc(6,vm,2,4,"div",6),e.TgZ(7,"div",7),e.YNc(8,qm,3,11,"ngx-charts-bar-vertical",8),e.qZA(),e.TgZ(9,"div",7),e.YNc(10,Sm,1,2,"rtl-forwarding-history",9),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(2),e.Q6J("ngIf","Getting fee report..."===a.errorMessage),e.xp6(2),e.Q6J("ngIf",a.feeReportData.length>0&&a.events.forwarding_events),e.xp6(1),e.Q6J("ngIf",(a.feeReportData.length<=0||!a.events.forwarding_events)&&""===a.errorMessage),e.xp6(1),e.Q6J("ngIf",""!==a.errorMessage),e.xp6(2),e.Q6J("ngIf",a.feeReportData.length>0&&a.events.forwarding_events),e.xp6(2),e.Q6J("ngIf",a.events&&(null==a.events?null:a.events.forwarding_events)))},directives:[_.xw,_.Wh,_.yH,He.D,m.O5,M.pW,m.mk,S.oO,Ge.K$,Ee],pipes:[m.JJ],styles:[""],data:{animation:[Be.J]}}),n})();var km=h(165);function Fm(n,i){1&n&&(e.TgZ(0,"div",11),e._UZ(1,"mat-progress-bar",12),e.TgZ(2,"span"),e._uU(3,"Getting transactions data..."),e.qZA(),e.qZA())}function Nm(n,i){if(1&n&&(e.TgZ(0,"div",13),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorMessage)}}function Om(n,i){if(1&n&&(e.TgZ(0,"div",16),e._uU(1),e.ALo(2,"number"),e.ALo(3,"number"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.AsE(" Paid ",e.xi3(2,2,t.transactionsReportSummary.amountPaidSelectedPeriod/1e3||0,"1.0-2")," Sats/",e.lcZ(3,5,t.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function Um(n,i){if(1&n&&(e.TgZ(0,"div",16),e._uU(1),e.ALo(2,"number"),e.ALo(3,"number"),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.AsE(" Received ",e.xi3(2,2,t.transactionsReportSummary.amountReceivedSelectedPeriod/1e3||0,"1.0-2")," Sats/",e.lcZ(3,5,t.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function Rm(n,i){if(1&n&&(e.TgZ(0,"div",14),e.YNc(1,Om,4,7,"div",15),e.YNc(2,Um,4,7,"div",15),e.qZA()),2&n){const t=e.oxw();e.Q6J("@fadeIn",t.transactionsReportSummary),e.xp6(1),e.Q6J("ngIf",t.transactionsReportSummary.paymentsSelectedPeriod>0),e.xp6(1),e.Q6J("ngIf",t.transactionsReportSummary.invoicesSelectedPeriod)}}function Im(n,i){1&n&&(e.TgZ(0,"div",17),e._uU(1,"No transactions report for the selected period"),e.qZA())}function Dm(n,i){if(1&n&&(e.TgZ(0,"span",21),e._uU(1),e.ALo(2,"number"),e.ALo(3,"number"),e.qZA()),2&n){const t=i.model;e.xp6(1),e.HOy("",t.name,": ",e.xi3(2,4,t.value||0,"1.0-2"),"/# ","Paid"===t.name?"Payments":"Invoices",": ",e.lcZ(3,7,(null==t.extra?null:t.extra.total)||0),"")}}function Pm(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"ngx-charts-bar-vertical-2d",19),e.NdJ("select",function(o){return e.CHM(t),e.oxw(2).onChartBarSelected(o)})("mouseup",function(o){return e.CHM(t),e.oxw(2).onChartMouseUp(o)}),e.YNc(1,Dm,4,9,"ng-template",null,20,e.W1O),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("view",t.view)("results",t.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",t.showYAxisLabel)("xAxisLabel",t.xAxisLabel)("yAxisLabel",t.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",t.reportPeriod===t.scrollRanges[0]?2:8)}}function Mm(n,i){if(1&n&&(e.TgZ(0,"div",9),e.YNc(1,Pm,3,13,"ngx-charts-bar-vertical-2d",18),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.transactionsReportData.length>0&&t.transactionsNonZeroReportData.length>0)}}function Jm(n,i){if(1&n&&e._UZ(0,"rtl-transactions-report-table",22),2&n){const t=e.oxw();e.Q6J("dataList",t.transactionsNonZeroReportData)("dataRange",t.reportPeriod)("filterValue",t.transactionFilterValue)}}let Qm=(()=>{class n{constructor(t,a,o){this.logger=t,this.commonService=a,this.store=o,this.scrollRanges=l.op,this.reportPeriod=l.op[0],this.secondsInADay=86400,this.payments=[],this.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=[{date:"",name:"1",series:[{extra:{total:0},name:"Paid",value:0},{extra:{total:0},name:"Received",value:0}]}],this.transactionsNonZeroReportData=[{amount_paid:0,amount_received:0,date:"",num_invoices:0,num_payments:0}],this.view=[350,350],this.screenPaddingX=100,this.gradient=!0,this.xAxisLabel="Date",this.yAxisLabel="Amount (Sats)",this.showYAxisLabel=!0,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===l.cu.XS||this.screenSize===l.cu.SM),this.store.select(C.l5).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.payments=t.allLightningTransactions.listPaymentsAll.payments||[],this.invoices=t.allLightningTransactions.listInvoicesAll.invoices||[],(this.payments.length>0||this.invoices.length>0)&&(this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData()),this.logger.info(t)}),this.commonService.containerSizeUpdated.pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{switch(this.screenSize){case l.cu.MD:this.screenPaddingX=t.width/10;break;case l.cu.LG:this.screenPaddingX=t.width/16;break;default:this.screenPaddingX=t.width/20}this.view=[t.width-this.screenPaddingX,t.height/2.2],this.logger.info("Container Size: "+JSON.stringify(t)),this.logger.info("View: "+JSON.stringify(this.view))})}onChartMouseUp(t){"svg"===t.srcElement.tagName&&t.srcElement.classList.length>0&&"ngx-charts"===t.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(t){this.transactionFilterValue=this.reportPeriod===l.op[1]?t.series+"/"+this.startDate.getFullYear():t.series.toString().padStart(2,"0")+"/"+l.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(t,a){const o=Math.round(t.getTime()/1e3),s=Math.round(a.getTime()/1e3),u=[];this.transactionsNonZeroReportData=[],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const g=this.payments.filter(x=>"SUCCEEDED"===x.status&&x.creation_date>=o&&x.creation_date<s),U=this.invoices.filter(x=>x.settled&&+x.creation_date>=o&&+x.creation_date<s);if(this.transactionsReportSummary.paymentsSelectedPeriod=g.length,this.transactionsReportSummary.invoicesSelectedPeriod=U.length,this.reportPeriod===l.op[1]){for(let x=0;x<12;x++)u.push({name:l.gg[x].name,date:new Date(t.getFullYear(),x,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});g.map(x=>{const N=new Date(1e3*+x.creation_date).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+ +x.value_msat+ +x.fee_msat,u[N].series[0].value=u[N].series[0].value+(+x.value_msat+ +x.fee_msat)/1e3,u[N].series[0].extra.total=u[N].series[0].extra.total+1,this.transactionsReportSummary}),U.map(x=>{const N=new Date(1e3*+x.creation_date).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+ +x.amt_paid_msat,u[N].series[1].value=u[N].series[1].value+ +x.amt_paid_msat/1e3,u[N].series[1].extra.total=u[N].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let x=0;x<this.getMonthDays(t.getMonth(),t.getFullYear());x++)u.push({name:(x+1).toString(),date:new Date(1e3*(x*this.secondsInADay+o)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});g.map(x=>{const N=Math.floor((+x.creation_date-o)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+ +x.value_msat+ +x.fee_msat,u[N].series[0].value=u[N].series[0].value+(+x.value_msat+ +x.fee_msat)/1e3,u[N].series[0].extra.total=u[N].series[0].extra.total+1,this.transactionsReportSummary}),U.map(x=>{const N=Math.floor((+x.creation_date-o)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+ +x.amt_paid_msat,u[N].series[1].value=u[N].series[1].value+ +x.amt_paid_msat/1e3,u[N].series[1].extra.total=u[N].series[1].extra.total+1,this.transactionsReportSummary})}return u}prepareTableData(){return this.transactionsReportData.reduce((t,a)=>a.series[0].extra.total>0||a.series[1].extra.total>0?t.concat({date:a.date,amount_paid:a.series[0].value,num_payments:a.series[0].extra.total,amount_received:a.series[1].value,num_invoices:a.series[1].extra.total}):t,[])}onSelectionChange(t){const a=t.selDate.getMonth(),o=t.selDate.getFullYear();this.reportPeriod=t.selScrollRange,this.reportPeriod===l.op[1]?(this.startDate=new Date(o,0,1,0,0,0),this.endDate=new Date(o,11,31,23,59,59)):(this.startDate=new Date(o,a,1,0,0,0),this.endDate=new Date(o,a,this.getMonthDays(a,o),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(t,a){return 1===t&&a%4==0?l.gg[t].days+1:l.gg[t].days}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-transactions-report"]],hostBindings:function(t,a){1&t&&e.NdJ("mouseup",function(s){return a.onChartMouseUp(s)})},decls:11,vars:6,consts:[["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x-large"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100",1,"padding-gap-x"],["fxLayout","column","fxLayoutAlign","start stretch","fxFlex","100"],[3,"stepChanged"],["class","p-2",4,"ngIf"],["class","p-2 error-border my-2",4,"ngIf"],["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"],["class","mt-1",4,"ngIf"],[1,"mt-1"],[3,"dataList","dataRange","filterValue",4,"ngIf"],[1,"p-2"],["mode","indeterminate"],[1,"p-2","error-border","my-2"],["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"],["class","two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup",4,"ngIf"],[1,"two-color",3,"view","results","noBarWhenZero","gradient","xAxis","yAxis","showXAxisLabel","showYAxisLabel","xAxisLabel","yAxisLabel","showGridLines","showDataLabel","groupPadding","select","mouseup"],["tooltipTemplate",""],[1,"tooltip-label"],[3,"dataList","dataRange","filterValue"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e.TgZ(3,"rtl-horizontal-scroller",3),e.NdJ("stepChanged",function(s){return a.onSelectionChange(s)}),e.qZA(),e.YNc(4,Fm,4,0,"div",4),e.YNc(5,Nm,2,1,"div",5),e.YNc(6,Rm,3,3,"div",6),e.YNc(7,Im,2,0,"div",7),e.YNc(8,Mm,2,1,"div",8),e.TgZ(9,"div",9),e.YNc(10,Jm,1,3,"rtl-transactions-report-table",10),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(4),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.ERROR),e.xp6(1),e.Q6J("ngIf",a.transactionsNonZeroReportData.length>0&&a.apiCallStatus.status===a.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",a.transactionsNonZeroReportData.length<=0&&a.apiCallStatus.status===a.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",a.transactionsNonZeroReportData.length>0&&a.apiCallStatus.status===a.apiCallStatusEnum.COMPLETED),e.xp6(2),e.Q6J("ngIf",a.transactionsNonZeroReportData.length>0&&a.apiCallStatus.status===a.apiCallStatusEnum.COMPLETED))},directives:[_.xw,_.Wh,_.yH,He.D,m.O5,M.pW,Ge.H5,km.g],pipes:[m.JJ],styles:[""],data:{animation:[Be.J]}}),n})();const Em=["form"];function Ym(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"UTXO Label is required."),e.qZA())}function Bm(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.labelError)}}function Hm(n,i){if(1&n&&(e.TgZ(0,"div",16),e._UZ(1,"fa-icon",17),e.YNc(2,Bm,2,1,"span",11),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(1),e.Q6J("ngIf",""!==t.labelError)}}let Gm=(()=>{class n{constructor(t,a,o,s,u,g){this.dialogRef=t,this.data=a,this.dataService=o,this.store=s,this.snackBar=u,this.commonService=g,this.faExclamationTriangle=y.eHv,this.utxo=null,this.label="",this.labelError="",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.utxo=this.data.utxo,this.label=this.utxo.label}onLabelUTXO(){if(!this.label||""===this.label)return!0;this.labelError="",this.dataService.labelUTXO(this.utxo.outpoint.txid_bytes,this.label,!0).pipe((0,d.R)(this.unSubs[0])).subscribe({next:t=>{this.store.dispatch((0,b.mC)()),this.store.dispatch((0,b.Ly)()),this.snackBar.open("Successfully labelled the UTXO."),this.dialogRef.close()},error:t=>{this.labelError=t}})}resetData(){this.labelError="",this.label=""}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(K.D),e.Y36(w.yh),e.Y36(te.ux),e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-on-chain-lebel-modal"]],viewQuery:function(t,a){if(1&t&&e.Gf(Em,7),2&t){let o;e.iGM(o=e.CRH())&&(a.form=o.first)}},decls:20,vars:4,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100",1,"overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex.gt-sm","100"],["autoFocus","","matInput","","placeholder","UTXO Label","name","label","tabindex","1","required","",3,"ngModel","ngModelChange"],[4,"ngIf"],["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"],["mat-button","","color","primary","type","submit","tabindex","8"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5,"Label UTXO"),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.TgZ(9,"form",7,8),e.NdJ("submit",function(){return a.onLabelUTXO()})("reset",function(){return a.resetData()}),e.TgZ(11,"mat-form-field",9),e.TgZ(12,"input",10),e.NdJ("ngModelChange",function(s){return a.label=s}),e.qZA(),e.YNc(13,Ym,2,0,"mat-error",11),e.qZA(),e.YNc(14,Hm,3,2,"div",12),e.TgZ(15,"div",13),e.TgZ(16,"button",14),e._uU(17,"Clear"),e.qZA(),e.TgZ(18,"button",15),e._uU(19,"Label UTXO"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(6),e.Q6J("mat-dialog-close",!1),e.xp6(6),e.Q6J("ngModel",a.label),e.xp6(1),e.Q6J("ngIf",!a.label),e.xp6(1),e.Q6J("ngIf",""!==a.labelError))},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,J.ZT,A.dn,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,V.h,c.Q7,c.JJ,c.On,m.O5,f.TO,I.BN],styles:[""]}),n})();function zm(n,i){1&n&&e._UZ(0,"mat-progress-bar",28)}function Vm(n,i){1&n&&(e.TgZ(0,"th",29),e._uU(1," Transaction ID "),e.qZA())}function Wm(n,i){1&n&&(e.TgZ(0,"span",35),e.TgZ(1,"mat-icon",36),e._uU(2,"warning"),e.qZA(),e.qZA())}function Xm(n,i){if(1&n&&(e.TgZ(0,"span"),e.YNc(1,Wm,3,0,"span",34),e.qZA()),2&n){const t=e.oxw().$implicit;e.oxw();const a=e.MAs(34);e.xp6(1),e.Q6J("ngIf",t.amount_sat<1e3)("ngIfElse",a)}}const ze=function(n){return{"max-width":n}};function $m(n,i){if(1&n&&(e.TgZ(0,"td",30),e.TgZ(1,"span",31),e.YNc(2,Xm,2,2,"span",32),e.TgZ(3,"span",33),e._uU(4),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(3,ze,a.screenSize===a.screenSizeEnum.XS?"12rem":"25rem")),e.xp6(2),e.Q6J("ngIf",a.utxos.length>0&&a.dustUtxos.length>0&&!a.isDustUTXO),e.xp6(2),e.Oqu(t.outpoint.txid_str)}}function jm(n,i){1&n&&(e.TgZ(0,"th",37),e._uU(1," Output "),e.qZA())}function Km(n,i){if(1&n&&(e.TgZ(0,"td",38),e.TgZ(1,"span",39),e._uU(2),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(t.outpoint.output_index)}}function e_(n,i){1&n&&(e.TgZ(0,"th",29),e._uU(1," Label "),e.qZA())}function t_(n,i){if(1&n&&(e.TgZ(0,"td",30),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,ze,a.screenSize===a.screenSizeEnum.XS?"12rem":"25rem")),e.xp6(1),e.hij(" ",null==t?null:t.label," ")}}function n_(n,i){1&n&&(e.TgZ(0,"th",37),e._uU(1," Amount (Sats) "),e.qZA())}function a_(n,i){if(1&n&&(e.TgZ(0,"td",38),e.TgZ(1,"span",39),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.amount_sat||0))}}function i_(n,i){1&n&&(e.TgZ(0,"th",37),e._uU(1," Confirmations "),e.qZA())}function o_(n,i){if(1&n&&(e.TgZ(0,"td",38),e.TgZ(1,"span",39),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.confirmations||0))}}function s_(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",40),e.TgZ(1,"div",41),e.TgZ(2,"mat-select",42),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",43),e.NdJ("click",function(){return e.CHM(t),e.oxw().onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function l_(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",44),e.TgZ(1,"div",45),e.TgZ(2,"mat-select",46),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",43),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onUTXOClick(s)}),e._uU(5,"View Info"),e.qZA(),e.TgZ(6,"mat-option",43),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onLabelUTXO(s)}),e._uU(7,"Label"),e.qZA(),e.TgZ(8,"mat-option",43),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onLeaseUTXO(s)}),e._uU(9,"Lease"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function r_(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No UTXO available."),e.qZA())}function c_(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting UTXOs..."),e.qZA())}function u_(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function p_(n,i){if(1&n&&(e.TgZ(0,"td",47),e.YNc(1,r_,2,0,"p",32),e.YNc(2,c_,2,0,"p",32),e.YNc(3,u_,2,1,"p",32),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!(null!=t.listUTXOs&&t.listUTXOs.data)||(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.listUTXOs&&t.listUTXOs.data)||(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.listUTXOs&&t.listUTXOs.data)||(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const m_=function(n){return{"display-none":n}};function __(n,i){if(1&n&&e._UZ(0,"tr",48),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,m_,(null==t.listUTXOs?null:t.listUTXOs.data)&&(null==t.listUTXOs||null==t.listUTXOs.data?null:t.listUTXOs.data.length)>0))}}function d_(n,i){1&n&&e._UZ(0,"tr",49)}function h_(n,i){1&n&&e._UZ(0,"tr",50)}function g_(n,i){1&n&&e._UZ(0,"mat-icon",36)}const f_=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},C_=function(){return["no_utxo"]};let x_=(()=>{class n{constructor(t,a,o,s,u,g){this.logger=t,this.commonService=a,this.dataService=o,this.store=s,this.rtlEffects=u,this.decimalPipe=g,this.isDustUTXO=!1,this.addressType=l.x$,this.faMoneyBillWave=y.aj4,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["amount_sat","confirmations","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["tx_id","output","amount_sat","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["tx_id","output","label","amount_sat","confirmations","actions"]):(this.flgSticky=!0,this.displayedColumns=["tx_id","output","label","amount_sat","confirmations","actions"])}ngOnInit(){this.store.select(C.T4).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),t.utxos&&t.utxos.length>0&&(this.dustUtxos=t.utxos.filter(a=>+a.amount_sat<1e3),this.utxos=t.utxos,this.loadUTXOsTable(this.isDustUTXO?this.dustUtxos:this.utxos)),this.logger.info(t)})}ngOnChanges(){!this.isDustUTXO&&this.utxos&&this.utxos.length>0&&this.loadUTXOsTable(this.utxos),this.isDustUTXO&&this.dustUtxos&&this.dustUtxos.length>0&&this.loadUTXOsTable(this.dustUtxos)}applyFilter(){this.listUTXOs.filter=this.selFilter.trim().toLowerCase()}onUTXOClick(t){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"UTXO Information",message:[[{key:"txid",value:t.outpoint.txid_str,title:"Transaction ID",width:100,type:l.Gi.STRING}],[{key:"label",value:t.label,title:"Label",width:100,type:l.Gi.STRING}],[{key:"output_index",value:t.outpoint.output_index,title:"Output Index",width:34,type:l.Gi.NUMBER},{key:"amount_sat",value:t.amount_sat,title:"Amount (Sats)",width:33,type:l.Gi.NUMBER},{key:"confirmations",value:t.confirmations,title:"Confirmations",width:33,type:l.Gi.NUMBER}],[{key:"address_type",value:this.addressType[t.address_type].name,title:"Address Type",width:34},{key:"address",value:t.address,title:"Address",width:66}],[{key:"pk_script",value:t.pk_script,title:"PK Script",width:100,type:l.Gi.STRING}]]}}}))}loadUTXOsTable(t){this.listUTXOs=new r.by([...t]),this.listUTXOs.filterPredicate=(a,o)=>((a.label?a.label.toLowerCase():"")+(a.outpoint.txid_str?a.outpoint.txid_str.toLowerCase():"")+(a.outpoint.output_index?a.outpoint.output_index:"")+(a.outpoint.txid_bytes?a.outpoint.txid_bytes.toLowerCase():"")+(a.address?a.address.toLowerCase():"")+(a.address_type?a.address_type.toLowerCase():"")+(a.amount_sat?a.amount_sat:"")+(a.confirmations?a.confirmations:"")+(a.pk_script?a.pk_script.toLowerCase():"")).includes(o),this.listUTXOs.sortingDataAccessor=(a,o)=>{switch(o){case"tx_id":return a.outpoint.txid_str.toLocaleLowerCase();case"output":return+a.outpoint.output_index;default:return a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null}},this.listUTXOs.sort=this.sort,this.listUTXOs.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.listUTXOs.paginator=this.paginator,this.applyFilter(),this.logger.info(this.listUTXOs)}onLabelUTXO(t){this.store.dispatch((0,v.qR)({payload:{data:{utxo:t,component:Gm}}}))}onLeaseUTXO(t){const a=[[{key:"txid_str",value:t.outpoint.txid_str,title:"Transaction ID",width:100}],[{key:"amount_sat",value:this.decimalPipe.transform(t.amount_sat),title:"Amount (Sats)",width:100}]];t.label&&a.splice(1,0,[{key:"label",value:t.label,title:"Label",width:100}]),this.store.dispatch((0,v.c1)({payload:{data:{type:l.n_.CONFIRM,alertTitle:"Lease UTXO",informationMessage:"The UTXO will be leased for 10 minutes.",message:a,noBtnText:"Cancel",yesBtnText:"Lease UTXO"}}})),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[0])).subscribe(o=>{o&&this.dataService.leaseUTXO(t.outpoint.txid_bytes,t.outpoint.output_index)})}onDownloadCSV(){this.listUTXOs.data&&this.listUTXOs.data.length>0&&this.commonService.downloadFile(this.listUTXOs.data,"UTXOs")}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(K.D),e.Y36(w.yh),e.Y36(ie.V),e.Y36(m.JJ))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-on-chain-utxos"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},inputs:{isDustUTXO:"isDustUTXO"},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("UTXOs")}]),e.TTD],decls:35,vars:14,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","end stretch","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","tx_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","output"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","label"],["matColumnDef","amount_sat"],["matColumnDef","confirmations"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","fxLayoutAlign","end center","class","pl-3",4,"matCellDef"],["matColumnDef","no_utxo"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["emptySpace",""],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["fxLayout","row"],[4,"ngIf"],[1,"ellipsis-child"],["matTooltip","Risk of dust attack","matTooltipPosition","right",4,"ngIf","ngIfElse"],["matTooltip","Risk of dust attack","matTooltipPosition","right"],["fxLayoutAlign","start center","color","warn",1,"small-icon"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-header-cell","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-3"],["fxLayoutAlign","center center",1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","2",1,"mr-0"],["mat-footer-cell","","colspan","4"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-form-field",2),e.TgZ(3,"input",3),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.YNc(6,zm,1,0,"mat-progress-bar",6),e.TgZ(7,"table",7,8),e.ynx(9,9),e.YNc(10,Vm,2,0,"th",10),e.YNc(11,$m,5,5,"td",11),e.BQk(),e.ynx(12,12),e.YNc(13,jm,2,0,"th",13),e.YNc(14,Km,3,1,"td",14),e.BQk(),e.ynx(15,15),e.YNc(16,e_,2,0,"th",10),e.YNc(17,t_,2,4,"td",11),e.BQk(),e.ynx(18,16),e.YNc(19,n_,2,0,"th",13),e.YNc(20,a_,4,3,"td",14),e.BQk(),e.ynx(21,17),e.YNc(22,i_,2,0,"th",13),e.YNc(23,o_,4,3,"td",14),e.BQk(),e.ynx(24,18),e.YNc(25,s_,6,0,"th",19),e.YNc(26,l_,10,0,"td",20),e.BQk(),e.ynx(27,21),e.YNc(28,p_,4,3,"td",22),e.BQk(),e.YNc(29,__,1,3,"tr",23),e.YNc(30,d_,1,0,"tr",24),e.YNc(31,h_,1,0,"tr",25),e.qZA(),e._UZ(32,"mat-paginator",26),e.qZA(),e.qZA(),e.qZA(),e.YNc(33,g_,1,0,"ng-template",null,27,e.W1O)),2&t&&(e.xp6(3),e.Q6J("ngModel",a.selFilter),e.xp6(3),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.listUTXOs)("ngClass",e.VKq(11,f_,""!==a.errorMessage)),e.xp6(22),e.Q6J("matFooterRowDef",e.DdM(13,C_)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,_.yH,_.Wh,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,m.O5,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,W.gM,j.Hw,O.gD,O.$L,E.ey,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-label[_ngcontent-%COMP%]{padding-left:1rem;flex:1 1 15%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-tx_id[_ngcontent-%COMP%]{flex:1 1 15%}.mat-column-tx_id[_ngcontent-%COMP%] .ellipsis-child[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();function T_(n,i){1&n&&e._UZ(0,"mat-progress-bar",28)}function y_(n,i){1&n&&(e.TgZ(0,"th",29),e._uU(1," Date/Time "),e.qZA())}function Z_(n,i){if(1&n&&(e.TgZ(0,"td",30),e._uU(1),e.ALo(2,"date"),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(e.xi3(2,1,1e3*t.time_stamp,"dd/MMM/y HH:mm"))}}function b_(n,i){1&n&&(e.TgZ(0,"th",29),e._uU(1," Label "),e.qZA())}const A_=function(n){return{"max-width":n}};function v_(n,i){if(1&n&&(e.TgZ(0,"td",31),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,A_,a.screenSize===a.screenSizeEnum.XS?"12rem":"25rem")),e.xp6(1),e.hij(" ",null==t?null:t.label," ")}}function w_(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1," Amount (Sats) "),e.qZA())}function q_(n,i){if(1&n&&(e.TgZ(0,"span",35),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Oqu(e.lcZ(2,1,t.amount))}}function S_(n,i){if(1&n&&(e.TgZ(0,"span",36),e._uU(1),e.ALo(2,"number"),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.hij("(",e.lcZ(2,1,-1*t.amount),")")}}function L_(n,i){if(1&n&&(e.TgZ(0,"td",30),e.YNc(1,q_,3,3,"span",33),e.YNc(2,S_,3,3,"span",34),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Q6J("ngIf",t.amount>0||0===t.amount),e.xp6(1),e.Q6J("ngIf",t.amount<0)}}function k_(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1," Fees (Sats) "),e.qZA())}function F_(n,i){if(1&n&&(e.TgZ(0,"td",30),e.TgZ(1,"span",35),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.total_fees))}}function N_(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1," Block Height "),e.qZA())}function O_(n,i){if(1&n&&(e.TgZ(0,"td",30),e.TgZ(1,"span",35),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.block_height))}}function U_(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1," Confirmations "),e.qZA())}function R_(n,i){if(1&n&&(e.TgZ(0,"td",30),e.TgZ(1,"span",35),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.hij(" ",e.lcZ(3,1,null==t?null:t.num_confirmations)," ")}}function I_(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"th",37),e.TgZ(1,"div",38),e.TgZ(2,"mat-select",39),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",40),e.NdJ("click",function(){return e.CHM(t),e.oxw().onDownloadCSV()}),e._uU(5,"Download CSV"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function D_(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",41),e.TgZ(1,"button",42),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onTransactionClick(s)}),e._uU(2,"View Info"),e.qZA(),e.qZA()}}function P_(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No transaction available."),e.qZA())}function M_(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting transactions..."),e.qZA())}function J_(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function Q_(n,i){if(1&n&&(e.TgZ(0,"td",43),e.YNc(1,P_,2,0,"p",44),e.YNc(2,M_,2,0,"p",44),e.YNc(3,J_,2,1,"p",44),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!(null!=t.listTransactions&&t.listTransactions.data)||(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.listTransactions&&t.listTransactions.data)||(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.listTransactions&&t.listTransactions.data)||(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const E_=function(n){return{"display-none":n}};function Y_(n,i){if(1&n&&e._UZ(0,"tr",45),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,E_,(null==t.listTransactions?null:t.listTransactions.data)&&(null==t.listTransactions||null==t.listTransactions.data?null:t.listTransactions.data.length)>0))}}function B_(n,i){1&n&&e._UZ(0,"tr",46)}function H_(n,i){1&n&&e._UZ(0,"tr",47)}const G_=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},z_=function(){return["no_transaction"]};let V_=(()=>{class n{constructor(t,a,o,s){this.logger=t,this.commonService=a,this.store=o,this.datePipe=s,this.faHistory=y.qO$,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.flgSticky=!1,this.displayedColumns=["time_stamp","amount","actions"]):this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["time_stamp","amount","num_confirmations","total_fees","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["time_stamp","label","amount","total_fees","num_confirmations","actions"]):(this.flgSticky=!0,this.displayedColumns=["time_stamp","label","amount","total_fees","block_height","num_confirmations","actions"])}ngOnInit(){this.store.select(C.dx).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),t.transactions&&t.transactions.length>0&&(this.transactions=t.transactions,this.loadTransactionsTable(this.transactions)),this.logger.info(t)})}ngOnChanges(){this.transactions&&this.transactions.length>0&&this.loadTransactionsTable(this.transactions)}applyFilter(){this.listTransactions.filter=this.selFilter.trim().toLowerCase()}onTransactionClick(t){this.store.dispatch((0,v.qR)({payload:{data:{type:l.n_.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"block_hash",value:t.block_hash,title:"Block Hash",width:100}],[{key:"tx_hash",value:t.tx_hash,title:"Transaction Hash",width:100}],[{key:"label",value:t.label,title:"Label",width:100,type:l.Gi.STRING}],[{key:"time_stamp",value:t.time_stamp,title:"Date/Time",width:50,type:l.Gi.DATE_TIME},{key:"block_height",value:t.block_height,title:"Block Height",width:50,type:l.Gi.NUMBER}],[{key:"num_confirmations",value:t.num_confirmations,title:"Number of Confirmations",width:34,type:l.Gi.NUMBER},{key:"total_fees",value:t.total_fees,title:"Total Fees (Sats)",width:33,type:l.Gi.NUMBER},{key:"amount",value:t.amount,title:"Amount (Sats)",width:33,type:l.Gi.NUMBER}],[{key:"dest_addresses",value:t.dest_addresses,title:"Destination Addresses",width:100,type:l.Gi.ARRAY}]],scrollable:t.dest_addresses&&t.dest_addresses.length>5}}}))}loadTransactionsTable(t){this.listTransactions=new r.by([...t]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.listTransactions.filterPredicate=(a,o)=>((a.time_stamp?this.datePipe.transform(new Date(1e3*a.time_stamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(a).toLowerCase()).includes(o),this.listTransactions.paginator=this.paginator,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(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh),e.Y36(m.uU))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-on-chain-transaction-history"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Transactions")}]),e.TTD],decls:36,vars:14,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["fxLayout","column","fxLayout.gt-xs","row wrap","fxLayoutAlign.gt-xs","end stretch","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","time_stamp"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","label"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","amount"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["matColumnDef","total_fees"],["matColumnDef","block_height"],["matColumnDef","num_confirmations"],["matColumnDef","actions"],["mat-header-cell","","class","px-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-3","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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell",""],["mat-cell","",3,"ngStyle"],["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","",1,"px-3"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-cell","","fxLayoutAlign","end center",1,"pl-3"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-form-field",2),e.TgZ(3,"input",3),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(4,"div",4),e.TgZ(5,"div",5),e.YNc(6,T_,1,0,"mat-progress-bar",6),e.TgZ(7,"table",7,8),e.ynx(9,9),e.YNc(10,y_,2,0,"th",10),e.YNc(11,Z_,3,4,"td",11),e.BQk(),e.ynx(12,12),e.YNc(13,b_,2,0,"th",10),e.YNc(14,v_,2,4,"td",13),e.BQk(),e.ynx(15,14),e.YNc(16,w_,2,0,"th",15),e.YNc(17,L_,3,2,"td",11),e.BQk(),e.ynx(18,16),e.YNc(19,k_,2,0,"th",15),e.YNc(20,F_,4,3,"td",11),e.BQk(),e.ynx(21,17),e.YNc(22,N_,2,0,"th",15),e.YNc(23,O_,4,3,"td",11),e.BQk(),e.ynx(24,18),e.YNc(25,U_,2,0,"th",15),e.YNc(26,R_,4,3,"td",11),e.BQk(),e.ynx(27,19),e.YNc(28,I_,6,0,"th",20),e.YNc(29,D_,3,0,"td",21),e.BQk(),e.ynx(30,22),e.YNc(31,Q_,4,3,"td",23),e.BQk(),e.YNc(32,Y_,1,3,"tr",24),e.YNc(33,B_,1,0,"tr",25),e.YNc(34,H_,1,0,"tr",26),e.qZA(),e._UZ(35,"mat-paginator",27),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(3),e.Q6J("ngModel",a.selFilter),e.xp6(3),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.listTransactions)("ngClass",e.VKq(11,G_,""!==a.errorMessage)),e.xp6(25),e.Q6J("matFooterRowDef",e.DdM(13,z_)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,_.yH,_.Wh,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,m.O5,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,O.gD,O.$L,E.ey,L.lW,r.yh,r.Q2,r.XQ,r.Gk],pipes:[m.uU,m.JJ],styles:[".mat-column-label[_ngcontent-%COMP%]{flex:1 1 20%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})();function W_(n,i){if(1&n&&(e.TgZ(0,"span",5),e._uU(1,"UTXOs"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.numUtxos)}}function X_(n,i){if(1&n&&(e.TgZ(0,"span",5),e._uU(1,"Transactions"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.numTransactions)}}function $_(n,i){if(1&n&&(e.TgZ(0,"span",5),e._uU(1,"Dust UTXOs"),e.qZA()),2&n){const t=e.oxw();e.s9C("matBadge",t.numDustUtxos)}}let j_=(()=>{class n{constructor(t,a){this.logger=t,this.store=a,this.selectedTableIndex=0,this.selectedTableIndexChange=new e.vpe,this.numTransactions=0,this.numUtxos=0,this.numDustUtxos=0,this.unSubs=[new p.x,new p.x,new p.x]}ngOnInit(){this.store.dispatch((0,b.mC)()),this.store.dispatch((0,b.Ly)()),this.store.select(C.T4).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{t.utxos&&t.utxos.length>0&&(this.numUtxos=t.utxos.length,this.numDustUtxos=t.utxos.filter(a=>+a.amount_sat<1e3).length),this.logger.info(t)}),this.store.select(C.dx).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{t.transactions&&t.transactions.length>0&&(this.numTransactions=t.transactions.length),this.logger.info(t)})}onSelectedIndexChanged(t){this.selectedTableIndexChange.emit(t)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-utxo-tables"]],inputs:{selectedTableIndex:"selectedTableIndex"},outputs:{selectedTableIndexChange:"selectedTableIndexChange"},decls:11,vars:3,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"bordered-box"],[3,"selectedIndex","selectedIndexChange"],["mat-tab-label",""],["fxLayout","row","fxFlex","100",3,"isDustUTXO"],["fxLayout","row","fxFlex","100"],["matBadgeOverlap","false",1,"tab-badge",3,"matBadge"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"mat-tab-group",1),e.NdJ("selectedIndexChange",function(s){return a.onSelectedIndexChanged(s)}),e.TgZ(2,"mat-tab"),e.YNc(3,W_,2,1,"ng-template",2),e._UZ(4,"rtl-on-chain-utxos",3),e.qZA(),e.TgZ(5,"mat-tab"),e.YNc(6,X_,2,1,"ng-template",2),e._UZ(7,"rtl-on-chain-transaction-history",4),e.qZA(),e.TgZ(8,"mat-tab"),e.YNc(9,$_,2,1,"ng-template",2),e._UZ(10,"rtl-on-chain-utxos",3),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("selectedIndex",a.selectedTableIndex),e.xp6(3),e.Q6J("isDustUTXO",!1),e.xp6(6),e.Q6J("isDustUTXO",!0))},directives:[_.xw,_.yH,_.Wh,D.SP,D.uX,D.uD,x_,V_,he.k],styles:[""]}),n})();const K_=function(n,i){return[n,i]};function ed(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",12),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().activeLink=null==s?null:s.link}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw();e.Q6J("active",a.activeLink===(null==t?null:t.link))("routerLink",e.WLB(3,K_,null==t?null:t.link,null==a.selectedTable?null:a.selectedTable.name)),e.xp6(1),e.Oqu(null==t?null:t.name)}}let td=(()=>{class n{constructor(t,a,o){this.store=t,this.router=a,this.activatedRoute=o,this.selNode={},this.faExchangeAlt=y.Ssp,this.faChartPie=y.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"},{link:"sweep",name:"Sweep All"}],this.activeLink=this.links[0].link,this.tables=[{id:0,name:"utxos"},{id:1,name:"trans"},{id:2,name:"dustUtxos"}],this.selectedTable=this.tables[0],this.unSubs=[new p.x,new p.x,new p.x,new p.x]}ngOnInit(){const t=this.links.find(a=>this.router.url.includes(a.link));this.activeLink=t?t.link:this.links[0].link,this.selectedTable=this.tables.find(a=>a.name===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(a=>a instanceof T.Av)).subscribe(a=>{const o=this.links.find(s=>a.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link,this.selectedTable=this.tables.find(s=>s.name===a.urlAfterRedirects.substring(a.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select(C.$k).pipe((0,d.R)(this.unSubs[1])).subscribe(a=>{this.selNode=a}),this.store.select(C.qU).pipe((0,d.R)(this.unSubs[2])).subscribe(a=>{this.balances=[{title:"Total Balance",dataValue:a.blockchainBalance.total_balance||0},{title:"Confirmed",dataValue:a.blockchainBalance.confirmed_balance},{title:"Unconfirmed",dataValue:a.blockchainBalance.unconfirmed_balance}]})}onSelectedTableIndexChanged(t){this.selectedTable=this.tables.find(a=>a.id===t),this.router.navigate(["./",this.activeLink,this.selectedTable.name],{relativeTo:this.activatedRoute})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh),e.Y36(T.F0),e.Y36(T.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-on-chain"]],decls:21,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",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"padding-gap-x-large"],["fxLayout","row","fxFlex","100",3,"selectedTableIndex","selectedTableIndexChange"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"On-chain Balance"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e._UZ(7,"rtl-currency-unit-converter",5),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",0),e._UZ(9,"fa-icon",1),e.TgZ(10,"span",2),e._uU(11,"On-chain Transactions"),e.qZA(),e.qZA(),e.TgZ(12,"div",6),e.TgZ(13,"mat-card"),e.TgZ(14,"mat-card-content",4),e.TgZ(15,"nav",7),e.YNc(16,ed,2,6,"div",8),e.qZA(),e.TgZ(17,"div",9),e._UZ(18,"router-outlet"),e.qZA(),e.TgZ(19,"div",10),e.TgZ(20,"rtl-utxo-tables",11),e.NdJ("selectedTableIndexChange",function(s){return a.onSelectedTableIndexChanged(s)}),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faChartPie),e.xp6(6),e.Q6J("values",a.balances),e.xp6(2),e.Q6J("icon",a.faExchangeAlt),e.xp6(7),e.Q6J("ngForOf",a.links),e.xp6(4),e.Q6J("selectedTableIndex",null==a.selectedTable?null:a.selectedTable.id))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,de.D,D.BU,m.sg,_.yH,T.lC,j_,D.Nj,T.rH],styles:[""]}),n})();var nd=h(9122);function ad(n,i){if(1&n&&(e.TgZ(0,"mat-option",7),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.hij(" ",t.addressTp," ")}}let id=(()=>{class n{constructor(t,a){this.store=t,this.lndEffects=a,this.addressTypes=l._t,this.selectedAddressType=l._t[0],this.newAddress=""}onGenerateAddress(){this.store.dispatch((0,b._E)({payload:this.selectedAddressType})),this.lndEffects.setNewAddress.pipe((0,G.q)(1)).subscribe(t=>{this.newAddress=t,setTimeout(()=>{this.store.dispatch((0,v.qR)({payload:{data:{address:this.newAddress,addressType:this.selectedAddressType.addressTp,component:nd.n}}}))},0)})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh),e.Y36(ee.l))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-on-chain-receive"]],decls:8,vars:2,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start end"],["fxFlex","48","fxFlex.gt-md","25","fxLayoutAlign","start end",1,"mr-2"],["placeholder","Address Type","name","address_type","tabindex","1",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"mt-2"],["mat-flat-button","","color","primary","tabindex","2",1,"top-minus-15px",3,"click"],[3,"value"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-form-field",2),e.TgZ(3,"mat-select",3),e.NdJ("ngModelChange",function(s){return a.selectedAddressType=s}),e.YNc(4,ad,2,2,"mat-option",4),e.qZA(),e.qZA(),e.TgZ(5,"div",5),e.TgZ(6,"button",6),e.NdJ("click",function(){return a.onGenerateAddress()}),e._uU(7,"Generate Address"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(3),e.Q6J("ngModel",a.selectedAddressType),e.xp6(1),e.Q6J("ngForOf",a.addressTypes))},directives:[_.xw,_.Wh,f.KE,_.yH,O.gD,c.JJ,c.On,m.sg,L.lW,E.ey],styles:[""]}),n})();var od=h(8012),Ve=h(8377);const sd=["form"],ld=["formSweepAll"],rd=["stepper"];function cd(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Bitcoin address is required."),e.qZA())}function ud(n,i){if(1&n&&(e.TgZ(0,"mat-error"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.amountError)}}function pd(n,i){if(1&n&&(e.TgZ(0,"mat-option",31),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t),e.xp6(1),e.Oqu(t)}}function md(n,i){if(1&n&&(e.TgZ(0,"mat-option",31),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.name," ")}}function _d(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Number of blocks is required."),e.qZA())}function dd(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",23),e.TgZ(1,"input",32,33),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw(2).transactionBlocks=o}),e.qZA(),e.YNc(3,_d,2,0,"mat-error",14),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngModel",t.transactionBlocks)("step",1)("min",0),e.xp6(2),e.Q6J("ngIf",!t.transactionBlocks)}}function hd(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Fees is required."),e.qZA())}function gd(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-form-field",23),e.TgZ(1,"input",34,35),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw(2).transactionFees=o}),e.qZA(),e.YNc(3,hd,2,0,"mat-error",14),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngModel",t.transactionFees)("step",1)("min",0),e.xp6(2),e.Q6J("ngIf",!t.transactionFees)}}function fd(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.sendFundError)}}function Cd(n,i){if(1&n&&(e.TgZ(0,"div",36),e._UZ(1,"fa-icon",37),e.YNc(2,fd,2,1,"span",14),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(1),e.Q6J("ngIf",""!==t.sendFundError)}}function xd(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"form",9,10),e.NdJ("submit",function(){return e.CHM(t),e.oxw().onSendFunds()})("reset",function(){return e.CHM(t),e.oxw().resetData()}),e.TgZ(2,"mat-form-field",11),e.TgZ(3,"input",12,13),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().transactionAddress=o}),e.qZA(),e.YNc(5,cd,2,0,"mat-error",14),e.qZA(),e.TgZ(6,"mat-form-field",15),e.TgZ(7,"input",16,17),e.NdJ("ngModelChange",function(o){return e.CHM(t),e.oxw().transactionAmount=o}),e.qZA(),e.TgZ(9,"span",18),e._uU(10),e.qZA(),e.YNc(11,ud,2,1,"mat-error",14),e.qZA(),e.TgZ(12,"mat-form-field",19),e.TgZ(13,"mat-select",20),e.NdJ("selectionChange",function(o){return e.CHM(t),e.oxw().onAmountUnitChange(o)}),e.YNc(14,pd,2,2,"mat-option",21),e.qZA(),e.qZA(),e.TgZ(15,"div",22),e.TgZ(16,"mat-form-field",23),e.TgZ(17,"mat-select",24),e.NdJ("valueChange",function(o){return e.CHM(t),e.oxw().selTransType=o}),e.YNc(18,md,2,2,"mat-option",21),e.qZA(),e.qZA(),e.YNc(19,dd,4,4,"mat-form-field",25),e.YNc(20,gd,4,4,"mat-form-field",25),e.qZA(),e._UZ(21,"div",26),e.YNc(22,Cd,3,2,"div",27),e.TgZ(23,"div",28),e.TgZ(24,"button",29),e._uU(25,"Clear Fields"),e.qZA(),e.TgZ(26,"button",30),e._uU(27,"Send Funds"),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngModel",t.transactionAddress),e.xp6(2),e.Q6J("ngIf",!t.transactionAddress),e.xp6(2),e.Q6J("ngModel",t.transactionAmount)("step",100)("min",0),e.xp6(3),e.hij(" ",t.selAmountUnit," "),e.xp6(1),e.Q6J("ngIf",!t.transactionAmount),e.xp6(2),e.Q6J("value",t.selAmountUnit),e.xp6(1),e.Q6J("ngForOf",t.amountUnits),e.xp6(3),e.Q6J("value",t.selTransType),e.xp6(1),e.Q6J("ngForOf",t.transTypes),e.xp6(1),e.Q6J("ngIf","1"===t.selTransType),e.xp6(1),e.Q6J("ngIf","2"===t.selTransType),e.xp6(2),e.Q6J("ngIf",""!==t.sendFundError)}}function Td(n,i){if(1&n&&e._uU(0),2&n){const t=e.oxw(3);e.Oqu(t.passwordFormLabel)}}function yd(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Password is required."),e.qZA())}function Zd(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"mat-step",42),e.TgZ(1,"form",61),e.YNc(2,Td,1,1,"ng-template",55),e.TgZ(3,"div",0),e.TgZ(4,"mat-form-field",1),e._UZ(5,"input",62),e.YNc(6,yd,2,0,"mat-error",14),e.qZA(),e.qZA(),e.TgZ(7,"div",63),e.TgZ(8,"button",64),e.NdJ("click",function(){return e.CHM(t),e.oxw(2).onAuthenticate()}),e._uU(9,"Confirm"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.Q6J("stepControl",t.passwordFormGroup)("editable",t.flgEditable),e.xp6(1),e.Q6J("formGroup",t.passwordFormGroup),e.xp6(5),e.Q6J("ngIf",null==t.passwordFormGroup.controls.password.errors?null:t.passwordFormGroup.controls.password.errors.required)}}function bd(n,i){if(1&n&&e._uU(0),2&n){const t=e.oxw(2);e.Oqu(t.sendFundFormLabel)}}function Ad(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Bitcoin address is required."),e.qZA())}function vd(n,i){if(1&n&&(e.TgZ(0,"mat-option",31),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.Q6J("value",t.id),e.xp6(1),e.hij(" ",t.name," ")}}function wd(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Number of blocks is required."),e.qZA())}function qd(n,i){if(1&n&&(e.TgZ(0,"mat-form-field",65),e._UZ(1,"input",66),e.YNc(2,wd,2,0,"mat-error",14),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("step",1)("min",0),e.xp6(1),e.Q6J("ngIf",null==t.sendFundFormGroup.controls.transactionBlocks.errors?null:t.sendFundFormGroup.controls.transactionBlocks.errors.required)}}function Sd(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Fees is required."),e.qZA())}function Ld(n,i){if(1&n&&(e.TgZ(0,"mat-form-field",65),e._UZ(1,"input",67),e.YNc(2,Sd,2,0,"mat-error",14),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("step",1)("min",0),e.xp6(1),e.Q6J("ngIf",null==t.sendFundFormGroup.controls.transactionFees.errors?null:t.sendFundFormGroup.controls.transactionFees.errors.required)}}function kd(n,i){if(1&n&&e._uU(0),2&n){const t=e.oxw(2);e.Oqu(t.confirmFormLabel)}}function Fd(n,i){if(1&n&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Oqu(t.sendFundError)}}function Nd(n,i){if(1&n&&(e.TgZ(0,"div",36),e._UZ(1,"fa-icon",37),e.YNc(2,Fd,2,1,"span",14),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("icon",t.faExclamationTriangle),e.xp6(1),e.Q6J("ngIf",""!==t.sendFundError)}}function Od(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",38),e.TgZ(1,"mat-vertical-stepper",39,40),e.NdJ("selectionChange",function(o){return e.CHM(t),e.oxw().stepSelectionChanged(o)}),e.YNc(3,Zd,10,4,"mat-step",41),e.TgZ(4,"mat-step",42),e.TgZ(5,"form",43),e.YNc(6,bd,1,1,"ng-template",44),e.TgZ(7,"div",45),e.TgZ(8,"mat-form-field",46),e._UZ(9,"input",47),e.YNc(10,Ad,2,0,"mat-error",14),e.qZA(),e.TgZ(11,"mat-form-field",48),e.TgZ(12,"mat-select",49),e.YNc(13,vd,2,2,"mat-option",21),e.qZA(),e.qZA(),e.YNc(14,qd,3,3,"mat-form-field",50),e.YNc(15,Ld,3,3,"mat-form-field",50),e.qZA(),e.TgZ(16,"div",51),e.TgZ(17,"button",52),e._uU(18,"Next"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(19,"mat-step",53),e.TgZ(20,"form",54),e.YNc(21,kd,1,1,"ng-template",55),e.TgZ(22,"div",38),e.TgZ(23,"div",56),e._UZ(24,"fa-icon",57),e.TgZ(25,"span"),e._uU(26,"You are about to sweep all funds from RTL. Are you sure?"),e.qZA(),e.qZA(),e.YNc(27,Nd,3,2,"div",27),e.TgZ(28,"div",51),e.TgZ(29,"button",58),e.NdJ("click",function(){return e.CHM(t),e.oxw().onSendFunds()}),e._uU(30,"Sweep All Funds"),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.TgZ(31,"div",59),e.TgZ(32,"button",60),e._uU(33),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("linear",!0),e.xp6(2),e.Q6J("ngIf",!t.appConfig.sso.rtlSSO),e.xp6(1),e.Q6J("stepControl",t.sendFundFormGroup)("editable",t.flgEditable),e.xp6(1),e.Q6J("formGroup",t.sendFundFormGroup),e.xp6(5),e.Q6J("ngIf",null==t.sendFundFormGroup.controls.transactionAddress.errors?null:t.sendFundFormGroup.controls.transactionAddress.errors.required),e.xp6(3),e.Q6J("ngForOf",t.transTypes),e.xp6(1),e.Q6J("ngIf","1"===t.sendFundFormGroup.controls.selTransType.value),e.xp6(1),e.Q6J("ngIf","2"===t.sendFundFormGroup.controls.selTransType.value),e.xp6(4),e.Q6J("stepControl",t.confirmFormGroup),e.xp6(1),e.Q6J("formGroup",t.confirmFormGroup),e.xp6(4),e.Q6J("icon",t.faExclamationTriangle),e.xp6(3),e.Q6J("ngIf",""!==t.sendFundError),e.xp6(5),e.Q6J("mat-dialog-close",!1),e.xp6(1),e.Oqu(t.flgValidated?"Close":"Cancel")}}let Ud=(()=>{class n{constructor(t,a,o,s,u,g,U,x,N,se){this.dialogRef=t,this.data=a,this.logger=o,this.store=s,this.rtlEffects=u,this.commonService=g,this.decimalPipe=U,this.snackBar=x,this.actions=N,this.formBuilder=se,this.faExclamationTriangle=y.eHv,this.sweepAll=!1,this.selNode={},this.addressTypes=[],this.selectedAddress={},this.blockchainBalance={},this.information={},this.newAddress="",this.transactionAddress="",this.transactionAmount=null,this.transactionFees=null,this.transactionBlocks=null,this.transTypes=[{id:"1",name:"Target Confirmation Blocks"},{id:"2",name:"Fee"}],this.selTransType="1",this.fiatConversion=!1,this.amountUnits=l.uA,this.selAmountUnit=l.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=l.Xz,this.sendFundError="",this.flgValidated=!1,this.flgEditable=!0,this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds",this.confirmFormLabel="Confirm sweep",this.amountError="Amount is Required.",this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x]}ngOnInit(){this.sweepAll=this.data.sweepAll,this.passwordFormGroup=this.formBuilder.group({hiddenPassword:["",[c.kI.required]],password:["",[c.kI.required]]}),this.sendFundFormGroup=this.formBuilder.group({transactionAddress:["",c.kI.required],transactionBlocks:[null],transactionFees:[null],selTransType:["1",c.kI.required]}),this.confirmFormGroup=this.formBuilder.group({}),this.sendFundFormGroup.controls.selTransType.valueChanges.pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{"1"===t?(this.sendFundFormGroup.controls.transactionBlocks.setValidators([c.kI.required]),this.sendFundFormGroup.controls.transactionBlocks.setValue(null),this.sendFundFormGroup.controls.transactionFees.setValidators(null),this.sendFundFormGroup.controls.transactionFees.setValue(null)):(this.sendFundFormGroup.controls.transactionBlocks.setValidators(null),this.sendFundFormGroup.controls.transactionBlocks.setValue(null),this.sendFundFormGroup.controls.transactionFees.setValidators([c.kI.required]),this.sendFundFormGroup.controls.transactionFees.setValue(null))}),this.store.select(Ve.Yj).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.appConfig=t}),this.store.select(Ve.dT).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.fiatConversion=t.settings.fiatConversion,this.amountUnits=t.settings.currencyUnits,this.logger.info(t)}),this.actions.pipe((0,d.R)(this.unSubs[3]),(0,Q.h)(t=>t.type===l.uR.UPDATE_API_CALL_STATUS_LND||t.type===l.uR.SET_CHANNEL_TRANSACTION_RES_LND)).subscribe(t=>{t.type===l.uR.SET_CHANNEL_TRANSACTION_RES_LND&&(this.store.dispatch((0,v.jW)({payload:this.sweepAll?"All Funds Sent Successfully!":"Fund Sent Successfully!"})),this.dialogRef.close()),t.type===l.uR.UPDATE_API_CALL_STATUS_LND&&t.payload.status===l.Bn.ERROR&&"SetChannelTransaction"===t.payload.action&&(this.sendFundError=t.payload.message)})}onAuthenticate(){if(!this.passwordFormGroup.controls.password.value)return!0;this.flgValidated=!1,this.store.dispatch((0,v.QO)({payload:od(this.passwordFormGroup.controls.password.value).toString()})),this.rtlEffects.isAuthorizedRes.pipe((0,G.q)(1)).subscribe(t=>{"ERROR"!==t?(this.passwordFormGroup.controls.hiddenPassword.setValue(this.passwordFormGroup.controls.password.value),this.stepper.next()):(this.dialogRef.close(),this.snackBar.open("Unauthorized User. Logging out from RTL."))})}onSendFunds(){if(this.invalidValues)return!0;this.sendFundError="";const t={amount:this.transactionAmount?this.transactionAmount:0,sendAll:this.sweepAll};this.sweepAll?(t.address=this.sendFundFormGroup.controls.transactionAddress.value,"1"===this.sendFundFormGroup.controls.selTransType.value&&(t.blocks=this.sendFundFormGroup.controls.transactionBlocks.value),"2"===this.sendFundFormGroup.controls.selTransType.value&&(t.fees=this.sendFundFormGroup.controls.transactionFees.value)):(t.address=this.transactionAddress,"1"===this.selTransType&&(t.blocks=this.transactionBlocks),"2"===this.selTransType&&(t.fees=this.transactionFees)),this.transactionAmount&&this.selAmountUnit!==l.NT.SATS?this.commonService.convertCurrency(this.transactionAmount,this.selAmountUnit===this.amountUnits[2]?l.NT.OTHER:this.selAmountUnit,l.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,d.R)(this.unSubs[4])).subscribe({next:a=>{this.selAmountUnit=l.NT.SATS,t.amount=+this.decimalPipe.transform(a[this.amountUnits[0]],this.currencyUnitFormats[this.amountUnits[0]]).replace(/,/g,""),this.store.dispatch((0,b.Wi)({payload:t}))},error:a=>{this.transactionAmount=null,this.selAmountUnit=l.NT.SATS,this.amountError="Conversion Error: "+a}}):this.store.dispatch((0,b.Wi)({payload:t}))}get invalidValues(){return this.sweepAll?!this.sendFundFormGroup.controls.transactionAddress.value||""===this.sendFundFormGroup.controls.transactionAddress.value||"1"===this.sendFundFormGroup.controls.selTransType.value&&(!this.sendFundFormGroup.controls.transactionBlocks.value||this.sendFundFormGroup.controls.transactionBlocks.value<=0)||"2"===this.sendFundFormGroup.controls.selTransType.value&&(!this.sendFundFormGroup.controls.transactionFees.value||this.sendFundFormGroup.controls.transactionFees.value<=0):!this.transactionAddress||""===this.transactionAddress||!this.transactionAmount||this.transactionAmount<=0||"1"===this.selTransType&&(!this.transactionBlocks||this.transactionBlocks<=0)||"2"===this.selTransType&&(!this.transactionFees||this.transactionFees<=0)}resetData(){this.sendFundError="",this.selTransType="1",this.transactionAddress="",this.transactionBlocks=null,this.transactionFees=null,this.sweepAll||(this.transactionAmount=null)}stepSelectionChanged(t){switch(this.sendFundError="",t.selectedIndex){case 0:default:this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds";break;case 1:this.passwordFormLabel="User authenticated successfully",this.sendFundFormLabel="Sweep funds";break;case 2:this.passwordFormLabel="User authenticated successfully",this.sendFundFormLabel="Sweep funds | Address: "+this.sendFundFormGroup.controls.transactionAddress.value+" | "+this.transTypes[this.sendFundFormGroup.controls.selTransType.value-1].name+("2"===this.sendFundFormGroup.controls.selTransType.value?" (Sats/vByte)":"")+": "+("1"===this.sendFundFormGroup.controls.selTransType.value?this.sendFundFormGroup.controls.transactionBlocks.value:this.sendFundFormGroup.controls.transactionFees.value)}t.selectedIndex<t.previouslySelectedIndex&&0===t.selectedIndex&&this.passwordFormGroup.controls.hiddenPassword.setValue("")}onAmountUnitChange(t){const a=this,o=this.sweepAll?l.NT.SATS:this.selAmountUnit===this.amountUnits[2]?l.NT.OTHER:this.selAmountUnit;let s=t.value===this.amountUnits[2]?l.NT.OTHER:t.value;this.transactionAmount&&this.selAmountUnit!==t.value&&this.commonService.convertCurrency(this.transactionAmount?this.transactionAmount:0,o,s,this.amountUnits[2],this.fiatConversion).pipe((0,d.R)(this.unSubs[5])).subscribe({next:g=>{this.selAmountUnit=t.value,a.transactionAmount=+a.decimalPipe.transform(g[s],a.currencyUnitFormats[s]).replace(/,/g,"")},error:g=>{a.transactionAmount=null,this.amountError="Conversion Error: "+g,this.selAmountUnit=o,s=o}})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(J.so),e.Y36(J.WI),e.Y36(F.mQ),e.Y36(w.yh),e.Y36(ie.V),e.Y36(P.v),e.Y36(m.JJ),e.Y36(te.ux),e.Y36(z.eX),e.Y36(c.qu))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-on-chain-send-modal"]],viewQuery:function(t,a){if(1&t&&(e.Gf(sd,7),e.Gf(ld,5),e.Gf(rd,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.form=o.first),e.iGM(o=e.CRH())&&(a.formSweepAll=o.first),e.iGM(o=e.CRH())&&(a.stepper=o.first)}},decls:12,vars:4,consts:[["fxLayout","row"],["fxFlex","100"],["fxLayout","row","fxLayoutAlign","space-between center",1,"modal-info-header"],["fxFlex","95","fxLayoutAlign","start start"],[1,"page-title"],["tabindex","8","fxFlex","5","fxLayoutAlign","center","default","","mat-button","",1,"btn-close-x","p-0",3,"mat-dialog-close"],[1,"padding-gap-x-large"],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100","class","overflow-x-hidden",3,"submit","reset",4,"ngIf","ngIfElse"],["sweepAllBlock",""],["fxLayout","row wrap","fxLayoutAlign","space-between start","fxFlex","100",1,"overflow-x-hidden",3,"submit","reset"],["form","ngForm"],["fxFlex.gt-sm","55"],["autoFocus","","matInput","","placeholder","Bitcoin Address","tabindex","1","name","address","required","",3,"ngModel","ngModelChange"],["address","ngModel"],[4,"ngIf"],["fxFlex.gt-sm","30"],["matInput","","placeholder","Amount","name","amt","type","number","tabindex","2","required","",3,"ngModel","step","min","ngModelChange"],["amnt","ngModel"],["matSuffix",""],["fxFlex.gt-sm","10","fxLayoutAlign","start end"],["tabindex","3","required","","name","amountUnit",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxFlex.gt-sm","60","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start"],["fxFlex","48"],["tabindex","4",3,"value","valueChange"],["fxFlex","48",4,"ngIf"],["fxLayout","column","fxFlex","100","fxFlex.gt-sm","40","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start"],["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"],["mat-button","","color","primary","type","submit","tabindex","8"],[3,"value"],["matInput","","placeholder","Number of Blocks","type","number","name","blcks","required","","tabindex","5",3,"ngModel","step","min","ngModelChange"],["blocks","ngModel"],["matInput","","placeholder","Fees (Sats/vByte)","type","number","name","chainFees","required","","tabindex","6",3,"ngModel","step","min","ngModelChange"],["fees","ngModel"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"],["fxLayout","column"],[3,"linear","selectionChange"],["stepper",""],[3,"stepControl","editable",4,"ngIf"],[3,"stepControl","editable"],["fxLayout","column",1,"my-1","pr-1",3,"formGroup"],["matStepLabel","","disabled","true"],["fxLayout","column","fxFlex","98","fxLayout.gt-sm","row wrap","fxLayoutAlign","start stretch","fxLayoutAlign.gt-sm","space-between start"],["fxFlex.gt-sm","45"],["matInput","","formControlName","transactionAddress","placeholder","Bitcoin Address","tabindex","4","name","address","required",""],["fxFlex.gt-sm","25"],["formControlName","selTransType","tabindex","5"],["fxFlex.gt-sm","25","fxLayoutAlign","start end",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"mt-2"],["mat-button","","color","primary","tabindex","8","type","button","matStepperNext",""],[3,"stepControl"],["fxLayout","column","fxLayoutAlign","start",1,"my-1","pr-1",3,"formGroup"],["matStepLabel",""],["fxFlex","100",1,"w-100","alert","alert-warn"],[1,"mt-1","mr-1","alert-icon",3,"icon"],["mat-button","","color","primary","tabindex","9","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-button","","color","primary","tabindex","12","type","button","default","",3,"mat-dialog-close"],["fxLayout","column","fxLayoutAlign","space-between",1,"my-1","pr-1",3,"formGroup"],["autoFocus","","matInput","","placeholder","Password","type","password","tabindex","1","formControlName","password","required",""],["fxLayout","row",1,"mt-2"],["mat-button","","color","primary","tabindex","3","type","button",3,"click"],["fxFlex.gt-sm","25","fxLayoutAlign","start end"],["matInput","","formControlName","transactionBlocks","placeholder","Number of Blocks","type","number","name","blcks","required","","tabindex","6",3,"step","min"],["matInput","","formControlName","transactionFees","placeholder","Fees (Sats/vByte)","type","number","name","chainFees","required","","tabindex","7",3,"step","min"]],template:function(t,a){if(1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"mat-card-header",2),e.TgZ(3,"div",3),e.TgZ(4,"span",4),e._uU(5),e.qZA(),e.qZA(),e.TgZ(6,"button",5),e._uU(7,"X"),e.qZA(),e.qZA(),e.TgZ(8,"mat-card-content",6),e.YNc(9,xd,28,14,"form",7),e.qZA(),e.qZA(),e.qZA(),e.YNc(10,Od,34,15,"ng-template",null,8,e.W1O)),2&t){const o=e.MAs(11);e.xp6(5),e.Oqu(a.sweepAll?"Sweep All Funds":"Send Funds"),e.xp6(1),e.Q6J("mat-dialog-close",!1),e.xp6(3),e.Q6J("ngIf",!a.sweepAll)("ngIfElse",o)}},directives:[_.xw,_.yH,A.dk,_.Wh,L.lW,J.ZT,A.dn,m.O5,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,V.h,c.Q7,c.JJ,c.On,c.wV,c.qQ,$.q,f.R9,O.gD,m.sg,f.TO,E.ey,I.BN,B.Vq,B.C0,c.sg,B.VY,c.u,B.Ic],styles:[""]}),n})(),We=(()=>{class n{constructor(t,a){this.store=t,this.activatedRoute=a,this.sweepAll=!1,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.activatedRoute.data.pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.sweepAll=t.sweepAll})}openSendFundsModal(){this.store.dispatch((0,v.qR)({payload:{data:{sweepAll:this.sweepAll,component:Ud}}}))}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(w.yh),e.Y36(T.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-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(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"button",2),e.NdJ("click",function(){return a.openSendFundsModal()}),e._uU(3),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(3),e.Oqu(a.sweepAll?"Sweep All":"Send Funds"))},directives:[_.xw,_.yH,_.Wh,L.lW],styles:[""]}),n})();function Rd(n,i){1&n&&e._UZ(0,"mat-progress-bar",26)}function Id(n,i){if(1&n&&e._UZ(0,"rtl-node-info",27),2&n){const t=e.oxw(3);e.Q6J("information",t.information)("showColorFieldSeparately",!0)}}function Dd(n,i){if(1&n&&e._UZ(0,"rtl-channel-status-info",28),2&n){const t=e.oxw(3);e.Q6J("channelsStatus",t.channelsStatus)("errorMessage",t.errorMessages[3]+" "+t.errorMessages[4])}}function Pd(n,i){if(1&n&&e._UZ(0,"rtl-fee-info",29),2&n){const t=e.oxw(3);e.Q6J("fees",t.fees)("errorMessage",t.errorMessages[2])}}const Xe=function(n){return{"dashboard-card-content":!0,"error-border":n}};function Md(n,i){if(1&n&&(e.TgZ(0,"mat-grid-tile",13),e.TgZ(1,"div",14),e.TgZ(2,"div",15),e.TgZ(3,"div",16),e._UZ(4,"fa-icon",17),e.TgZ(5,"span"),e._uU(6),e.qZA(),e.qZA(),e.qZA(),e.TgZ(7,"div",18),e.TgZ(8,"mat-card",19),e.TgZ(9,"mat-card-content",20),e.YNc(10,Rd,1,0,"mat-progress-bar",21),e.TgZ(11,"div",22),e.YNc(12,Id,1,2,"rtl-node-info",23),e.YNc(13,Dd,1,2,"rtl-channel-status-info",24),e.YNc(14,Pd,1,2,"rtl-fee-info",25),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(2);e.Q6J("colspan",t.cols)("rowspan",t.rows),e.xp6(4),e.Q6J("icon",t.icon),e.xp6(2),e.Oqu(t.title),e.xp6(3),e.Q6J("ngClass",e.VKq(10,Xe,"node"===t.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.ERROR||"status"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.ERROR||a.apiCallStatusPendingChannels.status===a.apiCallStatusEnum.ERROR)||"fee"===t.id&&a.apiCallStatusFees.status===a.apiCallStatusEnum.ERROR)),e.xp6(1),e.Q6J("ngIf","node"===t.id&&a.apiCallStatusNodeInfo.status===a.apiCallStatusEnum.INITIATED||"status"===t.id&&(a.apiCallStatusChannels.status===a.apiCallStatusEnum.INITIATED||a.apiCallStatusPendingChannels.status===a.apiCallStatusEnum.INITIATED)||"fee"===t.id&&a.apiCallStatusFees.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngSwitch",t.id),e.xp6(1),e.Q6J("ngSwitchCase","node"),e.xp6(1),e.Q6J("ngSwitchCase","status"),e.xp6(1),e.Q6J("ngSwitchCase","fee")}}function Jd(n,i){if(1&n&&(e.TgZ(0,"mat-grid-list",11),e.YNc(1,Md,15,12,"mat-grid-tile",12),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngForOf",t.nodeCards)}}function Qd(n,i){1&n&&e._UZ(0,"mat-progress-bar",26)}function Ed(n,i){1&n&&e.GkF(0)}function Yd(n,i){if(1&n&&(e.TgZ(0,"div",33),e.YNc(1,Ed,1,0,"ng-container",34),e.qZA()),2&n){const t=e.oxw(2),a=e.MAs(9),o=e.MAs(11);e.xp6(1),e.Q6J("ngTemplateOutlet",t.apiCallStatusNetwork.status===t.apiCallStatusEnum.ERROR?a:o)}}function Bd(n,i){1&n&&e.GkF(0)}function Hd(n,i){if(1&n&&(e.TgZ(0,"div",33),e.YNc(1,Bd,1,0,"ng-container",34),e.qZA()),2&n){const t=e.oxw(2),a=e.MAs(9),o=e.MAs(13);e.xp6(1),e.Q6J("ngTemplateOutlet",t.apiCallStatusNetwork.status===t.apiCallStatusEnum.ERROR?a:o)}}function Gd(n,i){1&n&&e.GkF(0)}function zd(n,i){if(1&n&&(e.TgZ(0,"div",33),e.YNc(1,Gd,1,0,"ng-container",34),e.qZA()),2&n){const t=e.oxw(2),a=e.MAs(9),o=e.MAs(15);e.xp6(1),e.Q6J("ngTemplateOutlet",t.apiCallStatusNetwork.status===t.apiCallStatusEnum.ERROR?a:o)}}function Vd(n,i){if(1&n&&(e.TgZ(0,"mat-grid-tile",30),e.TgZ(1,"mat-card",31),e.TgZ(2,"mat-card-content",20),e.YNc(3,Qd,1,0,"mat-progress-bar",21),e.TgZ(4,"div",22),e.YNc(5,Yd,2,1,"div",32),e.YNc(6,Hd,2,1,"div",32),e.YNc(7,zd,2,1,"div",32),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("colspan",t.cols)("rowspan",t.rows),e.xp6(2),e.Q6J("ngClass",e.VKq(8,Xe,a.apiCallStatusNetwork.status===a.apiCallStatusEnum.ERROR)),e.xp6(1),e.Q6J("ngIf",a.apiCallStatusNetwork.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngSwitch",t.id),e.xp6(1),e.Q6J("ngSwitchCase","general"),e.xp6(1),e.Q6J("ngSwitchCase","channels"),e.xp6(1),e.Q6J("ngSwitchCase","degrees")}}function Wd(n,i){if(1&n&&(e.TgZ(0,"div",35),e.TgZ(1,"p"),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.errorMessages[1])}}function Xd(n,i){if(1&n&&(e.TgZ(0,"div",36),e.TgZ(1,"div"),e.TgZ(2,"h4",37),e._uU(3,"Network Capacity"),e.qZA(),e.TgZ(4,"div",38),e._uU(5),e.ALo(6,"number"),e.qZA(),e.qZA(),e.TgZ(7,"div"),e.TgZ(8,"h4",37),e._uU(9,"Number of Nodes"),e.qZA(),e.TgZ(10,"div",38),e._uU(11),e.ALo(12,"number"),e.qZA(),e.qZA(),e.TgZ(13,"div"),e.TgZ(14,"h4",37),e._uU(15,"Number of Channels"),e.qZA(),e.TgZ(16,"span",38),e._uU(17),e.ALo(18,"number"),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(5),e.hij("",e.lcZ(6,3,t.networkInfo.total_network_capacity)," Sats"),e.xp6(6),e.Oqu(e.lcZ(12,5,t.networkInfo.num_nodes)),e.xp6(6),e.Oqu(e.lcZ(18,7,t.networkInfo.num_channels))}}function $d(n,i){if(1&n&&(e.TgZ(0,"div",36),e.TgZ(1,"div"),e.TgZ(2,"h4",37),e._uU(3,"Max Channel Size"),e.qZA(),e.TgZ(4,"div",38),e._uU(5),e.ALo(6,"number"),e.qZA(),e.qZA(),e.TgZ(7,"div"),e.TgZ(8,"h4",37),e._uU(9,"Avg Channel Size"),e.qZA(),e.TgZ(10,"div",38),e._uU(11),e.ALo(12,"number"),e.qZA(),e.qZA(),e.TgZ(13,"div"),e.TgZ(14,"h4",37),e._uU(15,"Min Channel Size"),e.qZA(),e.TgZ(16,"span",38),e._uU(17),e.ALo(18,"number"),e.qZA(),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(5),e.Oqu(e.lcZ(6,3,t.networkInfo.max_channel_size)),e.xp6(6),e.Oqu(e.lcZ(12,5,t.networkInfo.avg_channel_size)),e.xp6(6),e.Oqu(e.lcZ(18,7,t.networkInfo.min_channel_size))}}function jd(n,i){if(1&n&&(e.TgZ(0,"div",36),e.TgZ(1,"div"),e.TgZ(2,"h4",37),e._uU(3,"Max Out Degree"),e.qZA(),e.TgZ(4,"div",38),e._uU(5),e.ALo(6,"number"),e.qZA(),e.qZA(),e.TgZ(7,"div"),e.TgZ(8,"h4",37),e._uU(9,"Avg Out Degree"),e.qZA(),e.TgZ(10,"div",38),e._uU(11),e.ALo(12,"number"),e.qZA(),e.qZA(),e.TgZ(13,"div",39),e._UZ(14,"h4",37),e._UZ(15,"span",38),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(5),e.Oqu(e.lcZ(6,2,t.networkInfo.max_out_degree)),e.xp6(6),e.Oqu(e.xi3(12,4,t.networkInfo.avg_out_degree,"1.0-2"))}}const Kd=function(n){return{"mt-1":n}};let eh=(()=>{class n{constructor(t,a,o){this.logger=t,this.commonService=a,this.store=o,this.faProjectDiagram=y.o4t,this.faBolt=y.BDt,this.faServer=y.xf3,this.faNetworkWired=y.kXW,this.selNode={},this.information={},this.channelsStatus={},this.networkInfo={},this.networkCards=[],this.nodeCards=[],this.screenSize="",this.screenSizeEnum=l.cu,this.userPersonaEnum=l.ol,this.errorMessages=["","","","",""],this.apiCallStatusNodeInfo=null,this.apiCallStatusNetwork=null,this.apiCallStatusFees=null,this.apiCallStatusChannels=null,this.apiCallStatusPendingChannels=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS?(this.networkCards=[{id:"general",cols:3,rows:1},{id:"channels",cols:3,rows:1},{id:"degrees",cols:3,rows:1}],this.nodeCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1}]):(this.networkCards=[{id:"general",cols:1,rows:1},{id:"channels",cols:1,rows:1},{id:"degrees",cols:1,rows:1}],this.nodeCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:1,rows:1},{id:"status",icon:this.faNetworkWired,title:"Channels",cols:1,rows:1},{id:"fee",icon:this.faBolt,title:"Routing Fee",cols:1,rows:1}])}ngOnInit(){this.store.select(C.bx).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.errorMessages[0]="",this.apiCallStatusNodeInfo=t.apiCallStatus,this.apiCallStatusNodeInfo.status===l.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apiCallStatusNodeInfo.message?JSON.stringify(this.apiCallStatusNodeInfo.message):this.apiCallStatusNodeInfo.message),this.selNode=t.nodeSettings,this.information=t.information}),this.store.select(C.N7).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.errorMessages[1]="",this.apiCallStatusNetwork=t.apiCallStatus,this.apiCallStatusNetwork.status===l.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apiCallStatusNetwork.message?JSON.stringify(this.apiCallStatusNetwork.message):this.apiCallStatusNetwork.message),this.networkInfo=t.networkInfo}),this.store.select(C.JG).pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{this.errorMessages[2]="",this.apiCallStatusFees=t.apiCallStatus,this.apiCallStatusFees.status===l.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apiCallStatusFees.message?JSON.stringify(this.apiCallStatusFees.message):this.apiCallStatusFees.message),this.fees=t.fees}),this.store.select(C.ni).pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{this.errorMessages[4]="",this.apiCallStatusPendingChannels=t.apiCallStatus,this.apiCallStatusPendingChannels.status===l.Bn.ERROR&&(this.errorMessages[4]="object"==typeof this.apiCallStatusPendingChannels.message?JSON.stringify(this.apiCallStatusPendingChannels.message):this.apiCallStatusPendingChannels.message),this.channelsStatus.pending={num_channels:t.pendingChannelsSummary.open.num_channels,capacity:t.pendingChannelsSummary.open.limbo_balance},this.channelsStatus.closing={num_channels:t.pendingChannelsSummary.closing.num_channels+t.pendingChannelsSummary.force_closing.num_channels+t.pendingChannelsSummary.waiting_close.num_channels,capacity:t.pendingChannelsSummary.total_limbo_balance}}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[4])).subscribe(t=>{this.errorMessages[3]="",this.apiCallStatusChannels=t.apiCallStatus,this.apiCallStatusChannels.status===l.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apiCallStatusChannels.message?JSON.stringify(this.apiCallStatusChannels.message):this.apiCallStatusChannels.message),this.channelsStatus.active=t.channelsSummary.active,this.channelsStatus.inactive=t.channelsSummary.inactive,this.logger.info(t)})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-network-info"]],decls:16,vars:6,consts:[["fxLayout","column","fxLayoutAlign","space-between stretch",1,"mb-4"],["cols","3","rowHeight","330px",4,"ngIf"],["fxLayout","row","fxLayoutAlign","start end",1,"page-title-container",3,"ngClass"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["cols","3","rowHeight","250px"],["fxLayout","row",3,"colspan","rowspan",4,"ngFor","ngForOf"],["errorBlock",""],["generalBlock",""],["channelsBlock",""],["degreesBlock",""],["cols","3","rowHeight","330px"],["class","node-grid-tile",3,"colspan","rowspan",4,"ngFor","ngForOf"],[1,"node-grid-tile",3,"colspan","rowspan"],["fxLayout","column","fxLayoutAlign","stretch start","fxFlex","100",1,"h-100"],["fxLayout","row","fxLayoutAlign","start start",1,"w-100"],["fxLayout","row","fxLayoutAlign","start start",1,"page-title-container"],[1,"mr-1",3,"icon"],["fxLayout","column","fxLayoutAlign","stretch center","fxLayout.gt-sm","row","fxLayoutAlign.gt-sm","center stretch",1,"w-100","h-93"],["fxLayout","row","fxFlex","95","fxLayoutAlign","start stretch",1,"dashboard-card","w-96","h-93"],["fxLayout","column","fxFlex","100",3,"ngClass"],["mode","indeterminate",4,"ngIf"],["fxLayout","column","fxFlex","100",3,"ngSwitch"],["fxFlex","100",3,"information","showColorFieldSeparately",4,"ngSwitchCase"],["fxFlex","100",3,"channelsStatus","errorMessage",4,"ngSwitchCase"],["fxFlex","100",3,"fees","errorMessage",4,"ngSwitchCase"],["mode","indeterminate"],["fxFlex","100",3,"information","showColorFieldSeparately"],["fxFlex","100",3,"channelsStatus","errorMessage"],["fxFlex","100",3,"fees","errorMessage"],["fxLayout","row",3,"colspan","rowspan"],["fxLayout","row","fxFlex","95","fxLayoutAlign","start stretch",1,"dashboard-card","h-93"],["fxFlex","100",4,"ngSwitchCase"],["fxFlex","100"],[4,"ngTemplateOutlet"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["fxFlex","20"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,Jd,2,1,"mat-grid-list",1),e.TgZ(2,"div",2),e._UZ(3,"fa-icon",3),e.TgZ(4,"span",4),e._uU(5,"Network"),e.qZA(),e.qZA(),e.TgZ(6,"mat-grid-list",5),e.YNc(7,Vd,8,10,"mat-grid-tile",6),e.qZA(),e.qZA(),e.YNc(8,Wd,3,1,"ng-template",null,7,e.W1O),e.YNc(10,Xd,19,9,"ng-template",null,8,e.W1O),e.YNc(12,$d,19,9,"ng-template",null,9,e.W1O),e.YNc(14,jd,16,7,"ng-template",null,10,e.W1O)),2&t&&(e.xp6(1),e.Q6J("ngIf",a.selNode.userPersona!==a.userPersonaEnum.OPERATOR),e.xp6(1),e.Q6J("ngClass",e.VKq(4,Kd,a.screenSize!==a.screenSizeEnum.XS)),e.xp6(1),e.Q6J("icon",a.faProjectDiagram),e.xp6(4),e.Q6J("ngForOf",a.networkCards))},directives:[_.xw,_.Wh,m.O5,m.mk,S.oO,I.BN,le.Il,m.sg,le.DX,_.yH,A.a8,A.dn,m.RF,m.n9,M.pW,qe,Le,Se,m.tP],pipes:[m.JJ],styles:[""]}),n})();function th(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",8),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().activeLink=s.link}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw();e.s9C("routerLink",t.link),e.Q6J("active",a.activeLink===t.link),e.xp6(1),e.Oqu(t.name)}}let nh=(()=>{class n{constructor(t){this.router=t,this.faDownload=y.q7m,this.links=[{link:"bckup",name:"Backup"},{link:"restore",name:"Restore"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x]}ngOnInit(){const t=this.links.find(a=>this.router.url.includes(a.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(a=>a instanceof T.Av)).subscribe(a=>{const o=this.links.find(s=>a.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-backup"]],decls:11,vars:2,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",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"Channels Backup"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e.TgZ(7,"nav",5),e.YNc(8,th,2,3,"div",6),e.qZA(),e.TgZ(9,"div",7),e._UZ(10,"router-outlet"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faDownload),e.xp6(7),e.Q6J("ngForOf",a.links))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,D.BU,m.sg,_.yH,T.lC,D.Nj,T.rH],styles:[""]}),n})();function ah(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",23),e.TgZ(1,"h4",24),e._uU(2),e.qZA(),e.TgZ(3,"div",25),e.TgZ(4,"button",26),e.NdJ("click",function(){return e.CHM(t),e.oxw().onRestoreChannels({})}),e._uU(5,"Restore All"),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw();e.xp6(2),e.hij("Restore folder location: ",t.selNode.channelBackupPath,"/restore")}}function ih(n,i){if(1&n&&(e.TgZ(0,"div",27),e.TgZ(1,"h4",24),e._uU(2),e.qZA(),e.TgZ(3,"h4",28),e._uU(4,"All channel backup file not found! To perform channel restoration, channel backup file/s must be placed at the above location."),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.hij("Restore folder location: ",t.selNode.channelBackupPath,"/restore")}}function oh(n,i){if(1&n&&(e.TgZ(0,"div",27),e.TgZ(1,"h4",24),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw();e.xp6(2),e.hij("Restore folder location: ",t.selNode.channelBackupPath,"/restore")}}function sh(n,i){1&n&&e._UZ(0,"mat-progress-bar",29)}function lh(n,i){1&n&&(e.TgZ(0,"th",30),e._uU(1," Channel Point "),e.qZA())}const rh=function(n){return{"max-width":n}};function ch(n,i){if(1&n&&(e.TgZ(0,"td",31),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,rh,a.screenSize===a.screenSizeEnum.XS?"10rem":"45rem")),e.xp6(1),e.Oqu(null==t?null:t.channel_point)}}function uh(n,i){1&n&&(e.TgZ(0,"th",32),e.TgZ(1,"span",33),e._uU(2,"Actions"),e.qZA(),e.qZA())}function ph(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",34),e.TgZ(1,"span",33),e.TgZ(2,"button",35),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onRestoreChannels(s)}),e._uU(3,"Restore"),e.qZA(),e.qZA(),e.qZA()}}function mh(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No singular channel backups available."),e.qZA())}function _h(n,i){if(1&n&&(e.TgZ(0,"td",36),e.YNc(1,mh,2,0,"p",37),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.channels||!t.channels.data||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)}}const dh=function(n){return{"display-none":n}};function hh(n,i){if(1&n&&e._UZ(0,"tr",38),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,dh,t.channels&&t.channels.data&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function gh(n,i){1&n&&e._UZ(0,"tr",39)}function fh(n,i){1&n&&e._UZ(0,"tr",40)}const Ch=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},xh=function(){return["no_channel"]};let Th=(()=>{class n{constructor(t,a,o,s){this.logger=t,this.store=a,this.lndEffects=o,this.commonService=s,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.selNode={},this.displayedColumns=["channel_point","actions"],this.channelsData=[],this.allRestoreExists=!1,this.flgLoading=[!0],this.flgSticky=!1,this.selFilter="",this.screenSize="",this.screenSizeEnum=l.cu,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch((0,b.tb)()),this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t}),this.lndEffects.setRestoreChannelList.pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.allRestoreExists=t.all_restore_exists,this.channelsData=t.files,this.channelsData.length>0&&this.loadRestoreTable(this.channelsData),("error"!==this.flgLoading[0]||t&&t.files)&&(this.flgLoading[0]=!1),this.logger.info(t)})}ngAfterViewInit(){this.channelsData&&this.channelsData.length>0&&this.loadRestoreTable(this.channelsData)}onRestoreChannels(t){this.store.dispatch((0,b.vV)({payload:{channelPoint:t.channel_point?t.channel_point:"ALL"}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}loadRestoreTable(t){this.channels=new r.by([...t]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.channels.filterPredicate=(a,o)=>JSON.stringify(a).toLowerCase().includes(o),this.channels.paginator=this.paginator,this.applyFilter()}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(ee.l),e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-restore-table"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Channels")}])],decls:24,vars:17,consts:[["fxLayout","column",1,"mt-2"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxLayout","column","fxLayoutAlign","space-between start","fxLayout.gt-md","row wrap",4,"ngIf"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container","mt-2"],["fxFlex","70"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","row","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","channel_point"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","no_channel"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxFlex","100"],["fxLayout","row",1,"mt-2"],["mat-flat-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxLayoutAlign","space-between start","fxLayout.gt-md","row wrap"],["fxFlex","100",1,"mt-1"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","",1,"pr-3"],["fxLayoutAlign","end center"],["mat-cell",""],["mat-stroked-button","","color","primary","type","button","tabindex","1",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,ah,6,1,"div",1),e.YNc(2,ih,5,1,"div",2),e.YNc(3,oh,3,1,"div",2),e.TgZ(4,"div",3),e._UZ(5,"div",4),e.TgZ(6,"mat-form-field",5),e.TgZ(7,"input",6),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(8,"div",7),e.YNc(9,sh,1,0,"mat-progress-bar",8),e.TgZ(10,"table",9,10),e.ynx(12,11),e.YNc(13,lh,2,0,"th",12),e.YNc(14,ch,2,4,"td",13),e.BQk(),e.ynx(15,14),e.YNc(16,uh,3,0,"th",15),e.YNc(17,ph,4,0,"td",16),e.BQk(),e.ynx(18,17),e.YNc(19,_h,2,1,"td",18),e.BQk(),e.YNc(20,hh,1,3,"tr",19),e.YNc(21,gh,1,0,"tr",20),e.YNc(22,fh,1,0,"tr",21),e.qZA(),e.qZA(),e._UZ(23,"mat-paginator",22),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf",a.allRestoreExists),e.xp6(1),e.Q6J("ngIf",!a.allRestoreExists&&(!a.channels||(null==a.channels||null==a.channels.data?null:a.channels.data.length)<=0)),e.xp6(1),e.Q6J("ngIf",!a.allRestoreExists&&a.channels&&(null==a.channels||null==a.channels.data?null:a.channels.data.length)&&(null==a.channels||null==a.channels.data?null:a.channels.data.length)>0),e.xp6(4),e.Q6J("ngModel",a.selFilter),e.xp6(2),e.Q6J("ngIf",!0===a.flgLoading[0]),e.xp6(1),e.Q6J("dataSource",a.channels)("ngClass",e.VKq(14,Ch,"error"===a.flgLoading[0])),e.xp6(10),e.Q6J("matFooterRowDef",e.DdM(16,xh)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,m.O5,_.Wh,_.yH,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,L.lW,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,r.yh,r.Q2,r.XQ,r.Gk],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();function yh(n,i){1&n&&e._UZ(0,"mat-progress-bar",31)}function Zh(n,i){1&n&&(e.TgZ(0,"th",32),e._uU(1," Channel Point "),e.qZA())}const bh=function(n){return{"max-width":n}};function Ah(n,i){if(1&n&&(e.TgZ(0,"td",33),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw();e.Q6J("ngStyle",e.VKq(2,bh,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.Oqu(null==t?null:t.channel_point)}}function vh(n,i){1&n&&(e.TgZ(0,"th",34),e.TgZ(1,"span",35),e._uU(2,"Actions"),e.qZA(),e.qZA())}function wh(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",36),e.TgZ(1,"div",37),e.TgZ(2,"mat-select",38),e._UZ(3,"mat-select-trigger"),e.TgZ(4,"mat-option",39),e.NdJ("click",function(o){const u=e.CHM(t).$implicit;return e.oxw().onChannelClick(u,o)}),e._uU(5,"View Info"),e.qZA(),e.TgZ(6,"mat-option",39),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onBackupChannels(s)}),e._uU(7,"Backup"),e.qZA(),e.TgZ(8,"mat-option",39),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onDownloadBackup(s)}),e._uU(9,"Download Backup"),e.qZA(),e.TgZ(10,"mat-option",39),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().onVerifyChannels(s)}),e._uU(11,"Verify"),e.qZA(),e.qZA(),e.qZA(),e.qZA()}}function qh(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"No channel available."),e.qZA())}function Sh(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting channels..."),e.qZA())}function Lh(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Oqu(t.errorMessage)}}function kh(n,i){if(1&n&&(e.TgZ(0,"td",40),e.YNc(1,qh,2,0,"p",41),e.YNc(2,Sh,2,0,"p",41),e.YNc(3,Lh,2,1,"p",41),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.channels&&t.channels.data)||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const Fh=function(n){return{"display-none":n}};function Nh(n,i){if(1&n&&e._UZ(0,"tr",42),2&n){const t=e.oxw();e.Q6J("ngClass",e.VKq(1,Fh,(null==t.channels?null:t.channels.data)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0))}}function Oh(n,i){1&n&&e._UZ(0,"tr",43)}function Uh(n,i){1&n&&e._UZ(0,"tr",44)}const Rh=function(n){return{"overflow-auto error-border":n,"overflow-auto":!0}},Ih=function(){return["no_channel"]};let Dh=(()=>{class n{constructor(t,a,o,s){this.logger=t,this.store=a,this.actions=o,this.commonService=s,this.faInfoCircle=y.sqG,this.faExclamationTriangle=y.eHv,this.faArchive=y.N2j,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.selNode={},this.displayedColumns=["channel_point","actions"],this.channelsData=[],this.flgSticky=!1,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.selFilter="",this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select(C.$k).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.selNode=t}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.channelsData=t.channels,this.channelsData.length>0&&this.loadBackupTable(this.channelsData),this.logger.info(t)}),this.actions.pipe((0,d.R)(this.unSubs[2]),(0,Q.h)(t=>t.type===l.uR.SET_CHANNELS_LND||t.type===l.pg.SHOW_FILE)).subscribe(t=>{t.type===l.uR.SET_CHANNELS_LND&&(this.selectedChannel=null),t.type===l.pg.SHOW_FILE&&(this.commonService.downloadFile(t.payload,"channel-"+(this.selectedChannel.channel_point?this.selectedChannel.channel_point:"all"),".bak",".bak"),this.selectedChannel=null)})}ngAfterViewInit(){this.channelsData.length>0&&this.loadBackupTable(this.channelsData)}onBackupChannels(t){this.store.dispatch((0,b.Vv)({payload:{uiMessage:l.m6.BACKUP_CHANNEL,channelPoint:t.channel_point?t.channel_point:"ALL",showMessage:""}}))}onVerifyChannels(t){this.store.dispatch((0,b.Cp)({payload:{channelPoint:t.channel_point?t.channel_point:"ALL"}}))}onDownloadBackup(t){this.selectedChannel=t,this.store.dispatch((0,v.dc)({payload:{channelPoint:t.channel_point?t.channel_point:"all"}}))}onChannelClick(t,a){this.store.dispatch((0,v.qR)({payload:{data:{channel:t,showCopy:!1,component:fe}}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}loadBackupTable(t){this.channels=new r.by(t?[...t]:[]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(a,o)=>a[o]&&isNaN(a[o])?a[o].toLocaleLowerCase():a[o]?+a[o]:null,this.channels.paginator=this.paginator,this.channels.filterPredicate=(a,o)=>((a.active?"active":"inactive")+(a.channel_point?a.channel_point.toLowerCase():"")+(a.chan_id?a.chan_id.toLowerCase():"")+(a.remote_pubkey?a.remote_pubkey.toLowerCase():"")+(a.remote_alias?a.remote_alias.toLowerCase():"")+(a.capacity?a.capacity:"")+(a.local_balance?a.local_balance:"")+(a.remote_balance?a.remote_balance:"")+(a.total_satoshis_sent?a.total_satoshis_sent:"")+(a.total_satoshis_received?a.total_satoshis_received:"")+(a.commit_fee?a.commit_fee:"")+(a.private?"private":"public")).includes(o),this.applyFilter()}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(w.yh),e.Y36(z.eX),e.Y36(P.v))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-channel-backup-table"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Channels")}])],decls:42,vars:18,consts:[["fxLayout","column"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["fxFlex","100",1,"alert","alert-warn"],[1,"mr-1","alert-icon",3,"icon"],["fxFlex","100",1,"alert","alert-info"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","1",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","2",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3",3,"click"],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container","mt-2"],["fxFlex","70"],[1,"page-title-img","mr-1",3,"icon"],[1,"page-title"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","channel_point"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",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","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","",1,"pr-3"],["fxLayoutAlign","end center"],["mat-cell","","fxLayoutAlign","end center"],[1,"bordered-box","table-actions-select"],["placeholder","Actions","tabindex","1",1,"mr-0"],[3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"div",1),e.TgZ(2,"div",2),e._UZ(3,"fa-icon",3),e.TgZ(4,"span"),e._uU(5,"Save your backup files in a redundant location."),e.qZA(),e.qZA(),e.TgZ(6,"div",4),e._UZ(7,"fa-icon",3),e.TgZ(8,"span"),e.TgZ(9,"strong"),e._uU(10,"Backup Folder Location: "),e.qZA(),e._uU(11),e.qZA(),e.qZA(),e.TgZ(12,"div",5),e.TgZ(13,"button",6),e.NdJ("click",function(){return a.onVerifyChannels({})}),e._uU(14,"Verify All"),e.qZA(),e.TgZ(15,"button",7),e.NdJ("click",function(){return a.onBackupChannels({})}),e._uU(16,"Backup All"),e.qZA(),e.TgZ(17,"button",8),e.NdJ("click",function(){return a.onDownloadBackup({})}),e._uU(18,"Download Backup"),e.qZA(),e.qZA(),e.qZA(),e.TgZ(19,"div",9),e.TgZ(20,"div",10),e._UZ(21,"fa-icon",11),e.TgZ(22,"span",12),e._uU(23,"Backups"),e.qZA(),e.qZA(),e.TgZ(24,"mat-form-field",13),e.TgZ(25,"input",14),e.NdJ("keyup",function(){return a.applyFilter()})("ngModelChange",function(s){return a.selFilter=s}),e.qZA(),e.qZA(),e.qZA(),e.TgZ(26,"div",15),e.YNc(27,yh,1,0,"mat-progress-bar",16),e.TgZ(28,"table",17,18),e.ynx(30,19),e.YNc(31,Zh,2,0,"th",20),e.YNc(32,Ah,2,4,"td",21),e.BQk(),e.ynx(33,22),e.YNc(34,vh,3,0,"th",23),e.YNc(35,wh,12,0,"td",24),e.BQk(),e.ynx(36,25),e.YNc(37,kh,4,3,"td",26),e.BQk(),e.YNc(38,Nh,1,3,"tr",27),e.YNc(39,Oh,1,0,"tr",28),e.YNc(40,Uh,1,0,"tr",29),e.qZA(),e.qZA(),e._UZ(41,"mat-paginator",30),e.qZA()),2&t&&(e.xp6(3),e.Q6J("icon",a.faExclamationTriangle),e.xp6(4),e.Q6J("icon",a.faInfoCircle),e.xp6(4),e.hij("",a.selNode.channelBackupPath,"."),e.xp6(10),e.Q6J("icon",a.faArchive),e.xp6(4),e.Q6J("ngModel",a.selFilter),e.xp6(2),e.Q6J("ngIf",a.apiCallStatus.status===a.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",a.channels)("ngClass",e.VKq(15,Rh,""!==a.errorMessage)),e.xp6(10),e.Q6J("matFooterRowDef",e.DdM(17,Ih)),e.xp6(1),e.Q6J("matHeaderRowDef",a.displayedColumns)("matHeaderRowDefSticky",a.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",a.displayedColumns),e.xp6(1),e.Q6J("pageSize",a.pageSize)("pageSizeOptions",a.pageSizeOptions)("showFirstLastButtons",a.screenSize!==a.screenSizeEnum.XS))},directives:[_.xw,_.Wh,_.yH,I.BN,L.lW,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,m.O5,r.BZ,Z.YE,m.mk,S.oO,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,q.NW,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,O.gD,O.$L,E.ey,r.yh,r.Q2,r.XQ,r.Gk],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 70%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();function Ph(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",8),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw().activeLink=s.link}),e._uU(1),e.qZA()}if(2&n){const t=i.$implicit,a=e.oxw();e.s9C("routerLink",t.link),e.Q6J("active",a.activeLink===t.link),e.xp6(1),e.Oqu(t.name)}}let Mh=(()=>{class n{constructor(t){this.router=t,this.faUserCheck=y.hkK,this.links=[{link:"sign",name:"Sign"},{link:"verify",name:"Verify"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x]}ngOnInit(){const t=this.links.find(a=>this.router.url.includes(a.link));this.activeLink=t?t.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,Q.h)(a=>a instanceof T.Av)).subscribe(a=>{const o=this.links.find(s=>a.urlAfterRedirects.includes(s.link));this.activeLink=o?o.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(T.F0))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-sign-verify-message"]],decls:11,vars:2,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",""],["role","tab","mat-tab-link","","class","mat-tab-label",3,"active","routerLink","click",4,"ngFor","ngForOf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"mat-tab-body-wrapper"],["role","tab","mat-tab-link","",1,"mat-tab-label",3,"active","routerLink","click"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e._UZ(1,"fa-icon",1),e.TgZ(2,"span",2),e._uU(3,"Sign/Verify Message"),e.qZA(),e.qZA(),e.TgZ(4,"div",3),e.TgZ(5,"mat-card"),e.TgZ(6,"mat-card-content",4),e.TgZ(7,"nav",5),e.YNc(8,Ph,2,3,"div",6),e.qZA(),e.TgZ(9,"div",7),e._UZ(10,"router-outlet"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(1),e.Q6J("icon",a.faUserCheck),e.xp6(7),e.Q6J("ngForOf",a.links))},directives:[_.xw,_.Wh,I.BN,A.a8,A.dn,D.BU,m.sg,_.yH,T.lC,D.Nj,T.rH],styles:[""]}),n})();function Jh(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Message is required."),e.qZA())}let Qh=(()=>{class n{constructor(t,a,o){this.dataService=t,this.snackBar=a,this.logger=o,this.message="",this.signedMessage="",this.signature="",this.unSubs=[new p.x,new p.x]}onSign(){if(!this.message||""===this.message)return!0;this.dataService.signMessage(this.message).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.signedMessage=this.message,this.signature=t.signature})}onMessageChange(){this.signedMessage!==this.message&&(this.signature="")}onCopyField(t){this.snackBar.open("Signature copied."),this.logger.info("Copied Text: "+t)}resetData(){this.message="",this.signature="",this.signedMessage=""}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K.D),e.Y36(te.ux),e.Y36(F.mQ))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-sign"]],decls:20,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["form","ngForm"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start end"],["autoFocus","","matInput","","rows","1","placeholder","Message to sign","required","","tabindex","1","name","message",3,"ngModel","ngModelChange","keyup"],[4,"ngIf"],["fxLayout","row",1,"my-1"],["mat-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","3","type","submit",3,"click"],[1,"my-2",3,"inset"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center",1,"bordered-box","read-only","h-4","padding-gap"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","4","rtlClipboard","","type","button",3,"payload","copied"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"form",1,2),e.TgZ(3,"mat-form-field",3),e.TgZ(4,"textarea",4),e.NdJ("ngModelChange",function(s){return a.message=s})("keyup",function(){return a.onMessageChange()}),e.qZA(),e.YNc(5,Jh,2,0,"mat-error",5),e.qZA(),e.TgZ(6,"div",6),e.TgZ(7,"button",7),e.NdJ("click",function(){return a.resetData()}),e._uU(8,"Clear Field"),e.qZA(),e.TgZ(9,"button",8),e.NdJ("click",function(){return a.onSign()}),e._uU(10,"Sign"),e.qZA(),e.qZA(),e._UZ(11,"mat-divider",9),e.TgZ(12,"div",10),e.TgZ(13,"p"),e._uU(14,"Generated Signature"),e.qZA(),e.qZA(),e.TgZ(15,"div",11),e._uU(16),e.qZA(),e.TgZ(17,"div",12),e.TgZ(18,"button",13),e.NdJ("copied",function(s){return a.onCopyField(s)}),e._uU(19,"Copy Signature"),e.qZA(),e.qZA(),e.qZA(),e.qZA()),2&t&&(e.xp6(4),e.Q6J("ngModel",a.message),e.xp6(1),e.Q6J("ngIf",!a.message),e.xp6(6),e.Q6J("inset",!0),e.xp6(5),e.Oqu(a.signature),e.xp6(2),e.Q6J("payload",a.signature))},directives:[_.xw,_.yH,_.Wh,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,V.h,c.Q7,c.JJ,c.On,m.O5,L.lW,X.d,oe.y,f.TO],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();function Eh(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Message is required."),e.qZA())}function Yh(n,i){1&n&&(e.TgZ(0,"mat-error"),e._uU(1,"Signature is required."),e.qZA())}function Bh(n,i){1&n&&(e.TgZ(0,"p",13),e.TgZ(1,"mat-icon",14),e._uU(2,"close"),e.qZA(),e._uU(3,"Verification failed, please double check message and signature"),e.qZA())}function Hh(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Pubkey Used"),e.qZA())}function Gh(n,i){if(1&n&&(e.TgZ(0,"div",20),e.TgZ(1,"p"),e._uU(2),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(null==t.verifyRes?null:t.verifyRes.pubkey)}}function zh(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",21),e.TgZ(1,"button",22),e.NdJ("copied",function(o){return e.CHM(t),e.oxw(2).onCopyField(o)}),e._uU(2,"Copy Pubkey"),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("payload",null==t.verifyRes?null:t.verifyRes.pubkey)}}function Vh(n,i){if(1&n&&(e.TgZ(0,"div",15),e._UZ(1,"mat-divider",16),e.TgZ(2,"div",17),e.YNc(3,Hh,2,0,"p",5),e.qZA(),e.YNc(4,Gh,3,1,"div",18),e.YNc(5,zh,3,1,"div",19),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("inset",!0),e.xp6(2),e.Q6J("ngIf",t.verifyRes.valid),e.xp6(1),e.Q6J("ngIf",t.verifyRes.valid),e.xp6(1),e.Q6J("ngIf",t.verifyRes.valid)}}let Wh=(()=>{class n{constructor(t,a,o){this.dataService=t,this.snackBar=a,this.logger=o,this.message="",this.verifiedMessage="",this.signature="",this.verifiedSignature="",this.showVerifyStatus=!1,this.verifyRes={pubkey:"",valid:null},this.unSubs=[new p.x,new p.x]}onVerify(){if(!this.message||""===this.message||!this.signature||""===this.signature)return!0;this.dataService.verifyMessage(this.message,this.signature).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.verifyRes=t,this.showVerifyStatus=!0,this.verifiedMessage=this.message,this.verifiedSignature=this.signature})}onChange(){(this.verifiedMessage!==this.message||this.verifiedSignature!==this.signature)&&(this.showVerifyStatus=!1,this.verifyRes={pubkey:"",valid:null})}resetData(){this.message="",this.signature="",this.verifyRes=null,this.showVerifyStatus=!1}onCopyField(t){this.snackBar.open("Pubkey copied."),this.logger.info("Copied Text: "+t)}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(K.D),e.Y36(te.ux),e.Y36(F.mQ))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-verify"]],decls:17,vars:6,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],["fxLayout","column","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],["form","ngForm"],["fxFlex","100","fxLayoutAlign","start end"],["autoFocus","","matInput","","rows","1","placeholder","Message to verify","required","","tabindex","1","name","message",3,"ngModel","ngModelChange","keyup"],[4,"ngIf"],["matInput","","placeholder","Signature provided","name","signature","tabindex","2","required","",3,"ngModel","ngModelChange","keyup"],["sign","ngModel"],["fxFlex","100","class","color-warn","fxLayoutAlign","start center",4,"ngIf"],["fxLayout","row",1,"my-1"],["mat-stroked-button","","color","primary","tabindex","3","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","tabindex","4","type","submit",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap",4,"ngIf"],["fxFlex","100","fxLayoutAlign","start center",1,"color-warn"],[1,"mr-1","icon-small"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch","fxLayout.gt-sm","row wrap"],[1,"my-2",3,"inset"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start center"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start","class","bordered-box read-only h-4 padding-gap",4,"ngIf"],["fxLayout","row","class","mt-2",4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start start",1,"bordered-box","read-only","h-4","padding-gap"],["fxLayout","row",1,"mt-2"],["mat-stroked-button","","color","primary","tabindex","5","rtlClipboard","","type","button",3,"payload","copied"]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.TgZ(1,"form",1,2),e.TgZ(3,"mat-form-field",3),e.TgZ(4,"textarea",4),e.NdJ("ngModelChange",function(s){return a.message=s})("keyup",function(){return a.onChange()}),e.qZA(),e.YNc(5,Eh,2,0,"mat-error",5),e.qZA(),e.TgZ(6,"mat-form-field",3),e.TgZ(7,"input",6,7),e.NdJ("ngModelChange",function(s){return a.signature=s})("keyup",function(){return a.onChange()}),e.qZA(),e.YNc(9,Yh,2,0,"mat-error",5),e.qZA(),e.YNc(10,Bh,4,0,"p",8),e.TgZ(11,"div",9),e.TgZ(12,"button",10),e.NdJ("click",function(){return a.resetData()}),e._uU(13,"Clear Fields"),e.qZA(),e.TgZ(14,"button",11),e.NdJ("click",function(){return a.onVerify()}),e._uU(15,"Verify"),e.qZA(),e.qZA(),e.YNc(16,Vh,6,4,"div",12),e.qZA(),e.qZA()),2&t&&(e.xp6(4),e.Q6J("ngModel",a.message),e.xp6(1),e.Q6J("ngIf",!a.message),e.xp6(2),e.Q6J("ngModel",a.signature),e.xp6(2),e.Q6J("ngIf",!a.signature),e.xp6(1),e.Q6J("ngIf",a.showVerifyStatus&&!a.verifyRes.valid),e.xp6(6),e.Q6J("ngIf",a.showVerifyStatus&&a.verifyRes.valid))},directives:[_.xw,_.yH,_.Wh,c._Y,c.JL,c.F,f.KE,R.Nt,c.Fj,V.h,c.Q7,c.JJ,c.On,m.O5,L.lW,f.TO,j.Hw,X.d,oe.y],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),n})();var Xh=h(9442),k=h(1643);function $h(n,i){if(1&n&&(e.TgZ(0,"div",3),e._uU(1),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Oqu(t.errorMessage)}}function jh(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",9),e.TgZ(1,"div",10),e._uU(2,"Non Routing Peers"),e.qZA(),e.TgZ(3,"mat-form-field",11),e.TgZ(4,"input",12),e.NdJ("keyup",function(){return e.CHM(t),e.oxw(2).applyFilter()})("ngModelChange",function(o){return e.CHM(t),e.oxw(2).filter=o}),e.qZA(),e.qZA(),e.qZA()}if(2&n){const t=e.oxw(2);e.xp6(4),e.Q6J("ngModel",t.filter)}}function Kh(n,i){1&n&&e._UZ(0,"mat-progress-bar",35)}function eg(n,i){1&n&&(e.TgZ(0,"th",36),e._uU(1,"Channel ID"),e.qZA())}const $e=function(n){return{"max-width":n}};function tg(n,i){if(1&n&&(e.TgZ(0,"td",37),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(3);e.Q6J("ngStyle",e.VKq(2,$e,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.Oqu(t.chan_id)}}function ng(n,i){1&n&&(e.TgZ(0,"th",36),e._uU(1,"Peer Alias"),e.qZA())}function ag(n,i){if(1&n&&(e.TgZ(0,"td",37),e._uU(1),e.qZA()),2&n){const t=i.$implicit,a=e.oxw(3);e.Q6J("ngStyle",e.VKq(2,$e,a.screenSize===a.screenSizeEnum.XS?"10rem":"28rem")),e.xp6(1),e.Oqu(t.remote_alias)}}function ig(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Sats Sent"),e.qZA())}function og(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",40),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.total_satoshis_sent))}}function sg(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Sats Received"),e.qZA())}function lg(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",40),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.total_satoshis_received))}}function rg(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Local Balance (Sats)"),e.qZA())}function cg(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",40),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.local_balance))}}function ug(n,i){1&n&&(e.TgZ(0,"th",38),e._uU(1,"Remote Balance (Sats)"),e.qZA())}function pg(n,i){if(1&n&&(e.TgZ(0,"td",39),e.TgZ(1,"span",40),e._uU(2),e.ALo(3,"number"),e.qZA(),e.qZA()),2&n){const t=i.$implicit;e.xp6(2),e.Oqu(e.lcZ(3,1,t.remote_balance))}}function mg(n,i){1&n&&(e.TgZ(0,"th",41),e.TgZ(1,"span",40),e._uU(2,"Actions"),e.qZA(),e.qZA())}function _g(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"td",42),e.TgZ(1,"button",43),e.NdJ("click",function(){const s=e.CHM(t).$implicit;return e.oxw(3).onManagePeer(s)}),e._uU(2,"Manage"),e.qZA(),e.qZA()}}function dg(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"All peers are routing."),e.qZA())}function hg(n,i){1&n&&(e.TgZ(0,"p"),e._uU(1,"Getting non routing peers..."),e.qZA())}function gg(n,i){if(1&n&&(e.TgZ(0,"p"),e._uU(1),e.qZA()),2&n){const t=e.oxw(4);e.xp6(1),e.Oqu(t.errorMessage)}}function fg(n,i){if(1&n&&(e.TgZ(0,"td",44),e.YNc(1,dg,2,0,"p",45),e.YNc(2,hg,2,0,"p",45),e.YNc(3,gg,2,1,"p",45),e.qZA()),2&n){const t=e.oxw(3);e.xp6(1),e.Q6J("ngIf",(!(null!=t.NonRoutingPeers&&t.NonRoutingPeers.data)||(null==t.NonRoutingPeers||null==t.NonRoutingPeers.data?null:t.NonRoutingPeers.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.COMPLETED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.NonRoutingPeers&&t.NonRoutingPeers.data)||(null==t.NonRoutingPeers||null==t.NonRoutingPeers.data?null:t.NonRoutingPeers.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("ngIf",(!(null!=t.NonRoutingPeers&&t.NonRoutingPeers.data)||(null==t.NonRoutingPeers||null==t.NonRoutingPeers.data?null:t.NonRoutingPeers.data.length)<1)&&t.apiCallStatus.status===t.apiCallStatusEnum.ERROR)}}const Cg=function(n){return{"display-none":n}};function xg(n,i){if(1&n&&e._UZ(0,"tr",46),2&n){const t=e.oxw(3);e.Q6J("ngClass",e.VKq(1,Cg,(null==t.NonRoutingPeers||null==t.NonRoutingPeers.data?null:t.NonRoutingPeers.data.length)>0))}}function Tg(n,i){1&n&&e._UZ(0,"tr",47)}function yg(n,i){1&n&&e._UZ(0,"tr",48)}const Zg=function(){return["no_non_routing_event"]};function bg(n,i){if(1&n&&(e.TgZ(0,"div",13),e.YNc(1,Kh,1,0,"mat-progress-bar",14),e.TgZ(2,"table",15,16),e.ynx(4,17),e.YNc(5,eg,2,0,"th",18),e.YNc(6,tg,2,4,"td",19),e.BQk(),e.ynx(7,20),e.YNc(8,ng,2,0,"th",18),e.YNc(9,ag,2,4,"td",19),e.BQk(),e.ynx(10,21),e.YNc(11,ig,2,0,"th",22),e.YNc(12,og,4,3,"td",23),e.BQk(),e.ynx(13,24),e.YNc(14,sg,2,0,"th",22),e.YNc(15,lg,4,3,"td",23),e.BQk(),e.ynx(16,25),e.YNc(17,rg,2,0,"th",22),e.YNc(18,cg,4,3,"td",23),e.BQk(),e.ynx(19,26),e.YNc(20,ug,2,0,"th",22),e.YNc(21,pg,4,3,"td",23),e.BQk(),e.ynx(22,27),e.YNc(23,mg,3,0,"th",28),e.YNc(24,_g,3,0,"td",29),e.BQk(),e.ynx(25,30),e.YNc(26,fg,4,3,"td",31),e.BQk(),e.YNc(27,xg,1,3,"tr",32),e.YNc(28,Tg,1,0,"tr",33),e.YNc(29,yg,1,0,"tr",34),e.qZA(),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.apiCallStatus.status===t.apiCallStatusEnum.INITIATED),e.xp6(1),e.Q6J("dataSource",t.NonRoutingPeers),e.xp6(25),e.Q6J("matFooterRowDef",e.DdM(6,Zg)),e.xp6(1),e.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),e.xp6(1),e.Q6J("matRowDefColumns",t.displayedColumns)}}function Ag(n,i){if(1&n&&(e.TgZ(0,"div",4),e.YNc(1,jh,5,1,"div",5),e.YNc(2,bg,30,7,"div",6),e._UZ(3,"mat-paginator",7,8),e.qZA()),2&n){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",""===t.errorMessage),e.xp6(1),e.Q6J("ngIf",""===t.errorMessage),e.xp6(1),e.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS)}}const qg=T.Bz.forChild([{path:"",component:Ae,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:ai,canActivate:[k.QM]},{path:"wallet",component:Gc,canActivate:[k.a1]},{path:"onchain",component:td,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"receive/utxos"},{path:"receive/:selTab",component:id,canActivate:[k.QM]},{path:"send/:selTab",component:We,data:{sweepAll:!1},canActivate:[k.QM]},{path:"sweep/:selTab",component:We,data:{sweepAll:!0},canActivate:[k.QM]}]},{path:"connections",component:si,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:ro,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Rs,canActivate:[k.QM]},{path:"pending",component:Cr,canActivate:[k.QM]},{path:"closed",component:Yr,canActivate:[k.QM]},{path:"activehtlcs",component:yc,canActivate:[k.QM]}]},{path:"peers",component:ao,data:{sweepAll:!1},canActivate:[k.QM]}]},{path:"transactions",component:Wc,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:Ue,canActivate:[k.QM]},{path:"invoices",component:Ne,canActivate:[k.QM]}]},{path:"messages",component:Mh,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"sign"},{path:"sign",component:Qh,canActivate:[k.QM]},{path:"verify",component:Wh,canActivate:[k.QM]}]},{path:"channelbackup",component:nh,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"bckup"},{path:"bckup",component:Dh,canActivate:[k.QM]},{path:"restore",component:Th,canActivate:[k.QM]}]},{path:"routing",component:$u,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Ee,canActivate:[k.QM]},{path:"peers",component:Cm,canActivate:[k.QM]},{path:"nonroutingprs",component:(()=>{class n{constructor(t,a,o,s,u){this.logger=t,this.commonService=a,this.store=o,this.router=s,this.activatedRoute=u,this.routingPeersData=[],this.displayedColumns=[],this.NonRoutingPeers=new r.by([]),this.flgSticky=!1,this.pageSize=l.IV,this.pageSizeOptions=l.TJ,this.screenSize="",this.screenSizeEnum=l.cu,this.errorMessage="",this.filter="",this.activeChannels=[],this.apiCallStatus=null,this.apiCallStatusEnum=l.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===l.cu.XS||this.screenSize===l.cu.SM?(this.flgSticky=!1,this.displayedColumns=["remote_alias","local_balance","remote_balance","actions"]):this.screenSize===l.cu.MD?(this.flgSticky=!1,this.displayedColumns=["chan_id","remote_alias","local_balance","remote_balance","actions"]):(this.flgSticky=!0,this.displayedColumns=["chan_id","remote_alias","total_satoshis_received","total_satoshis_sent","local_balance","remote_balance","actions"])}ngOnInit(){this.store.select(C.Bo).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{var a;this.errorMessage="",this.apiCallStatus=t.apiCallStatus,(null===(a=t.apiCallStatus)||void 0===a?void 0:a.status)===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.routingPeersData=t.forwardingHistory.forwarding_events?t.forwardingHistory.forwarding_events:[],this.routingPeersData.length>0&&this.sort&&this.paginator&&this.loadNonRoutingPeersTable(this.routingPeersData),this.logger.info(t.apiCallStatus),this.logger.info(t.forwardingHistory)}),this.store.select(C.ZW).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.errorMessage="",this.apiCallStatus=t.apiCallStatus,this.apiCallStatus.status===l.Bn.ERROR&&(this.errorMessage="object"==typeof this.apiCallStatus.message?JSON.stringify(this.apiCallStatus.message):this.apiCallStatus.message),this.activeChannels=t.channels,this.logger.info(t)})}ngAfterViewInit(){this.routingPeersData.length>0&&this.loadNonRoutingPeersTable(this.routingPeersData)}onManagePeer(t){this.router.navigate(["../../","connections","channels","open"],{relativeTo:this.activatedRoute,state:{filter:t.chan_id}})}loadNonRoutingPeersTable(t){if(t.length>0){const a=this.activeChannels.filter(o=>t.findIndex(s=>s.chan_id_in===o.chan_id||s.chan_id_out===o.chan_id)<0);this.NonRoutingPeers=new r.by(a),this.NonRoutingPeers.sort=this.sort,this.NonRoutingPeers.filterPredicate=(o,s)=>JSON.stringify(o).toLowerCase().includes(s),this.NonRoutingPeers.paginator=this.paginator,this.logger.info(this.NonRoutingPeers)}else this.NonRoutingPeers=new r.by([]);this.applyFilter()}applyFilter(){this.NonRoutingPeers.filter=this.filter.toLowerCase()}ngOnDestroy(){this.unSubs.forEach(t=>{t.next(null),t.complete()})}}return n.\u0275fac=function(t){return new(t||n)(e.Y36(F.mQ),e.Y36(P.v),e.Y36(w.yh),e.Y36(T.F0),e.Y36(T.gz))},n.\u0275cmp=e.Xpm({type:n,selectors:[["rtl-non-routing-peers"]],viewQuery:function(t,a){if(1&t&&(e.Gf(Z.YE,5),e.Gf(q.NW,5)),2&t){let o;e.iGM(o=e.CRH())&&(a.sort=o.first),e.iGM(o=e.CRH())&&(a.paginator=o.first)}},features:[e._Bn([{provide:q.ye,useValue:(0,l.pt)("Non routing peers")}])],decls:3,vars:2,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",1,"padding-gap-x-large"],["class","p-2 error-border my-2",4,"ngIf"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch",4,"ngIf"],[1,"p-2","error-border","my-2"],["fxLayout","column","fxFlex","100","fxLayoutAlign","start stretch"],["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"],[1,"mb-1",3,"pageSize","pageSizeOptions","showFirstLastButtons"],["paginator",""],["fxLayout","column","fxLayout.gt-xs","row","fxLayoutAlign.gt-xs","start center","fxLayoutAlign","start stretch",1,"page-sub-title-container"],["fxFlex","70"],["fxFlex","30"],["matInput","","placeholder","Filter",3,"ngModel","keyup","ngModelChange"],["fxLayout","column","fxLayoutAlign","start center","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","matSort","",1,"overflow-auto",3,"dataSource"],["table",""],["matColumnDef","chan_id"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","remote_alias"],["matColumnDef","total_satoshis_sent"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","total_satoshis_received"],["matColumnDef","local_balance"],["matColumnDef","remote_balance"],["matColumnDef","actions"],["mat-header-cell","","class","pr-3",4,"matHeaderCellDef"],["mat-cell","","class","pl-2","fxLayoutAlign","end center",4,"matCellDef"],["matColumnDef","no_non_routing_event"],["mat-footer-cell","","colspan","4",4,"matFooterCellDef"],["mat-footer-row","",3,"ngClass",4,"matFooterRowDef"],["mat-header-row","",4,"matHeaderRowDef","matHeaderRowDefSticky"],["mat-row","",4,"matRowDef","matRowDefColumns"],["mode","indeterminate"],["mat-header-cell","","mat-sort-header",""],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["fxLayoutAlign","end center"],["mat-header-cell","",1,"pr-3"],["mat-cell","","fxLayoutAlign","end center",1,"pl-2"],["mat-stroked-button","","color","primary","type","button","tabindex","4",3,"click"],["mat-footer-cell","","colspan","4"],[4,"ngIf"],["mat-footer-row","",3,"ngClass"],["mat-header-row",""],["mat-row",""]],template:function(t,a){1&t&&(e.TgZ(0,"div",0),e.YNc(1,$h,2,1,"div",1),e.YNc(2,Ag,5,5,"div",2),e.qZA()),2&t&&(e.xp6(1),e.Q6J("ngIf",""!==a.errorMessage),e.xp6(1),e.Q6J("ngIf",""===a.errorMessage))},directives:[_.xw,_.yH,_.Wh,m.O5,q.NW,f.KE,R.Nt,c.Fj,c.JJ,c.On,Y.$V,r.BZ,Z.YE,r.w1,r.fO,r.Dz,r.mD,r.Ke,r.as,r.nj,M.pW,r.ge,Z.nU,r.ev,m.PC,S.Zl,L.lW,r.yh,r.Q2,m.mk,S.oO,r.XQ,r.Gk],pipes:[m.JJ],styles:[".mat-column-chan_id[_ngcontent-%COMP%], .mat-column-alias[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),n})(),canActivate:[k.QM]}]},{path:"reports",component:Tm,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:Lm,canActivate:[k.QM]},{path:"transactions",component:Qm,canActivate:[k.QM]}]},{path:"graph",component:$c,canActivate:[k.QM],children:[{path:"",pathMatch:"full",redirectTo:"lookups"},{path:"lookups",component:Qe,canActivate:[k.QM]},{path:"queryroutes",component:xu,canActivate:[k.QM]}]},{path:"lookups",component:Qe,canActivate:[k.QM]},{path:"network",component:eh,canActivate:[k.QM]},{path:"**",component:Xh.w},{path:"rates",redirectTo:"network"}]}]);var Sg=h(8750);let Lg=(()=>{class n{}return n.\u0275fac=function(t){return new(t||n)},n.\u0275mod=e.oAB({type:n,bootstrap:[Ae]}),n.\u0275inj=e.cJS({providers:[k.QM],imports:[[m.ez,Sg.m,qg]]}),n})()}}]);