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/angular/891.4fbbfe370fa877de7f39.js

1 line
491 KiB
JavaScript

(self.webpackChunkrtl=self.webpackChunkrtl||[]).push([[891],{7891:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LNDModule:()=>vg});var a=n(1511),i=n(6853),s=n(2865),o=n(1572),l=n(3722),r=n(5994);function c(e,t){1&e&&o._UZ(0,"mat-progress-bar",3)}let u=(()=>{class e{constructor(e){this.router=e,this.loading=!1,this.router.events.subscribe(e=>{switch(!0){case e instanceof i.OD:this.loading=!0;break;case e instanceof i.m2:case e instanceof i.gk:case e instanceof i.Q3:this.loading=!1}})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,c,1,0,"mat-progress-bar",1),o._UZ(2,"router-outlet",null,2),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngIf",t.loading))},directives:[l.xw,l.yH,l.Wh,a.O5,i.lC,r.pW],styles:[""],data:{animation:[s.g]}}),e})();var p=n(9666),d=n(9568),h=n(8868),m=n(7810),g=n(5291),f=n(9421),x=n(5678),Z=n(3869),y=n(964),A=n(5573),C=n(1084),T=n(7592),b=n(7271),w=n(7439),_=n(8055),v=n(377),q=n(5980),S=n(3691);const F=function(e){return{backgroundColor:e}};function L(e,t){if(1&e&&o._UZ(0,"span",6),2&e){const e=o.oxw();o.Q6J("ngStyle",o.VKq(1,F,null==e.information?null:e.information.color))}}function k(e,t){if(1&e&&(o.TgZ(0,"div"),o.TgZ(1,"h4",1),o._uU(2,"Color"),o.qZA(),o.TgZ(3,"div",2),o._UZ(4,"span",7),o._uU(5),o.ALo(6,"uppercase"),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(4),o.Q6J("ngStyle",o.VKq(4,F,null==e.information?null:e.information.color)),o.xp6(1),o.hij(" ",o.lcZ(6,2,null==e.information?null:e.information.color)," ")}}function N(e,t){if(1&e&&(o.TgZ(0,"span",2),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(e)}}let U=(()=>{class e{constructor(e){this.commonService=e,this.chains=[""]}ngOnChanges(){this.information&&this.information.chains&&this.information.chains.length>0&&(this.chains=[""],this.information.chains.forEach(e=>{this.chains.push(this.commonService.titleCase(e.chain)+" "+this.commonService.titleCase(e.network))}))}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-node-info"]],inputs:{information:"information",showColorFieldSeparately:"showColorFieldSeparately"},features:[o.TTD],decls:17,vars:5,consts:[["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch"],[1,"dashboard-info-title"],[1,"overflow-wrap","dashboard-info-value"],["class","dashboard-node-dot dot",3,"ngStyle",4,"ngIf"],[4,"ngIf"],["class","overflow-wrap dashboard-info-value",4,"ngFor","ngForOf"],[1,"dashboard-node-dot","dot",3,"ngStyle"],[1,"dashboard-node-square",3,"ngStyle"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div"),o.TgZ(2,"h4",1),o._uU(3,"Alias"),o.qZA(),o.TgZ(4,"div",2),o._uU(5),o.YNc(6,L,1,3,"span",3),o.qZA(),o.qZA(),o.YNc(7,k,7,6,"div",4),o.TgZ(8,"div"),o.TgZ(9,"h4",1),o._uU(10,"Implementation"),o.qZA(),o.TgZ(11,"div",2),o._uU(12),o.qZA(),o.qZA(),o.TgZ(13,"div"),o.TgZ(14,"h4",1),o._uU(15,"Chain"),o.qZA(),o.YNc(16,N,2,1,"span",5),o.qZA(),o.qZA()),2&e&&(o.xp6(5),o.hij(" ",null==t.information?null:t.information.alias," "),o.xp6(1),o.Q6J("ngIf",!t.showColorFieldSeparately),o.xp6(1),o.Q6J("ngIf",t.showColorFieldSeparately),o.xp6(5),o.Oqu(null!=t.information&&t.information.lnImplementation||null!=t.information&&t.information.version?(null==t.information?null:t.information.lnImplementation)+" "+(null==t.information?null:t.information.version):""),o.xp6(4),o.Q6J("ngForOf",t.chains))},directives:[l.xw,l.yH,l.Wh,a.O5,a.sg,a.PC,v.Zl],pipes:[a.gd],styles:[""]}),e})();function I(e,t){if(1&e&&(o.TgZ(0,"div",2),o.TgZ(1,"div"),o.TgZ(2,"h4",3),o._uU(3,"Lightning"),o.qZA(),o.TgZ(4,"div",4),o._uU(5),o.ALo(6,"number"),o.qZA(),o._UZ(7,"mat-progress-bar",5),o.qZA(),o.TgZ(8,"div"),o.TgZ(9,"h4",3),o._uU(10,"On-chain"),o.qZA(),o.TgZ(11,"div",4),o._uU(12),o.ALo(13,"number"),o.qZA(),o._UZ(14,"mat-progress-bar",5),o.qZA(),o.TgZ(15,"div"),o.TgZ(16,"h4",3),o._uU(17,"Total"),o.qZA(),o.TgZ(18,"div",4),o._uU(19),o.ALo(20,"number"),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(5),o.hij("",o.lcZ(6,5,null==e.balances?null:e.balances.lightning)," Sats"),o.xp6(2),o.s9C("value",(null==e.balances?null:e.balances.lightning)/(null==e.balances?null:e.balances.total)*100),o.xp6(5),o.hij("",o.lcZ(13,7,null==e.balances?null:e.balances.onchain)," Sats"),o.xp6(2),o.s9C("value",(null==e.balances?null:e.balances.onchain)/(null==e.balances?null:e.balances.total)*100),o.xp6(5),o.hij("",o.lcZ(20,9,null==e.balances?null:e.balances.total)," Sats")}}function O(e,t){if(1&e&&(o.TgZ(0,"div",6),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Oqu(e.errorMessage)}}let J=(()=>{class e{constructor(){this.balances={onchain:0,lightning:0,total:0}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,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(e,t){if(1&e&&(o.YNc(0,I,21,11,"div",0),o.YNc(1,O,3,1,"ng-template",null,1,o.W1O)),2&e){const e=o.MAs(2);o.Q6J("ngIf"," "===t.errorMessage)("ngIfElse",e)}},directives:[a.O5,l.xw,l.yH,l.Wh,r.pW],pipes:[a.JJ],styles:[""]}),e})();var D=n(6283),R=n(6828),M=n(7679),E=n(7038);function Q(e,t){if(1&e&&(o.TgZ(0,"div",19),o.TgZ(1,"span",20),o._uU(2),o.ALo(3,"slice"),o.qZA(),o.TgZ(4,"div",6),o.TgZ(5,"mat-hint",21),o.TgZ(6,"strong",8),o._uU(7,"Local:"),o.qZA(),o._uU(8),o.ALo(9,"number"),o.qZA(),o.TgZ(10,"mat-hint",22),o._UZ(11,"fa-icon",23),o._uU(12),o.ALo(13,"number"),o.qZA(),o.TgZ(14,"mat-hint",24),o.TgZ(15,"strong",8),o._uU(16,"Remote:"),o.qZA(),o._uU(17),o.ALo(18,"number"),o.qZA(),o.qZA(),o._UZ(19,"mat-progress-bar",25),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(3);o.xp6(1),o.s9C("matTooltip",e.remote_alias||e.remote_pubkey),o.s9C("matTooltipDisabled",(e.remote_alias||e.remote_pubkey).length<26),o.xp6(1),o.AsE("",o.Dn7(3,9,e.remote_alias||e.remote_pubkey,0,24),"",(e.remote_alias||e.remote_pubkey).length>25?"...":"",""),o.xp6(6),o.hij("",o.lcZ(9,13,e.local_balance||0)," Sats"),o.xp6(3),o.Q6J("icon",n.faBalanceScale),o.xp6(1),o.hij(" (",o.lcZ(13,15,e.balancedness||0),") "),o.xp6(5),o.hij("",o.lcZ(18,17,e.remote_balance||0)," Sats"),o.xp6(2),o.s9C("value",e.local_balance&&e.local_balance>0?+e.local_balance/(+e.local_balance+ +e.remote_balance)*100:0)}}function Y(e,t){if(1&e&&(o.TgZ(0,"div",17),o.YNc(1,Q,20,19,"div",18),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngForOf",e.allChannels)}}function P(e,t){if(1&e&&(o.TgZ(0,"div",3),o.TgZ(1,"div",4),o.TgZ(2,"span",5),o._uU(3,"Total Capacity"),o.qZA(),o.TgZ(4,"div",6),o.TgZ(5,"mat-hint",7),o.TgZ(6,"strong",8),o._uU(7,"Local:"),o.qZA(),o._uU(8),o.ALo(9,"number"),o.qZA(),o.TgZ(10,"mat-hint",9),o._UZ(11,"fa-icon",10),o._uU(12),o.ALo(13,"number"),o.qZA(),o.TgZ(14,"mat-hint",11),o.TgZ(15,"strong",8),o._uU(16,"Remote:"),o.qZA(),o._uU(17),o.ALo(18,"number"),o.qZA(),o.qZA(),o._UZ(19,"mat-progress-bar",12),o.qZA(),o.TgZ(20,"div",13),o._UZ(21,"mat-divider",14),o.qZA(),o.TgZ(22,"div",15),o.YNc(23,Y,2,1,"div",16),o.qZA(),o.qZA()),2&e){const e=o.oxw(),t=o.MAs(2);o.xp6(8),o.hij("",o.lcZ(9,7,(null==e.channelBalances?null:e.channelBalances.localBalance)||0)," Sats"),o.xp6(3),o.Q6J("icon",e.faBalanceScale),o.xp6(1),o.hij(" (",o.lcZ(13,9,(null==e.channelBalances?null:e.channelBalances.balancedness)||0),") "),o.xp6(5),o.hij("",o.lcZ(18,11,(null==e.channelBalances?null:e.channelBalances.remoteBalance)||0)," Sats"),o.xp6(2),o.s9C("value",null!=e.channelBalances&&e.channelBalances.localBalance&&(null==e.channelBalances?null:e.channelBalances.localBalance)>0?+(null==e.channelBalances?null:e.channelBalances.localBalance)/(+(null==e.channelBalances?null:e.channelBalances.localBalance)+ +(null==e.channelBalances?null:e.channelBalances.remoteBalance))*100:0),o.xp6(4),o.Q6J("ngIf",e.allChannels&&e.allChannels.length>0)("ngIfElse",t)}}function B(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",26),o._uU(1," No channels available. "),o.TgZ(2,"button",27),o.NdJ("click",function(){return o.CHM(e),o.oxw().goToChannels()}),o._uU(3,"Open Channel"),o.qZA(),o.qZA()}}function G(e,t){if(1&e&&(o.TgZ(0,"div",28),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Oqu(e.errorMessage)}}let H=(()=>{class e{constructor(e){this.router=e,this.faBalanceScale=g.DL8,this.faDumbbell=g.FlN,this.sortBy="Balance Score"}goToChannels(){this.router.navigateByUrl("/lnd/connections")}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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,"matTooltip","matTooltipDisabled"],["fxFlex","40","fxLayoutAlign","start center",1,"font-size-90","color-primary"],["fxFlex","20","fxLayoutAlign","center center",1,"font-size-90","color-primary"],["matTooltip","Balance Score",1,"color-primary","mr-3px",3,"icon"],["fxFlex","40","fxLayoutAlign","end center",1,"font-size-90","color-primary"],["mode","determinate",1,"dashboard-progress-bar",3,"value"],["fxLayout","row","fxFlex","100","fxLayoutAlign","space-between start",1,"mt-1","w-100"],["mat-stroked-button","","color","primary","tabindex","1",3,"click"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between",1,"p-2"]],template:function(e,t){if(1&e&&(o.YNc(0,P,24,13,"div",0),o.YNc(1,B,4,0,"ng-template",null,1,o.W1O),o.YNc(3,G,3,1,"ng-template",null,2,o.W1O)),2&e){const e=o.MAs(4);o.Q6J("ngIf",""===(null==t.errorMessage?null:t.errorMessage.trim()))("ngIfElse",e)}},directives:[a.O5,l.xw,l.Wh,l.yH,D.bx,T.BN,R.gM,r.pW,M.d,E.$V,a.sg,q.lW],pipes:[a.JJ,a.OU],styles:[".channels-capacity-scroll[_ngcontent-%COMP%]{width:100%;height:100%;overflow-y:hidden}"]}),e})();function z(e,t){if(1&e&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o.TgZ(2,"div"),o.TgZ(3,"h4",4),o._uU(4,"Daily"),o.qZA(),o.TgZ(5,"div",5),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.TgZ(8,"div"),o.TgZ(9,"h4",4),o._uU(10,"Weekly"),o.qZA(),o.TgZ(11,"div",5),o._uU(12),o.ALo(13,"number"),o.qZA(),o.qZA(),o.TgZ(14,"div"),o.TgZ(15,"h4",4),o._uU(16,"Monthly"),o.qZA(),o.TgZ(17,"div",5),o._uU(18),o.ALo(19,"number"),o.qZA(),o.qZA(),o.TgZ(20,"div",6),o._UZ(21,"h4",7),o._UZ(22,"span",5),o.qZA(),o.qZA(),o.TgZ(23,"div",3),o.TgZ(24,"div"),o.TgZ(25,"h4",4),o._uU(26,"Transactions"),o.qZA(),o.TgZ(27,"div",5),o._uU(28),o.ALo(29,"number"),o.qZA(),o.qZA(),o.TgZ(30,"div"),o.TgZ(31,"h4",4),o._uU(32,"Transactions"),o.qZA(),o.TgZ(33,"div",5),o._uU(34),o.ALo(35,"number"),o.qZA(),o.qZA(),o.TgZ(36,"div"),o.TgZ(37,"h4",4),o._uU(38,"Transactions"),o.qZA(),o.TgZ(39,"div",5),o._uU(40),o.ALo(41,"number"),o.qZA(),o.qZA(),o.TgZ(42,"div",6),o._UZ(43,"h4",7),o._UZ(44,"span",5),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(6),o.hij("",o.lcZ(7,6,null==e.fees?null:e.fees.day_fee_sum)," Sats"),o.xp6(6),o.hij("",o.lcZ(13,8,null==e.fees?null:e.fees.week_fee_sum)," Sats"),o.xp6(6),o.hij("",o.lcZ(19,10,null==e.fees?null:e.fees.month_fee_sum)," Sats"),o.xp6(10),o.Oqu(o.lcZ(29,12,null==e.fees?null:e.fees.daily_tx_count)),o.xp6(6),o.Oqu(o.lcZ(35,14,null==e.fees?null:e.fees.weekly_tx_count)),o.xp6(6),o.Oqu(o.lcZ(41,16,null==e.fees?null:e.fees.monthly_tx_count))}}function V(e,t){if(1&e&&(o.TgZ(0,"div",8),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Oqu(e.errorMessage)}}let W=(()=>{class e{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 e=Math.ceil(Math.log(this.fees.month_fee_sum+1)/Math.LN10),t=Math.pow(10,e-1);this.maxFeeValue=Math.ceil(this.fees.month_fee_sum/t)*t/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 e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-fee-info"]],inputs:{fees:"fees",errorMessage:"errorMessage"},features:[o.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(e,t){if(1&e&&(o.YNc(0,z,45,18,"div",0),o.YNc(1,V,3,1,"ng-template",null,1,o.W1O)),2&e){const e=o.MAs(2);o.Q6J("ngIf",""===(null==t.errorMessage?null:t.errorMessage.trim()))("ngIfElse",e)}},directives:[a.O5,l.xw,l.yH,l.Wh],pipes:[a.JJ],styles:[""]}),e})();function X(e,t){if(1&e&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o.TgZ(2,"div"),o.TgZ(3,"h4",4),o._uU(4,"Active"),o.qZA(),o.TgZ(5,"div",5),o._UZ(6,"span",6),o._uU(7),o.ALo(8,"number"),o.qZA(),o.qZA(),o.TgZ(9,"div"),o.TgZ(10,"h4",4),o._uU(11,"Pending"),o.qZA(),o.TgZ(12,"div",5),o._UZ(13,"span",7),o._uU(14),o.ALo(15,"number"),o.qZA(),o.qZA(),o.TgZ(16,"div"),o.TgZ(17,"h4",4),o._uU(18,"Inactive"),o.qZA(),o.TgZ(19,"div",5),o._UZ(20,"span",8),o._uU(21),o.ALo(22,"number"),o.qZA(),o.qZA(),o.TgZ(23,"div"),o.TgZ(24,"h4",4),o._uU(25,"Closing"),o.qZA(),o.TgZ(26,"div",5),o._UZ(27,"span",9),o._uU(28),o.ALo(29,"number"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(30,"div",3),o.TgZ(31,"div"),o.TgZ(32,"h4",4),o._uU(33,"Capacity"),o.qZA(),o.TgZ(34,"div",5),o._uU(35),o.ALo(36,"number"),o.qZA(),o.qZA(),o.TgZ(37,"div"),o.TgZ(38,"h4",4),o._uU(39,"Capacity"),o.qZA(),o.TgZ(40,"div",5),o._uU(41),o.ALo(42,"number"),o.qZA(),o.qZA(),o.TgZ(43,"div"),o.TgZ(44,"h4",4),o._uU(45,"Capacity"),o.qZA(),o.TgZ(46,"div",5),o._uU(47),o.ALo(48,"number"),o.qZA(),o.qZA(),o.TgZ(49,"div"),o.TgZ(50,"h4",4),o._uU(51,"Capacity"),o.qZA(),o.TgZ(52,"div",5),o._uU(53),o.ALo(54,"number"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(7),o.Oqu(o.lcZ(8,8,(null==e.channelsStatus||null==e.channelsStatus.active?null:e.channelsStatus.active.channels)||0)),o.xp6(7),o.Oqu(o.lcZ(15,10,(null==e.channelsStatus||null==e.channelsStatus.pending?null:e.channelsStatus.pending.channels)||0)),o.xp6(7),o.Oqu(o.lcZ(22,12,(null==e.channelsStatus||null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.channels)||0)),o.xp6(7),o.Oqu(o.lcZ(29,14,(null==e.channelsStatus||null==e.channelsStatus.closing?null:e.channelsStatus.closing.channels)||0)),o.xp6(7),o.hij("",o.lcZ(36,16,(null==e.channelsStatus||null==e.channelsStatus.active?null:e.channelsStatus.active.capacity)||0)," Sats"),o.xp6(6),o.hij("",o.lcZ(42,18,(null==e.channelsStatus||null==e.channelsStatus.pending?null:e.channelsStatus.pending.capacity)||0)," Sats"),o.xp6(6),o.hij("",o.lcZ(48,20,(null==e.channelsStatus||null==e.channelsStatus.inactive?null:e.channelsStatus.inactive.capacity)||0)," Sats"),o.xp6(6),o.hij("",o.lcZ(54,22,(null==e.channelsStatus||null==e.channelsStatus.closing?null:e.channelsStatus.closing.capacity)||0)," Sats")}}function $(e,t){if(1&e&&(o.TgZ(0,"div",10),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Oqu(e.errorMessage)}}let j=(()=>{class e{constructor(){this.channelsStatus={}}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,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(e,t){if(1&e&&(o.YNc(0,X,55,24,"div",0),o.YNc(1,$,3,1,"ng-template",null,1,o.W1O)),2&e){const e=o.MAs(2);o.Q6J("ngIf"," "===t.errorMessage)("ngIfElse",e)}},directives:[a.O5,l.xw,l.yH,l.Wh],pipes:[a.JJ],styles:[""]}),e})();var K=n(5028),ee=n(3929),te=n(2969);function ne(e,t){if(1&e&&(o.TgZ(0,"mat-hint",19),o.TgZ(1,"strong",20),o._uU(2,"Capacity: "),o.qZA(),o._uU(3),o.ALo(4,"number"),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(3),o.hij("",o.lcZ(4,1,e.remote_balance||0)," Sats")}}function ae(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",24),o.NdJ("click",function(){o.CHM(e);const t=o.oxw(2).$implicit;return o.oxw(3).onLoopOut(t)}),o._uU(1,"Loop Out"),o.qZA()}}function ie(e,t){if(1&e&&(o.TgZ(0,"div",21),o.TgZ(1,"mat-hint",22),o.TgZ(2,"strong",20),o._uU(3,"Capacity: "),o.qZA(),o._uU(4),o.ALo(5,"number"),o.qZA(),o.YNc(6,ae,2,0,"button",23),o.qZA()),2&e){const e=o.oxw().$implicit,t=o.oxw(3);o.xp6(4),o.hij("",o.lcZ(5,2,e.local_balance||0)," Sats"),o.xp6(2),o.Q6J("ngIf",t.showLoop)}}function se(e,t){if(1&e&&o._UZ(0,"mat-progress-bar",25),2&e){const e=o.oxw().$implicit,t=o.oxw(3);o.s9C("value",t.totalLiquidity>0?(+e.remote_balance||0)/t.totalLiquidity*100:0)}}function oe(e,t){if(1&e&&o._UZ(0,"mat-progress-bar",25),2&e){const e=o.oxw().$implicit,t=o.oxw(3);o.s9C("value",t.totalLiquidity>0?(+e.local_balance||0)/t.totalLiquidity*100:0)}}function le(e,t){if(1&e&&(o.TgZ(0,"div",13),o.TgZ(1,"span",14),o._uU(2),o.ALo(3,"slice"),o.qZA(),o.TgZ(4,"div",15),o.YNc(5,ne,5,3,"mat-hint",16),o.YNc(6,ie,7,4,"div",17),o.qZA(),o.YNc(7,se,1,1,"mat-progress-bar",18),o.YNc(8,oe,1,1,"mat-progress-bar",18),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(3);o.xp6(1),o.s9C("matTooltip",e.remote_alias||e.remote_pubkey),o.s9C("matTooltipDisabled",(e.remote_alias||e.remote_pubkey).length<26),o.xp6(1),o.AsE("",o.Dn7(3,8,e.remote_alias||e.remote_pubkey,0,24),"",(e.remote_alias||e.remote_pubkey).length>25?"...":"",""),o.xp6(3),o.Q6J("ngIf","In"===n.direction),o.xp6(1),o.Q6J("ngIf","Out"===n.direction),o.xp6(1),o.Q6J("ngIf","In"===n.direction),o.xp6(1),o.Q6J("ngIf","Out"===n.direction)}}function re(e,t){if(1&e&&(o.TgZ(0,"div",11),o.YNc(1,le,9,12,"div",12),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngForOf",e.allChannels)}}const ce=function(e,t,n){return{"mb-4":e,"mb-2":t,"mb-1":n}};function ue(e,t){if(1&e&&(o.TgZ(0,"div",3),o.TgZ(1,"div",4),o.TgZ(2,"span",5),o._uU(3,"Total Capacity"),o.qZA(),o.TgZ(4,"mat-hint",6),o._uU(5),o.ALo(6,"number"),o.qZA(),o._UZ(7,"mat-progress-bar",7),o.qZA(),o.TgZ(8,"div",8),o._UZ(9,"mat-divider",9),o.qZA(),o.YNc(10,re,2,1,"div",10),o.qZA()),2&e){const e=o.oxw(),t=o.MAs(2);o.Q6J("ngClass",o.kEZ(6,ce,e.screenSize===e.screenSizeEnum.XS||e.screenSize===e.screenSizeEnum.SM,e.screenSize===e.screenSizeEnum.MD,e.screenSize===e.screenSizeEnum.LG||e.screenSize===e.screenSizeEnum.XL)),o.xp6(5),o.hij("",o.lcZ(6,4,e.totalLiquidity)," Sats"),o.xp6(5),o.Q6J("ngIf",e.allChannels&&e.allChannels.length>0)("ngIfElse",t)}}function pe(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",28),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).goToChannels()}),o._uU(1,"Open Channel"),o.qZA()}}function de(e,t){if(1&e&&(o.TgZ(0,"div",26),o._uU(1," No channels available. "),o.YNc(2,pe,2,0,"button",27),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Q6J("ngIf","Out"===e.direction)}}function he(e,t){if(1&e&&(o.TgZ(0,"div",29),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Oqu(e.errorMessage)}}let me=(()=>{class e{constructor(e,t,n,a){this.router=e,this.loopService=t,this.commonService=n,this.store=a,this.targetConf=6,this.screenSize="",this.screenSizeEnum=f.cu,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.store.select("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.showLoop=!(!e.nodeSettings.swapServerUrl||""===e.nodeSettings.swapServerUrl.trim())})}goToChannels(){this.router.navigateByUrl("/lnd/connections")}onLoopOut(e){this.loopService.getLoopOutTermsAndQuotes(this.targetConf).pipe((0,d.R)(this.unSubs[1])).subscribe(t=>{this.store.dispatch(new ee.wu({minHeight:"56rem",data:{channel:e,minQuote:t[0],maxQuote:t[1],direction:f.$I.LOOP_OUT,component:K.a}}))})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(i.F0),o.Y36(te.W),o.Y36(C.v),o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,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,"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(e,t){if(1&e&&(o.YNc(0,ue,11,10,"div",0),o.YNc(1,de,3,1,"ng-template",null,1,o.W1O),o.YNc(3,he,3,1,"ng-template",null,2,o.W1O)),2&e){const e=o.MAs(4);o.Q6J("ngIf",""===(null==t.errorMessage?null:t.errorMessage.trim()))("ngIfElse",e)}},directives:[a.O5,l.xw,l.Wh,l.yH,a.mk,v.oO,D.bx,r.pW,M.d,E.$V,a.sg,R.gM,q.lW],pipes:[a.JJ,a.OU],styles:[""]}),e})();var ge=n(5109),fe=n(3005),xe=n(2464),Ze=n(7033),ye=n(4608),Ae=n(6073),Ce=n(6756),Te=n(6880),be=n(5095),we=n(4786),_e=n(7521),ve=n(1522);function qe(e,t){if(1&e&&(o.TgZ(0,"mat-option",24),o._uU(1),o.ALo(2,"titlecase"),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.Oqu(o.lcZ(2,2,e))}}function Se(e,t){if(1&e&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.invoiceError)}}function Fe(e,t){if(1&e&&(o.TgZ(0,"div",25),o._UZ(1,"fa-icon",26),o.YNc(2,Se,2,1,"span",27),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==e.invoiceError)}}let Le=(()=>{class e{constructor(e,t,n,a,i,s){this.dialogRef=e,this.data=t,this.store=n,this.decimalPipe=a,this.commonService=i,this.actions=s,this.faExclamationTriangle=g.eHv,this.selNode={},this.memo="",this.invoiceValueHint="",this.invoicePaymentReq="",this.information={},this.private=!1,this.expiryStep=100,this.pageSize=f.IV,this.timeUnitEnum=f.Qk,this.timeUnits=f.LO,this.selTimeUnit=f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.information=e.information}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,h.h)(e=>e.type===x.JE||e.type===x.Ov)).subscribe(e=>{e.type===x.Ov&&this.dialogRef.close(),e.type===x.JE&&e.payload.status===f.Bn.ERROR&&"SaveNewInvoice"===e.payload.action&&(this.invoiceError=e.payload.message)})}onAddInvoice(e){this.invoiceError="";let t=this.expiry?this.expiry:3600;this.selTimeUnit!==f.Qk.SECS&&(t=this.commonService.convertTime(this.expiry,this.selTimeUnit,f.Qk.SECS)),this.store.dispatch(new x.H1({uiMessage:f.m6.ADD_INVOICE,memo:this.memo,invoiceValue:this.invoiceValue,private:this.private,expiry:t,pageSize:this.pageSize,openModal:!0}))}resetData(){this.memo="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint="",this.selTimeUnit=f.Qk.SECS,this.invoiceError=""}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[2])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,f.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onTimeUnitChange(e){this.expiry&&this.selTimeUnit!==e.value&&(this.expiry=this.commonService.convertTime(this.expiry,this.selTimeUnit,e.value)),this.selTimeUnit=e.value}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(y.yh),o.Y36(a.JJ),o.Y36(C.v),o.Y36(A.eX))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-create-invoices"]],decls:36,vars:17,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","matTooltip","Include routing hints for private channels","name","private",3,"ngModel","matTooltipPosition","ngModelChange"],["fxFlex","100","class","alert alert-danger mt-1",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center",1,"mt-1"],["mat-stroked-button","","color","primary","tabindex","5","type","reset",1,"mr-1",3,"click"],["mat-flat-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(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Create Invoice"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.TgZ(11,"mat-form-field",9),o.TgZ(12,"input",10),o.NdJ("ngModelChange",function(e){return t.memo=e}),o.qZA(),o.qZA(),o.TgZ(13,"mat-form-field",11),o.TgZ(14,"input",12),o.NdJ("ngModelChange",function(e){return t.invoiceValue=e})("keyup",function(){return t.onInvoiceValueChange()}),o.qZA(),o.TgZ(15,"span",13),o._uU(16," Sats "),o.qZA(),o.TgZ(17,"mat-hint"),o._uU(18),o.qZA(),o.qZA(),o.TgZ(19,"mat-form-field",14),o.TgZ(20,"input",15),o.NdJ("ngModelChange",function(e){return t.expiry=e}),o.qZA(),o.TgZ(21,"span",13),o._uU(22),o.ALo(23,"titlecase"),o.qZA(),o.qZA(),o.TgZ(24,"mat-form-field",14),o.TgZ(25,"mat-select",16),o.NdJ("selectionChange",function(e){return t.onTimeUnitChange(e)}),o.YNc(26,qe,3,4,"mat-option",17),o.qZA(),o.qZA(),o.TgZ(27,"div",18),o.TgZ(28,"mat-slide-toggle",19),o.NdJ("ngModelChange",function(e){return t.private=e}),o._uU(29,"Private Routing Hints"),o.qZA(),o.qZA(),o.YNc(30,Fe,3,2,"div",20),o.TgZ(31,"div",21),o.TgZ(32,"button",22),o.NdJ("click",function(){return t.resetData()}),o._uU(33,"Clear Field"),o.qZA(),o.TgZ(34,"button",23),o.NdJ("click",function(){o.CHM(e);const n=o.MAs(10);return t.onAddInvoice(n)}),o._uU(35,"Create Invoice"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}2&e&&(o.xp6(6),o.Q6J("mat-dialog-close",!1),o.xp6(6),o.Q6J("ngModel",t.memo),o.xp6(2),o.Q6J("ngModel",t.invoiceValue)("step",100)("min",1),o.xp6(4),o.Oqu(t.invoiceValueHint),o.xp6(2),o.Q6J("ngModel",t.expiry)("step",t.selTimeUnit===t.timeUnitEnum.SECS?300:t.selTimeUnit===t.timeUnitEnum.MINS?10:t.selTimeUnit===t.timeUnitEnum.HOURS?2:1)("min",1),o.xp6(2),o.hij(" ",o.lcZ(23,15,t.selTimeUnit)," "),o.xp6(3),o.Q6J("value",t.selTimeUnit),o.xp6(1),o.Q6J("ngForOf",t.timeUnits),o.xp6(2),o.Q6J("ngModel",t.private)("matTooltipPosition","above"),o.xp6(2),o.Q6J("ngIf",""!==t.invoiceError))},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,ye.ZT,w.dn,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Te.h,Ae.JJ,Ae.On,Ae.wV,Ae.qQ,be.q,D.R9,D.bx,we.gD,a.sg,_e.Rr,R.gM,a.O5,ve.ey,T.BN],pipes:[a.rS],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();var ke=n(1827),Ne=n(4636);function Ue(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4,5),o.TgZ(2,"mat-form-field",6),o.TgZ(3,"input",7),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().memo=t}),o.qZA(),o.qZA(),o.TgZ(4,"mat-form-field",8),o.TgZ(5,"input",9),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().invoiceValue=t})("keyup",function(){return o.CHM(e),o.oxw().onInvoiceValueChange()}),o.qZA(),o.TgZ(6,"span",10),o._uU(7," Sats "),o.qZA(),o.TgZ(8,"mat-hint"),o._uU(9),o.qZA(),o.qZA(),o.TgZ(10,"div",11),o.TgZ(11,"button",12),o.NdJ("click",function(){return o.CHM(e),o.oxw().resetData()}),o._uU(12,"Clear Field"),o.qZA(),o.TgZ(13,"button",13),o.NdJ("click",function(){o.CHM(e);const t=o.MAs(1);return o.oxw().onAddInvoice(t)}),o._uU(14,"Create Invoice"),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("ngModel",e.memo),o.xp6(2),o.Q6J("ngModel",e.invoiceValue)("step",100)("min",1),o.xp6(4),o.Oqu(e.invoiceValueHint)}}function Ie(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",14),o.TgZ(1,"button",15),o.NdJ("click",function(){return o.CHM(e),o.oxw().openCreateInvoiceModal()}),o._uU(2,"Create Invoice"),o.qZA(),o.qZA()}}function Oe(e,t){1&e&&o._UZ(0,"mat-progress-bar",46)}function Je(e,t){1&e&&(o.TgZ(0,"th",47),o._uU(1," Date Created "),o.qZA())}const De=function(e){return{"mr-0":e}};function Re(e,t){if(1&e&&o._UZ(0,"span",51),2&e){const e=o.oxw(3);o.Q6J("ngClass",o.VKq(1,De,e.screenSize===e.screenSizeEnum.XS))}}function Me(e,t){if(1&e&&o._UZ(0,"span",52),2&e){const e=o.oxw(3);o.Q6J("ngClass",o.VKq(1,De,e.screenSize===e.screenSizeEnum.XS))}}function Ee(e,t){if(1&e&&(o.TgZ(0,"td",48),o.YNc(1,Re,1,3,"span",49),o.YNc(2,Me,1,3,"span",50),o._uU(3),o.ALo(4,"date"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Q6J("ngIf",e.settled),o.xp6(1),o.Q6J("ngIf",!e.settled),o.xp6(1),o.hij(" ",o.xi3(4,3,1e3*e.creation_date,"dd/MMM/YYYY HH:mm"),"")}}function Qe(e,t){1&e&&(o.TgZ(0,"th",53),o._uU(1," Date Settled "),o.qZA())}function Ye(e,t){if(1&e&&(o.TgZ(0,"td",54),o._uU(1),o.ALo(2,"date"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(0!=+e.settle_date?o.xi3(2,1,1e3*+e.settle_date,"dd/MMM/YYYY HH:mm"):"-")}}function Pe(e,t){1&e&&(o.TgZ(0,"th",47),o._uU(1," Memo "),o.qZA())}const Be=function(e){return{"max-width":e}};function Ge(e,t){if(1&e&&(o.TgZ(0,"td",48),o.TgZ(1,"div",55),o.TgZ(2,"span",56),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.xp6(1),o.Q6J("ngStyle",o.VKq(2,Be,n.screenSize===n.screenSizeEnum.XS?"10rem":"22rem")),o.xp6(2),o.Oqu(e.memo)}}function He(e,t){1&e&&(o.TgZ(0,"th",57),o._uU(1," Amount (Sats) "),o.qZA())}function ze(e,t){if(1&e&&(o.TgZ(0,"td",48),o.TgZ(1,"span",58),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.value)," ")}}function Ve(e,t){1&e&&(o.TgZ(0,"th",57),o._uU(1," Amount Settled (Sats) "),o.qZA())}function We(e,t){if(1&e&&(o.TgZ(0,"td",48),o.TgZ(1,"span",58),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.amt_paid_sat)," ")}}function Xe(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",59),o.TgZ(1,"div",60),o.TgZ(2,"mat-select",61),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",62),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}const $e=function(e){return{"pl-3":e}};function je(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",63),o.TgZ(1,"div",64),o.TgZ(2,"mat-select",65),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",62),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).onInvoiceClick(t)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",62),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).onRefreshInvoice(t)}),o._uU(7,"Refresh"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.Q6J("ngClass",o.VKq(1,$e,e.screenSize!==e.screenSizeEnum.XS))}}function Ke(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No invoice available."),o.qZA())}function et(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting invoices..."),o.qZA())}function tt(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(3);o.xp6(1),o.Oqu(e.errorMessage)}}function nt(e,t){if(1&e&&(o.TgZ(0,"td",66),o.YNc(1,Ke,2,0,"p",67),o.YNc(2,et,2,0,"p",67),o.YNc(3,tt,2,1,"p",67),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchInvoices.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchInvoices.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.invoices&&e.invoices.data)||(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchInvoices.status)===e.apiCallStatusEnum.ERROR)}}const at=function(e){return{"display-none":e}};function it(e,t){if(1&e&&o._UZ(0,"tr",68),2&e){const e=o.oxw(2);o.Q6J("ngClass",o.VKq(1,at,(null==e.invoices?null:e.invoices.data)&&(null==e.invoices||null==e.invoices.data?null:e.invoices.data.length)>0))}}function st(e,t){1&e&&o._UZ(0,"tr",69)}function ot(e,t){if(1&e&&o._UZ(0,"tr",70),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("@newlyAddedRowAnimation",e.memo===n.newlyAddedInvoiceMemo&&e.value===n.newlyAddedInvoiceValue&&n.flgAnimate?"added":"notAdded")}}const lt=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},rt=function(){return["no_invoice"]};function ct(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",16),o.TgZ(1,"div",17),o.TgZ(2,"div",18),o._UZ(3,"fa-icon",19),o.TgZ(4,"span",20),o._uU(5,"Invoices History"),o.qZA(),o.qZA(),o.TgZ(6,"mat-form-field",21),o.TgZ(7,"input",22),o.NdJ("keyup",function(t){return o.CHM(e),o.oxw().applyFilter(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",23),o.YNc(9,Oe,1,0,"mat-progress-bar",24),o.TgZ(10,"table",25,26),o.ynx(12,27),o.YNc(13,Je,2,0,"th",28),o.YNc(14,Ee,5,6,"td",29),o.BQk(),o.ynx(15,30),o.YNc(16,Qe,2,0,"th",31),o.YNc(17,Ye,3,4,"td",32),o.BQk(),o.ynx(18,33),o.YNc(19,Pe,2,0,"th",28),o.YNc(20,Ge,4,4,"td",29),o.BQk(),o.ynx(21,34),o.YNc(22,He,2,0,"th",35),o.YNc(23,ze,4,3,"td",29),o.BQk(),o.ynx(24,36),o.YNc(25,Ve,2,0,"th",35),o.YNc(26,We,4,3,"td",29),o.BQk(),o.ynx(27,37),o.YNc(28,Xe,6,0,"th",38),o.YNc(29,je,8,3,"td",39),o.BQk(),o.ynx(30,40),o.YNc(31,nt,4,3,"td",41),o.BQk(),o.YNc(32,it,1,3,"tr",42),o.YNc(33,st,1,0,"tr",43),o.YNc(34,ot,1,1,"tr",44),o.qZA(),o.TgZ(35,"mat-paginator",45),o.NdJ("page",function(t){return o.CHM(e),o.oxw().onPageChange(t)}),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("icon",e.faHistory),o.xp6(6),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchInvoices.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.invoices)("ngClass",o.VKq(12,lt,""!==e.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(14,rt)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("length",e.totalInvoices)("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let ut=(()=>{class e{constructor(e,t,n,a,i,s){this.logger=e,this.store=t,this.decimalPipe=n,this.commonService=a,this.datePipe=i,this.actions=s,this.calledFrom="transactions",this.faHistory=g.qO$,this.selNode={},this.newlyAddedInvoiceMemo=null,this.newlyAddedInvoiceValue=null,this.flgAnimate=!0,this.memo="",this.invoiceValueHint="",this.displayedColumns=[],this.invoicePaymentReq="",this.invoicesData=[],this.information={},this.flgSticky=!1,this.private=!1,this.expiryStep=100,this.totalInvoices=100,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.firstOffset=-1,this.lastOffset=-1,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.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===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["creation_date","value","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["creation_date","settle_date","value","amt_paid_sat","actions"]):this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchInvoices.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchInvoices.message?JSON.stringify(this.apisCallStatus.FetchInvoices.message):this.apisCallStatus.FetchInvoices.message),this.selNode=e.nodeSettings,this.information=e.information,this.totalInvoices=e.totalInvoices,this.firstOffset=+e.invoices.first_index_offset,this.lastOffset=+e.invoices.last_index_offset,this.invoicesData=e.invoices.invoices?e.invoices.invoices:[],this.invoicesData.length>0&&this.sort&&this.paginator&&this.loadInvoicesTable(this.invoicesData),this.logger.info(e)}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,h.h)(e=>e.type===x.RP||e.type===x.JE)).subscribe(e=>{e.type===x.RP&&this.invoicesData.length>0&&this.sort&&this.paginator&&e.payload&&(this.updateInvoicesData(JSON.parse(JSON.stringify(e.payload))),this.loadInvoicesTable(this.invoicesData))})}ngAfterViewInit(){this.invoicesData.length>0&&this.loadInvoicesTable(this.invoicesData)}onAddInvoice(e){const t=this.expiry?this.expiry:3600;this.flgAnimate=!0,this.newlyAddedInvoiceMemo=this.memo,this.newlyAddedInvoiceValue=this.invoiceValue,this.store.dispatch(new x.H1({uiMessage:f.m6.ADD_INVOICE,memo:this.memo,invoiceValue:this.invoiceValue,private:this.private,expiry:t,pageSize:this.pageSize,openModal:!0})),this.resetData()}onInvoiceClick(e){this.store.dispatch(new ee.wu({data:{invoice:e,newlyAdded:!1,component:ke.v}}))}onRefreshInvoice(e){this.store.dispatch(new x.oP(e.r_hash))}updateInvoicesData(e){this.invoicesData=this.invoicesData.map(t=>t.r_hash===e.r_hash?e:t)}loadInvoicesTable(e){this.invoices=new Ze.by(e?[...e]:[]),this.invoices.sort=this.sort,this.invoices.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.invoices.filterPredicate=(e,t)=>((e.creation_date?this.datePipe.transform(new Date(1e3*e.creation_date),"dd/MMM/YYYY HH:mm").toLowerCase():"")+(e.settle_date?this.datePipe.transform(new Date(1e3*e.settle_date),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(e).toLowerCase()).includes(t),setTimeout(()=>{this.flgAnimate=!1},5e3),this.logger.info(this.invoices)}resetData(){this.memo="",this.invoiceValue=null,this.private=!1,this.expiry=null,this.invoiceValueHint=""}applyFilter(e){this.invoices.filter=e.value.trim().toLowerCase()}onPageChange(e){let t=!0,n=this.lastOffset,a=e.pageSize;0===e.pageIndex?(t=!0,n=0):e.pageIndex<e.previousPageIndex?(t=!1,n=this.lastOffset):e.pageIndex>e.previousPageIndex&&e.length>(e.pageIndex+1)*e.pageSize?(t=!0,n=this.firstOffset):e.length<=(e.pageIndex+1)*e.pageSize&&(t=!1,n=0,a=e.length-e.pageIndex*e.pageSize),this.store.dispatch(new x._O({num_max_invoices:e.pageSize,index_offset:n,reversed:t}))}onInvoiceValueChange(){this.selNode.fiatConversion&&this.invoiceValue>99&&(this.invoiceValueHint="",this.commonService.convertCurrency(this.invoiceValue,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[2])).subscribe({next:e=>{this.invoiceValueHint="= "+e.symbol+this.decimalPipe.transform(e.OTHER,f.Xz.OTHER)+" "+e.unit},error:e=>{this.invoiceValueHint="Conversion Error: "+e}}))}onDownloadCSV(){this.invoices.data&&this.invoices.data.length>0&&this.commonService.downloadFile(this.invoices.data,"Invoices")}openCreateInvoiceModal(){this.store.dispatch(new ee.wu({data:{pageSize:this.pageSize,component:Le}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(a.JJ),o.Y36(C.v),o.Y36(a.uU),o.Y36(A.eX))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-lightning-invoices"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},inputs:{calledFrom:"calledFrom"},features:[o._Bn([{provide:fe.ye,useValue:(0,f.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,"keyup"],["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","","class","row-invoices",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","Settled","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["class","dot yellow","matTooltip","Unsettled","matTooltipPosition","right",3,"ngClass",4,"ngIf"],["matTooltip","Settled","matTooltipPosition","right",1,"dot","green",3,"ngClass"],["matTooltip","Unsettled","matTooltipPosition","right",1,"dot","yellow",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","",1,"row-invoices"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,Ue,15,5,"form",1),o.YNc(2,Ie,3,0,"div",2),o.YNc(3,ct,36,15,"div",3),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngIf","home"===t.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===t.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===t.calledFrom))},directives:[l.xw,l.yH,l.Wh,a.O5,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Ae.JJ,Ae.On,Ae.wV,Ae.qQ,be.q,D.R9,D.bx,q.lW,T.BN,E.$V,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,R.gM,a.PC,v.Zl,we.gD,we.$L,ve.ey,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.uU,a.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}"],data:{animation:[Ne.Q]}}),e})();var pt=n(9056),dt=n(3556),ht=n(5001),mt=n(84);const gt=["paymentReq"];function ft(e,t){if(1&e&&(o.TgZ(0,"mat-hint"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.paymentDecodedHint)}}function xt(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment request is required."),o.qZA())}function Zt(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.paymentDecodedHint)}}function yt(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment amount is required."),o.qZA())}function At(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",1),o.TgZ(1,"input",29,30),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().paymentAmount=t})("change",function(t){return o.CHM(e),o.oxw().onAmountChange(t)}),o.qZA(),o.TgZ(3,"mat-hint"),o._uU(4,"It is a zero amount invoice, enter amount to be paid."),o.qZA(),o.YNc(5,yt,2,0,"mat-error",11),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngModel",e.paymentAmount),o.xp6(4),o.Q6J("ngIf",!e.paymentAmount)}}function Ct(e,t){if(1&e&&(o.TgZ(0,"mat-option",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.hij(" ",e.name," ")}}function Tt(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("",e.selFeeLimitType.placeholder," is required.")}}function bt(e,t){if(1&e&&(o.TgZ(0,"mat-option",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.Oqu(e.remote_alias||e.chan_id)}}function wt(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Channel not found in the list."),o.qZA())}function _t(e,t){if(1&e&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.paymentError)}}function vt(e,t){if(1&e&&(o.TgZ(0,"div",32),o._UZ(1,"fa-icon",33),o.YNc(2,_t,2,1,"span",11),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==e.paymentError)}}let qt=(()=>{class e{constructor(e,t,n,a,i,s,o){this.dialogRef=e,this.store=t,this.logger=n,this.commonService=a,this.decimalPipe=i,this.actions=s,this.dataService=o,this.faExclamationTriangle=g.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 Ae.NI,this.feeLimit=null,this.selFeeLimitType=f.Vc[0],this.feeLimitTypes=f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.activeChannels=e.allChannels.filter(e=>e.active),this.filteredMinAmtActvChannels=this.activeChannels,this.filteredMinAmtActvChannels.length&&this.filteredMinAmtActvChannels.length>0?this.selectedChannelCtrl.enable():this.selectedChannelCtrl.disable(),this.logger.info(e)}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,h.h)(e=>e.type===x.JE||e.type===x.ug)).subscribe(e=>{e.type===x.ug&&this.dialogRef.close(),e.type===x.JE&&e.payload.status===f.Bn.ERROR&&"SendPayment"===e.payload.action&&(delete this.paymentDecoded.num_satoshis,this.paymentError=e.payload.message)});let e="",t="";this.activeChannels=this.activeChannels.sort((n,a)=>(e=n.remote_alias?n.remote_alias.toLowerCase():n.chan_id?n.chan_id.toLowerCase():"",t=a.remote_alias?a.remote_alias.toLowerCase():a.chan_id?a.chan_id.toLowerCase():"",e<t?-1:e>t?1:0)),this.selectedChannelCtrl.valueChanges.pipe((0,d.R)(this.unSubs[2])).subscribe(e=>{"string"==typeof e&&(this.filteredMinAmtActvChannels=this.filterChannels())})}filterChannels(){return this.activeChannels.filter(e=>0===(e.remote_alias?e.remote_alias.toLowerCase():e.chan_id?e.chan_id.toLowerCase():"").indexOf(this.selectedChannelCtrl.value?this.selectedChannelCtrl.value.toLowerCase():"")&&e.local_balance>=+(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0))}displayFn(e){return e&&e.remote_alias?e.remote_alias:e&&e.chan_id?e.chan_id:""}onSelectedChannelChanged(){if(this.selectedChannelCtrl.value&&this.selectedChannelCtrl.value.length>0&&"string"==typeof this.selectedChannelCtrl.value){const e=this.activeChannels.filter(e=>{const t=e.remote_alias?e.remote_alias.toLowerCase():e.chan_id?e.chan_id.toLowerCase():"";return t.length===this.selectedChannelCtrl.value.length&&0===t.indexOf(this.selectedChannelCtrl.value?this.selectedChannelCtrl.value.toLowerCase():"")});e&&e.length>0?(this.selectedChannelCtrl.setValue(e[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(){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(new x.Ar({uiMessage:f.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,outgoingChannel:this.selectedChannelCtrl.value,feeLimitType:{id:this.selFeeLimitType.id,name:this.selFeeLimitType.name},feeLimit:this.feeLimit,fromDialog:!0}))):(this.zeroAmtInvoice=!0,this.paymentDecoded.num_satoshis=this.paymentAmount,this.store.dispatch(new x.Ar({uiMessage:f.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,paymentAmount:this.paymentAmount,outgoingChannel:this.selectedChannelCtrl.value,feeLimitType:{id:this.selFeeLimitType.id,name:this.selFeeLimitType.name},feeLimit:this.feeLimit,fromDialog:!0})))}onAmountChange(e){delete this.paymentDecoded.num_satoshis}onPaymentRequestEntry(e){this.paymentRequest=e,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,pt.q)(1)).subscribe({next:e=>{this.paymentDecoded=e,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,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[4])).subscribe({next:e=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis)+" Sats ("+e.symbol+" "+this.decimalPipe.transform(e.OTHER?e.OTHER:0,f.Xz.OTHER)+") | Memo: "+(this.paymentDecoded.description?this.paymentDecoded.description:"None")},error:e=>{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:e=>{this.logger.error(e),this.paymentDecodedHint="ERROR: "+e.message,this.paymentReq.control.setErrors({decodeError:!0})}}))}onAdvancedPanelToggle(e,t){if(e&&!t){const e=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)+(""!==e?" | First Outgoing Channel: "+e:"")}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=f.Vc[0],this.advancedTitle="Advanced Options",this.zeroAmtInvoice=!1,this.paymentReq.control.setErrors(null),this.paymentError="",this.paymentDecodedHint=""}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(y.yh),o.Y36(Z.mQ),o.Y36(C.v),o.Y36(a.JJ),o.Y36(A.eX),o.Y36(dt.D))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-lightning-send-payments"]],viewQuery:function(e,t){if(1&e&&o.Gf(gt,5),2&e){let e;o.iGM(e=o.CRH())&&(t.paymentReq=e.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","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-stroked-button","","color","primary","tabindex","2","type","reset",1,"mr-1",3,"click"],["mat-flat-button","","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(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Send Payment"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.TgZ(11,"mat-form-field",1),o.TgZ(12,"textarea",9,10),o.NdJ("ngModelChange",function(e){return t.onPaymentRequestEntry(e)})("matTextareaAutosize",function(){return!0}),o.qZA(),o.YNc(14,ft,2,1,"mat-hint",11),o.YNc(15,xt,2,0,"mat-error",11),o.YNc(16,Zt,2,1,"mat-error",11),o.qZA(),o.YNc(17,At,6,2,"mat-form-field",12),o.TgZ(18,"mat-expansion-panel",13),o.NdJ("closed",function(){return t.onAdvancedPanelToggle(!0,!1)})("opened",function(){return t.onAdvancedPanelToggle(!1,!1)}),o.TgZ(19,"mat-expansion-panel-header"),o.TgZ(20,"mat-panel-title"),o.TgZ(21,"span"),o._uU(22),o.qZA(),o.qZA(),o.qZA(),o.TgZ(23,"div",14),o.TgZ(24,"mat-form-field",15),o.TgZ(25,"mat-select",16),o.NdJ("valueChange",function(e){return t.selFeeLimitType=e}),o.YNc(26,Ct,2,2,"mat-option",17),o.qZA(),o.qZA(),o.TgZ(27,"mat-form-field",18),o.TgZ(28,"input",19,20),o.NdJ("ngModelChange",function(e){return t.feeLimit=e}),o.qZA(),o.YNc(30,Tt,2,1,"mat-error",11),o.qZA(),o.TgZ(31,"mat-form-field",21),o._UZ(32,"input",22),o.TgZ(33,"mat-autocomplete",23,24),o.NdJ("optionSelected",function(){return t.onSelectedChannelChanged()}),o.YNc(35,bt,2,2,"mat-option",17),o.qZA(),o.YNc(36,wt,2,0,"mat-error",11),o.qZA(),o.qZA(),o.qZA(),o.YNc(37,vt,3,2,"div",25),o.TgZ(38,"div",26),o.TgZ(39,"button",27),o.NdJ("click",function(){return t.resetData()}),o._uU(40,"Clear Fields"),o.qZA(),o.TgZ(41,"button",28),o.NdJ("click",function(){return t.onSendPayment()}),o._uU(42,"Send Payment"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.MAs(13),n=o.MAs(34);o.xp6(6),o.Q6J("mat-dialog-close",!1),o.xp6(6),o.Q6J("ngModel",t.paymentRequest),o.xp6(2),o.Q6J("ngIf",t.paymentRequest&&""!==t.paymentDecodedHint),o.xp6(1),o.Q6J("ngIf",!t.paymentRequest),o.xp6(1),o.Q6J("ngIf",null==e.errors?null:e.errors.decodeError),o.xp6(1),o.Q6J("ngIf",t.zeroAmtInvoice),o.xp6(5),o.Oqu(t.advancedTitle),o.xp6(3),o.Q6J("value",t.selFeeLimitType),o.xp6(1),o.Q6J("ngForOf",t.feeLimitTypes),o.xp6(2),o.Q6J("ngModel",t.feeLimit)("placeholder",t.selFeeLimitType.placeholder)("step",1)("min",0)("disabled",t.selFeeLimitType===t.feeLimitTypes[0]),o.xp6(2),o.Q6J("ngIf",t.selFeeLimitType!==t.feeLimitTypes[0]&&!t.feeLimit),o.xp6(2),o.Q6J("formControl",t.selectedChannelCtrl)("matAutocomplete",n),o.xp6(1),o.Q6J("displayWith",t.displayFn),o.xp6(2),o.Q6J("ngForOf",t.filteredMinAmtActvChannels),o.xp6(1),o.Q6J("ngIf",null==t.selectedChannelCtrl.errors?null:t.selectedChannelCtrl.errors.notfound),o.xp6(1),o.Q6J("ngIf",""!==t.paymentError)}},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,ye.ZT,w.dn,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Ce.D7,Te.h,Ae.Q7,Ae.JJ,Ae.On,a.O5,ht.ib,ht.yz,ht.yK,we.gD,a.sg,Ae.wV,Ae.qQ,be.q,mt.ZL,Ae.oH,mt.XC,D.bx,D.TO,ve.ey,T.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}"]}),e})();var St=n(8914),Ft=n(8248);const Lt=["sendPaymentForm"];function kt(e,t){if(1&e&&(o.TgZ(0,"mat-hint"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.paymentDecodedHint)}}function Nt(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Payment request is required."),o.qZA())}function Ut(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",4,5),o.TgZ(2,"mat-form-field",6),o.TgZ(3,"textarea",7,8),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().onPaymentRequestEntry(t)})("matTextareaAutosize",function(){return!0}),o.qZA(),o.YNc(5,kt,2,1,"mat-hint",9),o.YNc(6,Nt,2,0,"mat-error",9),o.qZA(),o.TgZ(7,"div",10),o.TgZ(8,"button",11),o.NdJ("click",function(){return o.CHM(e),o.oxw().resetData()}),o._uU(9,"Clear Field"),o.qZA(),o.TgZ(10,"button",12),o.NdJ("click",function(){return o.CHM(e),o.oxw().onSendPayment()}),o._uU(11,"Send Payment"),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("ngModel",e.paymentRequest),o.xp6(2),o.Q6J("ngIf",e.paymentRequest&&""!==e.paymentDecodedHint),o.xp6(1),o.Q6J("ngIf",!e.paymentRequest)}}function It(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",13),o.TgZ(1,"button",14),o.NdJ("click",function(){return o.CHM(e),o.oxw().openSendPaymentModal()}),o._uU(2,"Send Payment"),o.qZA(),o.qZA()}}function Ot(e,t){1&e&&o._UZ(0,"mat-progress-bar",53)}function Jt(e,t){1&e&&(o.TgZ(0,"th",54),o._uU(1,"Creation Date"),o.qZA())}const Dt=function(e){return{"mr-0":e}};function Rt(e,t){if(1&e&&o._UZ(0,"span",58),2&e){const e=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Dt,e.screenSize===e.screenSizeEnum.XS))}}function Mt(e,t){if(1&e&&o._UZ(0,"span",59),2&e){const e=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Dt,e.screenSize===e.screenSizeEnum.XS))}}function Et(e,t){if(1&e&&(o.TgZ(0,"td",55),o.YNc(1,Rt,1,3,"span",56),o.YNc(2,Mt,1,3,"span",57),o._uU(3),o.ALo(4,"date"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Q6J("ngIf","SUCCEEDED"===e.status),o.xp6(1),o.Q6J("ngIf","SUCCEEDED"!==e.status),o.xp6(1),o.hij(" ",o.xi3(4,3,1e3*(null==e?null:e.creation_date),"dd/MMM/YYYY HH:mm")," ")}}function Qt(e,t){1&e&&(o.TgZ(0,"th",54),o._uU(1,"Payment Hash"),o.qZA())}const Yt=function(e){return{"max-width":e}};function Pt(e,t){if(1&e&&(o.TgZ(0,"td",60),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,Yt,n.screenSize===n.screenSizeEnum.XS?"10rem":"35rem")),o.xp6(1),o.Oqu(null==e?null:e.payment_hash)}}function Bt(e,t){1&e&&(o.TgZ(0,"th",61),o._uU(1,"Fee (Sats)"),o.qZA())}function Gt(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",62),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,null==e?null:e.fee))}}function Ht(e,t){1&e&&(o.TgZ(0,"th",61),o._uU(1,"Value (Sats)"),o.qZA())}function zt(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",62),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,null==e?null:e.value))}}function Vt(e,t){1&e&&(o.TgZ(0,"th",61),o._uU(1,"#Hops"),o.qZA())}function Wt(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",62),o._uU(2),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu((null==e||null==e.htlcs[0]||null==e.htlcs[0].route||null==e.htlcs[0].route.hops?null:e.htlcs[0].route.hops.length)||0)}}function Xt(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",63),o.TgZ(1,"div",64),o.TgZ(2,"mat-select",65),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",66),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function $t(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",67),o.TgZ(1,"button",68),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).onPaymentClick(t)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function jt(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No payment available."),o.qZA())}function Kt(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting payments..."),o.qZA())}function en(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(3);o.xp6(1),o.Oqu(e.errorMessage)}}function tn(e,t){if(1&e&&(o.TgZ(0,"td",69),o.YNc(1,jt,2,0,"p",9),o.YNc(2,Kt,2,0,"p",9),o.YNc(3,en,2,1,"p",9),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPayments.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPayments.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.payments&&e.payments.data)||(null==e.payments||null==e.payments.data?null:e.payments.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPayments.status)===e.apiCallStatusEnum.ERROR)}}function nn(e,t){if(1&e&&o._UZ(0,"span",58),2&e){const e=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Dt,e.screenSize===e.screenSizeEnum.XS))}}function an(e,t){if(1&e&&o._UZ(0,"span",59),2&e){const e=o.oxw(3);o.Q6J("ngClass",o.VKq(1,Dt,e.screenSize===e.screenSizeEnum.XS))}}function sn(e,t){if(1&e&&o._UZ(0,"span",58),2&e){const e=o.oxw(5);o.Q6J("ngClass",o.VKq(1,Dt,e.screenSize===e.screenSizeEnum.XS))}}function on(e,t){if(1&e&&o._UZ(0,"span",59),2&e){const e=o.oxw(5);o.Q6J("ngClass",o.VKq(1,Dt,e.screenSize===e.screenSizeEnum.XS))}}function ln(e,t){if(1&e&&(o.TgZ(0,"span",72),o.YNc(1,sn,1,3,"span",56),o.YNc(2,on,1,3,"span",57),o._uU(3),o.ALo(4,"date"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Q6J("ngIf","SUCCEEDED"===e.status),o.xp6(1),o.Q6J("ngIf","SUCCEEDED"!==e.status),o.xp6(1),o.hij(" ",o.xi3(4,3,1e3*e.attempt_time,"dd/MMM/YYYY HH:mm")," ")}}function rn(e,t){if(1&e&&(o.ynx(0),o.YNc(1,ln,5,6,"span",71),o.BQk()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.htlcs)}}function cn(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",70),o.YNc(2,nn,1,3,"span",56),o.YNc(3,an,1,3,"span",57),o._uU(4),o.qZA(),o.YNc(5,rn,2,1,"ng-container",9),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Q6J("ngIf","SUCCEEDED"===e.status),o.xp6(1),o.Q6J("ngIf","SUCCEEDED"!==e.status),o.xp6(1),o.hij(" Total Attempts: ",null==e||null==e.htlcs?null:e.htlcs.length," "),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function un(e,t){if(1&e&&(o.TgZ(0,"span",70),o._uU(1),o.qZA()),2&e){const e=t.index;o.xp6(1),o.hij(" HTLC ",e+1," ")}}function pn(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,un,2,1,"span",73),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.htlcs)}}function dn(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",70),o._uU(2),o.qZA(),o.YNc(3,pn,2,1,"span",9),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(null==e?null:e.payment_hash),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function hn(e,t){if(1&e&&(o.TgZ(0,"span",74),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",o.xi3(2,1,null==e.route?null:e.route.total_fees,"1.0-0")," ")}}function mn(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,hn,3,4,"span",75),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.htlcs)}}function gn(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",74),o._uU(2),o.ALo(3,"number"),o.qZA(),o.YNc(4,mn,2,1,"span",9),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.xi3(3,2,null==e?null:e.fee,"1.0-0")),o.xp6(2),o.Q6J("ngIf",e.is_expanded)}}function fn(e,t){if(1&e&&(o.TgZ(0,"span",74),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",o.xi3(2,1,null==e.route?null:e.route.total_amt,"1.0-0")," ")}}function xn(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,fn,3,4,"span",75),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.htlcs)}}function Zn(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",74),o._uU(2),o.ALo(3,"number"),o.qZA(),o.YNc(4,xn,2,1,"span",9),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.xi3(3,2,null==e?null:e.value,"1.0-0")),o.xp6(2),o.Q6J("ngIf",e.is_expanded)}}function yn(e,t){if(1&e&&(o.TgZ(0,"span",74),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",o.xi3(2,1,(null==e.route||null==e.route.hops?null:e.route.hops.length)||0,"1.0-0")," ")}}function An(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,yn,3,4,"span",75),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.htlcs)}}function Cn(e,t){if(1&e&&(o.TgZ(0,"td",55),o.TgZ(1,"span",74),o._uU(2,"-"),o.qZA(),o.YNc(3,An,2,1,"span",9),o.qZA()),2&e){const e=t.$implicit;o.xp6(3),o.Q6J("ngIf",e.is_expanded)}}function Tn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",62),o.TgZ(1,"button",79),o.NdJ("click",function(){const t=o.CHM(e).$implicit,n=o.oxw(2).$implicit;return o.oxw(2).onHTLCClick(t,n)}),o._uU(2),o.qZA(),o.qZA()}if(2&e){const e=t.index;o.xp6(2),o.hij("View ",e+1,"")}}function bn(e,t){if(1&e&&(o.TgZ(0,"div"),o.YNc(1,Tn,3,1,"div",78),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.htlcs)}}function wn(e,t){if(1&e&&(o.TgZ(0,"td",76),o.TgZ(1,"span",62),o.TgZ(2,"button",77),o.NdJ("click",function(){const e=t.$implicit;return e.is_expanded=!e.is_expanded}),o._uU(3),o.qZA(),o.qZA(),o.YNc(4,bn,2,1,"div",9),o.qZA()),2&e){const e=t.$implicit;o.xp6(3),o.Oqu(e.is_expanded?"Hide":"Show"),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function _n(e,t){if(1&e&&o._UZ(0,"tr",80),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("@newlyAddedRowAnimation",e.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const vn=function(e){return{"display-none":e}};function qn(e,t){if(1&e&&o._UZ(0,"tr",81),2&e){const e=o.oxw(2);o.Q6J("ngClass",o.VKq(1,vn,(null==e.payments?null:e.payments.data)&&(null==e.payments||null==e.payments.data?null:e.payments.data.length)>0))}}function Sn(e,t){1&e&&o._UZ(0,"tr",82)}function Fn(e,t){if(1&e&&o._UZ(0,"tr",80),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("@newlyAddedRowAnimation",e.payment_hash===n.newlyAddedPayment&&n.flgAnimate?"added":"notAdded")}}const Ln=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},kn=function(){return["no_payment"]};function Nn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",15),o.TgZ(1,"div",16),o.TgZ(2,"div",17),o._UZ(3,"fa-icon",18),o.TgZ(4,"span",19),o._uU(5,"Payments History"),o.qZA(),o.qZA(),o.TgZ(6,"mat-form-field",20),o.TgZ(7,"input",21),o.NdJ("keyup",function(t){return o.CHM(e),o.oxw().applyFilter(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",22),o.TgZ(9,"div",23),o.YNc(10,Ot,1,0,"mat-progress-bar",24),o.TgZ(11,"table",25,26),o.ynx(13,27),o.YNc(14,Jt,2,0,"th",28),o.YNc(15,Et,5,6,"td",29),o.BQk(),o.ynx(16,30),o.YNc(17,Qt,2,0,"th",28),o.YNc(18,Pt,2,4,"td",31),o.BQk(),o.ynx(19,32),o.YNc(20,Bt,2,0,"th",33),o.YNc(21,Gt,4,3,"td",29),o.BQk(),o.ynx(22,34),o.YNc(23,Ht,2,0,"th",33),o.YNc(24,zt,4,3,"td",29),o.BQk(),o.ynx(25,35),o.YNc(26,Vt,2,0,"th",33),o.YNc(27,Wt,3,1,"td",29),o.BQk(),o.ynx(28,36),o.YNc(29,Xt,6,0,"th",37),o.YNc(30,$t,3,0,"td",38),o.BQk(),o.ynx(31,39),o.YNc(32,tn,4,3,"td",40),o.BQk(),o.ynx(33,41),o.YNc(34,cn,6,4,"td",29),o.BQk(),o.ynx(35,42),o.YNc(36,dn,4,2,"td",29),o.BQk(),o.ynx(37,43),o.YNc(38,gn,5,5,"td",29),o.BQk(),o.ynx(39,44),o.YNc(40,Zn,5,5,"td",29),o.BQk(),o.ynx(41,45),o.YNc(42,Cn,4,1,"td",29),o.BQk(),o.ynx(43,46),o.YNc(44,wn,5,2,"td",47),o.BQk(),o.YNc(45,_n,1,1,"tr",48),o.YNc(46,qn,1,3,"tr",49),o.YNc(47,Sn,1,0,"tr",50),o.YNc(48,Fn,1,1,"tr",51),o.qZA(),o.TgZ(49,"mat-paginator",52),o.NdJ("page",function(t){return o.CHM(e),o.oxw().onPageChange(t)}),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("icon",e.faHistory),o.xp6(7),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.FetchPayments.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.payments)("ngClass",o.VKq(14,Ln,""!==e.errorMessage)),o.xp6(34),o.Q6J("matRowDefColumns",e.htlcColumns)("matRowDefWhen",e.is_group),o.xp6(1),o.Q6J("matFooterRowDef",o.DdM(16,kn)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("length",e.totalPayments)("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Un=(()=>{class e{constructor(e,t,n,a,i,s,o,l){this.logger=e,this.commonService=t,this.dataService=n,this.store=a,this.rtlEffects=i,this.lndEffects=s,this.decimalPipe=o,this.datePipe=l,this.calledFrom="transactions",this.faHistory=g.qO$,this.newlyAddedPayment="",this.flgAnimate=!0,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.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.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===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["creation_date","fee","actions"],this.htlcColumns=["groupTotal","groupFee","groupAction"]):this.screenSize===f.cu.SM||this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchPayments.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPayments.message?JSON.stringify(this.apisCallStatus.FetchPayments.message):this.apisCallStatus.FetchPayments.message),this.information=e.information,this.selNode=e.nodeSettings,this.peers=e.peers,this.paymentJSONArr=e.payments&&e.payments.payments&&e.payments.payments.length>0?e.payments.payments:[],this.totalPayments=e.allLightningTransactions.paymentsAll&&e.allLightningTransactions.paymentsAll.payments&&e.allLightningTransactions.paymentsAll.payments.length?e.allLightningTransactions.paymentsAll.payments.length:0,this.firstOffset=+e.payments.first_index_offset,this.lastOffset=+e.payments.last_index_offset,this.paymentJSONArr&&this.paymentJSONArr.length>0&&this.sort&&this.paginator?this.loadPaymentsTable(this.paymentJSONArr):this.paymentJSONArr&&0===this.paymentJSONArr.length&&(this.payments=new Ze.by([])),setTimeout(()=>{this.flgAnimate=!1},3e3),this.logger.info(e)})}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,pt.q)(1)).subscribe(e=>{this.paymentDecoded=e,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.flgAnimate=!0,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(new ee.b_({data:{type:f.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:f.Gi.DATE_TIME},{key:"num_satoshis",value:this.paymentDecoded.num_satoshis,title:"Amount (Sats)",width:50,type:f.Gi.NUMBER}],[{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:50,type:f.Gi.NUMBER},{key:"cltv_expiry",value:this.paymentDecoded.cltv_expiry,title:"CLTV Expiry",width:50}]]}})),this.rtlEffects.closeConfirm.pipe((0,pt.q)(1)).subscribe(e=>{e&&(this.store.dispatch(new x.Ar({uiMessage:f.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,fromDialog:!1})),this.resetData())})):(this.store.dispatch(new ee.b_({data:{type:f.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:f.Gi.DATE_TIME},{key:"expiry",value:this.paymentDecoded.expiry,title:"Expiry",width:30,type:f.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:f.Gi.NUMBER.toLowerCase(),inputValue:"",width:30}]}})),this.rtlEffects.closeConfirm.pipe((0,pt.q)(1)).subscribe(e=>{e&&(this.paymentDecoded.num_satoshis=e[0].inputValue,this.store.dispatch(new x.Ar({uiMessage:f.m6.SEND_PAYMENT,paymentReq:this.paymentRequest,paymentAmount:e[0].inputValue,fromDialog:!1})),this.resetData())}))}openSendPaymentModal(){this.store.dispatch(new ee.wu({data:{component:qt}}))}onPaymentRequestEntry(e){this.paymentRequest=e,this.paymentDecodedHint="",this.paymentRequest&&this.paymentRequest.length>100&&this.dataService.decodePayment(this.paymentRequest,!1).pipe((0,pt.q)(1)).subscribe(e=>{this.paymentDecoded=e,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,f.NT.SATS,f.NT.OTHER,this.selNode.currencyUnits[2],this.selNode.fiatConversion).pipe((0,d.R)(this.unSubs[2])).subscribe({next:e=>{this.paymentDecodedHint="Sending: "+this.decimalPipe.transform(this.paymentDecoded.num_satoshis?this.paymentDecoded.num_satoshis:0)+" Sats ("+e.symbol+this.decimalPipe.transform(e.OTHER?e.OTHER:0,f.Xz.OTHER)+") | Memo: "+this.paymentDecoded.description},error:e=>{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(e){let t=!0,n=this.lastOffset,a=e.pageSize;0===e.pageIndex?(t=!0,n=0):e.pageIndex<e.previousPageIndex?(t=!1,n=this.lastOffset):e.pageIndex>e.previousPageIndex&&e.length>(e.pageIndex+1)*e.pageSize?(t=!0,n=this.firstOffset):e.length<=(e.pageIndex+1)*e.pageSize&&(t=!1,n=0,a=e.length-e.pageIndex*e.pageSize),this.store.dispatch(new x.xt({max_payments:a,index_offset:n,reversed:t}))}is_group(e,t){return t.htlcs&&t.htlcs.length>1}resetData(){this.paymentDecoded={},this.paymentRequest="",this.form.resetForm()}getHopDetails(e){const t=this;return e.reduce((e,n)=>{const a=t.peers.find(e=>e.pub_key===n.pub_key);return a&&a.alias?e.push("<pre>Channel: "+a.alias.padEnd(20)+"&Tab;&Tab;&Tab;Amount (Sats): "+t.decimalPipe.transform(n.amt_to_forward)+"</pre>"):t.dataService.getAliasesFromPubkeys(n.pub_key,!1).pipe((0,d.R)(t.unSubs[1])).subscribe(a=>{e.push("<pre>Channel: "+(a.node&&a.node.alias?a.node.alias.padEnd(20):n.pub_key.substring(0,17)+"...")+"&Tab;&Tab;&Tab;Amount (Sats): "+t.decimalPipe.transform(n.amt_to_forward)+"</pre>")}),e},[])}onHTLCClick(e,t){t.payment_request&&""!==t.payment_request.trim()?this.dataService.decodePayment(t.payment_request,!1).pipe((0,pt.q)(1)).subscribe({next:n=>{this.showHTLCView(e,t,n)},error:n=>{this.showHTLCView(e,t,null)}}):this.showHTLCView(e,t,null)}showHTLCView(e,t,n){const a=[[{key:"payment_hash",value:t.payment_hash,title:"Payment Hash",width:100,type:f.Gi.STRING}],[{key:"preimage",value:e.preimage,title:"Preimage",width:100,type:f.Gi.STRING}],[{key:"payment_request",value:t.payment_request,title:"Payment Request",width:100,type:f.Gi.STRING}],[{key:"status",value:e.status,title:"Status",width:33,type:f.Gi.STRING},{key:"attempt_time_ns",value:+e.attempt_time_ns/1e9,title:"Attempt Time",width:33,type:f.Gi.DATE_TIME},{key:"resolve_time_ns",value:+e.resolve_time_ns/1e9,title:"Resolve Time",width:34,type:f.Gi.DATE_TIME}],[{key:"total_amt",value:e.route.total_amt,title:"Amount (Sats)",width:33,type:f.Gi.NUMBER},{key:"total_fees",value:e.route.total_fees,title:"Fee (Sats)",width:33,type:f.Gi.NUMBER},{key:"total_time_lock",value:e.route.total_time_lock,title:"Total Time Lock",width:34,type:f.Gi.NUMBER}],[{key:"hops",value:this.getHopDetails(e.route.hops),title:"Hops",width:100,type:f.Gi.ARRAY}]];n&&n.description&&""!==n.description&&a.splice(3,0,[{key:"description",value:n.description,title:"Description",width:100,type:f.Gi.STRING}]),this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"HTLC Information",message:a,scrollable:e.route&&e.route.hops&&e.route.hops.length>1}}))}onPaymentClick(e){if(e.htlcs&&e.htlcs[0]&&e.htlcs[0].route&&e.htlcs[0].route.hops&&e.htlcs[0].route.hops.length>0){const t=e.htlcs[0].route.hops.reduce((e,t)=>""===e?t.pub_key:e+","+t.pub_key,"");this.dataService.getAliasesFromPubkeys(t,!0).pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{this.showPaymentView(e,t.reduce((e,t)=>""===e?t:e+"\n"+t,""))})}else this.showPaymentView(e,"")}showPaymentView(e,t){const n=[[{key:"payment_hash",value:e.payment_hash,title:"Payment Hash",width:100,type:f.Gi.STRING}],[{key:"payment_preimage",value:e.payment_preimage,title:"Payment Preimage",width:100,type:f.Gi.STRING}],[{key:"payment_request",value:e.payment_request,title:"Payment Request",width:100,type:f.Gi.STRING}],[{key:"status",value:e.status,title:"Status",width:50,type:f.Gi.STRING},{key:"creation_date",value:e.creation_date,title:"Creation Date",width:50,type:f.Gi.DATE_TIME}],[{key:"value_msat",value:e.value_msat,title:"Value (mSats)",width:50,type:f.Gi.NUMBER},{key:"fee_msat",value:e.fee_msat,title:"Fee (mSats)",width:50,type:f.Gi.NUMBER}],[{key:"path",value:t,title:"Path",width:100,type:f.Gi.STRING}]];e.payment_request&&""!==e.payment_request.trim()?this.dataService.decodePayment(e.payment_request,!1).pipe((0,pt.q)(1)).subscribe(t=>{t&&t.description&&""!==t.description&&n.splice(3,0,[{key:"description",value:t.description,title:"Description",width:100,type:f.Gi.STRING}]),this.openPaymentAlert(n,e.htlcs&&e.htlcs[0]&&e.htlcs[0].route&&e.htlcs[0].route.hops&&e.htlcs[0].route.hops.length>1)}):this.openPaymentAlert(n,!1)}openPaymentAlert(e,t){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Payment Information",message:e,scrollable:t}}))}applyFilter(e){this.payments.filter=e.value.trim().toLowerCase()}loadPaymentsTable(e){this.payments=new Ze.by(e?[...e]:[]),this.payments.sortingDataAccessor=(e,t)=>{switch(t){case"hops":return e.htlcs.length&&e.htlcs[0]&&e.htlcs[0].route&&e.htlcs[0].route.hops&&e.htlcs[0].route.hops.length?e.htlcs[0].route.hops.length:0;default:return e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}},this.payments.sort=this.sort,this.payments.filterPredicate=(e,t)=>((e.creation_date?this.datePipe.transform(new Date(1e3*e.creation_date),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(e).toLowerCase()).includes(t)}onDownloadCSV(){if(this.payments.data&&this.payments.data.length>0){const e=JSON.parse(JSON.stringify(this.payments.data)),t=e.reduce((e,t)=>(t.payment_request&&""!==t.payment_request.trim()&&(e=""===e?t.payment_request:e+","+t.payment_request),e),"");this.dataService.decodePayments(t).pipe((0,d.R)(this.unSubs[4])).subscribe(t=>{let n=0;t.forEach((t,a)=>{for(;e[a+n].payment_hash!==t.payment_hash;)n+=1;e[a+n].description=t.description});const a=e.reduce((e,t)=>e.concat(t),[]);this.commonService.downloadFile(a,"Payments")})}}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(dt.D),o.Y36(y.yh),o.Y36(St.V),o.Y36(Ft.l),o.Y36(a.JJ),o.Y36(a.uU))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-lightning-payments"]],viewQuery:function(e,t){if(1&e&&(o.Gf(Lt,5),o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.form=e.first),o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},inputs:{calledFrom:"calledFrom"},features:[o._Bn([{provide:fe.ye,useValue:(0,f.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,"keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","creation_date"],["mat-header-cell","","mat-sort-header","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","payment_hash"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["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"],["mat-cell","",3,"ngStyle"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,Ut,12,3,"form",1),o.YNc(2,It,3,0,"div",2),o.YNc(3,Nn,50,17,"div",3),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngIf","home"===t.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===t.calledFrom),o.xp6(1),o.Q6J("ngIf","transactions"===t.calledFrom))},directives:[l.xw,l.yH,l.Wh,a.O5,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Ce.D7,Ae.Q7,E.$V,Ae.JJ,Ae.On,q.lW,D.bx,D.TO,T.BN,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.nj,Ze.Ke,Ze.as,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,R.gM,a.PC,v.Zl,we.gD,we.$L,ve.ey,Ze.yh,a.sg,Ze.Gk,Ze.Q2,Ze.XQ],pipes:[a.uU,a.JJ],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}.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}.mat-column-groupTotal[_ngcontent-%COMP%]{min-width:17rem}"],data:{animation:[Ne.Q]}}),e})();function In(e,t){if(1&e&&(o.TgZ(0,"button",26),o.TgZ(1,"mat-icon"),o._uU(2,"more_vert"),o.qZA(),o.qZA()),2&e){o.oxw();const e=o.MAs(11);o.Q6J("matMenuTriggerFor",e)}}function On(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(e),o.oxw(3).onNavigateTo("/lnd/reports")}),o._uU(1,"Fees Summary"),o.qZA()}}function Jn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",15),o.NdJ("click",function(){return o.CHM(e),o.oxw(3).onsortChannelsBy()}),o._uU(1),o.qZA()}if(2&e){const e=o.oxw(3);o.xp6(1),o.hij("Sort By ","Balance Score"===e.sortField?"Capacity":"Balance Score","")}}function Dn(e,t){1&e&&o._UZ(0,"mat-progress-bar",27)}function Rn(e,t){if(1&e&&o._UZ(0,"rtl-node-info",28),2&e){const e=o.oxw(3);o.Q6J("information",e.information)("showColorFieldSeparately",!1)}}function Mn(e,t){if(1&e&&o._UZ(0,"rtl-balances-info",29),2&e){const e=o.oxw(3);o.Q6J("balances",e.balances)("errorMessage",e.errorMessages[3]+" "+e.errorMessages[2])}}function En(e,t){if(1&e&&o._UZ(0,"rtl-channel-capacity-info",30),2&e){const e=o.oxw(3);o.Q6J("sortBy",e.sortField)("channelBalances",e.channelBalances)("allChannels",e.allChannelsCapacity)("errorMessage",e.errorMessages[3])}}function Qn(e,t){if(1&e&&o._UZ(0,"rtl-fee-info",31),2&e){const e=o.oxw(3);o.Q6J("fees",e.fees)("errorMessage",e.errorMessages[1])}}function Yn(e,t){if(1&e&&o._UZ(0,"rtl-channel-status-info",32),2&e){const e=o.oxw(3);o.Q6J("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[3]+" "+e.errorMessages[4])}}function Pn(e,t){1&e&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find information!"),o.qZA())}const Bn=function(e){return{"dashboard-card-content":!0,"error-border":e}};function Gn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-grid-tile",8),o.TgZ(1,"mat-card",9),o.TgZ(2,"mat-card-header"),o.TgZ(3,"mat-card-title",10),o.TgZ(4,"div"),o._UZ(5,"fa-icon",11),o.TgZ(6,"span"),o._uU(7),o.qZA(),o.qZA(),o.TgZ(8,"div"),o.YNc(9,In,3,1,"button",12),o.TgZ(10,"mat-menu",13,14),o.TgZ(12,"button",15),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw(2).onNavigateTo(t.link)}),o._uU(13),o.qZA(),o.YNc(14,On,2,0,"button",16),o.YNc(15,Jn,2,1,"button",16),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"mat-card-content",17),o.YNc(17,Dn,1,0,"mat-progress-bar",18),o.TgZ(18,"div",19),o.YNc(19,Rn,1,2,"rtl-node-info",20),o.YNc(20,Mn,1,2,"rtl-balances-info",21),o.YNc(21,En,1,4,"rtl-channel-capacity-info",22),o.YNc(22,Qn,1,2,"rtl-fee-info",23),o.YNc(23,Yn,1,2,"rtl-channel-status-info",24),o.YNc(24,Pn,2,0,"h3",25),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("colspan",e.cols)("rowspan",e.rows),o.xp6(5),o.Q6J("icon",e.icon),o.xp6(2),o.Oqu(e.title),o.xp6(2),o.Q6J("ngIf",e.link),o.xp6(4),o.hij("Go To ",e.goTo,""),o.xp6(1),o.Q6J("ngIf","fee"===e.id),o.xp6(1),o.Q6J("ngIf","capacity"===e.id),o.xp6(1),o.s9C("fxFlex","node"===e.id||"balance"===e.id?70:"fee"===e.id||"status"===e.id?78:90),o.Q6J("ngClass",o.VKq(17,Bn,"node"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"balance"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.ERROR||n.apisCallStatus.FetchBalanceBlockchain.status===n.apiCallStatusEnum.ERROR)||"capacity"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.ERROR||"fee"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.ERROR||"status"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.ERROR||(null==n.apisCallStatus?null:n.apisCallStatus.FetchPendingChannels.status)===n.apiCallStatusEnum.ERROR))),o.xp6(1),o.Q6J("ngIf","node"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||"balance"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.INITIATED||n.apisCallStatus.FetchBalanceBlockchain.status===n.apiCallStatusEnum.INITIATED)||"capacity"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.INITIATED||"fee"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.INITIATED||"status"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.INITIATED||(null==n.apisCallStatus?null:n.apisCallStatus.FetchPendingChannels.status)===n.apiCallStatusEnum.INITIATED)),o.xp6(1),o.Q6J("ngSwitch",e.id),o.xp6(1),o.Q6J("ngSwitchCase","node"),o.xp6(1),o.Q6J("ngSwitchCase","balance"),o.xp6(1),o.Q6J("ngSwitchCase","capacity"),o.xp6(1),o.Q6J("ngSwitchCase","fee"),o.xp6(1),o.Q6J("ngSwitchCase","status")}}function Hn(e,t){if(1&e&&(o.TgZ(0,"div",2),o.TgZ(1,"div",3),o._UZ(2,"fa-icon",4),o.TgZ(3,"span",5),o._uU(4),o.qZA(),o.qZA(),o.TgZ(5,"mat-grid-list",6),o.YNc(6,Gn,25,19,"mat-grid-tile",7),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Q6J("icon",(null==e.apisCallStatus?null:e.apisCallStatus.FetchInfo.status)===e.apiCallStatusEnum.ERROR?e.faFrown:e.faSmile),o.xp6(2),o.Oqu((null==e.apisCallStatus?null:e.apisCallStatus.FetchInfo.status)===e.apiCallStatusEnum.COMPLETED?"Welcome "+e.information.alias+"! Your node is up and running.":(null==e.apisCallStatus?null:e.apisCallStatus.FetchInfo.status)===e.apiCallStatusEnum.INITIATED?"Wait! Getting your node information...":"Error! Please check the server connection."),o.xp6(1),o.Q6J("rowHeight",e.operatorCardHeight),o.xp6(1),o.Q6J("ngForOf",e.operatorCards)}}function zn(e,t){if(1&e&&(o.TgZ(0,"button",26),o.TgZ(1,"mat-icon"),o._uU(2,"more_vert"),o.qZA(),o.qZA()),2&e){o.oxw();const e=o.MAs(9);o.Q6J("matMenuTriggerFor",e)}}function Vn(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-card-header"),o.TgZ(1,"mat-card-title",10),o.TgZ(2,"div"),o._UZ(3,"fa-icon",11),o.TgZ(4,"span"),o._uU(5),o.qZA(),o.qZA(),o.TgZ(6,"div"),o.YNc(7,zn,3,1,"button",12),o.TgZ(8,"mat-menu",13,42),o.TgZ(10,"button",15),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw(2).onNavigateTo(t.link)}),o._uU(11),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw().$implicit;o.xp6(3),o.Q6J("icon",e.icon),o.xp6(2),o.Oqu(e.title),o.xp6(2),o.Q6J("ngIf",e.link),o.xp6(4),o.hij("Go To ",e.goTo,"")}}function Wn(e,t){1&e&&o._UZ(0,"mat-progress-bar",27)}function Xn(e,t){if(1&e&&o._UZ(0,"rtl-node-info",43),2&e){const e=o.oxw(3);o.Q6J("information",e.information)}}function $n(e,t){if(1&e&&o._UZ(0,"rtl-balances-info",29),2&e){const e=o.oxw(3);o.Q6J("balances",e.balances)("errorMessage",e.errorMessages[3]+" "+e.errorMessages[2])}}function jn(e,t){if(1&e&&o._UZ(0,"rtl-channel-liquidity-info",44),2&e){const e=o.oxw(3);o.Q6J("direction","In")("totalLiquidity",e.totalInboundLiquidity)("allChannels",e.allInboundChannels)("errorMessage",e.errorMessages[3])}}function Kn(e,t){if(1&e&&o._UZ(0,"rtl-channel-liquidity-info",44),2&e){const e=o.oxw(3);o.Q6J("direction","Out")("totalLiquidity",e.totalOutboundLiquidity)("allChannels",e.allOutboundChannels)("errorMessage",e.errorMessages[3])}}function ea(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",26),o.TgZ(1,"mat-icon"),o._uU(2,"more_vert"),o.qZA(),o.qZA(),o.TgZ(3,"mat-menu",13,52),o.TgZ(5,"button",15),o.NdJ("click",function(){o.CHM(e);const t=o.oxw(2).$implicit;return o.oxw(2).onNavigateTo(t.link)}),o._uU(6),o.qZA(),o.TgZ(7,"button",15),o.NdJ("click",function(){return o.CHM(e),o.oxw(4).onNavigateTo("/lnd/reports/transactions")}),o._uU(8,"Transactions Summary"),o.qZA(),o.qZA()}if(2&e){const e=o.MAs(4),t=o.oxw(2).$implicit;o.Q6J("matMenuTriggerFor",e),o.xp6(6),o.hij("Go To ",t.goTo,"")}}function ta(e,t){1&e&&(o.TgZ(0,"span",45),o.TgZ(1,"mat-tab-group",46),o.TgZ(2,"mat-tab",47),o._UZ(3,"rtl-lightning-invoices",48),o.qZA(),o.TgZ(4,"mat-tab",49),o._UZ(5,"rtl-lightning-payments",48),o.qZA(),o.TgZ(6,"mat-tab",50),o.YNc(7,ea,9,2,"ng-template",51),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("calledFrom","home"),o.xp6(2),o.Q6J("calledFrom","home"),o.xp6(1),o.Q6J("disabled",!0))}function na(e,t){1&e&&(o.TgZ(0,"h3"),o._uU(1,"Error! Unable to find information!"),o.qZA())}const aa=function(e){return{"p-0":e}};function ia(e,t){if(1&e&&(o.TgZ(0,"mat-grid-tile",8),o.TgZ(1,"mat-card",35),o.YNc(2,Vn,12,4,"mat-card-header",36),o.TgZ(3,"mat-card-content",37),o.YNc(4,Wn,1,0,"mat-progress-bar",18),o.TgZ(5,"div",38),o.YNc(6,Xn,1,1,"rtl-node-info",39),o.YNc(7,$n,1,2,"rtl-balances-info",21),o.YNc(8,jn,1,4,"rtl-channel-liquidity-info",40),o.YNc(9,Kn,1,4,"rtl-channel-liquidity-info",40),o.YNc(10,ta,8,3,"span",41),o.YNc(11,na,2,0,"h3",25),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("colspan",e.cols)("rowspan",e.rows),o.xp6(1),o.Q6J("ngClass",o.VKq(13,aa,"transactions"===e.id)),o.xp6(1),o.Q6J("ngIf","transactions"!==e.id),o.xp6(1),o.s9C("fxFlex","transactions"===e.id?100:"balance"===e.id?70:90),o.Q6J("ngClass",o.VKq(15,Bn,"node"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"balance"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.ERROR||n.apisCallStatus.FetchBalanceBlockchain.status===n.apiCallStatusEnum.ERROR)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.ERROR)),o.xp6(1),o.Q6J("ngIf","node"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||"balance"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.INITIATED||n.apisCallStatus.FetchBalanceBlockchain.status===n.apiCallStatusEnum.INITIATED)||("inboundLiq"===e.id||"outboundLiq"===e.id)&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngSwitch",e.id),o.xp6(1),o.Q6J("ngSwitchCase","node"),o.xp6(1),o.Q6J("ngSwitchCase","balance"),o.xp6(1),o.Q6J("ngSwitchCase","inboundLiq"),o.xp6(1),o.Q6J("ngSwitchCase","outboundLiq"),o.xp6(1),o.Q6J("ngSwitchCase","transactions")}}function sa(e,t){if(1&e&&(o.TgZ(0,"div",33),o._UZ(1,"fa-icon",4),o.TgZ(2,"span",5),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"mat-grid-list",34),o.YNc(5,ia,12,17,"mat-grid-tile",7),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faSmile),o.xp6(2),o.hij("Welcome ",e.information.alias,"! Your node is up and running."),o.xp6(1),o.Q6J("rowHeight",e.merchantCardHeight),o.xp6(1),o.Q6J("ngForOf",e.merchantCards)}}let oa=(()=>{class e{constructor(e,t,n,a,i){switch(this.logger=e,this.store=t,this.actions=n,this.commonService=a,this.router=i,this.faSmile=m.I3,this.faFrown=m.Kf,this.faAngleDoubleDown=g.Sbq,this.faAngleDoubleUp=g.Vfw,this.faChartPie=g.OS1,this.faBolt=g.BDt,this.faServer=g.xf3,this.faNetworkWired=g.kXW,this.flgChildInfoUpdated=!1,this.userPersonaEnum=f.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=f.cu,this.errorMessages=["","","","",""],this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize){case f.cu.XS:this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:10,rows:1},{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:10,rows:1},{id:"fee",goTo:"Routing",link:"/lnd/routing",icon:this.faBolt,title:"Routing Fee",cols:10,rows:1},{id:"status",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels",cols:10,rows:1},{id:"capacity",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:6,rows:4},{id:"transactions",goTo:"Transactions",link:"/lnd/transactions",title:"",cols:6,rows:6},{id:"inboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:6,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:6,rows:8}];break;case f.cu.SM:case f.cu.MD:this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:5,rows:1},{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:5,rows:1},{id:"fee",goTo:"Routing",link:"/lnd/routing",icon:this.faBolt,title:"Routing Fee",cols:5,rows:1},{id:"status",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels",cols:5,rows:1},{id:"capacity",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:10,rows:2}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:4},{id:"transactions",goTo:"Transactions",link:"/lnd/transactions",title:"",cols:3,rows:4},{id:"inboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:3,rows:8},{id:"outboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:3,rows:8}];break;default:this.operatorCards=[{id:"node",icon:this.faServer,title:"Node Information",cols:3,rows:1},{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:3,rows:1},{id:"capacity",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels Capacity",cols:4,rows:2},{id:"fee",goTo:"Routing",link:"/lnd/routing",icon:this.faBolt,title:"Routing Fee",cols:3,rows:1},{id:"status",goTo:"Channels",link:"/lnd/connections",icon:this.faNetworkWired,title:"Channels",cols:3,rows:1}],this.merchantCards=[{id:"balance",goTo:"On-Chain",link:"/lnd/onchain",icon:this.faChartPie,title:"Balances",cols:2,rows:5},{id:"inboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleDown,title:"In-Bound Liquidity",cols:2,rows:10},{id:"outboundLiq",goTo:"Channels",link:"/lnd/connections",icon:this.faAngleDoubleUp,title:"Out-Bound Liquidity",cols:2,rows:10},{id:"transactions",goTo:"Transactions",link:"/lnd/transactions",title:"",cols:2,rows:5}]}}ngOnInit(){this.store.select("lnd").pipe((0,d.R)(this.unSubs[1])).subscribe(e=>{this.errorMessages=["","","","",""],this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchInfo.status===f.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apisCallStatus.FetchInfo.message?JSON.stringify(this.apisCallStatus.FetchInfo.message):this.apisCallStatus.FetchInfo.message),e.apisCallStatus.FetchFees.status===f.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apisCallStatus.FetchFees.message?JSON.stringify(this.apisCallStatus.FetchFees.message):this.apisCallStatus.FetchFees.message),e.apisCallStatus.FetchBalanceBlockchain.status===f.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apisCallStatus.FetchBalanceBlockchain.message?JSON.stringify(this.apisCallStatus.FetchBalanceBlockchain.message):this.apisCallStatus.FetchBalanceBlockchain.message),e.apisCallStatus.FetchAllChannels.status===f.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apisCallStatus.FetchAllChannels.message?JSON.stringify(this.apisCallStatus.FetchAllChannels.message):this.apisCallStatus.FetchAllChannels.message),e.apisCallStatus.FetchPendingChannels.status===f.Bn.ERROR&&(this.errorMessages[4]="object"==typeof this.apisCallStatus.FetchPendingChannels.message?JSON.stringify(this.apisCallStatus.FetchPendingChannels.message):this.apisCallStatus.FetchPendingChannels.message),this.selNode=e.nodeSettings,this.information=e.information,this.fees=e.fees,this.balances.onchain=+e.blockchainBalance.total_balance>=0?+e.blockchainBalance.total_balance:0;const t=e.totalLocalBalance?+e.totalLocalBalance:0,n=e.totalRemoteBalance?+e.totalRemoteBalance:0;this.channelBalances={localBalance:t,remoteBalance:n,balancedness:+(1-Math.abs((t-n)/(t+n))).toFixed(3)},this.balances.lightning=e.totalLocalBalance,this.balances.total=this.balances.lightning+this.balances.onchain,this.balances=Object.assign({},this.balances),this.activeChannels=e.numberOfActiveChannels,this.inactiveChannels=e.numberOfInactiveChannels,this.channelsStatus={active:{channels:e.numberOfActiveChannels,capacity:e.totalCapacityActive},inactive:{channels:e.numberOfInactiveChannels,capacity:e.totalCapacityInactive},pending:{channels:e.numberOfPendingChannels.open.num_channels,capacity:e.numberOfPendingChannels.open.limbo_balance},closing:{channels:e.numberOfPendingChannels.closing.num_channels+e.numberOfPendingChannels.force_closing.num_channels+e.numberOfPendingChannels.waiting_close.num_channels,capacity:e.numberOfPendingChannels.total_limbo_balance}},this.totalInboundLiquidity=0,this.totalOutboundLiquidity=0,this.allChannels=e.allChannels.filter(e=>!0===e.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(e=>e.remote_balance>0),"remote_balance"))),this.allOutboundChannels=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels.filter(e=>e.local_balance>0),"local_balance"))),this.allChannels.forEach(e=>{this.totalInboundLiquidity=this.totalInboundLiquidity+ +e.remote_balance,this.totalOutboundLiquidity=this.totalOutboundLiquidity+ +e.local_balance}),this.flgChildInfoUpdated=this.balances.lightning>=0&&this.balances.onchain>=0&&this.fees.month_fee_sum>=0,this.logger.info(e)}),this.actions.pipe((0,d.R)(this.unSubs[2]),(0,h.h)(e=>e.type===x.VS||e.type===x.HS)).subscribe(e=>{e.type===x.VS&&(this.flgChildInfoUpdated=!1),e.type===x.HS&&(this.flgChildInfoUpdated=!0)})}onNavigateTo(e){this.router.navigateByUrl(e)}onsortChannelsBy(){"Balance Score"===this.sortField?(this.sortField="Capacity",this.allChannelsCapacity=this.allChannels.sort((e,t)=>{const n=+e.local_balance+ +e.remote_balance,a=+t.local_balance+ +t.remote_balance;return n>a?-1:n<a?1:0})):(this.sortField="Balance Score",this.allChannelsCapacity=JSON.parse(JSON.stringify(this.commonService.sortDescByKey(this.allChannels,"balancedness"))))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(A.eX),o.Y36(C.v),o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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"],["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"],["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(e,t){if(1&e&&(o.YNc(0,Hn,7,4,"div",0),o.YNc(1,sa,6,4,"ng-template",null,1,o.W1O)),2&e){const e=o.MAs(2);o.Q6J("ngIf",t.selNode.userPersona===t.userPersonaEnum.OPERATOR)("ngIfElse",e)}},directives:[a.O5,l.xw,l.Wh,T.BN,b.Il,a.sg,b.DX,w.a8,l.yH,w.dk,w.n5,_.VK,_.OP,w.dn,a.mk,v.oO,a.RF,a.n9,a.ED,q.lW,_.p6,S.Hw,r.pW,U,J,H,W,j,me,E.$V,ge.SP,ge.uX,ut,Un,ge.uD],styles:[""]}),e})();var la=n(882),ra=n(1050);function ca(e,t){if(1&e&&(o.TgZ(0,"span",10),o._uU(1,"Channels"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.activeChannels)}}function ua(e,t){if(1&e&&(o.TgZ(0,"span",10),o._uU(1,"Peers"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.activePeers)}}let pa=(()=>{class e{constructor(e,t,n){this.store=e,this.logger=t,this.router=n,this.selNode={},this.activePeers=0,this.activeChannels=0,this.faUsers=g.FVb,this.faChartPie=g.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]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{this.activeLink=this.links.findIndex(t=>t.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("lnd").pipe((0,d.R)(this.unSubs[1])).subscribe(e=>{this.selNode=e.nodeSettings,this.activePeers=e.peers&&e.peers.length?e.peers.length:0,this.activeChannels=e.numberOfActiveChannels,this.balances=[{title:"Total Balance",dataValue:e.blockchainBalance.total_balance||0},{title:"Confirmed",dataValue:e.blockchainBalance.confirmed_balance},{title:"Unconfirmed",dataValue:e.blockchainBalance.unconfirmed_balance}],this.logger.info(e)})}onSelectedTabChange(e){this.router.navigateByUrl("/lnd/connections/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh),o.Y36(Z.mQ),o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"On-chain Balance"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o._UZ(7,"rtl-currency-unit-converter",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o._UZ(9,"fa-icon",1),o.TgZ(10,"span",2),o._uU(11,"Connections"),o.qZA(),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"mat-card"),o.TgZ(14,"mat-card-content",4),o.TgZ(15,"mat-tab-group",7),o.NdJ("selectedIndexChange",function(e){return t.activeLink=e})("selectedTabChange",function(e){return t.onSelectedTabChange(e)}),o.TgZ(16,"mat-tab"),o.YNc(17,ca,2,1,"ng-template",8),o.qZA(),o.TgZ(18,"mat-tab"),o.YNc(19,ua,2,1,"ng-template",8),o.qZA(),o.qZA(),o.TgZ(20,"div",9),o._UZ(21,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("icon",t.faChartPie),o.xp6(6),o.Q6J("values",t.balances),o.xp6(2),o.Q6J("icon",t.faUsers),o.xp6(6),o.Q6J("selectedIndex",t.activeLink))},directives:[l.xw,l.Wh,T.BN,w.a8,w.dn,la.D,ge.SP,ge.uX,ge.uD,l.yH,i.lC,ra.k],styles:[""]}),e})();var da=n(1258),ha=n(1681),ma=n(3474);const ga=["form"];function fa(e,t){if(1&e&&(o.TgZ(0,"mat-option",37),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.Oqu(e.alias?e.alias:e.pub_key?e.pub_key:"")}}function xa(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Peer alias is required."),o.qZA())}function Za(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Peer not found in the list."),o.qZA())}function ya(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",1),o._UZ(1,"input",34),o.TgZ(2,"mat-autocomplete",35,36),o.NdJ("optionSelected",function(){return o.CHM(e),o.oxw().onSelectedPeerChanged()}),o.YNc(4,fa,2,2,"mat-option",24),o.ALo(5,"async"),o.qZA(),o.YNc(6,xa,2,0,"mat-error",17),o.YNc(7,Za,2,0,"mat-error",17),o.qZA()}if(2&e){const e=o.MAs(3),t=o.oxw();o.xp6(1),o.Q6J("formControl",t.selectedPeer)("matAutocomplete",e),o.xp6(1),o.Q6J("displayWith",t.displayFn),o.xp6(2),o.Q6J("ngForOf",o.lcZ(5,6,t.filteredPeers)),o.xp6(2),o.Q6J("ngIf",null==t.selectedPeer.errors?null:t.selectedPeer.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.selectedPeer.errors?null:t.selectedPeer.errors.notfound)}}function Aa(e,t){1&e&&o.GkF(0)}function Ca(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Ta(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function ba(e,t){if(1&e&&(o.TgZ(0,"mat-option",37),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.id),o.xp6(1),o.hij(" ",e.name," ")}}function wa(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("","1"===e.selTransType?"Target Confirmation Blocks":"Fee"," is required.")}}function _a(e,t){if(1&e&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.channelConnectionError)}}function va(e,t){if(1&e&&(o.TgZ(0,"div",38),o._UZ(1,"fa-icon",39),o.YNc(2,_a,2,1,"span",17),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==e.channelConnectionError)}}function qa(e,t){if(1&e&&(o.TgZ(0,"mat-expansion-panel",41),o.TgZ(1,"mat-expansion-panel-header"),o.TgZ(2,"mat-panel-title"),o.TgZ(3,"span"),o._uU(4,"Peer: \xa0"),o.qZA(),o.TgZ(5,"strong",42),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",9),o.TgZ(8,"div",0),o.TgZ(9,"div",1),o.TgZ(10,"h4",43),o._uU(11,"Pubkey"),o.qZA(),o.TgZ(12,"span",44),o._uU(13),o.qZA(),o.qZA(),o.qZA(),o._UZ(14,"mat-divider",45),o.TgZ(15,"div",0),o.TgZ(16,"div",46),o.TgZ(17,"h4",43),o._uU(18,"Address"),o.qZA(),o.TgZ(19,"span",47),o._uU(20),o.qZA(),o.qZA(),o.TgZ(21,"div",46),o.TgZ(22,"h4",43),o._uU(23,"Inbound"),o.qZA(),o.TgZ(24,"span",47),o._uU(25),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw(2);o.xp6(6),o.Oqu((null==e.peer?null:e.peer.alias)||(null==e.peer?null:e.peer.address)),o.xp6(7),o.Oqu(e.peer.pub_key),o.xp6(7),o.Oqu(null==e.peer?null:e.peer.address),o.xp6(5),o.Oqu(null!=e.peer&&e.peer.inbound?"True":"False")}}function Sa(e,t){if(1&e&&o.YNc(0,qa,26,4,"mat-expansion-panel",40),2&e){const e=o.oxw();o.Q6J("ngIf",e.peer)}}let Fa=(()=>{class e{constructor(e,t,n,a){this.dialogRef=e,this.data=t,this.store=n,this.actions=a,this.selectedPeer=new Ae.NI,this.amount=new Ae.NI,this.faExclamationTriangle=g.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=f.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?this.data.message.peer:null,this.peers=this.data.message.peers&&this.data.message.peers.length?this.data.message.peers:[],this.actions.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e.type===x.JE||e.type===x.Mx)).subscribe(e=>{e.type===x.JE&&e.payload.status===f.Bn.ERROR&&"SaveNewChannel"===e.payload.action&&(this.channelConnectionError=e.payload.message),e.type===x.Mx&&this.dialogRef.close()});let e="",t="";this.sortedPeers=this.peers.sort((n,a)=>(e=n.alias?n.alias.toLowerCase():n.pub_key?n.pub_key.toLowerCase():"",t=a.alias?a.alias.toLowerCase():n.pub_key.toLowerCase(),e<t?-1:e>t?1:0)),this.filteredPeers=this.selectedPeer.valueChanges.pipe((0,d.R)(this.unSubs[1]),(0,da.O)(""),(0,ha.U)(e=>"string"==typeof e?e:e.alias?e.alias:e.pub_key),(0,ha.U)(e=>e?this.filterPeers(e):this.sortedPeers.slice()))}filterPeers(e){return this.sortedPeers.filter(t=>0===t.alias.toLowerCase().indexOf(e?e.toLowerCase():""))}displayFn(e){return e&&e.alias?e.alias:e&&e.pub_key?e.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 e=this.peers.filter(e=>e.alias.length===this.selectedPeer.value.length&&0===e.alias.toLowerCase().indexOf(this.selectedPeer.value?this.selectedPeer.value.toLowerCase():""));1===e.length&&e[0].pub_key&&(this.selectedPubkey=e[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(new x.nb({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(e){this.advancedTitle=e?"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(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(y.yh),o.Y36(A.eX))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-open-channel"]],viewQuery:function(e,t){if(1&e&&o.Gf(ga,7),2&e){let e;o.iGM(e=o.CRH())&&(t.form=e.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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["autoFocus","","mat-flat-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(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return t.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.NdJ("submit",function(){return t.onOpenChannel()})("reset",function(){return t.resetData()}),o.TgZ(11,"div",9),o.YNc(12,ya,8,8,"mat-form-field",10),o.qZA(),o.YNc(13,Aa,1,0,"ng-container",11),o.TgZ(14,"div",9),o.TgZ(15,"div",12),o.TgZ(16,"mat-form-field",13),o.TgZ(17,"input",14,15),o.NdJ("ngModelChange",function(e){return t.fundingAmount=e}),o.qZA(),o.TgZ(19,"mat-hint"),o._uU(20),o.ALo(21,"number"),o.qZA(),o.TgZ(22,"span",16),o._uU(23," Sats "),o.qZA(),o.YNc(24,Ca,2,0,"mat-error",17),o.YNc(25,Ta,2,1,"mat-error",17),o.qZA(),o.TgZ(26,"div",18),o.TgZ(27,"mat-slide-toggle",19),o.NdJ("ngModelChange",function(e){return t.isPrivate=e}),o._uU(28,"Private Channel"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(29,"mat-expansion-panel",20),o.NdJ("closed",function(){return t.onAdvancedPanelToggle(!0)})("opened",function(){return t.onAdvancedPanelToggle(!1)}),o.TgZ(30,"mat-expansion-panel-header"),o.TgZ(31,"mat-panel-title"),o.TgZ(32,"span"),o._uU(33),o.qZA(),o.qZA(),o.qZA(),o.TgZ(34,"div",21),o.TgZ(35,"div",12),o.TgZ(36,"mat-form-field",22),o.TgZ(37,"mat-select",23),o.NdJ("valueChange",function(e){return t.selTransType=e}),o.YNc(38,ba,2,2,"mat-option",24),o.qZA(),o.qZA(),o.TgZ(39,"mat-form-field",22),o.TgZ(40,"input",25,26),o.NdJ("ngModelChange",function(e){return t.transTypeValue=e}),o.qZA(),o.YNc(42,wa,2,1,"mat-error",17),o.qZA(),o.qZA(),o.TgZ(43,"div",12),o.TgZ(44,"div",27),o.TgZ(45,"mat-slide-toggle",28),o.NdJ("ngModelChange",function(e){return t.spendUnconfirmed=e}),o._uU(46,"Spend Unconfirmed Output"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(47,va,3,2,"div",29),o.TgZ(48,"div",30),o.TgZ(49,"button",31),o._uU(50,"Clear Fields"),o.qZA(),o.TgZ(51,"button",32),o._uU(52,"Open Channel"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(53,Sa,1,1,"ng-template",null,33,o.W1O)),2&e){const e=o.MAs(54);o.xp6(5),o.Oqu(t.alertTitle),o.xp6(7),o.Q6J("ngIf",!t.peer&&t.peers&&t.peers.length>0),o.xp6(1),o.Q6J("ngTemplateOutlet",e),o.xp6(4),o.Q6J("ngModel",t.fundingAmount)("step",1e3)("min",1)("max",t.totalBalance),o.xp6(3),o.hij("(Remaining Bal: ",o.lcZ(21,23,t.totalBalance-(t.fundingAmount?t.fundingAmount:0)),")"),o.xp6(4),o.Q6J("ngIf",null==t.amount.errors?null:t.amount.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.amount.errors?null:t.amount.errors.max),o.xp6(2),o.Q6J("ngModel",t.isPrivate),o.xp6(6),o.Oqu(t.advancedTitle),o.xp6(4),o.Q6J("value",t.selTransType),o.xp6(1),o.Q6J("ngForOf",t.transTypes),o.xp6(2),o.Q6J("ngModel",t.transTypeValue)("required","0"!==t.selTransType)("disabled","0"===t.selTransType)("placeholder","0"===t.selTransType?"Default":"1"===t.selTransType?"Target Confirmation Blocks":"Fee (Sats/vByte)")("step",1)("min",0),o.xp6(2),o.Q6J("ngIf","0"!==t.selTransType&&!t.transTypeValue),o.xp6(3),o.Q6J("ngModel",t.spendUnconfirmed),o.xp6(2),o.Q6J("ngIf",""!==t.channelConnectionError)}},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,w.dn,Ae._Y,Ae.JL,Ae.F,a.O5,a.tP,D.KE,Ce.Nt,Ae.wV,Ae.qQ,Ae.Fd,Ae.Fj,be.q,ma.F,Ae.Q7,Ae.JJ,Ae.On,D.bx,D.R9,_e.Rr,ht.ib,ht.yz,ht.yK,we.gD,a.sg,Te.h,mt.ZL,Ae.oH,mt.XC,ve.ey,D.TO,T.BN,M.d],pipes:[a.JJ,a.Ov],styles:[".open-inputs-box[_ngcontent-%COMP%]{padding:1.2rem 2.4rem .8rem!important}"]}),e})();var La=n(7753);const ka=["peersForm"],Na=["stepper"];function Ua(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw();o.Oqu(e.peerFormLabel)}}function Ia(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Address is required."),o.qZA())}function Oa(e,t){if(1&e&&(o.TgZ(0,"div",37),o._UZ(1,"fa-icon",38),o.TgZ(2,"span"),o._uU(3),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(2),o.Oqu(e.peerConnectionError)}}function Ja(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw();o.Oqu(e.channelFormLabel)}}function Da(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Ra(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount must be a positive number."),o.qZA())}function Ma(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("Amount must be less than or equal to ",e.totalBalance,".")}}function Ea(e,t){if(1&e&&(o.TgZ(0,"mat-option",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.id),o.xp6(1),o.hij(" ",e.name," ")}}function Qa(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("","0"===e.channelFormGroup.controls.selTransType.value?"Default":"1"===e.channelFormGroup.controls.selTransType.value?"Target Confirmation Blocks":"Fee (Sats/vByte)"," is required.")}}function Ya(e,t){if(1&e&&(o.TgZ(0,"div",37),o._UZ(1,"fa-icon",38),o.TgZ(2,"span"),o._uU(3),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(2),o.Oqu(e.channelConnectionError)}}let Pa=(()=>{class e{constructor(e,t,n,a,i,s,o){this.dialogRef=e,this.data=t,this.store=n,this.lndEffects=a,this.formBuilder=i,this.actions=s,this.logger=o,this.faExclamationTriangle=g.eHv,this.peerAddress="",this.totalBalance=0,this.transTypes=f.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:["",[Ae.kI.required]],peerAddress:["",[Ae.kI.required]]}),this.channelFormGroup=this.formBuilder.group({fundingAmount:["",[Ae.kI.required,Ae.kI.min(1),Ae.kI.max(this.totalBalance)]],isPrivate:[!1],selTransType:[f.Dr[0].id],transTypeValue:[{value:"",disabled:!0}],spendUnconfirmed:[!1],hiddenAmount:["",[Ae.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.channelFormGroup.controls.selTransType.valueChanges.pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{e===f.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([Ae.kI.required]))}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,h.h)(e=>e.type===x.X_||e.type===x.W8||e.type===x.JE)).subscribe(e=>{e.type===x.X_&&(this.logger.info(e.payload),this.flgEditable=!1,this.newlyAddedPeer=e.payload.peer,this.peerFormGroup.controls.hiddenAddress.setValue(this.peerFormGroup.controls.peerAddress.value),this.stepper.next()),e.type===x.W8&&this.dialogRef.close(),e.type===x.JE&&e.payload.status===f.Bn.ERROR&&("SaveNewPeer"===e.payload.action||"FetchGraphNode"===e.payload.action?this.peerConnectionError=e.payload.message:"SaveNewChannel"===e.payload.action&&(this.channelConnectionError=e.payload.message))})}onConnectPeer(){if(!this.peerFormGroup.controls.peerAddress.value)return!0;this.peerConnectionError="";const e=this.peerFormGroup.controls.peerAddress.value.search("@");let t="",n="";e>-1?(t=this.peerFormGroup.controls.peerAddress.value.substring(0,e),n=this.peerFormGroup.controls.peerAddress.value.substring(e+1),this.connectPeerWithParams(t,n)):(this.store.dispatch(new x.RR({pubkey:this.peerFormGroup.controls.peerAddress.value})),this.lndEffects.setGraphNode.pipe((0,pt.q)(1)).subscribe(e=>{n=e.node.addresses&&e.node.addresses.length&&e.node.addresses.length>0&&e.node.addresses[0].addr?e.node.addresses[0].addr:"",this.connectPeerWithParams(this.peerFormGroup.controls.peerAddress.value,n)}))}connectPeerWithParams(e,t){this.store.dispatch(new x.rF({pubkey:e,host:t,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(new x.nb({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(e){switch(e.selectedIndex){case 0: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)";break;default:this.peerFormLabel="Peer Details",this.channelFormLabel="Open Channel (Optional)"}e.selectedIndex<e.previouslySelectedIndex&&(0===e.selectedIndex?this.peerFormGroup.controls.hiddenAddress.setValue(""):1===e.selectedIndex&&this.channelFormGroup.controls.hiddenAmount.setValue(""))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(y.yh),o.Y36(Ft.l),o.Y36(Ae.qu),o.Y36(A.eX),o.Y36(Z.mQ))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-connect-peer"]],viewQuery:function(e,t){if(1&e&&(o.Gf(ka,5),o.Gf(Na,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.form=e.first),o.iGM(e=o.CRH())&&(t.stepper=e.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-stroked-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-stroked-button","","color","primary","tabindex","8","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Connect to a new peer"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return t.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"div",7),o.TgZ(10,"mat-vertical-stepper",8,9),o.NdJ("selectionChange",function(e){return t.stepSelectionChanged(e)}),o.TgZ(12,"mat-step",10),o.TgZ(13,"form",11),o.YNc(14,Ua,1,1,"ng-template",12),o.TgZ(15,"mat-form-field",1),o._UZ(16,"input",13),o.YNc(17,Ia,2,0,"mat-error",14),o.qZA(),o.YNc(18,Oa,4,2,"div",15),o.TgZ(19,"div",16),o.TgZ(20,"button",17),o.NdJ("click",function(){return t.onConnectPeer()}),o._uU(21),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(22,"mat-step",10),o.TgZ(23,"form",18),o.YNc(24,Ja,1,1,"ng-template",19),o.TgZ(25,"div",20),o.TgZ(26,"div",21),o.TgZ(27,"mat-form-field",22),o._UZ(28,"input",23),o.TgZ(29,"mat-hint"),o._uU(30),o.qZA(),o.TgZ(31,"span",24),o._uU(32," Sats "),o.qZA(),o.YNc(33,Da,2,0,"mat-error",14),o.YNc(34,Ra,2,0,"mat-error",14),o.YNc(35,Ma,2,1,"mat-error",14),o.qZA(),o.TgZ(36,"div",25),o.TgZ(37,"mat-slide-toggle",26),o._uU(38,"Private Channel"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(39,"div",27),o.TgZ(40,"mat-form-field",28),o.TgZ(41,"mat-select",29),o.YNc(42,Ea,2,2,"mat-option",30),o.qZA(),o.qZA(),o.TgZ(43,"mat-form-field",31),o._UZ(44,"input",32),o.YNc(45,Qa,2,1,"mat-error",14),o.qZA(),o.TgZ(46,"div",25),o.TgZ(47,"mat-slide-toggle",33),o._uU(48,"Spend Unconfirmed Output"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(49,Ya,4,2,"div",15),o.TgZ(50,"div",16),o.TgZ(51,"button",34),o.NdJ("click",function(){return t.onOpenChannel()}),o._uU(52),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(53,"div",35),o.TgZ(54,"button",36),o._uU(55),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(10),o.Q6J("linear",!0),o.xp6(2),o.Q6J("stepControl",t.peerFormGroup)("editable",t.flgEditable),o.xp6(1),o.Q6J("formGroup",t.peerFormGroup),o.xp6(4),o.Q6J("ngIf",null==t.peerFormGroup.controls.peerAddress.errors?null:t.peerFormGroup.controls.peerAddress.errors.required),o.xp6(1),o.Q6J("ngIf",""!==t.peerConnectionError),o.xp6(3),o.Oqu(""!==t.peerConnectionError?"Retry":"Add Peer"),o.xp6(1),o.Q6J("stepControl",t.channelFormGroup)("editable",t.flgEditable),o.xp6(1),o.Q6J("formGroup",t.channelFormGroup),o.xp6(5),o.Q6J("step",1e3),o.xp6(2),o.hij("Remaining Bal: ",t.totalBalance-(t.channelFormGroup.controls.fundingAmount.value?t.channelFormGroup.controls.fundingAmount.value:0),""),o.xp6(3),o.Q6J("ngIf",null==t.channelFormGroup.controls.fundingAmount.errors?null:t.channelFormGroup.controls.fundingAmount.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.channelFormGroup.controls.fundingAmount.errors?null:t.channelFormGroup.controls.fundingAmount.errors.min),o.xp6(1),o.Q6J("ngIf",null==t.channelFormGroup.controls.fundingAmount.errors?null:t.channelFormGroup.controls.fundingAmount.errors.max),o.xp6(7),o.Q6J("ngForOf",t.transTypes),o.xp6(2),o.Q6J("placeholder","0"===t.channelFormGroup.controls.selTransType.value?"Default":"1"===t.channelFormGroup.controls.selTransType.value?"Target Confirmation Blocks":"Fee (Sats/vByte)")("step",1)("required","0"!==t.channelFormGroup.controls.selTransType.value),o.xp6(1),o.Q6J("ngIf",null==t.channelFormGroup.controls.transTypeValue.errors?null:t.channelFormGroup.controls.transTypeValue.errors.required),o.xp6(4),o.Q6J("ngIf",""!==t.channelConnectionError),o.xp6(3),o.Oqu(""!==t.channelConnectionError?"Retry":"Open Channel"),o.xp6(2),o.Q6J("mat-dialog-close",!1),o.xp6(1),o.Oqu(null!=t.newlyAddedPeer&&t.newlyAddedPeer.pub_key?"Do It Later":"Close"))},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,w.dn,La.Vq,La.C0,Ae._Y,Ae.JL,Ae.sg,La.VY,D.KE,Ce.Nt,Ae.Fj,Te.h,Ae.JJ,Ae.u,Ae.Q7,a.O5,Ae.wV,D.bx,D.R9,_e.Rr,we.gD,a.sg,ye.ZT,D.TO,T.BN,ve.ey],styles:[""]}),e})();function Ba(e,t){1&e&&o._UZ(0,"mat-progress-bar",32)}function Ga(e,t){1&e&&(o.TgZ(0,"th",33),o._uU(1," Alias "),o.qZA())}const Ha=function(e){return{"max-width":e}};function za(e,t){if(1&e&&(o.TgZ(0,"td",34),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,Ha,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),o.xp6(1),o.hij(" ",null==e?null:e.alias," ")}}function Va(e,t){1&e&&(o.TgZ(0,"th",33),o._uU(1," Public Key "),o.qZA())}function Wa(e,t){if(1&e&&(o.TgZ(0,"td",34),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,Ha,n.screenSize===n.screenSizeEnum.XS?"5rem":"35rem")),o.xp6(1),o.hij(" ",null==e?null:e.pub_key," ")}}function Xa(e,t){1&e&&(o.TgZ(0,"th",35),o._uU(1," Sats Sent "),o.qZA())}function $a(e,t){if(1&e&&(o.TgZ(0,"td",36),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.sat_sent)," ")}}function ja(e,t){1&e&&(o.TgZ(0,"th",35),o._uU(1," Sats Received "),o.qZA())}function Ka(e,t){if(1&e&&(o.TgZ(0,"td",36),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.sat_recv)," ")}}function ei(e,t){1&e&&(o.TgZ(0,"th",35),o._uU(1," Ping "),o.qZA())}function ti(e,t){if(1&e&&(o.TgZ(0,"td",36),o.TgZ(1,"span",37),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.ping_time)," ")}}function ni(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",38),o.TgZ(1,"div",39),o.TgZ(2,"mat-select",40),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",41),o.NdJ("click",function(){return o.CHM(e),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function ai(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",42),o.TgZ(1,"div",39),o.TgZ(2,"mat-select",40),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",41),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw().onPeerClick(n,t)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",41),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onOpenChannel(t)}),o._uU(7,"Open Channel"),o.qZA(),o.TgZ(8,"mat-option",41),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onPeerDetach(t)}),o._uU(9,"Disconnect"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function ii(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No connected peer."),o.qZA())}function si(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting peers..."),o.qZA())}function oi(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function li(e,t){if(1&e&&(o.TgZ(0,"td",43),o.YNc(1,ii,2,0,"p",44),o.YNc(2,si,2,0,"p",44),o.YNc(3,oi,2,1,"p",44),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers.data?null:e.peers.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPeers.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers.data?null:e.peers.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPeers.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.peers&&e.peers.data)||(null==e.peers.data?null:e.peers.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPeers.status)===e.apiCallStatusEnum.ERROR)}}const ri=function(e){return{"display-none":e}};function ci(e,t){if(1&e&&o._UZ(0,"tr",45),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,ri,(null==e.peers?null:e.peers.data)&&(null==e.peers||null==e.peers.data?null:e.peers.data.length)>0))}}function ui(e,t){1&e&&o._UZ(0,"tr",46)}function pi(e,t){1&e&&o._UZ(0,"tr",47)}const di=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},hi=function(){return["no_peer"]};let mi=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.store=t,this.rtlEffects=n,this.commonService=a,this.availableBalance=0,this.faUsers=g.FVb,this.displayedColumns=[],this.peersData=[],this.information={},this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["alias","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["alias","sat_sent","sat_recv","actions"]):this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchPeers.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPeers.message?JSON.stringify(this.apisCallStatus.FetchPeers.message):this.apisCallStatus.FetchPeers.message),this.information=e.information,this.availableBalance=e.blockchainBalance.total_balance||0,this.peersData=e.peers,this.peersData.length>0&&this.loadPeersTable(this.peersData),this.logger.info(e)})}ngAfterViewInit(){this.peersData.length>0&&this.loadPeersTable(this.peersData)}onPeerClick(e,t){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Peer Information",showQRName:"Public Key",showQRField:e.pub_key,message:[[{key:"pub_key",value:e.pub_key,title:"Public Key",width:100}],[{key:"address",value:e.address,title:"Address",width:100}],[{key:"alias",value:e.alias,title:"Alias",width:40},{key:"inbound",value:e.inbound?"True":"False",title:"Inbound",width:30},{key:"ping_time",value:e.ping_time,title:"Ping Time",width:30,type:f.Gi.NUMBER}],[{key:"sat_sent",value:e.sat_sent,title:"Satoshis Sent",width:50,type:f.Gi.NUMBER},{key:"sat_recv",value:e.sat_recv,title:"Satoshis Received",width:50,type:f.Gi.NUMBER}],[{key:"bytes_sent",value:e.bytes_sent,title:"Bytes Sent",width:50,type:f.Gi.NUMBER},{key:"bytes_recv",value:e.bytes_recv,title:"Bytes Received",width:50,type:f.Gi.NUMBER}]]}}))}onConnectPeer(){this.store.dispatch(new ee.wu({data:{message:{peer:null,information:this.information,balance:this.availableBalance},component:Pa}}))}onOpenChannel(e){this.store.dispatch(new ee.wu({data:{alertTitle:"Open Channel",message:{peer:e,information:this.information,balance:this.availableBalance},component:Fa}}))}onPeerDetach(e){this.store.dispatch(new ee.b_({data:{type:f.n_.CONFIRM,alertTitle:"Disconnect Peer",titleMessage:"Disconnect peer: "+(e.alias?e.alias:e.pub_key),noBtnText:"Cancel",yesBtnText:"Disconnect"}})),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[3])).subscribe(t=>{t&&this.store.dispatch(new x.yw({pubkey:e.pub_key}))})}applyFilter(e){this.peers.filter=e.value.trim().toLowerCase()}loadPeersTable(e){this.peers=new Ze.by(e?[...e]:[]),this.peers.sort=this.sort,this.peers.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.peers.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.peers.paginator=this.paginator}onDownloadCSV(){this.peers.data&&this.peers.data.length>0&&this.commonService.downloadFile(this.peers.data,"Peers")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(St.V),o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-peers"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("Peers")}])],decls:40,vars:14,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,"keyup"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return t.onConnectPeer()}),o._uU(3,"Add Peer"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"div",4),o.TgZ(6,"div",5),o._UZ(7,"fa-icon",6),o.TgZ(8,"span",7),o._uU(9,"Connected Peers"),o.qZA(),o.qZA(),o.TgZ(10,"mat-form-field",8),o.TgZ(11,"input",9),o.NdJ("keyup",function(e){return t.applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(12,"div",10),o.YNc(13,Ba,1,0,"mat-progress-bar",11),o.TgZ(14,"table",12,13),o.ynx(16,14),o.YNc(17,Ga,2,0,"th",15),o.YNc(18,za,2,4,"td",16),o.BQk(),o.ynx(19,17),o.YNc(20,Va,2,0,"th",15),o.YNc(21,Wa,2,4,"td",16),o.BQk(),o.ynx(22,18),o.YNc(23,Xa,2,0,"th",19),o.YNc(24,$a,4,3,"td",20),o.BQk(),o.ynx(25,21),o.YNc(26,ja,2,0,"th",19),o.YNc(27,Ka,4,3,"td",20),o.BQk(),o.ynx(28,22),o.YNc(29,ei,2,0,"th",19),o.YNc(30,ti,4,3,"td",20),o.BQk(),o.ynx(31,23),o.YNc(32,ni,6,0,"th",24),o.YNc(33,ai,10,0,"td",25),o.BQk(),o.ynx(34,26),o.YNc(35,li,4,3,"td",27),o.BQk(),o.YNc(36,ci,1,3,"tr",28),o.YNc(37,ui,1,0,"tr",29),o.YNc(38,pi,1,0,"tr",30),o.qZA(),o.qZA(),o._UZ(39,"mat-paginator",31),o.qZA(),o.qZA()),2&e&&(o.xp6(7),o.Q6J("icon",t.faUsers),o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPeers.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.peers)("ngClass",o.VKq(11,di,""!==t.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(13,hi)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,l.yH,l.Wh,q.lW,T.BN,D.KE,Ce.Nt,E.$V,a.O5,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,we.gD,we.$L,ve.ey,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.JJ],styles:[".mat-column-alias[_ngcontent-%COMP%]{flex:1 1 25%}.mat-column-alias[_ngcontent-%COMP%], .mat-column-pub_key[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-column-pub_key[_ngcontent-%COMP%]{flex:1 1 35%;padding-left:2rem}.mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem;flex:1 1 10%}.mat-column-ping_time[_ngcontent-%COMP%], .mat-column-sat_recv[_ngcontent-%COMP%], .mat-column-sat_sent[_ngcontent-%COMP%]{flex:1 1 13%;width:13%}"]}),e})();function gi(e,t){if(1&e&&(o.TgZ(0,"span",7),o._uU(1,"Open"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.numOpenChannels)}}function fi(e,t){if(1&e&&(o.TgZ(0,"span",7),o._uU(1,"Pending"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.numPendingChannels)}}function xi(e,t){if(1&e&&(o.TgZ(0,"span",7),o._uU(1,"Closed"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.numClosedChannels)}}function Zi(e,t){if(1&e&&(o.TgZ(0,"span",7),o._uU(1,"Active HTLCs"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.numActiveHTLCs)}}let yi=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.router=n,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]}ngOnInit(){this.activeLink=this.links.findIndex(e=>e.link===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{this.activeLink=this.links.findIndex(t=>t.link===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("lnd").pipe((0,d.R)(this.unSubs[1])).subscribe(e=>{this.numOpenChannels=e.allChannels&&e.allChannels.length?e.allChannels.length:0,this.numPendingChannels=e.numberOfPendingChannels.total_channels?e.numberOfPendingChannels.total_channels:0,this.numClosedChannels=e.closedChannels&&e.closedChannels.length?e.closedChannels.length:0,this.numActiveHTLCs=e.allChannels.reduce((e,t)=>e+(t.pending_htlcs&&t.pending_htlcs.length>0?t.pending_htlcs.length:0),0),this.information=e.information,this.totalBalance=+e.blockchainBalance.total_balance,this.peers=e.peers,this.peers.forEach(e=>{e.alias&&""!==e.alias||(e.alias=e.pub_key.substring(0,15)+"...")}),this.logger.info(e)})}onOpenChannel(){this.store.dispatch(new ee.wu({data:{alertTitle:"Open Channel",message:{peers:this.peers,information:this.information,balance:this.totalBalance},component:Fa}}))}onSelectedTabChange(e){this.router.navigateByUrl("/lnd/connections/channels/"+this.links[e.index].link)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return t.onOpenChannel()}),o._uU(3,"Open Channel"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-tab-group",4),o.NdJ("selectedIndexChange",function(e){return t.activeLink=e})("selectedTabChange",function(e){return t.onSelectedTabChange(e)}),o.TgZ(6,"mat-tab"),o.YNc(7,gi,2,1,"ng-template",5),o.qZA(),o.TgZ(8,"mat-tab"),o.YNc(9,fi,2,1,"ng-template",5),o.qZA(),o.TgZ(10,"mat-tab"),o.YNc(11,xi,2,1,"ng-template",5),o.qZA(),o.TgZ(12,"mat-tab"),o.YNc(13,Zi,2,1,"ng-template",5),o.qZA(),o.qZA(),o.TgZ(14,"div",6),o._UZ(15,"router-outlet"),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(5),o.Q6J("selectedIndex",t.activeLink))},directives:[l.xw,l.yH,l.Wh,q.lW,ge.SP,ge.uX,ge.uD,i.lC,ra.k],styles:[""]}),e})();var Ai=n(1403),Ci=n(2609);function Ti(e,t){if(1&e&&(o.TgZ(0,"div"),o.TgZ(1,"div",9),o.TgZ(2,"div",14),o.TgZ(3,"h4",11),o._uU(4,"Commit Fee"),o.qZA(),o.TgZ(5,"span",15),o._uU(6),o.ALo(7,"number"),o.qZA(),o.qZA(),o.TgZ(8,"div",14),o.TgZ(9,"h4",11),o._uU(10,"Commit Weight"),o.qZA(),o.TgZ(11,"span",15),o._uU(12),o.ALo(13,"number"),o.qZA(),o.qZA(),o.TgZ(14,"div",14),o.TgZ(15,"h4",11),o._uU(16,"Fee/KW"),o.qZA(),o.TgZ(17,"span",15),o._uU(18),o.ALo(19,"number"),o.qZA(),o.qZA(),o.TgZ(20,"div",14),o.TgZ(21,"h4",11),o._uU(22,"Static Remote Key"),o.qZA(),o.TgZ(23,"span",15),o._uU(24),o.qZA(),o.qZA(),o.qZA(),o._UZ(25,"mat-divider",13),o.TgZ(26,"div",9),o.TgZ(27,"div",14),o.TgZ(28,"h4",11),o._uU(29),o.qZA(),o.TgZ(30,"span",15),o._uU(31),o.ALo(32,"number"),o.qZA(),o.qZA(),o.TgZ(33,"div",14),o.TgZ(34,"h4",11),o._uU(35),o.qZA(),o.TgZ(36,"span",15),o._uU(37),o.ALo(38,"number"),o.qZA(),o.qZA(),o.TgZ(39,"div",14),o.TgZ(40,"h4",11),o._uU(41,"Unsettled Balance"),o.qZA(),o.TgZ(42,"span",15),o._uU(43),o.ALo(44,"number"),o.qZA(),o.qZA(),o.TgZ(45,"div",14),o.TgZ(46,"h4",11),o._uU(47,"CSV Delay"),o.qZA(),o.TgZ(48,"span",15),o._uU(49),o.ALo(50,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(51,"mat-divider",13),o.TgZ(52,"div",9),o.TgZ(53,"div",14),o.TgZ(54,"h4",11),o._uU(55,"Local Reserve (Sats)"),o.qZA(),o.TgZ(56,"span",15),o._uU(57),o.ALo(58,"number"),o.qZA(),o.qZA(),o.TgZ(59,"div",14),o.TgZ(60,"h4",11),o._uU(61,"Remote Reserve (Sats)"),o.qZA(),o.TgZ(62,"span",15),o._uU(63),o.ALo(64,"number"),o.qZA(),o.qZA(),o.TgZ(65,"div",14),o.TgZ(66,"h4",11),o._uU(67,"Lifetime (Seconds)"),o.qZA(),o.TgZ(68,"span",15),o._uU(69),o.ALo(70,"number"),o.qZA(),o.qZA(),o.TgZ(71,"div",14),o.TgZ(72,"h4",11),o._uU(73,"Pending HTLCs"),o.qZA(),o.TgZ(74,"span",15),o._uU(75),o.ALo(76,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(77,"mat-divider",13),o.qZA()),2&e){const e=o.oxw();o.xp6(6),o.Oqu(o.lcZ(7,17,e.channel.commit_fee)),o.xp6(6),o.Oqu(o.lcZ(13,19,e.channel.commit_weight)),o.xp6(6),o.Oqu(o.lcZ(19,21,e.channel.fee_per_kw)),o.xp6(6),o.Oqu(e.channel.static_remote_key?"Yes":"No"),o.xp6(1),o.Q6J("inset",!0),o.xp6(4),o.Oqu(e.screenSize===e.screenSizeEnum.XS?"Total Sats Sent":"Total Satoshis Sent"),o.xp6(2),o.Oqu(o.lcZ(32,23,e.channel.total_satoshis_sent)),o.xp6(4),o.Oqu(e.screenSize===e.screenSizeEnum.XS?"Total Sats Recv":"Total Satoshis Received"),o.xp6(2),o.Oqu(o.lcZ(38,25,e.channel.total_satoshis_received)),o.xp6(6),o.Oqu(o.lcZ(44,27,e.channel.unsettled_balance)),o.xp6(6),o.Oqu(o.lcZ(50,29,e.channel.csv_delay)),o.xp6(2),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.lcZ(58,31,e.channel.local_chan_reserve_sat)),o.xp6(6),o.Oqu(o.lcZ(64,33,e.channel.remote_chan_reserve_sat)),o.xp6(6),o.Oqu(o.lcZ(70,35,e.channel.lifetime)),o.xp6(6),o.Oqu(o.lcZ(76,37,null==e.channel||null==e.channel.pending_htlcs?null:e.channel.pending_htlcs.length)),o.xp6(2),o.Q6J("inset",!0)}}function bi(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Show Advanced"),o.qZA())}function wi(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Hide Advanced"),o.qZA())}function _i(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",23),o.NdJ("copied",function(t){return o.CHM(e),o.oxw().onCopyChanID(t)}),o._uU(1,"Copy Channel ID"),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("payload",e.channel.chan_id)}}function vi(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",24),o.NdJ("click",function(){return o.CHM(e),o.oxw().onClose()}),o._uU(1,"OK"),o.qZA()}}const qi=function(e){return{"xs-scroll-y":e}};let Si=(()=>{class e{constructor(e,t,n,a,i){this.dialogRef=e,this.data=t,this.logger=n,this.commonService=a,this.snackBar=i,this.faReceipt=g.dLy,this.showAdvanced=!1,this.showCopy=!0,this.showCopyField=null,this.screenSize="",this.screenSizeEnum=f.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(e){this.snackBar.open("Channel ID "+e+" copied."),this.logger.info("Copied Text: "+e)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(Z.mQ),o.Y36(C.v),o.Y36(Ai.ux))},e.\u0275cmp=o.Xpm({type:e,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-stroked-button","","color","primary","type","reset","tabindex","1",1,"mr-1",3,"click"],[4,"ngIf","ngIfElse"],["hideAdvancedText",""],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","button",3,"click",4,"ngIf"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","submit","rtlClipboard","",3,"payload","copied"],["autoFocus","","mat-flat-button","","color","primary","tabindex","2","type","button",3,"click"]],template:function(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o._UZ(4,"fa-icon",4),o.TgZ(5,"span",5),o._uU(6,"Channel Information"),o.qZA(),o.qZA(),o.TgZ(7,"button",6),o.NdJ("click",function(){return t.onClose()}),o._uU(8,"X"),o.qZA(),o.qZA(),o.TgZ(9,"mat-card-content",7),o.TgZ(10,"div",8),o.TgZ(11,"div",9),o.TgZ(12,"div",10),o.TgZ(13,"h4",11),o._uU(14,"Channel ID"),o.qZA(),o.TgZ(15,"span",12),o._uU(16),o.qZA(),o.qZA(),o.TgZ(17,"div",10),o.TgZ(18,"h4",11),o._uU(19,"Peer Alias"),o.qZA(),o.TgZ(20,"span",12),o._uU(21),o.qZA(),o.qZA(),o.qZA(),o._UZ(22,"mat-divider",13),o.TgZ(23,"div",9),o.TgZ(24,"div",1),o.TgZ(25,"h4",11),o._uU(26,"Channel Point"),o.qZA(),o.TgZ(27,"span",12),o._uU(28),o.qZA(),o.qZA(),o.qZA(),o._UZ(29,"mat-divider",13),o.TgZ(30,"div",9),o.TgZ(31,"div",1),o.TgZ(32,"h4",11),o._uU(33,"Peer Public Key"),o.qZA(),o.TgZ(34,"span",12),o._uU(35),o.qZA(),o.qZA(),o.qZA(),o._UZ(36,"mat-divider",13),o.TgZ(37,"div",9),o.TgZ(38,"div",14),o.TgZ(39,"h4",11),o._uU(40,"Local Balance"),o.qZA(),o.TgZ(41,"span",15),o._uU(42),o.ALo(43,"number"),o.qZA(),o.qZA(),o.TgZ(44,"div",14),o.TgZ(45,"h4",11),o._uU(46,"Remote Balance"),o.qZA(),o.TgZ(47,"span",15),o._uU(48),o.ALo(49,"number"),o.qZA(),o.qZA(),o.TgZ(50,"div",14),o.TgZ(51,"h4",11),o._uU(52,"Capacity"),o.qZA(),o.TgZ(53,"span",15),o._uU(54),o.ALo(55,"number"),o.qZA(),o.qZA(),o.TgZ(56,"div",14),o.TgZ(57,"h4",11),o._uU(58,"Uptime (Seconds)"),o.qZA(),o.TgZ(59,"span",15),o._uU(60),o.ALo(61,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(62,"mat-divider",13),o.TgZ(63,"div",9),o.TgZ(64,"div",14),o.TgZ(65,"h4",11),o._uU(66,"Active"),o.qZA(),o.TgZ(67,"span",15),o._uU(68),o.qZA(),o.qZA(),o.TgZ(69,"div",14),o.TgZ(70,"h4",11),o._uU(71,"Private"),o.qZA(),o.TgZ(72,"span",15),o._uU(73),o.qZA(),o.qZA(),o.TgZ(74,"div",14),o.TgZ(75,"h4",11),o._uU(76,"Initiator"),o.qZA(),o.TgZ(77,"span",15),o._uU(78),o.qZA(),o.qZA(),o.TgZ(79,"div",14),o.TgZ(80,"h4",11),o._uU(81,"Number of Updates"),o.qZA(),o.TgZ(82,"span",15),o._uU(83),o.ALo(84,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(85,"mat-divider",13),o.YNc(86,Ti,78,39,"div",16),o.TgZ(87,"div",17),o.TgZ(88,"button",18),o.NdJ("click",function(){return t.onShowAdvanced()}),o.YNc(89,bi,2,0,"p",19),o.YNc(90,wi,2,0,"ng-template",null,20,o.W1O),o.qZA(),o.YNc(92,_i,2,1,"button",21),o.YNc(93,vi,2,0,"button",22),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.MAs(91);o.xp6(4),o.Q6J("icon",t.faReceipt),o.xp6(5),o.Q6J("ngClass",o.VKq(34,qi,t.screenSize===t.screenSizeEnum.XS)),o.xp6(7),o.Oqu(t.channel.chan_id),o.xp6(5),o.Oqu(t.channel.remote_alias),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(t.channel.channel_point),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(t.channel.remote_pubkey),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.lcZ(43,24,t.channel.local_balance)),o.xp6(6),o.Oqu(o.lcZ(49,26,t.channel.remote_balance)),o.xp6(6),o.Oqu(o.lcZ(55,28,t.channel.capacity)),o.xp6(6),o.Oqu(o.lcZ(61,30,t.channel.uptime)),o.xp6(2),o.Q6J("inset",!0),o.xp6(6),o.Oqu(t.channel.active?"Yes":"No"),o.xp6(5),o.Oqu(t.channel.private?"Yes":"No"),o.xp6(5),o.Oqu(t.channel.initiator?"Yes":"No"),o.xp6(5),o.Oqu(o.lcZ(84,32,t.channel.num_updates)),o.xp6(2),o.Q6J("inset",!0),o.xp6(1),o.Q6J("ngIf",t.showAdvanced),o.xp6(3),o.Q6J("ngIf",!t.showAdvanced)("ngIfElse",e),o.xp6(3),o.Q6J("ngIf",t.showCopy),o.xp6(1),o.Q6J("ngIf",!t.showCopy)}},directives:[l.xw,l.Wh,l.yH,w.dk,T.BN,q.lW,w.dn,a.mk,v.oO,M.d,a.O5,Te.h,Ci.y],pipes:[a.JJ],styles:[""]}),e})();var Fi=n(2041);const Li=["stepper"];function ki(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw();o.Oqu(e.inputFormLabel)}}function Ni(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function Ui(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount must be a positive number."),o.qZA())}function Ii(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("Amount must be less than or equal to ",null==e.selChannel?null:e.selChannel.local_balance,".")}}function Oi(e,t){if(1&e&&(o.TgZ(0,"mat-option",52),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.Oqu(e.remote_alias||e.chan_id)}}function Ji(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Peer is required."),o.qZA())}function Di(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Peer not found in the list."),o.qZA())}function Ri(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw();o.Oqu(e.feeFormLabel)}}function Mi(e,t){if(1&e&&(o.TgZ(0,"mat-option",52),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.hij(" ",e.name," ")}}function Ei(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("",e.feeFormGroup.controls.selFeeLimitType.value?e.feeFormGroup.controls.selFeeLimitType.value.placeholder:e.feeLimitTypes[0].placeholder," is required.")}}function Qi(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("",e.feeFormGroup.controls.selFeeLimitType.value?e.feeFormGroup.controls.selFeeLimitType.value.placeholder:e.feeLimitTypes[0].placeholder," must be a positive number.")}}function Yi(e,t){1&e&&o._uU(0,"Invoice/Payment")}function Pi(e,t){1&e&&(o.TgZ(0,"mat-icon",53),o._uU(1,"check"),o.qZA())}function Bi(e,t){1&e&&o._UZ(0,"mat-progress-bar",54)}function Gi(e,t){if(1&e&&(o.TgZ(0,"mat-icon",53),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(null!=e.paymentStatus&&e.paymentStatus.error?"close":"check")}}function Hi(e,t){1&e&&o._UZ(0,"div",7)}function zi(e,t){1&e&&o._UZ(0,"mat-progress-bar",54)}function Vi(e,t){if(1&e&&(o.TgZ(0,"h4",55),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.paymentStatus&&e.paymentStatus.payment_hash?"Rebalance Successful.":"Rebalance Failed.")}}function Wi(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",56),o.NdJ("click",function(){return o.CHM(e),o.oxw().onRestart()}),o._uU(1,"Start Again"),o.qZA()}}function Xi(e,t){1&e&&o.GkF(0)}function $i(e,t){if(1&e&&o.YNc(0,Xi,1,0,"ng-container",57),2&e){const e=o.oxw(),t=o.MAs(98),n=o.MAs(100);o.Q6J("ngTemplateOutlet",e.paymentStatus.error?t:n)}}function ji(e,t){if(1&e&&(o.TgZ(0,"div",7),o.TgZ(1,"span",40),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.hij("Error: ",e.paymentStatus.error,"")}}function Ki(e,t){if(1&e&&(o.TgZ(0,"div",7),o.TgZ(1,"div",0),o.TgZ(2,"div",1),o.TgZ(3,"h4",58),o._uU(4,"Payment Hash"),o.qZA(),o.TgZ(5,"span",40),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o._UZ(7,"mat-divider",59),o.TgZ(8,"div",0),o.TgZ(9,"div",60),o.TgZ(10,"h4",58),o._uU(11),o.qZA(),o.TgZ(12,"span",40),o._uU(13),o.qZA(),o.qZA(),o.TgZ(14,"div",60),o.TgZ(15,"h4",58),o._uU(16,"Number of Hops"),o.qZA(),o.TgZ(17,"span",40),o._uU(18),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(6),o.Oqu(e.paymentStatus.payment_hash),o.xp6(5),o.hij("Total Fees (",e.paymentStatus.payment_route.total_fees_msat?"mSats":"Sats",")"),o.xp6(2),o.Oqu(e.paymentStatus.payment_route.total_fees_msat?e.paymentStatus.payment_route.total_fees_msat:e.paymentStatus.payment_route.total_fees?e.paymentStatus.payment_route.total_fees:0),o.xp6(5),o.Oqu(e.paymentStatus&&e.paymentStatus.payment_route&&e.paymentStatus.payment_route.hops&&e.paymentStatus.payment_route.hops.length?e.paymentStatus.payment_route.hops.length:0)}}let es=(()=>{class e{constructor(e,t,n,a,i,s,o){this.dialogRef=e,this.data=t,this.logger=n,this.store=a,this.actions=i,this.formBuilder=s,this.decimalPipe=o,this.faInfoCircle=g.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 e="",t="";this.selChannel=this.data.message.selChannel,this.activeChannels=this.data.message.channels.filter(e=>e.active&&e.chan_id!==this.selChannel.chan_id&&e.remote_balance>0),this.activeChannels=this.activeChannels.sort((n,a)=>(e=n.remote_alias?n.remote_alias.toLowerCase():n.chan_id?n.chan_id.toLowerCase():"",t=a.remote_alias?a.remote_alias.toLowerCase():n.chan_id.toLowerCase(),e<t?-1:e>t?1:0)),f.Vc.forEach((e,t)=>{t>0&&this.feeLimitTypes.push(e)}),this.inputFormGroup=this.formBuilder.group({hiddenAmount:["",[Ae.kI.required]],rebalanceAmount:["",[Ae.kI.required,Ae.kI.min(1),Ae.kI.max(this.selChannel.local_balance)]],selRebalancePeer:[null,Ae.kI.required]}),this.feeFormGroup=this.formBuilder.group({selFeeLimitType:[this.feeLimitTypes[0],Ae.kI.required],feeLimit:["",[Ae.kI.required,Ae.kI.min(0)]],hiddenFeeLimit:["",[Ae.kI.required]]}),this.statusFormGroup=this.formBuilder.group({}),this.store.select("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.invoices=e.invoices,this.logger.info(e)}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,h.h)(e=>e.type===x.qs||e.type===x.ug||e.type===x.mZ)).subscribe(e=>{e.type===x.qs&&(this.queryRoute=e.payload),e.type===x.ug&&(this.logger.info(e.payload),this.flgPaymentSent=!0,this.paymentStatus=e.payload,this.flgEditable=!0),e.type===x.mZ&&(this.logger.info(e.payload),this.flgInvoiceGenerated=!0,this.sendPayment(e.payload.paymentRequest))}),this.inputFormGroup.get("rebalanceAmount").valueChanges.pipe((0,d.R)(this.unSubs[2]),(0,da.O)(0)).subscribe(e=>{this.inputFormGroup.controls.selRebalancePeer.setValue(""),this.inputFormGroup.controls.selRebalancePeer.setErrors(null),this.filteredActiveChannels=(0,Fi.of)(e?this.filterActiveChannels():this.activeChannels.slice())}),this.inputFormGroup.get("selRebalancePeer").valueChanges.pipe((0,d.R)(this.unSubs[3]),(0,da.O)("")).subscribe(e=>{"string"==typeof e&&(this.filteredActiveChannels=(0,Fi.of)(this.filterActiveChannels()))})}onSelectFee(){if(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)return!0;0===this.stepper.selectedIndex&&(this.inputFormGroup.controls.hiddenAmount.setValue(this.inputFormGroup.controls.rebalanceAmount.value),this.stepper.next()),this.queryRoute=null,this.feeFormGroup.reset(),this.feeFormGroup.controls.selFeeLimitType.setValue(this.feeLimitTypes[0]),this.feeFormGroup.controls.feeLimit.setValue(""),this.feeFormGroup.controls.feeLimit.setErrors(null),this.feeFormGroup.controls.hiddenFeeLimit.setValue(""),this.feeFormGroup.controls.hiddenFeeLimit.setErrors(null)}stepSelectionChanged(e){switch(e.selectedIndex){case 0: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";break;default:this.inputFormLabel="Amount to rebalance",this.feeFormLabel="Select rebalance fee"}e.selectedIndex<e.previouslySelectedIndex&&(0===e.selectedIndex?this.inputFormGroup.controls.hiddenAmount.setValue(""):1===e.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 e=this.findUnsettledInvoice();e?(this.flgReusingInvoice=!0,this.sendPayment(e.payment_request)):this.store.dispatch(new x.H1({uiMessage:f.m6.NO_SPINNER,memo:"Local-Rebalance-"+this.inputFormGroup.controls.rebalanceAmount.value+"-Sats",invoiceValue:this.inputFormGroup.controls.rebalanceAmount.value,private:!1,expiry:3600,pageSize:f.IV,openModal:!1}))}findUnsettledInvoice(){return this.invoices.invoices.find(e=>(0==+e.settle_date||!e.settle_date)&&e.memo==="Local-Rebalance-"+this.inputFormGroup.controls.rebalanceAmount.value+"-Sats"&&"CANCELED"!==e.state)}sendPayment(e){this.flgInvoiceGenerated=!0,this.paymentRequest=e,this.store.dispatch(new x.Ar({uiMessage:f.m6.NO_SPINNER,paymentReq:e,outgoingChannel:this.selChannel,feeLimitType:this.feeFormGroup.controls.selFeeLimitType.value,feeLimit:this.feeFormGroup.controls.feeLimit.value,allowSelfPayment:!0,lastHopPubkey:this.inputFormGroup.controls.selRebalancePeer.value.remote_pubkey,fromDialog:!0}))}filterActiveChannels(){return this.activeChannels.filter(e=>e.remote_balance>=this.inputFormGroup.controls.rebalanceAmount.value&&e.chan_id!==this.selChannel.chan_id&&(0===e.remote_alias.toLowerCase().indexOf(this.inputFormGroup.controls.selRebalancePeer.value?this.inputFormGroup.controls.selRebalancePeer.value.toLowerCase():"")||0===e.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 e=this.activeChannels.filter(e=>e.remote_alias.length===this.inputFormGroup.controls.selRebalancePeer.value.length&&0===e.remote_alias.toLowerCase().indexOf(this.inputFormGroup.controls.selRebalancePeer.value?this.inputFormGroup.controls.selRebalancePeer.value.toLowerCase():""));e&&e.length>0?(this.inputFormGroup.controls.selRebalancePeer.setValue(e[0]),this.inputFormGroup.controls.selRebalancePeer.setErrors(null)):this.inputFormGroup.controls.selRebalancePeer.setErrors({notfound:!0})}}displayFn(e){return e&&e.remote_alias?e.remote_alias:e&&e.chan_id?e.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,Fi.of)(this.activeChannels)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(A.eX),o.Y36(Ae.qu),o.Y36(a.JJ))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-channel-rebalance"]],viewQuery:function(e,t){if(1&e&&o.Gf(Li,5),2&e){let e;o.iGM(e=o.CRH())&&(t.stepper=e.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-stroked-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-stroked-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-flat-button","","color","primary","tabindex","11","type","button",3,"click",4,"ngIf"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-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-flat-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(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Channel Rebalance"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return t.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"div",7),o.TgZ(10,"div",8),o.TgZ(11,"div",9),o._UZ(12,"fa-icon",10),o.TgZ(13,"span"),o._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."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(15,"div",11),o.TgZ(16,"p",12),o.TgZ(17,"strong"),o._uU(18,"Channel Peer:\xa0"),o.qZA(),o._uU(19),o.ALo(20,"titlecase"),o.qZA(),o.TgZ(21,"p",13),o.TgZ(22,"strong"),o._uU(23,"Channel ID:\xa0"),o.qZA(),o._uU(24),o.qZA(),o._UZ(25,"p",13),o.qZA(),o.TgZ(26,"mat-vertical-stepper",14,15),o.NdJ("selectionChange",function(e){return t.stepSelectionChanged(e)}),o.TgZ(28,"mat-step",16),o.TgZ(29,"form",17),o.YNc(30,ki,1,1,"ng-template",18),o.TgZ(31,"div",19),o.TgZ(32,"mat-form-field",20),o._UZ(33,"input",21),o.TgZ(34,"mat-hint"),o._uU(35),o.qZA(),o.TgZ(36,"span",22),o._uU(37,"Sats"),o.qZA(),o.YNc(38,Ni,2,0,"mat-error",23),o.YNc(39,Ui,2,0,"mat-error",23),o.YNc(40,Ii,2,1,"mat-error",23),o.qZA(),o.TgZ(41,"mat-form-field",24),o.TgZ(42,"input",25),o.NdJ("change",function(){return t.onSelectedPeerChanged()}),o.qZA(),o.TgZ(43,"mat-autocomplete",26,27),o.NdJ("optionSelected",function(){return t.onSelectedPeerChanged()}),o.YNc(45,Oi,2,2,"mat-option",28),o.ALo(46,"async"),o.qZA(),o.YNc(47,Ji,2,0,"mat-error",23),o.YNc(48,Di,2,0,"mat-error",23),o.qZA(),o.qZA(),o.TgZ(49,"div",29),o.TgZ(50,"button",30),o.NdJ("click",function(){return t.onSelectFee()}),o._uU(51,"Select Fee"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(52,"mat-step",16),o.TgZ(53,"form",17),o.YNc(54,Ri,1,1,"ng-template",31),o.TgZ(55,"div",19),o.TgZ(56,"div",19),o.TgZ(57,"mat-form-field",24),o.TgZ(58,"mat-select",32),o.YNc(59,Mi,2,2,"mat-option",28),o.qZA(),o.qZA(),o.TgZ(60,"mat-form-field",20),o._UZ(61,"input",33),o.YNc(62,Ei,2,1,"mat-error",23),o.YNc(63,Qi,2,1,"mat-error",23),o.qZA(),o.qZA(),o.qZA(),o.TgZ(64,"div",29),o.TgZ(65,"button",34),o.NdJ("click",function(){return t.onRebalance()}),o._uU(66,"Rebalance"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(67,"mat-step",35),o.TgZ(68,"form",17),o.YNc(69,Yi,1,0,"ng-template",18),o.TgZ(70,"div",36),o.TgZ(71,"mat-expansion-panel",37),o.TgZ(72,"mat-expansion-panel-header"),o.TgZ(73,"mat-panel-title"),o.TgZ(74,"span",38),o._uU(75),o.YNc(76,Pi,2,0,"mat-icon",39),o.qZA(),o.qZA(),o.qZA(),o.TgZ(77,"div",7),o.TgZ(78,"span",40),o._uU(79),o.qZA(),o.qZA(),o.qZA(),o.YNc(80,Bi,1,0,"mat-progress-bar",41),o.TgZ(81,"mat-expansion-panel",42),o.TgZ(82,"mat-expansion-panel-header"),o.TgZ(83,"mat-panel-title"),o.TgZ(84,"span",38),o._uU(85),o.YNc(86,Gi,2,1,"mat-icon",39),o.qZA(),o.qZA(),o.qZA(),o.YNc(87,Hi,1,0,"div",43),o.qZA(),o.YNc(88,zi,1,0,"mat-progress-bar",41),o.qZA(),o.YNc(89,Vi,2,1,"h4",44),o.TgZ(90,"div",45),o.YNc(91,Wi,2,0,"button",46),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(92,"div",47),o.TgZ(93,"button",48),o._uU(94,"Close"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(95,$i,1,1,"ng-template",null,49,o.W1O),o.YNc(97,ji,3,1,"ng-template",null,50,o.W1O),o.YNc(99,Ki,19,4,"ng-template",null,51,o.W1O)),2&e){const e=o.MAs(44),n=o.MAs(96);o.xp6(12),o.Q6J("icon",t.faInfoCircle),o.xp6(7),o.Oqu(o.lcZ(20,41,t.selChannel.remote_alias)),o.xp6(5),o.Oqu(t.selChannel.chan_id),o.xp6(2),o.Q6J("linear",!0),o.xp6(2),o.Q6J("stepControl",t.inputFormGroup)("editable",t.flgEditable),o.xp6(1),o.Q6J("formGroup",t.inputFormGroup),o.xp6(4),o.Q6J("step",100),o.xp6(2),o.AsE("(Local Bal: ",null==t.selChannel?null:t.selChannel.local_balance,", Remaining: ",(null==t.selChannel?null:t.selChannel.local_balance)-(t.inputFormGroup.controls.rebalanceAmount.value?t.inputFormGroup.controls.rebalanceAmount.value:0),")"),o.xp6(3),o.Q6J("ngIf",null==t.inputFormGroup.controls.rebalanceAmount.errors?null:t.inputFormGroup.controls.rebalanceAmount.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.inputFormGroup.controls.rebalanceAmount.errors?null:t.inputFormGroup.controls.rebalanceAmount.errors.min),o.xp6(1),o.Q6J("ngIf",null==t.inputFormGroup.controls.rebalanceAmount.errors?null:t.inputFormGroup.controls.rebalanceAmount.errors.max),o.xp6(2),o.Q6J("matAutocomplete",e),o.xp6(1),o.Q6J("displayWith",t.displayFn),o.xp6(2),o.Q6J("ngForOf",o.lcZ(46,43,t.filteredActiveChannels)),o.xp6(2),o.Q6J("ngIf",null==t.inputFormGroup.controls.selRebalancePeer.errors?null:t.inputFormGroup.controls.selRebalancePeer.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.inputFormGroup.controls.selRebalancePeer.errors?null:t.inputFormGroup.controls.selRebalancePeer.errors.notfound),o.xp6(4),o.Q6J("stepControl",t.feeFormGroup)("editable",t.flgEditable),o.xp6(1),o.Q6J("formGroup",t.feeFormGroup),o.xp6(6),o.Q6J("ngForOf",t.feeLimitTypes),o.xp6(2),o.s9C("placeholder",t.feeFormGroup.controls.selFeeLimitType.value?t.feeFormGroup.controls.selFeeLimitType.value.placeholder:t.feeLimitTypes[0].placeholder),o.Q6J("step",1),o.xp6(1),o.Q6J("ngIf",null==t.feeFormGroup.controls.feeLimit.errors?null:t.feeFormGroup.controls.feeLimit.errors.required),o.xp6(1),o.Q6J("ngIf",null==t.feeFormGroup.controls.feeLimit.errors?null:t.feeFormGroup.controls.feeLimit.errors.min),o.xp6(4),o.Q6J("stepControl",t.statusFormGroup),o.xp6(1),o.Q6J("formGroup",t.statusFormGroup),o.xp6(7),o.Oqu(t.flgInvoiceGenerated?t.flgReusingInvoice?"Invoice re-used":"Invoice generated":"Generating invoice..."),o.xp6(1),o.Q6J("ngIf",t.flgInvoiceGenerated),o.xp6(3),o.Oqu(t.paymentRequest),o.xp6(1),o.Q6J("ngIf",!t.flgInvoiceGenerated),o.xp6(1),o.Q6J("expanded",(t.flgInvoiceGenerated||t.flgReusingInvoice)&&t.flgPaymentSent),o.xp6(4),o.Oqu(t.flgInvoiceGenerated||t.flgPaymentSent?t.flgPaymentSent?null!=t.paymentStatus&&t.paymentStatus.error?"Payment failed":"Payment successful":"Processing payment...":"Payment waiting for Invoice"),o.xp6(1),o.Q6J("ngIf",t.flgPaymentSent),o.xp6(1),o.Q6J("ngIf",!t.paymentStatus)("ngIfElse",n),o.xp6(1),o.Q6J("ngIf",t.flgInvoiceGenerated&&!t.flgPaymentSent),o.xp6(1),o.Q6J("ngIf",t.flgInvoiceGenerated&&t.flgPaymentSent),o.xp6(2),o.Q6J("ngIf",t.paymentStatus&&t.paymentStatus.error),o.xp6(2),o.Q6J("mat-dialog-close",!1)}},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,w.dn,T.BN,La.Vq,La.C0,Ae._Y,Ae.JL,Ae.sg,La.VY,D.KE,Ce.Nt,Ae.wV,Ae.Fj,Te.h,Ae.JJ,Ae.u,Ae.Q7,D.bx,D.R9,a.O5,mt.ZL,mt.XC,a.sg,we.gD,ht.ib,ht.yz,ht.yK,ye.ZT,D.TO,ve.ey,S.Hw,r.pW,a.tP,M.d],pipes:[a.rS,a.Ov],styles:[""]}),e})();function ts(e,t){if(1&e&&(o.TgZ(0,"div",16),o.TgZ(1,"p",17),o.TgZ(2,"mat-icon",18),o._uU(3,"close"),o.qZA(),o._uU(4),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(4),o.Oqu(e.errorMsg)}}function ns(e,t){if(1&e&&(o.TgZ(0,"div",27),o._UZ(1,"fa-icon",28),o.TgZ(2,"span"),o._uU(3,"Priority/Fee for force closing inactive channels cannot be modified."),o.qZA(),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("icon",e.faInfoCircle)}}function as(e,t){if(1&e&&(o.TgZ(0,"mat-option",29),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.id),o.xp6(1),o.hij(" ",e.name," ")}}function is(e,t){1&e&&(o.TgZ(0,"mat-form-field",30),o._UZ(1,"input",31),o.qZA())}function ss(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Number of blocks is required."),o.qZA())}function os(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",32),o.TgZ(1,"input",33,34),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).blocks=t}),o.qZA(),o.YNc(3,ss,2,0,"mat-error",35),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngModel",e.blocks)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.blocks)}}function ls(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Fees is required."),o.qZA())}function rs(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",32),o.TgZ(1,"input",36,37),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).fees=t}),o.qZA(),o.YNc(3,ls,2,0,"mat-error",35),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngModel",e.fees)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.fees)}}function cs(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",19),o.YNc(1,ns,4,1,"div",20),o.TgZ(2,"div",21),o.TgZ(3,"mat-form-field",22),o.TgZ(4,"mat-select",23),o.NdJ("valueChange",function(t){return o.CHM(e),o.oxw().selTransType=t}),o.YNc(5,as,2,2,"mat-option",24),o.qZA(),o.qZA(),o.YNc(6,is,2,0,"mat-form-field",25),o.YNc(7,os,4,4,"mat-form-field",26),o.YNc(8,rs,4,4,"mat-form-field",26),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",!e.channelToClose.active),o.xp6(3),o.Q6J("value",e.selTransType)("disabled",!e.channelToClose.active),o.xp6(1),o.Q6J("ngForOf",e.transTypes),o.xp6(1),o.Q6J("ngIf","0"===e.selTransType),o.xp6(1),o.Q6J("ngIf","1"===e.selTransType),o.xp6(1),o.Q6J("ngIf","2"===e.selTransType)}}function us(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",38),o.NdJ("click",function(){return o.CHM(e),o.oxw().resetData()}),o._uU(1,"Clear"),o.qZA()}}function ps(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",39),o.NdJ("click",function(){return o.CHM(e),o.oxw().onCloseChannel()}),o._uU(1),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.channelToClose.active?"Close Channel":"Force Close")}}function ds(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"button",40),o.NdJ("click",function(){return o.CHM(e),o.oxw().onClose()}),o._uU(1,"Ok"),o.qZA()}}let hs=(()=>{class e{constructor(e,t,n,a,i){this.dialogRef=e,this.data=t,this.store=n,this.actions=a,this.logger=i,this.transTypes=f.Dr,this.selTransType="0",this.blocks=null,this.fees=null,this.faExclamationTriangle=g.eHv,this.faInfoCircle=g.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,h.h)(e=>e.type===x.JE||e.type===x.P2)).subscribe(e=>{if(e.type===x.P2){const t=e.payload.find(e=>e.chan_id===this.data.channel.chan_id);t.pending_htlcs&&t.pending_htlcs.length&&t.pending_htlcs.length>0&&(this.flgPendingHtlcs=!0)}e.type===x.JE&&e.payload.status===f.Bn.ERROR&&"FetchAllChannels"===e.payload.action&&this.logger.error("Fetching latest channel information failed!\n"+e.payload.message)})}onCloseChannel(){if("1"===this.selTransType&&(!this.blocks||0===this.blocks)||"2"===this.selTransType&&(!this.fees||0===this.fees))return!0;const e={channelPoint:this.channelToClose.channel_point,forcibly:!this.channelToClose.active};this.blocks&&(e.targetConf=this.blocks),this.fees&&(e.satPerByte=this.fees),this.store.dispatch(new x.e8(e)),this.dialogRef.close(!1)}resetData(){this.selTransType="0",this.blocks=null,this.fees=null}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(y.yh),o.Y36(A.eX),o.Y36(Z.mQ))},e.\u0275cmp=o.Xpm({type:e,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-stroked-button","","color","primary","type","reset","class","mr-1","tabindex","3","default","",3,"click",4,"ngIf"],["mat-flat-button","","color","primary","type","submit","tabindex","4",3,"click",4,"ngIf"],["mat-flat-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-stroked-button","","color","primary","type","reset","tabindex","3","default","",1,"mr-1",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","4",3,"click"],["mat-flat-button","","color","primary","type","submit","tabindex","5",3,"click"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return t.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7),o.TgZ(10,"div",8),o.TgZ(11,"p",9),o._uU(12),o.qZA(),o.YNc(13,ts,5,1,"div",10),o.YNc(14,cs,9,7,"div",11),o.qZA(),o.TgZ(15,"div",12),o.YNc(16,us,2,0,"button",13),o.YNc(17,ps,2,1,"button",14),o.YNc(18,ds,2,0,"button",15),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(5),o.Oqu(t.channelToClose.active?"Close Channel":"Force Close Channel"),o.xp6(7),o.Oqu(t.channelToClose.active?"Closing channel: "+t.channelToClose.channel_point:"Force closing channel: "+t.channelToClose.channel_point),o.xp6(1),o.Q6J("ngIf",t.flgPendingHtlcs),o.xp6(1),o.Q6J("ngIf",!t.flgPendingHtlcs),o.xp6(2),o.Q6J("ngIf",t.channelToClose.active&&!t.flgPendingHtlcs),o.xp6(1),o.Q6J("ngIf",!t.flgPendingHtlcs),o.xp6(1),o.Q6J("ngIf",t.flgPendingHtlcs))},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,w.dn,Ae._Y,Ae.JL,Ae.F,a.O5,S.Hw,D.KE,we.gD,a.sg,T.BN,ve.ey,Ce.Nt,Ae.wV,Ae.qQ,Ae.Fj,be.q,Ae.Q7,Ae.JJ,Ae.On,D.TO],styles:[""]}),e})();function ms(e,t){1&e&&o._UZ(0,"mat-progress-bar",30)}function gs(e,t){1&e&&(o.TgZ(0,"th",31),o._uU(1," Peer "),o.qZA())}function fs(e,t){1&e&&o._UZ(0,"span",39)}function xs(e,t){1&e&&o._UZ(0,"span",40)}function Zs(e,t){if(1&e&&(o.TgZ(0,"span",41),o._UZ(1,"fa-icon",42),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("icon",e.faEyeSlash)}}function ys(e,t){if(1&e&&(o.TgZ(0,"span",43),o._UZ(1,"fa-icon",42),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("icon",e.faEye)}}const As=function(e){return{"max-width":e}};function Cs(e,t){if(1&e&&(o.TgZ(0,"td",32),o.TgZ(1,"div",33),o.YNc(2,fs,1,0,"span",34),o.YNc(3,xs,1,0,"span",35),o.YNc(4,Zs,2,1,"span",36),o.YNc(5,ys,2,1,"span",37),o.TgZ(6,"span",38),o._uU(7),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.xp6(1),o.Q6J("ngStyle",o.VKq(6,As,n.screenSize===n.screenSizeEnum.XS?"10rem":n.screenSize===n.screenSizeEnum.MD?"15rem":"22rem")),o.xp6(1),o.Q6J("ngIf",e.active),o.xp6(1),o.Q6J("ngIf",!e.active),o.xp6(1),o.Q6J("ngIf",e.private),o.xp6(1),o.Q6J("ngIf",!e.private),o.xp6(2),o.Oqu(e.remote_alias||e.remote_pubkey)}}function Ts(e,t){if(1&e&&(o.TgZ(0,"th",44),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("Uptime (",e.timeUnit,")")}}function bs(e,t){if(1&e&&(o.TgZ(0,"td",32),o.TgZ(1,"span",45),o._uU(2),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij("",e.uptime_str," ")}}function ws(e,t){1&e&&(o.TgZ(0,"th",44),o._uU(1,"Sats Sent "),o.qZA())}function _s(e,t){if(1&e&&(o.TgZ(0,"td",32),o.TgZ(1,"span",45),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij("",o.lcZ(3,1,e.total_satoshis_sent)," ")}}function vs(e,t){1&e&&(o.TgZ(0,"th",44),o._uU(1,"Sats Received "),o.qZA())}function qs(e,t){if(1&e&&(o.TgZ(0,"td",32),o.TgZ(1,"span",45),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij("",o.lcZ(3,1,e.total_satoshis_received)," ")}}function Ss(e,t){1&e&&(o.TgZ(0,"th",44),o._uU(1,"Local Balance (Sats) "),o.qZA())}function Fs(e,t){if(1&e&&(o.TgZ(0,"td",32),o.TgZ(1,"span",45),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij("",o.lcZ(3,1,e.local_balance)," ")}}function Ls(e,t){1&e&&(o.TgZ(0,"th",44),o._uU(1,"Remote Balance (Sats) "),o.qZA())}function ks(e,t){if(1&e&&(o.TgZ(0,"td",32),o.TgZ(1,"span",45),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij("",o.lcZ(3,1,e.remote_balance)," ")}}function Ns(e,t){1&e&&(o.TgZ(0,"th",46),o._uU(1,"Balance Score "),o.qZA())}function Us(e,t){if(1&e&&(o.TgZ(0,"td",47),o.TgZ(1,"div",48),o.TgZ(2,"mat-hint",49),o._uU(3),o.ALo(4,"number"),o.qZA(),o.qZA(),o._UZ(5,"mat-progress-bar",50),o.qZA()),2&e){const e=t.$implicit;o.xp6(3),o.Oqu(o.lcZ(4,2,e.balancedness||0)),o.xp6(2),o.s9C("value",e.local_balance&&e.local_balance>0?+e.local_balance/(+e.local_balance+ +e.remote_balance)*100:0)}}function Is(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",51),o.TgZ(1,"div",52),o.TgZ(2,"mat-select",53),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",54),o.NdJ("click",function(){return o.CHM(e),o.oxw().onChannelUpdate("all")}),o._uU(5,"Update Fee Policy"),o.qZA(),o.TgZ(6,"mat-option",54),o.NdJ("click",function(){return o.CHM(e),o.oxw().onDownloadCSV()}),o._uU(7,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Os(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-option",54),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().onCircularRebalance(t)}),o._uU(1,"Circular Rebalance"),o.qZA()}}function Js(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-option",54),o.NdJ("click",function(){o.CHM(e);const t=o.oxw().$implicit;return o.oxw().onLoopOut(t)}),o._uU(1,"Loop Out"),o.qZA()}}function Ds(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",55),o.TgZ(1,"div",52),o.TgZ(2,"mat-select",56),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",54),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw().onChannelClick(n,t)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",54),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onViewRemotePolicy(t)}),o._uU(7,"View Remote Fee "),o.qZA(),o.TgZ(8,"mat-option",54),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onChannelUpdate(t)}),o._uU(9,"Update Fee Policy"),o.qZA(),o.YNc(10,Os,2,0,"mat-option",57),o.YNc(11,Js,2,0,"mat-option",57),o.TgZ(12,"mat-option",54),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onChannelClose(t)}),o._uU(13,"Close Channel"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(10),o.Q6J("ngIf",+e.versionsArr[0]>0||+e.versionsArr[1]>=9),o.xp6(1),o.Q6J("ngIf",e.selNode.swapServerUrl)}}function Rs(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No peers connected. Add a peer in order to open a channel."),o.qZA())}function Ms(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No channel available."),o.qZA())}function Es(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting channels..."),o.qZA())}function Qs(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function Ys(e,t){if(1&e&&(o.TgZ(0,"td",58),o.YNc(1,Rs,2,0,"p",59),o.YNc(2,Ms,2,0,"p",59),o.YNc(3,Es,2,0,"p",59),o.YNc(4,Qs,2,1,"p",59),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",e.numPeers<1&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",e.numPeers>0&&(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.ERROR)}}const Ps=function(e){return{"display-none":e}};function Bs(e,t){if(1&e&&o._UZ(0,"tr",60),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,Ps,e.numPeers>0&&(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Gs(e,t){1&e&&o._UZ(0,"tr",61)}function Hs(e,t){1&e&&o._UZ(0,"tr",62)}const zs=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Vs=function(){return["no_peer"]};let Ws=(()=>{class e{constructor(e,t,n,a,i,s,o){this.logger=e,this.store=t,this.rtlEffects=n,this.lndEffects=a,this.commonService=i,this.loopService=s,this.decimalPipe=o,this.timeUnit="mins:secs",this.userPersonaEnum=f.ol,this.selNode={},this.totalBalance=0,this.displayedColumns=[],this.channelsData=[],this.myChanPolicy={},this.information={},this.numPeers=-1,this.selFilter="",this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.versionsArr=[],this.faEye=g.Mdf,this.faEyeSlash=g.Aq,this.targetConf=6,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[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===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["remote_alias","local_balance","remote_balance","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.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"])}ngOnInit(){this.store.select("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchAllChannels.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchAllChannels.message?JSON.stringify(this.apisCallStatus.FetchAllChannels.message):this.apisCallStatus.FetchAllChannels.message),this.selNode=e.nodeSettings,this.information=e.information,this.information&&this.information.version&&(this.versionsArr=this.information.version.split(".")),this.numPeers=e.peers&&e.peers.length?e.peers.length:0,this.totalBalance=+e.blockchainBalance.total_balance,this.channelsData=this.calculateUptime(e.allChannels),this.channelsData.length>0&&this.loadChannelsTable(this.channelsData),this.logger.info(e)})}ngAfterViewInit(){this.channelsData.length>0&&this.loadChannelsTable(this.channelsData)}onViewRemotePolicy(e){this.store.dispatch(new x.IG({uiMessage:f.m6.GET_REMOTE_POLICY,channelID:e.chan_id.toString()+"/"+this.information.identity_pubkey})),this.lndEffects.setLookup.pipe((0,pt.q)(1)).subscribe(e=>{if(!e.fee_base_msat&&!e.fee_rate_milli_msat&&!e.time_lock_delta)return!1;this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Remote Channel Policy",message:[[{key:"fee_base_msat",value:e.fee_base_msat,title:"Base Fees (mSats)",width:25,type:f.Gi.NUMBER},{key:"fee_rate_milli_msat",value:e.fee_rate_milli_msat,title:"Fee Rate (milli mSats)",width:25,type:f.Gi.NUMBER},{key:"fee_rate_milli_msat",value:e.fee_rate_milli_msat/1e4,title:"Fee Rate (%)",width:25,type:f.Gi.NUMBER,digitsInfo:"1.0-8"},{key:"time_lock_delta",value:e.time_lock_delta,title:"Time Lock Delta",width:25,type:f.Gi.NUMBER}]]}}))})}onCircularRebalance(e){this.store.dispatch(new ee.wu({data:{message:{channels:this.channelsData,selChannel:e},component:es}}))}onChannelUpdate(e){"all"===e?(this.store.dispatch(new ee.b_({data:{type:f.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:f.Gi.NUMBER.toLowerCase(),inputValue:1e3,width:32},{placeholder:"Fee Rate (mili mSat)",inputType:f.Gi.NUMBER.toLowerCase(),inputValue:1,min:1,width:32,hintFunction:this.percentHintFunction},{placeholder:"Time Lock Delta",inputType:f.Gi.NUMBER.toLowerCase(),inputValue:40,width:32}]}})),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[1])).subscribe(e=>{e&&this.store.dispatch(new x.k({baseFeeMsat:e[0].inputValue,feeRate:e[1].inputValue,timeLockDelta:e[2].inputValue,chanPoint:"all"}))})):(this.myChanPolicy={fee_base_msat:0,fee_rate_milli_msat:0,time_lock_delta:0},this.store.dispatch(new x.IG({uiMessage:f.m6.GET_CHAN_POLICY,channelID:e.chan_id.toString()})),this.lndEffects.setLookup.pipe((0,pt.q)(1)).subscribe(t=>{this.myChanPolicy=t.node1_pub===this.information.identity_pubkey?t.node1_policy:t.node2_pub===this.information.identity_pubkey?t.node2_policy:{fee_base_msat:0,fee_rate_milli_msat:0,time_lock_delta:0},this.logger.info(this.myChanPolicy),this.store.dispatch(new ee.b_({data:{type:f.n_.CONFIRM,alertTitle:"Update Fee Policy",titleMessage:"Update fee policy for channel point: "+e.channel_point,noBtnText:"Cancel",yesBtnText:"Update Channel",message:[],flgShowInput:!0,getInputs:[{placeholder:"Base Fee (mSat)",inputType:f.Gi.NUMBER.toLowerCase(),inputValue:""===this.myChanPolicy.fee_base_msat?0:this.myChanPolicy.fee_base_msat,width:32},{placeholder:"Fee Rate (mili mSat)",inputType:f.Gi.NUMBER.toLowerCase(),inputValue:this.myChanPolicy.fee_rate_milli_msat,min:1,width:32,hintFunction:this.percentHintFunction},{placeholder:"Time Lock Delta",inputType:f.Gi.NUMBER.toLowerCase(),inputValue:this.myChanPolicy.time_lock_delta,width:32}]}}))}),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[2])).subscribe(t=>{t&&this.store.dispatch(new x.k({baseFeeMsat:t[0].inputValue,feeRate:t[1].inputValue,timeLockDelta:t[2].inputValue,chanPoint:e.channel_point}))})),this.applyFilter()}onChannelClose(e){e.active&&this.store.dispatch(new x.jh),this.store.dispatch(new ee.wu({width:"70%",data:{channel:e,component:hs}}))}applyFilter(){this.channels.filter=this.selFilter.trim().toLowerCase()}onChannelClick(e,t){this.store.dispatch(new ee.wu({data:{channel:e,showCopy:!0,component:Si}}))}loadChannelsTable(e){e.sort((e,t)=>e.active===t.active?0:t.active?1:-1),this.channels=new Ze.by([...e]),this.channels.filterPredicate=(e,t)=>((e.active?"active":"inactive")+(e.chan_id?e.chan_id.toLowerCase():"")+(e.remote_pubkey?e.remote_pubkey.toLowerCase():"")+(e.remote_alias?e.remote_alias.toLowerCase():"")+(e.capacity?e.capacity:"")+(e.local_balance?e.local_balance:"")+(e.remote_balance?e.remote_balance:"")+(e.total_satoshis_sent?e.total_satoshis_sent:"")+(e.total_satoshis_received?e.total_satoshis_received:"")+(e.commit_fee?e.commit_fee:"")+(e.private?"private":"public")).includes(t),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.channels.paginator=this.paginator,this.logger.info(this.channels)}calculateUptime(e){const t=3600,n=86400,a=31536e3;let i=60,s=1,o=0;switch(e.forEach(e=>{e.uptime&&+e.uptime>o&&(o=+e.uptime)}),!0){case o<t:this.timeUnit="Mins:Secs",i=60,s=1;break;case o>=t&&o<n:this.timeUnit="Hrs:Mins",i=t,s=60;break;case o>=n&&o<a:this.timeUnit="Days:Hrs",i=n,s=t;break;case o>a:this.timeUnit="Yrs:Days",i=a,s=n;break;default:this.timeUnit="Mins:Secs",i=60,s=1}return e.forEach(e=>{e.uptime_str=e.uptime?this.decimalPipe.transform(Math.floor(+e.uptime/i),"2.0-0")+":"+this.decimalPipe.transform(Math.round(+e.uptime%i/s),"2.0-0"):"---"}),e}onLoopOut(e){this.loopService.getLoopOutTermsAndQuotes(this.targetConf).pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{this.store.dispatch(new ee.wu({minHeight:"56rem",data:{channel:e,minQuote:t[0],maxQuote:t[1],direction:f.$I.LOOP_OUT,component:K.a}}))})}onDownloadCSV(){this.channels.data&&this.channels.data.length>0&&this.commonService.downloadFile(this.channels.data,"Open-channels")}percentHintFunction(e){return(e/1e4).toString()+"%"}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(St.V),o.Y36(Ft.l),o.Y36(C.v),o.Y36(te.W),o.Y36(a.JJ))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-channel-open-table"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"div",2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"input",4),o.NdJ("keyup",function(){return t.applyFilter()})("ngModelChange",function(e){return t.selFilter=e}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,ms,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,gs,2,0,"th",10),o.YNc(11,Cs,8,8,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,Ts,2,1,"th",13),o.YNc(14,bs,3,1,"td",11),o.BQk(),o.ynx(15,14),o.YNc(16,ws,2,0,"th",13),o.YNc(17,_s,4,3,"td",11),o.BQk(),o.ynx(18,15),o.YNc(19,vs,2,0,"th",13),o.YNc(20,qs,4,3,"td",11),o.BQk(),o.ynx(21,16),o.YNc(22,Ss,2,0,"th",13),o.YNc(23,Fs,4,3,"td",11),o.BQk(),o.ynx(24,17),o.YNc(25,Ls,2,0,"th",13),o.YNc(26,ks,4,3,"td",11),o.BQk(),o.ynx(27,18),o.YNc(28,Ns,2,0,"th",19),o.YNc(29,Us,6,4,"td",20),o.BQk(),o.ynx(30,21),o.YNc(31,Is,8,0,"th",22),o.YNc(32,Ds,14,2,"td",23),o.BQk(),o.ynx(33,24),o.YNc(34,Ys,5,4,"td",25),o.BQk(),o.YNc(35,Bs,1,3,"tr",26),o.YNc(36,Gs,1,0,"tr",27),o.YNc(37,Hs,1,0,"tr",28),o.qZA(),o.qZA(),o._UZ(38,"mat-paginator",29),o.qZA()),2&e&&(o.xp6(4),o.Q6J("ngModel",t.selFilter),o.xp6(2),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchAllChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.channels)("ngClass",o.VKq(11,zs,""!==t.errorMessage)),o.xp6(28),o.Q6J("matFooterRowDef",o.DdM(13,Vs)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,D.KE,Ce.Nt,Ae.Fj,Ae.JJ,Ae.On,E.$V,a.O5,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,R.gM,T.BN,D.bx,we.gD,we.$L,ve.ey,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.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-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-uptime[_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-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-uptime[_ngcontent-%COMP%]{white-space:unset;flex:1 1 25%;width:25%}}@media only screen and (max-width:56.25em){.mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-uptime[_ngcontent-%COMP%]{flex:0 0 15%;width:15%}}@media only screen and (max-width:37.5em){.mat-column-local_balance[_ngcontent-%COMP%], .mat-column-remote_balance[_ngcontent-%COMP%], .mat-column-total_satoshis_received[_ngcontent-%COMP%], .mat-column-total_satoshis_sent[_ngcontent-%COMP%], .mat-column-uptime[_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%}}"]}),e})();const Xs=["outputIdx"];function $s(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Index for change output is required."),o.qZA())}function js(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Invalid index value."),o.qZA())}function Ks(e,t){if(1&e&&(o.TgZ(0,"mat-option",29),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.id),o.xp6(1),o.hij(" ",e.name," ")}}function eo(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Number of blocks is required."),o.qZA())}function to(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",17),o.TgZ(1,"input",30,31),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().blocks=t}),o.qZA(),o.YNc(3,eo,2,0,"mat-error",20),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngModel",e.blocks)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.blocks)}}function no(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Fees is required."),o.qZA())}function ao(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",17),o.TgZ(1,"input",32,33),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().fees=t}),o.qZA(),o.YNc(3,no,2,0,"mat-error",20),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngModel",e.fees)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.fees)}}function io(e,t){if(1&e&&(o.TgZ(0,"div",34),o._UZ(1,"fa-icon",13),o.TgZ(2,"span"),o._uU(3),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(2),o.Oqu(e.bumpFeeError)}}let so=(()=>{class e{constructor(e,t,n,a,i){this.dialogRef=e,this.data=t,this.logger=n,this.dataService=a,this.snackBar=i,this.transTypes=[...f.Dr],this.selTransType="2",this.blocks=null,this.fees=null,this.outputIndex=null,this.faCopy=g.kZ_,this.faInfoCircle=g.sqG,this.faExclamationTriangle=g.eHv,this.bumpFeeError="",this.unSubs=[new p.x,new p.x]}set payReq(e){e&&(this.outputIdx=e)}ngOnInit(){this.transTypes=this.transTypes.splice(1),this.bumpFeeChannel=this.data.pendingChannel;const e=this.bumpFeeChannel.channel&&this.bumpFeeChannel.channel.channel_point?this.bumpFeeChannel.channel.channel_point.split(":"):[];this.bumpFeeChannel.channel.txid_str=e[0]?e[0]:this.bumpFeeChannel.channel&&this.bumpFeeChannel.channel.channel_point?this.bumpFeeChannel.channel.channel_point:"",this.bumpFeeChannel.channel.output_index=e[1]?+e[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:e=>{this.dialogRef.close(!1)},error:e=>{this.logger.error(e),this.bumpFeeError=e.message?e.message:e}})}onCopyID(e){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(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(Z.mQ),o.Y36(dt.D),o.Y36(Ai.ux))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-bump-fee"]],viewQuery:function(e,t){if(1&e&&o.Gf(Xs,5),2&e){let e;o.iGM(e=o.CRH())&&(t.payReq=e.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-stroked-button","","color","primary","type","reset","tabindex","5","default","",1,"mr-1",3,"click"],["mat-flat-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(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Bump Fee"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o.NdJ("click",function(){return t.onClose()}),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7),o.TgZ(10,"div",8),o.TgZ(11,"p",9),o._uU(12),o.TgZ(13,"fa-icon",10),o.NdJ("copied",function(e){return t.onCopyID(e)}),o.qZA(),o.qZA(),o.TgZ(14,"div",11),o.TgZ(15,"div",12),o._UZ(16,"fa-icon",13),o.TgZ(17,"span",14),o._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. "),o.TgZ(19,"div"),o._uU(20,"Before attempting fee bump ensure the following:"),o.qZA(),o.TgZ(21,"div",15),o._uU(22,"1: Use a Bitcoin block explorer to ensure that channel opening transaction is not confirmed."),o.qZA(),o.TgZ(23,"div",15),o._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."),o.qZA(),o.TgZ(25,"div",15),o._uU(26,"3: Find the index value of the change output via a block explorer."),o.qZA(),o.TgZ(27,"div",15),o._uU(28,"4: Enter the index value of the change output in the form below and the desired fee rate."),o.qZA(),o.TgZ(29,"div",15),o._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."),o.qZA(),o.qZA(),o.qZA(),o.TgZ(31,"div",16),o.TgZ(32,"mat-form-field",17),o.TgZ(33,"input",18,19),o.NdJ("ngModelChange",function(e){return t.outputIndex=e}),o.qZA(),o.YNc(35,$s,2,0,"mat-error",20),o.YNc(36,js,2,0,"mat-error",20),o.qZA(),o.TgZ(37,"mat-form-field",21),o.TgZ(38,"mat-select",22),o.NdJ("valueChange",function(e){return t.selTransType=e})("selectionChange",function(){return t.blocks=null,t.fees=null}),o.YNc(39,Ks,2,2,"mat-option",23),o.qZA(),o.qZA(),o.YNc(40,to,4,4,"mat-form-field",24),o.YNc(41,ao,4,4,"mat-form-field",24),o.qZA(),o.YNc(42,io,4,2,"div",25),o.qZA(),o.qZA(),o.TgZ(43,"div",26),o.TgZ(44,"button",27),o.NdJ("click",function(){return t.resetData()}),o._uU(45,"Clear"),o.qZA(),o.TgZ(46,"button",28),o.NdJ("click",function(){return t.onBumpFee()}),o._uU(47),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.MAs(34);o.xp6(12),o.hij("Bump fee for channel point: ",null==t.bumpFeeChannel||null==t.bumpFeeChannel.channel?null:t.bumpFeeChannel.channel.channel_point," "),o.xp6(1),o.Q6J("icon",t.faCopy)("payload",null==t.bumpFeeChannel||null==t.bumpFeeChannel.channel?null:t.bumpFeeChannel.channel.txid_str),o.xp6(3),o.Q6J("icon",t.faInfoCircle),o.xp6(17),o.Q6J("ngModel",t.outputIndex)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",null==e.errors?null:e.errors.required),o.xp6(1),o.Q6J("ngIf",null==e.errors?null:e.errors.pendingChannelOutputIndex),o.xp6(2),o.Q6J("value",t.selTransType),o.xp6(1),o.Q6J("ngForOf",t.transTypes),o.xp6(1),o.Q6J("ngIf","1"===t.selTransType),o.xp6(1),o.Q6J("ngIf","2"===t.selTransType),o.xp6(1),o.Q6J("ngIf",""!==t.bumpFeeError),o.xp6(5),o.Oqu(""!==t.bumpFeeError?"Retry Bump Fee":"Bump Fee")}},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,w.dn,Ae._Y,Ae.JL,Ae.F,T.BN,D.R9,Ci.y,R.gM,D.KE,Ce.Nt,Ae.wV,Ae.qQ,Ae.Fj,be.q,Ae.Q7,Ae.JJ,Ae.On,a.O5,we.gD,a.sg,D.TO,ve.ey],styles:[""]}),e})();function oo(e,t){1&e&&o._UZ(0,"mat-progress-bar",36)}function lo(e,t){1&e&&o._UZ(0,"mat-progress-bar",36)}function ro(e,t){1&e&&(o.TgZ(0,"mat-header-cell",37),o._uU(1," Peer "),o.qZA())}const co=function(e){return{"max-width":e}};function uo(e,t){if(1&e&&(o.TgZ(0,"mat-cell",38),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,co,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),o.xp6(1),o.Oqu(e.channel.remote_alias)}}function po(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1,"Commit Fee (Sats) "),o.qZA())}function ho(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.commit_fee))}}function mo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1,"Commit Weight "),o.qZA())}function go(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.commit_weight))}}function fo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1,"Capacity (Sats)"),o.qZA())}function xo(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.capacity))}}function Zo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",41),o._uU(1,"Actions"),o.qZA())}function yo(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-cell",42),o.TgZ(1,"div",43),o.TgZ(2,"mat-select",44),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",45),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onOpenClick(t)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",45),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onBumpFee(t)}),o._uU(7,"Bump Fee"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Ao(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No pending channel."),o.qZA())}function Co(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting pending channels..."),o.qZA())}function To(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function bo(e,t){if(1&e&&(o.TgZ(0,"td",46),o.YNc(1,Ao,2,0,"p",47),o.YNc(2,Co,2,0,"p",47),o.YNc(3,To,2,1,"p",47),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!e.pendingOpenChannels||!(null!=e.pendingOpenChannels&&e.pendingOpenChannels.data)||(null==e.pendingOpenChannels||null==e.pendingOpenChannels.data?null:e.pendingOpenChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!e.pendingOpenChannels||!(null!=e.pendingOpenChannels&&e.pendingOpenChannels.data)||(null==e.pendingOpenChannels||null==e.pendingOpenChannels.data?null:e.pendingOpenChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!e.pendingOpenChannels||!(null!=e.pendingOpenChannels&&e.pendingOpenChannels.data)||(null==e.pendingOpenChannels||null==e.pendingOpenChannels.data?null:e.pendingOpenChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.ERROR)}}const wo=function(e){return{"display-none":e}};function _o(e,t){if(1&e&&o._UZ(0,"tr",48),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,wo,e.pendingOpenChannels&&(null==e.pendingOpenChannels?null:e.pendingOpenChannels.data)&&(null==e.pendingOpenChannels||null==e.pendingOpenChannels.data?null:e.pendingOpenChannels.data.length)>0))}}function vo(e,t){1&e&&o._UZ(0,"mat-header-row")}function qo(e,t){1&e&&o._UZ(0,"mat-row",49)}function So(e,t){1&e&&o._UZ(0,"mat-progress-bar",36)}function Fo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",37),o._uU(1," Peer "),o.qZA())}function Lo(e,t){if(1&e&&(o.TgZ(0,"mat-cell",38),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,co,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),o.xp6(1),o.Oqu(e.channel.remote_alias)}}function ko(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1,"Recovered Balance (Sats) "),o.qZA())}function No(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.recovered_balance))}}function Uo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1,"Limbo Balance (Sats) "),o.qZA())}function Io(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.limbo_balance))}}function Oo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1,"Capacity (Sats) "),o.qZA())}function Jo(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.capacity))}}function Do(e,t){1&e&&(o.TgZ(0,"mat-header-cell",50),o._uU(1,"Actions"),o.qZA())}function Ro(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-cell",51),o.TgZ(1,"button",52),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onForceClosingClick(t)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function Mo(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No pending channel."),o.qZA())}function Eo(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting pending channels..."),o.qZA())}function Qo(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function Yo(e,t){if(1&e&&(o.TgZ(0,"td",46),o.YNc(1,Mo,2,0,"p",47),o.YNc(2,Eo,2,0,"p",47),o.YNc(3,Qo,2,1,"p",47),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!e.pendingForceClosingChannels||!(null!=e.pendingForceClosingChannels&&e.pendingForceClosingChannels.data)||(null==e.pendingForceClosingChannels||null==e.pendingForceClosingChannels.data?null:e.pendingForceClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!e.pendingForceClosingChannels||!(null!=e.pendingForceClosingChannels&&e.pendingForceClosingChannels.data)||(null==e.pendingForceClosingChannels||null==e.pendingForceClosingChannels.data?null:e.pendingForceClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!e.pendingForceClosingChannels||!(null!=e.pendingForceClosingChannels&&e.pendingForceClosingChannels.data)||(null==e.pendingForceClosingChannels||null==e.pendingForceClosingChannels.data?null:e.pendingForceClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.ERROR)}}function Po(e,t){if(1&e&&o._UZ(0,"tr",48),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,wo,e.pendingForceClosingChannels&&(null==e.pendingForceClosingChannels?null:e.pendingForceClosingChannels.data)&&(null==e.pendingForceClosingChannels||null==e.pendingForceClosingChannels.data?null:e.pendingForceClosingChannels.data.length)>0))}}function Bo(e,t){1&e&&o._UZ(0,"mat-header-row")}function Go(e,t){1&e&&o._UZ(0,"mat-row",49)}function Ho(e,t){1&e&&o._UZ(0,"mat-progress-bar",36)}function zo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",53),o._uU(1," Peer "),o.qZA())}function Vo(e,t){if(1&e&&(o.TgZ(0,"mat-cell",54),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,co,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),o.xp6(1),o.Oqu(e.channel.remote_alias)}}function Wo(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1," Local Balance (Sats) "),o.qZA())}function Xo(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.local_balance))}}function $o(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1," Remote Balance (Sats) "),o.qZA())}function jo(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.remote_balance))}}function Ko(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1," Capacity (Sats) "),o.qZA())}function el(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.capacity))}}function tl(e,t){1&e&&(o.TgZ(0,"mat-header-cell",50),o._uU(1,"Actions"),o.qZA())}function nl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-cell",51),o.TgZ(1,"button",55),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onClosingClick(t)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function al(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No pending channel."),o.qZA())}function il(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting pending channels..."),o.qZA())}function sl(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function ol(e,t){if(1&e&&(o.TgZ(0,"td",46),o.YNc(1,al,2,0,"p",47),o.YNc(2,il,2,0,"p",47),o.YNc(3,sl,2,1,"p",47),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!e.pendingClosingChannels||!(null!=e.pendingClosingChannels&&e.pendingClosingChannels.data)||(null==e.pendingClosingChannels||null==e.pendingClosingChannels.data?null:e.pendingClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!e.pendingClosingChannels||!(null!=e.pendingClosingChannels&&e.pendingClosingChannels.data)||(null==e.pendingClosingChannels||null==e.pendingClosingChannels.data?null:e.pendingClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!e.pendingClosingChannels||!(null!=e.pendingClosingChannels&&e.pendingClosingChannels.data)||(null==e.pendingClosingChannels||null==e.pendingClosingChannels.data?null:e.pendingClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.ERROR)}}function ll(e,t){if(1&e&&o._UZ(0,"tr",48),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,wo,e.pendingClosingChannels&&(null==e.pendingClosingChannels?null:e.pendingClosingChannels.data)&&(null==e.pendingClosingChannels||null==e.pendingClosingChannels.data?null:e.pendingClosingChannels.data.length)>0))}}function rl(e,t){1&e&&o._UZ(0,"mat-header-row")}function cl(e,t){1&e&&o._UZ(0,"mat-row",49)}function ul(e,t){1&e&&o._UZ(0,"mat-progress-bar",36)}function pl(e,t){1&e&&(o.TgZ(0,"mat-header-cell",53),o._uU(1," Peer "),o.qZA())}function dl(e,t){if(1&e&&(o.TgZ(0,"mat-cell",54),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,co,n.screenSize===n.screenSizeEnum.XS?"10rem":"30rem")),o.xp6(1),o.Oqu(e.channel.remote_alias)}}function hl(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1," Limbo Balance (Sats) "),o.qZA())}function ml(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij("",o.lcZ(2,1,e.limbo_balance)," ")}}function gl(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1," Local Balance (Sats) "),o.qZA())}function fl(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.local_balance))}}function xl(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1," Remote Balance (Sats) "),o.qZA())}function Zl(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.remote_balance))}}function yl(e,t){1&e&&(o.TgZ(0,"mat-header-cell",39),o._uU(1," Capacity (Sats) "),o.qZA())}function Al(e,t){if(1&e&&(o.TgZ(0,"mat-cell",40),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.channel.capacity))}}function Cl(e,t){1&e&&(o.TgZ(0,"mat-header-cell",50),o._uU(1,"Actions"),o.qZA())}function Tl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-cell",51),o.TgZ(1,"button",56),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onWaitClosingClick(t)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function bl(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No pending channel."),o.qZA())}function wl(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting pending channels..."),o.qZA())}function _l(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function vl(e,t){if(1&e&&(o.TgZ(0,"td",46),o.YNc(1,bl,2,0,"p",47),o.YNc(2,wl,2,0,"p",47),o.YNc(3,_l,2,1,"p",47),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!e.pendingWaitClosingChannels||!(null!=e.pendingWaitClosingChannels&&e.pendingWaitClosingChannels.data)||(null==e.pendingWaitClosingChannels||null==e.pendingWaitClosingChannels.data?null:e.pendingWaitClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!e.pendingWaitClosingChannels||!(null!=e.pendingWaitClosingChannels&&e.pendingWaitClosingChannels.data)||(null==e.pendingWaitClosingChannels||null==e.pendingWaitClosingChannels.data?null:e.pendingWaitClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!e.pendingWaitClosingChannels||!(null!=e.pendingWaitClosingChannels&&e.pendingWaitClosingChannels.data)||(null==e.pendingWaitClosingChannels||null==e.pendingWaitClosingChannels.data?null:e.pendingWaitClosingChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchPendingChannels.status)===e.apiCallStatusEnum.ERROR)}}const ql=function(e){return{"py-0":!0,"display-none":e}};function Sl(e,t){if(1&e&&o._UZ(0,"tr",48),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,ql,e.pendingWaitClosingChannels&&(null==e.pendingWaitClosingChannels?null:e.pendingWaitClosingChannels.data)&&(null==e.pendingWaitClosingChannels||null==e.pendingWaitClosingChannels.data?null:e.pendingWaitClosingChannels.data.length)>0))}}function Fl(e,t){1&e&&o._UZ(0,"mat-header-row")}function Ll(e,t){1&e&&o._UZ(0,"mat-row",49)}const kl=function(e){return{"error-border bordered-box":e,"bordered-box":!0}},Nl=function(){return["no_pending_open"]},Ul=function(){return["no_pending_force_closing"]},Il=function(){return["no_pending_closing"]},Ol=function(){return["no_pending_wait_closing"]};let Jl=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.commonService=n,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=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.displayedOpenColumns=["remote_alias","actions"],this.displayedForceClosingColumns=["remote_alias","actions"],this.displayedClosingColumns=["remote_alias","actions"],this.displayedWaitClosingColumns=["remote_alias","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchPendingChannels.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchPendingChannels.message?JSON.stringify(this.apisCallStatus.FetchPendingChannels.message):this.apisCallStatus.FetchPendingChannels.message),this.selNode=e.nodeSettings,this.information=e.information,this.pendingChannels=e.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(e)})}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(e){const t=JSON.parse(JSON.stringify(e,["commit_weight","confirmation_height","fee_per_kw","commit_fee"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a={};Object.assign(a,t,n),this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Opening Channel Information",message:[[{key:"channel_point",value:a.channel_point,title:"Channel Point",width:100,type:f.Gi.STRING}],[{key:"remote_alias",value:a.remote_alias,title:"Peer Alias",width:25,type:f.Gi.STRING},{key:"remote_node_pub",value:a.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.Gi.STRING}],[{key:"capacity",value:a.capacity,title:"Capacity",width:25,type:f.Gi.NUMBER},{key:"confirmation_height",value:a.confirmation_height,title:"Confirmation Height",width:25,type:f.Gi.NUMBER},{key:"local_balance",value:a.local_balance,title:"Local Balance",width:25,type:f.Gi.NUMBER},{key:"remote_balance",value:a.remote_balance,title:"Remote Balance",width:25,type:f.Gi.NUMBER}],[{key:"fee_per_kw",value:a.fee_per_kw,title:"Fee/KW",width:25,type:f.Gi.NUMBER},{key:"commit_weight",value:a.commit_weight,title:"Commit Weight",width:25,type:f.Gi.NUMBER},{key:"commit_fee",value:a.commit_fee,title:"Commit Fee",width:50,type:f.Gi.NUMBER}]]}}))}onBumpFee(e){this.store.dispatch(new ee.wu({data:{pendingChannel:e,component:so}}))}onForceClosingClick(e){const t=JSON.parse(JSON.stringify(e,["closing_txid","limbo_balance","maturity_height","blocks_til_maturity","recovered_balance"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a={};Object.assign(a,t,n),this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Force Closing Channel Information",message:[[{key:"closing_txid",value:a.closing_txid,title:"Closing Transaction ID",width:100,type:f.Gi.STRING}],[{key:"channel_point",value:a.channel_point,title:"Channel Point",width:100,type:f.Gi.STRING}],[{key:"remote_alias",value:a.remote_alias,title:"Peer Alias",width:25,type:f.Gi.STRING},{key:"remote_node_pub",value:a.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.Gi.STRING}],[{key:"capacity",value:a.capacity,title:"Capacity",width:25,type:f.Gi.NUMBER},{key:"limbo_balance",value:a.limbo_balance,title:"Limbo Balance",width:25,type:f.Gi.NUMBER},{key:"local_balance",value:a.local_balance,title:"Local Balance",width:25,type:f.Gi.NUMBER},{key:"remote_balance",value:a.remote_balance,title:"Remote Balance",width:25,type:f.Gi.NUMBER}],[{key:"maturity_height",value:a.maturity_height,title:"Maturity Height",width:25,type:f.Gi.NUMBER},{key:"blocks_til_maturity",value:a.blocks_til_maturity,title:"Blocks Till Maturity",width:25,type:f.Gi.NUMBER},{key:"recovered_balance",value:a.recovered_balance,title:"Recovered Balance",width:50,type:f.Gi.NUMBER}]]}}))}onClosingClick(e){const t=JSON.parse(JSON.stringify(e,["closing_txid"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a={};Object.assign(a,t,n),this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Closing Channel Information",message:[[{key:"closing_txid",value:a.closing_txid,title:"Closing Transaction ID",width:50,type:f.Gi.STRING}],[{key:"channel_point",value:a.channel_point,title:"Channel Point",width:100,type:f.Gi.STRING}],[{key:"remote_alias",value:a.remote_alias,title:"Peer Alias",width:25,type:f.Gi.STRING},{key:"remote_node_pub",value:a.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.Gi.STRING}],[{key:"capacity",value:a.capacity,title:"Capacity",width:25,type:f.Gi.NUMBER},{key:"local_balance",value:a.local_balance,title:"Local Balance",width:25,type:f.Gi.NUMBER},{key:"remote_balance",value:a.remote_balance,title:"Remote Balance",width:50,type:f.Gi.NUMBER}]]}}))}onWaitClosingClick(e){const t=JSON.parse(JSON.stringify(e,["limbo_balance"],2)),n=JSON.parse(JSON.stringify(e.channel,["remote_alias","channel_point","remote_balance","local_balance","remote_node_pub","capacity"],2)),a=JSON.parse(JSON.stringify(e.commitments,["local_txid"],2)),i={};Object.assign(i,t,n,a),this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Wait Closing Channel Information",message:[[{key:"local_txid",value:i.local_txid,title:"Transaction ID",width:100,type:f.Gi.STRING}],[{key:"channel_point",value:i.channel_point,title:"Channel Point",width:100,type:f.Gi.STRING}],[{key:"remote_alias",value:i.remote_alias,title:"Peer Alias",width:25,type:f.Gi.STRING},{key:"remote_node_pub",value:i.remote_node_pub,title:"Peer Node Pubkey",width:75,type:f.Gi.STRING}],[{key:"capacity",value:i.capacity,title:"Capacity",width:25,type:f.Gi.NUMBER},{key:"limbo_balance",value:i.limbo_balance,title:"Limbo Balance",width:25,type:f.Gi.NUMBER},{key:"local_balance",value:i.local_balance,title:"Local Balance",width:25,type:f.Gi.NUMBER},{key:"remote_balance",value:i.remote_balance,title:"Remote Balance",width:25,type:f.Gi.NUMBER}]]}}))}loadOpenChannelsTable(e){e.sort((e,t)=>e.active===t.active?0:t.active?-1:1),this.pendingOpenChannelsLength=e.length?e.length:0,this.pendingOpenChannels=new Ze.by([...e]),this.pendingOpenChannels.sort=this.sort,this.pendingOpenChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingOpenChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingOpenChannels)}loadForceClosingChannelsTable(e){e.sort((e,t)=>e.active===t.active?0:t.active?-1:1),this.pendingForceClosingChannelsLength=e.length?e.length:0,this.pendingForceClosingChannels=new Ze.by([...e]),this.pendingForceClosingChannels.sort=this.sort,this.pendingForceClosingChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingForceClosingChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingForceClosingChannels)}loadClosingChannelsTable(e){e.sort((e,t)=>e.active===t.active?0:t.active?-1:1),this.pendingClosingChannelsLength=e.length?e.length:0,this.pendingClosingChannels=new Ze.by([...e]),this.pendingClosingChannels.sort=this.sort,this.pendingClosingChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingClosingChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingClosingChannels)}loadWaitClosingChannelsTable(e){e.sort((e,t)=>e.active===t.active?0:t.active?-1:1),this.pendingWaitClosingChannelsLength=e.length?e.length:0,this.pendingWaitClosingChannels=new Ze.by([...e]),this.pendingWaitClosingChannels.sort=this.sort,this.pendingWaitClosingChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.pendingWaitClosingChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.logger.info(this.pendingWaitClosingChannels)}applyFilter(e){this.selectedFilter=e.trim().toLowerCase()}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-channel-pending-table"]],viewQuery:function(e,t){if(1&e&&o.Gf(xe.YE,5),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"span",1),o._uU(2),o.ALo(3,"number"),o.qZA(),o.TgZ(4,"mat-accordion",2),o.YNc(5,oo,1,0,"mat-progress-bar",3),o.TgZ(6,"mat-expansion-panel",4),o.TgZ(7,"mat-expansion-panel-header"),o.TgZ(8,"mat-panel-title"),o._uU(9),o.qZA(),o.qZA(),o.TgZ(10,"div",5),o.YNc(11,lo,1,0,"mat-progress-bar",3),o.TgZ(12,"table",6,7),o.ynx(14,8),o.YNc(15,ro,2,0,"mat-header-cell",9),o.YNc(16,uo,2,4,"mat-cell",10),o.BQk(),o.ynx(17,11),o.YNc(18,po,2,0,"mat-header-cell",12),o.YNc(19,ho,3,3,"mat-cell",13),o.BQk(),o.ynx(20,14),o.YNc(21,mo,2,0,"mat-header-cell",12),o.YNc(22,go,3,3,"mat-cell",13),o.BQk(),o.ynx(23,15),o.YNc(24,fo,2,0,"mat-header-cell",12),o.YNc(25,xo,3,3,"mat-cell",13),o.BQk(),o.ynx(26,16),o.YNc(27,Zo,2,0,"mat-header-cell",17),o.YNc(28,yo,8,0,"mat-cell",18),o.BQk(),o.ynx(29,19),o.YNc(30,bo,4,3,"td",20),o.BQk(),o.YNc(31,_o,1,3,"tr",21),o.YNc(32,vo,1,0,"mat-header-row",22),o.YNc(33,qo,1,0,"mat-row",23),o.qZA(),o.qZA(),o.qZA(),o.YNc(34,So,1,0,"mat-progress-bar",3),o.TgZ(35,"mat-expansion-panel",4),o.TgZ(36,"mat-expansion-panel-header"),o.TgZ(37,"mat-panel-title"),o._uU(38),o.qZA(),o.qZA(),o.TgZ(39,"div",5),o.TgZ(40,"table",24,7),o.ynx(42,8),o.YNc(43,Fo,2,0,"mat-header-cell",9),o.YNc(44,Lo,2,4,"mat-cell",10),o.BQk(),o.ynx(45,25),o.YNc(46,ko,2,0,"mat-header-cell",12),o.YNc(47,No,3,3,"mat-cell",13),o.BQk(),o.ynx(48,26),o.YNc(49,Uo,2,0,"mat-header-cell",12),o.YNc(50,Io,3,3,"mat-cell",13),o.BQk(),o.ynx(51,15),o.YNc(52,Oo,2,0,"mat-header-cell",12),o.YNc(53,Jo,3,3,"mat-cell",13),o.BQk(),o.ynx(54,16),o.YNc(55,Do,2,0,"mat-header-cell",27),o.YNc(56,Ro,3,0,"mat-cell",28),o.BQk(),o.ynx(57,29),o.YNc(58,Yo,4,3,"td",20),o.BQk(),o.YNc(59,Po,1,3,"tr",21),o.YNc(60,Bo,1,0,"mat-header-row",22),o.YNc(61,Go,1,0,"mat-row",23),o.qZA(),o.qZA(),o.qZA(),o.YNc(62,Ho,1,0,"mat-progress-bar",3),o.TgZ(63,"mat-expansion-panel",4),o.TgZ(64,"mat-expansion-panel-header"),o.TgZ(65,"mat-panel-title"),o._uU(66),o.qZA(),o.qZA(),o.TgZ(67,"div",5),o.TgZ(68,"table",24,7),o.ynx(70,8),o.YNc(71,zo,2,0,"mat-header-cell",30),o.YNc(72,Vo,2,4,"mat-cell",31),o.BQk(),o.ynx(73,32),o.YNc(74,Wo,2,0,"mat-header-cell",12),o.YNc(75,Xo,3,3,"mat-cell",13),o.BQk(),o.ynx(76,33),o.YNc(77,$o,2,0,"mat-header-cell",12),o.YNc(78,jo,3,3,"mat-cell",13),o.BQk(),o.ynx(79,15),o.YNc(80,Ko,2,0,"mat-header-cell",12),o.YNc(81,el,3,3,"mat-cell",13),o.BQk(),o.ynx(82,16),o.YNc(83,tl,2,0,"mat-header-cell",27),o.YNc(84,nl,3,0,"mat-cell",28),o.BQk(),o.ynx(85,34),o.YNc(86,ol,4,3,"td",20),o.BQk(),o.YNc(87,ll,1,3,"tr",21),o.YNc(88,rl,1,0,"mat-header-row",22),o.YNc(89,cl,1,0,"mat-row",23),o.qZA(),o.qZA(),o.qZA(),o.YNc(90,ul,1,0,"mat-progress-bar",3),o.TgZ(91,"mat-expansion-panel",4),o.TgZ(92,"mat-expansion-panel-header"),o.TgZ(93,"mat-panel-title"),o._uU(94),o.qZA(),o.qZA(),o.TgZ(95,"div",5),o.TgZ(96,"table",24,7),o.ynx(98,8),o.YNc(99,pl,2,0,"mat-header-cell",30),o.YNc(100,dl,2,4,"mat-cell",31),o.BQk(),o.ynx(101,26),o.YNc(102,hl,2,0,"mat-header-cell",12),o.YNc(103,ml,3,3,"mat-cell",13),o.BQk(),o.ynx(104,32),o.YNc(105,gl,2,0,"mat-header-cell",12),o.YNc(106,fl,3,3,"mat-cell",13),o.BQk(),o.ynx(107,33),o.YNc(108,xl,2,0,"mat-header-cell",12),o.YNc(109,Zl,3,3,"mat-cell",13),o.BQk(),o.ynx(110,15),o.YNc(111,yl,2,0,"mat-header-cell",12),o.YNc(112,Al,3,3,"mat-cell",13),o.BQk(),o.ynx(113,16),o.YNc(114,Cl,2,0,"mat-header-cell",27),o.YNc(115,Tl,3,0,"mat-cell",28),o.BQk(),o.ynx(116,35),o.YNc(117,vl,4,3,"td",20),o.BQk(),o.YNc(118,Sl,1,3,"tr",21),o.YNc(119,Fl,1,0,"mat-header-row",22),o.YNc(120,Ll,1,0,"mat-row",23),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(2),o.hij("Total Limbo Balance: ",o.lcZ(3,30,t.pendingChannels.total_limbo_balance)," Sats"),o.xp6(3),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPendingChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(4),o.hij("Pending Open (",t.pendingOpenChannelsLength,")"),o.xp6(2),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPendingChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.pendingOpenChannels)("ngClass",o.VKq(32,kl,""!==t.errorMessage)),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(34,Nl)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedOpenColumns),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedOpenColumns),o.xp6(1),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPendingChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(4),o.hij("Pending Force Closing (",t.pendingForceClosingChannelsLength,")"),o.xp6(2),o.Q6J("dataSource",t.pendingForceClosingChannels)("ngClass",o.VKq(35,kl,""!==t.errorMessage)),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(37,Ul)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedForceClosingColumns),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedForceClosingColumns),o.xp6(1),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPendingChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(4),o.hij("Pending Closing (",t.pendingClosingChannelsLength,")"),o.xp6(2),o.Q6J("dataSource",t.pendingClosingChannels)("ngClass",o.VKq(38,kl,""!==t.errorMessage)),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(40,Il)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedClosingColumns),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedClosingColumns),o.xp6(1),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchPendingChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(4),o.hij("Waiting Close (",t.pendingWaitClosingChannelsLength,")"),o.xp6(2),o.Q6J("dataSource",t.pendingWaitClosingChannels)("ngClass",o.VKq(41,kl,""!==t.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(43,Ol)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedWaitClosingColumns),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedWaitClosingColumns))},directives:[l.xw,ht.pp,a.O5,ht.ib,ht.yz,ht.yK,l.Wh,l.yH,E.$V,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,we.gD,we.$L,ve.ey,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk,q.lW],pipes:[a.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}"]}),e})();function Dl(e,t){1&e&&o._UZ(0,"mat-progress-bar",28)}function Rl(e,t){1&e&&(o.TgZ(0,"th",29),o._uU(1," Close Type "),o.qZA())}function Ml(e,t){if(1&e&&(o.TgZ(0,"td",30),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("matTooltip",n.channelClosureType[e.close_type].tooltip),o.xp6(1),o.hij("",n.channelClosureType[e.close_type].name," ")}}function El(e,t){1&e&&(o.TgZ(0,"th",29),o._uU(1," Peer "),o.qZA())}const Ql=function(e){return{"max-width":e}};function Yl(e,t){if(1&e&&(o.TgZ(0,"td",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,Ql,n.screenSize===n.screenSizeEnum.XS?"10rem":"20rem")),o.xp6(1),o.hij(" ",e.remote_alias," ")}}function Pl(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Capacity "),o.qZA())}function Bl(e,t){if(1&e&&(o.TgZ(0,"td",33),o.TgZ(1,"span",34),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,e.capacity)," ")}}function Gl(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Close Height "),o.qZA())}function Hl(e,t){if(1&e&&(o.TgZ(0,"td",33),o.TgZ(1,"span",34),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,e.close_height)," ")}}function zl(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Settled Balance "),o.qZA())}function Vl(e,t){if(1&e&&(o.TgZ(0,"td",33),o.TgZ(1,"span",34),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,e.settled_balance)," ")}}function Wl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",35),o.TgZ(1,"div",36),o.TgZ(2,"mat-select",37),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",38),o.NdJ("click",function(){return o.CHM(e),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Xl(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",39),o.TgZ(1,"span",34),o.TgZ(2,"button",40),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw().onClosedChannelClick(n,t)}),o._uU(3,"View Info"),o.qZA(),o.qZA(),o.qZA()}}function $l(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No closed channel available."),o.qZA())}function jl(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting closed channels..."),o.qZA())}function Kl(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function er(e,t){if(1&e&&(o.TgZ(0,"td",41),o.YNc(1,$l,2,0,"p",42),o.YNc(2,jl,2,0,"p",42),o.YNc(3,Kl,2,1,"p",42),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=e.closedChannels&&e.closedChannels.data)||(null==e.closedChannels||null==e.closedChannels.data?null:e.closedChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchClosedChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.closedChannels&&e.closedChannels.data)||(null==e.closedChannels||null==e.closedChannels.data?null:e.closedChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchClosedChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.closedChannels&&e.closedChannels.data)||(null==e.closedChannels||null==e.closedChannels.data?null:e.closedChannels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchClosedChannels.status)===e.apiCallStatusEnum.ERROR)}}const tr=function(e){return{"display-none":e}};function nr(e,t){if(1&e&&o._UZ(0,"tr",43),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,tr,(null==e.closedChannels?null:e.closedChannels.data)&&(null==e.closedChannels||null==e.closedChannels.data?null:e.closedChannels.data.length)>0))}}function ar(e,t){1&e&&o._UZ(0,"tr",44)}function ir(e,t){1&e&&o._UZ(0,"tr",45)}const sr=function(e){return{"error-border":e,"overflow-auto":!0}},or=function(){return["no_closed_channel"]};let lr=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.commonService=n,this.channelClosureType=f.HW,this.faHistory=g.qO$,this.displayedColumns=[],this.closedChannelsData=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unsub=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["remote_alias","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.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("lnd").pipe((0,d.R)(this.unsub[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchClosedChannels.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchClosedChannels.message?JSON.stringify(this.apisCallStatus.FetchClosedChannels.message):this.apisCallStatus.FetchClosedChannels.message),this.closedChannelsData=e.closedChannels,this.closedChannelsData.length>0&&this.loadClosedChannelsTable(this.closedChannelsData),this.logger.info(e)})}ngAfterViewInit(){this.closedChannelsData.length>0&&this.loadClosedChannelsTable(this.closedChannelsData)}applyFilter(e){this.closedChannels.filter=e.value.trim().toLowerCase()}onClosedChannelClick(e,t){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Closed Channel Information",message:[[{key:"close_type",value:this.channelClosureType[e.close_type].name,title:"Close Type",width:30,type:f.Gi.STRING},{key:"settled_balance",value:e.settled_balance,title:"Settled Balance",width:30,type:f.Gi.NUMBER},{key:"time_locked_balance",value:e.time_locked_balance,title:"Time Locked Balance",width:40,type:f.Gi.NUMBER}],[{key:"chan_id",value:e.chan_id,title:"Channel ID",width:30},{key:"capacity",value:e.capacity,title:"Capacity",width:30,type:f.Gi.NUMBER},{key:"close_height",value:e.close_height,title:"Close Height",width:40,type:f.Gi.NUMBER}],[{key:"remote_alias",value:e.remote_alias,title:"Peer Alias",width:30},{key:"remote_pubkey",value:e.remote_pubkey,title:"Peer Public Key",width:70}],[{key:"channel_point",value:e.channel_point,title:"Channel Point",width:100}],[{key:"closing_tx_hash",value:e.closing_tx_hash,title:"Closing Transaction Hash",width:100,type:f.Gi.STRING}]]}}))}loadClosedChannelsTable(e){this.closedChannels=new Ze.by([...e]),this.closedChannels.sort=this.sort,this.closedChannels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.closedChannels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.closedChannels.paginator=this.paginator,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(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-channel-closed-table"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("Channels")}])],decls:33,vars:13,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,"keyup"],["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","",3,"matTooltip",4,"matCellDef"],["matColumnDef","remote_alias"],["mat-cell","",3,"ngStyle",4,"matCellDef"],["matColumnDef","capacity"],["mat-header-cell","","mat-sort-header","","arrowPosition","before",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["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","",3,"matTooltip"],["mat-cell","",3,"ngStyle"],["mat-header-cell","","mat-sort-header","","arrowPosition","before"],["mat-cell",""],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"div",2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"input",4),o.NdJ("keyup",function(e){return t.applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,Dl,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,Rl,2,0,"th",10),o.YNc(11,Ml,2,2,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,El,2,0,"th",10),o.YNc(14,Yl,2,4,"td",13),o.BQk(),o.ynx(15,14),o.YNc(16,Pl,2,0,"th",15),o.YNc(17,Bl,4,3,"td",16),o.BQk(),o.ynx(18,17),o.YNc(19,Gl,2,0,"th",15),o.YNc(20,Hl,4,3,"td",16),o.BQk(),o.ynx(21,18),o.YNc(22,zl,2,0,"th",15),o.YNc(23,Vl,4,3,"td",16),o.BQk(),o.ynx(24,19),o.YNc(25,Wl,6,0,"th",20),o.YNc(26,Xl,4,0,"td",21),o.BQk(),o.ynx(27,22),o.YNc(28,er,4,3,"td",23),o.BQk(),o.YNc(29,nr,1,3,"tr",24),o.YNc(30,ar,1,0,"tr",25),o.YNc(31,ir,1,0,"tr",26),o.qZA(),o.qZA(),o._UZ(32,"mat-paginator",27),o.qZA()),2&e&&(o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchClosedChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.closedChannels)("ngClass",o.VKq(10,sr,""!==t.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(12,or)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,D.KE,Ce.Nt,E.$V,a.O5,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,R.gM,a.PC,v.Zl,we.gD,we.$L,ve.ey,q.lW,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.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}"]}),e})();function rr(e,t){1&e&&o._UZ(0,"mat-progress-bar",27)}function cr(e,t){1&e&&(o.TgZ(0,"th",28),o._uU(1,"Amount (Sats)"),o.qZA())}function ur(e,t){if(1&e&&(o.TgZ(0,"span",33),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",o.lcZ(2,1,null==e?null:e.amount)," ")}}function pr(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,ur,3,3,"span",32),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.pending_htlcs)}}function dr(e,t){if(1&e&&(o.TgZ(0,"td",29),o.TgZ(1,"span",30),o._uU(2),o.qZA(),o.YNc(3,pr,2,1,"span",31),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" Active HTLCs: ",null==e||null==e.pending_htlcs?null:e.pending_htlcs.length," "),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function hr(e,t){1&e&&(o.TgZ(0,"th",28),o._uU(1,"Alias/Incoming"),o.qZA())}function mr(e,t){if(1&e&&(o.TgZ(0,"span",30),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",null!=e&&e.incoming?"Yes":"No"," ")}}function gr(e,t){if(1&e&&(o.ynx(0),o.YNc(1,mr,2,1,"span",34),o.BQk()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.pending_htlcs)}}function fr(e,t){if(1&e&&(o.TgZ(0,"td",29),o.TgZ(1,"span",30),o._uU(2),o.qZA(),o.YNc(3,gr,2,1,"ng-container",31),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(null==e?null:e.remote_alias),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function xr(e,t){1&e&&(o.TgZ(0,"th",35),o.TgZ(1,"span",36),o._uU(2,"Expiration Height"),o.qZA(),o.qZA())}function Zr(e,t){if(1&e&&(o.TgZ(0,"span",36),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",o.xi3(2,1,null==e?null:e.expiration_height,"1.0-0")," ")}}function yr(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,Zr,3,4,"span",37),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.pending_htlcs)}}function Ar(e,t){if(1&e&&(o.TgZ(0,"td",29),o.TgZ(1,"span",36),o._uU(2),o.qZA(),o.YNc(3,yr,2,1,"span",31),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(" "),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function Cr(e,t){1&e&&(o.TgZ(0,"th",38),o.TgZ(1,"span",36),o._uU(2,"Hash Lock"),o.qZA(),o.qZA())}function Tr(e,t){if(1&e&&(o.TgZ(0,"span",36),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",null==e?null:e.hash_lock," ")}}function br(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,Tr,2,1,"span",37),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.pending_htlcs)}}function wr(e,t){if(1&e&&(o.TgZ(0,"td",39),o.TgZ(1,"span",36),o._uU(2),o.qZA(),o.YNc(3,br,2,1,"span",31),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(" "),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function _r(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",40),o.TgZ(1,"div",41),o.TgZ(2,"mat-select",42),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",43),o.NdJ("click",function(){return o.CHM(e),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function vr(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",45),o.TgZ(1,"button",48),o.NdJ("click",function(){const t=o.CHM(e).$implicit,n=o.oxw(2).$implicit;return o.oxw().onHTLCClick(t,n)}),o._uU(2),o.qZA(),o.qZA()}if(2&e){const e=t.index;o.xp6(2),o.hij("View ",e+1,"")}}function qr(e,t){if(1&e&&(o.TgZ(0,"div"),o.YNc(1,vr,3,1,"div",47),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Q6J("ngForOf",null==e?null:e.pending_htlcs)}}function Sr(e,t){if(1&e&&(o.TgZ(0,"td",44),o.TgZ(1,"span",45),o.TgZ(2,"button",46),o.NdJ("click",function(){const e=t.$implicit;return e.is_expanded=!e.is_expanded}),o._uU(3),o.qZA(),o.qZA(),o.YNc(4,qr,2,1,"div",31),o.qZA()),2&e){const e=t.$implicit;o.xp6(3),o.Oqu(e.is_expanded?"Hide":"Show"),o.xp6(1),o.Q6J("ngIf",e.is_expanded)}}function Fr(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No active htlc available."),o.qZA())}function Lr(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting active htlcs..."),o.qZA())}function kr(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function Nr(e,t){if(1&e&&(o.TgZ(0,"td",49),o.YNc(1,Fr,2,0,"p",31),o.YNc(2,Lr,2,0,"p",31),o.YNc(3,kr,2,1,"p",31),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.ERROR)}}const Ur=function(e){return{"display-none":e}};function Ir(e,t){if(1&e&&o._UZ(0,"tr",50),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,Ur,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Or(e,t){1&e&&o._UZ(0,"tr",51)}function Jr(e,t){1&e&&o._UZ(0,"tr",52)}const Dr=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Rr=function(){return["no_channel"]};let Mr=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.channelsJSONArr=[],this.displayedColumns=[],this.htlcColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["amount","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["amount","incoming","actions"]):this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchAllChannels.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchAllChannels.message?JSON.stringify(this.apisCallStatus.FetchAllChannels.message):this.apisCallStatus.FetchAllChannels.message),this.channelsJSONArr=e.allChannels&&e.allChannels.length>0?e.allChannels.filter(e=>e.pending_htlcs&&e.pending_htlcs.length>0):[],this.loadHTLCsTable(this.channelsJSONArr),this.logger.info(e)})}ngAfterViewInit(){this.loadHTLCsTable(this.channelsJSONArr)}onHTLCClick(e,t){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"HTLC Information",message:[[{key:"remote_alias",value:t.remote_alias,title:"Alias",width:100,type:f.Gi.STRING}],[{key:"amount",value:e.amount,title:"Amount (Sats)",width:50,type:f.Gi.NUMBER},{key:"incoming",value:e.incoming?"Yes":"No",title:"Incoming",width:50,type:f.Gi.STRING}],[{key:"expiration_height",value:e.expiration_height,title:"Expiration Height",width:50,type:f.Gi.NUMBER},{key:"hash_lock",value:e.hash_lock,title:"Hash Lock",width:50,type:f.Gi.STRING}]]}}))}onChannelClick(e,t){this.store.dispatch(new ee.wu({data:{channel:e,showCopy:!0,component:Si}}))}applyFilter(e){this.channels.filter=e.value.trim().toLowerCase()}loadHTLCsTable(e){this.channels=new Ze.by(e?[...e]:[]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,t)=>{switch(t){case"amount":return this.commonService.sortByKey(e.pending_htlcs,t,"number",this.sort.direction),e.pending_htlcs&&e.pending_htlcs.length?e.pending_htlcs.length:null;case"incoming":return this.commonService.sortByKey(e.pending_htlcs,t,"boolean",this.sort.direction),e.remote_alias?e.remote_alias:e.remote_pubkey?e.remote_pubkey:null;case"expiration_height":case"hash_lock":return this.commonService.sortByKey(e.pending_htlcs,t,"number",this.sort.direction),e;default:return e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}},this.channels.paginator=this.paginator,this.channels.filterPredicate=(e,t)=>((e.remote_alias?e.remote_alias.toLowerCase():"")+e.pending_htlcs.map(e=>JSON.stringify(e)+(e.incoming?"yes":"no"))).includes(t)}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((e,t)=>e.concat(t.pending_htlcs?t.pending_htlcs:t),[])}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-channel-active-htlcs-table"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("HTLCs")}])],decls:30,vars:13,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,"keyup"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"div",2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"input",4),o.NdJ("keyup",function(e){return t.applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.YNc(6,rr,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,cr,2,0,"th",10),o.YNc(11,dr,4,2,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,hr,2,0,"th",10),o.YNc(14,fr,4,2,"td",11),o.BQk(),o.ynx(15,13),o.YNc(16,xr,3,0,"th",14),o.YNc(17,Ar,4,2,"td",11),o.BQk(),o.ynx(18,15),o.YNc(19,Cr,3,0,"th",16),o.YNc(20,wr,4,2,"td",17),o.BQk(),o.ynx(21,18),o.YNc(22,_r,6,0,"th",19),o.YNc(23,Sr,5,2,"td",20),o.BQk(),o.ynx(24,21),o.YNc(25,Nr,4,3,"td",22),o.BQk(),o.YNc(26,Ir,1,3,"tr",23),o.YNc(27,Or,1,0,"tr",24),o.YNc(28,Jr,1,0,"tr",25),o.qZA(),o.qZA(),o._UZ(29,"mat-paginator",26),o.qZA()),2&e&&(o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchAllChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.channels)("ngClass",o.VKq(10,Dr,""!==t.errorMessage)),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(12,Rr)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,D.KE,Ce.Nt,E.$V,a.O5,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,a.sg,we.gD,we.$L,ve.ey,q.lW,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.JJ],styles:[".mat-column-amount[_ngcontent-%COMP%], .mat-column-expiration_height[_ngcontent-%COMP%]{flex:0 0 30%;width:30%}.mat-column-hash_lock[_ngcontent-%COMP%], .mat-column-incoming[_ngcontent-%COMP%]{flex:0 0 25%;width:25%;text-overflow:ellipsis}.htlc-row-span[_ngcontent-%COMP%]{min-height:4.2rem}.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}"]}),e})();function Er(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Wallet password is required."),o.qZA())}let Qr=(()=>{class e{constructor(e){this.store=e,this.walletPassword=""}ngOnInit(){this.walletPassword=""}onUnlockWallet(){if(!this.walletPassword)return!0;this.store.dispatch(new x.l8({pwd:window.btoa(this.walletPassword)}))}resetData(){this.walletPassword=""}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"form",1),o.TgZ(2,"mat-form-field",2),o.TgZ(3,"input",3),o.NdJ("ngModelChange",function(e){return t.walletPassword=e}),o.qZA(),o.TgZ(4,"mat-hint"),o._uU(5,"Enter Wallet Password"),o.qZA(),o.YNc(6,Er,2,0,"mat-error",4),o.qZA(),o.TgZ(7,"div",5),o.TgZ(8,"button",6),o.NdJ("click",function(){return t.resetData()}),o._uU(9,"Clear Field"),o.qZA(),o.TgZ(10,"button",7),o.NdJ("click",function(){return t.onUnlockWallet()}),o._uU(11,"Unlock Wallet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.walletPassword),o.xp6(3),o.Q6J("ngIf",!t.walletPassword))},directives:[l.xw,Ae._Y,Ae.JL,Ae.F,l.Wh,D.KE,l.yH,Ce.Nt,Ae.Fj,Te.h,Ae.Q7,Ae.JJ,Ae.On,D.bx,a.O5,q.lW,D.TO],styles:[""]}),e})();var Yr=n(8544);function Pr(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div"),o.TgZ(1,"form",4),o.TgZ(2,"div",5),o._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?"),o.qZA(),o.TgZ(4,"div",6),o.TgZ(5,"button",7),o.NdJ("click",function(){o.CHM(e);const t=o.oxw();return t.proceed=!1,t.warnRes=!0}),o._uU(6,"Do Not Proceed"),o.qZA(),o.TgZ(7,"button",8),o.NdJ("click",function(){o.CHM(e);const t=o.oxw();return t.proceed=!0,t.warnRes=!0}),o._uU(8,"Proceed"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Br(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",9),o.TgZ(1,"div",10),o._uU(2,"Please re-configure & re-start RTL after securing your LND connction. You can close this window now."),o.qZA(),o.TgZ(3,"div",6),o.TgZ(4,"button",11),o.NdJ("click",function(){return o.CHM(e),o.oxw().warnRes=!1}),o._uU(5,"Go Back"),o.qZA(),o.qZA(),o.qZA()}}function Gr(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Password is required."),o.qZA())}function Hr(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Password must be at least 8 characters in length."),o.qZA())}function zr(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Confirm password is required."),o.qZA())}function Vr(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Confirm password must be at least 8 characters in length."),o.qZA())}function Wr(e,t){1&e&&(o.TgZ(0,"div",41),o.TgZ(1,"mat-icon",42),o._uU(2,"cancel"),o.qZA(),o._uU(3,"Passwords do not match. "),o.qZA())}function Xr(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Cipher seed is required."),o.qZA())}function $r(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Invalid Cipher. Enter comma separated 24 words cipher seed."),o.qZA())}function jr(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Passphrase is required."),o.qZA())}function Kr(e,t){1&e&&(o.TgZ(0,"mat-icon"),o._uU(1,"vpn_key"),o.qZA())}function ec(e,t){1&e&&(o.TgZ(0,"mat-icon"),o._uU(1,"swap_calls"),o.qZA())}function tc(e,t){1&e&&(o.TgZ(0,"mat-icon"),o._uU(1,"fingerprint"),o.qZA())}function nc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-vertical-stepper",12,13),o.TgZ(2,"mat-step",14),o.TgZ(3,"form",15),o.TgZ(4,"mat-form-field",16),o._UZ(5,"input",17),o.TgZ(6,"mat-hint"),o._uU(7,"Enter Wallet Password"),o.qZA(),o.YNc(8,Gr,2,0,"mat-error",1),o.YNc(9,Hr,2,0,"mat-error",1),o.qZA(),o.TgZ(10,"mat-form-field",16),o._UZ(11,"input",18),o.TgZ(12,"mat-hint"),o._uU(13,"Confirm Wallet Password"),o.qZA(),o.YNc(14,zr,2,0,"mat-error",1),o.YNc(15,Vr,2,0,"mat-error",1),o.qZA(),o.YNc(16,Wr,4,0,"div",19),o.TgZ(17,"div",20),o.TgZ(18,"button",21),o._uU(19,"Next"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(20,"mat-step",22),o.TgZ(21,"form",23),o.TgZ(22,"div",24),o.TgZ(23,"mat-slide-toggle",25),o._uU(24,"Existing Cipher"),o.qZA(),o.TgZ(25,"mat-form-field",26),o._UZ(26,"input",27),o.TgZ(27,"mat-hint"),o._uU(28,"Cipher Seed"),o.qZA(),o.YNc(29,Xr,2,0,"mat-error",1),o.YNc(30,$r,2,0,"mat-error",1),o.qZA(),o.qZA(),o.TgZ(31,"div",28),o.TgZ(32,"button",29),o._uU(33,"Back"),o.qZA(),o.TgZ(34,"button",30),o._uU(35,"Next"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(36,"mat-step",31),o.TgZ(37,"form",23),o.TgZ(38,"div",24),o.TgZ(39,"mat-slide-toggle",32),o._uU(40,"Existing Passphrase"),o.qZA(),o.TgZ(41,"mat-form-field",33),o._UZ(42,"input",34),o.TgZ(43,"mat-hint"),o._uU(44,"Enter Passphrase"),o.qZA(),o.YNc(45,jr,2,0,"mat-error",1),o.qZA(),o.qZA(),o.TgZ(46,"div",28),o.TgZ(47,"button",35),o.NdJ("click",function(){return o.CHM(e),o.oxw().resetData()}),o._uU(48,"Clear"),o.qZA(),o.TgZ(49,"button",36),o._uU(50,"Back"),o.qZA(),o.TgZ(51,"button",37),o.NdJ("click",function(){return o.CHM(e),o.oxw().onInitWallet()}),o._uU(52,"Initialize Wallet"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.YNc(53,Kr,2,0,"ng-template",38),o.YNc(54,ec,2,0,"ng-template",39),o.YNc(55,tc,2,0,"ng-template",40),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("linear",!0),o.xp6(2),o.Q6J("stepControl",e.passwordFormGroup),o.xp6(1),o.Q6J("formGroup",e.passwordFormGroup),o.xp6(5),o.Q6J("ngIf",null==e.passwordFormGroup.controls.initWalletPassword.errors?null:e.passwordFormGroup.controls.initWalletPassword.errors.required),o.xp6(1),o.Q6J("ngIf",null==e.passwordFormGroup.controls.initWalletPassword.errors?null:e.passwordFormGroup.controls.initWalletPassword.errors.minlength),o.xp6(5),o.Q6J("ngIf",null==e.passwordFormGroup.controls.initWalletConfirmPassword.errors?null:e.passwordFormGroup.controls.initWalletConfirmPassword.errors.required),o.xp6(1),o.Q6J("ngIf",null==e.passwordFormGroup.controls.initWalletConfirmPassword.errors?null:e.passwordFormGroup.controls.initWalletConfirmPassword.errors.minlength),o.xp6(1),o.Q6J("ngIf",(null==e.passwordFormGroup.errors?null:e.passwordFormGroup.errors.unmatchedPasswords)&&(e.passwordFormGroup.controls.initWalletPassword.touched||e.passwordFormGroup.controls.initWalletPassword.dirty)&&(e.passwordFormGroup.controls.initWalletConfirmPassword.touched||e.passwordFormGroup.controls.initWalletConfirmPassword.dirty)),o.xp6(4),o.Q6J("stepControl",e.cipherFormGroup),o.xp6(1),o.Q6J("formGroup",e.cipherFormGroup),o.xp6(2),o.Q6J("labelPosition","before"),o.xp6(6),o.Q6J("ngIf",null==e.cipherFormGroup.controls.cipherSeed.errors?null:e.cipherFormGroup.controls.cipherSeed.errors.required),o.xp6(1),o.Q6J("ngIf",!(null!=e.cipherFormGroup.controls.cipherSeed.errors&&e.cipherFormGroup.controls.cipherSeed.errors.required)&&(null==e.cipherFormGroup.controls.cipherSeed.errors?null:e.cipherFormGroup.controls.cipherSeed.errors.invalidCipher)),o.xp6(6),o.Q6J("stepControl",e.passphraseFormGroup),o.xp6(1),o.Q6J("formGroup",e.passphraseFormGroup),o.xp6(2),o.Q6J("labelPosition","before"),o.xp6(6),o.Q6J("ngIf",null==e.passphraseFormGroup.controls.passphrase.errors?null:e.passphraseFormGroup.controls.passphrase.errors.required)}}function ac(e,t){if(1&e&&(o.TgZ(0,"span",48),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(e)}}function ic(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div"),o.TgZ(1,"form",4),o.TgZ(2,"div",43),o._uU(3,"YOU MUST WRITE DOWN THIS SEED TO BE ABLE TO RESTORE THE WALLET!"),o.qZA(),o.TgZ(4,"div",44),o.YNc(5,ac,2,1,"span",45),o.qZA(),o.TgZ(6,"div",46),o._uU(7,"Wallet initialization is done."),o.qZA(),o.TgZ(8,"div",46),o._uU(9,"The node will be usable only after LND has synced completely with the network."),o.qZA(),o.TgZ(10,"div",46),o._uU(11,"Click continue only after writing down the seed."),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"button",47),o.NdJ("click",function(){return o.CHM(e),o.oxw().onGoToHome()}),o._uU(14,"Go To Home"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(5),o.Q6J("ngForOf",e.genSeedResponse)}}function sc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div"),o.TgZ(1,"form",4),o.TgZ(2,"div",46),o._uU(3,"Something went wrong! Unable to initialize wallet!"),o.qZA(),o.TgZ(4,"div",6),o.TgZ(5,"button",49),o.NdJ("click",function(){return o.CHM(e),o.oxw().resetData()}),o._uU(6,"Restart"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function oc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div"),o.TgZ(1,"form",4),o.TgZ(2,"div",46),o._uU(3,"Wallet recovery is done."),o.qZA(),o.TgZ(4,"div",46),o._uU(5,"The node will be usable only after LND has synced completely with the network."),o.qZA(),o.TgZ(6,"div",6),o.TgZ(7,"button",50),o.NdJ("click",function(){return o.CHM(e),o.oxw().onGoToHome()}),o._uU(8,"Go To Home"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}const lc=e=>{const t=e.get("initWalletPassword"),n=e.get("initWalletConfirmPassword");return t&&n&&t.value!==n.value?{unmatchedPasswords:!0}:null},rc=e=>{const t=e.value?e.value.toString().trim().split(","):[];return t&&24!==t.length?{invalidCipher:!0}:null};let cc=(()=>{class e{constructor(e,t,n){this.store=e,this.formBuilder=t,this.lndEffects=n,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:["",[Ae.kI.required,Ae.kI.minLength(8)]],initWalletConfirmPassword:["",[Ae.kI.required,Ae.kI.minLength(8)]]},{validators:lc}),this.cipherFormGroup=this.formBuilder.group({existingCipher:[!1],cipherSeed:[{value:"",disabled:!0},[rc]]}),this.passphraseFormGroup=this.formBuilder.group({enterPassphrase:[!1],passphrase:[{value:"",disabled:!0}]}),this.cipherFormGroup.controls.existingCipher.valueChanges.pipe((0,d.R)(this.unsubs[0])).subscribe(e=>{e?(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(e=>{e?(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(e=>{this.initWalletResponse=e}),this.lndEffects.genSeedResponse.pipe((0,d.R)(this.unsubs[3])).subscribe(e=>{this.genSeedResponse=e,this.store.dispatch(new x.My(this.passphraseFormGroup.controls.enterPassphrase.value?{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:this.genSeedResponse,passphrase:window.btoa(this.passphraseFormGroup.controls.passphrase.value)}:{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 e=this.cipherFormGroup.controls.cipherSeed.value.toString().trim().split(",");this.store.dispatch(new x.My(this.passphraseFormGroup.controls.enterPassphrase.value?{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:e,passphrase:window.btoa(this.passphraseFormGroup.controls.passphrase.value)}:{pwd:window.btoa(this.passwordFormGroup.controls.initWalletPassword.value),cipher:e}))}else this.store.dispatch(new x.$b(this.passphraseFormGroup.controls.enterPassphrase.value?window.btoa(this.passphraseFormGroup.controls.passphrase.value):""))}onGoToHome(){setTimeout(()=>{this.store.dispatch(new ee.uQ),this.store.dispatch(new x.z6({loadPage:"HOME"}))},1e3)}resetData(){this.genSeedResponse=[],this.initWalletResponse=""}ngOnDestroy(){this.unsubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh),o.Y36(Ae.qu),o.Y36(Ft.l))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-initialize-wallet"]],viewQuery:function(e,t){if(1&e&&o.Gf(La.Vq,5),2&e){let e;o.iGM(e=o.CRH())&&(t.stepper=e.first)}},features:[o._Bn([{provide:Yr.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(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,Pr,9,0,"div",1),o.YNc(2,Br,6,0,"div",2),o.YNc(3,nc,56,17,"mat-vertical-stepper",3),o.YNc(4,ic,15,1,"div",1),o.YNc(5,sc,7,0,"div",1),o.YNc(6,oc,9,0,"div",1),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngIf",t.insecureLND&&!t.warnRes),o.xp6(1),o.Q6J("ngIf",t.warnRes&&!t.proceed),o.xp6(1),o.Q6J("ngIf",(!t.insecureLND||t.warnRes&&t.proceed)&&t.genSeedResponse.length<=0&&""===t.initWalletResponse),o.xp6(1),o.Q6J("ngIf",t.genSeedResponse.length>0&&""!==t.initWalletResponse),o.xp6(1),o.Q6J("ngIf",t.genSeedResponse.length>0&&""===t.initWalletResponse),o.xp6(1),o.Q6J("ngIf",t.genSeedResponse.length<=0&&""!==t.initWalletResponse))},directives:[l.xw,a.O5,Ae._Y,Ae.JL,Ae.F,l.Wh,l.yH,q.lW,La.Vq,La.C0,Ae.sg,D.KE,Ce.Nt,Ae.Fj,Ae.JJ,Ae.u,Ae.Q7,D.bx,La.Ic,_e.Rr,La.fd,La.z9,D.TO,S.Hw,a.sg],styles:[""]}),e})(),uc=(()=>{class e{constructor(){this.faWallet=g.X5K}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"Wallet"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o.TgZ(7,"mat-tab-group"),o.TgZ(8,"mat-tab",5),o._UZ(9,"rtl-unlock-wallet"),o.qZA(),o.TgZ(10,"mat-tab",6),o._UZ(11,"rtl-initialize-wallet"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("icon",t.faWallet))},directives:[l.xw,l.Wh,T.BN,w.a8,w.dn,ge.SP,ge.uX,Qr,cc],styles:[""]}),e})();function pc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",11),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().activeLink=t.link}),o._uU(1),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.s9C("routerLink",e.link),o.Q6J("active",n.activeLink===e.link),o.xp6(1),o.Oqu(e.name)}}let dc=(()=>{class e{constructor(e,t,n){this.logger=e,this.store=t,this.router=n,this.faExchangeAlt=g.Ssp,this.faChartPie=g.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"},{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 e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{const t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link}),this.store.select("lnd").pipe((0,d.R)(this.unSubs[1])).subscribe(e=>{this.currencyUnits=e.nodeSettings.currencyUnits,this.balances=e.nodeSettings.userPersona===f.ol.OPERATOR?[{title:"Local Capacity",dataValue:e.totalLocalBalance,tooltip:"Amount you can send"},{title:"Remote Capacity",dataValue:e.totalRemoteBalance,tooltip:"Amount you can receive"}]:[{title:"Outbound Capacity",dataValue:e.totalLocalBalance,tooltip:"Amount you can send"},{title:"Inbound Capacity",dataValue:e.totalRemoteBalance,tooltip:"Amount you can receive"}],this.logger.info(e)})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"Lightning Balance"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o._UZ(7,"rtl-currency-unit-converter",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",6),o._UZ(9,"fa-icon",1),o.TgZ(10,"span",2),o._uU(11,"Lightning Transactions"),o.qZA(),o.qZA(),o.TgZ(12,"div",7),o.TgZ(13,"mat-card"),o.TgZ(14,"mat-card-content",4),o.TgZ(15,"nav",8),o.YNc(16,pc,2,3,"div",9),o.qZA(),o.TgZ(17,"div",10),o._UZ(18,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("icon",t.faChartPie),o.xp6(6),o.Q6J("values",t.balances),o.xp6(2),o.Q6J("icon",t.faExchangeAlt),o.xp6(7),o.Q6J("ngForOf",t.links))},directives:[l.xw,l.Wh,T.BN,w.a8,w.dn,la.D,ge.BU,a.sg,l.yH,i.lC,ge.Nj,i.rH],styles:[""]}),e})();function hc(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Destination pubkey is required."),o.qZA())}function mc(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Amount is required."),o.qZA())}function gc(e,t){1&e&&o._UZ(0,"mat-progress-bar",37)}function fc(e,t){1&e&&(o.TgZ(0,"th",38),o._uU(1," Hop "),o.qZA())}function xc(e,t){if(1&e&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",null==e?null:e.hop_sequence," ")}}function Zc(e,t){1&e&&(o.TgZ(0,"th",38),o._uU(1," Peer "),o.qZA())}const yc=function(e){return{"max-width":e}};function Ac(e,t){if(1&e&&(o.TgZ(0,"td",40),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,yc,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),o.xp6(1),o.hij(" ",null==e?null:e.pubkey_alias," ")}}function Cc(e,t){1&e&&(o.TgZ(0,"th",38),o._uU(1," Channel "),o.qZA())}function Tc(e,t){if(1&e&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",null==e?null:e.chan_id," ")}}function bc(e,t){1&e&&(o.TgZ(0,"th",41),o._uU(1," Capacity (Sats) "),o.qZA())}function wc(e,t){if(1&e&&(o.TgZ(0,"td",39),o.TgZ(1,"span",42),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.chan_capacity),"")}}function _c(e,t){1&e&&(o.TgZ(0,"th",41),o._uU(1," Amount To Fwd (Sats) "),o.qZA())}function vc(e,t){if(1&e&&(o.TgZ(0,"td",39),o.TgZ(1,"span",42),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.amt_to_forward)," ")}}function qc(e,t){1&e&&(o.TgZ(0,"th",41),o._uU(1," Fee (mSats) "),o.qZA())}function Sc(e,t){if(1&e&&(o.TgZ(0,"td",39),o.TgZ(1,"span",42),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.fee_msat)," ")}}function Fc(e,t){1&e&&(o.TgZ(0,"th",43),o.TgZ(1,"span",42),o._uU(2,"Actions"),o.qZA(),o.qZA())}function Lc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",44),o.TgZ(1,"button",45),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw().onHopClick(n,t)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function kc(e,t){1&e&&o._UZ(0,"tr",46)}function Nc(e,t){1&e&&o._UZ(0,"tr",47)}const Uc=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}};let Ic=(()=>{class e{constructor(e,t,n){this.store=e,this.lndEffects=t,this.commonService=n,this.destinationPubkey="",this.amount=null,this.flgSticky=!1,this.displayedColumns=[],this.flgLoading=[!1],this.faRoute=g.FpQ,this.faExclamationTriangle=g.eHv,this.screenSize="",this.screenSizeEnum=f.cu,this.unSubs=[new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["pubkey_alias","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["hop_sequence","pubkey_alias","fee_msat","actions"]):this.screenSize===f.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(e=>{this.qrHops=new Ze.by([]),e.routes&&e.routes[0].hops?(this.flgLoading[0]=!1,this.qrHops=new Ze.by([...e.routes[0].hops]),this.qrHops.data=e.routes[0].hops):this.flgLoading[0]="error",this.qrHops.sort=this.sort,this.qrHops.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null})}onQueryRoutes(){if(!this.destinationPubkey||!this.amount)return!0;this.qrHops=new Ze.by([]),this.flgLoading[0]=!0,this.store.dispatch(new x.bm({destPubkey:this.destinationPubkey,amount:this.amount}))}resetData(){this.destinationPubkey="",this.amount=null,this.flgLoading[0]=!1}onHopClick(e,t){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Route Information",message:[[{key:"hop_sequence",value:e.hop_sequence,title:"Sequence",width:30,type:f.Gi.NUMBER},{key:"amt_to_forward",value:e.amt_to_forward,title:"Amount To Forward (Sats)",width:30,type:f.Gi.NUMBER},{key:"fee_msat",value:e.fee_msat,title:"Fee (mSats)",width:40,type:f.Gi.NUMBER}],[{key:"pubkey_alias",value:e.pubkey_alias,title:"Peer Alias",width:30,type:f.Gi.STRING},{key:"pub_key",value:e.pub_key,title:"Peer Pubkey",width:70,type:f.Gi.STRING}],[{key:"expiry",value:e.expiry,title:"Expiry",width:30,type:f.Gi.NUMBER},{key:"chan_id",value:e.chan_id,title:"Channel ID",width:30,type:f.Gi.STRING},{key:"chan_capacity",value:e.chan_capacity,title:"Channel Capacity",width:40,type:f.Gi.NUMBER}]]}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh),o.Y36(Ft.l),o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-query-routes"]],viewQuery:function(e,t){if(1&e&&o.Gf(xe.YE,5),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.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-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","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(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",0),o.TgZ(1,"form",1,2),o.NdJ("ngSubmit",function(){return o.CHM(e),o.MAs(2).form.valid&&t.onQueryRoutes()}),o.TgZ(3,"div",3),o._UZ(4,"fa-icon",4),o.TgZ(5,"span"),o._uU(6,"The actual routing fee on a payment can be different from the fee shown on query routes."),o.qZA(),o.qZA(),o.TgZ(7,"mat-form-field",5),o.TgZ(8,"input",6,7),o.NdJ("ngModelChange",function(e){return t.destinationPubkey=e}),o.qZA(),o.YNc(10,hc,2,0,"mat-error",8),o.qZA(),o.TgZ(11,"mat-form-field",9),o.TgZ(12,"input",10),o.NdJ("ngModelChange",function(e){return t.amount=e}),o.qZA(),o.YNc(13,mc,2,0,"mat-error",8),o.qZA(),o.TgZ(14,"div",11),o.TgZ(15,"button",12),o.NdJ("click",function(){return t.resetData()}),o._uU(16,"Clear"),o.qZA(),o.TgZ(17,"button",13),o._uU(18,"Query Route"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"div",14),o.TgZ(20,"div",15),o._UZ(21,"fa-icon",16),o.TgZ(22,"span",17),o._uU(23,"Transaction Route"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(24,"div",18),o.YNc(25,gc,1,0,"mat-progress-bar",19),o.TgZ(26,"table",20,21),o.ynx(28,22),o.YNc(29,fc,2,0,"th",23),o.YNc(30,xc,2,1,"td",24),o.BQk(),o.ynx(31,25),o.YNc(32,Zc,2,0,"th",23),o.YNc(33,Ac,2,4,"td",26),o.BQk(),o.ynx(34,27),o.YNc(35,Cc,2,0,"th",23),o.YNc(36,Tc,2,1,"td",24),o.BQk(),o.ynx(37,28),o.YNc(38,bc,2,0,"th",29),o.YNc(39,wc,4,3,"td",24),o.BQk(),o.ynx(40,30),o.YNc(41,_c,2,0,"th",29),o.YNc(42,vc,4,3,"td",24),o.BQk(),o.ynx(43,31),o.YNc(44,qc,2,0,"th",29),o.YNc(45,Sc,4,3,"td",24),o.BQk(),o.ynx(46,32),o.YNc(47,Fc,3,0,"th",33),o.YNc(48,Lc,3,0,"td",34),o.BQk(),o.YNc(49,kc,1,0,"tr",35),o.YNc(50,Nc,1,0,"tr",36),o.qZA(),o.qZA(),o.qZA()}2&e&&(o.xp6(4),o.Q6J("icon",t.faExclamationTriangle),o.xp6(4),o.Q6J("ngModel",t.destinationPubkey),o.xp6(2),o.Q6J("ngIf",!t.destinationPubkey),o.xp6(2),o.Q6J("ngModel",t.amount)("step",1e3)("min",0),o.xp6(1),o.Q6J("ngIf",!t.amount),o.xp6(8),o.Q6J("icon",t.faRoute),o.xp6(4),o.Q6J("ngIf",!0===t.flgLoading[0]),o.xp6(1),o.Q6J("dataSource",t.qrHops)("ngClass",o.VKq(14,Uc,"error"===t.flgLoading[0])),o.xp6(23),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns))},directives:[l.xw,l.yH,Ae._Y,Ae.JL,Ae.F,l.Wh,T.BN,D.KE,Ce.Nt,Ae.Fj,Ae.Q7,Ae.JJ,Ae.On,a.O5,Ae.wV,Ae.qQ,be.q,q.lW,E.$V,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.as,Ze.nj,D.TO,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,Ze.XQ,Ze.Gk],pipes:[a.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}"]}),e})();var Oc=n(4810);function Jc(e,t){1&e&&(o.TgZ(0,"th",25),o._uU(1,"Network"),o.qZA())}function Dc(e,t){if(1&e&&(o.TgZ(0,"td",26),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",null==e?null:e.network," ")}}function Rc(e,t){1&e&&(o.TgZ(0,"th",25),o._uU(1,"Address"),o.qZA())}function Mc(e,t){if(1&e&&(o.TgZ(0,"td",26),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.hij(" ",null==e?null:e.addr," ")}}function Ec(e,t){1&e&&(o.TgZ(0,"th",27),o.TgZ(1,"span",28),o._uU(2,"Actions"),o.qZA(),o.qZA())}function Qc(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",29),o.TgZ(1,"span",28),o.TgZ(2,"button",30),o.NdJ("copied",function(t){return o.CHM(e),o.oxw(2).onCopyNodeURI(t)}),o._uU(3,"Copy Node URI"),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw(2);o.xp6(2),o.Q6J("payload",n.lookupResult.node.pub_key+"@"+e.addr)}}function Yc(e,t){1&e&&o._UZ(0,"tr",31)}function Pc(e,t){1&e&&o._UZ(0,"tr",32)}const Bc=function(e){return{"background-color":e}};function Gc(e,t){if(1&e&&(o.TgZ(0,"div",1),o._UZ(1,"mat-divider",2),o.TgZ(2,"div",3),o.TgZ(3,"h4",4),o._uU(4,"Pub Key"),o.qZA(),o.TgZ(5,"span",5),o._uU(6),o.qZA(),o.qZA(),o._UZ(7,"mat-divider",6),o.TgZ(8,"div",7),o.TgZ(9,"div",8),o.TgZ(10,"h4",4),o._uU(11,"Alias"),o.qZA(),o.TgZ(12,"span",9),o._uU(13),o.TgZ(14,"span",10),o._uU(15),o.qZA(),o.qZA(),o.qZA(),o.TgZ(16,"div",8),o.TgZ(17,"h4",4),o._uU(18,"Last Update"),o.qZA(),o.TgZ(19,"span",9),o._uU(20),o.ALo(21,"date"),o.qZA(),o.qZA(),o.qZA(),o._UZ(22,"mat-divider",6),o.TgZ(23,"div",7),o.TgZ(24,"div",8),o.TgZ(25,"h4",4),o._uU(26,"Total Capacity (Sats)"),o.qZA(),o.TgZ(27,"span",9),o._uU(28),o.ALo(29,"number"),o.qZA(),o.qZA(),o.TgZ(30,"div",8),o.TgZ(31,"h4",4),o._uU(32,"Number of Channels"),o.qZA(),o.TgZ(33,"span",9),o._uU(34),o.ALo(35,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(36,"mat-divider",6),o.TgZ(37,"div",11),o.TgZ(38,"h4",12),o._uU(39,"Addresses"),o.qZA(),o.TgZ(40,"div",13),o.TgZ(41,"table",14,15),o.ynx(43,16),o.YNc(44,Jc,2,0,"th",17),o.YNc(45,Dc,2,1,"td",18),o.BQk(),o.ynx(46,19),o.YNc(47,Rc,2,0,"th",17),o.YNc(48,Mc,2,1,"td",18),o.BQk(),o.ynx(49,20),o.YNc(50,Ec,3,0,"th",21),o.YNc(51,Qc,4,1,"td",22),o.BQk(),o.YNc(52,Yc,1,0,"tr",23),o.YNc(53,Pc,1,0,"tr",24),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(e.lookupResult.node.pub_key),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(e.lookupResult.node.alias),o.xp6(1),o.Q6J("ngStyle",o.VKq(21,Bc,null==e.lookupResult.node?null:e.lookupResult.node.color)),o.xp6(1),o.Oqu(null==e.lookupResult.node?null:e.lookupResult.node.color),o.xp6(5),o.Oqu(o.xi3(21,14,1e3*e.lookupResult.node.last_update,"dd/MMM/YYYY HH:mm")),o.xp6(2),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.lcZ(29,17,e.lookupResult.total_capacity)),o.xp6(6),o.Oqu(o.lcZ(35,19,e.lookupResult.num_channels)),o.xp6(2),o.Q6J("inset",!0),o.xp6(5),o.Q6J("dataSource",e.lookupResult.node.addresses),o.xp6(11),o.Q6J("matHeaderRowDef",e.displayedColumns),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns)}}let Hc=(()=>{class e{constructor(e,t){this.logger=e,this.snackBar=t,this.displayedColumns=["network","addr","actions"]}onCopyNodeURI(e){this.snackBar.open("Node URI copied."),this.logger.info("Copied Text: "+e)}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(Ai.ux))},e.\u0275cmp=o.Xpm({type:e,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","column","fxFlex","100","fxLayoutAlign","end start",1,"my-1"],["fxLayoutAlign","start",1,"font-bold-500"],[1,"foreground-secondary-text","w-100"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxLayout","column","fxFlex","50","fxLayoutAlign","end start",1,"my-1"],[1,"foreground-secondary-text"],[1,"ml-2",3,"ngStyle"],["fxLayout","column",1,"mt-2"],["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(e,t){1&e&&o.YNc(0,Gc,54,23,"div",0),2&e&&o.Q6J("ngIf",t.lookupResult)},directives:[a.O5,l.xw,M.d,l.yH,l.Wh,a.PC,v.Zl,E.$V,Ze.BZ,xe.YE,Ze.w1,Ze.fO,Ze.Dz,Ze.as,Ze.nj,Ze.ge,xe.nU,Ze.ev,q.lW,Ci.y,Ze.XQ,Ze.Gk],pipes:[a.uU,a.JJ],styles:[""]}),e})();function zc(e,t){1&e&&(o.TgZ(0,"h3",16),o._uU(1,"Node 1"),o.qZA())}function Vc(e,t){1&e&&(o.TgZ(0,"h3",16),o._uU(1,"Node 1 (Your Node)"),o.qZA())}function Wc(e,t){1&e&&(o.TgZ(0,"h3",16),o._uU(1,"Node 2"),o.qZA())}function Xc(e,t){1&e&&(o.TgZ(0,"h3",16),o._uU(1,"Node 2 (Your Node)"),o.qZA())}function $c(e,t){if(1&e&&(o.TgZ(0,"div",1),o._UZ(1,"mat-divider",2),o.TgZ(2,"div",3),o.TgZ(3,"h4",4),o._uU(4,"Channel Id"),o.qZA(),o.TgZ(5,"span",5),o._uU(6),o.qZA(),o.qZA(),o._UZ(7,"mat-divider",6),o.TgZ(8,"div",3),o.TgZ(9,"h4",4),o._uU(10,"Channel Point"),o.qZA(),o.TgZ(11,"span",5),o._uU(12),o.qZA(),o.qZA(),o._UZ(13,"mat-divider",6),o.TgZ(14,"div",7),o.TgZ(15,"div",8),o.TgZ(16,"h4",4),o._uU(17,"Last Update"),o.qZA(),o.TgZ(18,"span",5),o._uU(19),o.ALo(20,"date"),o.qZA(),o.qZA(),o.TgZ(21,"div",8),o.TgZ(22,"h4",4),o._uU(23,"Capacity (Sats)"),o.qZA(),o.TgZ(24,"span",5),o._uU(25),o.ALo(26,"number"),o.qZA(),o.qZA(),o.qZA(),o._UZ(27,"mat-divider",6),o.TgZ(28,"div",9),o.TgZ(29,"div",10),o.TgZ(30,"div",11),o.YNc(31,zc,2,0,"h3",12),o.YNc(32,Vc,2,0,"h3",12),o.qZA(),o._UZ(33,"mat-divider",13),o.TgZ(34,"div",14),o.TgZ(35,"h4",4),o._uU(36,"Pubkey"),o.qZA(),o.TgZ(37,"span",5),o._uU(38),o.qZA(),o.qZA(),o._UZ(39,"mat-divider",13),o.TgZ(40,"div",15),o.TgZ(41,"h4",4),o._uU(42,"Time Lock Delta"),o.qZA(),o.TgZ(43,"span",5),o._uU(44),o.qZA(),o.qZA(),o._UZ(45,"mat-divider",13),o.TgZ(46,"div",15),o.TgZ(47,"h4",4),o._uU(48,"Min HTLC"),o.qZA(),o.TgZ(49,"span",5),o._uU(50),o.qZA(),o.qZA(),o._UZ(51,"mat-divider",13),o.TgZ(52,"div",15),o.TgZ(53,"h4",4),o._uU(54,"Fee Base Msat"),o.qZA(),o.TgZ(55,"span",5),o._uU(56),o.qZA(),o.qZA(),o._UZ(57,"mat-divider",13),o.TgZ(58,"div",15),o.TgZ(59,"h4",4),o._uU(60,"Fee Rate Milli Msat"),o.qZA(),o.TgZ(61,"span",5),o._uU(62),o.qZA(),o.qZA(),o._UZ(63,"mat-divider",13),o.TgZ(64,"div",15),o.TgZ(65,"h4",4),o._uU(66,"Disabled"),o.qZA(),o.TgZ(67,"span",5),o._uU(68),o.qZA(),o.qZA(),o.qZA(),o.TgZ(69,"div",10),o.TgZ(70,"div"),o.YNc(71,Wc,2,0,"h3",12),o.YNc(72,Xc,2,0,"h3",12),o.qZA(),o._UZ(73,"mat-divider",13),o.TgZ(74,"div",14),o.TgZ(75,"h4",4),o._uU(76,"Pubkey"),o.qZA(),o.TgZ(77,"span",5),o._uU(78),o.qZA(),o.qZA(),o._UZ(79,"mat-divider",13),o.TgZ(80,"div",15),o.TgZ(81,"h4",4),o._uU(82,"Time Lock Delta"),o.qZA(),o.TgZ(83,"span",5),o._uU(84),o.qZA(),o.qZA(),o._UZ(85,"mat-divider",13),o.TgZ(86,"div",15),o.TgZ(87,"h4",4),o._uU(88,"Min HTLC"),o.qZA(),o.TgZ(89,"span",5),o._uU(90),o.qZA(),o.qZA(),o._UZ(91,"mat-divider",13),o.TgZ(92,"div",15),o.TgZ(93,"h4",4),o._uU(94,"Fee Base Msat"),o.qZA(),o.TgZ(95,"span",5),o._uU(96),o.qZA(),o.qZA(),o._UZ(97,"mat-divider",13),o.TgZ(98,"div",15),o.TgZ(99,"h4",4),o._uU(100,"Fee Rate Milli Msat"),o.qZA(),o.TgZ(101,"span",5),o._uU(102),o.qZA(),o.qZA(),o._UZ(103,"mat-divider",13),o.TgZ(104,"div",15),o.TgZ(105,"h4",4),o._uU(106,"Disabled"),o.qZA(),o.TgZ(107,"span",5),o._uU(108),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(e.lookupResult.channel_id),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(e.lookupResult.chan_point),o.xp6(1),o.Q6J("inset",!0),o.xp6(6),o.Oqu(o.xi3(20,36,1e3*e.lookupResult.last_update,"dd/MMM/YYYY HH:mm")),o.xp6(6),o.Oqu(o.lcZ(26,39,e.lookupResult.capacity)),o.xp6(2),o.Q6J("inset",!0),o.xp6(4),o.Q6J("ngIf",!e.node1_match),o.xp6(1),o.Q6J("ngIf",e.node1_match),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(e.lookupResult.node1_pub),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.time_lock_delta),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.min_htlc),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.fee_base_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.fee_rate_milli_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node1_policy?null:e.lookupResult.node1_policy.disabled),o.xp6(3),o.Q6J("ngIf",!e.node2_match),o.xp6(1),o.Q6J("ngIf",e.node2_match),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(e.lookupResult.node2_pub),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.time_lock_delta),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.min_htlc),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.fee_base_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.fee_rate_milli_msat),o.xp6(1),o.Q6J("inset",!0),o.xp6(5),o.Oqu(null==e.lookupResult.node2_policy?null:e.lookupResult.node2_policy.disabled)}}let jc=(()=>{class e{constructor(e){this.store=e,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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.lookupResult.node1_pub===e.information.identity_pubkey&&(this.node1_match=!0),this.lookupResult.node2_pub===e.information.identity_pubkey&&(this.node2_match=!0)})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,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","column","fxFlex","100","fxLayoutAlign","end start",1,"my-1"],[1,"font-bold-500"],[1,"foreground-secondary-text"],[1,"my-1",3,"inset"],["fxLayout","row"],["fxLayout","column","fxFlex","100","fxFlex.gt-sm","50","fxLayoutAlign","end start",1,"my-1"],["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"],[3,"inset"],["fxLayout","column","fxFlex","20",1,"my-1"],["fxLayout","column","fxFlex","10",1,"my-1"],[1,"page-title","font-bold-500"]],template:function(e,t){1&e&&o.YNc(0,$c,109,41,"div",0),2&e&&o.Q6J("ngIf",t.lookupResult)},directives:[a.O5,l.xw,M.d,l.yH,l.Wh],pipes:[a.uU,a.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}"]}),e})();function Kc(e,t){if(1&e&&(o.TgZ(0,"mat-radio-button",21),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("value",e.id)("checked",n.selectedFieldId===e.id),o.xp6(1),o.hij(" ",e.name," ")}}function eu(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.hij("",null==e.lookupFields[e.selectedFieldId]?null:e.lookupFields[e.selectedFieldId].placeholder," is required.")}}function tu(e,t){1&e&&o._UZ(0,"mat-progress-bar",24)}const nu=function(e){return{"w-100 mt-2 p-2 error-border":e,"w-100 my-2 p-2":!0}};function au(e,t){if(1&e&&(o.TgZ(0,"div",22),o.YNc(1,tu,1,0,"mat-progress-bar",23),o._uU(2),o.qZA()),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(3,nu,""!==e.errorMessage&&"Getting lookup details..."!==e.errorMessage)),o.xp6(1),o.Q6J("ngIf","Getting lookup details..."===e.errorMessage),o.xp6(1),o.hij(" ",e.errorMessage," ")}}function iu(e,t){if(1&e&&(o.TgZ(0,"span",31),o._UZ(1,"rtl-node-lookup",32),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("lookupResult",e.lookupValue)}}function su(e,t){if(1&e&&(o.TgZ(0,"span",31),o._UZ(1,"rtl-channel-lookup",32),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("lookupResult",e.lookupValue)}}function ou(e,t){1&e&&(o.TgZ(0,"span",31),o.TgZ(1,"h3"),o._uU(2,"Error! Unable to find details!"),o.qZA(),o.qZA())}function lu(e,t){if(1&e&&(o.TgZ(0,"div",25),o.TgZ(1,"div",26),o.TgZ(2,"span",27),o._uU(3),o.qZA(),o.qZA(),o.TgZ(4,"div",28),o.YNc(5,iu,2,1,"span",29),o.YNc(6,su,2,1,"span",29),o.YNc(7,ou,3,0,"span",30),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(3),o.hij("",e.lookupFields[e.selectedFieldId].name," Details"),o.xp6(1),o.Q6J("ngSwitch",e.selectedFieldId),o.xp6(1),o.Q6J("ngSwitchCase",0),o.xp6(1),o.Q6J("ngSwitchCase",1)}}const ru=function(e){return{"mt-2":e}};let cu=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.commonService=t,this.store=n,this.actions=a,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=g.wn1,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.actions.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e.type===x.RP||e.type===x.JE)).subscribe(e=>{e.type===x.RP&&(this.errorMessage=0===this.selectedFieldId&&e.payload.hasOwnProperty("node")||1===this.selectedFieldId&&e.payload.hasOwnProperty("channel_id")?"":this.errorMessage,this.lookupValue=JSON.parse(JSON.stringify(e.payload)),this.flgSetLookupValue=!(0!==this.selectedFieldId||!e.payload.hasOwnProperty("node"))||!(1!==this.selectedFieldId||!e.payload.hasOwnProperty("channel_id")),this.logger.info(this.lookupValue)),e.type===x.JE&&"Lookup"===e.payload.action&&(this.errorMessage="",e.payload.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof e.payload.message?JSON.stringify(e.payload.message):e.payload.message),e.payload.status===f.Bn.INITIATED&&(this.errorMessage=f.m6.GET_LOOKUP_DETAILS))})}onLookup(){if(!this.lookupKey)return!0;switch(this.flgSetLookupValue=!1,this.lookupValue={},this.selectedFieldId){case 0:this.store.dispatch(new x.x$(this.lookupKey.trim()));break;case 1:this.store.dispatch(new x.IG({uiMessage:f.m6.SEARCHING_CHANNEL,channelID:this.lookupKey.trim()}))}}onSelectChange(e){this.resetData(),this.selectedFieldId=e.value}resetData(){this.flgSetLookupValue=!1,this.selectedFieldId=0,this.lookupKey="",this.lookupValue={},this.errorMessage=""}clearLookupValue(){this.lookupValue={},this.flgSetLookupValue=!1}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(y.yh),o.Y36(A.eX))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-lookups"]],decls:24,vars:11,consts:[["fxLayout","column"],["fxLayout","row","fxLayoutAlign","start end",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"],["fxLayout","row","fxFlex","100","fxLayoutAlign","start start"],["fxLayout","column","fxFlex","100","fxLayoutAlign","space-between stretch",1,"card-content-gap","mt-1"],["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","35","fxFlex.gt-md","25","fxLayoutAlign","start end"],["color","primary","tabindex","1","name","lookupField",3,"ngModel","ngModelChange","change"],["class","mr-4",3,"value","checked",4,"ngFor","ngForOf"],["fxFlex","65","fxFlex.gt-md","75","fxLayoutAlign","start end",3,"ngClass"],["matInput","","name","lookupKey","tabindex","2","required","",3,"placeholder","ngModel","change","ngModelChange"],["key",""],[4,"ngIf"],[1,"mt-2"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"fa-icon",2),o.TgZ(3,"span",3),o._uU(4,"Graph Lookups"),o.qZA(),o.qZA(),o.TgZ(5,"div",4),o.TgZ(6,"mat-card",5),o.TgZ(7,"mat-card-content",6),o.TgZ(8,"form",7,8),o.TgZ(10,"div",9),o.TgZ(11,"mat-radio-group",10),o.NdJ("ngModelChange",function(e){return t.selectedFieldId=e})("change",function(e){return t.onSelectChange(e)}),o.YNc(12,Kc,2,3,"mat-radio-button",11),o.qZA(),o.qZA(),o.TgZ(13,"mat-form-field",12),o.TgZ(14,"input",13,14),o.NdJ("change",function(){return t.clearLookupValue()})("ngModelChange",function(e){return t.lookupKey=e}),o.qZA(),o.YNc(16,eu,2,1,"mat-error",15),o.qZA(),o.TgZ(17,"div",16),o.TgZ(18,"button",17),o.NdJ("click",function(){return t.resetData()}),o._uU(19,"Clear"),o.qZA(),o.TgZ(20,"button",18),o.NdJ("click",function(){return t.onLookup()}),o._uU(21,"Lookup"),o.qZA(),o.qZA(),o.qZA(),o.YNc(22,au,3,5,"div",19),o.YNc(23,lu,8,4,"div",20),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(2),o.Q6J("icon",t.faSearch),o.xp6(9),o.Q6J("ngModel",t.selectedFieldId),o.xp6(1),o.Q6J("ngForOf",t.lookupFields),o.xp6(1),o.Q6J("ngClass",o.VKq(9,ru,t.screenSize===t.screenSizeEnum.XS||t.screenSize===t.screenSizeEnum.SM)),o.xp6(1),o.Q6J("placeholder",(null==t.lookupFields[t.selectedFieldId]?null:t.lookupFields[t.selectedFieldId].placeholder)||"Lookup Key")("ngModel",t.lookupKey),o.xp6(2),o.Q6J("ngIf",!t.lookupKey),o.xp6(6),o.Q6J("ngIf",""!==t.errorMessage),o.xp6(1),o.Q6J("ngIf",""===t.errorMessage&&t.lookupValue&&t.flgSetLookupValue))},directives:[l.xw,l.Wh,T.BN,l.yH,w.a8,w.dn,Ae._Y,Ae.JL,Ae.F,Oc.VQ,Ae.JJ,Ae.On,a.sg,D.KE,a.mk,v.oO,Ce.Nt,Ae.Fj,Ae.Q7,a.O5,q.lW,Oc.U0,D.TO,r.pW,a.RF,a.n9,a.ED,Hc,jc],styles:[".tree-invisible[_ngcontent-%COMP%]{display:none}.lookup-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%], .lookup-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-top:0;margin-bottom:0;list-style-type:none}.pl-3[_ngcontent-%COMP%]{padding-left:3rem}"]}),e})();var uu=n(5812);function pu(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Invalid date format."),o.qZA())}function du(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Invalid date format."),o.qZA())}function hu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",27),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().activeLink=t.link}),o._uU(1),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.s9C("routerLink",e.link),o.Q6J("active",n.activeLink===e.link),o.xp6(1),o.Oqu(e.name)}}let mu=(()=>{class e{constructor(e,t){this.store=e,this.router=t,this.faMapSigns=g.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"}],this.activeLink=this.links[0].link,this.unSubs=[new p.x,new p.x,new p.x]}ngOnInit(){this.onEventsFetch();const e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{const t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}onEventsFetch(){this.store.dispatch(new x.Fn({})),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(new x.KK({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(new x.Fn({})),this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh),o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o._UZ(2,"fa-icon",2),o.TgZ(3,"span",3),o._uU(4,"Routing"),o.qZA(),o.qZA(),o.TgZ(5,"div",4),o.TgZ(6,"mat-card",5),o.TgZ(7,"mat-card-content",6),o.TgZ(8,"form",7,8),o.NdJ("ngSubmit",function(){return t.onEventsFetch()}),o.TgZ(10,"div",9),o.TgZ(11,"mat-form-field",10),o.TgZ(12,"input",11,12),o.NdJ("ngModelChange",function(e){return t.startDate=e}),o.qZA(),o._UZ(14,"mat-datepicker-toggle",13),o._UZ(15,"mat-datepicker",14,15),o.YNc(17,pu,2,0,"mat-error",16),o.qZA(),o.TgZ(18,"mat-form-field",10),o.TgZ(19,"input",17,18),o.NdJ("ngModelChange",function(e){return t.endDate=e}),o.qZA(),o._UZ(21,"mat-datepicker-toggle",13),o._UZ(22,"mat-datepicker",14,19),o.YNc(24,du,2,0,"mat-error",16),o.qZA(),o.qZA(),o.TgZ(25,"div",20),o.TgZ(26,"button",21),o.NdJ("click",function(){return t.resetData()}),o._uU(27,"Clear"),o.qZA(),o.TgZ(28,"button",22),o._uU(29,"Fetch Events"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(30,"div",23),o.TgZ(31,"nav",24),o.YNc(32,hu,2,3,"div",25),o.qZA(),o.qZA(),o.TgZ(33,"div",26),o._UZ(34,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.MAs(13),n=o.MAs(16),a=o.MAs(20),i=o.MAs(23);o.xp6(2),o.Q6J("icon",t.faMapSigns),o.xp6(10),o.Q6J("matDatepicker",n)("max",t.today)("ngModel",t.startDate),o.xp6(2),o.Q6J("for",n),o.xp6(1),o.Q6J("startAt",t.startDate),o.xp6(2),o.Q6J("ngIf",e.errors),o.xp6(2),o.Q6J("matDatepicker",i)("min",t.startDate)("max",t.today)("ngModel",t.endDate),o.xp6(2),o.Q6J("for",i),o.xp6(1),o.Q6J("startAt",t.endDate),o.xp6(2),o.Q6J("ngIf",a.errors),o.xp6(8),o.Q6J("ngForOf",t.links)}},directives:[l.xw,l.Wh,T.BN,l.yH,w.a8,w.dn,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,uu.hl,ma.F,Ae.Fj,Ae.JJ,Ae.On,uu.nW,D.R9,uu.Mq,a.O5,be.q,q.lW,ge.BU,a.sg,i.lC,D.TO,ge.Nj,i.rH],styles:[""]}),e})();function gu(e,t){if(1&e&&(o.TgZ(0,"div",5),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errorMessage)}}function fu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",6),o._UZ(1,"div",7),o.TgZ(2,"mat-form-field",8),o.TgZ(3,"input",9),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().filterValue=t})("input",function(){return o.CHM(e),o.oxw().applyFilter()})("keyup",function(){return o.CHM(e),o.oxw().applyFilter()}),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("ngModel",e.filterValue)}}function xu(e,t){1&e&&o._UZ(0,"mat-progress-bar",31)}function Zu(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1,"Timestamp"),o.qZA())}function yu(e,t){if(1&e&&(o.TgZ(0,"td",33),o._uU(1),o.ALo(2,"date"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.xi3(2,1,1e3*e.timestamp,"dd/MMM/YYYY HH:mm"))}}function Au(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1,"Inbound Channel"),o.qZA())}function Cu(e,t){if(1&e&&(o.TgZ(0,"td",33),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(e.alias_in)}}function Tu(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1,"Outbound Channel"),o.qZA())}function bu(e,t){if(1&e&&(o.TgZ(0,"td",33),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(e.alias_out)}}function wu(e,t){1&e&&(o.TgZ(0,"th",34),o._uU(1,"Inbound Amount (Sats)"),o.qZA())}function _u(e,t){if(1&e&&(o.TgZ(0,"td",33),o.TgZ(1,"span",35),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.amt_in))}}function vu(e,t){1&e&&(o.TgZ(0,"th",34),o._uU(1,"Outbound Amount (Sats)"),o.qZA())}function qu(e,t){if(1&e&&(o.TgZ(0,"td",33),o.TgZ(1,"span",35),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.amt_out))}}function Su(e,t){1&e&&(o.TgZ(0,"th",34),o._uU(1,"Fee (mSats)"),o.qZA())}function Fu(e,t){if(1&e&&(o.TgZ(0,"td",33),o.TgZ(1,"span",35),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.fee_msat))}}function Lu(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",36),o.TgZ(1,"div",37),o.TgZ(2,"mat-select",38),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",39),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function ku(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",40),o.TgZ(1,"button",41),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw(2).onForwardingEventClick(n,t)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function Nu(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No forwarding history available."),o.qZA())}function Uu(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting forwarding history..."),o.qZA())}function Iu(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(3);o.xp6(1),o.Oqu(e.errorMessage)}}function Ou(e,t){if(1&e&&(o.TgZ(0,"td",42),o.YNc(1,Nu,2,0,"p",43),o.YNc(2,Uu,2,0,"p",43),o.YNc(3,Iu,2,1,"p",43),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.forwardingHistoryEvents&&e.forwardingHistoryEvents.data)||(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.ERROR)}}const Ju=function(e){return{"display-none":e}};function Du(e,t){if(1&e&&o._UZ(0,"tr",44),2&e){const e=o.oxw(2);o.Q6J("ngClass",o.VKq(1,Ju,(null==e.forwardingHistoryEvents?null:e.forwardingHistoryEvents.data)&&(null==e.forwardingHistoryEvents||null==e.forwardingHistoryEvents.data?null:e.forwardingHistoryEvents.data.length)>0))}}function Ru(e,t){1&e&&o._UZ(0,"tr",45)}function Mu(e,t){1&e&&o._UZ(0,"tr",46)}const Eu=function(){return["no_event"]};function Qu(e,t){if(1&e&&(o.TgZ(0,"div",10),o.YNc(1,xu,1,0,"mat-progress-bar",11),o.TgZ(2,"table",12,13),o.ynx(4,14),o.YNc(5,Zu,2,0,"th",15),o.YNc(6,yu,3,4,"td",16),o.BQk(),o.ynx(7,17),o.YNc(8,Au,2,0,"th",15),o.YNc(9,Cu,2,1,"td",16),o.BQk(),o.ynx(10,18),o.YNc(11,Tu,2,0,"th",15),o.YNc(12,bu,2,1,"td",16),o.BQk(),o.ynx(13,19),o.YNc(14,wu,2,0,"th",20),o.YNc(15,_u,4,3,"td",16),o.BQk(),o.ynx(16,21),o.YNc(17,vu,2,0,"th",20),o.YNc(18,qu,4,3,"td",16),o.BQk(),o.ynx(19,22),o.YNc(20,Su,2,0,"th",20),o.YNc(21,Fu,4,3,"td",16),o.BQk(),o.ynx(22,23),o.YNc(23,Lu,6,0,"th",24),o.YNc(24,ku,3,0,"td",25),o.BQk(),o.ynx(25,26),o.YNc(26,Ou,4,3,"td",27),o.BQk(),o.YNc(27,Du,1,3,"tr",28),o.YNc(28,Ru,1,0,"tr",29),o.YNc(29,Mu,1,0,"tr",30),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.forwardingHistoryEvents),o.xp6(25),o.Q6J("matFooterRowDef",o.DdM(6,Eu)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns)}}function Yu(e,t){if(1&e&&o._UZ(0,"mat-paginator",47),2&e){const e=o.oxw();o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Pu=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.commonService=t,this.store=n,this.datePipe=a,this.eventsData=[],this.filterValue="",this.forwardingHistoryData=[],this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["timestamp","fee_msat","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.eventsData.length<=0&&(this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.GetForwardingHistory.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.GetForwardingHistory.message?JSON.stringify(this.apisCallStatus.GetForwardingHistory.message):this.apisCallStatus.GetForwardingHistory.message),this.forwardingHistoryData=e.forwardingHistory&&e.forwardingHistory.forwarding_events?e.forwardingHistory.forwarding_events:[],this.loadForwardingEventsTable(this.forwardingHistoryData),this.logger.info(e))})}ngAfterViewInit(){this.forwardingHistoryData.length>0&&this.loadForwardingEventsTable(this.forwardingHistoryData)}ngOnChanges(e){e.eventsData&&(this.eventsData=e.eventsData.currentValue,this.forwardingHistoryData=this.eventsData,e.eventsData.firstChange||this.loadForwardingEventsTable(this.forwardingHistoryData)),e.filterValue&&!e.filterValue.firstChange&&this.applyFilter()}onForwardingEventClick(e,t){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Event Information",message:[[{key:"timestamp",value:e.timestamp,title:"Timestamp",width:25,type:f.Gi.DATE_TIME},{key:"amt_in",value:e.amt_in,title:"Inbound Amount (Sats)",width:25,type:f.Gi.NUMBER},{key:"amt_out",value:e.amt_out,title:"Outbound Amount (Sats)",width:25,type:f.Gi.NUMBER},{key:"fee_msat",value:e.fee_msat,title:"Fee (mSats)",width:25,type:f.Gi.NUMBER}],[{key:"alias_in",value:e.alias_in,title:"Inbound Peer Alias",width:25,type:f.Gi.STRING},{key:"chan_id_in",value:e.chan_id_in,title:"Inbound Channel ID",width:25,type:f.Gi.STRING},{key:"alias_out",value:e.alias_out,title:"Outbound Peer Alias",width:25,type:f.Gi.STRING},{key:"chan_id_out",value:e.chan_id_out,title:"Outbound Channel ID",width:25,type:f.Gi.STRING}]]}}))}loadForwardingEventsTable(e){this.forwardingHistoryEvents=new Ze.by(e?[...e]:[]),this.forwardingHistoryEvents.sort=this.sort,this.forwardingHistoryEvents.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.forwardingHistoryEvents.filterPredicate=(e,t)=>((e.timestamp?this.datePipe.transform(new Date(1e3*e.timestamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(e).toLowerCase()).includes(t),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(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(y.yh),o.Y36(a.uU))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-forwarding-history"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},inputs:{eventsData:"eventsData",filterValue:"filterValue"},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("Events")}]),o.TTD],decls:5,vars:4,consts:[["fxLayout","column","fxLayoutAlign","start stretch",1,"padding-gap-x"],["class","p-2 error-border mb-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","mb-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(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,gu,2,1,"div",1),o.YNc(2,fu,4,1,"div",2),o.YNc(3,Qu,30,7,"div",3),o.YNc(4,Yu,1,3,"mat-paginator",4),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngIf",""!==t.errorMessage),o.xp6(1),o.Q6J("ngIf",""===t.errorMessage),o.xp6(1),o.Q6J("ngIf",""===t.errorMessage),o.xp6(1),o.Q6J("ngIf",""===t.errorMessage))},directives:[l.xw,l.Wh,a.O5,l.yH,D.KE,Ce.Nt,Ae.Fj,Ae.JJ,Ae.On,E.$V,Ze.BZ,xe.YE,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,r.pW,Ze.ge,xe.nU,Ze.ev,we.gD,we.$L,ve.ey,q.lW,Ze.yh,Ze.Q2,a.mk,v.oO,Ze.XQ,Ze.Gk,fe.NW],pipes:[a.uU,a.JJ],styles:[".mat-column-actions[_ngcontent-%COMP%]{min-height:4.8rem}"]}),e})();const Bu=["tableIn"],Gu=["tableOut"],Hu=["paginatorIn"],zu=["paginatorOut"];function Vu(e,t){if(1&e&&(o.TgZ(0,"div",3),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errorMessage)}}function Wu(e,t){1&e&&o._UZ(0,"mat-progress-bar",37)}function Xu(e,t){1&e&&(o.TgZ(0,"th",38),o._uU(1,"Channel ID"),o.qZA())}const $u=function(e){return{"max-width":e}};function ju(e,t){if(1&e&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,$u,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),o.xp6(1),o.Oqu(e.chan_id)}}function Ku(e,t){1&e&&(o.TgZ(0,"th",38),o._uU(1,"Peer Alias"),o.qZA())}function ep(e,t){if(1&e&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,$u,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),o.xp6(1),o.Oqu(e.alias)}}function tp(e,t){1&e&&(o.TgZ(0,"th",40),o._uU(1,"Events"),o.qZA())}function np(e,t){if(1&e&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.events))}}function ap(e,t){1&e&&(o.TgZ(0,"th",40),o._uU(1,"Total Amount (Sats)"),o.qZA())}function ip(e,t){if(1&e&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.total_amount))}}function sp(e,t){1&e&&(o.TgZ(0,"th",43),o.TgZ(1,"span",42),o._uU(2,"Actions"),o.qZA(),o.qZA())}function op(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",44),o.TgZ(1,"button",45),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw(2).onRoutingPeerClick(n,t,"in")}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function lp(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No incoming routing peer available."),o.qZA())}function rp(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting incoming routing peers..."),o.qZA())}function cp(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(3);o.xp6(1),o.Oqu(e.errorMessage)}}function up(e,t){if(1&e&&(o.TgZ(0,"td",46),o.YNc(1,lp,2,0,"p",47),o.YNc(2,rp,2,0,"p",47),o.YNc(3,cp,2,1,"p",47),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=e.RoutingPeersIncoming&&e.RoutingPeersIncoming.data)||(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.RoutingPeersIncoming&&e.RoutingPeersIncoming.data)||(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.RoutingPeersIncoming&&e.RoutingPeersIncoming.data)||(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.ERROR)}}const pp=function(e){return{"display-none":e}};function dp(e,t){if(1&e&&o._UZ(0,"tr",48),2&e){const e=o.oxw(2);o.Q6J("ngClass",o.VKq(1,pp,(null==e.RoutingPeersIncoming?null:e.RoutingPeersIncoming.data)&&(null==e.RoutingPeersIncoming||null==e.RoutingPeersIncoming.data?null:e.RoutingPeersIncoming.data.length)>0))}}function hp(e,t){1&e&&o._UZ(0,"tr",49)}function mp(e,t){1&e&&o._UZ(0,"tr",50)}function gp(e,t){1&e&&o._UZ(0,"mat-progress-bar",37)}function fp(e,t){1&e&&(o.TgZ(0,"th",38),o._uU(1,"Channel ID"),o.qZA())}function xp(e,t){if(1&e&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,$u,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),o.xp6(1),o.Oqu(e.chan_id)}}function Zp(e,t){1&e&&(o.TgZ(0,"th",38),o._uU(1,"Peer Alias"),o.qZA())}function yp(e,t){if(1&e&&(o.TgZ(0,"td",39),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("ngStyle",o.VKq(2,$u,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),o.xp6(1),o.Oqu(e.alias)}}function Ap(e,t){1&e&&(o.TgZ(0,"th",40),o._uU(1,"Events"),o.qZA())}function Cp(e,t){if(1&e&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.events))}}function Tp(e,t){1&e&&(o.TgZ(0,"th",40),o._uU(1,"Total Amount (Sats)"),o.qZA())}function bp(e,t){if(1&e&&(o.TgZ(0,"td",41),o.TgZ(1,"span",42),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.total_amount))}}function wp(e,t){1&e&&(o.TgZ(0,"th",43),o.TgZ(1,"span",42),o._uU(2,"Actions"),o.qZA(),o.qZA())}function _p(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",51),o.TgZ(1,"button",52),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw(2).onRoutingPeerClick(n,t,"out")}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function vp(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No outgoing routing peer available."),o.qZA())}function qp(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting outgoing routing peers..."),o.qZA())}function Sp(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(3);o.xp6(1),o.Oqu(e.errorMessage)}}function Fp(e,t){if(1&e&&(o.TgZ(0,"td",46),o.YNc(1,vp,2,0,"p",47),o.YNc(2,qp,2,0,"p",47),o.YNc(3,Sp,2,1,"p",47),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngIf",(!(null!=e.RoutingPeersOutgoing&&e.RoutingPeersOutgoing.data)||(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.RoutingPeersOutgoing&&e.RoutingPeersOutgoing.data)||(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.RoutingPeersOutgoing&&e.RoutingPeersOutgoing.data)||(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.ERROR)}}function Lp(e,t){if(1&e&&o._UZ(0,"tr",48),2&e){const e=o.oxw(2);o.Q6J("ngClass",o.VKq(1,pp,(null==e.RoutingPeersOutgoing?null:e.RoutingPeersOutgoing.data)&&(null==e.RoutingPeersOutgoing||null==e.RoutingPeersOutgoing.data?null:e.RoutingPeersOutgoing.data.length)>0))}}function kp(e,t){1&e&&o._UZ(0,"tr",49)}function Np(e,t){1&e&&o._UZ(0,"tr",50)}const Up=function(e,t){return{"mt-2":e,"mt-1":t}},Ip=function(){return["no_incoming_event"]},Op=function(e){return{"mt-2":e}},Jp=function(){return["no_outgoing_event"]};function Dp(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",4),o.TgZ(1,"div",5),o.TgZ(2,"div",6),o.TgZ(3,"div",7),o._uU(4,"Incoming"),o.qZA(),o.TgZ(5,"mat-form-field",8),o.TgZ(6,"input",9),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().filterIn=t})("keyup",function(t){return o.CHM(e),o.oxw().applyIncomingFilter(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",10),o.YNc(8,Wu,1,0,"mat-progress-bar",11),o.TgZ(9,"table",12,13),o.ynx(11,14),o.YNc(12,Xu,2,0,"th",15),o.YNc(13,ju,2,4,"td",16),o.BQk(),o.ynx(14,17),o.YNc(15,Ku,2,0,"th",15),o.YNc(16,ep,2,4,"td",16),o.BQk(),o.ynx(17,18),o.YNc(18,tp,2,0,"th",19),o.YNc(19,np,4,3,"td",20),o.BQk(),o.ynx(20,21),o.YNc(21,ap,2,0,"th",19),o.YNc(22,ip,4,3,"td",20),o.BQk(),o.ynx(23,22),o.YNc(24,sp,3,0,"th",23),o.YNc(25,op,3,0,"td",24),o.BQk(),o.ynx(26,25),o.YNc(27,up,4,3,"td",26),o.BQk(),o.YNc(28,dp,1,3,"tr",27),o.YNc(29,hp,1,0,"tr",28),o.YNc(30,mp,1,0,"tr",29),o.qZA(),o.qZA(),o._UZ(31,"mat-paginator",30,31),o.qZA(),o.TgZ(33,"div",5),o.TgZ(34,"div",6),o.TgZ(35,"div",7),o._uU(36,"Outgoing"),o.qZA(),o.TgZ(37,"mat-form-field",8),o.TgZ(38,"input",9),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().filterOut=t})("keyup",function(t){return o.CHM(e),o.oxw().applyOutgoingFilter(t.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(39,"div",10),o.YNc(40,gp,1,0,"mat-progress-bar",11),o.TgZ(41,"table",32,33),o.ynx(43,14),o.YNc(44,fp,2,0,"th",15),o.YNc(45,xp,2,4,"td",16),o.BQk(),o.ynx(46,17),o.YNc(47,Zp,2,0,"th",15),o.YNc(48,yp,2,4,"td",16),o.BQk(),o.ynx(49,18),o.YNc(50,Ap,2,0,"th",19),o.YNc(51,Cp,4,3,"td",20),o.BQk(),o.ynx(52,21),o.YNc(53,Tp,2,0,"th",19),o.YNc(54,bp,4,3,"td",20),o.BQk(),o.ynx(55,22),o.YNc(56,wp,3,0,"th",23),o.YNc(57,_p,3,0,"td",34),o.BQk(),o.ynx(58,35),o.YNc(59,Fp,4,3,"td",26),o.BQk(),o.YNc(60,Lp,1,3,"tr",27),o.YNc(61,kp,1,0,"tr",28),o.YNc(62,Np,1,0,"tr",29),o.qZA(),o.qZA(),o._UZ(63,"mat-paginator",30,36),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(2),o.Q6J("ngClass",o.WLB(22,Up,e.screenSize===e.screenSizeEnum.XS,e.screenSize===e.screenSizeEnum.SM)),o.xp6(4),o.Q6J("ngModel",e.filterIn),o.xp6(2),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.RoutingPeersIncoming),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(25,Ip)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS),o.xp6(3),o.Q6J("ngClass",o.VKq(26,Op,e.screenSize!==e.screenSizeEnum.LG)),o.xp6(4),o.Q6J("ngModel",e.filterOut),o.xp6(2),o.Q6J("ngIf",(null==e.apisCallStatus?null:e.apisCallStatus.GetForwardingHistory.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",e.RoutingPeersOutgoing),o.xp6(19),o.Q6J("matFooterRowDef",o.DdM(28,Jp)),o.xp6(1),o.Q6J("matHeaderRowDef",e.displayedColumns)("matHeaderRowDefSticky",e.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",e.displayedColumns),o.xp6(1),o.Q6J("pageSize",e.pageSize)("pageSizeOptions",e.pageSizeOptions)("showFirstLastButtons",e.screenSize!==e.screenSizeEnum.XS)}}let Rp=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.routingPeersData=[],this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.filterIn="",this.filterOut="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["chan_id","events","actions"]):this.screenSize===f.cu.SM||this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.GetForwardingHistory.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.GetForwardingHistory.message?JSON.stringify(this.apisCallStatus.GetForwardingHistory.message):this.apisCallStatus.GetForwardingHistory.message),this.routingPeersData=e.forwardingHistory&&e.forwardingHistory.forwarding_events?e.forwardingHistory.forwarding_events:[],this.routingPeersData.length>0&&this.sortIn&&this.paginatorIn&&this.sortOut&&this.paginatorOut&&this.loadRoutingPeersTable(this.routingPeersData),this.logger.info(e)})}onRoutingPeerClick(e,t,n){let a=" Routing Information";a="in"===n?"Incoming"+a:"Outgoing"+a,this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:a,message:[[{key:"chan_id",value:e.chan_id,title:"Channel ID",width:50,type:f.Gi.STRING},{key:"alias",value:e.alias,title:"Peer Alias",width:50,type:f.Gi.STRING}],[{key:"events",value:e.events,title:"Events",width:50,type:f.Gi.NUMBER},{key:"total_amount",value:e.total_amount,title:"Total Amount (Sats)",width:50,type:f.Gi.NUMBER}]]}}))}loadRoutingPeersTable(e){if(this.filterIn="",this.filterOut="",e.length>0){const t=this.groupRoutingPeers(e);this.RoutingPeersIncoming=new Ze.by(t[0]),this.RoutingPeersIncoming.sort=this.sortIn,this.RoutingPeersIncoming.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.RoutingPeersIncoming.paginator=this.paginatorIn,this.logger.info(this.RoutingPeersIncoming),this.RoutingPeersOutgoing=new Ze.by(t[1]),this.RoutingPeersOutgoing.sort=this.sortOut,this.RoutingPeersOutgoing.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.RoutingPeersOutgoing.paginator=this.paginatorOut,this.logger.info(this.RoutingPeersOutgoing)}else this.RoutingPeersIncoming=new Ze.by([]),this.RoutingPeersOutgoing=new Ze.by([])}groupRoutingPeers(e){const t=[],n=[];return e.forEach(e=>{const a=t.find(t=>t.chan_id===e.chan_id_in),i=n.find(t=>t.chan_id===e.chan_id_out);a?(a.events++,a.total_amount=+a.total_amount+ +e.amt_in):t.push({chan_id:e.chan_id_in,alias:e.alias_in,events:1,total_amount:+e.amt_in}),i?(i.events++,i.total_amount=+i.total_amount+ +e.amt_out):n.push({chan_id:e.chan_id_out,alias:e.alias_out,events:1,total_amount:+e.amt_out})}),[this.commonService.sortDescByKey(t,"total_amount"),this.commonService.sortDescByKey(n,"total_amount")]}applyIncomingFilter(e){this.RoutingPeersIncoming.filter=e.value.trim().toLowerCase()}applyOutgoingFilter(e){this.RoutingPeersOutgoing.filter=e.value.trim().toLowerCase()}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-routing-peers"]],viewQuery:function(e,t){if(1&e&&(o.Gf(Bu,5,xe.YE),o.Gf(Gu,5,xe.YE),o.Gf(Hu,5),o.Gf(zu,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sortIn=e.first),o.iGM(e=o.CRH())&&(t.sortOut=e.first),o.iGM(e=o.CRH())&&(t.paginatorIn=e.first),o.iGM(e=o.CRH())&&(t.paginatorOut=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("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","ngModelChange","keyup"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,Vu,2,1,"div",1),o.YNc(2,Dp,65,29,"div",2),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngIf",""!==t.errorMessage),o.xp6(1),o.Q6J("ngIf",""===t.errorMessage))},directives:[l.xw,l.Wh,a.O5,l.yH,a.mk,v.oO,D.KE,Ce.Nt,Ae.Fj,Ae.JJ,Ae.On,E.$V,Ze.BZ,xe.YE,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,q.lW,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.JJ],styles:[".mat-column-alias[_ngcontent-%COMP%], .mat-column-chan_id[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function Mp(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",7),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().activeLink=t.link}),o._uU(1),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.s9C("routerLink",e.link),o.Q6J("active",n.activeLink===e.link),o.xp6(1),o.Oqu(e.name)}}let Ep=(()=>{class e{constructor(e){this.router=e,this.faChartBar=g.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 e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{const t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"Reports"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o.TgZ(7,"nav",5),o.YNc(8,Mp,2,3,"div",6),o.qZA(),o._UZ(9,"router-outlet"),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("icon",t.faChartBar),o.xp6(7),o.Q6J("ngForOf",t.links))},directives:[l.xw,l.Wh,T.BN,w.a8,w.dn,ge.BU,a.sg,i.lC,ge.Nj,i.rH],styles:[""]}),e})();var Qp=n(4833),Yp=n(4018),Pp=n(1905);function Bp(e,t){1&e&&o._UZ(0,"mat-progress-bar",10)}function Gp(e,t){if(1&e&&(o.TgZ(0,"div",11),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&e){const e=o.oxw();o.Q6J("@fadeIn",e.events.total_fee_msat),o.xp6(1),o.AsE("",o.xi3(2,3,e.events.total_fee_msat/1e3||0,"1.0-2")," Sats/",o.lcZ(3,6,(null==e.events||null==e.events.forwarding_events?null:e.events.forwarding_events.length)||0)," Events")}}function Hp(e,t){1&e&&(o.TgZ(0,"div",12),o._uU(1,"No fee report for the selected period"),o.qZA())}const zp=function(e){return{"error-border":e}};function Vp(e,t){if(1&e&&(o.TgZ(0,"div",13),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(2,zp,"Getting fee report..."!==e.errorMessage&&""!==e.errorMessage)),o.xp6(1),o.Oqu(e.errorMessage)}}function Wp(e,t){if(1&e&&(o.TgZ(0,"span"),o.TgZ(1,"span",16),o._uU(2),o.ALo(3,"number"),o.qZA(),o.TgZ(4,"span",16),o._uU(5),o.ALo(6,"number"),o.qZA(),o.qZA()),2&e){const e=t.model;o.xp6(2),o.hij("Events: ",o.lcZ(3,2,e.extra.totalEvents||0),""),o.xp6(3),o.hij("Fee: ",o.xi3(6,4,e.value||0,"1.0-2"),"")}}function Xp(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"ngx-charts-bar-vertical",14),o.NdJ("select",function(t){return o.CHM(e),o.oxw().onChartBarSelected(t)})("mouseup",function(t){return o.CHM(e),o.oxw().onChartMouseUp(t)}),o.YNc(1,Wp,7,7,"ng-template",null,15,o.W1O),o.qZA()}if(2&e){const e=o.oxw();o.Q6J("view",e.view)("results",e.feeReportData)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)}}function $p(e,t){if(1&e&&o._UZ(0,"rtl-forwarding-history",17),2&e){const e=o.oxw();o.Q6J("eventsData",null==e.events?null:e.events.forwarding_events)("filterValue",e.eventFilterValue)}}let jp=(()=>{class e{constructor(e,t,n){this.dataService=e,this.commonService=t,this.store=n,this.reportPeriod=f.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=f.cu,this.errorMessage="",this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===f.cu.XS||this.screenSize===f.cu.SM),this.fetchEvents(this.startDate,this.endDate)}ngAfterContentInit(){const e=this.commonService.getContainerSize();switch(this.screenSize){case f.cu.MD:this.screenPaddingX=e.width/10;break;case f.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2]}fetchEvents(e,t){this.errorMessage=f.m6.GET_FEE_REPORT;const n=Math.round(e.getTime()/1e3).toString(),a=Math.round(t.getTime()/1e3).toString();this.dataService.getForwardingHistory(n,a).pipe((0,d.R)(this.unSubs[1])).subscribe({next:t=>{this.errorMessage="",t.forwarding_events&&t.forwarding_events.length?(t.forwarding_events=t.forwarding_events.reverse(),this.events=t,this.feeReportData=this.prepareFeeReport(e)):(this.events={},this.feeReportData=[])},error:e=>{this.errorMessage=e}})}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.eventFilterValue="")}onChartBarSelected(e){this.eventFilterValue=this.reportPeriod===f.op[1]?e.name+"/"+this.startDate.getFullYear():e.name.toString().padStart(2,"0")+"/"+f.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}prepareFeeReport(e){const t=Math.round(e.getTime()/1e3),n=[];if(this.reportPeriod===f.op[1]){for(let e=0;e<12;e++)n.push({name:f.gg[e].name,value:1e-9,extra:{totalEvents:0}});this.events.forwarding_events.map(e=>{const t=new Date(1e3*+e.timestamp).getMonth();return n[t].value=n[t].value+ +e.fee_msat/1e3,n[t].extra.totalEvents=n[t].extra.totalEvents+1,this.events.total_fee_msat=(this.events.total_fee_msat?this.events.total_fee_msat:0)+ +e.fee_msat,this.events})}else{for(let t=0;t<this.getMonthDays(e.getMonth(),e.getFullYear());t++)n.push({name:t+1,value:1e-9,extra:{totalEvents:0}});this.events.forwarding_events.map(e=>{const a=Math.floor((+e.timestamp-t)/this.secondsInADay);return n[a].value=n[a].value+ +e.fee_msat/1e3,n[a].extra.totalEvents=n[a].extra.totalEvents+1,this.events.total_fee_msat=(this.events.total_fee_msat?this.events.total_fee_msat:0)+ +e.fee_msat,this.events})}return n}onSelectionChange(e){const t=e.selDate.getMonth(),n=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===f.op[1]?(this.startDate=new Date(n,0,1,0,0,0),this.endDate=new Date(n,11,31,23,59,59)):(this.startDate=new Date(n,t,1,0,0,0),this.endDate=new Date(n,t,this.getMonthDays(t,n),23,59,59)),this.fetchEvents(this.startDate,this.endDate),this.eventFilterValue=""}getMonthDays(e,t){return 1===e&&t%4==0?f.gg[e].days+1:f.gg[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(dt.D),o.Y36(C.v),o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-fee-report"]],hostBindings:function(e,t){1&e&&o.NdJ("mouseup",function(e){return t.onChartMouseUp(e)})},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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"rtl-horizontal-scroller",1),o.NdJ("stepChanged",function(e){return t.onSelectionChange(e)}),o.qZA(),o.YNc(2,Bp,1,0,"mat-progress-bar",2),o.TgZ(3,"div",3),o.YNc(4,Gp,4,8,"div",4),o.YNc(5,Hp,2,0,"div",5),o.YNc(6,Vp,2,4,"div",6),o.TgZ(7,"div",7),o.YNc(8,Xp,3,11,"ngx-charts-bar-vertical",8),o.qZA(),o.TgZ(9,"div",7),o.YNc(10,$p,1,2,"rtl-forwarding-history",9),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(2),o.Q6J("ngIf","Getting fee report..."===t.errorMessage),o.xp6(2),o.Q6J("ngIf",t.feeReportData.length>0&&t.events.forwarding_events),o.xp6(1),o.Q6J("ngIf",(t.feeReportData.length<=0||!t.events.forwarding_events)&&""===t.errorMessage),o.xp6(1),o.Q6J("ngIf",""!==t.errorMessage),o.xp6(2),o.Q6J("ngIf",t.feeReportData.length>0&&t.events.forwarding_events),o.xp6(2),o.Q6J("ngIf",t.events&&(null==t.events?null:t.events.forwarding_events)))},directives:[l.xw,l.Wh,l.yH,Yp.D,a.O5,r.pW,a.mk,v.oO,Pp.K$,Pu],pipes:[a.JJ],styles:[""],data:{animation:[Qp.J]}}),e})();var Kp=n(6590);function ed(e,t){1&e&&(o.TgZ(0,"div",11),o._UZ(1,"mat-progress-bar",12),o.TgZ(2,"span"),o._uU(3,"Getting transactions data..."),o.qZA(),o.qZA())}function td(e,t){if(1&e&&(o.TgZ(0,"div",13),o._uU(1),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Oqu(e.errorMessage)}}function nd(e,t){if(1&e&&(o.TgZ(0,"div",16),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.AsE(" Paid ",o.xi3(2,2,e.transactionsReportSummary.amountPaidSelectedPeriod/1e3||0,"1.0-2")," Sats/",o.lcZ(3,5,e.transactionsReportSummary.paymentsSelectedPeriod)," Payments ")}}function ad(e,t){if(1&e&&(o.TgZ(0,"div",16),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.AsE(" Received ",o.xi3(2,2,e.transactionsReportSummary.amountReceivedSelectedPeriod/1e3||0,"1.0-2")," Sats/",o.lcZ(3,5,e.transactionsReportSummary.invoicesSelectedPeriod)," Invoices ")}}function id(e,t){if(1&e&&(o.TgZ(0,"div",14),o.YNc(1,nd,4,7,"div",15),o.YNc(2,ad,4,7,"div",15),o.qZA()),2&e){const e=o.oxw();o.Q6J("@fadeIn",e.transactionsReportSummary),o.xp6(1),o.Q6J("ngIf",e.transactionsReportSummary.paymentsSelectedPeriod>0),o.xp6(1),o.Q6J("ngIf",e.transactionsReportSummary.invoicesSelectedPeriod)}}function sd(e,t){1&e&&(o.TgZ(0,"div",17),o._uU(1,"No transactions report for the selected period"),o.qZA())}function od(e,t){if(1&e&&(o.TgZ(0,"span",21),o._uU(1),o.ALo(2,"number"),o.ALo(3,"number"),o.qZA()),2&e){const e=t.model;o.xp6(1),o.HOy("",e.name,": ",o.xi3(2,4,e.value||0,"1.0-2"),"/# ","Paid"===e.name?"Payments":"Invoices",": ",o.lcZ(3,7,(null==e.extra?null:e.extra.total)||0),"")}}function ld(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"ngx-charts-bar-vertical-2d",19),o.NdJ("select",function(t){return o.CHM(e),o.oxw(2).onChartBarSelected(t)})("mouseup",function(t){return o.CHM(e),o.oxw(2).onChartMouseUp(t)}),o.YNc(1,od,4,9,"ng-template",null,20,o.W1O),o.qZA()}if(2&e){const e=o.oxw(2);o.Q6J("view",e.view)("results",e.transactionsReportData)("noBarWhenZero",!1)("gradient",!1)("xAxis",!0)("yAxis",!0)("showXAxisLabel",!0)("showYAxisLabel",e.showYAxisLabel)("xAxisLabel",e.xAxisLabel)("yAxisLabel",e.yAxisLabel)("showGridLines",!1)("showDataLabel",!1)("groupPadding",e.reportPeriod===e.scrollRanges[0]?2:8)}}function rd(e,t){if(1&e&&(o.TgZ(0,"div",9),o.YNc(1,ld,3,13,"ngx-charts-bar-vertical-2d",18),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",e.transactionsReportData.length>0&&e.transactionsNonZeroReportData.length>0)}}function cd(e,t){if(1&e&&o._UZ(0,"rtl-transactions-report-table",22),2&e){const e=o.oxw();o.Q6J("dataList",e.transactionsNonZeroReportData)("dataRange",e.reportPeriod)("filterValue",e.transactionFilterValue)}}let ud=(()=>{class e{constructor(e,t){this.commonService=e,this.store=t,this.scrollRanges=f.op,this.reportPeriod=f.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=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.screenSize=this.commonService.getScreenSize(),this.showYAxisLabel=!(this.screenSize===f.cu.XS||this.screenSize===f.cu.SM),this.store.select("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchLightningTransactions.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchLightningTransactions.message?JSON.stringify(this.apisCallStatus.FetchLightningTransactions.message):this.apisCallStatus.FetchLightningTransactions.message),this.payments=e.allLightningTransactions.paymentsAll?e.allLightningTransactions.paymentsAll.payments:[],this.invoices=e.allLightningTransactions.invoicesAll?e.allLightningTransactions.invoicesAll.invoices:[],(this.payments.length>0||this.invoices.length>0)&&(this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData())})}ngAfterContentInit(){const e=this.commonService.getContainerSize();switch(this.screenSize){case f.cu.MD:this.screenPaddingX=e.width/10;break;case f.cu.LG:this.screenPaddingX=e.width/16;break;default:this.screenPaddingX=e.width/20}this.view=[e.width-this.screenPaddingX,e.height/2.2]}onChartMouseUp(e){"svg"===e.srcElement.tagName&&e.srcElement.classList.length>0&&"ngx-charts"===e.srcElement.classList[0]&&(this.transactionFilterValue="")}onChartBarSelected(e){this.transactionFilterValue=this.reportPeriod===f.op[1]?e.series+"/"+this.startDate.getFullYear():e.series.toString().padStart(2,"0")+"/"+f.gg[this.startDate.getMonth()].name+"/"+this.startDate.getFullYear()}filterTransactionsForSelectedPeriod(e,t){const n=Math.round(e.getTime()/1e3),a=Math.round(t.getTime()/1e3),i=[];this.transactionsNonZeroReportData=[],this.transactionsReportSummary={paymentsSelectedPeriod:0,invoicesSelectedPeriod:0,amountPaidSelectedPeriod:0,amountReceivedSelectedPeriod:0};const s=this.payments.filter(e=>"SUCCEEDED"===e.status&&e.creation_date>=n&&e.creation_date<a),o=this.invoices.filter(e=>e.settled&&+e.creation_date>=n&&+e.creation_date<a);if(this.transactionsReportSummary.paymentsSelectedPeriod=s.length,this.transactionsReportSummary.invoicesSelectedPeriod=o.length,this.reportPeriod===f.op[1]){for(let t=0;t<12;t++)i.push({name:f.gg[t].name,date:new Date(e.getFullYear(),t,1,0,0,0,0),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});s.map(e=>{const t=new Date(1e3*+e.creation_date).getMonth();return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+ +e.value_msat+ +e.fee_msat,i[t].series[0].value=i[t].series[0].value+(+e.value_msat+ +e.fee_msat)/1e3,i[t].series[0].extra.total=i[t].series[0].extra.total+1,this.transactionsReportSummary}),o.map(e=>{const t=new Date(1e3*+e.creation_date).getMonth();return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+ +e.amt_paid_msat,i[t].series[1].value=i[t].series[1].value+ +e.amt_paid_msat/1e3,i[t].series[1].extra.total=i[t].series[1].extra.total+1,this.transactionsReportSummary})}else{for(let t=0;t<this.getMonthDays(e.getMonth(),e.getFullYear());t++)i.push({name:(t+1).toString(),date:new Date(1e3*(t*this.secondsInADay+n)),series:[{name:"Paid",value:0,extra:{total:0}},{name:"Received",value:0,extra:{total:0}}]});s.map(e=>{const t=Math.floor((+e.creation_date-n)/this.secondsInADay);return this.transactionsReportSummary.amountPaidSelectedPeriod=this.transactionsReportSummary.amountPaidSelectedPeriod+ +e.value_msat+ +e.fee_msat,i[t].series[0].value=i[t].series[0].value+(+e.value_msat+ +e.fee_msat)/1e3,i[t].series[0].extra.total=i[t].series[0].extra.total+1,this.transactionsReportSummary}),o.map(e=>{const t=Math.floor((+e.creation_date-n)/this.secondsInADay);return this.transactionsReportSummary.amountReceivedSelectedPeriod=this.transactionsReportSummary.amountReceivedSelectedPeriod+ +e.amt_paid_msat,i[t].series[1].value=i[t].series[1].value+ +e.amt_paid_msat/1e3,i[t].series[1].extra.total=i[t].series[1].extra.total+1,this.transactionsReportSummary})}return i}prepareTableData(){return this.transactionsReportData.reduce((e,t)=>t.series[0].extra.total>0||t.series[1].extra.total>0?e.concat({date:t.date,amount_paid:t.series[0].value,num_payments:t.series[0].extra.total,amount_received:t.series[1].value,num_invoices:t.series[1].extra.total}):e,[])}onSelectionChange(e){const t=e.selDate.getMonth(),n=e.selDate.getFullYear();this.reportPeriod=e.selScrollRange,this.reportPeriod===f.op[1]?(this.startDate=new Date(n,0,1,0,0,0),this.endDate=new Date(n,11,31,23,59,59)):(this.startDate=new Date(n,t,1,0,0,0),this.endDate=new Date(n,t,this.getMonthDays(t,n),23,59,59)),this.transactionsReportData=this.filterTransactionsForSelectedPeriod(this.startDate,this.endDate),this.transactionsNonZeroReportData=this.prepareTableData(),this.transactionFilterValue=""}getMonthDays(e,t){return 1===e&&t%4==0?f.gg[e].days+1:f.gg[e].days}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(C.v),o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-transactions-report"]],hostBindings:function(e,t){1&e&&o.NdJ("mouseup",function(e){return t.onChartMouseUp(e)})},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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o.TgZ(3,"rtl-horizontal-scroller",3),o.NdJ("stepChanged",function(e){return t.onSelectionChange(e)}),o.qZA(),o.YNc(4,ed,4,0,"div",4),o.YNc(5,td,2,1,"div",5),o.YNc(6,id,3,3,"div",6),o.YNc(7,sd,2,0,"div",7),o.YNc(8,rd,2,1,"div",8),o.TgZ(9,"div",9),o.YNc(10,cd,1,3,"rtl-transactions-report-table",10),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(4),o.Q6J("ngIf",t.apisCallStatus.FetchLightningTransactions.status===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",t.apisCallStatus.FetchLightningTransactions.status===t.apiCallStatusEnum.ERROR),o.xp6(1),o.Q6J("ngIf",t.transactionsNonZeroReportData.length>0&&t.apisCallStatus.FetchLightningTransactions.status===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",t.transactionsNonZeroReportData.length<=0&&t.apisCallStatus.FetchLightningTransactions.status===t.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",t.transactionsNonZeroReportData.length>0&&t.apisCallStatus.FetchLightningTransactions.status===t.apiCallStatusEnum.COMPLETED),o.xp6(2),o.Q6J("ngIf",t.transactionsNonZeroReportData.length>0&&t.apisCallStatus.FetchLightningTransactions.status===t.apiCallStatusEnum.COMPLETED))},directives:[l.xw,l.Wh,l.yH,Yp.D,a.O5,r.pW,Pp.H5,Kp.g],pipes:[a.JJ],styles:[""],data:{animation:[Qp.J]}}),e})();const pd=["form"];function dd(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"UTXO Label is required."),o.qZA())}function hd(e,t){if(1&e&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.labelError)}}function md(e,t){if(1&e&&(o.TgZ(0,"div",16),o._UZ(1,"fa-icon",17),o.YNc(2,hd,2,1,"span",11),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==e.labelError)}}let gd=(()=>{class e{constructor(e,t,n,a,i,s){this.dialogRef=e,this.data=t,this.dataService=n,this.store=a,this.snackBar=i,this.commonService=s,this.faExclamationTriangle=g.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:e=>{this.store.dispatch(new x.eL),this.store.dispatch(new x.Zt),this.snackBar.open("Successfully labelled the UTXO."),this.dialogRef.close()},error:e=>{this.labelError=e}})}resetData(){this.labelError="",this.label=""}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(dt.D),o.Y36(y.yh),o.Y36(Ai.ux),o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-on-chain-lebel-modal"]],viewQuery:function(e,t){if(1&e&&o.Gf(pd,7),2&e){let e;o.iGM(e=o.CRH())&&(t.form=e.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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-flat-button","","color","primary","type","submit","tabindex","8"],["fxFlex","100",1,"alert","alert-danger","mt-1"],[1,"mr-1","alert-icon",3,"icon"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5,"Label UTXO"),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.TgZ(9,"form",7,8),o.NdJ("submit",function(){return t.onLabelUTXO()})("reset",function(){return t.resetData()}),o.TgZ(11,"mat-form-field",9),o.TgZ(12,"input",10),o.NdJ("ngModelChange",function(e){return t.label=e}),o.qZA(),o.YNc(13,dd,2,0,"mat-error",11),o.qZA(),o.YNc(14,md,3,2,"div",12),o.TgZ(15,"div",13),o.TgZ(16,"button",14),o._uU(17,"Clear"),o.qZA(),o.TgZ(18,"button",15),o._uU(19,"Label UTXO"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(6),o.Q6J("mat-dialog-close",!1),o.xp6(6),o.Q6J("ngModel",t.label),o.xp6(1),o.Q6J("ngIf",!t.label),o.xp6(1),o.Q6J("ngIf",""!==t.labelError))},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,ye.ZT,w.dn,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Te.h,Ae.Q7,Ae.JJ,Ae.On,a.O5,D.TO,T.BN],styles:[""]}),e})();function fd(e,t){1&e&&o._UZ(0,"mat-progress-bar",28)}function xd(e,t){1&e&&(o.TgZ(0,"th",29),o._uU(1," Transaction ID "),o.qZA())}function Zd(e,t){1&e&&(o.TgZ(0,"span",35),o.TgZ(1,"mat-icon",36),o._uU(2,"warning"),o.qZA(),o.qZA())}function yd(e,t){if(1&e&&(o.TgZ(0,"span"),o.YNc(1,Zd,3,0,"span",34),o.qZA()),2&e){const e=o.oxw().$implicit;o.oxw();const t=o.MAs(34);o.xp6(1),o.Q6J("ngIf",e.amount_sat<1e3)("ngIfElse",t)}}const Ad=function(e){return{"max-width":e}};function Cd(e,t){if(1&e&&(o.TgZ(0,"td",30),o.TgZ(1,"span",31),o.YNc(2,yd,2,2,"span",32),o.TgZ(3,"span",33),o._uU(4),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(3,Ad,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),o.xp6(2),o.Q6J("ngIf",n.utxos.length>0&&!n.isDustUTXO),o.xp6(2),o.Oqu(e.outpoint.txid_str)}}function Td(e,t){1&e&&(o.TgZ(0,"th",37),o._uU(1," Output "),o.qZA())}function bd(e,t){if(1&e&&(o.TgZ(0,"td",38),o.TgZ(1,"span",39),o._uU(2),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(e.outpoint.output_index)}}function wd(e,t){1&e&&(o.TgZ(0,"th",29),o._uU(1," Label "),o.qZA())}function _d(e,t){if(1&e&&(o.TgZ(0,"td",30),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,Ad,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),o.xp6(1),o.hij(" ",null==e?null:e.label," ")}}function vd(e,t){1&e&&(o.TgZ(0,"th",37),o._uU(1," Amount (Sats) "),o.qZA())}function qd(e,t){if(1&e&&(o.TgZ(0,"td",38),o.TgZ(1,"span",39),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.amount_sat||0))}}function Sd(e,t){1&e&&(o.TgZ(0,"th",37),o._uU(1," Confirmations "),o.qZA())}function Fd(e,t){if(1&e&&(o.TgZ(0,"td",38),o.TgZ(1,"span",39),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.confirmations||0))}}function Ld(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",40),o.TgZ(1,"div",41),o.TgZ(2,"mat-select",42),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",43),o.NdJ("click",function(){return o.CHM(e),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function kd(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",44),o.TgZ(1,"div",45),o.TgZ(2,"mat-select",46),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",43),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onUTXOClick(t)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",43),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onLabelUTXO(t)}),o._uU(7,"Label"),o.qZA(),o.TgZ(8,"mat-option",43),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onLeaseUTXO(t)}),o._uU(9,"Lease"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Nd(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No UTXO available."),o.qZA())}function Ud(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting UTXOs..."),o.qZA())}function Id(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function Od(e,t){if(1&e&&(o.TgZ(0,"td",47),o.YNc(1,Nd,2,0,"p",32),o.YNc(2,Ud,2,0,"p",32),o.YNc(3,Id,2,1,"p",32),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=e.listUTXOs&&e.listUTXOs.data)||(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchUTXOs.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.listUTXOs&&e.listUTXOs.data)||(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchUTXOs.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.listUTXOs&&e.listUTXOs.data)||(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchUTXOs.status)===e.apiCallStatusEnum.ERROR)}}const Jd=function(e){return{"display-none":e}};function Dd(e,t){if(1&e&&o._UZ(0,"tr",48),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,Jd,(null==e.listUTXOs?null:e.listUTXOs.data)&&(null==e.listUTXOs||null==e.listUTXOs.data?null:e.listUTXOs.data.length)>0))}}function Rd(e,t){1&e&&o._UZ(0,"tr",49)}function Md(e,t){1&e&&o._UZ(0,"tr",50)}function Ed(e,t){1&e&&o._UZ(0,"mat-icon",36)}const Qd=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Yd=function(){return["no_utxo"]};let Pd=(()=>{class e{constructor(e,t,n,a,i,s){this.logger=e,this.commonService=t,this.dataService=n,this.store=a,this.rtlEffects=i,this.decimalPipe=s,this.isDustUTXO=!1,this.addressType=f.x$,this.faMoneyBillWave=g.aj4,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["amount_sat","confirmations","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["tx_id","output","amount_sat","actions"]):this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchUTXOs.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchUTXOs.message?JSON.stringify(this.apisCallStatus.FetchUTXOs.message):this.apisCallStatus.FetchUTXOs.message),e.utxos&&e.utxos.length>0&&(this.utxos=this.isDustUTXO?e.utxos.filter(e=>+e.amount_sat<1e3):e.utxos,this.loadUTXOsTable(this.utxos)),this.logger.info(e)})}ngOnChanges(){this.utxos&&this.utxos.length>0&&this.loadUTXOsTable(this.utxos)}applyFilter(e){this.listUTXOs.filter=e.value.trim().toLowerCase()}onUTXOClick(e){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"UTXO Information",message:[[{key:"txid",value:e.outpoint.txid_str,title:"Transaction ID",width:100,type:f.Gi.STRING}],[{key:"label",value:e.label,title:"Label",width:100,type:f.Gi.STRING}],[{key:"output_index",value:e.outpoint.output_index,title:"Output Index",width:34,type:f.Gi.NUMBER},{key:"amount_sat",value:e.amount_sat,title:"Amount (Sats)",width:33,type:f.Gi.NUMBER},{key:"confirmations",value:e.confirmations,title:"Confirmations",width:33,type:f.Gi.NUMBER}],[{key:"address_type",value:this.addressType[e.address_type].name,title:"Address Type",width:34},{key:"address",value:e.address,title:"Address",width:66}],[{key:"pk_script",value:e.pk_script,title:"PK Script",width:100,type:f.Gi.STRING}]]}}))}loadUTXOsTable(e){this.listUTXOs=new Ze.by([...e]),this.listUTXOs.filterPredicate=(e,t)=>((e.label?e.label.toLowerCase():"")+(e.outpoint.txid_str?e.outpoint.txid_str.toLowerCase():"")+(e.outpoint.output_index?e.outpoint.output_index:"")+(e.outpoint.txid_bytes?e.outpoint.txid_bytes.toLowerCase():"")+(e.address?e.address.toLowerCase():"")+(e.address_type?e.address_type.toLowerCase():"")+(e.amount_sat?e.amount_sat:"")+(e.confirmations?e.confirmations:"")+(e.pk_script?e.pk_script.toLowerCase():"")).includes(t),this.listUTXOs.sortingDataAccessor=(e,t)=>{switch(t){case"tx_id":return e.outpoint.txid_str.toLocaleLowerCase();case"output":return+e.outpoint.output_index;default:return e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null}},this.listUTXOs.sort=this.sort,this.listUTXOs.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.listUTXOs.paginator=this.paginator,this.logger.info(this.listUTXOs)}onLabelUTXO(e){this.store.dispatch(new ee.wu({data:{utxo:e,component:gd}}))}onLeaseUTXO(e){const t=[[{key:"txid_str",value:e.outpoint.txid_str,title:"Transaction ID",width:100}],[{key:"amount_sat",value:this.decimalPipe.transform(e.amount_sat),title:"Amount (Sats)",width:100}]];e.label&&t.splice(1,0,[{key:"label",value:e.label,title:"Label",width:100}]),this.store.dispatch(new ee.b_({data:{type:f.n_.CONFIRM,alertTitle:"Lease UTXO",informationMessage:"The UTXO will be leased for 10 minutes.",message:t,noBtnText:"Cancel",yesBtnText:"Lease UTXO"}})),this.rtlEffects.closeConfirm.pipe((0,d.R)(this.unSubs[0])).subscribe(t=>{t&&this.dataService.leaseUTXO(e.outpoint.txid_bytes,e.outpoint.output_index)})}onDownloadCSV(){this.listUTXOs.data&&this.listUTXOs.data.length>0&&this.commonService.downloadFile(this.listUTXOs.data,"UTXOs")}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(dt.D),o.Y36(y.yh),o.Y36(St.V),o.Y36(a.JJ))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-on-chain-utxos"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},inputs:{isDustUTXO:"isDustUTXO"},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("UTXOs")}]),o.TTD],decls:35,vars:13,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,"keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","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,"mr-1"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-form-field",2),o.TgZ(3,"input",3),o.NdJ("keyup",function(e){return t.applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(4,"div",4),o.TgZ(5,"div",5),o.YNc(6,fd,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,xd,2,0,"th",10),o.YNc(11,Cd,5,5,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,Td,2,0,"th",13),o.YNc(14,bd,3,1,"td",14),o.BQk(),o.ynx(15,15),o.YNc(16,wd,2,0,"th",10),o.YNc(17,_d,2,4,"td",11),o.BQk(),o.ynx(18,16),o.YNc(19,vd,2,0,"th",13),o.YNc(20,qd,4,3,"td",14),o.BQk(),o.ynx(21,17),o.YNc(22,Sd,2,0,"th",13),o.YNc(23,Fd,4,3,"td",14),o.BQk(),o.ynx(24,18),o.YNc(25,Ld,6,0,"th",19),o.YNc(26,kd,10,0,"td",20),o.BQk(),o.ynx(27,21),o.YNc(28,Od,4,3,"td",22),o.BQk(),o.YNc(29,Dd,1,3,"tr",23),o.YNc(30,Rd,1,0,"tr",24),o.YNc(31,Md,1,0,"tr",25),o.qZA(),o._UZ(32,"mat-paginator",26),o.qZA(),o.qZA(),o.qZA(),o.YNc(33,Ed,1,0,"ng-template",null,27,o.W1O)),2&e&&(o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchUTXOs.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.listUTXOs)("ngClass",o.VKq(10,Qd,""!==t.errorMessage)),o.xp6(22),o.Q6J("matFooterRowDef",o.DdM(12,Yd)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,l.yH,l.Wh,D.KE,Ce.Nt,E.$V,a.O5,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,R.gM,S.Hw,we.gD,we.$L,ve.ey,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.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}"]}),e})();function Bd(e,t){1&e&&o._UZ(0,"mat-progress-bar",28)}function Gd(e,t){1&e&&(o.TgZ(0,"th",29),o._uU(1," Date/Time "),o.qZA())}function Hd(e,t){if(1&e&&(o.TgZ(0,"td",30),o._uU(1),o.ALo(2,"date"),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Oqu(o.xi3(2,1,1e3*e.time_stamp,"dd/MMM/YYYY HH:mm"))}}function zd(e,t){1&e&&(o.TgZ(0,"th",29),o._uU(1," Label "),o.qZA())}const Vd=function(e){return{"max-width":e}};function Wd(e,t){if(1&e&&(o.TgZ(0,"td",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,Vd,n.screenSize===n.screenSizeEnum.XS?"12rem":"25rem")),o.xp6(1),o.hij(" ",null==e?null:e.label," ")}}function Xd(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Amount (Sats) "),o.qZA())}function $d(e,t){if(1&e&&(o.TgZ(0,"span",35),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.Oqu(o.lcZ(2,1,e.amount))}}function jd(e,t){if(1&e&&(o.TgZ(0,"span",36),o._uU(1),o.ALo(2,"number"),o.qZA()),2&e){const e=o.oxw().$implicit;o.xp6(1),o.hij("(",o.lcZ(2,1,-1*e.amount),")")}}function Kd(e,t){if(1&e&&(o.TgZ(0,"td",30),o.YNc(1,$d,3,3,"span",33),o.YNc(2,jd,3,3,"span",34),o.qZA()),2&e){const e=t.$implicit;o.xp6(1),o.Q6J("ngIf",e.amount>0||0===e.amount),o.xp6(1),o.Q6J("ngIf",e.amount<0)}}function eh(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Fees (Sats) "),o.qZA())}function th(e,t){if(1&e&&(o.TgZ(0,"td",30),o.TgZ(1,"span",35),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.total_fees))}}function nh(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Block Height "),o.qZA())}function ah(e,t){if(1&e&&(o.TgZ(0,"td",30),o.TgZ(1,"span",35),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.Oqu(o.lcZ(3,1,e.block_height))}}function ih(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Confirmations "),o.qZA())}function sh(e,t){if(1&e&&(o.TgZ(0,"td",30),o.TgZ(1,"span",35),o._uU(2),o.ALo(3,"number"),o.qZA(),o.qZA()),2&e){const e=t.$implicit;o.xp6(2),o.hij(" ",o.lcZ(3,1,null==e?null:e.num_confirmations)," ")}}function oh(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"th",37),o.TgZ(1,"div",38),o.TgZ(2,"mat-select",39),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",40),o.NdJ("click",function(){return o.CHM(e),o.oxw().onDownloadCSV()}),o._uU(5,"Download CSV"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function lh(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",41),o.TgZ(1,"button",42),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onTransactionClick(t)}),o._uU(2,"View Info"),o.qZA(),o.qZA()}}function rh(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No transaction available."),o.qZA())}function ch(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting transactions..."),o.qZA())}function uh(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function ph(e,t){if(1&e&&(o.TgZ(0,"td",43),o.YNc(1,rh,2,0,"p",44),o.YNc(2,ch,2,0,"p",44),o.YNc(3,uh,2,1,"p",44),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchTransactions.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchTransactions.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.listTransactions&&e.listTransactions.data)||(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchTransactions.status)===e.apiCallStatusEnum.ERROR)}}const dh=function(e){return{"display-none":e}};function hh(e,t){if(1&e&&o._UZ(0,"tr",45),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,dh,(null==e.listTransactions?null:e.listTransactions.data)&&(null==e.listTransactions||null==e.listTransactions.data?null:e.listTransactions.data.length)>0))}}function mh(e,t){1&e&&o._UZ(0,"tr",46)}function gh(e,t){1&e&&o._UZ(0,"tr",47)}const fh=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},xh=function(){return["no_transaction"]};let Zh=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.commonService=t,this.store=n,this.datePipe=a,this.faHistory=g.qO$,this.displayedColumns=[],this.flgSticky=!1,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.cu.XS?(this.flgSticky=!1,this.displayedColumns=["time_stamp","amount","actions"]):this.screenSize===f.cu.SM?(this.flgSticky=!1,this.displayedColumns=["time_stamp","amount","num_confirmations","total_fees","actions"]):this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchTransactions.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchTransactions.message?JSON.stringify(this.apisCallStatus.FetchTransactions.message):this.apisCallStatus.FetchTransactions.message),e.transactions&&e.transactions.length>0&&(this.transactions=e.transactions,this.loadTransactionsTable(this.transactions)),this.logger.info(e)})}ngOnChanges(){this.transactions&&this.transactions.length>0&&this.loadTransactionsTable(this.transactions)}applyFilter(e){this.listTransactions.filter=e.value.trim().toLowerCase()}onTransactionClick(e){this.store.dispatch(new ee.wu({data:{type:f.n_.INFORMATION,alertTitle:"Transaction Information",message:[[{key:"block_hash",value:e.block_hash,title:"Block Hash",width:100}],[{key:"tx_hash",value:e.tx_hash,title:"Transaction Hash",width:100}],[{key:"label",value:e.label,title:"Label",width:100,type:f.Gi.STRING}],[{key:"time_stamp",value:e.time_stamp,title:"Date/Time",width:50,type:f.Gi.DATE_TIME},{key:"block_height",value:e.block_height,title:"Block Height",width:50,type:f.Gi.NUMBER}],[{key:"num_confirmations",value:e.num_confirmations,title:"Number of Confirmations",width:34,type:f.Gi.NUMBER},{key:"total_fees",value:e.total_fees,title:"Total Fees (Sats)",width:33,type:f.Gi.NUMBER},{key:"amount",value:e.amount,title:"Amount (Sats)",width:33,type:f.Gi.NUMBER}],[{key:"dest_addresses",value:e.dest_addresses,title:"Destination Addresses",width:100,type:f.Gi.ARRAY}]],scrollable:e.dest_addresses&&e.dest_addresses.length>5}}))}loadTransactionsTable(e){this.listTransactions=new Ze.by([...e]),this.listTransactions.sort=this.sort,this.listTransactions.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.listTransactions.filterPredicate=(e,t)=>((e.time_stamp?this.datePipe.transform(new Date(1e3*e.time_stamp),"dd/MMM/YYYY HH:mm").toLowerCase():"")+JSON.stringify(e).toLowerCase()).includes(t),this.listTransactions.paginator=this.paginator,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(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(y.yh),o.Y36(a.uU))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-on-chain-transaction-history"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("Transactions")}]),o.TTD],decls:36,vars:13,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,"keyup"],["fxLayout","row","fxLayoutAlign","start start"],["fxLayout","column","fxLayoutAlign","start end","fxFlex","100",1,"table-container",3,"perfectScrollbar"],["mode","indeterminate",4,"ngIf"],["mat-table","","fxFlex","100","matSort","",3,"dataSource","ngClass"],["table",""],["matColumnDef","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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-form-field",2),o.TgZ(3,"input",3),o.NdJ("keyup",function(e){return t.applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(4,"div",4),o.TgZ(5,"div",5),o.YNc(6,Bd,1,0,"mat-progress-bar",6),o.TgZ(7,"table",7,8),o.ynx(9,9),o.YNc(10,Gd,2,0,"th",10),o.YNc(11,Hd,3,4,"td",11),o.BQk(),o.ynx(12,12),o.YNc(13,zd,2,0,"th",10),o.YNc(14,Wd,2,4,"td",13),o.BQk(),o.ynx(15,14),o.YNc(16,Xd,2,0,"th",15),o.YNc(17,Kd,3,2,"td",11),o.BQk(),o.ynx(18,16),o.YNc(19,eh,2,0,"th",15),o.YNc(20,th,4,3,"td",11),o.BQk(),o.ynx(21,17),o.YNc(22,nh,2,0,"th",15),o.YNc(23,ah,4,3,"td",11),o.BQk(),o.ynx(24,18),o.YNc(25,ih,2,0,"th",15),o.YNc(26,sh,4,3,"td",11),o.BQk(),o.ynx(27,19),o.YNc(28,oh,6,0,"th",20),o.YNc(29,lh,3,0,"td",21),o.BQk(),o.ynx(30,22),o.YNc(31,ph,4,3,"td",23),o.BQk(),o.YNc(32,hh,1,3,"tr",24),o.YNc(33,mh,1,0,"tr",25),o.YNc(34,gh,1,0,"tr",26),o.qZA(),o._UZ(35,"mat-paginator",27),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchTransactions.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.listTransactions)("ngClass",o.VKq(10,fh,""!==t.errorMessage)),o.xp6(25),o.Q6J("matFooterRowDef",o.DdM(12,xh)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,l.yH,l.Wh,D.KE,Ce.Nt,E.$V,a.O5,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,we.gD,we.$L,ve.ey,q.lW,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],pipes:[a.uU,a.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}"]}),e})();function yh(e,t){if(1&e&&(o.TgZ(0,"span",5),o._uU(1,"UTXOs"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.numUtxos)}}function Ah(e,t){if(1&e&&(o.TgZ(0,"span",5),o._uU(1,"Transactions"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.numTransactions)}}function Ch(e,t){if(1&e&&(o.TgZ(0,"span",5),o._uU(1,"Dust UTXOs"),o.qZA()),2&e){const e=o.oxw();o.s9C("matBadge",e.numDustUtxos)}}let Th=(()=>{class e{constructor(e,t){this.logger=e,this.store=t,this.selectedTableIndex=0,this.selectedTableIndexChange=new o.vpe,this.numTransactions=0,this.numUtxos=0,this.numDustUtxos=0,this.unSubs=[new p.x]}ngOnInit(){this.store.dispatch(new x.eL),this.store.dispatch(new x.Zt),this.store.select("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{e.utxos&&e.utxos.length>0&&(this.numUtxos=e.utxos.length,this.numDustUtxos=e.utxos.filter(e=>+e.amount_sat<1e3).length),e.transactions&&e.transactions.length>0&&(this.numTransactions=e.transactions.length),this.logger.info(e)})}onSelectedIndexChanged(e){this.selectedTableIndexChange.emit(e)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"mat-tab-group",1),o.NdJ("selectedIndexChange",function(e){return t.onSelectedIndexChanged(e)}),o.TgZ(2,"mat-tab"),o.YNc(3,yh,2,1,"ng-template",2),o._UZ(4,"rtl-on-chain-utxos",3),o.qZA(),o.TgZ(5,"mat-tab"),o.YNc(6,Ah,2,1,"ng-template",2),o._UZ(7,"rtl-on-chain-transaction-history",4),o.qZA(),o.TgZ(8,"mat-tab"),o.YNc(9,Ch,2,1,"ng-template",2),o._UZ(10,"rtl-on-chain-utxos",3),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("selectedIndex",t.selectedTableIndex),o.xp6(3),o.Q6J("isDustUTXO",!1),o.xp6(6),o.Q6J("isDustUTXO",!0))},directives:[l.xw,l.yH,l.Wh,ge.SP,ge.uX,ge.uD,Pd,Zh,ra.k],styles:[""]}),e})();const bh=function(e,t){return[e,t]};function wh(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",12),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().activeLink=null==t?null:t.link}),o._uU(1),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.Q6J("active",n.activeLink===(null==e?null:e.link))("routerLink",o.WLB(3,bh,null==e?null:e.link,null==n.selectedTable?null:n.selectedTable.name)),o.xp6(1),o.Oqu(null==e?null:e.name)}}let _h=(()=>{class e{constructor(e,t,n){this.store=e,this.router=t,this.activatedRoute=n,this.selNode={},this.faExchangeAlt=g.Ssp,this.faChartPie=g.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 e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.selectedTable=this.tables.find(e=>e.name===this.router.url.substring(this.router.url.lastIndexOf("/")+1)),this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{const t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link,this.selectedTable=this.tables.find(t=>t.name===e.urlAfterRedirects.substring(e.urlAfterRedirects.lastIndexOf("/")+1))}),this.store.select("lnd").pipe((0,d.R)(this.unSubs[1])).subscribe(e=>{this.selNode=e.nodeSettings,this.balances=[{title:"Total Balance",dataValue:e.blockchainBalance.total_balance||0},{title:"Confirmed",dataValue:e.blockchainBalance.confirmed_balance},{title:"Unconfirmed",dataValue:e.blockchainBalance.unconfirmed_balance}]})}onSelectedTableIndexChanged(e){this.selectedTable=this.tables.find(t=>t.id===e),this.router.navigate(["./",this.activeLink,this.selectedTable.name],{relativeTo:this.activatedRoute})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh),o.Y36(i.F0),o.Y36(i.gz))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"On-chain Balance"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o._UZ(7,"rtl-currency-unit-converter",5),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",0),o._UZ(9,"fa-icon",1),o.TgZ(10,"span",2),o._uU(11,"On-chain Transactions"),o.qZA(),o.qZA(),o.TgZ(12,"div",6),o.TgZ(13,"mat-card"),o.TgZ(14,"mat-card-content",4),o.TgZ(15,"nav",7),o.YNc(16,wh,2,6,"div",8),o.qZA(),o.TgZ(17,"div",9),o._UZ(18,"router-outlet"),o.qZA(),o.TgZ(19,"div",10),o.TgZ(20,"rtl-utxo-tables",11),o.NdJ("selectedTableIndexChange",function(e){return t.onSelectedTableIndexChanged(e)}),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("icon",t.faChartPie),o.xp6(6),o.Q6J("values",t.balances),o.xp6(2),o.Q6J("icon",t.faExchangeAlt),o.xp6(7),o.Q6J("ngForOf",t.links),o.xp6(4),o.Q6J("selectedTableIndex",null==t.selectedTable?null:t.selectedTable.id))},directives:[l.xw,l.Wh,T.BN,w.a8,w.dn,la.D,ge.BU,a.sg,l.yH,i.lC,Th,ge.Nj,i.rH],styles:[""]}),e})();var vh=n(7969);function qh(e,t){if(1&e&&(o.TgZ(0,"mat-option",7),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.hij(" ",e.addressTp," ")}}let Sh=(()=>{class e{constructor(e,t){this.store=e,this.lndEffects=t,this.addressTypes=f._t,this.selectedAddressType=f._t[0],this.newAddress=""}onGenerateAddress(){this.store.dispatch(new x.ER(this.selectedAddressType)),this.lndEffects.setNewAddress.pipe((0,pt.q)(1)).subscribe(e=>{this.newAddress=e,this.store.dispatch(new ee.wu({width:"58%",data:{address:this.newAddress,addressType:this.selectedAddressType.addressTp,component:vh.n}}))})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh),o.Y36(Ft.l))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-form-field",2),o.TgZ(3,"mat-select",3),o.NdJ("ngModelChange",function(e){return t.selectedAddressType=e}),o.YNc(4,qh,2,2,"mat-option",4),o.qZA(),o.qZA(),o.TgZ(5,"div",5),o.TgZ(6,"button",6),o.NdJ("click",function(){return t.onGenerateAddress()}),o._uU(7,"Generate Address"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Q6J("ngModel",t.selectedAddressType),o.xp6(1),o.Q6J("ngForOf",t.addressTypes))},directives:[l.xw,l.Wh,D.KE,l.yH,we.gD,Ae.JJ,Ae.On,a.sg,q.lW,ve.ey],styles:[""]}),e})();var Fh=n(1339);const Lh=["form"],kh=["formSweepAll"],Nh=["stepper"];function Uh(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Bitcoin address is required."),o.qZA())}function Ih(e,t){if(1&e&&(o.TgZ(0,"mat-error"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.amountError)}}function Oh(e,t){if(1&e&&(o.TgZ(0,"mat-option",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e),o.xp6(1),o.Oqu(e)}}function Jh(e,t){if(1&e&&(o.TgZ(0,"mat-option",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.id),o.xp6(1),o.hij(" ",e.name," ")}}function Dh(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Number of blocks is required."),o.qZA())}function Rh(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",23),o.TgZ(1,"input",32,33),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).transactionBlocks=t}),o.qZA(),o.YNc(3,Dh,2,0,"mat-error",14),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngModel",e.transactionBlocks)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.transactionBlocks)}}function Mh(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Fees is required."),o.qZA())}function Eh(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-form-field",23),o.TgZ(1,"input",34,35),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw(2).transactionFees=t}),o.qZA(),o.YNc(3,Mh,2,0,"mat-error",14),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("ngModel",e.transactionFees)("step",1)("min",0),o.xp6(2),o.Q6J("ngIf",!e.transactionFees)}}function Qh(e,t){if(1&e&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&e){const e=o.oxw(3);o.xp6(1),o.Oqu(e.sendFundError)}}function Yh(e,t){if(1&e&&(o.TgZ(0,"div",36),o._UZ(1,"fa-icon",37),o.YNc(2,Qh,2,1,"span",14),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==e.sendFundError)}}function Ph(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"form",9,10),o.NdJ("submit",function(){return o.CHM(e),o.oxw().onSendFunds()})("reset",function(){return o.CHM(e),o.oxw().resetData()}),o.TgZ(2,"mat-form-field",11),o.TgZ(3,"input",12,13),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().transactionAddress=t}),o.qZA(),o.YNc(5,Uh,2,0,"mat-error",14),o.qZA(),o.TgZ(6,"mat-form-field",15),o.TgZ(7,"input",16,17),o.NdJ("ngModelChange",function(t){return o.CHM(e),o.oxw().transactionAmount=t}),o.qZA(),o.TgZ(9,"span",18),o._uU(10),o.qZA(),o.YNc(11,Ih,2,1,"mat-error",14),o.qZA(),o.TgZ(12,"mat-form-field",19),o.TgZ(13,"mat-select",20),o.NdJ("selectionChange",function(t){return o.CHM(e),o.oxw().onAmountUnitChange(t)}),o.YNc(14,Oh,2,2,"mat-option",21),o.qZA(),o.qZA(),o.TgZ(15,"div",22),o.TgZ(16,"mat-form-field",23),o.TgZ(17,"mat-select",24),o.NdJ("valueChange",function(t){return o.CHM(e),o.oxw().selTransType=t}),o.YNc(18,Jh,2,2,"mat-option",21),o.qZA(),o.qZA(),o.YNc(19,Rh,4,4,"mat-form-field",25),o.YNc(20,Eh,4,4,"mat-form-field",25),o.qZA(),o._UZ(21,"div",26),o.YNc(22,Yh,3,2,"div",27),o.TgZ(23,"div",28),o.TgZ(24,"button",29),o._uU(25,"Clear Fields"),o.qZA(),o.TgZ(26,"button",30),o._uU(27,"Send Funds"),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(3),o.Q6J("ngModel",e.transactionAddress),o.xp6(2),o.Q6J("ngIf",!e.transactionAddress),o.xp6(2),o.Q6J("ngModel",e.transactionAmount)("step",100)("min",0),o.xp6(3),o.hij(" ",e.selAmountUnit," "),o.xp6(1),o.Q6J("ngIf",!e.transactionAmount),o.xp6(2),o.Q6J("value",e.selAmountUnit),o.xp6(1),o.Q6J("ngForOf",e.amountUnits),o.xp6(3),o.Q6J("value",e.selTransType),o.xp6(1),o.Q6J("ngForOf",e.transTypes),o.xp6(1),o.Q6J("ngIf","1"===e.selTransType),o.xp6(1),o.Q6J("ngIf","2"===e.selTransType),o.xp6(2),o.Q6J("ngIf",""!==e.sendFundError)}}function Bh(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw(3);o.Oqu(e.passwordFormLabel)}}function Gh(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Password is required."),o.qZA())}function Hh(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"mat-step",42),o.TgZ(1,"form",61),o.YNc(2,Bh,1,1,"ng-template",55),o.TgZ(3,"div",0),o.TgZ(4,"mat-form-field",1),o._UZ(5,"input",62),o.YNc(6,Gh,2,0,"mat-error",14),o.qZA(),o.qZA(),o.TgZ(7,"div",63),o.TgZ(8,"button",64),o.NdJ("click",function(){return o.CHM(e),o.oxw(2).onAuthenticate()}),o._uU(9,"Confirm"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.Q6J("stepControl",e.passwordFormGroup)("editable",e.flgEditable),o.xp6(1),o.Q6J("formGroup",e.passwordFormGroup),o.xp6(5),o.Q6J("ngIf",null==e.passwordFormGroup.controls.password.errors?null:e.passwordFormGroup.controls.password.errors.required)}}function zh(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw(2);o.Oqu(e.sendFundFormLabel)}}function Vh(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Bitcoin address is required."),o.qZA())}function Wh(e,t){if(1&e&&(o.TgZ(0,"mat-option",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit;o.Q6J("value",e.id),o.xp6(1),o.hij(" ",e.name," ")}}function Xh(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Number of blocks is required."),o.qZA())}function $h(e,t){if(1&e&&(o.TgZ(0,"mat-form-field",65),o._UZ(1,"input",66),o.YNc(2,Xh,2,0,"mat-error",14),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("step",1)("min",0),o.xp6(1),o.Q6J("ngIf",null==e.sendFundFormGroup.controls.transactionBlocks.errors?null:e.sendFundFormGroup.controls.transactionBlocks.errors.required)}}function jh(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Fees is required."),o.qZA())}function Kh(e,t){if(1&e&&(o.TgZ(0,"mat-form-field",65),o._UZ(1,"input",67),o.YNc(2,jh,2,0,"mat-error",14),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("step",1)("min",0),o.xp6(1),o.Q6J("ngIf",null==e.sendFundFormGroup.controls.transactionFees.errors?null:e.sendFundFormGroup.controls.transactionFees.errors.required)}}function em(e,t){if(1&e&&o._uU(0),2&e){const e=o.oxw(2);o.Oqu(e.confirmFormLabel)}}function tm(e,t){if(1&e&&(o.TgZ(0,"span"),o._uU(1),o.qZA()),2&e){const e=o.oxw(3);o.xp6(1),o.Oqu(e.sendFundError)}}function nm(e,t){if(1&e&&(o.TgZ(0,"div",36),o._UZ(1,"fa-icon",37),o.YNc(2,tm,2,1,"span",14),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("icon",e.faExclamationTriangle),o.xp6(1),o.Q6J("ngIf",""!==e.sendFundError)}}function am(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",38),o.TgZ(1,"mat-vertical-stepper",39,40),o.NdJ("selectionChange",function(t){return o.CHM(e),o.oxw().stepSelectionChanged(t)}),o.YNc(3,Hh,10,4,"mat-step",41),o.TgZ(4,"mat-step",42),o.TgZ(5,"form",43),o.YNc(6,zh,1,1,"ng-template",44),o.TgZ(7,"div",45),o.TgZ(8,"mat-form-field",46),o._UZ(9,"input",47),o.YNc(10,Vh,2,0,"mat-error",14),o.qZA(),o.TgZ(11,"mat-form-field",48),o.TgZ(12,"mat-select",49),o.YNc(13,Wh,2,2,"mat-option",21),o.qZA(),o.qZA(),o.YNc(14,$h,3,3,"mat-form-field",50),o.YNc(15,Kh,3,3,"mat-form-field",50),o.qZA(),o.TgZ(16,"div",51),o.TgZ(17,"button",52),o._uU(18,"Next"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"mat-step",53),o.TgZ(20,"form",54),o.YNc(21,em,1,1,"ng-template",55),o.TgZ(22,"div",38),o.TgZ(23,"div",56),o._UZ(24,"fa-icon",57),o.TgZ(25,"span"),o._uU(26,"You are about to sweep all funds from RTL. Are you sure?"),o.qZA(),o.qZA(),o.YNc(27,nm,3,2,"div",27),o.TgZ(28,"div",51),o.TgZ(29,"button",58),o.NdJ("click",function(){return o.CHM(e),o.oxw().onSendFunds()}),o._uU(30,"Sweep All Funds"),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.TgZ(31,"div",59),o.TgZ(32,"button",60),o._uU(33),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(1),o.Q6J("linear",!0),o.xp6(2),o.Q6J("ngIf",!e.appConfig.sso.rtlSSO),o.xp6(1),o.Q6J("stepControl",e.sendFundFormGroup)("editable",e.flgEditable),o.xp6(1),o.Q6J("formGroup",e.sendFundFormGroup),o.xp6(5),o.Q6J("ngIf",null==e.sendFundFormGroup.controls.transactionAddress.errors?null:e.sendFundFormGroup.controls.transactionAddress.errors.required),o.xp6(3),o.Q6J("ngForOf",e.transTypes),o.xp6(1),o.Q6J("ngIf","1"===e.sendFundFormGroup.controls.selTransType.value),o.xp6(1),o.Q6J("ngIf","2"===e.sendFundFormGroup.controls.selTransType.value),o.xp6(4),o.Q6J("stepControl",e.confirmFormGroup),o.xp6(1),o.Q6J("formGroup",e.confirmFormGroup),o.xp6(4),o.Q6J("icon",e.faExclamationTriangle),o.xp6(3),o.Q6J("ngIf",""!==e.sendFundError),o.xp6(5),o.Q6J("mat-dialog-close",!1),o.xp6(1),o.Oqu(e.flgValidated?"Close":"Cancel")}}let im=(()=>{class e{constructor(e,t,n,a,i,s,o,l,r,c){this.dialogRef=e,this.data=t,this.logger=n,this.store=a,this.rtlEffects=i,this.commonService=s,this.decimalPipe=o,this.snackBar=l,this.actions=r,this.formBuilder=c,this.faExclamationTriangle=g.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=f.uA,this.selAmountUnit=f.uA[0],this.currConvertorRate={},this.unitConversionValue=0,this.currencyUnitFormats=f.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]}ngOnInit(){this.sweepAll=this.data.sweepAll,this.passwordFormGroup=this.formBuilder.group({hiddenPassword:["",[Ae.kI.required]],password:["",[Ae.kI.required]]}),this.sendFundFormGroup=this.formBuilder.group({transactionAddress:["",Ae.kI.required],transactionBlocks:[null],transactionFees:[null],selTransType:["1",Ae.kI.required]}),this.confirmFormGroup=this.formBuilder.group({}),this.sendFundFormGroup.controls.selTransType.valueChanges.pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{"1"===e?(this.sendFundFormGroup.controls.transactionBlocks.setValidators([Ae.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([Ae.kI.required]),this.sendFundFormGroup.controls.transactionFees.setValue(null))}),this.store.select("root").pipe((0,d.R)(this.unSubs[1])).subscribe(e=>{this.fiatConversion=e.selNode.settings.fiatConversion,this.amountUnits=e.selNode.settings.currencyUnits,this.appConfig=e.appConfig,this.nodeData=e.nodeData,this.logger.info(e)}),this.actions.pipe((0,d.R)(this.unSubs[2]),(0,h.h)(e=>e.type===x.JE||e.type===x.__)).subscribe(e=>{e.type===x.__&&(this.store.dispatch(new ee.Lw(this.sweepAll?"All Funds Sent Successfully!":"Fund Sent Successfully!")),this.dialogRef.close()),e.type===x.JE&&e.payload.status===f.Bn.ERROR&&"SetChannelTransaction"===e.payload.action&&(this.sendFundError=e.payload.message)})}onAuthenticate(){if(!this.passwordFormGroup.controls.password.value)return!0;this.flgValidated=!1,this.store.dispatch(new ee.ZF(Fh(this.passwordFormGroup.controls.password.value))),this.rtlEffects.isAuthorizedRes.pipe((0,pt.q)(1)).subscribe(e=>{"ERROR"!==e?(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 e={amount:this.transactionAmount?this.transactionAmount:0,sendAll:this.sweepAll};this.sweepAll?(e.address=this.sendFundFormGroup.controls.transactionAddress.value,"1"===this.sendFundFormGroup.controls.selTransType.value&&(e.blocks=this.sendFundFormGroup.controls.transactionBlocks.value),"2"===this.sendFundFormGroup.controls.selTransType.value&&(e.fees=this.sendFundFormGroup.controls.transactionFees.value)):(e.address=this.transactionAddress,"1"===this.selTransType&&(e.blocks=this.transactionBlocks),"2"===this.selTransType&&(e.fees=this.transactionFees)),this.transactionAmount&&this.selAmountUnit!==f.NT.SATS?this.commonService.convertCurrency(this.transactionAmount,this.selAmountUnit===this.amountUnits[2]?f.NT.OTHER:this.selAmountUnit,f.NT.SATS,this.amountUnits[2],this.fiatConversion).pipe((0,d.R)(this.unSubs[3])).subscribe({next:t=>{this.selAmountUnit=f.NT.SATS,e.amount=+this.decimalPipe.transform(t[this.amountUnits[0]],this.currencyUnitFormats[this.amountUnits[0]]).replace(/,/g,""),this.store.dispatch(new x.uj(e))},error:e=>{this.transactionAmount=null,this.selAmountUnit=f.NT.SATS,this.amountError="Conversion Error: "+e}}):this.store.dispatch(new x.uj(e))}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(e){switch(this.sendFundError="",e.selectedIndex){case 0: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);break;default:this.passwordFormLabel="Authenticate with your RTL password",this.sendFundFormLabel="Sweep funds"}e.selectedIndex<e.previouslySelectedIndex&&0===e.selectedIndex&&this.passwordFormGroup.controls.hiddenPassword.setValue("")}onAmountUnitChange(e){const t=this,n=this.sweepAll?f.NT.SATS:this.selAmountUnit===this.amountUnits[2]?f.NT.OTHER:this.selAmountUnit;let a=e.value===this.amountUnits[2]?f.NT.OTHER:e.value;this.transactionAmount&&this.selAmountUnit!==e.value&&this.commonService.convertCurrency(this.transactionAmount?this.transactionAmount:0,n,a,this.amountUnits[2],this.fiatConversion).pipe((0,d.R)(this.unSubs[3])).subscribe({next:n=>{this.selAmountUnit=e.value,t.transactionAmount=+t.decimalPipe.transform(n[a],t.currencyUnitFormats[a]).replace(/,/g,"")},error:e=>{t.transactionAmount=null,this.amountError="Conversion Error: "+e,this.selAmountUnit=n,a=n}})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(ye.so),o.Y36(ye.WI),o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(St.V),o.Y36(C.v),o.Y36(a.JJ),o.Y36(Ai.ux),o.Y36(A.eX),o.Y36(Ae.qu))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-on-chain-send-modal"]],viewQuery:function(e,t){if(1&e&&(o.Gf(Lh,7),o.Gf(kh,5),o.Gf(Nh,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.form=e.first),o.iGM(e=o.CRH())&&(t.formSweepAll=e.first),o.iGM(e=o.CRH())&&(t.stepper=e.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-stroked-button","","color","primary","tabindex","7","type","reset",1,"mr-1"],["mat-flat-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-stroked-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-stroked-button","","color","primary","tabindex","9","type","button",3,"click"],["fxLayout","row","fxFlex","100","fxLayoutAlign","end center"],["mat-stroked-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-stroked-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(e,t){if(1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"mat-card-header",2),o.TgZ(3,"div",3),o.TgZ(4,"span",4),o._uU(5),o.qZA(),o.qZA(),o.TgZ(6,"button",5),o._uU(7,"X"),o.qZA(),o.qZA(),o.TgZ(8,"mat-card-content",6),o.YNc(9,Ph,28,14,"form",7),o.qZA(),o.qZA(),o.qZA(),o.YNc(10,am,34,15,"ng-template",null,8,o.W1O)),2&e){const e=o.MAs(11);o.xp6(5),o.Oqu(t.sweepAll?"Sweep All Funds":"Send Funds"),o.xp6(1),o.Q6J("mat-dialog-close",!1),o.xp6(3),o.Q6J("ngIf",!t.sweepAll)("ngIfElse",e)}},directives:[l.xw,l.yH,w.dk,l.Wh,q.lW,ye.ZT,w.dn,a.O5,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Te.h,Ae.Q7,Ae.JJ,Ae.On,Ae.wV,Ae.qQ,be.q,D.R9,we.gD,a.sg,D.TO,ve.ey,T.BN,La.Vq,La.C0,Ae.sg,La.VY,Ae.u,La.Ic],styles:[""]}),e})(),sm=(()=>{class e{constructor(e,t){this.store=e,this.activatedRoute=t,this.sweepAll=!1,this.unSubs=[new p.x,new p.x]}ngOnInit(){this.activatedRoute.data.pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.sweepAll=e.sweepAll})}openSendFundsModal(){this.store.dispatch(new ee.wu({data:{sweepAll:this.sweepAll,component:im}}))}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(y.yh),o.Y36(i.gz))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"button",2),o.NdJ("click",function(){return t.openSendFundsModal()}),o._uU(3),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(3),o.Oqu(t.sweepAll?"Sweep All":"Send Funds"))},directives:[l.xw,l.yH,l.Wh,q.lW],styles:[""]}),e})();function om(e,t){1&e&&o._UZ(0,"mat-progress-bar",26)}function lm(e,t){if(1&e&&o._UZ(0,"rtl-node-info",27),2&e){const e=o.oxw(3);o.Q6J("information",e.information)("showColorFieldSeparately",!0)}}function rm(e,t){if(1&e&&o._UZ(0,"rtl-channel-status-info",28),2&e){const e=o.oxw(3);o.Q6J("channelsStatus",e.channelsStatus)("errorMessage",e.errorMessages[3]+" "+e.errorMessages[4])}}function cm(e,t){if(1&e&&o._UZ(0,"rtl-fee-info",29),2&e){const e=o.oxw(3);o.Q6J("fees",e.fees)("errorMessage",e.errorMessages[2])}}const um=function(e){return{"dashboard-card-content":!0,"error-border":e}};function pm(e,t){if(1&e&&(o.TgZ(0,"mat-grid-tile",13),o.TgZ(1,"div",14),o.TgZ(2,"div",15),o.TgZ(3,"div",16),o._UZ(4,"fa-icon",17),o.TgZ(5,"span"),o._uU(6),o.qZA(),o.qZA(),o.qZA(),o.TgZ(7,"div",18),o.TgZ(8,"mat-card",19),o.TgZ(9,"mat-card-content",20),o.YNc(10,om,1,0,"mat-progress-bar",21),o.TgZ(11,"div",22),o.YNc(12,lm,1,2,"rtl-node-info",23),o.YNc(13,rm,1,2,"rtl-channel-status-info",24),o.YNc(14,cm,1,2,"rtl-fee-info",25),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw(2);o.Q6J("colspan",e.cols)("rowspan",e.rows),o.xp6(4),o.Q6J("icon",e.icon),o.xp6(2),o.Oqu(e.title),o.xp6(3),o.Q6J("ngClass",o.VKq(10,um,"node"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.ERROR||"status"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.ERROR||n.apisCallStatus.FetchPendingChannels.status===n.apiCallStatusEnum.ERROR)||"fee"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.ERROR)),o.xp6(1),o.Q6J("ngIf","node"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchInfo.status)===n.apiCallStatusEnum.INITIATED||"status"===e.id&&((null==n.apisCallStatus?null:n.apisCallStatus.FetchAllChannels.status)===n.apiCallStatusEnum.INITIATED||n.apisCallStatus.FetchPendingChannels.status===n.apiCallStatusEnum.INITIATED)||"fee"===e.id&&(null==n.apisCallStatus?null:n.apisCallStatus.FetchFees.status)===n.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngSwitch",e.id),o.xp6(1),o.Q6J("ngSwitchCase","node"),o.xp6(1),o.Q6J("ngSwitchCase","status"),o.xp6(1),o.Q6J("ngSwitchCase","fee")}}function dm(e,t){if(1&e&&(o.TgZ(0,"mat-grid-list",11),o.YNc(1,pm,15,12,"mat-grid-tile",12),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngForOf",e.nodeCards)}}function hm(e,t){1&e&&o._UZ(0,"mat-progress-bar",26)}function mm(e,t){1&e&&o.GkF(0)}function gm(e,t){if(1&e&&(o.TgZ(0,"div",33),o.YNc(1,mm,1,0,"ng-container",34),o.qZA()),2&e){const e=o.oxw(2),t=o.MAs(9),n=o.MAs(11);o.xp6(1),o.Q6J("ngTemplateOutlet",(null==e.apisCallStatus?null:e.apisCallStatus.FetchNetwork.status)===e.apiCallStatusEnum.ERROR?t:n)}}function fm(e,t){1&e&&o.GkF(0)}function xm(e,t){if(1&e&&(o.TgZ(0,"div",33),o.YNc(1,fm,1,0,"ng-container",34),o.qZA()),2&e){const e=o.oxw(2),t=o.MAs(9),n=o.MAs(13);o.xp6(1),o.Q6J("ngTemplateOutlet",(null==e.apisCallStatus?null:e.apisCallStatus.FetchNetwork.status)===e.apiCallStatusEnum.ERROR?t:n)}}function Zm(e,t){1&e&&o.GkF(0)}function ym(e,t){if(1&e&&(o.TgZ(0,"div",33),o.YNc(1,Zm,1,0,"ng-container",34),o.qZA()),2&e){const e=o.oxw(2),t=o.MAs(9),n=o.MAs(15);o.xp6(1),o.Q6J("ngTemplateOutlet",(null==e.apisCallStatus?null:e.apisCallStatus.FetchNetwork.status)===e.apiCallStatusEnum.ERROR?t:n)}}function Am(e,t){if(1&e&&(o.TgZ(0,"mat-grid-tile",30),o.TgZ(1,"mat-card",31),o.TgZ(2,"mat-card-content",20),o.YNc(3,hm,1,0,"mat-progress-bar",21),o.TgZ(4,"div",22),o.YNc(5,gm,2,1,"div",32),o.YNc(6,xm,2,1,"div",32),o.YNc(7,ym,2,1,"div",32),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("colspan",e.cols)("rowspan",e.rows),o.xp6(2),o.Q6J("ngClass",o.VKq(8,um,(null==n.apisCallStatus?null:n.apisCallStatus.FetchNetwork.status)===n.apiCallStatusEnum.ERROR)),o.xp6(1),o.Q6J("ngIf",(null==n.apisCallStatus?null:n.apisCallStatus.FetchNetwork.status)===n.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngSwitch",e.id),o.xp6(1),o.Q6J("ngSwitchCase","general"),o.xp6(1),o.Q6J("ngSwitchCase","channels"),o.xp6(1),o.Q6J("ngSwitchCase","degrees")}}function Cm(e,t){if(1&e&&(o.TgZ(0,"div",35),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.Oqu(e.errorMessages[1])}}function Tm(e,t){if(1&e&&(o.TgZ(0,"div",36),o.TgZ(1,"div"),o.TgZ(2,"h4",37),o._uU(3,"Network Capacity"),o.qZA(),o.TgZ(4,"div",38),o._uU(5),o.ALo(6,"number"),o.qZA(),o.qZA(),o.TgZ(7,"div"),o.TgZ(8,"h4",37),o._uU(9,"Number of Nodes"),o.qZA(),o.TgZ(10,"div",38),o._uU(11),o.ALo(12,"number"),o.qZA(),o.qZA(),o.TgZ(13,"div"),o.TgZ(14,"h4",37),o._uU(15,"Number of Channels"),o.qZA(),o.TgZ(16,"span",38),o._uU(17),o.ALo(18,"number"),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(5),o.hij("",o.lcZ(6,3,e.networkInfo.total_network_capacity)," Sats"),o.xp6(6),o.Oqu(o.lcZ(12,5,e.networkInfo.num_nodes)),o.xp6(6),o.Oqu(o.lcZ(18,7,e.networkInfo.num_channels))}}function bm(e,t){if(1&e&&(o.TgZ(0,"div",36),o.TgZ(1,"div"),o.TgZ(2,"h4",37),o._uU(3,"Max Channel Size"),o.qZA(),o.TgZ(4,"div",38),o._uU(5),o.ALo(6,"number"),o.qZA(),o.qZA(),o.TgZ(7,"div"),o.TgZ(8,"h4",37),o._uU(9,"Avg Channel Size"),o.qZA(),o.TgZ(10,"div",38),o._uU(11),o.ALo(12,"number"),o.qZA(),o.qZA(),o.TgZ(13,"div"),o.TgZ(14,"h4",37),o._uU(15,"Min Channel Size"),o.qZA(),o.TgZ(16,"span",38),o._uU(17),o.ALo(18,"number"),o.qZA(),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(5),o.Oqu(o.lcZ(6,3,e.networkInfo.max_channel_size)),o.xp6(6),o.Oqu(o.lcZ(12,5,e.networkInfo.avg_channel_size)),o.xp6(6),o.Oqu(o.lcZ(18,7,e.networkInfo.min_channel_size))}}function wm(e,t){if(1&e&&(o.TgZ(0,"div",36),o.TgZ(1,"div"),o.TgZ(2,"h4",37),o._uU(3,"Max Out Degree"),o.qZA(),o.TgZ(4,"div",38),o._uU(5),o.ALo(6,"number"),o.qZA(),o.qZA(),o.TgZ(7,"div"),o.TgZ(8,"h4",37),o._uU(9,"Avg Out Degree"),o.qZA(),o.TgZ(10,"div",38),o._uU(11),o.ALo(12,"number"),o.qZA(),o.qZA(),o.TgZ(13,"div",39),o._UZ(14,"h4",37),o._UZ(15,"span",38),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(5),o.Oqu(o.lcZ(6,2,e.networkInfo.max_out_degree)),o.xp6(6),o.Oqu(o.xi3(12,4,e.networkInfo.avg_out_degree,"1.0-2"))}}const _m=function(e){return{"mt-1":e}};let vm=(()=>{class e{constructor(e,t,n){this.logger=e,this.commonService=t,this.store=n,this.faProjectDiagram=g.o4t,this.faBolt=g.BDt,this.faServer=g.xf3,this.faNetworkWired=g.kXW,this.selNode={},this.information={},this.channelsStatus={},this.networkInfo={},this.networkCards=[],this.nodeCards=[],this.screenSize="",this.screenSizeEnum=f.cu,this.userPersonaEnum=f.ol,this.errorMessages=["","","","",""],this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x],this.screenSize=this.commonService.getScreenSize(),this.screenSize===f.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("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessages=["","","","",""],this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchInfo.status===f.Bn.ERROR&&(this.errorMessages[0]="object"==typeof this.apisCallStatus.FetchInfo.message?JSON.stringify(this.apisCallStatus.FetchInfo.message):this.apisCallStatus.FetchInfo.message),e.apisCallStatus.FetchNetwork.status===f.Bn.ERROR&&(this.errorMessages[1]="object"==typeof this.apisCallStatus.FetchNetwork.message?JSON.stringify(this.apisCallStatus.FetchNetwork.message):this.apisCallStatus.FetchNetwork.message),e.apisCallStatus.FetchFees.status===f.Bn.ERROR&&(this.errorMessages[2]="object"==typeof this.apisCallStatus.FetchFees.message?JSON.stringify(this.apisCallStatus.FetchFees.message):this.apisCallStatus.FetchFees.message),e.apisCallStatus.FetchAllChannels.status===f.Bn.ERROR&&(this.errorMessages[3]="object"==typeof this.apisCallStatus.FetchAllChannels.message?JSON.stringify(this.apisCallStatus.FetchAllChannels.message):this.apisCallStatus.FetchAllChannels.message),e.apisCallStatus.FetchPendingChannels.status===f.Bn.ERROR&&(this.errorMessages[4]="object"==typeof this.apisCallStatus.FetchPendingChannels.message?JSON.stringify(this.apisCallStatus.FetchPendingChannels.message):this.apisCallStatus.FetchPendingChannels.message),this.selNode=e.nodeSettings,this.information=e.information,this.networkInfo=e.networkInfo,this.fees=e.fees,this.channelsStatus={active:{channels:e.numberOfActiveChannels,capacity:e.totalCapacityActive},inactive:{channels:e.numberOfInactiveChannels,capacity:e.totalCapacityInactive},pending:{channels:e.numberOfPendingChannels.open.num_channels,capacity:e.numberOfPendingChannels.open.limbo_balance},closing:{channels:e.numberOfPendingChannels.closing.num_channels+e.numberOfPendingChannels.force_closing.num_channels+e.numberOfPendingChannels.waiting_close.num_channels,capacity:e.numberOfPendingChannels.total_limbo_balance}},this.logger.info(e)})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(C.v),o.Y36(y.yh))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,dm,2,1,"mat-grid-list",1),o.TgZ(2,"div",2),o._UZ(3,"fa-icon",3),o.TgZ(4,"span",4),o._uU(5,"Network"),o.qZA(),o.qZA(),o.TgZ(6,"mat-grid-list",5),o.YNc(7,Am,8,10,"mat-grid-tile",6),o.qZA(),o.qZA(),o.YNc(8,Cm,3,1,"ng-template",null,7,o.W1O),o.YNc(10,Tm,19,9,"ng-template",null,8,o.W1O),o.YNc(12,bm,19,9,"ng-template",null,9,o.W1O),o.YNc(14,wm,16,7,"ng-template",null,10,o.W1O)),2&e&&(o.xp6(1),o.Q6J("ngIf",t.selNode.userPersona!==t.userPersonaEnum.OPERATOR),o.xp6(1),o.Q6J("ngClass",o.VKq(4,_m,t.screenSize!==t.screenSizeEnum.XS)),o.xp6(1),o.Q6J("icon",t.faProjectDiagram),o.xp6(4),o.Q6J("ngForOf",t.networkCards))},directives:[l.xw,l.Wh,a.O5,a.mk,v.oO,T.BN,b.Il,a.sg,b.DX,l.yH,w.a8,w.dn,a.RF,a.n9,r.pW,U,j,W,a.tP],pipes:[a.JJ],styles:[""]}),e})();function qm(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",8),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().activeLink=t.link}),o._uU(1),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.s9C("routerLink",e.link),o.Q6J("active",n.activeLink===e.link),o.xp6(1),o.Oqu(e.name)}}let Sm=(()=>{class e{constructor(e){this.router=e,this.faDownload=g.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 e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{const t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"Channels Backup"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o.TgZ(7,"nav",5),o.YNc(8,qm,2,3,"div",6),o.qZA(),o.TgZ(9,"div",7),o._UZ(10,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("icon",t.faDownload),o.xp6(7),o.Q6J("ngForOf",t.links))},directives:[l.xw,l.Wh,T.BN,w.a8,w.dn,ge.BU,a.sg,l.yH,i.lC,ge.Nj,i.rH],styles:[""]}),e})();function Fm(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",23),o.TgZ(1,"h4",24),o._uU(2),o.qZA(),o.TgZ(3,"div",25),o.TgZ(4,"button",26),o.NdJ("click",function(){return o.CHM(e),o.oxw().onRestoreChannels({})}),o._uU(5,"Restore All"),o.qZA(),o.qZA(),o.qZA()}if(2&e){const e=o.oxw();o.xp6(2),o.hij("Restore folder location: ",e.selNode.channelBackupPath,"/restore")}}function Lm(e,t){if(1&e&&(o.TgZ(0,"div",27),o.TgZ(1,"h4",24),o._uU(2),o.qZA(),o.TgZ(3,"h4",28),o._uU(4,"All channel backup file not found! To perform channel restoration, channel backup file/s must be placed at the above location."),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.hij("Restore folder location: ",e.selNode.channelBackupPath,"/restore")}}function km(e,t){if(1&e&&(o.TgZ(0,"div",27),o.TgZ(1,"h4",24),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw();o.xp6(2),o.hij("Restore folder location: ",e.selNode.channelBackupPath,"/restore")}}function Nm(e,t){1&e&&o._UZ(0,"mat-progress-bar",29)}function Um(e,t){1&e&&(o.TgZ(0,"th",30),o._uU(1," Channel Point "),o.qZA())}const Im=function(e){return{"max-width":e}};function Om(e,t){if(1&e&&(o.TgZ(0,"td",31),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,Im,n.screenSize===n.screenSizeEnum.XS?"10rem":"45rem")),o.xp6(1),o.Oqu(null==e?null:e.channel_point)}}function Jm(e,t){1&e&&(o.TgZ(0,"th",32),o.TgZ(1,"span",33),o._uU(2,"Actions"),o.qZA(),o.qZA())}function Dm(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",34),o.TgZ(1,"span",33),o.TgZ(2,"button",35),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onRestoreChannels(t)}),o._uU(3,"Restore"),o.qZA(),o.qZA(),o.qZA()}}function Rm(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No singular channel backups available."),o.qZA())}function Mm(e,t){if(1&e&&(o.TgZ(0,"td",36),o.YNc(1,Rm,2,0,"p",37),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",!e.channels||!e.channels.data||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)}}const Em=function(e){return{"display-none":e}};function Qm(e,t){if(1&e&&o._UZ(0,"tr",38),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,Em,e.channels&&e.channels.data&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function Ym(e,t){1&e&&o._UZ(0,"tr",39)}function Pm(e,t){1&e&&o._UZ(0,"tr",40)}const Bm=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},Gm=function(){return["no_channel"]};let Hm=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.store=t,this.lndEffects=n,this.commonService=a,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.selNode={},this.displayedColumns=["channel_point","actions"],this.channelsData=[],this.allRestoreExists=!1,this.flgLoading=[!0],this.flgSticky=!1,this.screenSize="",this.screenSizeEnum=f.cu,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.dispatch(new x.gL),this.store.select("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.selNode=e.nodeSettings,this.logger.info(e)}),this.lndEffects.setRestoreChannelList.pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.allRestoreExists=e.all_restore_exists,this.channelsData=e.files,this.channelsData.length>0&&this.loadRestoreTable(this.channelsData),("error"!==this.flgLoading[0]||e&&e.files)&&(this.flgLoading[0]=!1),this.logger.info(e)})}ngAfterViewInit(){this.channelsData&&this.channelsData.length>0&&this.loadRestoreTable(this.channelsData)}onRestoreChannels(e){this.store.dispatch(new x.Cd({channelPoint:e.channel_point?e.channel_point:"ALL"}))}applyFilter(e){this.channels.filter=e.value.trim().toLowerCase()}loadRestoreTable(e){this.channels=new Ze.by([...e]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.channels.filterPredicate=(e,t)=>JSON.stringify(e).toLowerCase().includes(t),this.channels.paginator=this.paginator}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(Ft.l),o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-channel-restore-table"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("Channels")}])],decls:24,vars:16,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,"keyup"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.YNc(1,Fm,6,1,"div",1),o.YNc(2,Lm,5,1,"div",2),o.YNc(3,km,3,1,"div",2),o.TgZ(4,"div",3),o._UZ(5,"div",4),o.TgZ(6,"mat-form-field",5),o.TgZ(7,"input",6),o.NdJ("keyup",function(e){return t.applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(8,"div",7),o.YNc(9,Nm,1,0,"mat-progress-bar",8),o.TgZ(10,"table",9,10),o.ynx(12,11),o.YNc(13,Um,2,0,"th",12),o.YNc(14,Om,2,4,"td",13),o.BQk(),o.ynx(15,14),o.YNc(16,Jm,3,0,"th",15),o.YNc(17,Dm,4,0,"td",16),o.BQk(),o.ynx(18,17),o.YNc(19,Mm,2,1,"td",18),o.BQk(),o.YNc(20,Qm,1,3,"tr",19),o.YNc(21,Ym,1,0,"tr",20),o.YNc(22,Pm,1,0,"tr",21),o.qZA(),o.qZA(),o._UZ(23,"mat-paginator",22),o.qZA()),2&e&&(o.xp6(1),o.Q6J("ngIf",t.allRestoreExists),o.xp6(1),o.Q6J("ngIf",!t.allRestoreExists&&(!t.channels||(null==t.channels||null==t.channels.data?null:t.channels.data.length)<=0)),o.xp6(1),o.Q6J("ngIf",!t.allRestoreExists&&t.channels&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)&&(null==t.channels||null==t.channels.data?null:t.channels.data.length)>0),o.xp6(6),o.Q6J("ngIf",!0===t.flgLoading[0]),o.xp6(1),o.Q6J("dataSource",t.channels)("ngClass",o.VKq(13,Bm,"error"===t.flgLoading[0])),o.xp6(10),o.Q6J("matFooterRowDef",o.DdM(15,Gm)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,a.O5,l.Wh,l.yH,D.KE,Ce.Nt,E.$V,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,q.lW,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function zm(e,t){1&e&&o._UZ(0,"mat-progress-bar",31)}function Vm(e,t){1&e&&(o.TgZ(0,"th",32),o._uU(1," Channel Point "),o.qZA())}const Wm=function(e){return{"max-width":e}};function Xm(e,t){if(1&e&&(o.TgZ(0,"td",33),o._uU(1),o.qZA()),2&e){const e=t.$implicit,n=o.oxw();o.Q6J("ngStyle",o.VKq(2,Wm,n.screenSize===n.screenSizeEnum.XS?"10rem":"28rem")),o.xp6(1),o.Oqu(null==e?null:e.channel_point)}}function $m(e,t){1&e&&(o.TgZ(0,"th",34),o.TgZ(1,"span",35),o._uU(2,"Actions"),o.qZA(),o.qZA())}function jm(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"td",36),o.TgZ(1,"div",37),o.TgZ(2,"mat-select",38),o._UZ(3,"mat-select-trigger"),o.TgZ(4,"mat-option",39),o.NdJ("click",function(t){const n=o.CHM(e).$implicit;return o.oxw().onChannelClick(n,t)}),o._uU(5,"View Info"),o.qZA(),o.TgZ(6,"mat-option",39),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onBackupChannels(t)}),o._uU(7,"Backup"),o.qZA(),o.TgZ(8,"mat-option",39),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onDownloadBackup(t)}),o._uU(9,"Download Backup"),o.qZA(),o.TgZ(10,"mat-option",39),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().onVerifyChannels(t)}),o._uU(11,"Verify"),o.qZA(),o.qZA(),o.qZA(),o.qZA()}}function Km(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"No channel available."),o.qZA())}function eg(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Getting channels..."),o.qZA())}function tg(e,t){if(1&e&&(o.TgZ(0,"p"),o._uU(1),o.qZA()),2&e){const e=o.oxw(2);o.xp6(1),o.Oqu(e.errorMessage)}}function ng(e,t){if(1&e&&(o.TgZ(0,"td",40),o.YNc(1,Km,2,0,"p",41),o.YNc(2,eg,2,0,"p",41),o.YNc(3,tg,2,1,"p",41),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.COMPLETED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("ngIf",(!(null!=e.channels&&e.channels.data)||(null==e.channels||null==e.channels.data?null:e.channels.data.length)<1)&&(null==e.apisCallStatus?null:e.apisCallStatus.FetchAllChannels.status)===e.apiCallStatusEnum.ERROR)}}const ag=function(e){return{"display-none":e}};function ig(e,t){if(1&e&&o._UZ(0,"tr",42),2&e){const e=o.oxw();o.Q6J("ngClass",o.VKq(1,ag,(null==e.channels?null:e.channels.data)&&(null==e.channels||null==e.channels.data?null:e.channels.data.length)>0))}}function sg(e,t){1&e&&o._UZ(0,"tr",43)}function og(e,t){1&e&&o._UZ(0,"tr",44)}const lg=function(e){return{"overflow-auto error-border":e,"overflow-auto":!0}},rg=function(){return["no_channel"]};let cg=(()=>{class e{constructor(e,t,n,a){this.logger=e,this.store=t,this.actions=n,this.commonService=a,this.faInfoCircle=g.sqG,this.faExclamationTriangle=g.eHv,this.faArchive=g.N2j,this.pageSize=f.IV,this.pageSizeOptions=f.TJ,this.selNode={},this.displayedColumns=["channel_point","actions"],this.channelsData=[],this.flgSticky=!1,this.screenSize="",this.screenSizeEnum=f.cu,this.errorMessage="",this.apisCallStatus=null,this.apiCallStatusEnum=f.Bn,this.unSubs=[new p.x,new p.x,new p.x,new p.x],this.screenSize=this.commonService.getScreenSize()}ngOnInit(){this.store.select("lnd").pipe((0,d.R)(this.unSubs[0])).subscribe(e=>{this.errorMessage="",this.apisCallStatus=e.apisCallStatus,e.apisCallStatus.FetchAllChannels.status===f.Bn.ERROR&&(this.errorMessage="object"==typeof this.apisCallStatus.FetchAllChannels.message?JSON.stringify(this.apisCallStatus.FetchAllChannels.message):this.apisCallStatus.FetchAllChannels.message),this.selNode=e.nodeSettings,this.channelsData=e.allChannels,this.channelsData.length>0&&this.loadBackupTable(this.channelsData),this.logger.info(e)}),this.actions.pipe((0,d.R)(this.unSubs[1]),(0,h.h)(e=>e.type===x.P2||e.type===ee.BQ)).subscribe(e=>{e.type===x.P2&&(this.selectedChannel=null),e.type===ee.BQ&&(this.commonService.downloadFile(e.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(e){this.store.dispatch(new x.FN({uiMessage:f.m6.BACKUP_CHANNEL,channelPoint:e.channel_point?e.channel_point:"ALL",showMessage:""}))}onVerifyChannels(e){this.store.dispatch(new x.gf({channelPoint:e.channel_point?e.channel_point:"ALL"}))}onDownloadBackup(e){this.selectedChannel=e,this.store.dispatch(new ee.nw({channelPoint:e.channel_point?e.channel_point:"all"}))}onChannelClick(e,t){this.store.dispatch(new ee.wu({data:{channel:e,showCopy:!1,component:Si}}))}applyFilter(e){this.channels.filter=e.value.trim().toLowerCase()}loadBackupTable(e){this.channels=new Ze.by(e?[...e]:[]),this.channels.sort=this.sort,this.channels.sortingDataAccessor=(e,t)=>e[t]&&isNaN(e[t])?e[t].toLocaleLowerCase():e[t]?+e[t]:null,this.channels.paginator=this.paginator,this.channels.filterPredicate=(e,t)=>((e.active?"active":"inactive")+(e.channel_point?e.channel_point.toLowerCase():"")+(e.chan_id?e.chan_id.toLowerCase():"")+(e.remote_pubkey?e.remote_pubkey.toLowerCase():"")+(e.remote_alias?e.remote_alias.toLowerCase():"")+(e.capacity?e.capacity:"")+(e.local_balance?e.local_balance:"")+(e.remote_balance?e.remote_balance:"")+(e.total_satoshis_sent?e.total_satoshis_sent:"")+(e.total_satoshis_received?e.total_satoshis_received:"")+(e.commit_fee?e.commit_fee:"")+(e.private?"private":"public")).includes(t)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(Z.mQ),o.Y36(y.yh),o.Y36(A.eX),o.Y36(C.v))},e.\u0275cmp=o.Xpm({type:e,selectors:[["rtl-channel-backup-table"]],viewQuery:function(e,t){if(1&e&&(o.Gf(xe.YE,5),o.Gf(fe.NW,5)),2&e){let e;o.iGM(e=o.CRH())&&(t.sort=e.first),o.iGM(e=o.CRH())&&(t.paginator=e.first)}},features:[o._Bn([{provide:fe.ye,useValue:(0,f.pt)("Channels")}])],decls:42,vars:17,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,"keyup"],["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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"div",1),o.TgZ(2,"div",2),o._UZ(3,"fa-icon",3),o.TgZ(4,"span"),o._uU(5,"Save your backup files in a redundant location."),o.qZA(),o.qZA(),o.TgZ(6,"div",4),o._UZ(7,"fa-icon",3),o.TgZ(8,"span"),o.TgZ(9,"strong"),o._uU(10,"Backup Folder Location: "),o.qZA(),o._uU(11),o.qZA(),o.qZA(),o.TgZ(12,"div",5),o.TgZ(13,"button",6),o.NdJ("click",function(){return t.onVerifyChannels({})}),o._uU(14,"Verify All"),o.qZA(),o.TgZ(15,"button",7),o.NdJ("click",function(){return t.onBackupChannels({})}),o._uU(16,"Backup All"),o.qZA(),o.TgZ(17,"button",8),o.NdJ("click",function(){return t.onDownloadBackup({})}),o._uU(18,"Download Backup"),o.qZA(),o.qZA(),o.qZA(),o.TgZ(19,"div",9),o.TgZ(20,"div",10),o._UZ(21,"fa-icon",11),o.TgZ(22,"span",12),o._uU(23,"Backups"),o.qZA(),o.qZA(),o.TgZ(24,"mat-form-field",13),o.TgZ(25,"input",14),o.NdJ("keyup",function(e){return t.applyFilter(e.target)}),o.qZA(),o.qZA(),o.qZA(),o.TgZ(26,"div",15),o.YNc(27,zm,1,0,"mat-progress-bar",16),o.TgZ(28,"table",17,18),o.ynx(30,19),o.YNc(31,Vm,2,0,"th",20),o.YNc(32,Xm,2,4,"td",21),o.BQk(),o.ynx(33,22),o.YNc(34,$m,3,0,"th",23),o.YNc(35,jm,12,0,"td",24),o.BQk(),o.ynx(36,25),o.YNc(37,ng,4,3,"td",26),o.BQk(),o.YNc(38,ig,1,3,"tr",27),o.YNc(39,sg,1,0,"tr",28),o.YNc(40,og,1,0,"tr",29),o.qZA(),o.qZA(),o._UZ(41,"mat-paginator",30),o.qZA()),2&e&&(o.xp6(3),o.Q6J("icon",t.faExclamationTriangle),o.xp6(4),o.Q6J("icon",t.faInfoCircle),o.xp6(4),o.hij("",t.selNode.channelBackupPath,"."),o.xp6(10),o.Q6J("icon",t.faArchive),o.xp6(6),o.Q6J("ngIf",(null==t.apisCallStatus?null:t.apisCallStatus.FetchAllChannels.status)===t.apiCallStatusEnum.INITIATED),o.xp6(1),o.Q6J("dataSource",t.channels)("ngClass",o.VKq(14,lg,""!==t.errorMessage)),o.xp6(10),o.Q6J("matFooterRowDef",o.DdM(16,rg)),o.xp6(1),o.Q6J("matHeaderRowDef",t.displayedColumns)("matHeaderRowDefSticky",t.flgSticky),o.xp6(1),o.Q6J("matRowDefColumns",t.displayedColumns),o.xp6(1),o.Q6J("pageSize",t.pageSize)("pageSizeOptions",t.pageSizeOptions)("showFirstLastButtons",t.screenSize!==t.screenSizeEnum.XS))},directives:[l.xw,l.Wh,l.yH,T.BN,q.lW,D.KE,Ce.Nt,E.$V,a.O5,Ze.BZ,xe.YE,a.mk,v.oO,Ze.w1,Ze.fO,Ze.Dz,Ze.mD,Ze.Ke,Ze.as,Ze.nj,fe.NW,r.pW,Ze.ge,xe.nU,Ze.ev,a.PC,v.Zl,we.gD,we.$L,ve.ey,Ze.yh,Ze.Q2,Ze.XQ,Ze.Gk],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 70%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function ug(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",8),o.NdJ("click",function(){const t=o.CHM(e).$implicit;return o.oxw().activeLink=t.link}),o._uU(1),o.qZA()}if(2&e){const e=t.$implicit,n=o.oxw();o.s9C("routerLink",e.link),o.Q6J("active",n.activeLink===e.link),o.xp6(1),o.Oqu(e.name)}}let pg=(()=>{class e{constructor(e){this.router=e,this.faUserCheck=g.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 e=this.links.find(e=>this.router.url.includes(e.link));this.activeLink=e?e.link:this.links[0].link,this.router.events.pipe((0,d.R)(this.unSubs[0]),(0,h.h)(e=>e instanceof i.Av)).subscribe(e=>{const t=this.links.find(t=>e.urlAfterRedirects.includes(t.link));this.activeLink=t?t.link:this.links[0].link})}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(i.F0))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o._UZ(1,"fa-icon",1),o.TgZ(2,"span",2),o._uU(3,"Sign/Verify Message"),o.qZA(),o.qZA(),o.TgZ(4,"div",3),o.TgZ(5,"mat-card"),o.TgZ(6,"mat-card-content",4),o.TgZ(7,"nav",5),o.YNc(8,ug,2,3,"div",6),o.qZA(),o.TgZ(9,"div",7),o._UZ(10,"router-outlet"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(1),o.Q6J("icon",t.faUserCheck),o.xp6(7),o.Q6J("ngForOf",t.links))},directives:[l.xw,l.Wh,T.BN,w.a8,w.dn,ge.BU,a.sg,l.yH,i.lC,ge.Nj,i.rH],styles:[""]}),e})();function dg(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Message is required."),o.qZA())}let hg=(()=>{class e{constructor(e,t,n){this.dataService=e,this.snackBar=t,this.logger=n,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(e=>{this.signedMessage=this.message,this.signature=e.signature})}onMessageChange(){this.signedMessage!==this.message&&(this.signature="")}onCopyField(e){this.snackBar.open("Signature copied."),this.logger.info("Copied Text: "+e)}resetData(){this.message="",this.signature="",this.signedMessage=""}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(dt.D),o.Y36(Ai.ux),o.Y36(Z.mQ))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"form",1,2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"textarea",4),o.NdJ("ngModelChange",function(e){return t.message=e})("keyup",function(){return t.onMessageChange()}),o.qZA(),o.YNc(5,dg,2,0,"mat-error",5),o.qZA(),o.TgZ(6,"div",6),o.TgZ(7,"button",7),o.NdJ("click",function(){return t.resetData()}),o._uU(8,"Clear Field"),o.qZA(),o.TgZ(9,"button",8),o.NdJ("click",function(){return t.onSign()}),o._uU(10,"Sign"),o.qZA(),o.qZA(),o._UZ(11,"mat-divider",9),o.TgZ(12,"div",10),o.TgZ(13,"p"),o._uU(14,"Generated Signature"),o.qZA(),o.qZA(),o.TgZ(15,"div",11),o._uU(16),o.qZA(),o.TgZ(17,"div",12),o.TgZ(18,"button",13),o.NdJ("copied",function(e){return t.onCopyField(e)}),o._uU(19,"Copy Signature"),o.qZA(),o.qZA(),o.qZA(),o.qZA()),2&e&&(o.xp6(4),o.Q6J("ngModel",t.message),o.xp6(1),o.Q6J("ngIf",!t.message),o.xp6(6),o.Q6J("inset",!0),o.xp6(5),o.Oqu(t.signature),o.xp6(2),o.Q6J("payload",t.signature))},directives:[l.xw,l.yH,l.Wh,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Te.h,Ae.Q7,Ae.JJ,Ae.On,a.O5,q.lW,M.d,Ci.y,D.TO],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();function mg(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Message is required."),o.qZA())}function gg(e,t){1&e&&(o.TgZ(0,"mat-error"),o._uU(1,"Signature is required."),o.qZA())}function fg(e,t){1&e&&(o.TgZ(0,"p",13),o.TgZ(1,"mat-icon",14),o._uU(2,"close"),o.qZA(),o._uU(3,"Verification failed, please double check message and signature"),o.qZA())}function xg(e,t){1&e&&(o.TgZ(0,"p"),o._uU(1,"Pubkey Used"),o.qZA())}function Zg(e,t){if(1&e&&(o.TgZ(0,"div",20),o.TgZ(1,"p"),o._uU(2),o.qZA(),o.qZA()),2&e){const e=o.oxw(2);o.xp6(2),o.Oqu(null==e.verifyRes?null:e.verifyRes.pubkey)}}function yg(e,t){if(1&e){const e=o.EpF();o.TgZ(0,"div",21),o.TgZ(1,"button",22),o.NdJ("copied",function(t){return o.CHM(e),o.oxw(2).onCopyField(t)}),o._uU(2,"Copy Pubkey"),o.qZA(),o.qZA()}if(2&e){const e=o.oxw(2);o.xp6(1),o.Q6J("payload",null==e.verifyRes?null:e.verifyRes.pubkey)}}function Ag(e,t){if(1&e&&(o.TgZ(0,"div",15),o._UZ(1,"mat-divider",16),o.TgZ(2,"div",17),o.YNc(3,xg,2,0,"p",5),o.qZA(),o.YNc(4,Zg,3,1,"div",18),o.YNc(5,yg,3,1,"div",19),o.qZA()),2&e){const e=o.oxw();o.xp6(1),o.Q6J("inset",!0),o.xp6(2),o.Q6J("ngIf",e.verifyRes.valid),o.xp6(1),o.Q6J("ngIf",e.verifyRes.valid),o.xp6(1),o.Q6J("ngIf",e.verifyRes.valid)}}let Cg=(()=>{class e{constructor(e,t,n){this.dataService=e,this.snackBar=t,this.logger=n,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(e=>{this.verifyRes=e,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(e){this.snackBar.open("Pubkey copied."),this.logger.info("Copied Text: "+e)}ngOnDestroy(){this.unSubs.forEach(e=>{e.next(null),e.complete()})}}return e.\u0275fac=function(t){return new(t||e)(o.Y36(dt.D),o.Y36(Ai.ux),o.Y36(Z.mQ))},e.\u0275cmp=o.Xpm({type:e,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(e,t){1&e&&(o.TgZ(0,"div",0),o.TgZ(1,"form",1,2),o.TgZ(3,"mat-form-field",3),o.TgZ(4,"textarea",4),o.NdJ("ngModelChange",function(e){return t.message=e})("keyup",function(){return t.onChange()}),o.qZA(),o.YNc(5,mg,2,0,"mat-error",5),o.qZA(),o.TgZ(6,"mat-form-field",3),o.TgZ(7,"input",6,7),o.NdJ("ngModelChange",function(e){return t.signature=e})("keyup",function(){return t.onChange()}),o.qZA(),o.YNc(9,gg,2,0,"mat-error",5),o.qZA(),o.YNc(10,fg,4,0,"p",8),o.TgZ(11,"div",9),o.TgZ(12,"button",10),o.NdJ("click",function(){return t.resetData()}),o._uU(13,"Clear Fields"),o.qZA(),o.TgZ(14,"button",11),o.NdJ("click",function(){return t.onVerify()}),o._uU(15,"Verify"),o.qZA(),o.qZA(),o.YNc(16,Ag,6,4,"div",12),o.qZA(),o.qZA()),2&e&&(o.xp6(4),o.Q6J("ngModel",t.message),o.xp6(1),o.Q6J("ngIf",!t.message),o.xp6(2),o.Q6J("ngModel",t.signature),o.xp6(2),o.Q6J("ngIf",!t.signature),o.xp6(1),o.Q6J("ngIf",t.showVerifyStatus&&!t.verifyRes.valid),o.xp6(6),o.Q6J("ngIf",t.showVerifyStatus&&t.verifyRes.valid))},directives:[l.xw,l.yH,l.Wh,Ae._Y,Ae.JL,Ae.F,D.KE,Ce.Nt,Ae.Fj,Te.h,Ae.Q7,Ae.JJ,Ae.On,a.O5,q.lW,D.TO,S.Hw,M.d,Ci.y],styles:[".mat-column-channel_point[_ngcontent-%COMP%]{flex:1 1 25%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"]}),e})();var Tg=n(8016),bg=n(6013);const wg=i.Bz.forChild([{path:"",component:u,children:[{path:"",pathMatch:"full",redirectTo:"home"},{path:"home",component:oa,canActivate:[bg.QM]},{path:"wallet",component:uc,canActivate:[bg.a1]},{path:"onchain",component:_h,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"receive/utxos"},{path:"receive/:selTab",component:Sh,canActivate:[bg.QM]},{path:"send/:selTab",component:sm,data:{sweepAll:!1},canActivate:[bg.QM]},{path:"sweep/:selTab",component:sm,data:{sweepAll:!0},canActivate:[bg.QM]}]},{path:"connections",component:pa,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"channels"},{path:"channels",component:yi,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"open"},{path:"open",component:Ws,canActivate:[bg.QM]},{path:"pending",component:Jl,canActivate:[bg.QM]},{path:"closed",component:lr,canActivate:[bg.QM]},{path:"activehtlcs",component:Mr,canActivate:[bg.QM]}]},{path:"peers",component:mi,data:{sweepAll:!1},canActivate:[bg.QM]}]},{path:"transactions",component:dc,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"payments"},{path:"payments",component:Un,canActivate:[bg.QM]},{path:"invoices",component:ut,canActivate:[bg.QM]},{path:"queryroutes",component:Ic,canActivate:[bg.QM]}]},{path:"messages",component:pg,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"sign"},{path:"sign",component:hg,canActivate:[bg.QM]},{path:"verify",component:Cg,canActivate:[bg.QM]}]},{path:"channelbackup",component:Sm,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"bckup"},{path:"bckup",component:cg,canActivate:[bg.QM]},{path:"restore",component:Hm,canActivate:[bg.QM]}]},{path:"routing",component:mu,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"forwardinghistory"},{path:"forwardinghistory",component:Pu,canActivate:[bg.QM]},{path:"peers",component:Rp,canActivate:[bg.QM]}]},{path:"reports",component:Ep,canActivate:[bg.QM],children:[{path:"",pathMatch:"full",redirectTo:"routingfees"},{path:"routingfees",component:jp,canActivate:[bg.QM]},{path:"transactions",component:ud,canActivate:[bg.QM]}]},{path:"lookups",component:cu,canActivate:[bg.QM]},{path:"network",component:vm,canActivate:[bg.QM]},{path:"**",component:Tg.w},{path:"rates",redirectTo:"network"}]}]);var _g=n(253);let vg=(()=>{class e{}return e.\u0275fac=function(t){return new(t||e)},e.\u0275mod=o.oAB({type:e,bootstrap:[u]}),e.\u0275inj=o.cJS({providers:[bg.QM],imports:[[a.ez,_g.m,wg]]}),e})()}}]);